1 2013-09-29 Torbjorn Granlund <tege@gmplib.org>
3 * Version 5.1.3 released.
5 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
6 * gmp-h.in: Bump version.
8 2013-09-27 Niels Möller <nisse@lysator.liu.se>
10 * NEWS: Mention the ia64 mpn_divrem_2 bugfix.
12 2013-07-16 Torbjorn Granlund <tege@gmplib.org>
14 * doc/gmp.texi: Declare countless of function arguments as 'const'.
16 2013-07-15 Torbjorn Granlund <tege@gmplib.org>
18 * mpn/generic/sb_div_sec.c: Compute inverse as floor(B^2/(dh+1)), per
20 * mpn/generic/sbpi1_div_sec.c: Remove inverse rounding-up code.
22 2013-07-12 Torbjorn Granlund <tege@gmplib.org>
24 * mpn/generic/sbpi1_div_sec.c: Partial rewrite.
26 2013-06-19 Torbjorn Granlund <tege@gmplib.org>
28 * mpn/powerpc64/p6/lshift.asm: Rewrite switching-into-loop code.
29 * mpn/powerpc64/p6/rshift.asm: Likewise.
30 * mpn/powerpc64/p6/lshiftc.asm: Likewise.
32 2013-06-17 Torbjorn Granlund <tege@gmplib.org>
34 * mpn/powerpc64/p6/lshift.asm: Fix typo in label reference.
35 For 32-bit mode, zero extend `n' argument and split retval.
36 * mpn/powerpc64/p6/rshift.asm: Likewise.
37 * mpn/powerpc64/p6/lshiftc.asm: Likewise.
39 2013-06-09 Marc Glisse <marc.glisse@inria.fr>
41 * mpn/generic/get_d.c (mpn_get_d): Avoid signed overflow.
42 * mpz/kronzs.c (mpz_kronecker_si): Use ABS_CAST.
44 2013-05-22 Torbjorn Granlund <tege@gmplib.org>
46 * doc/gmp.texi (Reporting Bugs): Ask for configure's output.
48 * mpn/ia64/divrem_2.asm: Don't clobber f16-f18.
50 2013-05-20 Torbjorn Granlund <tege@gmplib.org>
52 * Version 5.1.2 released.
54 * mpn/arm/udiv.asm: Change spacing to work around binutils bug.
56 2013-05-16 Torbjorn Granlund <tege@gmplib.org>
58 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
59 * gmp-h.in: Bump version.
61 * tests/misc.c (tests_hardware_getround, tests_hardware_setround):
62 Avoid assembly dependency unless WANT_ASSEMBLY.
64 * configure.ac (WANT_ASSEMBLY): Conditionally define.
66 2013-05-14 Torbjorn Granlund <tege@gmplib.org>
68 * configure.ac (arm1156): Don't fall back to plain v6 compiler option.
70 2013-05-10 Torbjorn Granlund <tege@gmplib.org>
72 * mpn/x86/p6/mmx/gmp-mparam.h: Set down SQR_TOOM2_THRESHOLD to parent
75 2013-05-09 Torbjorn Granlund <tege@gmplib.org>
77 * mpn/x86_64/bd1/mul_1.asm: Fix typo.
79 2013-04-29 Torbjorn Granlund <tege@gmplib.org>
81 * configure.ac (sparc-*-*): Recognise t5 along with t3 and t4.
82 Remove sparc64/ultrasparct1 from path_64 for T3, T3, and T5.
84 2013-04-27 Mike Frysinger <vapier@gentoo.org>
86 * configure.ac (arm*-*-*): Set up path also for plainest CPU variants.
88 2013-03-19 Torbjorn Granlund <tege@gmplib.org>
90 * tests/arm32check.c: Get printing of clobbered register right.
92 * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add arm32call.asm and
95 2013-03-18 Torbjorn Granlund <tege@gmplib.org>
97 * configure.ac (arm*-*-*): Define CALLING_CONVENTIONS_OBJS.
99 * tests/arm32call.asm: New file.
100 * tests/arm32check.c: New file.
102 * mpn/arm/arm-defs.m4 (LEA): Rewrite to properly handle repeated use.
103 (EPILOGUE_cpu): Define.
105 * mpn/x86/darwin.m4 (m4append): Move definition from here...
106 * mpn/asm-defs.m4: ...to here.
108 2012-03-17 Marc Glisse <marc.glisse@inria.fr>
110 * tests/cxx/t-do-exceptions-work-at-all-with-this-compiler.cc: New file.
111 * tests/cxx/Makefile.am: Add new file. Reorder the tests.
113 2013-03-11 Torbjorn Granlund <tege@gmplib.org>
115 * tests/mpz/t-powm_ui.c: Test larger arguments.
117 * mpz/powm_ui.c (mod): Adhere to mpn_mu_div_qr's overlap requirements.
119 2013-02-25 Niels Möller <nisse@lysator.liu.se>
121 * mini-gmp/tests/t-double.c (testmain): Declare double variables
122 as volatile, to drop extended precision.
124 * mini-gmp/tests/testutils.c (testfree): New function. Use it
125 everywhere where test programs deallocate storage allocated via
126 the mini-gmp allocation functions, including uses of mpz_get_str
127 for various test failure messages.
129 2013-02-20 Niels Möller <nisse@lysator.liu.se>
131 * tests/mpq/t-get_d.c (check_random): Rewrote to make test less
132 dependent on float operations. Fixes problem with m68k-linux and
133 extended float precision.
135 2013-02-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
137 * mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
139 * mini-gmp/tests/t-reuse.c: Fix typo causing the same negation
140 condition to be applied to all operands. (See 2013-02-03, Torbjorn)
142 2013-02-17 Marc Glisse <marc.glisse@inria.fr>
144 * cxx/osdoprnti.cc: Use <stdarg.h> and <string.h> rather than <cstdarg>
145 and <cstring> (revert 2002-12-21).
147 * tests/cxx/Makefile.am: Link with libm.
148 * tests/cxx/t-ops2.cc: Comment about more tests. Use <math.h> rather
149 than <cmath> and using namespace. Don't include <iostream>.
151 2013-02-16 Marc Glisse <marc.glisse@inria.fr>
153 * gmpxx.h: Include <algorithm>.
155 2013-02-16 Torbjorn Granlund <tege@gmplib.org>
157 * mpn/x86_64/x86_64-defs.m4 (PROTECT): Emit '.hidden' instead of
158 '.protected" to please Sun's assembler, but also for semantic reasons.
160 2013-02-10 Torbjorn Granlund <tege@gmplib.org>
162 * Version 5.1.1 released.
164 2013-02-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
166 * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
167 * tune/README: Document new parameter syntax mpn_mul.<#> .
169 2013-02-06 Niels Möller <nisse@lysator.liu.se>
171 * tests/mpz/t-jac.c (check_large_quotients): Rewrote. Now uses a
172 more efficient method for generating the test inputs.
174 2013-02-05 Torbjorn Granlund <tege@gmplib.org>
176 * tests/mpn/t-div.c: Limit random dbits to avoid an infinite loop.
178 2013-02-03 Torbjorn Granlund <tege@gmplib.org>
180 * tests/mpz/reuse.c: Fix typo causing the same negation condition to be
181 applied to all operands. Fix condition for when to invoke mpz_remove.
182 Make different-size random operands.
184 2013-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
186 * mpz/remove.c: Correct the sign in case of reuse.
188 2013-02-01 Torbjorn Granlund <tege@gmplib.org>
190 * gmp-impl.h (DIGITS_IN_BASE_PER_LIMB): Add a cast.
191 (LIMBS_PER_DIGIT_IN_BASE): Likewise.
193 * tests/refmpn.c (refmpn_mul): Use toom6h instead of toom44 for the
196 2013-01-31 Torbjorn Granlund <tege@gmplib.org>
198 * mpn/generic/toom44_mul.c: Revert last change in favour of a simple
199 change (thanks Marco!).
200 * mpn/generic/toom4_sqr.c: Likewise.
202 2013-01-30 Torbjorn Granlund <tege@gmplib.org>
204 * mpn/generic/toom44_mul.c (MAYBE_mul_toom44): Take toom6h and toom8h
205 into account, using new macro MUL_NEXTALG_THRESHOLD.
206 * mpn/generic/toom4_sqr.c (MAYBE_sqr_toom4): Likewise.
208 2013-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
210 * mpz/remove.c: init+set=init_set, cast before shifting.
212 * mpz/cmp_si.c: Use ABS_CAST.
214 2013-01-26 Torbjorn Granlund <tege@gmplib.org>
216 * tests/mpn/logic.c: Set things up to always test library logops, not
217 gmp-impl.h's inlined variants. Test also mpn_com.
219 * tests/mpn/t-mod_1.c: Test also mpn_mod_1s_3p.
221 * mpn/generic/mod_1_3.c: Swap some lines to make it similar to mod_4.c.
223 * tests/mpz/reuse.c: Fix typo in last change.
225 2013-01-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
227 * mini-gmp/mini-gmp.c (mpz_cmpabs_d, mpz_cmp_d): Simplify.
228 (mpz_set_str): Behaviour more adherent to the real GMP.
230 * mini-gmp/tests/t-str.c: Cast size_t to unsigned long, for printf.
231 * mini-gmp/tests/t-import.c: Likewise.
232 * mini-gmp/tests/t-comb.c: Remove an unused var.
233 * mini-gmp/tests/t-div.c: Remove unused args passed to fprintf.
234 * mini-gmp/tests/t-double.c: Use float immediates with float vars.
236 2013-01-22 Torbjorn Granlund <tege@gmplib.org>
238 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
239 * gmp-h.in: Bump version.
241 * tests/mpz/reuse.c: Delete always zero 'failures' and code depending
242 on it. Replace rotating progress with real measure.
244 * Makefile.am (check-mini-gmp): Fix typo in last change.
246 2013-01-22 Niels Möller <nisse@lysator.liu.se>
248 * mini-gmp/mini-gmp.c (mpz_cmp_d): Simplified, just sort out
249 signs, then call mpz_cmpabs_d.
251 * mini-gmp/tests/testutils.h: Include stdio.h and stdlib.h.
252 (numberof): New define.
254 * mini-gmp/tests/t-cmp_d.c: New file, copied from
255 tests/mpz/t-cmp_d.c with minor changes.
256 * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-cmp_d,
258 * mini-gmp/mini-gmp.c (mpz_cmpabs_d): New function.
259 * mini-gmp/mini-gmp.h: Declare it.
261 2013-01-21 Niels Möller <nisse@lysator.liu.se>
263 * mini-gmp/tests/t-str.c (testmain): Test mpz_out_str, using
264 the tmpfile function for i/o.
266 2013-01-20 Torbjorn Granlund <tege@gmplib.org>
268 * Makefile.am (check-mini-gmp): Set also DYLD_LIBRARY_PATH for the
271 * tests/mpn/t-div.c: Test mpn_sb_div_qr_sec and mpn_sb_div_r_sec.
272 (main): Separate divisor into normalised (dnp) and unnormalised (dup),
273 pass appropriate variant to each function.
274 (main): Make negative `test' index value mean divisor bits, for better
275 small operands coverage.
276 (main): Put random junk at qp[] instead of zeroing.
278 * tests/mpz/t-remove.c: Back out last change which left `divisor_size'
279 uninitialised; achieve change's aim with a parameter tweak.
281 2013-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
283 * mini-gmp/tests/testutils.c (testhalves): New function, test default
285 * mini-gmp/tests/testutils.h (testhalves): Declare it
286 * mini-gmp/tests/t-logops.c: Use testhalves.
288 * mini-gmp/mini-gmp.c (mpz_init_set_str): New function.
289 * mini-gmp/mini-gmp.h (mpz_init_set_str): Declare it.
290 * mini-gmp/tests/t-str.c: Test mpz_init_set_str.
292 2013-01-20 Torbjorn Granlund <tege@gmplib.org>
294 * tests/memory.c (PTRLIMB): New macro, used for conformant casting.
296 2013-01-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
298 * mini-gmp/tests/t-double.c (testmain): Get the current free
299 function using mp_get_memory_functions.
300 * mini-gmp/tests/t-str.c (testmain): Likewise.
302 * mini-gmp/tests/testutils.h (tu_free): Remove declaration.
304 * mini-gmp/tests/testutils.c (block_check, tu_free): Mark static.
306 * tests/mpz/t-set_str.c: Check also failing conditions.
308 * tests/mpz/t-remove.c: Test removal of 1.
310 2013-01-18 Niels Möller <nisse@lysator.liu.se>
312 * mini-gmp/tests/t-str.c (test_small): New function, exercising
313 parsing of whitespace and base prefixes.
316 * mini-gmp/tests/t-gcd.c (gcdext_valid_p): Fixed memory leak.
318 * mini-gmp/tests/t-double.c (testmain): Call tu_free rather than
319 free, for storage allocated by mpz_get_str.
320 * mini-gmp/tests/t-str.c (testmain): Likewise.
322 * mini-gmp/tests/testutils.c (block_init, block_check): New
324 (tu_alloc, tu_realloc, tu_free): New functions.
325 (main): Use mp_set_memory_functions.
326 * mini-gmp/tests/testutils.h (tu_free): Declare.
328 * mini-gmp/tests/testutils.h: New file, declarations for test
331 * mini-gmp/tests/testutils.c (main): New file, with shared main
332 function for all the test programs. Also includes mini-gmp.c.
333 Calls testmain after initialization. All other test programs
334 updated to define testmain rather than main.
336 2013-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
338 * mini-gmp/tests/t-signed.c: Slightly larger coverage.
339 * mini-gmp/tests/t-double.c: Test also mpz_init_set_d.
341 2013-01-18 Torbjorn Granlund <tege@gmplib.org>
343 * mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
346 * mini-gmp/tests/t-div.c: Test mpz_divisible_p and mpz_divisible_ui_p.
348 * tests/tests.h (TESTS_REPS): Fix printf argument type clashes.
350 * mini-gmp/tests/t-div.c: Test also mpz_mod, mpz_mod_ui. Compare
351 mpz_divisible_p just to ceil, to save time.
353 * mini-gmp/mini-gmp.c: Prefix some names with GMP_.
355 2013-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
357 * mini-gmp/tests/t-double.c: Test mpz_cmp_d.
358 * mini-gmp/mini-gmp.c (mpz_cmp_d): Correct multiword comparison.
360 * mini-gmp/mini-gmp.c (mpz_set_str): Handle the empty string.
361 * mini-gmp/tests/t-str.c: Test base <= 0.
363 2013-01-15 Niels Möller <nisse@lysator.liu.se>
365 * mini-gmp/tests/t-str.c (main): Use x->_mp_d rather than x[0]._mp_d.
366 * mini-gmp/tests/t-invert.c (main): Likewise.
368 * mini-gmp/tests/t-mul.c (main): Test mpn_mul_n and mpn_sqr.
370 * mini-gmp/tests/hex-random.h (enum hex_random_op): New value
373 * mini-gmp/tests/mini-random.c (mini_random_op3): Renamed, from...
374 (mini_random_op): ... old name. Updated callers.
375 (mini_random_op2): New function.
377 * mini-gmp/tests/hex-random.c (hex_random_op3): Renamed, from...
378 (hex_random_op): ... old name. Updated callers.
379 (hex_random_op2): New function.
381 2013-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
383 * mini-gmp/tests/t-logops.c: Improve popcount/hamdist testing.
384 * mini-gmp/tests/t-signed.c: Test more cases.
386 2013-01-15 Torbjorn Granlund <tege@gmplib.org>
389 * configure.ac: Add x32 ABI for x86_64.
391 2013-01-14 Niels Möller <nisse@lysator.liu.se>
393 * mini-gmp/tests/t-str.c (main): Added tests for mpn_get_str and
396 2013-01-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
398 * doc/gmp.texi (gmp_version): Remove "was used" repetition.
399 (Upward compatibility): Mention mpn_bdivmod, GMP 4 -> GMP 5.
401 2013-01-13 Marc Glisse <marc.glisse@inria.fr>
403 * doc/gmp.texi: Let mpn_sqrtrem reference mpn_perfect_square_p instead
404 of mpz_perfect_square_p.
406 2013-01-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
408 * mini-gmp/tests/t-comb.c: New test program, testing both
409 mpz_fac_ui and mpz_bin_uiui.
410 * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-comb.
412 * mini-gmp/mini-gmp.c (mpz_mul_si): Simplify.
413 (mpz_mul_ui, mpz_mul, mpz_div_qr): Replace init+REALLOC with init2.
415 * mini-gmp/mini-gmp.c (NEG_CAST): New macro.
416 (mpz_mul_si, mpz_set_si, mpz_cmp_si): Use NEG_CAST.
418 * mini-gmp/mini-gmp.c (mpz_set_si, mpz_cmp_si): Simplify by using
421 * mini-gmp/tests/t-root.c: Use mpz_ui_pow_ui, when base fits an ui.
423 * mini-gmp/tests/t-mul.c: Test also mpz_mul_si.
424 * mini-gmp/tests/t-sub.c: Test also mpz_ui_sub.
426 * mini-gmp/mini-gmp.c (mpz_fits_slong_p): Correct range.
427 * mini-gmp/tests/t-signed.c: New test program, for get/set/cmp_si.
428 * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-signed.
430 * mini-gmp/mini-gmp.c (mpz_hamdist): Handle different sizes.
431 * mini-gmp/tests/t-logops.c: Test also popcount and hamdist.
433 2013-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
435 * mpz/export.c: Less restrictive ASSERTs.
436 * mini-gmp/mini-gmp.c (mpz_export, mpz_import): Likewise.
437 * mini-gmp/tests/t-import.c: Test also size=0 or count=0.
439 2013-01-10 Torbjorn Granlund <tege@gmplib.org>
441 * mini-gmp/tests/t-import.c (main): Don't drop off functon end.
443 * Makefile.am (check-mini-gmp): Set LD_LIBRARY_PATH to allow testing
444 with dynamic main GMP build.
446 2013-01-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
448 * mini-gmp/mini-gmp.c (mpz_export): Support op=0 countp=NULL.
450 2013-01-08 Niels Möller <nisse@lysator.liu.se>
452 * mini-gmp/tests/t-import.c: New test program, testing both
453 mpz_import and mpz_export.
454 * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-import.
456 * mini-gmp/tests/mini-random.c (mini_rrandomb_export): New
458 * mini-gmp/tests/mini-random.h: Declare it.
459 * mini-gmp/tests/hex-random.c (hex_rrandomb_export): New function.
460 * mini-gmp/tests/hex-random.h: Declare it.
462 * mini-gmp/mini-gmp.c (mpz_export): Compute accurate word count up
463 front, to avoid generating any high zero words.
465 2013-01-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
467 * mini-gmp/README: Document base limitation for conversions.
468 * mini-gmp/mini-gmp.c (mpz_set_str): Remove goto.
469 (mpz_import, mpz_export): Correctly use order/endianess.
471 2013-01-05 Torbjorn Granlund <tege@gmplib.org>
473 * longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.
475 2013-01-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
478 * mini-gmp/mini-gmp.c (mpz_import): Reset limb after storing it.
480 2013-01-04 Torbjorn Granlund <tege@gmplib.org>
482 From Marko Lindqvist:
483 * configure.ac: Use AC_CONFIG_HEADERS instead of the obsolete
486 2013-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
488 * tests/mpz/bit.c: Wider testing for mpz_combit.
489 * tests/mpz/logic.c: Check the -2^n case.
491 * mpz/ior.c: Fixed an allocation bug in the -2^n case.
493 2012-12-31 Torbjorn Granlund <tege@gmplib.org>
495 * mpn/generic/get_d.c: Minor reorg, add vax D code.
497 * gmp-impl.h (double_extract): New union type for vax D floats.
499 * tests/mpq/t-get_d.c (check_random): Limit exponents on vax.
501 2012-12-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
503 * tests/mpz/bit.c (check_clr_extend): Check _set shrink.
505 2012-12-29 Torbjorn Granlund <tege@gmplib.org>
507 * demos/calc/calc.c: Remove generated file from repo.
508 * demos/calc/calc.h: Likewise.
509 * demos/calc/calclex.c: Likewise.
511 2012-12-27 Torbjorn Granlund <tege@gmplib.org>
513 * mpn/generic/get_d.c: Complete rewrite of non-IEEE code.
515 * tests/mpq/t-get_d.c (main): Suppress check_random for vax.
517 2012-12-25 Torbjorn Granlund <tege@gmplib.org>
519 * mpn/x86_64/bdiv_q_1.asm: Use LEA for binvert_limb_table.
521 2012-12-23 Torbjorn Granlund <tege@gmplib.org>
523 * tests/mpz/t-get_d.c (check_onebit): Decrease vax limit to avoid
524 overflow in last, unused 'want' value.
526 * config.guess: Recognise AMD family 22 as a future bobcat.
528 2012-12-21 Torbjorn Granlund <tege@gmplib.org>
530 * configure.ac: Rename configure.in.
532 2012-12-17 Torbjorn Granlund <tege@gmplib.org>
534 * Version 5.1.0 released.
536 * configure.in (none-*-*): Allow this again, but print a warning.
538 2012-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
540 * mpz/n_pow_ui.c: Fix typos in an ASSERT.
542 2012-12-16 Torbjorn Granlund <tege@gmplib.org>
544 * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr): Explicitly use
545 MPN_COPY_INCR for slightly overlapping copy.
547 2012-12-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
549 * tests/mpn/toom-sqr-shared.h: Skip ALLOCs if the test is skipped.
551 2012-12-13 Torbjorn Granlund <tege@gmplib.org>
553 * mpn/x86_64/dos64.m4 (PIC): Move definition early.
554 (JMPENT): Remove PIC variant.
556 * mpn/x86_64/darwin.m4 (JUMPTABSECT): Define to .text, instead of
559 2012-12-12 Torbjorn Granlund <tege@gmplib.org>
561 * mpn/x86_64/x86_64-defs.m4 (JMPENT): New macro.
562 * mpn/x86_64/dos64.m4: Likewise.
563 * mpn/x86_64/darwin.m4: Likewise.
564 * mpn/x86_64/mod_34lsub1.asm: Use JMPENT to properly support PIC.
565 * mpn/x86_64/mullo_basecase.asm: Likewise.
566 * mpn/x86_64/sqr_basecase.asm: Likewise.
568 2012-12-11 Torbjorn Granlund <tege@gmplib.org>
570 * mpn/x86_64/mod_34lsub1.asm: Try different jump table for the benefit
571 of broken Apple linkers.
573 2012-12-09 Torbjorn Granlund <tege@gmplib.org>
575 * configure.in: Make GMP_NONSTD_ABI ABI specific.
577 2012-12-08 Torbjorn Granlund <tege@gmplib.org>
579 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
580 * gmp-h.in: Bump version.
582 2012-12-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
584 * tests/mpq/reuse.c: New test (adapted from mpf/reuse.c).
585 * tests/mpq/Makefile.am (check_PROGRAMS): Add reuse.
587 * mpz/abs.c: Use NEWALLOC.
588 * mpz/neg.c: Likewise.
589 * mpz/com.c: Reduce branches.
591 2012-12-05 Niels Möller <nisse@lysator.liu.se>
593 * mpn/generic/brootinv.c (mpn_brootinv): Make valgrind happier, at
594 the cost of a redundant MPN_ZERO.
596 * mpz/jacobi.c (mpz_jacobi): Check for asize == 0 or bsize == 0
597 before using the low limbs.
599 2012-12-05 Torbjorn Granlund <tege@gmplib.org>
601 * mpn/generic/set_str.c (mpn_dc_set_str): Work around a valgrind issue.
603 * mpz/powm_ui.c: Don't assume >= 2 limbs in mod argument.
605 * tests/tests.h (TESTS_REPS): Handle float GMP_CHECK_REPFACTOR.
607 * longlong.h: Refine cpp test for vax.
608 * tests/mpn/t-get_d.c: Likewise.
609 * tests/mpz/t-get_d.c: Likewise.
610 * tests/mpz/t-cmp_d.c: Likewise.
611 * tests/mpz/t-get_d.c: Likewise.
612 * tests/mpq/t-get_d.c: Likewise.
613 * tests/mpf/t-get_d.c: Likewise.
615 2012-11-30 Torbjorn Granlund <tege@gmplib.org>
617 * gen-fac.c (gen_consts): Correct printf types.
619 * mpn/arm/v7a/cora15/gmp-mparam.h: New file.
621 * configure.in (arm*-*-*): New compiler optional "tune". Pass value for
622 selected processors. Add more specific path components.
624 2012-11-29 Torbjorn Granlund <tege@gmplib.org>
626 From Andoni Morales Alastruey:
627 * longlong.h: Conditionalise ARM asm on !__thumb__.
629 2012-11-28 Torbjorn Granlund <tege@gmplib.org>
631 * config.guess (arm*-*-*): Support specific ARM processors.
632 * config.sub: Match arm CPUs.
633 * configure.in (arm*-*-*): Likewise.
635 * mpz/powm.c: Move new_b out since it lives on through b.
637 * configure.in (arm*-*-*): Pass -marm to deal with compilers defaulting
640 2012-11-26 Torbjorn Granlund <tege@gmplib.org>
642 * tests/cxx/t-ops2.cc (checkz): Reduce huge numbers to avoid vax
645 2012-11-25 Torbjorn Granlund <tege@gmplib.org>
647 * mpn/generic/get_d.c: Reinsert non-IEEE code.
649 * mpn/vax/add_n.asm: New file.
650 * mpn/vax/add_n.s: Remove.
651 * mpn/vax/addmul_1.asm: New file.
652 * mpn/vax/addmul_1.s: Remove.
653 * mpn/vax/lshift.asm: New file.
654 * mpn/vax/lshift.s: Remove.
655 * mpn/vax/mul_1.asm: New file.
656 * mpn/vax/mul_1.s: Remove.
657 * mpn/vax/rshift.asm: New file.
658 * mpn/vax/rshift.s: Remove.
659 * mpn/vax/sub_n.asm: New file.
660 * mpn/vax/sub_n.s: Remove.
661 * mpn/vax/submul_1.asm: New file.
662 * mpn/vax/submul_1.s: Remove.
664 * mpn/vax/elf.m4: New file.
665 * configure.in (vax*-*-*elf*): New case, grabbing vax/elf.m4.
667 * tests/mpn/t-get_d.c (check_onebit): Get vax bounds right.
668 (main): Switch off check_rand for vax.
670 2012-11-22 Niels Möller <nisse@lysator.liu.se>
672 * mini-gmp/tests/run-tests: Copied latest version from GNU Nettle.
673 Minor fix to the use of $EMULATOR, and proper copyright notice.
675 2012-11-16 Torbjorn Granlund <tege@gmplib.org>
677 * mpn/generic/powm_sec.c (redcify): Use mpn_sb_div_r_sec.
679 * mpn/generic/sb_div_sec.c: New file.
680 * mpn/generic/sbpi1_div_sec.c: New file.
681 * configure.in (gmp_mpn_functions): Add new files.
682 * gmp-impl.h: Declare new functions.
684 2012-11-12 Torbjorn Granlund <tege@gmplib.org>
686 * longlong.h: Add ARM64 support.
687 * longlong.h: Add AVR support.
689 * mpn/powerpc64/mode64/divrem_1.asm: Tune, simplify.
691 * mpq/md_2exp.c: Use MPN_COPY_INCR, not MPN_COPY_DECR.
692 * tests/mpq/t-md_2exp.c (check_random): New function.
694 2012-11-10 Torbjorn Granlund <tege@gmplib.org>
696 * mpn/generic/remove.c (mpn_bdiv_qr_wrap): Make static.
698 2012-11-04 Torbjorn Granlund <tege@gmplib.org>
700 * mpz/powm_ui.c: Rewrite.
702 2012-11-01 Niels Möller <nisse@lysator.liu.se>
704 * mpn/generic/brootinv.c (mpn_brootinv): Input size in limbs
705 rather than bits. Use single-precision iterations for the first
707 * mpn/generic/perfpow.c (is_kth_power): Update mpn_brootinv call.
708 * tests/mpn/t-brootinv.c (main): Likewise.
709 * tune/speed.h (SPEED_ROUTINE_MPN_BROOTINV): Likewise.
710 * gmp-impl.h (mpn_brootinv): Updated prototype.
712 * mpn/generic/hgcd2.c (mpn_hgcd2): Removed redundant loop exit
713 tests in the single-precision loop.
715 * mpz/combit.c (mpz_combit): Rewrite, optimizing for the common
718 2012-10-31 Niels Möller <nisse@lysator.liu.se>
720 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-brootinv.
721 * tests/mpn/t-brootinv.c: New file
723 * mpn/generic/broot.c (mpn_broot_invm1): Avoid a mullo_n in the
724 loop, and do powering as a plain mpn_sqr followed by mpn_powlo.
726 * tune/speed.c (routine): Added mpn_broot, mpn_broot_invm1,
729 * tune/common.c (speed_mpn_broot, speed_mpn_broot_invm1)
730 (speed_mpn_brootinv): New functions.
731 * tune/speed.h (SPEED_ROUTINE_MPN_BROOT)
732 (SPEED_ROUTINE_MPN_BROOTINV): New macros.
734 * mpn/generic/broot.c (mpn_broot_invm1): Made non-static (mainly
736 * gmp-impl.h (mpn_broot_invm1): Declare it.
738 2012-10-28 Torbjorn Granlund <tege@gmplib.org>
740 * configure.in (gmp_mpn_functions): Add new files.
741 * gmp-impl.h: Declare new functions.
742 * mpn/generic/perfpow.c: Overhaul.
743 (binv_root, binv_sqroot): Remove.
744 * mpn/generic/brootinv.c: New file, code from overhauled binv_root.
745 * mpn/generic/bsqrtinv.c: New file, code from overhauled binv_sqroot.
746 * mpn/generic/bsqrt.c: New file.
748 * tests/mpn/t-broot.c: Add a forgotten TMP_MARK.
750 2012-10-28 Niels Möller <nisse@lysator.liu.se>
752 * mpn/generic/broot.c (mpn_broot): New file and function.
753 * configure.in (gmp_mpn_functions): Add broot.
754 * gmp-impl.h (mpn_broot): Declare.
755 * tests/mpn/t-broot.c: New testcase.
756 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-broot.
758 2012-10-27 Torbjorn Granlund <tege@gmplib.org>
760 * mpn/generic/remove.c: Get remainder allocation right.
762 2012-10-25 Torbjorn Granlund <tege@gmplib.org>
764 * longlong.h: De-support old POWER asm syntax.
766 * tests/mpz/t-remove.c: Run more tests, but use a tad smaller operands.
768 * mpn/generic/remove.c (mpn_bdiv_qr_wrap): New function.
769 (mpn_remove): Call mpn_bdiv_qr_wrap.
770 * mpz/remove.c: Enable suppressed mpn_remove call.
772 2012-10-17 Torbjorn Granlund <tege@gmplib.org>
774 * mpz/powm_ui.c (mpz_powm_ui): Deflect to mpz_powm for large exponent.
776 2012-09-10 Torbjorn Granlund <tege@gmplib.org>
778 * demos/factorize.c: Rewrite no more current form. Implement Lucas
779 prime proving, and make its use the default.
780 * demos/primes.h: New file.
782 2012-08-24 Torbjorn Granlund <tege@gmplib.org>
784 * demos/factorize.c: Overhaul.
786 2012-08-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
788 * doc/gmp.texi (mpn_neg): Correctly document returned type.
790 * gmp-impl.h (_mpz_newalloc, log_n_max): mark with inline (spotted by Niels).
792 2012-07-28 Marc Glisse <marc.glisse@inria.fr>
794 * gmpxx.h (std::common_type): New partial specializations with builtin
796 * tests/cxx/t-cxx11.cc: Test it.
798 2012-07-21 Torbjorn Granlund <tege@gmplib.org>
800 * mpn/powerpc32/vmx/mod_34lsub1.asm: Fix r0 clobbering issue with
801 "large" code affecting elf+darwin PIC.
803 2012-07-21 Marc Glisse <marc.glisse@inria.fr>
805 * gmpxx.h (__GMPXX_CONSTANT): Disable for g++-3.4.
807 2012-06-26 Torbjorn Granlund <tege@gmplib.org>
809 * Makefile.am (LIBMP_LT_*): Remove these.
811 2012-06-26 Marc Glisse <marc.glisse@inria.fr>
813 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Update comment for 5.1.0.
815 2012-06-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
817 * configure.in (CALLING_CONVENTIONS_OBJS): Disable any use of
818 assembly code with the --disable-assembly option.
819 * mpz/oddfac_1.c: Use the ASSERT_CODE macro.
820 * gen-trialdivtab.c (mpz_log2): Use mpz_sizeinbase (., 2).
822 * gmp-impl.h (MPN_SIZEINBASE_16): Replace with MPN_SIZEINBASE_2EXP
824 * mpz/export.c (MPN_SIZEINBASE_2EXP): Removed.
825 * mpn/generic/sizeinbase.c: Use MPN_SIZEINBASE.
827 * mpz/nextprime.c: Use MPN_SIZEINBASE_2EXP to count bits.
828 * mpn/generic/perfpow.c: Likewise.
829 * mpn/generic/rootrem.c: Likewise.
830 * mpz/get_d_2exp.c: Likewise.
831 * mpn/generic/powm_sec.c: Likewise, nailify.
832 * mpn/generic/powlo.c: Likewise.
833 * mpn/generic/powm.c: Likewise.
835 * mini-gmp/mini-gmp.c (mpz_div_r_2exp, mpz_div_q_2exp): Improve
836 adjustment condition.
838 2012-06-23 Marc Glisse <marc.glisse@inria.fr>
840 * gmpxx.h (numeric_limits): Make content public.
841 * cxx/limits.cc: New file, proper declarations.
842 * Makefile.am: List new file.
843 * cxx/Makefile.am: Likewise.
844 * cxx/t-misc.cc: Add minimal test for numeric_limits.
846 2012-06-09 Marc Glisse <marc.glisse@inria.fr>
848 * gmpxx.h (__gmp_resolve_expr::srcptr_type): New typedef.
849 (__gmp_temp): Wrapper for mp*_class, the constructor copies the
850 precision of its second argument for mpf_t.
851 (__gmp_expr::eval(p, prec)): Remove.
852 (__gmp_expr::eval(p)): Use __gmp_temp.
853 (__gmp_set_expr): Never pass prec to eval().
855 2012-06-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
857 * gmp-impl.h (__GMP_WITHIN_CONFIGURE): Use the same #if as in gmp-h.in.
858 (MPN_NORMALIZE_NOT_ZERO): Tighter ASSERT.
859 (MPZ_NEWALLOC): New macro.
860 * mpq: Use the new macro when possible.
861 * mpz/bin_uiui.c: Likewise.
862 * mpz/oddfac_1.c: Likewise.
863 * mpz/prodlimbs.c: Likewise.
865 * mini-gmp/mini-gmp.c (mpz_realloc): remove a branch.
867 2012-06-04 Torbjorn Granlund <tege@gmplib.org>
869 * mpn/powerpc64/aix.m4 (ASM_START): Claim machine type "any".
871 2012-06-03 Niels Möller <nisse@lysator.liu.se>
873 * mpn/generic/gcdext.c (mpn_gcdext): Deleted code for handling
874 impossible case u1 == 0, Simplified test for unlikely case u0 == 0.
876 2012-06-02 Torbjorn Granlund <tege@gmplib.org>
878 * mpn/arm/lshiftc.asm: New file.
880 2012-06-01 Torbjorn Granlund <tege@gmplib.org>
882 * mpn/arm/aorslsh1_n.asm: Use cmp/cmn instead of subs/adds in more
885 * mpz/get_str.c: Don't strip leading zeros since current mpn_get_str
886 won't generate any. Misc streamlining.
887 * mpz/out_str.c: Analogous changes.
889 * tests/mpz/io.c: Use a wider range of bases.
891 * tests/mpz/t-cong.c (check_random): Rewrite random generation for
892 exponentially distributed operand sizes.
894 2012-06-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
896 * mpq: Use more macros and MPZ_REALLOC return value when possible.
898 * gmp-impl.h (LIMBS): Removed, was an alias for PTR.
899 * mpz/combit.c: Use PTR and CNST_LIMB.
901 * tests/mpn/t-bdiv.c: Test also mpn_bdiv_qr.
902 * mpn/generic/bdiv_qr.c: Add an ASSERT.
904 * mpn/generic/remove.c: Add a zero limb to use bdiv_qr...
906 2012-05-31 Marc Glisse <marc.glisse@inria.fr>
908 * gmpxx.h (mpq_class::mpq_class): Handle mpq_class(0,1).
909 * tests/cxx/t-constr.cc: Test it.
911 2012-05-30 Torbjorn Granlund <tege@gmplib.org>
913 * mpn/x86_64 (FUNC_ENTRY): New name for DOS64_ENTRY.
914 * mpn/x86_64 (FUNC_EXIT): New name for DOS64_EXIT.
916 2012-05-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
918 * mpz/remove.c: Optimise branches.
920 * mpn/generic/toom6h_mul.c: less branches in the LIKELY balanced path.
921 * mpn/generic/toom8h_mul.c: Likewise.
923 2012-05-29 Torbjorn Granlund <tege@gmplib.org>
925 * mpn/arm/v5/mod_1_1.asm: New file.
927 2012-05-28 Niels Möller <nisse@lysator.liu.se>
929 * mpn/generic/gcdext.c (compute_v): Simplified carry handling a
930 bit, reduced stated scratch need from 2n+1 to 2n. Also comment and
933 2012-05-27 Torbjorn Granlund <tege@gmplib.org>
935 * config.guess: Add new x86 CPUs.
936 * mpn/x86/fat/fat.c: Likewise.
937 * mpn/x86_64/fat/fat.c: Likewise.
939 2012-05-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
941 * mpn/x86_64/fat/fat.c: abort iff longmode-capable-bit is turned off.
943 * mpn/generic/toom8h_mul.c: mark UNLIKELY branches.
945 2012-05-26 Torbjorn Granlund <tege@gmplib.org>
947 * mpz: Use MPZ_REALLOC return value when possible.
949 2012-05-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
951 * mini-gmp/tests/t-div.c: Test all _qr, _q, _r variants.
952 * mini-gmp/tests/t-lcm.c: Test the _ui variant.
954 * mini-gmp/mini-gmp.c (mpz_mod, mpz_mod_ui): New functions.
955 * mini-gmp/mini-gmp.h (mpz_mod, mpz_mod_ui): Prototypes.
957 * mpz/scan1.c: Simplify, and add a shortcut for scan1(z, 0).
959 2012-05-24 Torbjorn Granlund <tege@gmplib.org>
961 * mpz/n_pow_ui.c: Cast non-limb count_leading_zeros argument.
963 2012-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
965 * mpz/remove.c: Support negative divisor.
966 * tests/mpz/t-remove.c: Test negative divisor.
968 2012-05-23 Torbjorn Granlund <tege@gmplib.org>
970 * tests/mpz/reuse.c: Major rewrite.
972 2012-05-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
974 * mpz/sqrt.c: Further simplify.
975 * mpz/sqrtrem.c: Likewise.
977 * Mark failing branches with UNLIKELY. Many files affected.
979 2012-05-22 Torbjorn Granlund <tege@gmplib.org>
981 * mpz/sqrt.c: Allocate less for overlapping operands, simplify.
982 * mpz/sqrtrem.c: Likewise.
984 2012-05-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
986 * mpn/generic/toom8_sqr.c: Reduce branches for recursion.
987 * mpn/generic/toom8h_mul.c: Likewise.
989 * tests/mpn/t-toom8h.c: Don't use GMP_NUMB_BITS when not yet defined.
991 2012-05-20 Torbjorn Granlund <tege@gmplib.org>
993 * tests/mpz/t-gcd.c: Rewrite.
995 2012-05-19 Torbjorn Granlund <tege@gmplib.org>
997 * tests/mpz/t-gcd.c: Generate larger operands for better gcd code
998 coverage; distribute size exponentially.
1000 2012-05-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
1002 * mpf/pow_ui.c: Simplify.
1003 * tests/mpf/reuse.c (dsi_func): Exercise pow_ui.
1005 * tests/mpf/t-set_ui.c (check_data): LONG_HIGHBIT -> ULONG_HIGHBIT.
1006 * tests/mpf/t-set.c (check_random): New check, both set and init_set.
1008 * tests/cxx/t-ops.cc (check_mpq): Check squaring.
1009 * tests/mpq/t-equal.c (check_various): Check different den-size.
1011 * mpn/generic/mullo_n.c: Disable MAYBE_ if WANT_FAT_BINARY.
1012 * mpz/cmpabs_d.c: Remove an unused branch.
1014 * tests/mpz/t-get_d_2exp.c (check_zero): New check.
1015 * tests/mpz/t-inp_str.c: A few more cases.
1016 * tests/mpz/t-cmp_d.c: More bases and symbols, a few cases.
1018 * mpz/rootrem.c: Correctly handle odd roots of negatives.
1019 * tests/mpz/t-root.c: Test it.
1021 2012-05-16 Torbjorn Granlund <tege@gmplib.org>
1023 * tests/mpf/t-eq.c (check_random): New function, meat from old main().
1024 (check_data): New function.
1026 2012-05-13 Torbjorn Granlund <tege@gmplib.org>
1028 * mpn/arm/rsh1aors_n.asm: New file.
1029 * mpn/arm/v5/mod_1_2.asm: New file.
1031 2012-05-11 Marc Glisse <marc.glisse@inria.fr>
1033 * gmpxx.h (explicit operator bool): New functions.
1034 * tests/cxx/t-cxx11.cc: Test the above.
1036 2012-05-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
1038 * gmp-impl.h (__gmpn_cpuvec_initialized): Was __gmpn_cpuvec.initialized
1039 * mpn/x86/fat/fat.c: Use separated _initialized variable.
1040 * mpn/x86_64/fat/fat.c: Likewise.
1041 * tests/mpn/t-fat.c: Likewise.
1043 * mpn/generic/toom2_sqr.c: Override global __gmpn_cpuvec_initialized.
1044 * mpn/generic/toom22_mul.c: Likewise.
1045 * mpn/generic/toom3_sqr.c: Likewise.
1046 * mpn/generic/toom33_mul.c: Likewise.
1048 2012-05-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
1050 * mini-gmp/mini-gmp.c: merge mpz_rootrem and mpz_sqrtrem.
1052 * mpn/generic/sqrtrem.c (invsqrttab): Reduce size removing common byte.
1054 * mpz/bin_uiui.c (mul3, mul4, mul8): Remove unneeded shifts.
1055 (MAXFACS): Redefine, using the shared (safer) log_n_max.
1057 2012-05-08 Torbjorn Granlund <tege@gmplib.org>
1059 * mpn/minithres/gmp-mparam.h (REDC_1_TO_REDC_N_THRESHOLD): Up to 9, for
1060 coherency with ASSERT in mpn/generic/redc_n.c.
1062 2012-05-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
1064 * mpn/minithres/gmp-mparam.h: Updated TOOM6 and FAC_DSC.
1065 * tests/mpn/toom-sqr-shared.h: Don't test if no range.
1067 * mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.
1068 * tune/tuneup.c: Update minimal threshold for FAC_DSC.
1070 2012-05-06 Torbjorn Granlund <tege@gmplib.org>
1072 * mpn/arm/v6/sqr_basecase.asm: Simplify n=4 code.
1074 2012-05-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
1076 * mpn/generic/invert.c: Mark a branch UNLIKELY.
1077 * tune/tuneup.c (tune_fac_u): Update DSC_THRESHOLD minimum.
1078 * gmp-impl.h (FAC_???_THRESHOLD): Update default values.
1079 (ABOVE_THRESHOLD): New definition with __builtin_constant_p.
1081 * mpn/generic/toom22_mul.c: Disable MAYBE_ if WANT_FAT_BINARY.
1082 * mpn/generic/toom33_mul.c: Likewise.
1083 * mpn/generic/toom2_sqr.c: Likewise.
1084 * mpn/generic/toom3_sqr.c: Likewise.
1086 2012-05-04 Torbjorn Granlund <tege@gmplib.org>
1088 * tune/tuneup.c: Measure POWM_SEC_TABLE after the REDC thresholds.
1090 2012-05-03 Torbjorn Granlund <tege@gmplib.org>
1092 * mpn/generic/powm_sec.c: Use redc_2.
1093 (INNERLOOP): Use this mechanism, like plain powm.c.
1094 (WANT_CACHE_SECURITY): Remove, feature now unconditional.
1096 2012-05-02 Torbjorn Granlund <tege@gmplib.org>
1098 * mpz/bin_uiui.c: Make use of CNST_LIMB.
1100 2012-05-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
1102 * mpz/mfac_uiui.c: Support limb != ui.
1104 2012-05-02 Torbjorn Granlund <tege@gmplib.org>
1106 * mpn/arm/logops_n.asm: Work around register clobbering issue.
1108 * mpn/arm/aorscnd_n.asm: New file.
1110 2012-05-01 Torbjorn Granlund <tege@gmplib.org>
1112 * configure.in: Put arm dirs in path in proper prio order.
1114 * mpn/arm/logops_n.asm: New file.
1116 * mpz/2fac_ui.c: Fix assumed typo.
1118 * mpn/arm/v6/gmp-mparam.h: New file.
1120 * mpn/arm/v5/gcd_1.asm: Hack for undefined BMOD_1_TO_MOD_1_THRESHOLD.
1121 * mpn/arm/v6t2/gcd_1.asm: Likewise.
1123 2012-04-30 Torbjorn Granlund <tege@gmplib.org>
1125 * mpn/arm/v6/sqr_basecase.asm: New file.
1127 2012-04-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
1129 * mpn/generic/comb_tables.c: New file.
1130 * configure.in: Add it.
1131 * gen-fac.c: Define table limits.
1132 * gmp-impl.h: Declare tables.
1133 (log_n_max): New static function.
1134 * mpz/2fac_ui.c: Use shared tables.
1135 * mpz/bin_uiui.c: Likewise.
1136 * mpz/oddfac_1.c: Likewise.
1137 * mpz/primorial_ui.c: Likewise.
1139 * mpz/mfac_uiui.c: New file.
1140 * Makefile.am: Compile it.
1141 * mpz/Makefile.am (libmpz_la_SOURCES): Add mpz_mfac_uiui.c
1142 * gmp-h.in (mpz_mfac_uiui): Declare.
1144 * tests/mpz/t-mfac_uiui.c: New file.
1145 * tests/mpz/Makefile.am: Run it.
1147 * doc/gmp.texi: Document mpz_mfac_uiui, collapsing with other factorial functions.
1149 * tests/mpz/t-lcm.c: Test zero too.
1151 * mpz/prodlimbs.c: Simplify threshold (should be tuned, not guessed).
1153 2012-04-29 Torbjorn Granlund <tege@gmplib.org>
1155 * mpn/arm/aors_n.asm: Tune for more stable performance.
1157 * mpn/arm/aorslsh1_n.asm: New file.
1159 * mpn/arm/mod_34lsub1.asm: New file.
1161 * mpn/arm/v6t2/divrem_1.asm: New file.
1163 2012-04-28 Torbjorn Granlund <tege@gmplib.org>
1165 * mpn/thumb/add_n.asm: New file.
1166 * mpn/thumb/sub_n.asm: New file.
1167 * mpn/thumb/add_n.s: Remove broken code.
1168 * mpn/thumb/sub_n.s: Likewise.
1170 * mpn/arm/v6/addmul_1.asm: Rewrite for stable speed, smaller size.
1171 * mpn/arm/v6/mul_1.asm: Likewise.
1173 2012-04-27 Torbjorn Granlund <tege@gmplib.org>
1175 * configure.in: Search arm/v6t2 for arm7.
1177 * mpn/arm/v5/gcd_1.asm: New file.
1178 * mpn/arm/v6t2/gcd_1.asm: New file.
1180 * mpn/arm/mode1o.asm: New file.
1181 * mpn/arm/v6t2/mode1o.asm: New file.
1183 * mpn/arm/arm-defs.m4 (LEA): New define.
1184 * mpn/arm/invert_limb.asm: Use LEA.
1186 2012-04-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1188 * mpz/bin_uiui.c (bc_bin_uiui): Nail support.
1189 * tests/cxx/t-ops2.cc: Test 0/3.
1190 * oddfac_1.c: assume n > 26.
1191 * tests/mpz/t-jac.c (mpn_jacobi_n): Enlarge tested sizes.
1193 2012-04-24 Torbjorn Granlund <tege@gmplib.org>
1195 * mpn/arm/v6/addmul_2.asm: New file.
1196 * mpn/arm/v6/mul_2.asm: New file.
1198 2012-04-23 Torbjorn Granlund <tege@gmplib.org>
1200 * mpn/arm/aorsmul_1.asm: Tweak loop control for a 6% speed increase.
1202 2012-04-22 Torbjorn Granlund <tege@gmplib.org>
1204 * configure.in: Recognise ARM sub-architectures.
1206 * configfsf.guess: Update to current FSF version.
1207 * configfsf.sub: Likewise.
1209 * mpn/arm/bdiv_dbm1c.asm: New file.
1211 * mpn/arm/v6/mul_1.asm: New file.
1212 * mpn/arm/v6/addmul_1.asm: New file.
1214 2012-04-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
1216 * gen-fac.c: Renamed, was gen-fac_ui.c .
1217 * Makefile.am: Renamed gen-fac.c and fac_table.h .
1218 * gmp-impl.h: #include "fac_table.h".
1219 * mpz/oddfac_1.c: Use generated constant.
1220 * mpz/bin_ui.c: Small optimisations.
1222 * tune/common.c (speed_mpz_bin_ui): New function.
1223 * tune/speed.h: Declare it.
1224 * tune/speed.c: Use it.
1226 2012-04-21 Torbjorn Granlund <tege@gmplib.org>
1228 * mpn/arm/mul_1.asm: Cleanup.
1229 * mpn/arm/copyi.asm: Cleanup, assume allocate-on-write cache.
1230 * mpn/arm/copyd.asm: Likewise.
1232 * mpn/arm/add_n.asm: Delete.
1233 * mpn/arm/sub_n.asm: Delete.
1234 * mpn/arm/aors_n.asm: New file, made from old files.
1236 * mpn/arm/addmul_1.asm: Delete.
1237 * mpn/arm/submul_1.asm: Delete.
1238 * mpn/arm/aorsmul_1.asm: New file, made from old files.
1240 * mpn/arm/com.asm: New file.
1241 * mpn/arm/lshift.asm: New file.
1242 * mpn/arm/rshift.asm: New file.
1244 2012-04-20 Torbjorn Granlund <tege@gmplib.org>
1246 * tests/mpq/io.c: New file.
1247 * tests/mpq/Makefile.am: Run it.
1249 * mpz/clrbit.c: Simplify along the lines of setbit.c.
1251 2012-04-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
1253 * mpz/setbit.c: Simplify.
1255 * gmp-impl.h (LOG2C): Define.
1256 * mpz/fac_ui.c (LOG2C): Remove.
1257 * mpz/2fac_ui.c (LOG2C): Remove.
1258 * mpz/oddfac_1.c (LOG2C): Remove.
1259 * mpn/generic/binvert.c (LOG2C): Remove.
1260 * mpn/generic/invertappr.c (LOG2C): Remove.
1262 * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): Move declarations,
1263 and assume that n and k are not small.
1265 2012-04-19 Torbjorn Granlund <tege@gmplib.org>
1267 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-remove.
1269 * tests/mpz/t-remove.c: Clear out mpz variables.
1271 * tests/mpz/t-cong.c (check_random): Use much larger numbers.
1272 (check_data): Check congruences mod 0.
1274 * tests/mpz/t-divis.c: Test divisibility by zero.
1276 * tests/mpz/reuse.c: Test mpz_mod.
1278 * mpz/setbit.c: Remove dead code. Use CNST_LIMB.
1279 * mpz/clrbit.c: Use CNST_LIMB.
1281 2012-04-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
1283 * primesieve.c: New file, with functions from mpz/oddfac_1.c .
1284 * mpz/oddfac_1.c (bitwise_primesieve): Re-moved.
1285 * Makefile.am (libgmp_la_SOURCES): Add primesieve.c .
1286 * gmp-impl.h (gmp_primesieve): Declare.
1288 * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): New, factor-based
1290 * tests/mpz/t-bin.c: Extend tests, to cover _goetgheluck.
1292 * mpz/primorial_ui.c: New file.
1293 * mpz/Makefile.am (libmpz_la_SOURCES): Add mpz/primorial_ui.c
1294 * Makefile.am (MPZ_OBJECTS): Add mpz/primorial_ui$U.lo
1295 * gmp-h.in (mpz_primorial_ui): Declare.
1296 * tests/mpz/t-primorial_ui.c: New test for the new function.
1297 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-primorial_ui.
1298 * doc/gmp.texi: Short documentation for the new function.
1300 2012-04-17 Torbjorn Granlund <tege@gmplib.org>
1302 * mpn/x86_64/coreisbr/aorsmul_1.asm: Fix some DOS64 issues.
1303 * mpn/x86_64/coreisbr/mul_1.asm: Likewise.
1305 * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Adhere to DOS64 register
1308 * mpn/x86_64/fastsse/copyi-palignr.asm: Implement temporary workaround
1311 2012-04-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
1313 * mpz/bin_uiui.c: Support small limbs (fallback on bin_ui).
1315 * tests/mpn/toom-sqr-shared.h: Use a restricted range.
1316 * tests/mpn/t-toom2-sqr.c: Specify correct range.
1317 * tests/mpn/t-toom3-sqr.c: Likewise.
1318 * tests/mpn/t-toom4-sqr.c: Likewise.
1319 * tests/mpn/t-toom6-sqr.c: Likewise.
1320 * tests/mpn/t-toom8-sqr.c: Likewise, but extended.
1321 * tests/mpn/Makefile.am (check_PROGRAMS): Add t-toom?-sqr tests.
1323 * mpn/generic/sbpi1_bdiv_q.c: Move ASSERTs, to support qp = np.
1325 2012-04-17 Torbjorn Granlund <tege@gmplib.org>
1327 * mpn/x86_64/copyd.asm: Rewrite.
1328 * mpn/x86_64/copyi.asm: Rewrite.
1330 2012-04-16 Torbjorn Granlund <tege@gmplib.org>
1332 * mpn/x86_64/fastsse/lshift-movdqu2.asm: Add DOS entry/exit sequences.
1333 * mpn/x86_64/fastsse/rshift-movdqu2.asm: Likewise.
1334 * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Likewise.
1336 * mpn/x86_64/x86_64-defs.m4 (palignr): New macro.
1337 (x86_opcode_regxmm, x86_opcode_regxmm_list): New, made from x86 mmx
1339 (x86_lookup): Copy from x86/x86-defs.m4.
1340 * mpn/x86_64/fastsse/copyd-palignr.asm: Use palignr macro.
1341 * mpn/x86_64/fastsse/copyi-palignr.asm: Likewise.
1343 2012-04-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
1345 * tests/mpz/t-bin.c: Add more tests on small values.
1346 * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): Smaller temporary areas.
1348 2012-04-15 Torbjorn Granlund <tege@gmplib.org>
1350 * mpn/x86_64/fastsse/copyd-palignr.asm: New file.
1351 * mpn/x86_64/fastsse/copyi-palignr.asm: New file.
1352 * mpn/x86_64/core2/copyd.asm: New file.
1353 * mpn/x86_64/core2/copyi.asm: New file.
1354 * mpn/x86_64/nano/copyd.asm: New file.
1355 * mpn/x86_64/nano/copyi.asm: New file.
1356 * mpn/x86_64/atom/copyd.asm: New file.
1357 * mpn/x86_64/atom/copyi.asm: New file.
1359 2012-04-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
1361 * mpz/bin_uiui.c: Rewrite (some parts are Torbjorn's).
1362 * gen-fac_ui.c: Generate new constants for bin_uiui.
1364 * mini-gmp/mini-gmp.h (mpz_fac_ui, mpz_bin_uiui): New definitions.
1365 * mini-gmp/mini-gmp.c (mpz_fac_ui, mpz_bin_uiui): Trivial
1368 * tests/mpz/t-fac_ui.c: Check Wilson's theorem on a big value.
1370 * mpn/generic/invert.c: Remove support for scratch == NULL.
1371 * tune/speed.h (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Allocate scratch
1372 space for mpn_invert.
1374 * mpz/mul_i.h: Small clean-up.
1376 * tests/mpn/toom-sqr-shared.h: New file.
1377 * tests/mpn/t-toom2-sqr.c: New file.
1378 * tests/mpn/t-toom3-sqr.c: New file.
1379 * tests/mpn/t-toom4-sqr.c: New file.
1380 * tests/mpn/t-toom6-sqr.c: New file.
1381 * tests/mpn/t-toom8-sqr.c: New file.
1382 * tests/mpn/Makefile.am (EXTRA_DIST): Add toom-sqr-shared.h .
1384 * mpn/generic/toom62_mul.c: Use add_n, sub_n, when possible.
1386 2012-04-12 Torbjorn Granlund <tege@gmplib.org>
1388 * mpn/x86_64/fastsse/lshift-movdqu2.asm: New file.
1389 * mpn/x86_64/fastsse/rshift-movdqu2.asm: New file.
1390 * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: New file.
1391 * mpn/x86_64/coreisbr/lshift.asm: New file.
1392 * mpn/x86_64/coreisbr/rshift.asm: New file.
1393 * mpn/x86_64/coreisbr/lshiftc.asm: New file.
1394 * mpn/x86_64/k10/lshift.asm: New file.
1395 * mpn/x86_64/k10/rshift.asm: New file.
1396 * mpn/x86_64/k10/lshiftc.asm: New file.
1398 * mpn/x86_64/fastsse/lshift.asm: Simplify to very basic form.
1400 2012-04-11 Niels Möller <nisse@lysator.liu.se>
1402 * Makefile.am (check-mini-gmp): Pass -I../.. in EXTRA_CFLAGS, to
1405 2012-04-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
1407 * mini-gmp/mini-gmp.h (mpz_root, mpz_rootrem): define (correctly).
1408 * mini-gmp/mini-gmp.c (mpz_rootrem): Extended code from _root.
1409 (mpz_root): Use mpz_rootrem.
1410 (mpz_mul_ui): Correctly handle negative operands.
1412 * mini-gmp/tests/Makefile (CHECK_PROGRAMS): add t-root.
1413 * mini-gmp/tests/t-root.c: New file.
1414 * mini-gmp/tests/t-reuse.c: Enable root{,rem} tests.
1416 2012-04-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
1418 * gen-fac_ui.c (mpz_root): Remove.
1419 * mini-gmp/mini-gmp.c (mpz_root): New, support negative operands.
1420 * mini-gmp/mini-gmp.h (mpz_root): define.
1421 (mpz_out_str): Test also __STDIO_LOADED (for VMS).
1422 * mpz/2fac_ui.c: Cosmetic change.
1424 2012-04-07 Torbjorn Granlund <tege@gmplib.org>
1426 * mpn/ia64/gcd_1.asm: Rewrite inner loop to use ctz table.
1428 2012-04-05 Torbjorn Granlund <tege@gmplib.org>
1430 * mpn/powerpc64/p7/popcount.asm: Properly extend arg n for mode32.
1431 * mpn/powerpc64/p7/hamdist.asm: Likewise.
1433 2012-04-04 Torbjorn Granlund <tege@gmplib.org>
1435 * mpn/powerpc64/p7/popcount.asm: New file.
1436 * mpn/powerpc64/p7/hamdist.asm: New file.
1438 * longlong.h (ARM count_leading_zeros): Enable for more arch versions.
1440 * mpn/x86_64/gcd_1.asm: Make room for DOS64 regparm shadow area.
1441 * mpn/x86_64/core2/gcd_1.asm: Likewise.
1443 2012-04-03 Torbjorn Granlund <tege@gmplib.org>
1445 * mpn/x86_64/coreisbr/aorrlsh_n.asm: Make it actually work for DOS64.
1447 2012-04-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
1449 * mpz/oddfac_1.c: Initalize size for ASSERT.
1451 2012-04-02 Torbjorn Granlund <tege@gmplib.org>
1453 * gmp-h.in (_GMP_H_HAVE_FILE): Test also __STDIO_LOADED (for VMS).
1455 * gmp-impl.h (doprnt_format_t, etc): Remove bogus __GMP_DECLSPECs.
1457 2012-03-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
1459 * mpn/x86_64/sqr_basecase.asm: Speed-up for small cases.
1461 2012-03-29 Torbjorn Granlund <tege@gmplib.org>
1463 * mpn/sparc64/gcd_1.asm: New file.
1465 2012-03-27 Torbjorn Granlund <tege@gmplib.org>
1467 * config.guess: Fix typo in coreisbr recognition.
1469 2012-03-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1471 * mpn/x86_64/gcd_1.asm: Reduce latency.
1472 * mpn/x86_64/mul_basecase.asm: Save one jump.
1474 * mpz/iset_ui.c: Don't realloc.
1476 2012-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
1478 * mp_clz_tab.c: Add __clz_tab[128].
1479 * longlong.h (count_trailing_zeros): Use it in pure C variant.
1481 2012-03-20 Torbjorn Granlund <tege@gmplib.org>
1483 * configure.in (x86 fat_path): Add many missing directories.
1484 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Rewrite.
1485 (fake_cpuid_table): Add many more CPUs.
1487 * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Minor spacing cleanup.
1489 2012-03-19 Torbjorn Granlund <tege@gmplib.org>
1491 * mpn/x86/x86-defs.m4 (CALL, PIC_WITH_EBX): New macros.
1492 * mpn/x86/darwin.m4: Likewise.
1493 * mpn/x86/k7/gcd_1.asm: Use new macros to support PIC.
1494 * mpn/x86/p6/gcd_1.asm: Likewise.
1496 2012-03-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
1498 * gen-fac_ui.c: Generate more constants (possible mini-mpz_root).
1499 * mpz/oddfac_1.c: Improve ASSERTs.
1500 (log_n_max): Use precomputed table.
1502 * longlong.h (_PROTO): Remove.
1504 2012-03-18 Torbjorn Granlund <tege@gmplib.org>
1506 * longlong.h (count_trailing_zeros): Write better pure C default
1509 * mpn/x86/p6/gcd_1.asm: Remove forgotten x86_64 reference.
1511 * mpn/x86/p6/gmp-mparam.h: Update, to get BMOD_1_TO_MOD_1_THRESHOLD
1512 defined for fat binaries.
1514 2012-03-17 Torbjorn Granlund <tege@gmplib.org>
1516 * mpn/x86/k7/gcd_1.asm: Rewrite.
1517 * mpn/x86/p6/gcd_1.asm: New file.
1519 * mpn/x86_64/core2/gcd_1.asm: Conditionally suppress reduction calls.
1520 * mpn/x86_64/gcd_1.asm: Rewrite.
1522 2012-03-15 Torbjorn Granlund <tege@gmplib.org>
1524 * mpn/generic/gcd_1.c: Parameterise zerotab code.
1526 * mpn/x86_64/nano/gcd_1.asm: New file, grabbing core2 asm file.
1528 * mpn/x86_64/core2/gcd_1.asm: Speed up loop code, simplify non-loop
1531 2012-03-13 Torbjorn Granlund <tege@gmplib.org>
1533 * mpn/x86_64/core2/gcd_1.asm: Add hack to support fat builds.
1535 * mpn/x86_64/core2/gcd_1.asm: Shorten critical path.
1537 2012-03-12 Torbjorn Granlund <tege@gmplib.org>
1539 * mpn/x86_64/core2/gcd_1.asm: New file.
1540 * mpn/x86_64/k10/gcd_1.asm: New file, grabbing core2 asm file.
1541 * mpn/x86_64/bd1/gcd_1.asm: Likewise.
1543 * mpn/x86_64/bobcat/sqr_basecase.asm: New file.
1544 * mpn/x86_64/bobcat/mul_basecase.asm: Minor tuning.
1546 2012-03-10 Torbjorn Granlund <tege@gmplib.org>
1548 * configure.in (fat_functions): Add addlsh1_n, addlsh2_n, addmul_2,
1549 mullo_basecase, redc_1, redc_2, sublsh1_n.
1551 * gmp-impl.h (struct cpuvec_t): Add fields for new fat functions.
1552 * gmp-impl.h: Adjust corresponding declarations.
1554 * mpn/generic/redc_2.c (mpn_addmul_2): Make static.
1556 * mpn/x86_64/fat/fat_entry.asm (FAT_INIT): Expand before fat_init to
1557 reduce branch offsets. Pass plain 0,1,3... in %al since we'd else run
1560 * mpn/x86_64/fat/fat_entry.asm (fat_init): Scale passed index value.
1561 * mpn/x86/fat/fat_entry.asm (fat_init): Use movzbl for expanding index
1564 * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Add new fat functions.
1565 * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Likewise.
1566 * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Likewise.
1567 * mpn/x86/fat/fat.c (__gmpn_cpuvec): Likewise.
1569 * mpn/x86_64/fat/redc_2.c: New file.
1570 * mpn/x86/fat/mullo_basecase.c: New file.
1571 * mpn/x86/fat/redc_1.c: New file.
1572 * mpn/x86/fat/redc_2.c: New file.
1574 * tests/mpn/t-fat.c: Test mullo_basecase.
1576 2012-03-08 Torbjorn Granlund <tege@gmplib.org>
1578 * mpn/x86_64/coreisbr/addmul_2.asm: Port to DOS64.
1580 2012-02-29 Marc Glisse <marc.glisse@inria.fr>
1582 * gmpxx.h: Ignore partial C++11 support in g++-4.6.
1583 * tests/cxx/t-cxx11.cc: Likewise.
1585 * gmpxx.h (operator""): New functions.
1586 * tests/cxx/t-cxx11.cc: Test the above.
1587 * doc/gmp.texi: Document the above.
1589 2012-03-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
1591 * acinclude.m4 (GMP_H_ANSI): Remove.
1592 * configure.in: Don't use GMP_H_ANSI.
1593 * gmp-h.in (__GMP_HAVE_PROTOTYPES): Remove.
1595 2012-03-08 Torbjorn Granlund <tege@gmplib.org>
1597 * mpn/x86_64/fat/fat.c (fake_cpuid_table): Recognise "bulldozer".
1598 (__gmpn_cpuvec_init): Overhaul to match configure.in.
1600 * configure.in: Adjust bulldozer path_64.
1602 2012-03-07 Torbjorn Granlund <tege@gmplib.org>
1604 * configure.in (x86_64 fat_path): List recently added AMD directories.
1606 * mpn/x86_64/bobcat/copyi.asm: New file.
1607 * mpn/x86_64/bobcat/copyd.asm: New file.
1609 * config.guess: Handle AMD 11h correctly.
1611 * tune/tuneup.c (tune_redc): Better handle situation where redc_2 is
1614 2012-03-06 Torbjorn Granlund <tege@gmplib.org>
1616 * mpn/x86_64/bobcat/mul_basecase.asm: New file.
1618 2012-03-04 Torbjorn Granlund <tege@gmplib.org>
1620 * mpn/x86_64/bobcat/mul_1.asm: New file.
1621 * mpn/x86_64/bobcat/aorsmul_1.asm: New file.
1623 2012-03-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
1625 * mpz/invert.c: Remove mod 0 branch.
1626 * tests/mpz/t-invert.c: Avoid testing mod 0.
1627 * doc/gmp.texi (mpz_invert): Specify mod 0 is not handled.
1629 * gmp-h.in (__gmp_signed, __gmp_const): Remove.
1630 (__GMP_HAVE_TOKEN_PASTE, __GMP_HAVE_CONST): Remove.
1631 * gmp-impl.h: Strip __GMP_HAVE_TOKEN_PASTE and __GMP_HAVE_CONST.
1632 * demos/expr/: Strip __gmp_const usage from all files.
1634 * tests/mpz/t-powm.c (allsizes_seen): Require unsigned*.
1636 2012-03-03 Torbjorn Granlund <tege@gmplib.org>
1638 * mpn/x86_64/k8/gmp-mparam.h: New file.
1639 * mpn/x86_64/k10/gmp-mparam.h: New file.
1641 * mpn/generic/hgcd_step.c (mpn_hgcd_step): Remove unused variables.
1642 * mpn/generic/hgcd_jacobi.c (hgcd_jacobi_step): Likewise.
1643 * mpn/generic/hgcd_reduce.c (hgcd_matrix_apply): Likewise.
1644 * mpn/generic/mu_bdiv_qr.c: Likewise.
1645 * mpz/jacobi.c: Likewise.
1646 * mpz/mod.c: Likewise.
1648 * mpn/generic/toom42_mul.c: Remove unread variable.
1649 * mpn/generic/set_str.c (mpn_set_str_compute_powtab): Likewise.
1650 * mpn/generic/rootrem.c (mpn_rootrem_internal): Likewise.
1651 * tests/refmpn.c (refmpn_mul): Likewise.
1652 * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Propagate mask computation
1653 into ASSERT, remove variable.
1655 * gmp-h.in (__GMP_PROTO): Remove.
1656 * Strip __GMP_PROTO usage from all files.
1657 * Strip prototype parameter names from all files.
1659 2012-03-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
1661 * doc/gmp.texi (mpz_invert): Correctly document result range.
1662 * tests/mpz/t-invert.c: Small range correction.
1664 2012-03-01 Torbjorn Granlund <tege@gmplib.org>
1666 * mpn/x86_64/mullo_basecase.asm: New file.
1668 2012-02-29 Marc Glisse <marc.glisse@inria.fr>
1670 * gmpxx.h (std::numeric_limits): New partial specialization.
1672 2012-02-29 Niels Möller <nisse@lysator.liu.se>
1674 * mini-gmp/tests/t-reuse.c: New test case, based on
1677 * mini-gmp/mini-gmp.c (mpz_cdiv_r_ui): New function.
1678 (mpz_fdiv_r_ui): New function.
1679 (mpz_tdiv_r_ui): New function.
1680 (mpz_powm_ui): New function.
1681 (mpz_pow_ui): New function.
1682 (mpz_ui_pow_ui): Use mpz_pow_ui.
1683 (mpz_gcdext): Fixed input/output overlap, for the case of one
1685 (mpz_sqrtrem): Fix for the case r NULL, U zero.
1687 * Makefile.am (check-mini-gmp): Use $(MAKE).
1688 (clean-mini-gmp): New target.
1689 (clean-local, distclean-local): New automake targets. Depend on
1692 2012-02-28 Niels Möller <nisse@lysator.liu.se>
1694 * Makefile.am (check-mini-gmp): New target, for running the
1697 * mini-gmp/tests/Makefile (srcdir, MINI_GMP_DIR): New make
1698 variables. These can be overridden when using a separate build
1700 (EXTRA_CFLAGS): Renamed, was OPTFLAGS.
1702 * mini-gmp/mini-gmp.c (mpz_abs_add): Don't cache limb pointers
1703 over MPZ_REALLOC, since that breaks in-place operation. Bug
1704 spotted by Torbjörn.
1705 (mpz_and, mpz_ior, mpz_xor): Likewise.
1706 (mpz_cmp): Fixed comparison of negative numbers.
1708 2012-02-27 Torbjorn Granlund <tege@gmplib.org>
1710 * mpn/x86_64/fastsse/lshiftc.asm: New file.
1711 * mpn/x86_64/fastsse/com.asm: New file.
1713 * mpn/x86_64/bd1/popcount.asm: New file.
1714 * mpn/x86_64/bd1/hamdist.asm: New file.
1716 * mpn/x86_64/fastsse/copyi.asm: New file.
1717 * mpn/x86_64/fastsse/copyd.asm: New file.
1718 * mpn/x86_64/fastsse/lshift.asm: New file.
1720 2012-02-26 Torbjorn Granlund <tege@gmplib.org>
1722 * mpn/x86_64/coreisbr/addmul_2.asm: New file.
1724 * tests/devel/try.c (param_init): Don't require addmul_N to handle
1727 * mpn/x86_64/bd1/mul_1.asm: New file.
1728 * mpn/x86_64/bd1/aorsmul_1.asm: New file.
1730 2012-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1732 * mpz/2fac_ui.c: New file: implements n!!.
1733 * Makefile.am (MPZ_OBJECTS): Add mpz/2fac_ui.
1734 * gmp-h.in: Declare mpz_2fac_ui.
1735 * tests/mpz/t-fac.c: Test mpz_2fac_ui.
1736 * doc/gmp.texi: Document mpz_2fac_ui.
1737 * mpz/Makefile.am (libmpz_la_SOURCES): Add 2fac_ui.c.
1739 * mpz/oddfac_1.c (mpz_oddfac_1): Use umul_ppmm when size = 2.
1741 2012-02-26 Niels Möller <nisse@lysator.liu.se>
1743 * mini-gmp: New subdirectory. For use by GMP bootstrap, and as a
1744 fallback for applications needing bignums but not high
1747 * bootstrap.c: New file, replacing dumbmp.c. Uses mini-gmp for the
1748 standard GMP functions, and then defines the few functions
1749 particular for the bootstrap.
1750 * dumbmp.c: Deleted file. A few functions moved to bootstrap.c.
1752 * gen-bases.c: Include bootstrap.c, not dumbmp.c.
1753 * gen-fac_ui.c: Likewise.
1754 * gen-trialdivtab.c: Likewise.
1755 * gen-fib.c: Include bootstrap.c, not dumbmp.c. Use assert rather
1756 than ASSERT. Deleted casts of xmalloc return value.
1757 * gen-psqr.c: Likewise.
1758 (COLLAPSE_ELEMENT): Use memmove rather than mem_copyi.
1760 * Makefile.am: Replaced all uses of dumbmp.c by bootstrap.c.
1761 (EXTRA_DIST, dist-hook): Arrange for distribution of the mini-gmp
1764 2012-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
1766 * mpz/invert.c: Use ABSIZ, MPZ_EQUAL_1_P.
1767 * mpz/abs.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
1768 * mpz/aors_ui.h: Likewise.
1769 * mpz/com.c: Likewise.
1770 * mpz/neg.c: Likewise.
1772 * mpz/invert.c: Reply "no-inverse" when modulus is zero.
1773 * tests/mpz/t-invert.c: Add more checks.
1774 * doc/gmp.texi (mpz_invert): Inverse can not be zero.
1776 2012-02-24 Torbjorn Granlund <tege@gmplib.org>
1778 * tests/mpn/logic.c: New file.
1779 * tests/mpn/Makefile.am (check_PROGRAMS): Add logic.
1781 * tests/mpz/t-invert.c: New file.
1782 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-invert.
1784 2012-02-24 Marc Glisse <marc.glisse@inria.fr>
1786 * tests/mpq/t-cmp.c: Move NUM and DEN macros...
1787 * tests/mpq/t-cmp_ui.c: Likewise...
1788 * gmp-impl.h: ... to here.
1790 * mpq/abs.c: Use NUM, DEN, SIZ, ALLOC, PTR, MPZ_REALLOC.
1791 * mpq/aors.c: Likewise.
1792 * mpq/canonicalize.c: Likewise.
1793 * mpq/clear.c: Likewise.
1794 * mpq/cmp.c: Likewise.
1795 * mpq/cmp_si.c: Likewise.
1796 * mpq/cmp_ui.c: Likewise.
1797 * mpq/div.c: Likewise.
1798 * mpq/equal.c: Likewise.
1799 * mpq/get_d.c: Likewise.
1800 * mpq/get_den.c: Likewise.
1801 * mpq/get_num.c: Likewise.
1802 * mpq/get_str.c: Likewise.
1803 * mpq/init.c: Likewise.
1804 * mpq/inp_str.c: Likewise.
1805 * mpq/inv.c: Likewise.
1806 * mpq/md_2exp.c: Likewise.
1807 * mpq/mul.c: Likewise.
1808 * mpq/neg.c: Likewise.
1809 * mpq/set.c: Likewise.
1810 * mpq/set_d.c: Likewise.
1811 * mpq/set_den.c: Likewise.
1812 * mpq/set_f.c: Likewise.
1813 * mpq/set_num.c: Likewise.
1814 * mpq/set_si.c: Likewise.
1815 * mpq/set_str.c: Likewise.
1816 * mpq/set_ui.c: Likewise.
1817 * mpq/set_z.c: Likewise.
1818 * mpq/swap.c: Likewise.
1820 * tests/mpq/t-inv.c: New test file.
1821 * tests/mpq/Makefile.am: Add the above.
1823 * gmpxx.h (__gmp_set_expr): Use mpq_set_z.
1825 * mpq/md_2exp.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
1826 * mpq/set_d.c: Likewise.
1827 * mpq/set_f.c: Likewise.
1829 2012-02-24 Niels Möller <nisse@lysator.liu.se>
1831 * mpn/x86_64/core2/aorsmul_1.asm: Added mpn_addmul_1c and
1832 mpn_submul_1c entry points.
1834 2012-02-23 Marc Glisse <marc.glisse@inria.fr>
1836 * mpz/abs.c: Use ALLOC, SIZ, ABSIZ, PTR, MPZ_REALLOC.
1837 * mpz/aors_ui.h: Likewise.
1838 * mpz/array_init.c: Likewise.
1839 * mpz/cdiv_q.c: Likewise.
1840 * mpz/cdiv_qr.c: Likewise.
1841 * mpz/cdiv_r.c: Likewise.
1842 * mpz/clear.c: Likewise.
1843 * mpz/clrbit.c: Likewise.
1844 * mpz/cmp_si.c: Likewise.
1845 * mpz/com.c: Likewise.
1846 * mpz/fdiv_q.c: Likewise.
1847 * mpz/fdiv_qr.c: Likewise.
1848 * mpz/fdiv_r.c: Likewise.
1849 * mpz/get_si.c: Likewise.
1850 * mpz/get_str.c: Likewise.
1851 * mpz/init.c: Likewise.
1852 * mpz/inp_str.c: Likewise.
1853 * mpz/iset.c: Likewise.
1854 * mpz/iset_d.c: Likewise.
1855 * mpz/iset_si.c: Likewise.
1856 * mpz/iset_str.c: Likewise.
1857 * mpz/iset_ui.c: Likewise.
1858 * mpz/mod.c: Likewise.
1859 * mpz/neg.c: Likewise.
1860 * mpz/out_str.c: Likewise.
1861 * mpz/random2.c: Likewise.
1862 * mpz/set_si.c: Likewise.
1863 * mpz/set_str.c: Likewise.
1864 * mpz/set_ui.c: Likewise.
1865 * mpz/setbit.c: Likewise.
1866 * mpz/sqrt.c: Likewise.
1867 * mpz/swap.c: Likewise.
1868 * mpz/tdiv_r_2exp.c: Likewise.
1870 * tests/cxx/t-ops.cc: Test mpz_abs reallocation.
1872 2012-02-23 Torbjorn Granlund <tege@gmplib.org>
1874 * mpn/x86_64/core2/rsh1aors_n.asm: Complete rewrite.
1875 * mpn/x86_64/coreisbr/rsh1aors_n.asm: Move old core2 code here.
1877 * mpn/x86_64/redc_1.asm: Make it work for DOS64 (broken in last edit).
1879 2012-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
1881 * mpn/generic/toom_interpolate_8pts.c: Compute carry iif non-trivial.
1883 * mpz/gcdext.c: Adapt to relaxed mpn_gcdext's input requirements.
1885 * mpz/and.c: Use mpn_ logic everywhere. Reduce branches.
1886 * mpz/ior.c: Likewise.
1887 * mpz/xor.c: Likewise.
1889 2012-02-20 Torbjorn Granlund <tege@gmplib.org>
1891 * mpn/x86_64/coreisbr/mul_1.asm: New file.
1893 * mpn/x86_64/coreisbr/aorsmul_1.asm: New file.
1895 * mpn/x86_64/mod_34lsub1.asm: Avoid ",pt" branch hint since many
1896 assemblers don't support it.
1898 2012-02-19 Torbjorn Granlund <tege@gmplib.org>
1900 * mpn/generic/redc_1.c: Put back mpn_add_n call, return its carry.
1901 Reintroduce previously removed RP argument.
1902 * mpn/x86_64/redc_1.asm: Likewise.
1904 * mpn/generic/redc_2.c: Remove mpn_sub_n call, return carry from
1907 * gmp-impl.h (mpn_redc_1, mpn_redc_2): Now return an mp_limb_t.
1909 * tune/speed.h (SPEED_ROUTINE_REDC_1): Adopt to pass RP argument.
1911 * tests/refmpn.c (refmpn_redc_1): Adopt to new redc_1 interface.
1913 * mpn/generic/powm.c (MPN_REDC_1): Pass rp parameter to mpn_redc_1.
1914 * mpn/generic/powm_sec.c (MPN_REDC_1_SEC): Likewise.
1915 * mpn/generic/powm.c (MPN_REDC_2): New macro, use for mpn_redc_2.
1917 2012-02-18 Marc Glisse <marc.glisse@inria.fr>
1919 * gmpxx.h (std::common_type): New partial specialization in C++11.
1920 * tests/cxx/t-cxx11.cc: Test it.
1922 * gmpxx.h: Don't declare long double functions that are never defined.
1924 * gmpxx.h (__gmp_binary_expr): Let things happen in place: q=q*q+z*z
1925 becomes tmp=z*z, q=q*q, q+=tmp.
1926 * tests/cxx/t-binary.cc: More variable reuse tests.
1928 2012-02-17 Marc Glisse <marc.glisse@inria.fr>
1930 * gmp-h.in (__GMP_WITHIN_GMP): Test with #ifdef instead of #if, for
1931 the benefit of applications using gcc -Wundef.
1932 (__GMP_WITHIN_GMPXX): Likewise.
1934 2012-02-16 Marc Glisse <marc.glisse@inria.fr>
1936 * gmpxx.h (__gmp_binary_expr): Let things happen in place: e=a*b-c*d
1937 becomes tmp=c*d, e=a*b, e-=tmp.
1938 * tests/cxx/t-binary.cc: More variable reuse tests.
1940 2012-02-15 Niels Möller <nisse@lysator.liu.se>
1942 * tune/tuneup.c (mul_toom43_to_toom54_threshold): New global.
1943 (tune_mul): Added tuning of MUL_TOOM43_TO_TOOM54_THRESHOLD.
1944 * tune/speed.h (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM54_MUL): New macro.
1945 (SPEED_ROUTINE_MPN_TOOM54_FOR_TOOM43_MUL): New macro.
1946 Prototypes for corresponding functions.
1947 * tune/common.c (speed_mpn_toom43_for_toom54_mul): New function.
1948 (speed_mpn_toom54_for_toom43_mul): New function.
1950 * gmp-impl.h (MPN_TOOM43_MUL_MINSIZE): Corrected constant.
1951 (MPN_TOOM53_MUL_MINSIZE): Likewise.
1952 (MPN_TOOM54_MUL_MINSIZE): New constant.
1953 (mpn_toom54_mul): Added prototype.
1954 (MUL_TOOM43_TO_TOOM54_THRESHOLD): New threshold. Default value and
1957 2012-02-14 Niels Möller <nisse@lysator.liu.se>
1959 * mpn/generic/toom54_mul.c: New file, originally contributed by
1961 * gmp-impl.h (mpn_toom54_mul_itch): New function.
1962 * configure.in (gmp_mpn_functions): Added toom54_mul.
1963 * tests/mpn/t-toom54.c: New file.
1964 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom54.
1966 2012-02-13 Niels Möller <nisse@lysator.liu.se>
1968 * configure.in: Display summary of options.
1970 2012-02-11 Torbjorn Granlund <tege@gmplib.org>
1972 * tests/tests.h (TESTS_REPS): Print any non-standard repetitions.
1974 2012-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
1976 * doc/gmp.texi (Factorial): Shortly describe current algorithm.
1977 (Multiplication Algorithms): Add Toom[68]'n'half, (too) shortly.
1978 * gmp-impl.h (ASSERT_ALWAYS): Consider failures UNLIKELY.
1980 2012-02-10 Niels Möller <nisse@lysator.liu.se>
1982 * tests/mpz/t-gcd.c (gcdext_valid_p): Enforce sligthly stricter
1983 bound for cofactors.
1985 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): Corrected
1986 handling of unlikely (maybe impossible?) case u1n < un. Related to
1987 the 2012-02-05 bugfix of gcdext_subdiv_step.c in the gmp-5.0 repo.
1989 2012-02-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
1991 * gmp-impl.h (mpn_toom3*_itch): Support any recursion depth.
1992 * tests/refmpn.c (refmpn_mul): Restore tight allocations.
1994 * mpz/oddfac_1.c (mpz_oddfac_1): Get ready for n!!
1995 * gmp-impl.h (mpz_oddfac_1): Update signature.
1996 * mpz/fac_ui.c (mpz_fac_ui): Update call to mpz_oddfac_1.
1998 2012-02-09 Marc Glisse <marc.glisse@inria.fr>
2000 * gmp-impl.h (ABS_CAST): New macro.
2001 * mpf/cmp_si.c: Use ABS_CAST.
2002 * mpf/get_si.c: Use ABS_CAST.
2003 * mpf/iset_si.c: Use ABS_CAST.
2004 * mpf/set_si.c: Use ABS_CAST.
2005 * mpq/set_si.c: Use ABS_CAST.
2006 * mpz/cmp_si.c: Use ABS_CAST.
2007 * mpz/get_si.c: Use ABS_CAST.
2008 * mpz/iset_si.c: Use ABS_CAST.
2009 * mpz/mul_i.h: Use ABS_CAST.
2010 * mpz/set_si.c: Use ABS_CAST.
2012 2012-02-08 Torbjorn Granlund <tege@gmplib.org>
2014 * mpn/powerpc32/divrem_2.asm: Fix off-by-one condition in invert_limb
2017 2012-02-08 Niels Möller <nisse@lysator.liu.se>
2019 * doc/gmp.texi (mpz_gcdext): Clarified corner cases in cofactor
2022 2012-02-07 Niels Möller <nisse@lysator.liu.se>
2024 * mpn/generic/gcdext.c (mpn_gcdext): Fixed assert, related to the
2025 special case A = (2k+1) G, B = 2 G. Fix copied from gmp-5.0 repo.
2027 2012-02-06 Niels Möller <nisse@lysator.liu.se>
2029 * mpn/generic/hgcd_matrix.c (hgcd_matrix_update_q): Fixed carry
2030 handling bug. Fix copied from gmp-5.0 repo, where the function is
2033 * tests/mpz/t-gcd.c (main): Use mpz_rrandomb for test operands,
2034 not mpz_urandomb. Change copied from gmp-5.0 repo.
2035 * tests/mpn/t-hgcd.c (main): Likewise.
2037 2012-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
2039 * tests/refmpn.c (refmpn_mul): More conservative allocations.
2041 2012-02-03 Torbjorn Granlund <tege@gmplib.org>
2043 * mpn/x86_64/bd1/gmp-mparam.h: New file.
2045 * longlong.h (udiv_qrnnd from sdiv_qrnnd): Declare udiv_w_sdiv.
2047 * mpn/generic/udiv_w_sdiv.c: Use c89 function header.
2049 2012-02-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
2051 * mpz/fac_ui.c: mpz_oddfac_1 removed, with many related functions.
2052 * mpz/oddfac_1.c: New file, mpz_oddfac_1 implementation.
2053 * gmp-impl.h: mpz_oddfac_1 declaration.
2054 * Makefile.am (MPZ_OBJECTS): add mpz/oddfac_1$U.lo .
2055 * mpz/Makefile.am (libmpz_la_SOURCES): add oddfac_1.c .
2056 * tune/Makefile.am (fac_ui.c): include mpz/oddfac_1.c .
2058 2012-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
2060 * mpn/generic/toom_interpolate_16pts.c: Correct an unlikely 32-bit bug.
2062 2012-02-02 Torbjorn Granlund <tege@gmplib.org>
2064 * mpn/generic/toom63_mul.c: Allow s+t==n by adjusting an ASSERT.
2065 * mpn/generic/toom_interpolate_8pts.c: Perform final incr iff s+t!=n.
2067 * tests/mpn/t-toom6h.c (MIN_BN): Make more consistent with ASSERT in
2070 2012-02-01 Torbjorn Granlund <tege@gmplib.org>
2072 * tests/mpn/t-mul.c: New file.
2073 * tests/mpn/Makefile.am: Compile it.
2075 2012-02-01 Marc Glisse <marc.glisse@inria.fr>
2077 * gmpxx.h: Remove check for g++ older than 2.91.
2079 2012-02-01 Niels Möller <nisse@lysator.liu.se>
2081 * mpn/generic/mul.c: Added diagram on where toom functions can be
2084 2012-02-01 Marc Glisse <marc.glisse@inria.fr>
2086 * gmpxx.h (__gmp_unary_expr): Make the constructor explicit.
2087 (__gmp_expr(__gmp_expr&&)): New move constructors.
2088 (__gmp_expr::operator=(__gmp_expr&&)): New move assignments.
2089 (swap): Mark as noexcept.
2090 (__GMPXX_USE_CXX11): New macro.
2091 (__GMPXX_NOEXCEPT): New macro.
2092 * tests/cxx/t-cxx11.cc: New file.
2093 * tests/cxx/Makefile.am: Added t-cxx11.
2095 2012-01-31 Torbjorn Granlund <tege@gmplib.org>
2097 * mpn/generic/powm_sec.c (SQR_BASECASE_LIM): New name for
2099 (SQR_BASECASE_LIM, fat variant): Define to read __gmpn_cpuvec.
2100 (SQR_BASECASE_LIM, native variant): Define to SQR_TOOM2_THRESHOLD
2101 straight, without arithmetic.
2102 (mpn_local_sqr): Use BELOW_THRESHOLD as per Marco's suggestion.
2104 2012-01-30 Torbjorn Granlund <tege@gmplib.org>
2106 * tests/mpz/t-powm.c: Ensure all sizes are seen.
2108 2012-01-30 Marc Glisse <marc.glisse@inria.fr>
2110 * gmpxx.h (__gmp_binary_expr): Let things happen in place: d=a+b+c
2112 * tests/cxx/t-binary.cc: Test variable reuse: c=a+b+c.
2114 2012-01-28 Marc Glisse <marc.glisse@inria.fr>
2116 * gmpxx.h: Don't compute -LONG_MIN.
2118 * doc/gmp.texi (gmp_randclass::get_z_bits): Use mp_bitcnt_t.
2119 * gmpxx.h: Replace unsigned long with mp_bitcnt_t.
2121 2012-01-27 Torbjorn Granlund <tege@gmplib.org>
2123 * Upgrade to libtool 2.4.2.
2125 2012-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
2127 * tests/mpz/t-fac_ui.c: Increase default test cases.
2129 * mpz/prodlimbs.c: New file, mpz_prodlimbs implementation.
2130 * gmp-impl.h: mpz_prodlimbs declaration.
2131 * Makefile.am (MPZ_OBJECTS): add mpz/prodlimbs$U.lo .
2132 * mpz/Makefile.am (libmpz_la_SOURCES): add prodlimbs.c .
2133 (fac_ui.h): remove target (moved up one directory).
2134 * mpz/fac_ui.c: mpz_prodlimbs removed, micro-optimisations.
2136 2012-01-25 Torbjorn Granlund <tege@gmplib.org>
2138 * tune/tuneup.c: Remove unused tuneup variables.
2140 2012-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
2142 * mpz/fac_ui.c: Reduce branches in basecases.
2144 2012-01-18 Marc Glisse <marc.glisse@inria.fr>
2146 * doc/gmp.texi (mpf_class::mpf_class): Use mp_bitcnt_t.
2148 2012-01-17 Torbjorn Granlund <tege@gmplib.org>
2150 * configure.in: Add ultrasparc T4 support.
2152 * demos/isprime.c (main): Run 25 millerrabin tests.
2154 2012-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
2156 * mpz/fac_ui.c (SIEVE_SEED): Define value for small limb size.
2157 (mpz_oddswing_1): Reduce the number of divisions.
2158 (mpz_oddfac_1): Reduce memory usage.
2159 * mpn/minithres/gmp-mparam.h: Correct minimum for FAC_DSC_.
2160 * tune/tuneup.c (tune_fac_ui): Likewise.
2162 2012-01-15 Niels Möller <nisse@lysator.liu.se>
2164 * mpz/scan0.c (mpz_scan0): Use ~(mp_bitcnt_t) 0, rather than
2165 ULONG_MAX, when returning "infinity".
2166 * mpz/scan1.c (mpz_scan1): Likewise.
2168 2012-01-12 Torbjorn Granlund <tege@gmplib.org>
2170 * tests/t-popc.c: Test longer bit strings.
2172 2012-01-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
2174 * mpz/divexact.c: Tight realloc, delayed if variables are reused.
2175 * mpz/lcm.c: Smaller temp space, avoid goto.
2176 * gmp-impl.h (popc_limb): avoid double & (for 8-bits limb).
2178 2012-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
2180 * mpn/minithres/gmp-mparam.h: New FAC_ODD_ and FAC_DSC_ thresholds.
2181 * tune/tuneup.c (tune_fac_ui): Correct minimum for FAC_DSC_.
2183 2012-01-07 Torbjorn Granlund <tege@gmplib.org>
2185 * mpz/mul_2exp.c: Rewrite.
2186 * mpz/tdiv_q_2exp.c: Rewrite.
2188 2012-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
2190 * gen-fac_ui.c: Remove currently unused constants; add new odd
2191 double factorial table.
2192 * mpz/fac_ui.c (RECURSIVE_PROD_THRESHOLD): Increase default.
2193 (mpz_oddfac_1): New function: a merge of _bc_odd and _dsc_odd.
2194 (mpz_prodlimbs): More in-place computations.
2196 * tune/tuneup.c (tune_fac_ui): min_is_always for FAC_ODD_.
2198 2012-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
2200 * tune/tuneup.c (tune_fac_ui): Compute FAC_DSC before FAC_ODD.
2202 2011-12-31 Torbjorn Granlund <tege@gmplib.org>
2204 * Makefile.am (fac_ui.h): Put file in top-level dir, not in mpz.
2206 2011-12-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
2208 * tune/Makefile.am (fac_ui.c): New target.
2209 (nodist_tuneup_SOURCES,CLEANFILES): Add fac_ui.c.
2210 * tune/tuneup.c (mpz_fac_ui_tune): Declare prototype.
2211 (fac_odd_threshold,fac_dsc_threshold): New global variables.
2212 (speed_mpz_fac_ui_tune,tune_fac_ui): New functions.
2213 (all): Call tune_fac_ui.
2214 * gmp-impl.h (FAC_ODD_THRESHOLD,FAC_DSC_THRESHOLD):
2215 New thresholds: default values, and setup for tuning.
2216 (FAC_DSC_THRESHOLD_LIMIT): Define (when tuning).
2217 * mpz/fac_ui.c (FAC_ODD_THRESHOLD,FAC_DSC_THRESHOLD):
2218 Default values removed.
2220 2011-12-30 Torbjorn Granlund <tege@gmplib.org>
2222 * mpz/hamdist.c: Fix typo in a return statement.
2224 * mpn/generic/powm_sec.c (SQR_BASECASE_MAX): Set safely from
2225 SQR_TOOM2_THRESHOLD.
2227 2011-12-17 Torbjorn Granlund <tege@gmplib.org>
2229 * tests/mpz/t-perfpow.c: Decrease default # of tests.
2231 2011-12-16 Torbjorn Granlund <tege@gmplib.org>
2233 * tests/refmpn.c (AORS_1): Fix typo in variable type.
2235 2011-12-10 Torbjorn Granlund <tege@gmplib.org>
2237 * mpn/generic/sbpi1_bdiv_q.c: Delay quotient limb stores in order to
2238 allow quotient and dividend to completely overlap.
2239 * mpn/generic/sbpi1_bdiv_qr.c: Likewise.
2241 2011-12-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
2243 * mpz/fac_ui.c: fac_bc_ui inlined in fac_ui.
2245 2011-12-08 Torbjorn Granlund <tege@gmplib.org>
2247 * mpn/generic/powm_sec.c: Handle fat binaries better.
2249 * mpz/fac_ui.c (mpz_bc_fac_1): Fix typo in allocation size.
2251 * mpn/x86/fat/com.c: New file.
2253 * mpn/x86_64/pentium4/aors_n.asm: Make it actually work for DOS64.
2254 * mpn/x86_64/pentium4/rsh1aors_n.asm: Conditionalise jump on DOS64
2255 to avoid overhead for standard ABIs.
2257 * mpn/x86_64/gcd_1.asm: Support DOS64.
2259 2011-12-07 Torbjorn Granlund <tege@gmplib.org>
2261 * configure.in: Fix typo making HAVE_NATIVE_mpn_X fail for fat
2264 * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Add a missing break.
2266 2011-12-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
2268 * gen-fac_ui.c: Generate two more tables: odd factorial, swing.
2270 * mpz/fac_ui.c: Rewrite.
2272 2011-12-06 Niels Möller <nisse@lysator.liu.se>
2274 * mpn/generic/hgcd.c (mpn_hgcd): Use hgcd_reduce for first
2277 2011-12-06 Torbjorn Granlund <tege@gmplib.org>
2279 * tune/mod_1_1-1.c: Redefine the mpn_ functions, not __gmpn_ (for the
2280 benefit of fat builds).
2281 * tune/mod_1_1-2.c: Likewise.
2283 2011-12-05 Torbjorn Granlund <tege@gmplib.org>
2285 * mpn/x86/fat/lshiftc.c: New file.
2286 * mpn/x86/fat/mod_1_1.c: New file.
2287 * mpn/x86/fat/mod_1_2.c: New file.
2288 * mpn/x86/fat/mod_1_4.c: New file.
2290 * mpn/x86/fat/diveby3.c: Remove no longer fat function.
2291 * mpn/x86_64/fat/diveby3.c: Likewise.
2293 * mpn/x86_64/fat/gcd_1.c: Remove since always provided as asm.
2294 * mpn/x86_64/fat/mode1o.c: Likewise.
2296 * configure.in (fat_functions): Update to more relevant function set.
2297 Add special handling for mod_1_N_cps functions.
2298 * gmp-impl.h (struct cpuvec_t) : Corresponding changes. Also add
2299 vrious declarations for new functions.
2300 * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): Corresponding changes.
2301 * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): Corresponding changes.
2302 * mpn/x86/fat/fat.c (__gmpn_cpuvec): Corresponding changes.
2303 * mpn/x86_64/fat/fat.c (__gmpn_cpuvec): Corresponding changes.
2305 * mpn/x86_64: Port most remaining x86_64 files to DOS64.
2307 * mpn/x86_64/coreisbr/aors_n.asm: Add forgotten DOS64_EXIT.
2309 * mpn/x86_64/x86_64-defs.m4 (LEA): Handle non-PIC code.
2310 * mpn/x86_64/darwin.m4 (LEA): Likewise.
2312 2011-12-04 Torbjorn Granlund <tege@gmplib.org>
2314 * mpn/x86_64/fat/fat.c (MAKE_FMS): Rewrite to handle modern CPUs.
2315 * mpn/x86/fat/fat.c (MAKE_FMS): Likewise.
2317 * mpn/x86_64/darwin.m4 (PROTECT): Define to potentially useful value.
2319 2011-12-02 Torbjorn Granlund <tege@gmplib.org>
2321 * mpn/x86_64/invert_limb_table.asm: Use PROTECT.
2322 * mpn/x86_64/invert_limb.asm: Likewise.
2324 * mpn/x86_64/darwin.m4 (PROTECT, IFELF): New defines.
2325 * mpn/x86_64/dos64.m4 (PROTECT, IFELF): New defines.
2326 * mpn/x86_64/x86_64-defs.m4 (PROTECT, IFELF): New defines.
2328 2011-12-01 Torbjorn Granlund <tege@gmplib.org>
2330 * mpn/x86_64/fat/fat.c: Copy fake cpuid code from x86/fat/fat.c.
2332 * mpn/x86_64 (STD64, IFSTD): New names for ELF64, IFELF (since these
2333 denote all standard calling conventions).
2335 * mpn/x86_64: Add DOS64 ABI support to more files.
2337 * mpn/x86_64/mod_1_1.asm: Finish DOS64 support.
2338 * mpn/x86_64/mod_1_2.asm: Likewise.
2339 * mpn/x86_64/mod_1_4.asm: Likewise.
2341 * configure.in: Add GMP_NONSTD_ABI also for fat builds.
2343 * mpn/x86_64/fat/fat_entry.asm: Rewrite to support DOS64.
2345 * mpn/x86_64/dos64.m4 (IFDOS, IFSTD): New defines.
2346 * mpn/x86_64/x86_64-defs (IFDOS, IFSTD): New defines.
2348 * mpn/x86_64/dive_1.asm: Add DOS64 ABI support.
2349 * mpn/x86_64/mode1o.asm: Likewise.
2351 * mpn/x86_64/mod_34lsub1.asm: Enable for DOS64.
2353 * mpn/x86_64/invert_limb.asm: Wrap .protected decl.
2355 * gmp-impl.h (DECL_divexact_1): Fix typo in return type.
2357 * mpn/x86_64/dos64.m4 (LEA): New define.
2360 2011-11-29 Torbjorn Granlund <tege@gmplib.org>
2362 * mpn/x86_64: Add DOS64 ABI support to most files.
2364 2011-11-28 Torbjorn Granlund <tege@gmplib.org>
2366 * mpn/x86_64/mul_basecase.asm: Support ABI DOS64.
2367 * mpn/x86_64/sqr_basecase.asm: Support ABI DOS64.
2368 * mpn/x86_64/aorsmul_1.asm: Support ABI DOS64.
2369 * mpn/x86_64/mul_1.asm: Support ABI DOS64.
2371 * mpn/x86_64/x86_64-defs.m4 (DOS64_ENTRY, DOS64_EXIT): New, empty defs.
2373 * mpn/x86_64/dos64.m4: New file.
2375 * mpn/asm-defs.m4 (ABI_SUPPORT): New dummy macro.
2377 * configure.in (64-bit mingw/cygwin): Define HOST_DOS64,GMP_NONSTD_ABI.
2378 No longer clear out path_64.
2379 (mpn code selection loop): Handle GMP_NONSTD_ABI.
2381 * mpn/generic/udiv_w_sdiv.c: Use CNST_LIMB for some constants.
2383 2011-11-25 Torbjorn Granlund <tege@gmplib.org>
2385 * x86/*: Many new gmp-mparam.h file for 64-bit CPUs in 32-bit mode.
2387 * configure.in: Overhaul x86/x86_64 support, merging three case
2388 statements into one.
2390 2011-11-24 Torbjorn Granlund <tege@gmplib.org>
2392 * doc/gmp.texi (Formatted Output Strings): Clarify rules for mpf_t
2395 * mpn/powerpc32/p7/gmp-mparam.h: New file.
2397 * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Up min_size to karatsuba's
2400 2011-11-22 Torbjorn Granlund <tege@gmplib.org>
2402 * mpn/powerpc64/mode64/p6/aorsmul_1.asm: New file.
2404 * configure.in: Don't fail fat builds under 64-bit DOS.
2406 * mpn/powerpc64/mode64/aors_n.asm: Align loop for slightly better
2409 2011-11-21 Torbjorn Granlund <tege@gmplib.org>
2411 * gmp-h.in (__GNU_MP_RELEASE): Renamed from typo name.
2413 2011-11-20 Torbjorn Granlund <tege@gmplib.org>
2415 * configure.in: Split x86 CPUs into more subtypes for more accurate
2416 passing of gcc flags.
2418 * mpn/powerpc32/p3-p7/aors_n.asm: New file.
2420 * configure.in: Pass -m32 for powerpc64 with abi=32, using via _maybe
2423 * configure.in: Support powerpc32/p3-p7 directory for affected CPUs.
2425 2011-11-17 Torbjorn Granlund <tege@gmplib.org>
2427 * tune/speed.c (routine): Add mpn_tabselect.
2428 * tune/common.c (speed_mpn_tabselect): New function.
2429 * tune/speed.h (SPEED_ROUTINE_MPN_COPY_CALL): New macro, made from
2430 old SPEED_ROUTINE_MPN_COPY.
2431 (SPEED_ROUTINE_MPN_COPY): Just invoke SPEED_ROUTINE_MPN_COPY_CALL.
2432 (SPEED_ROUTINE_MPN_TABSELECT): New macro.
2434 2011-11-17 Niels Möller <nisse@lysator.liu.se>
2436 * tune/tuneup.c (tune_hgcd_appr): Increase stop_since_change.
2438 2011-11-16 Torbjorn Granlund <tege@gmplib.org>
2440 * mpn/powerpc32/tabselect.asm: New file.
2442 * mpn/powerpc64/mode64/aorscnd_n.asm: New file.
2444 2011-11-15 Niels Möller <nisse@lysator.liu.se>
2446 * tune/speed.h (speed_mpn_hgcd_appr_lehmer): New prototype.
2447 (mpn_hgcd_lehmer_itch): Likewise.
2448 (mpn_hgcd_appr_lehmer): Likewise.
2449 (mpn_hgcd_appr_lehmer_itch): Likewise.
2450 (MPN_HGCD_LEHMER_ITCH): Deleted macro.
2452 * tune/speed.c (routine): Added mpn_hgcd_appr_lehmer.
2454 * tune/common.c (speed_mpn_hgcd_lehmer): Use mpn_hgcd_lehmer_itch
2455 rather than similarly named macro.
2456 (speed_mpn_hgcd_appr_lehmer): New function.
2458 * tune/Makefile.am (libspeed_la_SOURCES): Added
2461 * tune/hgcd_appr_lehmer.c: New file.
2463 * tune/tuneup.c (tune_hgcd_appr): Increased min_size to 50; some
2464 machines got small thresholds which appear to be bogus.
2466 2011-11-15 Torbjorn Granlund <tege@gmplib.org>
2468 * mpn/generic/powm_sec.c (mpn_local_sqr): Remove forgotten TMP_* calls.
2469 (redcify): Likewise.
2470 (mpn_powm_sec): Likewise.
2472 * mpn/generic/powm_sec.c (mpn_powm_sec): Rework scratch usage
2473 (mpn_powm_sec_itch): Rewrite.
2475 * mpn/generic/powm_sec.c (mpn_powm_sec): Use mpn_tabselect also in
2478 * configure.in: Amend 2011-11-03 gcc_cflags change.
2480 * mpn/powerpc64/tabselect.asm: New file.
2481 * mpn/x86_64/tabselect.asm: New file.
2482 * mpn/x86/tabselect.asm: New file.
2483 * mpn/ia64/tabselect.asm: New file.
2485 * mpn/asm-defs.m4 (define_mpn): Add tabselect.
2487 * configure.in (gmp_mpn_functions): Add tabselect.
2488 (HAVE_NATIVE): Add entries for addncd_n, subcnd_n, tabselect.
2490 * mpn/generic/powm_sec.c: Remove mpn_tabselect implementation.
2491 * mpn/generic/tabselect.c: New file with removed code.
2493 2011-11-13 Torbjorn Granlund <tege@gmplib.org>
2495 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add powm_sec.c.
2497 * mpn/generic/powm_sec.c (win_size): Use POWM_SEC_TABLE
2498 (POWM_SEC_TABLE): Define default.
2500 * tune/tuneup.c (tune_powm_sec): New function computing POWM_SEC_TABLE.
2501 (all): Call new function.
2503 * mpn/generic/powm_sec.c (win_size): Define only when
2504 TUNE_PROGRAM_BUILD is not set.
2506 2011-11-13 Niels Möller <nisse@lysator.liu.se>
2508 * tune/tuneup.c (tune_hgcd_appr): Use default min_size.
2509 (tune_hgcd_reduce): Increase max_size and step_factor, to 7000
2510 and 0.04, respectively.
2512 2011-11-11 Torbjorn Granlund <tege@gmplib.org>
2514 * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: Remove.
2516 2011-11-11 Niels Möller <nisse@lysator.liu.se>
2518 * tune/hgcd_reduce_2.c: New file.
2519 * tune/hgcd_reduce_1.c: New file.
2521 * tune/tuneup.c (hgcd_appr_threshold): New threshold variable.
2522 (hgcd_reduce_threshold): Likewise.
2523 (tune_hgcd_appr): New function.
2524 (tune_hgcd_reduce): New function.
2525 (all): Call tune_hgcd_appr and tune_hgcd_reduce.
2527 * tune/speed.h (speed_mpn_hgcd_reduce): Declaration.
2528 (speed_mpn_hgcd_reduce_[12]): Likewise.
2529 (mpn_hgcd_reduce_[12]): Likewise.
2530 (SPEED_ROUTINE_MPN_HGCD_REDUCE_CALL): New macro.
2532 * tune/speed.c (routine): Added mpn_hgcd_reduce,
2533 mpn_hgcd_reduce_1, and mpn_hgcd_reduce_2.
2535 * tune/common.c (speed_mpn_hgcd_reduce): New function.
2536 (speed_mpn_hgcd_reduce_[12]): Likewise.
2538 * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_reduce_1.c
2540 (TUNE_MPN_SRCS_BASIC): Added hgcd_appr.c and hgcd_reduce.c.
2542 * mpn/generic/hgcd_appr.c (submul, hgcd_matrix_apply): Deleted
2543 functions, earlier copied to hgcd_reduce.c.
2544 (mpn_hgcd_appr): Use hgcd_reduce.
2546 2011-11-09 Torbjorn Granlund <tege@gmplib.org>
2548 * mpn/powerpc64/mode64/sqr_basecase.asm: New file.
2550 * mpn/x86_64/aorscnd_n.asm: New file.
2552 * tune/speed.c (routine): Add measuring of mpn_addcnd_n, mpn_subcnd_n.
2553 * tune/common.c (speed_mpn_addcnd_n,speed_mpn_subcnd_n): New functions.
2554 * tune/speed.h: Declare them.
2556 * tests/devel/try.c: Add tests for mpn_addcnd_n and mpn_subcnd_n.
2557 * tests/refmpn.c (refmpn_addcnd_n, refmpn_subcnd_n): New functions.
2558 * tests/tests.h: Declare them.
2560 * configure.in (gmp_mpn_functions): Add addcnd_n and subcnd_n.
2562 2011-11-07 Torbjorn Granlund <tege@gmplib.org>
2564 * mpn/generic/redc_1.c: Just reduce U operand using Hensel norm, but
2565 not fully canonically; leave add_n and conditional sub_n to caller.
2566 Therefore omit R argument.
2568 * mpn/generic/redc_1_sec.c: Remove.
2570 * gmp-impl.h (mpn_redc_1): Update declaration.
2571 (mpn_redc_1_sec): Remove declaration.
2573 * configure.in (gmp_mpn_functions): Remove redc_1.
2575 * mpn/x86_64/redc_1.asm: Adopt to new defined functionality/interface.
2576 * tune/speed.h (SPEED_ROUTINE_REDC_1): Likewise.
2578 * tests/refmpn.c (refmpn_redc_1): Likewise; also call refmpn_addmul_1
2579 instead of mpn_addmul_1.
2581 * mpn/generic/powm.c (MPN_REDC_1): New macro, use for mpn_redc_1.
2582 * mpn/generic/powm_sec.c (MPN_REDC_1_SEC): New macro, use for
2585 2011-11-03 Torbjorn Granlund <tege@gmplib.org>
2587 * dumbmp.c (mpz_sub): Abort for non-handled case.
2589 * mpn/powerpc64/mode64/lshiftc.asm: Move file from here...
2590 * mpn/powerpc64/lshiftc.asm: ...to here, with trivial modifications.
2592 * configure.in: Pass -m32 in more cases, using _maybe mechanism.
2593 Inherit default gcc_cflags in more places.
2595 * mpn/powerpc64/mode64/p7/gmp-mparam.h: New file.
2597 2011-11-02 Torbjorn Granlund <tege@gmplib.org>
2599 * mpn/s390_64/invert_limb.asm: Slight optimisation.
2601 * configure.in (s390): Set gcc_32_cflags_maybe.
2603 * mpn/s390_32/gmp-mparam.h: Put in proper data.
2604 * mpn/s390_32/esame/gmp-mparam.h: New file.
2606 * mpn/x86_64/bobcat/gmp-mparam.h: New file.
2608 * mpn/s390_32/lshift.asm: New file.
2609 * mpn/s390_32/rshift.asm: New file.
2610 * mpn/s390_32/lshiftc.asm: New file.
2612 2011-10-31 Torbjorn Granlund <tege@gmplib.org>
2614 * mpn/powerpc64/sqr_diagonal.asm: Move from here...
2615 * mpn/powerpc64/mode32/sqr_diagonal.asm: ...to here.
2617 * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: New file.
2619 * mpn/s390_64/sqr_basecase.asm: Rewrite sqr_diag_addlsh1 code.
2620 * mpn/s390_32/esame/sqr_basecase.asm: Likewise.
2622 2011-10-29 Torbjorn Granlund <tege@gmplib.org>
2624 * mpn/s390_64/lshift.asm: Complete rewrite.
2625 * mpn/s390_64/rshift.asm: Likewise.
2627 * mpn/s390_64/lshiftc.asm: New file.
2629 2011-10-28 Torbjorn Granlund <tege@gmplib.org>
2631 * mpn/s390_32/esame/aors_n.asm: New file, with rewritten add/sub code.
2633 2011-10-27 Torbjorn Granlund <tege@gmplib.org>
2636 * gmp-impl.h (BSWAP_LIMB): Rename variable to avoid BSWAP_LIMB_FETCH
2639 * mpn/s390_32/esame/mul_basecase.asm: New file.
2641 * mpn/s390_32/esame/sqr_basecase.asm: New file.
2643 * mpn/s390_32/logops_n.asm: New file.
2645 * mpn/s390_64/logops_n.asm: Fix rp=up code. Remove a leftover insn.
2647 2011-10-26 Niels Möller <nisse@lysator.liu.se>
2649 * gmp-impl.h (mpn_hgcd_reduce, mpn_hgcd_reduce_itch): Added
2651 (HGCD_APPR_THRESHOLD): Set up threshold for tuning.
2652 (HGCD_REDUCE_THRESHOLD): Likewise.
2654 * configure.in (gmp_mpn_functions): Added hgcd_reduce.
2656 * mpn/generic/hgcd_reduce.c: New file.
2658 2011-10-24 Torbjorn Granlund <tege@gmplib.org>
2660 * mpn/x86_64/sqr_basecase.asm: Put intermediate result into R, don't
2661 allocate any stack space.
2663 2011-10-23 Torbjorn Granlund <tege@gmplib.org>
2665 * mpn/s390_64/logops_n.asm: Use nc, oc, xc when possible.
2667 * tune/common.c (speed_mpn_and_n, speed_mpn_andn_n, etc):
2668 Pass correct input args.
2670 * mpn/s390_64/mod_34lsub1.asm: Use llgfr for zero extensions.
2672 * mpn/s390_64/mul_basecase.asm: New file.
2674 * mpn/s390_64/sqr_basecase.asm: New file.
2675 * mpn/s390_64/sqr_diag_addlsh1.asm: Removed, lives on in sqr_basecase.
2677 * mpn/s390_64/bdiv_dbm1c.asm: Shave off 1 c/l.
2679 * mpn/s390_64/aorrlsh1_n.asm: New file, developed from aorslsh1_n.asm.
2680 * mpn/s390_64/sublsh1_n.asm: New file.
2681 * mpn/s390_64/aorslsh1_n.asm: Remove file.
2683 2011-10-22 Torbjorn Granlund <tege@gmplib.org>
2685 * mpn/s390_64/logops_n.asm: New file.
2687 * mpn/s390_64/aors_n.asm: New file, with rewritten add/sub code.
2689 2011-10-20 Torbjorn Granlund <tege@gmplib.org>
2691 * tune/speed.h (SPEED_ROUTINE_MPN_SQR_DIAL_ADDLSH1_CALL): New macro.
2692 * tune/common.c (speed_mpn_sqr_diag_addlsh1): New function.
2693 * tune/speed.c (routine): Measure mpn_sqr_diag_addlsh1.
2695 * mpn/s390_64/sqr_diag_addlsh1.asm: Rewrite like s390_32/esame code.
2697 * mpn/s390_32/esame/sqr_diag_addlsh1.asm: Save just needed registers.
2699 2011-10-19 Torbjorn Granlund <tege@gmplib.org>
2701 * mpn/s390_32/esame/add_n.asm: Rewrite, similar to s390_64 code.
2702 * mpn/s390_32/esame/add_n.asm: Likewise.
2704 2011-10-17 Torbjorn Granlund <tege@gmplib.org>
2706 * mpn/s390_32/esame/aorslsh1_n.asm: New file.
2708 2011-10-16 Torbjorn Granlund <tege@gmplib.org>
2710 * mpn/s390_32/esame/sqr_diag_addlsh1.asm: New file.
2712 * mpn/s390_32/copyi.asm: New file.
2713 * mpn/s390_32/copyd.asm: New file.
2715 * mpn/s390_64/copyd.asm: Optimise.
2717 * mpn/s390_64/copyi.asm: Rewrite along the lines of glibc memcpy.
2719 * mpn/s390_64/aorslsh1_n.asm: New file.
2721 * mpn/s390_64/mod_34lsub1.asm: New file.
2723 * mpn/s390_64/sqr_diag_addlsh1.asm: New file.
2725 2011-10-15 Torbjorn Granlund <tege@gmplib.org>
2727 * configure.in (s390): Rewrite support to handle known CPUs.
2728 * config.guess: Recognise s390 CPUs.
2729 * config.sub: Match s390 CPUs.
2730 * acinclude.m4 (S390_PATTERN, S390X_PATTERN): New defines.
2732 2011-10-14 Torbjorn Granlund <tege@gmplib.org>
2735 * mpn/generic/popham.c: Add __GMP_NOTHROW to make it match gmp.h.
2736 * mpn/generic/gcd_1.c: Separate declarations and initialisers for the
2739 * configure.in: AC_DEFINE HAVE_HOST_CPU_s390_zarch.
2740 * longlong.h (s390): Use it.
2741 (s390 umul_ppmm): Fix typo in pure C variant.
2743 2011-10-13 Torbjorn Granlund <tege@gmplib.org>
2745 * longlong.h (s390): Put back an accidentally deleted #else.
2747 * configure.in (s390): Unset extra_functions for s390x.
2749 2011-10-12 Torbjorn Granlund <tege@gmplib.org>
2751 * mpn/s390_64/lshift.asm: Reduce register usage.
2752 * mpn/s390_64/rshift.asm: Likewise.
2754 * longlong.h (s390 umul_ppmm): With new-enough gcc, avoid asm.
2756 From Andreas Krebbel:
2757 * longlong.h (s390 umul_ppmm): Support 32-bit limbs with gcc using
2759 (s390 udiv_qrnnd): Likewise.
2761 2011-10-11 Torbjorn Granlund <tege@gmplib.org>
2763 * configure.in (s390x): Pass -mzarch to gcc in 32-bit mode.
2765 * longlong.h (s390x): Add __CLOBBER_CC for relevant asm patterns.
2766 * mpn/generic/mod_1_1.c (s390x add_mssaaaa): Likewise.
2768 * mpn/s390_64/copyd.asm: New file.
2770 2011-10-10 Niels Möller <nisse@lysator.liu.se>
2772 * mpn/generic/hgcd_appr.c: Deleted debugging code.
2774 * tests/mpn/t-hgcd_appr.c (main): Added -v flag.
2775 (hgcd_appr_valid_p): Increased margin of non-minimality for
2776 divide-and-conquer algorithm. Display bit counts only if
2779 * mpn/generic/hgcd_appr.c (submul): New (static) function.
2780 (hgcd_matrix_apply): New function.
2781 (mpn_hgcd_appr_itch): Account for divide-and-conquer algorithm.
2782 (mpn_hgcd_appr): Implemented divide-and-conquer.
2784 2011-10-10 Torbjorn Granlund <tege@gmplib.org>
2786 * mpn/generic/mod_1_1.c (add_mssaaaa): Add s390x variant. Put arm code
2789 * tune/time.c (STCK): Use proper memory constraint.
2792 * tests/mpz/t-scan.c (check_ref): Fix loop end bound.
2794 2011-10-10 Niels Möller <nisse@lysator.liu.se>
2796 * gmp-impl.h: (HGCD_APPR_THRESHOLD): New threshold.
2798 * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Interface change.
2799 Destroy inputs, let caller make working copies if needed.
2800 (mpn_hgcd_appr_itch): Reduced scratch need.
2801 * gmp-impl.h: Updated mpn_hgcd_appr prototype.
2802 * tests/mpn/t-hgcd_appr.c (one_test): Make working copies for
2804 * tune/common.c (speed_mpn_hgcd_appr): Use SPEED_ROUTINE_MPN_HGCD_CALL.
2805 * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_APPR_CALL): Deleted.
2807 2011-10-09 Torbjorn Granlund <tege@gmplib.org>
2809 * mpn/s390_64/copyi.asm: New file.
2810 * mpn/s390_64/lshift.asm: New file.
2811 * mpn/s390_64/rshift.asm: New file.
2813 * mpn/s390_64/add_n.asm: Rewrite using lmg/stmg.
2814 * mpn/s390_64/sub_n.asm: Likewise.
2816 * mpn/s390_64/invert_limb.asm: Save a callee-saves register less.
2818 * tune/time.c (getrusage_backwards_p): Properly cast printed values.
2820 * longlong.h (s390x): Put back UDItype casts to make gcc reloading use
2821 right more for constants.
2822 (s390x count_leading_zeros): Disable until we support z10 specifically.
2823 (s390x add_ssaaaa): Remove algsi/slgsi until we support z10.
2825 2011-10-09 Niels Möller <nisse@lysator.liu.se>
2827 * mpn/generic/hgcd_matrix.c (mpn_hgcd_matrix_adjust): Declare
2828 matrix argument const.
2830 2011-10-08 Niels Möller <nisse@lysator.liu.se>
2832 * tests/mpn/t-hgcd_appr.c (hgcd_appr_valid_p): Adjusted the
2833 allowed margin of non-minimality for hgcd_appr.
2835 * mpn/generic/hgcd_appr.c (mpn_hgcd_appr): Fixed handling of
2836 extra_bits, starting at zero, to ensure that we don't produce too
2837 small remainders. Added a final reduction loop when we we
2838 otherwise terminate with extra_bits > 0, to make the returned
2839 remainders closer to minimal.
2841 2011-10-07 Torbjorn Granlund <tege@gmplib.org>
2843 * longlong.h (s390): Add 32-bit zarch umul_ppmm and udiv_qrnnd.
2844 (s390): Overhaul 32-bit and 64-bit code.
2846 2011-10-07 Niels Möller <nisse@lysator.liu.se>
2848 * tune/speed.h (speed_mpn_hgcd_appr): New prototype.
2849 (SPEED_ROUTINE_MPN_HGCD_APPR_CALL): New macro.
2850 * tune/common.c (speed_mpn_hgcd_appr): New function.
2851 * tune/speed.c (routine): Added mpn_hgcd_appr.
2853 * tests/mpn/t-hgcd_appr.c: New file.
2854 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-hgcd_appr.
2856 * configure.in (gmp_mpn_functions): Added hgcd_step and hgcd_appr.
2858 * gmp-impl.h: Added prototypes for mpn_hgcd_step,
2859 mpn_hgcd_appr_itch and mpn_hgcd_appr.
2861 * mpn/generic/hgcd_appr.c: New file.
2863 * mpn/generic/hgcd_step.c: New file, extracted from hgcd.c.
2864 (mpn_hgcd_step): Renamed, from...
2865 * mpn/generic/hgcd.c (hgcd_step): ...old name. Renamed and moved
2867 (hgcd_hook): Also moved to hgcd_step.c.
2868 (mpn_hgcd): Updated for hgcd_step renaming.
2870 2011-10-06 Torbjorn Granlund <tege@gmplib.org>
2872 * mpn/s390_64/invert_limb.asm: New file.
2874 2011-10-04 Torbjorn Granlund <tege@gmplib.org>
2876 * mpn/s390_64/submul_1.asm: New file.
2877 * mpn/s390_32/esame/submul_1.asm: New file.
2879 * mpn/generic/mulmid.c (mpn_mulmid): Move a TMP_DECL to block start.
2881 * mpn/Makefile.am (TARG_DIST): Add s390_32 and s390_64, remove s390 and
2884 * doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
2886 * demos/factorize.c: Run 25 Miller-Rabin tests.
2888 * mpz/nextprime.c: Run 25 mpz_millerrabin tests (was 10).
2890 2011-10-03 Torbjorn Granlund <tege@gmplib.org>
2892 * configure.in: Support s390x.
2894 * longlong.h: Add support for 64-bit s390x.
2896 * mpn/s390_64: New directory.
2897 * mpn/s390_64/add_n.asm: New file.
2898 * mpn/s390_64/sub_n.asm: New file.
2899 * mpn/s390_64/mul_1.asm: New file.
2900 * mpn/s390_64/addmul_1.asm: New file.
2901 * mpn/s390_64/bdiv_dbm1c.asm: New file.
2902 * mpn/s390_64/gmp-mparam.h: New file, taken from x86_64.
2904 * mpn/s390_32: Directory renamed from mpn/s390.
2905 * mpn/s390_32/gmp-mparam.h: New file, taken from x86_64.
2906 * mpn/s390_32/esame/add_n.asm: New file.
2907 * mpn/s390_32/esame/sub_n.asm: New file.
2908 * mpn/s390_32/esame/mul_1.asm: New file.
2909 * mpn/s390_32/esame/addmul_1.asm: New file.
2910 * mpn/s390_32/esame/bdiv_dbm1c.asm: New file.
2912 2011-10-03 Niels Möller <nisse@lysator.liu.se>
2914 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mulmid.
2915 * tests/mpn/t-mulmid.c: New file.
2917 mulmid-related assembly for x86_64, from David Harvey:
2918 * mpn/asm-defs.m4 (define_mpn): Added [add,sub]_err[1,2,3]_n and
2919 mulmid_basecase. Also use m4_not_for_expansion on the
2920 corresponding OPERATION_* symbols.
2921 * mpn/x86_64/aors_err1_n.asm: New file.
2922 * mpn/x86_64/aors_err2_n.asm: Likewise.
2923 * mpn/x86_64/aors_err3_n.asm: Likewise.
2924 * mpn/x86_64/mulmid_basecase.asm: Likewise.
2925 * mpn/x86_64/core2/aors_err1_n.asm: Likewise.
2926 * mpn/x86_64/gmp-mparam.h (MULMID_TOOM42_THRESHOLD): New value.
2927 * mpn/x86_64/core2/gmp-mparam.h (MULMID_TOOM42_THRESHOLD): Likewise.
2929 Tuning of mulmid, from David Harvey:
2930 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added mulmid.c
2931 mulmid_n.c toom42_mulmid.c.
2932 * tune/speed.h: Prototypes for mulmid-related functions.
2933 (struct speed_params): Increased max number of sources to 5.
2934 (SPEED_ROUTINE_MPN_BINARY_ERR_N_CALL): New macro.
2935 (SPEED_ROUTINE_MPN_BINARY_ERR1_N): Likewise.
2936 (SPEED_ROUTINE_MPN_BINARY_ERR2_N): Likewise.
2937 (SPEED_ROUTINE_MPN_BINARY_ERR3_N): Likewise.
2938 (SPEED_ROUTINE_MPN_MULMID): Likewise.
2939 (SPEED_ROUTINE_MPN_MULMID_N): Likewise.
2940 (SPEED_ROUTINE_MPN_TOOM42_MULMID): Likewise.
2941 * tune/common.c (mpn_[add,sub]_err[1,2,3]_n): New functions.
2942 (speed_mpn_mulmid_basecase): New function.
2943 (speed_mpn_mulmid): New function.
2944 (speed_mpn_mulmid_n): New function.
2945 (speed_mpn_toom42_mulmid): New function.
2946 * tune/speed.c (routine): Added mpn_[add,sub]_err[1,2,3]_n,
2947 mpn_mulmid_basecase, mpn_toom42_mulmid, mpn_mulmid_n, and
2949 * tune/tuneup.c (mulmid_toom42_threshold): New threshold variable.
2950 (tune_mulmid): New function.
2951 (all): Call tune_mulmid.
2953 Testing of mulmid, from David Harvey:
2954 * tests/refmpn.c (AORS_ERR1_N): New macro.
2955 (refmpn_add_err1_n, refmpn_sub_err1_n): New functions.
2956 (AORS_ERR2_N): New macro.
2957 (refmpn_add_err2_n, refmpn_sub_err2_n): New functions.
2958 (AORS_ERR3_N): New macro.
2959 (refmpn_add_err3_n, refmpn_sub_err3_n): New functions.
2960 (refmpn_mulmid_basecase): New function.
2961 (refmpn_toom42_mulmid): New function, wrapper for
2962 refmpn_mulmid_basecase.
2963 (refmpn_mulmid_n): Likewise.
2964 (refmpn_mulmid): Likewise.
2965 * tests/tests.h: Prototypes for new functions.
2966 * tests/devel/try.c (NUM_SOURCES): Increased to 5.
2967 (struct try_t): Use NUM_SOURCES and NUM_DESTS constants.
2968 (SIZE_4, SIZE_6, SIZE_DIFF_PLUS_3, SIZE_ODD): New constants.
2969 (OVERLAP_NOT_DST2): New flag.
2970 (param_init): New mulmid-related operation types.
2971 (mpn_toom42_mulmid_fun): New function.
2972 (choice_array): Added mulmid-related entries.
2973 (overlap_array): Extended for larger NUM_SOURCES.
2974 (OVERLAP_COUNT): Handle OVERLAP_NOT_DST2.
2975 (call): Support mulmid-related functions.
2976 (pointer_setup): Handle SIZE_4, SIZE_6, and SIZE_DIFF_PLUS_3.
2977 (SIZE_ITERATION): Handle SIZE_ODD.
2978 (SIZE2_FIRST): Handle SIZE_CEIL_HALF.
2979 (SIZE2_LAST): Likewise.
2981 Implementation of mulmid, from David Harvey:
2982 * mpn/generic/add_err1_n.c (mpn_add_err1_n): New file and function.
2983 * mpn/generic/add_err2_n.c (mpn_add_err2_n): Likewise.
2984 * mpn/generic/add_err3_n.c (mpn_add_err3_n): Likewise.
2985 * mpn/generic/sub_err1_n.c (mpn_sub_err1_n): Likewise.
2986 * mpn/generic/sub_err2_n.c (mpn_sub_err2_n): Likewise.
2987 * mpn/generic/sub_err3_n.c (mpn_sub_err3_n): Likewise.
2988 * mpn/generic/mulmid_basecase.c (mpn_mulmid_basecase): Likewise.
2989 * mpn/generic/mulmid_n.c (mpn_mulmid_n): Likewise.
2990 * mpn/generic/toom42_mulmid.c (mpn_toom42_mulmid): Likewise.
2991 * configure.in (gmp_mpn_functions): Added mulmid-related
2993 (GMP_MULFUNC_CHOICES): Handle aors_err1_n, aors_err2_n, and
2995 * gmp-impl.h: Added prototypes for mulmid functions.
2996 (MPN_TOOM42_MULMID_MINSIZE): New constant.
2997 (MULMID_TOOM42_THRESHOLD): New threshold.
2998 (mpn_toom42_mulmid_itch): New macro.
3000 2011-10-03 Niels Möller <nisse@lysator.liu.se>
3002 * tune/tune-gcd-p.c (main): Fixed broken loop conditions.
3004 2011-09-26 Torbjorn Granlund <tege@gmplib.org>
3006 * mpn/sh/sh2/submul_1.asm: Make this old submul_1 implementation
3007 actually compute intended function.
3009 * longlong.h (SH): Recognise predefs for all SH processors as defined
3010 by current gcc versions.
3012 2011-09-25 Torbjorn Granlund <tege@gmplib.org>
3014 * mpn/sh: Migrate files to '.asm'.
3015 * configure.in: Recognise sh3 and sh4.
3017 2011-09-21 Marc Glisse <marc.glisse@inria.fr>
3019 * gmpxx.h (mpz_class::swap): New function.
3020 (mpq_class::swap): Likewise.
3021 (mpf_class::swap): Likewise.
3022 (swap): New function.
3023 * tests/cxx/t-assign.cc: Test the above.
3024 * doc/gmp.texi (swap): Document the above.
3026 2011-08-21 Marc Glisse <marc.glisse@inria.fr>
3028 * tests/cxx/t-ops2.cc: check mul-div by 2.
3030 * gmpxx.h (__GMPXX_CONSTANT): New macro (__builtin_constant_p).
3031 (__gmp_binary_lshift): Move before multiplication. Optimize x << 0.
3032 (__gmp_binary_rshift): Move before division. Optimize x >> 0.
3033 (__gmp_binary_plus): Optimize x + 0. Rewrite rational + integer.
3034 (__gmp_binary_minus): Optimize x - 0 and 0 - x.
3035 Rewrite rational - integer.
3036 (__gmp_binary_multiplies): Optimize x * 2^n.
3037 (__gmp_binary_divides): Optimize x / 2^n.
3038 (__gmp_binary_*): Deduplicate code for symmetric operations.
3040 2011-08-18 Torbjorn Granlund <tege@gmplib.org>
3042 * printf/doprntf.c (__gmp_doprnt_mpf): For DOPRNT_CONV_FIXED, ask for
3045 2011-08-17 Torbjorn Granlund <tege@gmplib.org>
3047 * mpf/sub.c: Fix typo in copy condition. Delay an allocation.
3049 2011-08-12 Torbjorn Granlund <tege@gmplib.org>
3051 * gmp-impl.h (LIMBS_PER_DIGIT_IN_BASE): Fix typo.
3053 2011-08-10 Torbjorn Granlund <tege@gmplib.org>
3055 * gmp-impl.h (DIGITS_IN_BASEGT2_FROM_BITS): New.
3056 (DIGITS_IN_BASE_FROM_BITS): Compute more accurate result.
3057 (MPN_SIZEINBASE): Use DIGITS_IN_BASEGT2_FROM_BITS.
3059 * tests/rand/t-lc2exp.c (check_bigc): Call abort after reporting error.
3061 2011-08-09 Torbjorn Granlund <tege@gmplib.org>
3063 * mpz/out_str.c (mpz_out_str): Reinsert accidentally deleted str_size
3066 * gmp-impl.h (DIGITS_IN_BASE_FROM_BITS): Simplify, also avoiding
3067 overflow for base 2.
3069 2011-08-07 Torbjorn Granlund <tege@gmplib.org>
3071 * gmp-impl.h (struct bases): Add log2b and logb2 field, remove
3072 chars_per_limb_exactly field.
3073 (DIGITS_IN_BASE_FROM_BITS): New.
3074 (DIGITS_IN_BASE_PER_LIMB): New.
3075 (LIMBS_PER_DIGIT_IN_BASE): New.
3076 * gen-bases.c: Generate log2b and logb2 fields; do not generate
3077 chars_per_limb_exactly field.
3078 * mpf/get_str.c mpf/out_str.c mpf/set_str.c mpn/generic/get_str.c
3079 mpn/generic/sizeinbase.c mpq/get_str.c mpz/inp_str.c mpz/out_str.c
3080 mpz/set_str.c printf/doprntf.c tune/speed.h tune/tuneup.c:
3083 2011-08-04 Torbjorn Granlund <tege@gmplib.org>
3085 * dumbmp.c (mpz_root): Reinsert accidentally removed line.
3087 2011-08-03 Torbjorn Granlund <tege@gmplib.org>
3089 * dumbmp.c (mpz_tdiv_qr): Correctly handle dividend value being equal
3091 (mpz_root): Create reasonable starting approximation.
3092 (mpz_sqrt): New function.
3093 (mpz_mul_2exp): Add faster block shifting code, disabled for now.
3095 2011-07-15 Torbjorn Granlund <tege@gmplib.org>
3097 * mpn/arm/invert_limb.asm: Swap around some registers to silence 'as'
3100 2011-07-14 Torbjorn Granlund <tege@gmplib.org>
3102 * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q): Get mpn_sub_1 size
3105 2011-07-04 Torbjorn Granlund <tege@gmplib.org>
3107 * tests/misc/t-locale.c: Disable test for mingw.
3109 * configure.in (x86_64 *-*-mingw*): Handle also cygwin here; clear out
3112 2011-07-02 Torbjorn Granlund <tege@gmplib.org>
3114 * config.guess: Don't print newline in x86 cpuid function.
3115 Rewrite x86-64 cpu recognition asm code to work under Windoze.
3117 2011-06-16 Torbjorn Granlund <tege@gmplib.org>
3119 * acinclude.m4 (GMP_ASM_RODATA): Fix typo in 2011-04-20 change.
3121 * configure.in: Surround tr ranges with [] for portability.
3123 2011-05-25 Niels Möller <nisse@lysator.liu.se>
3125 * tune/tune-gcd-p.c (search): New function to search for minimum.
3126 (main): Replaced slow linear search.
3128 2011-05-24 Niels Möller <nisse@lysator.liu.se>
3130 * tune/Makefile.am (EXTRA_PROGRAMS): Added tune-gcd-p. Also added
3131 related automake variables.
3133 * mpn/Makefile.am (tune-gcd-p): Deleted target.
3135 * tune/tune-gcd-p.c: New file, extracted from mpn/generic/gcd.c
3137 * mpn/generic/gcd.c: Deleted the corresponding code, including
3140 2011-05-23 Niels Möller <nisse@lysator.liu.se>
3142 * mpz/jacobi.c (mpz_jacobi): Simplied by swapping operands when
3143 needed, to get asize >= bsize. Use the reciprocity law generalized
3144 to work when one operand is even.
3146 2011-05-22 Niels Möller <nisse@lysator.liu.se>
3148 * mpz/jacobi.c (mpz_jacobi): Another bugfix for the asize == 1
3149 case. Sometimes, powers of two in b were taken into account twice.
3151 2011-05-21 Niels Möller <nisse@lysator.liu.se>
3153 * mpz/jacobi.c (mpz_jacobi): The handling of asize == 1 was
3156 * tests/mpz/t-jac.c (mpz_nextprime_step): Sanity check that prime
3157 candidate and step has no common factor.
3158 (check_data): Added some test cases related to the asize == 1 case
3161 2011-05-20 Niels Möller <nisse@lysator.liu.se>
3163 * gmp-impl.h: Jacobi-related prototypes.
3165 * configure.in (gmp_mpn_functions): Added jacobi_2, jacobi,
3166 hgcd2_jacobi, hgcd_jacobi, and removed jacobi_lehmer.
3168 * mpz/jacobi.c (STRIP_TWOS): Deleted macro.
3169 (mpz_jacobi): Partially rewritten, to no longer makes the A
3170 operand odd. Use new mpn_jacobi_n.
3172 * mpn/generic/jacobi_lehmer.c: Deleted file.
3174 * mpn/generic/jacobi.c (mpn_jacobi_n): New subquadratic jacobi
3175 implementation. Supersedes jacobi_lehmer.c.
3177 * mpn/generic/hgcd_jacobi.c (mpn_hgcd_jacobi): New file and
3178 function. A copy of mpn_hgcd, using mpn_hgcd2_jacobi, and with calls to
3179 mpn_jacobi_update when appropriate.
3181 * mpn/generic/jacobi_2.c (mpn_jacobi_2): New file. Extracted from
3183 * mpn/generic/hgcd2_jacobi.c (mpn_hgcd2_jacobi): Likewise.
3185 * mpn/generic/hgcd.c (hgcd_hook): Avoid using NULL.
3187 2011-05-19 Niels Möller <nisse@lysator.liu.se>
3189 * tune/hgcd_lehmer.c (__gmpn_hgcd_itch): Don't rename symbols for
3190 the functions moved to hgcd_matrix.c.
3192 * configure.in (gmp_mpn_functions): Added hgcd_matrix.
3194 * mpn/generic/hgcd.c (hgcd_matrix_update_1): Deleted. Several other
3195 helper functions moved to hgcd_matrix.c, see below.
3196 (hgcd_hook): New function.
3197 (hgcd_step): Simplified, using mpn_gcd_subdiv_step and hgcd_hook.
3199 * mpn/generic/hgcd_matrix.c: New file.
3200 (mpn_hgcd_matrix_init): Moved here, from hgcd.c.
3201 (mpn_hgcd_matrix_update_q): Likewise.
3202 (mpn_hgcd_matrix_mul_1): Likewise.
3203 (mpn_hgcd_matrix_mul): Likewise.
3204 (mpn_hgcd_matrix_adjust): Likewise.
3206 * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): New
3207 argument s, for use by hgcd.
3208 * gmp-impl.h (mpn_gcd_subdiv_step): Update declaration.
3210 * mpn/generic/gcd.c (mpn_gcd): Pass s = 0 to mpn_gcd_subdiv_step.
3211 * mpn/generic/gcdext.c (mpn_gcdext): Likewise. Also added an ASSERT.
3212 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Likewise.
3213 (mpn_gcdext_hook): Added some ASSERTs.
3214 * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): Likewise.
3216 2011-05-17 Niels Möller <nisse@lysator.liu.se>
3218 * doc/gmp.texi (mpn_gcd, mpn_gcdext): Document input requirements:
3219 Must have un >= vn > 0, and V normalized.
3220 * mpn/generic/gcdext.c (mpn_gcdext): Added ASSERT for input
3222 * mpn/generic/gcd.c (mpn_gcd): Added ASSERTs for input
3225 2011-05-15 Marc Glisse <marc.glisse@inria.fr>
3227 * gmpxx.h (operator<<): Dedup.
3228 * tests/cxx/t-iostream.cc: Test on compound types.
3230 * gmpxx.h (__gmp_binary_expr): Let things happen in place: c=(a+b)/2.
3232 2011-05-10 Marc Glisse <marc.glisse@inria.fr>
3234 * gmpxx.h (__gmp_unary_expr): Let things happen in place: c=-(a+b).
3235 (operator>>): Clean the commenting out.
3236 * tests/cxx/t-iostream.cc: New file.
3237 * tests/cxx/Makefile.am: Added t-iostream.
3239 2011-05-10 Niels Möller <nisse@lysator.liu.se>
3241 * doc/gmp.texi (mpz_gcd): Document that gcd(0,0) = 0.
3242 (mpz_gcdext): Document range for cofactors.
3244 2011-05-09 Niels Möller <nisse@lysator.liu.se>
3246 * mpz/gcdext.c (mpz_gcdext): Increased sp allocation to bsize+1 limbs.
3247 * doc/gmp.texi (mpn_gcdext): Fixed documentation of allocation
3248 requirements; one extra limb is still needed for S.
3250 2011-05-09 Torbjorn Granlund <tege@gmplib.org>
3252 * mpn/x86/fat/gmp-mparam.h (BMOD_1_TO_MOD_1_THRESHOLD): Define.
3253 * mpn/x86_64/fat/gmp-mparam.h (BMOD_1_TO_MOD_1_THRESHOLD): Define.
3255 2011-05-08 Marc Glisse <marc.glisse@inria.fr>
3257 * gmpxx.h: Replace unsigned long with mp_bitcnt_t in many places.
3258 * doc/gmp.texi: Likewise.
3260 2011-05-06 Marc Glisse <marc.glisse@inria.fr>
3262 * gmpxx.h (mpz_class): Make constructor from mp[qf]_class explicit.
3263 (mpq_class): Make constructor from mpf_class explicit.
3264 * doc/gmp.texi: Document the above.
3265 * NEWS: Likewise, and mention the EOF istream fix.
3266 * tests/cxx/t-mix.cc: New file.
3267 * tests/cxx/Makefile.am: Added t-mix.
3269 * tests/cxx/t-assign.cc: Minor tweak.
3270 * tests/cxx/t-misc.cc: Likewise.
3272 * gmpxx.h (__gmp_resolve_temp): Remove.
3273 (__gmp_set_expr): Remove some overloads.
3274 (mpq_class): mpz_init_set the numerator and denominator instead of
3276 (mpz_class): Dedup the string constructors.
3277 (mpq_class): Likewise.
3279 * tests/cxx/t-ops3.cc: New file.
3280 * tests/cxx/Makefile.am: Added t-ops3.
3282 2011-05-05 Torbjorn Granlund <tege@gmplib.org>
3284 * mpz/gcdext.c: Correct sgn computation.
3287 2011-05-05 Marc Glisse <marc.glisse@inria.fr>
3289 * mpn/x86_64/fat/fat.c: Update for Sandy Bridge.
3290 * config.guess: warning to keep it in sync with fat.c.
3292 2011-05-05 Torbjorn Granlund <tege@gmplib.org>
3294 * mpn/x86_64/fat/fat_entry.asm (PIC_OR_DARWIN): New symbol. Use it to
3295 work around Darwin problems.
3297 2011-05-04 Niels Möller <nisse@lysator.liu.se>
3299 * mpz/gcdext.c (mpz_gcdext): Reduced temporary allocations. Use
3300 mpz_divexact when computing the second cofactor.
3302 2011-05-03 David Harvey <dmharvey@cims.nyu.edu>
3304 * configure.in: make invert_limb_table work correctly with
3305 --disable-assembly (from Niels Moller)
3307 2011-05-02 Marc Glisse <marc.glisse@inria.fr>
3309 * .bootstrap: libtoolize doesn't need -c.
3311 * configfsf.guess: Update to version of 2011-02-02.
3312 * configfsf.sub: Update to version of 2011-03-23.
3314 2011-05-02 Niels Möller <nisse@lysator.liu.se>
3316 * mpz/gcdext.c (mpz_gcdext): Don't allocate extra limbs at the end
3317 of mpn_gcdext parameters.
3319 * doc/gmp.texi (mpn_gcdext): Updated doc.
3321 2011-05-01 Niels Möller <nisse@lysator.liu.se>
3323 * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Fixed ASSERT.
3325 2011-04-30 Marc Glisse <marc.glisse@inria.fr>
3327 * gmp-h.in (mpz_cdiv_q_2exp): Use mp_bitcnt_t to match the definition
3328 and the documentation.
3329 (mpz_remove): Likewise.
3332 * ltmain.sh: Remove.
3333 * .bootstrap: Let libtoolize generate ltmain.sh.
3335 * tests/cxx/t-ops2.cc: Add a couple tests.
3336 * tests/cxx/t-rand.cc: Likewise.
3338 * doc/gmp.texi (mpf_urandomb): Explicit the fact that it does not
3339 change the precision.
3341 * gmp-h.in (__GMP_EXTERN_INLINE): Recent g++ uses gnu_inline.
3343 2011-04-28 Torbjorn Granlund <tege@gmplib.org>
3345 * configure.in (x86_64): Support bobcat specifically.
3346 (x86): Match bobcat and bulldozer, handle like k10.
3348 2011-04-28 David Harvey <dmharvey@cims.nyu.edu>
3350 * README.HG: update autotools version numbers.
3352 2011-04-27 Torbjorn Granlund <tege@gmplib.org>
3354 * tune/speed.h (speed_cyclecounter): Always use PIC variant when
3355 compiled with Apple's GCC.
3357 * mpn/x86/darwin.m4 (LEA): Complete rewrite.
3358 (m4append): New macro.
3360 2011-04-26 Torbjorn Granlund <tege@gmplib.org>
3362 * mpn/sparc32/sparc-defs.m4 (changecom): Don't redefine '!' as it
3363 interferes with expressions.
3365 2011-04-20 Torbjorn Granlund <tege@gmplib.org>
3367 * acinclude.m4 (GMP_ASM_RODATA): Make 'foo' larger to avoid clang
3370 2011-04-12 Niels Möller <nisse@lysator.liu.se>
3372 * mpn/x86_64/invert_limb.asm [PIC]: Declare mpn_invert_limb_table
3375 2011-04-11 Torbjorn Granlund <tege@gmplib.org>
3377 * mpn/x86/k7/invert_limb.asm: Use deflit for Darwin bug workaround.
3378 Undo 2011-03-28 change.
3380 * mpn/asm-defs.m4 (define_mpn): Use deflit.
3382 2011-04-10 Niels Möller <nisse@lysator.liu.se>
3384 * mpn/asm-defs.m4 (define_mpn): Added invert_limb_table.
3386 * configure.in: Add invert_limb_table to extra_functions_64 on
3389 * mpn/x86_64/invert_limb.asm: Changed references from approx_tab
3390 mpn_invert_limb_table.
3392 * mpn/x86_64/invert_limb_table.asm (mpn_invert_limb_table): New
3393 file. Extracted approximation table from invert_limb.asm, renamed
3396 2011-03-30 Niels Möller <nisse@lysator.liu.se>
3398 * mpn/x86_64/div_qr_2u_pi1.asm: New file.
3400 * configure.in (gmp_mpn_functions): Add div_qr_2u_pi1.
3402 * gmp-impl.h (mpn_div_qr_2u_pi1): Declare.
3404 * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Moved to
3405 separate file, from...
3406 * mpn/generic/div_qr_2.c: ... old location.
3408 * mpn/generic/div_qr_2n_pi1.c: Renamed file, from...
3409 * mpn/generic/div_qr_2_pi1_norm.c: ...old name.
3410 * mpn/x86_64/div_qr_2n_pi1.asm: Renamed file, from...
3411 * mpn/x86_64/div_qr_2_pi1_norm.asm: ...old name.
3413 * gmp-impl.h (mpn_div_qr_2n_pi1): Use new name in declaration.
3414 * tune/speed.h (speed_mpn_div_qr_2n): Likewise.
3415 (speed_mpn_div_qr_2u): Likewise.
3417 * tune/tuneup.c (tune_div_qr_2): Use new name speed_mpn_div_qr_2n.
3419 * tune/speed.c (routine): Use new names mpn_div_qr_2n and
3420 mpn_div_qr_2u, also on the command line.
3422 * tune/common.c (speed_mpn_div_qr_2n): Renamed, from...
3423 (speed_mpn_div_qr_2_norm): ... old name.
3424 (speed_mpn_div_qr_2u): Renamed, from...
3425 (speed_mpn_div_qr_2_unnorm): ... old name.
3427 * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2n_pi1): Renamed,
3429 (mpn_div_qr_2_pi1_norm): ...old name.
3430 * mpn/x86_64/div_qr_2_pi1_norm.asm: Likewise.
3432 * mpn/generic/div_qr_2.c (mpn_div_qr_2n_pi2): Renamed, from...
3433 (mpn_div_qr_2_pi2_norm): ... old name.
3434 (mpn_div_qr_2u_pi1): Renamed, from...
3435 (mpn_div_qr_2_pi1_unnorm): ... old name.
3436 (mpn_div_qr_2): Call functions using new names.
3438 * mpn/asm-defs.m4: Renamed div_qr_2-functions to new names.
3440 2011-03-29 Niels Möller <nisse@lysator.liu.se>
3442 * mpn/x86_64/div_qr_2_pi1_norm.asm: Updated to use a separate rp
3445 * gmp-impl.h (mpn_div_qr_2_pi1_norm): Updated declaration.
3446 * gmp-h.in (mpn_div_qr_2): Likewise.
3448 * tests/mpn/t-div.c (main): Adapted to new mpn_div_qr2 interface.
3449 * tune/speed.h (SPEED_ROUTINE_MPN_DIV_QR_2): Likewise.
3451 * mpn/generic/div_qr_2.c (mpn_div_qr_2_pi2_norm): Added rp
3452 argument. Don't clobber the input dividend.
3453 (mpn_div_qr_2_pi1_unnorm): Likewise.
3454 (mpn_div_qr_2): Likewise.
3455 * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2_pi1_norm): Likewise.
3457 2011-03-29 Niels Möller <nisse@lysator.liu.se>
3459 * mpn/x86/k7/invert_limb.asm: Use mov rather than push and pop.
3460 Earlier load of divisor from stack.
3462 2011-03-28 Torbjorn Granlund <tege@gmplib.org>
3464 * mpn/x86/k7/invert_limb.asm: Protect movzwl register parameters from
3465 being interpreted as m4 macro parameters.
3467 2011-03-22 Niels Möller <nisse@lysator.liu.se>
3469 * mpn/x86_64/div_qr_2_pi1_norm.asm: Copied optimized inner loop
3472 * mpn/x86_64/div_qr_2_pi1_norm.asm: First working, but poorly
3473 optimized, implementation.
3475 * mpn/asm-defs.m4 (define_mpn): Added div_qr_2_pi[12]_*norm.
3477 * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2_pi1_norm): Moved
3478 to separate file, from...
3479 * mpn/generic/div_qr_2.c: ... old location.
3481 * gmp-impl.h (mpn_div_qr_2_pi1_norm): Declare.
3483 * configure.in (gmp_mpn_functions): Added div_qr_2_pi1_norm.
3485 2011-03-22 Torbjorn Granlund <tege@gmplib.org>
3487 * configure.in (powerpc): Reinsert lost AIX cpu_path 32-bit handling.
3488 Reinsert lost linux/bsd cpu_path handling.
3490 * mpn/generic/mod_1_1.c: Disable powerpc asm for _LONG_LONG_LIMB.
3491 * mpn/generic/div_qr_2.c: Likewise.
3493 * mpn/generic/div_qr_2.c: Use asm just for gcc.
3494 Make powerpc add_sssaaaa work for 32-bit case, and use less strict
3497 2011-03-21 Niels Möller <nisse@lysator.liu.se>
3499 * tune/tuneup.c (div_qr_2_pi2_threshold): New global variable.
3500 (tune_div_qr_2): New function.
3501 (all): Call tune_div_qr_2.
3503 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added div_qr_2.c.
3505 * gmp-impl.h (DIV_QR_2_PI2_THRESHOLD): Setup for tuning.
3507 New 4/2 division loop, based on Torbjörn's work:
3508 * mpn/generic/div_qr_2.c (add_sssaaaa, add_csaac): New macros.
3509 (udiv_qr_4by2): New macro.
3510 (invert_4by2): New function.
3511 (mpn_div_qr_2_pi2_norm): New function.
3512 (DIV_QR_2_PI2_THRESHOLD): New threshold.
3513 (mpn_div_qr_2_pi1_norm): Renamed, from...
3514 (mpn_div_qr_2_norm): ... old name.
3515 (mpn_div_qr_2_pi1_unnorm): Renamed, from...
3516 (mpn_div_qr_2_unnorm): ... old name.
3517 (mpn_div_qr_2): Use mpn_div_qr_2_pi2_norm for large enough
3518 normalized divisors.
3520 * gmp-impl.h (udiv_qr_3by2): Avoid a copy.
3522 2011-03-21 Torbjorn Granlund <tege@gmplib.org>
3524 * configure.in (hppa): Under linux, treat 64-bit processors as if they
3525 were 32-bit processors.
3527 * mpn/generic/addcnd_n.c: New file.
3528 * mpn/asm-defs.m4 (define_mpn): Add addcnd_n and subcnd_n.
3529 * configure.in (gmp_mpn_functions): Add addcnd_n.
3530 * gmp-impl.h (mpn_addcnd_n): Declare.
3532 * mpn/generic/subcnd_n.c: Combine nails and non-nails functions.
3534 * gmp-impl.h (invert_pi1): Prepend _ to local variables, protect
3535 parameters within () where necessary.
3537 * mpn/asm-defs.m4 (define_mpn): Add div_qr_2.
3538 * configure.in (gmp_mpn_functions): Reinsert mercurial-bug-removed
3541 2011-03-20 Torbjorn Granlund <tege@gmplib.org>
3543 * configure.in (powerpc): Add cpu_path for all three ABIs.
3544 Rename "aix64" to "mode64" for consistency.
3546 2011-03-16 Marc Glisse <marc.glisse@inria.fr>
3548 * gmpxx.h (__gmp_binary_not_equal): Remove, use !__gmp_binary_equal.
3549 (__gmp_binary_less_equal): Remove, use !__gmp_binary_greater.
3550 (__gmp_binary_greater_equal): Remove, use !__gmp_binary_less.
3551 * tests/cxx/t-ops2.cc: Typo.
3553 2011-03-20 Niels Möller <nisse@lysator.liu.se>
3555 * tune/common.c (speed_mpn_div_qr_2_norm): New function.
3556 (speed_mpn_div_qr_2_unnorm): New function.
3557 * tune/speed.c (routine): Recognize above functions.
3558 * tune/speed.h: Declarations for above functions.
3559 (SPEED_ROUTINE_MPN_DIV_QR_2): New macro.
3561 * tests/mpn/t-div.c (main): Added tests for mpn_divrem_2 and
3564 * mpn/generic/div_qr_2.c (mpn_div_qr_2): New file and function.
3565 Intended to eventually replace divrem_2.
3566 * configure.in (gmp_mpn_functions): Add div_qr_2.
3568 2011-03-16 Marc Glisse <marc.glisse@inria.fr>
3570 * gmpxx.h (__gmp_set_expr): Remove broken declarations.
3572 2011-03-19 Torbjorn Granlund <tege@gmplib.org>
3574 * mpz/fac_ui.c (mpz_fac_ui): Use MPZ_REALLOC for standard, conditional
3577 2011-03-19 Niels Möller <nisse@lysator.liu.se>
3579 * mpn/generic/divrem_2.c (mpn_divrem_2): Fixed comment and assert
3580 regarding q and n overlap.
3582 2011-03-16 Marc Glisse <marc.glisse@inria.fr>
3584 * gmpxx.h (__mpz_set_ui_safe): New inline function.
3585 (__mpz_set_si_safe): Likewise.
3586 (__GMPXX_TMPZ_UI): Use the new function.
3587 (__GMPXX_TMPZ_SI): Likewise.
3588 (__GMPXX_TMPQ_UI): Likewise.
3589 (__GMPXX_TMPQ_SI): Likewise.
3590 * tests/cxx/t-ops2.cc: test converting 0 to stack mpq_t.
3592 2011-03-15 Marc Glisse <marc.glisse@inria.fr>
3594 * gmpxx.h (__GMPXX_TMPQ_UI): New macro.
3595 (__GMPXX_TMPQ_SI): New macro.
3596 (struct __gmp_binary_multiplies): Rewrite, using the new macros.
3597 (struct __gmp_binary_divides): Likewise.
3599 * gmpxx.h (__GMPZ_ULI_LIMBS): Rewrite.
3600 * tests/cxx/t-ops2.cc: test converting ULONG_MIN to stack mpq_t.
3602 2011-03-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
3604 * mpn/generic/toom_interpolate_16pts.c: Remove ambiguity.
3606 2011-03-14 Torbjorn Granlund <tege@gmplib.org>
3608 * tune/tuneup.c (tune_mul): Set tuning min size considering print skew.
3610 * doc/gmp.texi: Make reference to "Formatted I/O" chapters from type
3611 specific I/O sections.
3613 * mpn/alpha/add_n.asm: Add _nc entry point.
3614 * mpn/alpha/sub_n.asm: Likewise.
3615 * mpn/mips64/add_n.asm: Likewise.
3616 * mpn/mips64/sub_n.asm: Likewise.
3617 * mpn/sparc64/ultrasparc1234/add_n.asm: Likewise.
3618 * mpn/sparc64/ultrasparc1234/sub_n: Likewise.
3620 2011-03-13 Marc Glisse <marc.glisse@inria.fr>
3622 * tests/cxx/t-ops2.cc: New file.
3623 * tests/cxx/Makefile.am: Added t-ops2.
3625 2011-03-13 Torbjorn Granlund <tege@gmplib.org>
3627 * mpn/generic/toom32_mul.c (mpn_toom32_mul): Make 'hi' be limb-sized
3630 * gmp-impl.h (MPN_IORD_U): Handle x86_64 as well as x86_32. Generate
3631 no code for incrementing by constant 0.
3633 2011-03-12 Marc Glisse <marc.glisse@inria.fr>
3635 * gmpxx.h: Rename __GMPXX_TMP_* to __GMPXX_TMPZ_*. Use in more places.
3637 2011-03-12 Torbjorn Granlund <tege@gmplib.org>
3639 * mpn/powerpc64/rshift.asm: Accept/return values correctly also for
3641 * mpn/powerpc64/lshift.asm: Likewise.
3643 * tune/powerpc.asm: Use powerpc syntax, not power syntax.
3645 * tune/common.c (speed_udiv_qrnnd_preinv1, etc): Remove.
3646 * tune/speed.c (routine): Remove udiv_qrnnd_preinv1, etc.
3648 2011-03-12 Marc Glisse <marc.glisse@inria.fr>
3650 * tests/cxx/t-istream.cc: Restrict mpq test in t-istream -s.
3652 * gmpxx.h: Remove leftover #undefs.
3654 2011-03-11 Torbjorn Granlund <tege@gmplib.org>
3656 * gmp-impl.h (udiv_qrnnd_preinv1, udiv_qrnnd_preinv2,
3657 udiv_qrnnd_preinv2gen): Remove obsolete macros.
3658 (udiv_qrnnd_preinv): New name for udiv_qrnnd_preinv3.
3660 2011-03-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
3662 * gmp-impl.h: Declare many mpn_{sub,add}lsh*_n_ip[12] functions/macros.
3663 * mpn/generic/toom_interpolate_5pts.c: Use mpn_sublsh1_n_ip1.
3665 * tests/devel/try.c: Tests for {add,sub}lsh*_n_ip[12].
3666 * tests/refmpn.c: New reference for mpn_{add,sub}lsh*_n_ip[12].
3667 * tests/tests.h: Declarations for reference functions above.
3669 * tune/common.c: New speed_mpn_{add,sub}lsh*_n_ip[12] functions.
3670 * tune/speed.h: Prototypes for functions above.
3671 * tune/speed.c: Support for mpn_{add,sub}lsh*_n_ip[12].
3673 * mpn/x86/k7/sublsh1_n.asm: Replaced generic sublsh1 code with faster _ip1.
3674 * mpn/x86/atom/sublsh1_n.asm: Changed PROLOGUE accordingly.
3676 * configure.in: Define HAVE_NATIVE_mpn_addlsh*_n*_ip[12].
3677 * mpn/asm-defs.m4: Declare mpn_addlsh*_n*_ip[12].
3679 2011-03-10 Marc Glisse <marc.glisse@inria.fr>
3681 * tests/cxx/t-istream.cc: Explicit conversion to streampos.
3683 2011-03-10 Torbjorn Granlund <tege@gmplib.org>
3685 * mpn/x86/atom/sse2/mul_basecase.asm: Suppress wind-down rp updates.
3687 * Move new aorrlsh_n.asm to new k8 dir. Revert
3688 mpn/x86_64/aorrlsh_n.asm.
3689 * configure.in: Setup path for new k8 directory.
3691 2011-03-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
3693 * mpn/x86/pentium4/sse2/bdiv_dbm1c.asm: New file, was in atom.
3694 * mpn/x86/atom/sse2/bdiv_dbm1c.asm: Grab file above.
3696 2011-03-09 Torbjorn Granlund <tege@gmplib.org>
3698 * mpn/x86_64/aorrlsh_n.asm: Complete rewrite.
3700 * mpn/x86_64/core2/aorrlsh_n.asm: New file, grabbing another asm file.
3702 2011-03-09 Marc Glisse <marc.glisse@inria.fr>
3704 * tests/cxx/t-ostream.cc: Use bool instead of int.
3705 * tests/cxx/t-istream.cc: Likewise.
3706 * tests/cxx/t-misc.cc: Likewise.
3708 * cxx/ismpznw.cc: Don't clear eofbit.
3709 * cxx/ismpq.cc: Likewise.
3710 * cxx/ismpf.cc: Likewise.
3711 * tests/cxx/t-istream.cc: Test accordingly.
3713 2011-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
3715 * mpn/x86/atom/sse2/bdiv_dbm1c.asm: New file.
3717 2011-03-09 Marc Glisse <marc.glisse@inria.fr>
3719 * doc/gmp.texi: Remove void return type from constructors. Document
3720 explicit constructors. Document mpf_class::mpf_class(mpf_t).
3722 2011-03-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
3724 * mpn/x86/atom/sse2/sqr_basecase.asm: Postponed pushes. Cleaned
3727 2011-03-07 Torbjorn Granlund <tege@gmplib.org>
3729 * mpn/x86_64/gcd_1.asm: Workaround Oracle assembler bug.
3731 * mpn/x86/atom/sse2/mul_basecase.asm: Replace addmul_1 loops.
3732 Tweak outer loop rp updates.
3734 2011-03-06 Torbjorn Granlund <tege@gmplib.org>
3736 * mpn/x86/atom/sse2/sqr_basecase.asm: New file.
3738 2011-03-05 Torbjorn Granlund <tege@gmplib.org>
3740 * mpn/x86_64/bdiv_dbm1c.asm: Write proper feed-in code.
3742 2011-03-04 Torbjorn Granlund <tege@gmplib.org>
3744 * mpn/x86_64/addmul_2.asm: Rewrite for linear performance.
3746 2011-03-03 Torbjorn Granlund <tege@gmplib.org>
3748 * mpn/generic/mod_1_1.c (add_mssaaaa): Canonicalise layout. Add arm
3749 variant. Enable sparc64 code and powerpc code (the latter for 32-bit
3752 * mpn/generic/sqrtrem.c (mpn_dc_sqrtrem): Use mpn_addlsh1_n.
3754 * gmp-impl.h (mpn_addlsh_nc, mpn_rsblsh_nc): Declare.
3755 * mpn/asm-defs.m4: Likewise.
3757 * mpn/x86_64/coreisbr/aorrlsh_n.asm: Disable mpn_rsblsh_n due to
3759 * mpn/x86_64/coreinhm/aorrlsh_n.asm: Likewise.
3760 * mpn/x86_64/coreisbr/aorrlsh2_n.asm: Likewise.
3762 2011-03-03 Niels Möller <nisse@lysator.liu.se>
3764 * mpn/generic/mod_1_1.c (add_mssaaaa): For x86 and x86_64, treat m
3765 as in output operand only. Added sparc32 implementation. Also
3766 added #if:ed out attempts at sparc64 and powerpc64.
3768 * tune/tuneup.c (tune_mod_1): Record result of MOD_1_1P_METHOD
3769 measurement for use by mpn_mod_1_tune. And omit measurement if
3770 mpn_mod_1_1p is native assebly code.
3772 * mpn/generic/mod_1.c (mpn_mod_1_1p) [TUNE_PROGRAM_BUILD]: Macro
3773 to check mod_1_1p_method and call the right function.
3774 (mpn_mod_1_1p_cps) [TUNE_PROGRAM_BUILD]: Likewise.
3776 * gmp-impl.h (MOD_1_1P_METHOD) [TUNE_PROGRAM_BUILD]: Define macro.
3777 (mod_1_1p_method) [TUNE_PROGRAM_BUILD]: Declare variable.
3779 2011-03-02 Torbjorn Granlund <tege@gmplib.org>
3781 * mpn/x86_64/coreinhm/aorrlsh_n.asm: New file.
3782 * mpn/x86_64/coreisbr/aorrlsh_n.asm: New file.
3784 2011-03-01 Niels Möller <nisse@lysator.liu.se>
3786 * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Eliminated a neg and
3787 two mov instructions.
3789 * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p_cps): Simplified
3790 computation, analogous to recent x86_64/mod_1_1.asm changes.
3791 (mpn_mod_1_1p): Corresponding changes. Don't shift b.
3793 * mpn/sparc64/mod_1_4.c (mpn_mod_1s_4p_cps): Use udiv_rnnd_preinv
3794 rather than udiv_rnd_preinv.
3795 (mpn_mod_1s_4p): Likewise.
3797 2011-03-01 Torbjorn Granlund <tege@gmplib.org>
3799 * mpn/x86/pentium4/sse2/mul_1.asm: Swap entry insns to share more code
3800 between entry points.
3801 * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
3803 * mpz/divegcd.c: Rewrite, as per Marc Glisse's suggestion. Also fix
3804 problem with passing a longlong limb to a _ui function.
3806 * gmp-impl.h (udiv_qrnnd_preinv3): Cast truth value to mask's type.
3807 (udiv_rnnd_preinv): Likewise.
3808 * mpn/generic/mod_1_1.c (mpn_mod_1_1p): Likewise.
3810 2011-02-28 Niels Möller <nisse@lysator.liu.se>
3812 * mpn/generic/mod_1_1.c (add_mssaaaa): Typo fix, define
3813 add_mssaaaa, not add_sssaaaa.
3815 * tune/tuneup.c (tune_mod_1): Measure mpn_mod_1_1_1 and
3816 mpn_mod_1_1_2, to set MOD_1_1P_METHOD.
3818 * tune/speed.c (routine): Added mpn_mod_1_1_1 and mpn_mod_1_1_2.
3820 * tune/speed.h: Declare speed_mpn_mod_1_1_1, speed_mpn_mod_1_1_2,
3821 mpn_mod_1_1p_1, mpn_mod_1_1p_2, mpn_mod_1_1p_cps_1, and
3824 * tune/common.c (speed_mpn_mod_1_1_1): New function.
3825 (speed_mpn_mod_1_1_2): New function.
3827 * tune/Makefile.am (libspeed_la_SOURCES): Added mod_1_1-1.c
3830 * tune/mod_1_1-1.c: New file.
3831 * tune/mod_1_1-2.c: New file.
3833 * mpn/generic/mod_1_1.c: Implemented an algorithm with fewer
3834 multiplications, configured via MOD_1_1P_METHOD.
3836 * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Simplified
3837 computation of B2modb, use B^2 mod (normalized b).
3838 (mpn_mod_1_1p): Corresponding changes. Don't shift b.
3840 * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Use udiv_rnnd_preinv rather
3841 than udiv_rnd_preinv.
3842 (mpn_mod_1_1p): Likewise.
3843 * mpn/generic/mod_1_4.c: Analogous changes.
3844 * mpn/generic/mod_1_3.c: Analogous changes.
3845 * mpn/generic/mod_1_2.c: Analogous changes.
3846 * mpn/generic/mod_1.c: Analogous changes.
3847 * mpn/generic/pre_mod_1.c: Analogous changes.
3849 * gmp-impl.h (udiv_qrnnd_preinv3): Eliminated unpredictable branch
3850 using masking logic. Further optimization of the nl == constant 0
3851 case, similar to udiv_rnd_preinv.
3852 (udiv_rnnd_preinv): Likewise.
3853 (udiv_rnd_preinv): Deleted, use udiv_rnnd_preinv with nl == 0
3856 * tests/mpn/t-divrem_1.c (check_data): Added testcase to exercise
3857 the nl == constant 0 special case in udiv_qrnnd_preinv3.
3859 2011-02-28 Torbjorn Granlund <tege@gmplib.org>
3861 * mpn/generic/rootrem.c (mpn_rootrem): Combine two similar scalar
3862 divisions. Misc minor cleanup.
3864 * mpn/x86/atom/sse2/aorsmul_1.asm: Shorten software pipeline.
3866 * mpn/x86/atom/mul_basecase.asm: Remove file no longer used.
3868 * mpn/generic/rootrem.c (mpn_rootrem_internal): Delay O(log(U))
3869 allocations until they are known to be needed.
3871 2011-02-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
3873 * mpn/x86/atom/sse2/mul_1.asm: New code.
3875 2011-02-27 Niels Möller <nisse@lysator.liu.se>
3877 * gmp-impl.h (udiv_rnnd_preinv): New macro.
3879 2011-02-27 Torbjorn Granlund <tege@gmplib.org>
3881 * mpn/x86/atom/sse2/mul_basecase.asm: New file.
3883 2011-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
3885 * mpn/x86/atom/sse2/aorsmul_1.asm: Optimise non-loop code.
3887 2011-02-26 Torbjorn Granlund <tege@gmplib.org>
3889 * mpn/powerpc64/mode64/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
3890 * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
3892 * mpn/powerpc64/mode64/aorsmul_1.asm: Add missing MULFUNC_PROLOGUE.
3893 * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
3895 2011-02-25 Torbjorn Granlund <tege@gmplib.org>
3897 * mpn/x86/atom/sse2/aorsmul_1.asm: New file.
3898 * mpn/x86/atom/aorsmul_1.asm: File removed.
3900 2011-02-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
3902 * mpn/x86/atom/sse2/divrem_1.asm: New file (was in x86/atom).
3903 * mpn/x86/atom/sse2/mul_1.asm: Likewise.
3904 * mpn/x86/atom/sse2/popcount.asm: Likewise.
3905 * mpn/x86/atom/divrem_1.asm: ReMoved (in sse2/ now).
3906 * mpn/x86/atom/mul_1.asm: Likewise.
3907 * mpn/x86/atom/popcount.asm: Likewise.
3909 * configure.in: Set up mmx path for atom.
3910 * mpn/x86/atom/mmx/copyd.asm: New file (was in x86/atom).
3911 * mpn/x86/atom/mmx/copyi.asm: Likewise.
3912 * mpn/x86/atom/mmx/hamdist.asm: Likewise.
3913 * mpn/x86/atom/copyd.asm: ReMoved (in mmx/ now).
3914 * mpn/x86/atom/copyi.asm: Likewise.
3915 * mpn/x86/atom/hamdist.asm: Likewise.
3917 2011-02-24 Torbjorn Granlund <tege@gmplib.org>
3919 * mpn/x86/atom/sse2/mod_1_1.asm: New file.
3920 * mpn/x86/atom/sse2/mod_1_4.asm: New file.
3921 * configure.in: Set up sse2 path for atom.
3923 * mpn/x86/p6/sse2/mod_1_1.asm: New file.
3924 * mpn/x86/p6/sse2/mod_1_4.asm: Fix typo in MULFUNC_PROLOGUE.
3926 2011-02-24 Niels Möller <nisse@lysator.liu.se>
3928 * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p): Rewrite using the same
3929 algorithm as the x86_64 version.
3931 2011-02-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
3933 * mpn/x86/atom/logops_n.asm: New file (same loop as aors_n).
3935 2011-02-23 Niels Möller <nisse@lysator.liu.se>
3937 * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Shaved off one
3938 instruction and one register in the inner loop. Rearranged
3939 registers slightly, and no longer needs the callee-save register
3942 2011-02-22 Torbjorn Granlund <tege@gmplib.org>
3944 * configure.in: Export SHLD_SLOW and SHRD_SLOW to config.m4, also
3945 fixing typo in exporting code.
3947 * mpn/x86_64/nano/gmp-mparam.h (SHLD_SLOW, SHRD_SLOW): Define.
3948 * mpn/x86_64/atom/gmp-mparam.h (SHLD_SLOW, SHRD_SLOW): Define.
3950 2011-02-22 Niels Möller <nisse@lysator.liu.se>
3952 * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Rewrite.
3954 2011-02-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
3956 * mpn/x86/atom/lshiftc.asm: New file (a copy of lshift.asm with a handful of neg added).
3958 2011-02-21 Torbjorn Granlund <tege@gmplib.org>
3960 * mpn/x86/aors_n.asm: Move _nc entry to after main code. Align loop
3961 and _n entry for claimed performance. Normalise mnemonic usage.
3963 * mpn/x86/atom/aorrlsh1_n.asm: New file (code from rsblsh_1, slightly
3964 slower for addlsh_1 for large operands, but much faster for small).
3965 * mpn/x86/atom/addlsh1_n.asm: Remove.
3966 * mpn/x86/atom/rsblsh1_n.asm: Remove.
3968 2011-02-20 Marc Glisse <marc.glisse@inria.fr>
3970 * mpq/aors.c: Rewrite to remove redundant division.
3972 2011-02-20 Torbjorn Granlund <tege@gmplib.org>
3974 * mpn/x86/atom/lshift.asm: New file.
3975 * mpn/x86/atom/rshift.asm: Normalise mnemonic usage.
3977 * gmp-impl.h (mpn_divexact_by7): Relax inclusion condition.
3979 * mpz/divegcd.c (mpz_divexact_by5): New conditionally enabled function.
3980 (mpz_divexact_by3): Wrap inside appropriate conditions.
3981 (mpz_divexact_gcd): Rewrite.
3983 * mpn/x86/bdiv_dbm1c.asm: Save a jump.
3985 2011-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
3987 * mpn/x86/atom/aorslshC_n.asm: New file.
3988 * mpn/x86/atom/sublsh2_n.asm: New file.
3990 * mpn/x86/atom/aors_n.asm: New code.
3991 * mpn/x86/atom/rshift.asm: Atom64 code adapted to 32-bit.
3992 * mpn/x86/atom/lshift.asm: Likewise.
3994 2011-02-19 Torbjorn Granlund <tege@gmplib.org>
3996 * mpn/x86_64/atom/rsh1aors_n.asm: New file.
3998 * mpn/x86_64/atom/lshift.asm: New file.
3999 * mpn/x86_64/atom/rshift.asm: New file.
4000 * mpn/x86_64/atom/lshiftc.asm: New file.
4002 2011-02-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
4004 * mpn/x86/atom/aorsmul_1.asm: Small improvements for small sizes.
4005 * mpn/x86/atom/aorrlshC_n.asm: Tiny size improvements.
4007 2011-02-16 Torbjorn Granlund <tege@gmplib.org>
4009 * configure.in: Fix k8/k10 32-bit path setup problem.
4011 2011-02-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
4013 * mpn/x86/atom/aorsmul_1.asm: Revive an old k7/aorsmul.
4015 2011-02-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
4017 * gmp-impl.h (mpn_sublsh_n): Declare.
4018 * mpn/asm-defs.m4: Likewise.
4020 * mpn/x86/atom/aorrlshC_n.asm: New file (was k7).
4021 * mpn/x86/k7/aorrlshC_n.asm: ReMoved.
4022 * mpn/x86/atom/aorrlsh2_n.asm: Grab atom/aorrlshC_n.asm.
4023 * mpn/x86/atom/rsblsh1_n.asm: Grab atom/aorrlshC_n.asm.
4025 2011-02-13 Torbjorn Granlund <tege@gmplib.org>
4027 * mpn/x86_64/atom/aorrlsh2_n.asm: New file.
4029 2011-02-12 Torbjorn Granlund <tege@gmplib.org>
4031 * mpn/x86_64/aorrlsh_n.asm: Minor tweaks, update c/l numbers.
4033 * mpn/x86_64/atom/sublsh1_n.asm: New file.
4035 * mpn/x86_64/atom/aorrlsh1_n.asm: New file.
4037 2011-02-11 Torbjorn Granlund <tege@gmplib.org>
4039 * mpn/powerpc64/mode64/mod_1_1.asm: Fix Darwin syntax issues.
4041 2011-02-10 Torbjorn Granlund <tege@gmplib.org>
4043 * mpn/powerpc64/mode64/mod_1_4.asm: Tune away a cycle for 970.
4045 2011-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
4047 * mpn/x86/k7/addlsh1_n.asm: Faster core loop (Torbjorn's).
4049 * configure.in: Add HAVE_NATIVE_{add,sub,rsb}lsh{,1,2}_nc.
4050 * tests/tests.h: refmpn_{add,sub,rsb}lsh{,1,2}_nc prototypes.
4051 * tests/refmpn.c: New refmpn_{add,sub,rsb}lsh{,1,2}_nc.
4052 * tests/devel/try.c: Tests for mpn_{add,sub,rsb}lsh{,1,2}_nc.
4054 * mpn/x86/k7/aorrlshC_n.asm: New file.
4055 * mpn/x86/atom/aorrlsh2_n.asm: Grab k7/aorrlshC_n.asm.
4056 * mpn/x86/atom/rsblsh1_n.asm: Grab k7/aorrlshC_n.asm.
4058 2011-02-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
4060 * mpn/x86/k7/addlsh1_n.asm: New file.
4061 * mpn/x86/k7/sublsh1_n.asm: New file.
4062 * mpn/x86/atom/addlsh1_n.asm: Grab k7/addlsh1_n.asm.
4063 * mpn/x86/atom/sublsh1_n.asm: Grab k7/sublsh1_n.asm.
4065 2011-02-05 Torbjorn Granlund <tege@gmplib.org>
4067 * gmp-impl.h (mpn_addlsh1_nc, mpn_addlsh2_nc, mpn_sublsh1_nc,
4068 mpn_sublsh2_nc, mpn_rsblsh1_nc, mpn_rsblsh2_nc): Declare.
4069 * mpn/asm-defs.m4: Likewise.
4071 * mpn/x86_64/coreisbr/aorrlshC_n.asm: New file.
4072 * mpn/x86_64/coreisbr/aorrlsh1_n.asm: New file.
4073 * mpn/x86_64/coreisbr/aorrlsh2_n.asm: New file.
4075 * mpn/x86_64/coreisbr/aors_n.asm: New file, based on old
4077 * mpn/x86_64/atom/aors_n.asm: Grab coreisbr/aors_n.asm.
4079 2011-02-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
4081 * gmp-impl.h (mpn_toom6_mul_n_itch): Handle threshold == zero.
4082 (mpn_toom8_mul_n_itch): Likewise.
4083 (MPN_TOOM6H_MIN, MPN_TOOM8H_MIN): Define.
4084 * tests/mpn/t-toom6h.c: No tests below MPN_TOOM6H_MIN.
4085 * tests/mpn/t-toom8h.c: No tests below MPN_TOOM8H_MIN.
4087 * mpz/lucnum_ui.c: Use mpn_addlsh2_n.
4089 2011-02-04 Torbjorn Granlund <tege@gmplib.org>
4091 * mpn/x86_64/atom/rsh1aors_n.asm: Add a MULFUNC_PROLOGUE.
4092 * mpn/x86_64/atom/dive_1.asm: Likewise.
4093 * mpn/x86_64/atom/popcount.asm: Likewise.
4094 * mpn/x86_64/core2/popcount.asm: Likewise.
4095 * mpn/x86_64/coreinhm/hamdist.asm: Likewise.
4096 * mpn/x86_64/coreinhm/popcount.asm: Likewise.
4097 * mpn/x86_64/nano/popcount.asm: Likewise.
4098 * mpn/x86_64/pentium4/popcount.asm: Likewise.
4100 2011-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
4102 * mpn/x86/atom/mode1o.asm: New file, grabbing another asm file.
4103 * mpn/x86/atom/mul_1.asm: Claim mul_1c.
4105 2011-02-02 Niels Möller <nisse@lysator.liu.se>
4107 * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): Fixed one
4108 speed_operand_dst call.
4110 2011-02-01 Torbjorn Granlund <tege@gmplib.org>
4112 * tune/speed.h (struct speed_params): Allow for 4 dst operands.
4113 * tune/common.c (TOLERANCE): Increase from 0.5% to 1%.
4115 * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): New macro, mainly based
4116 on old speed_mpn_hgcd, but with speed_operand_src calls (as suggested
4118 * tune/common.c (speed_mpn_hgcd): Invoke SPEED_ROUTINE_MPN_HGCD_CALL.
4119 (speed_mpn_hgcd_lehmer): Likewise.
4121 * configure.in: Set up 32-bit x86 paths for new corei* CPU strings.
4123 2011-01-31 Torbjorn Granlund <tege@gmplib.org>
4125 * config.guess: Recognise new Intel processors.
4127 * config.guess: Support 'coreinhm' and 'coreisbr'.
4128 * config.sub: Likewise.
4129 * configure.in: Likewise.
4131 2011-01-30 Torbjorn Granlund <tege@gmplib.org>
4133 * configure.in: Support x86/geode.
4134 * mpn/x86/geode/gmp-mparam.h: New file.
4136 2011-01-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
4138 * mpn/x86/atom/addlsh1_n.asm: Removed.
4139 * mpn/x86/atom/rsh1add_n.asm: Likewise.
4141 2011-01-28 Torbjorn Granlund <tege@gmplib.org>
4143 * mpn/alpha/ev6/slot.pl: Add some missing insns.
4145 2011-01-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
4147 * mpn/x86/atom/copyd.asm: New file, grabbing another asm file.
4148 * mpn/x86/atom/copyi.asm: Likewise.
4149 * mpn/x86/atom/aors_n.asm: Likewise.
4150 * mpn/x86/atom/addlsh1_n.asm: Likewise.
4151 * mpn/x86/atom/aorsmul_1.asm: Likewise.
4152 * mpn/x86/atom/bdiv_q_1.asm: Likewise.
4153 * mpn/x86/atom/dive_1.asm: Likewise.
4154 * mpn/x86/atom/divrem_1.asm: Likewise.
4155 * mpn/x86/atom/hamdist.asm: Likewise.
4156 * mpn/x86/atom/logops_n.asm: Likewise.
4157 * mpn/x86/atom/lshift.asm: Likewise.
4158 * mpn/x86/atom/mod_34lsub1.asm: Likewise.
4159 * mpn/x86/atom/mul_1.asm: Likewise.
4160 * mpn/x86/atom/mul_basecase.asm: Likewise.
4161 * mpn/x86/atom/popcount.asm: Likewise.
4162 * mpn/x86/atom/rsh1add_n.asm: Likewise.
4163 * mpn/x86/atom/rshift.asm: Likewise.
4164 * mpn/x86/atom/sqr_basecase.asm: Likewise.
4166 2011-01-27 Torbjorn Granlund <tege@gmplib.org>
4168 * mpn/x86_64/atom/rsh1aors_n.asm: New file, grabbing another asm file.
4169 * mpn/x86_64/atom/popcount.asm: Likewise.
4170 * mpn/x86_64/atom/dive_1.asm: Likewise.
4171 * mpn/x86_64/nano/popcount.asm: Likewise.
4173 2011-01-26 Torbjorn Granlund <tege@gmplib.org>
4175 * mpn/alpha/invert_limb.asm: Complete rewrite.
4177 2011-01-25 Torbjorn Granlund <tege@gmplib.org>
4179 * mpn/powerpc32/invert_limb.asm: New file.
4181 2011-01-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
4183 * mpn/x86/pentium4/sse2/bdiv_q_1.asm: New file.
4184 * mpn/x86/k7/bdiv_q_1.asm: New file.
4186 2011-01-24 Torbjorn Granlund <tege@gmplib.org>
4188 * tune/tuneup.c (tune_mul_n, tune_sqr): Loop, re-measuring thresholds
4189 until no tiny ranges remain.
4191 2011-01-23 Torbjorn Granlund <tege@gmplib.org>
4193 * mpn/ia64/mul_2.asm: Tweak to 1.5 c/l, less overhead.
4195 * mpn/ia64/addmul_2.asm: Rewrite, adding mpn_addmul_2s entry point.
4197 2011-01-22 Torbjorn Granlund <tege@gmplib.org>
4199 * mpn/ia64/aors_n.asm: Fix some incorrect bundle types.
4201 * mpn/ia64/sqr_diagonal.asm: Remove.
4203 * mpn/ia64/sqr_diag_addlsh1.asm: New file.
4205 * mpn/ia64/ia64-defs.m4: Define some shorter convenience mnemonics.
4207 * mpn/generic/sqr_basecase.c (MPN_SQR_DIAG_ADDLSH1): New macro, using
4208 new function mpn_sqr_diag_addlsh1 or defining its equivalent.
4210 * gmp-impl.h (mpn_addmul_2s): Declare.
4211 (mpn_sqr_diag_addlsh1): Declare.
4212 * mpn/asm-defs.m4 (define_mpn): Add addmul_2s and sqr_diag_addlsh1.
4214 * configure.in: Add HAVE_NATIVEs for mpn_sqr_diag_addlsh1 and
4216 (gmp_mpn_functions_optional): Add sqr_diag_addlsh1.
4218 2011-01-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
4220 * tests/devel/try.c: Initial support for mpn_bdiv_q_1.
4221 * mpn/x86/pentium/bdiv_q_1.asm: New file.
4222 * mpn/x86/p6/bdiv_q_1.asm: New file.
4224 2011-01-20 Torbjorn Granlund <tege@gmplib.org>
4226 * tune/speed.c (run_gnuplot): Update to current gnuplot syntax.
4228 * mpn/powerpc64/mode64/aorsmul_1.asm: Trim away 0.5 c/l for submul_1
4231 2011-01-19 Torbjorn Granlund <tege@gmplib.org>
4233 * mpn/x86_64/core2/rsh1aors_n.asm: New file.
4235 2011-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
4237 * mpn/x86/bdiv_q_1.asm: New file (same core alg. as dive_1).
4239 2011-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
4241 * mpn/generic/divexact.c: Avoid COPY if not needed.
4243 2011-01-14 Torbjorn Granlund <tege@gmplib.org>
4245 * gmp-impl.h (struct cpuvec_t): Add field bmod_1_to_mod_1_threshold.
4246 * configure.in (fat_thresholds): Add BMOD_1_TO_MOD_1_THRESHOLD.
4248 2011-01-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
4250 * mpz/mul.c: Remove redundant size computation.
4252 2011-01-08 Torbjorn Granlund <tege@gmplib.org>
4254 * tests/devel/try.c (types enum): Add TYPE_MUL_5 and TYPE_MUL_6.
4255 (param_init): Support new types.
4256 (choice_array): Support testing of mpn_mul_5 and mpn_mul_6.
4257 (call): Support new routines.
4259 * tests/refmpn.c (refmpn_mul_5, refmpn_mul_6): New functions.
4260 * tests/tests.h (refmpn_mul_5, refmpn_mul_6): Declare.
4261 Remove parameter names from some other functions.
4263 * gmp-impl.h (mpn_mul_5, mpn_mul_6): Declare.
4264 * mpn/asm-defs.m4: Likewise, also declare mpn_addmul_5, mpn_addmul_6,
4265 mpn_addmul_7, and mpn_addmul_8.
4267 * configure.in (gmp_mpn_functions_optional): Add mul_5 and mul_6.
4269 * tune/speed.c (routine): Add measuring of mpn_mul_5 and mpn_mul_6.
4270 * tune/common.c (speed_mpn_mul_5, speed_mpn_mul_6): New functions.
4271 * tune/speed.h: Declare new functions.
4273 2011-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
4275 * mpz/aors.h: Remove #ifdef BERKELEY_MP, and cleanup.
4276 * mpz/cmp.c: Likewise.
4277 * mpz/gcd.c: Likewise.
4278 * mpz/mul.c: Likewise.
4279 * mpz/powm.c: Likewise.
4280 * mpz/set.c: Likewise.
4281 * mpz/sqrtrem.c: Likewise.
4282 * mpz/tdiv_qr.c: Likewise.
4284 2010-12-28 Torbjorn Granlund <tege@gmplib.org>
4286 * mpn/minithres/gmp-mparam.h: Update with several recent thresholds.
4288 2010-12-19 Torbjorn Granlund <tege@gmplib.org>
4290 * mpn/x86/k7/mod_1_1.asm: Canonicalise cmov forms.
4291 * mpn/x86/k7/mod_1_4.asm: Likewise.
4292 * mpn/x86/pentium4/sse2/mod_1_1.asm: Likewise.
4293 * mpn/x86/pentium4/sse2/mod_1_4.asm: Likewise.
4294 * mpn/x86_64/core2/divrem_1.asm: Likewise.
4295 * mpn/x86_64/divrem_1.asm: Likewise.
4296 * mpn/x86_64/mod_1_1.asm: Likewise.
4297 * mpn/x86_64/mod_1_2.asm: Likewise.
4298 * mpn/x86_64/mod_1_4.asm: Likewise.
4300 * mpn/x86/k7/gcd_1.asm: Rewrite. Remove slow 'div' loop. Call
4301 mpn_mod_1 for operands with mode than BMOD_1_TO_MOD_1_THRESHOLD limbs.
4304 2010-12-18 Torbjorn Granlund <tege@gmplib.org>
4306 * mpn/x86_64/gcd_1.asm: Call mpn_mod_1 for operands with mode than
4307 BMOD_1_TO_MOD_1_THRESHOLD limbs.
4309 * configure.in: Generalise code for putting THRESHOLDs in config.m4.
4310 Add BMOD_1_TO_MOD_1_THRESHOLD to list.
4312 * mpn/x86_64/core2/divrem_1.asm: Tweak slightly, correct cycle counts.
4314 * mpn/x86_64/addmul_2.asm: Remove constant index.
4315 * mpn/x86_64/lshiftc.asm: Likewise.
4316 * mpn/x86_64/pentium4/lshift.asm: Likewise.
4317 * mpn/x86_64/pentium4/lshiftc.asm: Likewise.
4318 * mpn/x86_64/pentium4/rshift.asm: Likewise.
4320 2010-12-16 Torbjorn Granlund <tege@gmplib.org>
4322 * mpn/x86_64/mod_34lsub1.asm: Complete rewrite.
4323 * mpn/x86_64/pentium4/mod_34lsub1.asm: New file, old
4324 mpn/x86_64/mod_34lsub1.asm.
4326 2010-12-15 Torbjorn Granlund <tege@gmplib.org>
4328 * mpn/powerpc64/vmx/popcount.asm: Rewrite to use vperm count table.
4330 2010-12-14 Torbjorn Granlund <tege@gmplib.org>
4333 * configure.in: Remove mp-h.in from AC_OUTPUT invocation.
4335 2010-12-13 Torbjorn Granlund <tege@gmplib.org>
4337 * mpz/mod.c: Rewrite.
4339 * mpn/x86_64/corei/popcount.asm: New file.
4340 * mpn/x86_64/corei/hamdist.asm: New file.
4342 * mpn/x86_64/k10/hamdist.asm: New file.
4344 * configure.in: Amend last change for lame /bin/sh.
4346 2010-12-12 Torbjorn Granlund <tege@gmplib.org>
4348 * configure.in: Comment out M4=m4-not-needed.
4350 * mpn/x86_64/k10/popcount.asm: New file.
4351 * configure.in: Setup special path for k10 and later AMD CPUs.
4352 Remove special x86_64'k8' path, since directory is non-existent.
4354 2010-12-11 Torbjorn Granlund <tege@gmplib.org>
4356 * mpn/sparc32/ultrasparct1: New directory.
4357 * mpn/sparc32/ultrasparct1/add_n.asm: New file.
4358 * mpn/sparc32/ultrasparct1/sub_n.asm: New file.
4359 * mpn/sparc32/ultrasparct1/mul_1.asm: New file.
4360 * mpn/sparc32/ultrasparct1/addmul_1.asm: New file.
4361 * mpn/sparc32/ultrasparct1/submul_1.asm: New file.
4362 * mpn/sparc32/ultrasparct1/sqr_diagonal.asm: New file.
4364 * config.guess: Support Ultrasparc T2 and T3.
4365 * config.sub: Likewise.
4366 * configure.in: Likewise.
4368 * config.guess: Generalise BSD Sparc recognition by allowing any
4369 caps (needed for OpenBSD which spells things innovatively).
4371 2010-12-01 Torbjorn Granlund <tege@gmplib.org>
4373 * config.guess: Match new AMD processors, allow finer distinctions
4375 * acinclude.m4 (X86_64_PATTERN): Likewise.
4376 * config.sub: Likewise.
4377 * configure.in: Rudimentarily support new AMD processors.
4379 * configure.in (--enable_assembly): New option.
4380 (target none-*-*): Disable, give error.
4382 2010-11-29 Torbjorn Granlund <tege@gmplib.org>
4384 * mpn/x86/x86-defs.m4 (LEA): Support non-PIC code.
4385 * mpn/x86/darwin.m4 (LEA): Likewise.
4387 * tests/amd64call.asm: Rewrite for code size, and to match calls and
4390 * tests/x86call.asm: Rewrite for code size, to support PIC, and to
4391 match calls and returns.
4392 * tests/x86check.c: Rewrite.
4394 2010-11-22 Torbjorn Granlund <tege@gmplib.org>
4396 * mpz/get_str.c: Make all bases either work or return an error.
4397 * mpz/out_str.c: Likewise.
4398 * mpq/get_str.c: Likewise.
4399 * mpf/get_str.c: Likewise.
4401 2010-11-14 Torbjorn Granlund <tege@gmplib.org>
4403 * tests/misc/t-printf.c: Add explicit casts for type conversions.
4404 * mpn/generic/toom62_mul.c: Likewise.
4406 2010-11-13 Torbjorn Granlund <tege@gmplib.org>
4408 * mpn/generic/get_d.c: Misc cleanup. Fail with a syntax error for
4409 non-IEEE fp formats.
4411 * tests/devel/try.c (malloc_region): Add explicit casts for type
4414 * acinclude.m4 (GMP_ASM_RODATA): Make test code snippet C++ compatible.
4415 (GMP_C_DOUBLE_FORMAT): Likewise.
4416 (GMP_FUNC_VSNPRINTF): Likewise.
4418 * config.guess (x86): Make test C snippet C++ compatible.
4420 2010-11-12 Torbjorn Granlund <tege@gmplib.org>
4422 * Makefile.am: Remove mpbsd.
4423 * configure.in: Remove mpbsd.
4424 * doc/configuration: Remove mpbsd mentions.
4425 * doc/gmp.texi: Remove mpbsd docs.
4426 * tests/Makefile.am: Remove mpbsd.
4427 * libmp.sym: Remove.
4428 * mpbsd: Remove directory and files.
4429 * tests/mpbsd: Remove directory and files.
4431 2010-11-11 Torbjorn Granlund <tege@gmplib.org>
4433 * mpn/x86_64/atom/aors_n.asm: Don't rely on ZF after 'bt' insn.
4434 Use 64-bit 'test' to support operands of 2^32 limbs and more.
4436 * rand: New directory, move rand*.c and randmt.h here.
4437 * rand/Makefile.am: New file.
4438 * Makefile.am (SUBDIRS): Add rand.
4439 (RANDOM_OBJECTS): New variable.
4440 (libgmp_la_SOURCES): Remove random objects.
4441 (libgmp_la_DEPENDENCIES): Add RANDOM_OBJECTS.
4442 * configure.in (AC_OUTPUT): Add rand/Makefile.
4444 * ansi2knr.1: File removed.
4445 * ansi2knr.c: File removed.
4447 2010-11-10 Torbjorn Granlund <tege@gmplib.org>
4449 Make it possible to compile GMP with g++:
4451 * gmp-impl.h: Declare __gmp_digit_value_tab here.
4452 * mpbsd/min.c: ...not here.
4453 * mpbsd/xtom.c: ...nor here.
4454 * mpf/set_str.c: ...nor here.
4455 * mpz/inp_str.c: ...nor here.
4456 * mpz/set_str.c: ...nor here.
4458 * mpn/generic/toom43_mul.c: Add casts for logical operations on enums.
4459 * mpn/generic/toom44_mul.c: Likewise.
4460 * mpn/generic/toom4_sqr.c: Likewise.
4461 * mpn/generic/toom52_mul.c: Likewise.
4462 * mpn/generic/toom53_mul.c: Likewise.
4463 * mpn/generic/toom62_mul.c: Likewise.
4465 * mpz/clrbit.c: Clean up typing using MPZ_REALLOC.
4466 * mpz/setbit.c: Likewise.
4468 * mpz/powm.c: Avoid variable name 'new'.
4470 * randlc2x.c: Add explicit casts for type conversions.
4471 * tests/misc/t-printf.c: Likewise.
4472 * tests/misc/t-scanf.c: Likewise.
4473 * tests/misc.c: Likewise.
4474 * tests/mpz/convert.c: Likewise.
4475 * tests/refmpn.c: Likewise.
4477 * tests/tests.h: Unconditionally use <sstream> for now.
4479 * tests/memory.c: Include "tests.h.
4481 * mp_get_fns.c: Add a __GMP_NOTHROW for coherency with prototype.
4482 * mp_set_fns.c: Likewise.
4483 * mpf/cmp.c: Likewise.
4484 * mpf/cmp_si.c: Likewise.
4485 * mpf/cmp_ui.c: Likewise.
4486 * mpf/fits_s.h: Likewise.
4487 * mpf/fits_u.h: Likewise.
4488 * mpf/get_dfl_prec.c: Likewise.
4489 * mpf/get_prc.c: Likewise.
4490 * mpf/get_si.c: Likewise.
4491 * mpf/get_ui.c: Likewise.
4492 * mpf/int_p.c: Likewise.
4493 * mpf/set_dfl_prec.c: Likewise.
4494 * mpf/set_prc_raw.c: Likewise.
4495 * mpf/size.c: Likewise.
4496 * mpf/swap.c: Likewise.
4497 * mpq/equal.c: Likewise.
4498 * mpq/swap.c: Likewise.
4499 * mpz/cmp.c: Likewise.
4500 * mpz/cmp_si.c: Likewise.
4501 * mpz/cmp_ui.c: Likewise.
4502 * mpz/cmpabs.c: Likewise.
4503 * mpz/cmpabs_ui.c: Likewise.
4504 * mpz/cong_2exp.c: Likewise.
4505 * mpz/divis_2exp.c: Likewise.
4506 * mpz/fits_s.h: Likewise.
4507 * mpz/get_si.c: Likewise.
4508 * mpz/hamdist.c: Likewise.
4509 * mpz/scan0.c: Likewise.
4510 * mpz/scan1.c: Likewise.
4511 * mpz/sizeinbase.c: Likewise.
4512 * mpz/swap.c: Likewise.
4513 * mpz/tstbit.c: Likewise.
4514 * tal-reent.c: Likewise.
4516 2010-11-09 Torbjorn Granlund <tege@gmplib.org>
4518 * configure.in: Get rid of K&R support.
4519 * Makefile.am: Likewise.
4520 * mpn/Makefile.am: Likewise.
4521 * doc/configuration: Update docs wrt K&R support.
4522 * doc/gmp.texi: Likewise.
4524 * configure.in (AC_INIT): Amend bug reporting address with manual
4527 2010-11-06 Torbjorn Granlund <tege@gmplib.org>
4529 * config.guess: If cpuid says we have 32bit-only x86 but
4530 configfsf.guess return x86_64, return the latter.
4532 * mpn/x86_64/aors_n.asm: Rewrite not to rely on ZF after 'bt' insn.
4534 2010-10-09 Torbjorn Granlund <tege@gmplib.org>
4536 * mpn/generic/trialdiv.c: Update documentation.
4538 2010-10-04 Torbjorn Granlund <tege@gmplib.org>
4540 * mpn/x86_64/gcd_1.asm: Use m4_lshift to avoid << operator.
4541 * mpn/x86_64/aorrlshC_n.asm: Likewise.
4542 * mpn/x86_64/pentium4/aorslshC_n.asm: Likewise.
4543 * mpn/x86/k7/gcd_1.asm: Likewise.
4545 2010-08-20 Niels Möller <nisse@lysator.liu.se>
4547 Suggested by Ozkan Sezer:
4548 * configure.in: If $M4 is already set in the environment, don't
4549 touch it. Fixed the case that no assembler files are used, and
4550 GMP_PROG_M4 is omitted.
4552 2010-08-08 Torbjorn Granlund <tege@gmplib.org>
4554 * mpn/x86_64/fat/fat.c: Recognise many more processors.
4556 2010-06-30 Torbjorn Granlund <tege@gmplib.org>
4558 * mpn/x86_64/divrem_2.asm: Tune.
4560 2010-06-19 Niels Möller <nisse@lysator.liu.se>
4562 * tune/speed.h (SPEED_ROUTINE_MPN_MOD_1_1): Pass normalized
4563 divisor to the benchmarked function.
4565 2010-06-15 Torbjorn Granlund <tege@gmplib.org>
4567 * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Rewrite.
4568 * mpn/x86_64/mod_1_2.asm (mpn_mod_1s_2p_cps): Rewrite.
4569 * mpn/x86_64/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
4571 * gmp-impl.h (udiv_rnd_preinv): Simplify.
4573 * mpn/x86/k7/mod_1_1.asm: New file.
4574 * mpn/x86/pentium4/sse2/mod_1_1.asm (mpn_mod_1_1p_cps): Rewrite.
4575 * mpn/x86/k7/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
4576 * mpn/x86/pentium4/sse2/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
4578 * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Store results as they are
4580 * mpn/generic/mod_1_2.c (mpn_mod_1s_2p_cps): Likewise.
4581 * mpn/generic/mod_1_4.c (mpn_mod_1s_4p_cps): Likewise.
4583 * mpn/x86/k7/invert_limb.asm: Moved from mpn/x86/invert_limb.asm.
4585 2010-06-15 Niels Möller <nisse@lysator.liu.se>
4587 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mod_1.
4588 * tests/mpn/t-mod_1.c: New file.
4590 2010-05-25 Torbjorn Granlund <tege@gmplib.org>
4592 * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr_itch): Trim out space
4593 for inverse, since that is passed in already.
4595 2010-05-24 Torbjorn Granlund <tege@gmplib.org>
4597 * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr_itch): New function.
4598 * gmp-impl.h: Declare it.
4599 * tune/common.c (speed_mpn_mupi_div_qr): Use new itch function.
4600 * tune/speed.h (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Pass parameters right
4601 for new itch function.
4603 * mpn/powerpc32/lshiftc.asm: New file.
4605 2010-05-22 Torbjorn Granlund <tege@gmplib.org>
4607 * tune/tuneup.c (tune_mod_1): Revert to version of 2010-05-06.
4609 2010-05-17 Torbjorn Granlund <tege@gmplib.org>
4611 * configure.in (ia64): Get 32-bit sizeof test right.
4613 * tune/tuneup.c (tune_mod_1): Undo unintensional change to tuning of
4614 PREINV_MOD_1_TO_MOD_1_THRESHOLD.
4616 2010-05-16 Torbjorn Granlund <tege@gmplib.org>
4618 * mpn/sparc64/mod_1.c: Rewrite.
4619 * mpn/sparc64/sparc64.h (umul_ppmm_s): New macro.
4620 * mpn/sparc64/mod_1_4.c: New file.
4622 * mpn/generic/divrem_1.c: Minor cleanup.
4623 * mpn/generic/mod_1.c: Likewise.
4624 * mpn/generic/mod_1_1.c: Likewise.
4625 * mpn/generic/mod_1_2.c: Likewise.
4626 * mpn/generic/mod_1_3.c: Likewise.
4627 * mpn/generic/mod_1_4.c: Likewise.
4629 * configure.in (ia64-hpux): Do sizeof tests for 32-bit and 64-bit ABI.
4631 * tune/tuneup.c (tune_mod_1): Completely finish MOD_1_N tuning before
4632 tuning MOD_1U_TO_MOD_1_1_THRESHOLD.
4634 2010-05-14 Torbjorn Granlund <tege@gmplib.org>
4636 * mpn/generic/redc_2.c: Use asm code just for GNU C.
4638 2010-05-13 Torbjorn Granlund <tege@gmplib.org>
4640 * mpn/sparc64/ultrasparc1234: New directory. Move all code that uses
4641 floating-point into this directory.
4642 * configure.in: Point to ultrasparc1234 for appropriate CPUs.
4644 * mpn/sparc64/ultrasparct1/add_n.asm: New file.
4645 * mpn/sparc64/ultrasparct1/addlsh2_n.asm: New file.
4646 * mpn/sparc64/ultrasparct1/addmul_1.asm: New file.
4647 * mpn/sparc64/ultrasparct1/lshift.asm: New file.
4648 * mpn/sparc64/ultrasparct1/mul_1.asm: New file.
4649 * mpn/sparc64/ultrasparct1/rsblsh2_n.asm: New file.
4650 * mpn/sparc64/ultrasparct1/rshift.asm: New file.
4651 * mpn/sparc64/ultrasparct1/sublsh1_n.asm: New file.
4652 * mpn/sparc64/ultrasparct1/sublshC_n.asm: New file.
4653 * mpn/sparc64/ultrasparct1/addlsh1_n.asm: New file.
4654 * mpn/sparc64/ultrasparct1/addlshC_n.asm: New file.
4655 * mpn/sparc64/ultrasparct1/lshiftc.asm: New file.
4656 * mpn/sparc64/ultrasparct1/rsblsh1_n.asm: New file.
4657 * mpn/sparc64/ultrasparct1/rsblshC_n.asm: New file.
4658 * mpn/sparc64/ultrasparct1/sub_n.asm: New file.
4659 * mpn/sparc64/ultrasparct1/sublsh2_n.asm: New file.
4660 * mpn/sparc64/ultrasparct1/submul_1.asm: New file.
4661 * mpn/sparc64/ultrasparct1/gmp-mparam.h: New file.
4663 * configure.in: Give ultrasparct1 and ultrasparct2 special code path.
4665 * mpn/x86_64/pentium4/gmp-mparam.h: Disable mpn_addlsh_n, mpn_rsblsh_n.
4667 2010-05-12 Niels Möller <nisse@lysator.liu.se>
4669 * mpz/jacobi.c (mpz_jacobi): Fixed off-by-one error in use of
4672 * tune/common.c (speed_mpz_powm_sec): New function.
4673 * tune/speed.h: Declare speed_mpz_powm_sec.
4674 * tune/speed.c (routine): Added speed_mpz_powm_sec.
4676 * tune/common.c (speed_mpn_addlsh_n, speed_mpn_sublsh_n)
4677 (speed_mpn_rsblsh_n): New functions.
4678 * tune/speed.h: Declare new functions.
4679 * tune/speed.c (routine): Add new functions.
4681 2010-05-12 Torbjorn Granlund <tege@gmplib.org>
4683 * mpn/x86_64/mod_1_4.asm: Tune for more processors.
4685 * mpn/x86_64/pentium4/lshiftc.asm: New file.
4687 2010-05-11 Niels Möller <nisse@lysator.liu.se>
4689 * mpz/jacobi.c (mpz_jacobi): Deleted old implementation.
4690 Reorganized new implementation, to handle small inputs efficiently.
4692 * tests/mpz/t-jac.c (check_large_quotients): Reduced test sizes.
4693 (check_data): One more input pair related to a fixed bug.
4694 (main): Enable check_large_quotients.
4696 2010-05-10 Torbjorn Granlund <tege@gmplib.org>
4698 * mpn/x86_64/aorrlsh2_n.asm: Fix typo.
4700 2010-05-09 Torbjorn Granlund <tege@gmplib.org>
4702 * mpn/x86_64/aorrlshC_n.asm: New file based on aorrlsh2_n.asm.
4703 * mpn/x86_64/aorrlsh2_n.asm: Now just include aorrlshC_n.asm.
4704 * mpn/x86_64/core2/aorrlsh1_n.asm: New file, include ../aorrlshC_n.asm.
4705 * mpn/x86_64/core2/aorrlsh2_n.asm: Likewise.
4707 * mpn/x86_64/core2/sublshC_n.asm: New file based on aorslsh1_n.asm.
4708 * mpn/x86_64/core2/aorslsh1_n.asm: Remove.
4709 * mpn/x86_64/core2/sublsh1_n.asm: Just include sublshC_n.asm.
4710 * mpn/x86_64/core2/sublsh2_n.asm: Likewise.
4712 2010-05-08 Torbjorn Granlund <tege@gmplib.org>
4714 * mpn/x86_64/atom/gmp-mparam.h: Disable mpn_rsh1add_n, mpn_rsh1sub_n.
4716 * mpn/x86_64/pentium4/aorslshC_n.asm: New file based on aorslsh1_n.asm.
4717 * mpn/x86_64/pentium4/aorslsh1_n.asm: Now just include aorslshC_n.asm.
4718 * mpn/x86_64/pentium4/aorslsh2_n.asm: New file.
4720 2010-05-07 Torbjorn Granlund <tege@gmplib.org>
4722 * mpn/sparc64: Support operands of >= 2^32 limbs.
4724 * mpn/sparc64/lshiftc.asm: New file.
4726 * mpn/ia64/divrem_2.asm: Complete rewrite.
4728 2010-05-06 Torbjorn Granlund <tege@gmplib.org>
4730 * tune/tuneup.c (all): Don't call tune_divrem_2.
4732 * mpn/generic/divrem_2.c: Complete rewrite.
4734 * tune/tuneup.c (tune_mod_1): Fix typo.
4736 2010-05-05 Torbjorn Granlund <tege@gmplib.org>
4738 * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Use macro register names.
4739 (mpn_mod_1_1p_cps): Rewrite.
4741 * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Micro-optimise.
4743 * longlong.h: Undo 2009-03-01 change for powerpc64, it gives poor code.
4745 * mpn/x86/pentium4/sse2/mod_1_1.asm: New file.
4747 * mpn/powerpc64/mode64/mod_1_1.asm: New file.
4749 * tune/tuneup.c (tune_mod_1): Use more typical divisor, for the benefit
4750 of machines with early-out multipliers.
4752 2010-05-04 Torbjorn Granlund <tege@gmplib.org>
4754 * tune/tuneup.c (tune_mod_1): Fix typo.
4756 * mpn/generic/mod_1_1.c: Undo last change.
4757 * mpn/x86_64/mod_1_1.asm: Likewise.
4759 2010-05-03 Niels Möller <nisse@lysator.liu.se>
4761 * mpn/generic/jacobi_lehmer.c (jacobi_hook): New function.
4762 (mpn_jacobi_subdiv_step): Deleted function.
4763 (mpn_jacobi_lehmer): Use general mpn_gcd_subdiv_step.
4765 * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Reorganized
4766 to use a single hook function.
4767 * mpn/generic/gcdext.c (mpn_gcdext): Adapted to new hook
4769 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): New unified hook
4771 * mpn/generic/gcd.c (gcd_hook): Renamed from gcd_done, and adapted
4772 to new hook interface.
4773 * gmp-impl.h (gcd_subdiv_step_hook): New typedef, now a function
4775 (mpn_gcdext_hook): Declare.
4777 2010-05-03 Torbjorn Granlund <tege@gmplib.org>
4779 * mpn/generic/mod_1_1.c: Avoid multiply for 2 limb feed-in.
4780 * mpn/generic/mod_1_2.c: Likewise.
4781 * mpn/generic/mod_1_3.c: Likewise.
4782 * mpn/generic/mod_1_4.c: Likewise.
4783 * mpn/x86_64/mod_1_1.asm: Likewise.
4784 * mpn/x86_64/mod_1_2.asm: Likewise.
4785 * mpn/x86_64/mod_1_4.asm: Likewise.
4786 * mpn/x86/k7/mod_1_4.asm: Likewise.
4787 * mpn/x86/pentium4/sse2/mod_1_4.asm: Likewise.
4788 * mpn/alpha/ev6/mod_1_4.asm: Likewise.
4790 * tune/tuneup.c (tune_mod_1): Measure MOD_1_1_TO_MOD_1_2_THRESHOLD and
4791 MOD_1_2_TO_MOD_1_4_THRESHOLD before MOD_1U_TO_MOD_1_1_THRESHOLD for
4794 * mpn/powerpc64/sqr_diagonal.asm: Complete rewrite.
4796 * mpn/powerpc64/mode64/mod_1_4.asm: New file.
4798 2010-05-02 Torbjorn Granlund <tege@gmplib.org>
4800 * config.guess: Recognise power7.
4802 * configure.in: Major overhaul of powerpc support.
4804 * mpn/powerpc64/p6/lshift.asm: New file.
4805 * mpn/powerpc64/p6/lshiftc.asm: Likewise.
4806 * mpn/powerpc64/p6/rshift.asm: Likewise.
4808 2010-04-30 Torbjorn Granlund <tege@gmplib.org>
4810 * configure.in (powerpc64): Support CPU specific mode-less subdirs.
4812 * mpn/powerpc64/aix.m4 (PROLOGUE_cpu): Use "named csect" making
4813 requested aignment actually honoured.
4815 2010-04-30 Niels Möller <nisse@lysator.liu.se>
4817 * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Fixed handling of
4818 the case bl == 1. Fixed missing application of reciprocity.
4820 2010-04-29 Niels Möller <nisse@lysator.liu.se>
4822 * configure.in (gmp_mpn_functions): Deleted gcdext_subdiv_step.
4824 * mpn/generic/gcdext.c (mpn_gcdext): Use new generalized
4825 mpn_gcd_subdiv_step.
4827 * mpn/generic/gcdext_lehmer.c (gcdext_update): New function.
4828 (gcdext_done): New function.
4829 (gcdext_hook): New const hook struct.
4830 (mpn_gcdext_lehmer_n): Use new generalized mpn_gcd_subdiv_step.
4832 * mpn/generic/gcd.c (gcd_done): New function.
4833 (gcd_hook): New const hook struct.
4834 (mpn_gcd): Adapted to new mpn_gcd_subdiv_step interface.
4836 * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Reorganized
4837 function. Added hook function pointers to the argument list, so
4838 the same function can be used for gcd, gcdext, and jacobi.
4840 * gmp-impl.h (struct gcd_subdiv_step_hook): New struct.
4841 (mpn_gcdext_subdiv_step): Deleted prototype.
4842 (struct gcdext_ctx): New struct.
4843 (gcdext_hook): Declare const struct.
4844 (mpn_gcd_subdiv_step): Updated prototype.
4846 * mpn/generic/gcdext_subdiv_step.c: Deleted file.
4848 2010-04-28 Torbjorn Granlund <tege@gmplib.org>
4850 * mpn/powerpc64/lshift.asm: Rewrite.
4851 * mpn/powerpc64/rshift.asm: Likewise.
4852 * mpn/powerpc64/mode64/lshiftc.asm: New file.
4854 * mpn/powerpc64/aix.m4: Align functions to 32-byte boundary.
4855 * mpn/powerpc64/darwin.m4: Likewise.
4856 * mpn/powerpc64/elf.m4: Likewise.
4858 2010-04-28 Niels Möller <nisse@lysator.liu.se>
4860 * tests/mpz/t-jac.c (check_data): Added some more test cases.
4862 * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Bugfix, count
4863 trailing zeros, not leading.
4865 2010-04-27 Torbjorn Granlund <tege@gmplib.org>
4867 * mpn/powerpc64/mode64/p6/mul_basecase.asm: New file.
4869 2010-04-23 Niels Möller <nisse@lysator.liu.se>
4871 * gmp-impl.h (MPN_GCD_LEHMER_N_ITCH): Deleted.
4872 (mpn_gcd_lehmer_n): Deleted declaration.
4874 * mpn/generic/gcd.c (gcd_2): Moved from gcd_lehmer.c.
4875 (mpn_gcd): Inlined the code from mpn_gcd_lehmer_n. Also use
4876 MPN_GCD_SUBDIV_STEP_ITCH rather than MPN_GCD_LEHMER_N_ITCH.
4878 2010-04-22 Torbjorn Granlund <tege@gmplib.org>
4880 * mpn/powerpc64/mode64/bdiv_dbm1c.asm: Swap multiply insns to make them
4881 consecutive, for the benefit of POWER6.
4883 * mpn/powerpc64/mode64/p6/gmp-mparam.h: New file.
4885 2010-04-21 Torbjorn Granlund <tege@gmplib.org>
4887 * mpn/generic/gcd_lehmer.c: Deleted file.
4889 * mpn/powerpc64/mode64/divrem_1.asm: Swap multiply insns to make them
4890 consecutive, for the benefit of POWER6.
4891 * mpn/powerpc64/mode64/dive_1.asm: Likewise.
4892 * mpn/powerpc64/mode64/divrem_2.asm: Likewise.
4893 * mpn/powerpc64/mode64/mul_1.asm: Likewise.
4894 * mpn/powerpc64/mode64/aorsmul_1.asm: Likewise.
4896 * mpn/powerpc64/mode64/aorslshC_n.asm: Swap ldx operands as a temporary
4897 workaround for POWER6 pipeline glitch.
4899 2010-04-19 Niels Möller <nisse@lysator.liu.se>
4901 * mpz/jacobi.c (mpz_jacobi): New implementation using
4902 mpn_jacobi_lehmer. Currently #if:ed out.
4904 * mpn/generic/jacbase.c (mpn_jacobi_base)
4905 [JACOBI_BASE_METHOD < 4]: Support inputs with a >= b.
4907 * gmp-impl.h (mpn_jacobi_lehmer): Added prototype.
4908 (jacobi_table): Declare.
4909 (mpn_jacobi_init): New inline function.
4910 (mpn_jacobi_finish): Likewise.
4911 (mpn_jacobi_update): Likewise.
4913 * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): New file, new
4916 * configure.in (gmp_mpn_functions): Added jacobi_lehmer.
4918 2010-04-14 Niels Möller <nisse@lysator.liu.se>
4920 * configure.in (gmp_mpn_functions): Added
4921 matrix22_mul1_inverse_vector.
4922 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
4923 matrix22_mul1_inverse_vector.c.
4925 * gmp-impl.h (mpn_matrix22_mul1_inverse_vector): Updated for
4926 rename of mpn_matrix22_mul1_inverse_vector.
4927 * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Likewise.
4928 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Likewise.
4929 * mpn/generic/hgcd.c (hgcd_step): Likewise.
4931 * mpn/generic/matrix22_mul1_inverse_vector.c
4932 (mpn_matrix22_mul1_inverse_vector): New file, function moved and
4934 * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_inverse_vector):
4937 2010-04-12 Torbjorn Granlund <tege@gmplib.org>
4939 * tests/mpn/t-toom6h.c (SIZE_LOG): Define.
4940 * tests/mpn/t-toom8h.c (SIZE_LOG): Likewise.
4942 2010-04-10 Torbjorn Granlund <tege@gmplib.org>
4944 * mpn/ia64/lorrshift.asm: Rewrite feed-in and wind-down code.
4946 * mpn/ia64/aorslsh1_n.asm: Adapt to new aorslsh1_n.
4947 * mpn/ia64/aorslsh1_n.asm: Likewise.
4949 * mpn/ia64/aors_n.asm: Complete rewrite.
4950 * mpn/ia64/aorslsh1_n.asm: Likewise.
4952 * mpn/ia64/add_n_sub_n.asm: Misc cleanups. Add slotting comments.
4954 * mpn/ia64/lshiftc.asm: New file.
4956 * mpn/x86_64/pentium4/gmp-mparam.h: No longer disable rsh1add_n and
4957 rsh1sub_n; instead disable rsblsh1_n, addlsh2_n, rsblsh2_n.
4959 * mpn/x86/divrem_2.asm: Use "orb" instead of "or" to work around
4960 Solaris assembler bug.
4961 * mpn/x86_64/mpn/x86_64/divrem_2.asm: Likewise.
4963 * mpn/x86/aors_n.asm: Use operand-less shift-by-1 insn form.
4964 * mpn/x86/pentium/aors_n.asm: Likewise.
4965 * mpn/x86_64/invert_limb.asm: Likewise.
4967 * mpn/x86_64/pentium4/aors_n.asm: Let non-nc code fall into nc code.
4969 * mpn/x86_64/pentium4/rsh1aors_n.asm: New file.
4971 2010-03-25 Torbjorn Granlund <tege@gmplib.org>
4973 * mpn/ia64/add_n_sub_n.asm: New file.
4975 * mpn/generic/toom33_mul.c: Fix mpn_add_n_sub_n usage.
4976 * mpn/generic/toom3_sqr.c: Likewise.
4977 * mpn/generic/toom63_mul.c: Likewise.
4979 * mpn/generic/add_n_sub_n.c: Renamed from addsub_n.c.
4981 2010-03-23 Torbjorn Granlund <tege@gmplib.org>
4983 * mpn/x86_64/divrem_2.asm: Use mpn_invert_limb instead of div insn.
4985 * mpn/ia64/aorslshC_n.asm: New file, generalised from last iteration of
4987 * mpn/ia64/aorslsh1_n.asm: Use aorslshC_n.asm.
4988 * mpn/ia64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
4990 2010-03-20 Torbjorn Granlund <tege@gmplib.org>
4992 * mpn/powerpc64/mode64/invert_limb.asm: Rewrite to exploit cancellation
4993 in the Newton iteration.
4995 2010-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
4997 * mpn/generic/toom_interpolate_8pts.c: Use mpn_sublsh2_n.
4999 2010-03-20 Torbjorn Granlund <tege@gmplib.org>
5001 * mpn/powerpc64/mode64/aorslshC_n.asm: New file, generalised from
5002 last iteration of aorslsh1_n.asm.
5003 * mpn/powerpc64/mode64/aorslsh1_n.asm: Use aorslshC_n.asm.
5004 * mpn/powerpc64/mode64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
5006 2010-03-19 Torbjorn Granlund <tege@gmplib.org>
5008 * mpn/x86_64/nano/dive_1.asm: New file.
5010 * mpn/x86_64/divrem_1.asm: Avoid shld since it is slow on several CPU
5011 types. Unconditionally provide code for normalised and unnormalised
5012 divisors. Cleanup labels.
5014 * mpn/x86_64/core2/divrem_1.asm: Remove special code for normalised
5015 divisors. Cleanup labels.
5017 * mpn/generic/toom_interpolate_6pts.c: Call mpn_sublsh2_n and
5018 mpn_sublsh_n with correct args.
5020 * tests/devel/try.c: Use enum for TYPE_*.
5022 * tests/devel/try.c: Test mpn_sublsh2_n.
5023 * tests/refmpn.c (refmpn_sublsh2_n): New function.
5024 * tests/tests.h (refmpn_sublsh2_n): Declare.
5026 * mpn/powerpc64/mode64/aorslsh1_n.asm: New file, with faster
5027 mpn_addlsh1_n and mpn_sublsh1_n.
5028 * mpn/powerpc64/mode64/addlsh1_n.asm: Delete.
5029 * mpn/powerpc64/mode64/sublsh1_n.asm: Delete.
5031 2010-03-18 Torbjorn Granlund <tege@gmplib.org>
5033 * configure.in (*-*-aix): Define gcc_32_cflags_maybe, ar_32_flags and
5036 * mpn/x86/pentium4/sse2/addlsh1_n.asm: Tune for slightly better speed.
5037 Misc cleanups. Add cycle table.
5039 * mpn/x86_64/copyi.asm: Update cycle table.
5040 * mpn/x86_64/copyd.asm: Likewise.
5041 * mpn/x86_64/rsh1aors_n.asm: Likewise.
5042 * mpn/x86_64/dive_1.asm: Likewise.
5044 * mpn/x86/pentium4/sse2/add_n.asm: Misc cleanups. Add cycle table.
5045 * mpn/x86/pentium4/sse2/sub_n.asm: Likewise.
5047 2010-03-16 Torbjorn Granlund <tege@gmplib.org>
5049 * mpn/x86_64/divrem_1.asm: Use mpn_invert_limb instead of div insn.
5050 * mpn/x86_64/core2/divrem_1.asm: Likewise.
5052 * tune/speed.c (routine): Add FLAG_R_OPTIONAL for many binops.
5054 2010-03-15 Torbjorn Granlund <tege@gmplib.org>
5056 * mpn/alpha/ev6/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
5058 * mpn/ia64/aors_n.asm: Insert explicitly typed nops to trigger intended
5060 * mpn/ia64/aorslsh1_n.asm: Likewise.
5061 * mpn/ia64/dive_1.asm: Likewise.
5063 2010-03-13 Torbjorn Granlund <tege@gmplib.org>
5065 * mpn/x86/pentium4/sse2/submul_1.asm: Rewrite.
5067 * mpn/powerpc64/mode64/aorsmul_1.asm: New file, faster than old code
5068 for both mpn_addmul_1 and mpn_submul_1.
5069 * mpn/powerpc64/mode64/addmul_1.asm: Remove.
5070 * mpn/powerpc64/mode64/submul_1.asm: Remove.
5072 2010-03-11 Niels Möller <nisse@lysator.liu.se>
5074 * mpn/generic/gcd_lehmer.c (gcd_2): Use sub_ddmmss.
5076 * mpn/generic/jacbase.c (mpn_jacobi_base): Reorganized the
5077 JACOBI_BASE_METHOD 4 slightly. Now requires that b > 1.
5079 2010-03-10 Torbjorn Granlund <tege@gmplib.org>
5081 * mpn/x86_64/divrem_1.asm: Make fraction code take documented # of
5082 cycles. Annotate code for more CPUs. Misc cleanups.
5083 * mpn/x86_64/core2/divrem_1.asm: Annotate code for more CPUs.
5085 * mpn/alpha/ev6/mod_1_4.asm: New file.
5087 * mpn/ia64/mod_34lsub1.asm: New file.
5089 * doc/gmp.texi (Language Bindings): Update Python site, add Ruby.
5091 2010-03-10 Niels Möller <nisse@lysator.liu.se>
5093 * tune/tuneup.c (tune_jacobi_base): Consider mpn_jacobi_base_4.
5094 * tune/speed.c (routine): Added mpn_jacobi_base_4.
5095 * tune/common.c (speed_mpn_jacobi_base_4): New function.
5096 * tune/speed.h (speed_mpn_jacobi_base_4): Declare it.
5097 * tune/Makefile.am (libspeed_la_SOURCES): Added jacbase4.c.
5098 * tune/jacbase4.c: New file.
5100 * mpn/generic/jacbase.c (mpn_jacobi_base): New function, for
5101 JACOBI_BASE_METHOD 4.
5103 2010-03-09 Niels Möller <nisse@lysator.liu.se>
5105 * tests/mpz/t-jac.c (check_large_quotients): Also generate inputs
5106 with large quotients and a large gcd.
5108 2010-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
5110 * tests/mpz/t-bin.c (randomwalk): New test-generator function.
5112 2010-03-07 Torbjorn Granlund <tege@gmplib.org>
5114 * tune/speed.c (routine): Force r argument for several mod_1 calls.
5116 2010-03-06 Torbjorn Granlund <tege@gmplib.org>
5118 * mpn/x86_64/divrem_1.asm: Disable SPECIAL_CODE_FOR_NORMALIZED_DIVISOR.
5121 * mpn/x86_64/mod_1_1.asm: New file.
5122 * mpn/x86_64/mod_1_2.asm: New file.
5123 * mpn/x86_64/mod_1_4.asm: Update cycle counts.
5125 * tests/tests.h (TESTS_REPS): Fix typo.
5127 2010-03-03 Torbjorn Granlund <tege@gmplib.org>
5129 * mpn/x86_64/core2/divrem_1.asm: New file.
5131 2010-02-26 Niels Möller <nisse@lysator.liu.se>
5133 * tune/speed.c (routine): Added udiv_qrnnd_preinv3.
5135 * tune/common.c (speed_udiv_qrnnd_preinv3): New function.
5136 * tune/speed.h: Added prototype for it.
5138 2010-02-26 Niels Möller <nisse@lysator.liu.se>
5140 * tests/mpz/t-jac.c (check_large_quotients): New test. Currently
5141 disabled, since it's quite slow.
5142 (mpz_nextprime_step): New function.
5144 2010-02-26 Torbjorn Granlund <tege@gmplib.org>
5146 * mpn/pa64/aors_n.asm: Fix typo in last change.
5148 2010-02-25 Niels Möller <nisse@lysator.liu.se>
5150 * tests/mpz/t-jac.c (ref_jacobi): New reference implementation,
5151 using factorization and legendre symbols computed by powm.
5153 * tests/devel/try.c (param_init, call): Don't pass negative values
5154 for the second argument to mpz_jacobi and refmpz_jacobi.
5156 * tests/refmpz.c (refmpz_jacobi): Require that b is odd and positive.
5158 * tests/devel/try.c (param_init): Support mpz_legendre.
5159 (choice_array): Added mpz_kronecker (apparently forgotten) and
5161 (call): Added TYPE_MPZ_LEGENDRE.
5162 (try_one): Added support for DATA_SRC1_ODD_PRIME.
5164 * tests/refmpz.c (refmpz_legendre): Rewrote using powm.
5166 2010-02-25 Torbjorn Granlund <tege@gmplib.org>
5168 * config.guess: Make "corei" default for unrecognised Intel P6 CPUs.
5170 * tests/mpz/t-perfpow.c (check_random): Use mp_limb_t type for limb
5173 * tests/mpn/t-toom6h.c (COUNT): Define.
5174 * tests/mpn/t-toom8h.c (COUNT): Define.
5176 * tests/mpn/t-div.c: Cast a switch index to placate HP's cc.
5177 * tests/mpn/t-bdiv.c: Likewise.
5179 * mpn/pa64/aors_n.asm: Fix support of the 2.0n ABI.
5181 2010-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
5183 * tests/mpz/t-bin.c (data): Replace (2k,k), tested by twos ().
5184 * tests/mpf/t-inp_str.c (data): Test also "+" in the exponent.
5186 2010-02-23 Torbjorn Granlund <tege@gmplib.org>
5188 * mpn/generic/mod_1_3.c: Cast a switch index to placate HP's cc.
5190 * mpn/generic/sqrtrem.c: Use CNST_LIMB.
5192 2010-02-20 Niels Möller <nisse@lysator.liu.se>
5194 * tune/speed.h (mpn_gcd_accel): Deleted prototype.
5195 (mpn_hgcd_lehmer): New prototype.
5196 (MPN_HGCD_LEHMER_ITCH): New macro (previously in gmp-impl.h).
5198 * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_lehmer.c.
5199 * tune/hgcd_lehmer.c: New file.
5200 * tune/gcd_accel.c: Deleted obsolete file.
5202 * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): Deleted macro.
5204 * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Deleted function,
5205 (mpn_hgcd): Don't call mpn_hgcd_lehmer, instead use inlined loop
5207 (mpn_hgcd_itch): Substitute n for MPN_HGCD_LEHMER_ITCH (n).
5209 2010-02-19 Niels Möller <nisse@lysator.liu.se>
5211 * Makefile.am (mpn/jacobitab.h): Added the rules needed to
5214 * gen-jacobitab.c: New file.
5216 2010-02-19 Torbjorn Granlund <tege@gmplib.org>
5218 * mpn/generic/powm.c: Honour SQR_BASECASE_THRESHOLD in innerloop
5221 2010-02-16 Niels Möller <nisse@lysator.liu.se>
5223 * tune/time.c (cgt_works_p): Added rudimentary sanity check for
5224 clock_gettime working.
5226 2010-02-15 Niels Möller <nisse@lysator.liu.se>
5228 * tune/time.c (speed_time_init): Make use of cycle counter
5229 configurable, via the speed_option_cycles_broken flag.
5230 * tune/common.c (speed_option_cycles_broken): New global variable.
5231 (speed_option_set): Recognize option "cycles-broken".
5233 * tune/time.c (cycles_works_p): Deleted hack to disable cycle
5234 counter on linux. Needs to be replaced by something more
5237 2010-02-11 Niels Möller <nisse@lysator.liu.se>
5239 * tune/time.c (speed_time_init): Fix speed_time_string when using
5241 (cycles_works_p): On linux, don't use the cycle counter.
5243 * tune/Makefile.am: Add $(TUNE_LIBS) when linking programs.
5245 * configure.in: Check if -lrt is needed for clock_gettime, and if
5246 so, add that flag to TUNE_LIBS.
5248 2010-02-07 Torbjorn Granlund <tege@gmplib.org>
5250 * tune/tuneup.c (tune_redc): Set min_size and min_is_always when
5251 measuring REDC_1_TO_REDC_2_THRESHOLD.
5252 (tune_mod_1): Set min_size for PREINV_MOD_1_TO_MOD_1_THRESHOLD.
5254 * mpn/x86_64/aorrlsh_n.asm (cnt): Fix a typo.
5255 * mpn/x86_64/lshsub_n.asm: Likewise.
5257 2010-02-05 Torbjorn Granlund <tege@gmplib.org>
5259 * Version 5.0.1 released.
5261 * mpn/generic/powm.c: Use rp target area for power table computation in
5262 order to use less scratch.
5264 * mpn/generic/binvert.c (mpn_binvert_itch): Enable more economical
5265 mpn_mulmod_bnm1_itch call.
5267 * mpn/generic/mu_div_qr.c: Remove always true #if.
5268 * mpn/generic/mu_divappr_q.c: Likewise.
5269 * mpn/generic/mu_bdiv_q.c: Likewise.
5270 * mpn/generic/mu_bdiv_qr.c: Likewise.
5272 2010-02-01 Torbjorn Granlund <tege@gmplib.org>
5274 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
5277 * mpn/powerpc64/mode64/gmp-mparam.h: Remove {MUL,SQR}_FFT_TABLE2.
5278 * mpn/x86/p6/gmp-mparam.h: Likewise.
5279 * mpn/x86/p6/mmx/gmp-mparam.h: Likewise.
5280 * mpn/generic/mul_fft.c: Don't depend on FFT_TABLE2, it was broken.
5282 2010-01-29 Torbjorn Granlund <tege@gmplib.org>
5284 * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Remove arguments n, m,
5285 k and rec; add argument sqr. Don't call mpn_mul_fft_decompose here,
5286 instead do that in all callers.
5287 (mpn_mul_fft): Trim allocation when squaring, and use TMP_ALLOC*, not
5288 explicit alloc/free.
5289 (mpn_fft_div_2exp_modF): Avoid a scalar division.
5290 (mpn_fft_mul_modF_K): Replace some multiplies by K with shifting by k.
5291 (mpn_fft_mul_2exp_modF): Make function more symmetrical.
5293 2010-01-27 Torbjorn Granlund <tege@gmplib.org>
5295 * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): Rewrite.
5296 * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Re-enable
5297 better mulmod itch estimate.
5298 * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
5299 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
5300 * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
5302 2010-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
5304 * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Disabled guessed
5305 estimate, enabled a conservative one.
5306 * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
5307 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
5308 * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
5310 2010-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
5312 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Partial rewrite to
5313 reduce memory usage.
5314 * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
5315 (mpn_sqrmod_bnm1_next_size): New function.
5317 * gmp-impl.h (mpn_mulmod_bnm1_itch): Accepts 3 parameters now.
5318 (mpn_sqrmod_bnm1_itch): New inline function.
5319 (mpn_sqrmod_bnm1_next_size): Declaration and mangling.
5320 * mpn/generic/nussbaumer_mul.c: Use the new functions.
5322 * mpn/generic/invertappr.c (mpn_ni_invertappr): Use new syntax for
5323 mpn_mulmod_bnm1_itch.
5324 * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
5325 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
5326 * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
5327 * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Likewise.
5328 * mpn/generic/binvert.c (mpn_binvert_itch): Likewise.
5329 * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): Likewise.
5330 (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Likewise.
5332 * tests/mpn/t-sqrmod_bnm1.c, tests/mpn/t-mulmod_bnm1.c: Test
5333 reduced memory usage.
5335 2010-01-25 Torbjorn Granlund <tege@gmplib.org>
5337 * tune/tuneup.c (INSERT_FFTTAB): New macro, like old insertion code but
5338 also inserting a sentinel.
5339 (fftmes): Use INSERT_FFTTAB for inserting new measurements.
5340 Limit k range to best_k - 4 ... best_k + 4.
5342 2010-01-23 Torbjorn Granlund <tege@gmplib.org>
5344 * gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
5345 (__GMP_MP_RELEASE): New macro.
5347 * mpf/div.c: Rewrite to use mpn_div_q.
5349 2010-01-21 Torbjorn Granlund <tege@gmplib.org>
5351 * Add FFT_TABLE3 tables for a basic set of machines.
5353 * configure.in: Use -mtune=nocona for 64-bit pentium4.
5355 * config.guess: Recognise many more Intel processors.
5357 * tune/common.c: Whitespace cleanup.
5358 (speed_mpn_matrix22_mul): Rewrite.
5360 2010-01-21 Niels Möller <nisse@lysator.liu.se>
5362 * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Take
5363 advantage of new mpn_mulmod_bnm1 interface, to reduce allocation.
5365 * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1, main): Adapted to
5366 mpn_mulmod_bnm1 interface change.
5368 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Interface change,
5369 in case an + bn < rn, only write an + bn output limbs. New input
5370 requirement, an + bn > rn/2.
5371 * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Corresponding
5374 2010-01-19 Torbjorn Granlund <tege@gmplib.org>
5376 * tune/tuneup.c (fftmes): Round up initial n according to initial k.
5377 Limit k to 24 in loop. Remove an obsolete always-true condition.
5378 Remove a redundant trace printout.
5380 2010-01-18 Torbjorn Granlund <tege@gmplib.org>
5382 * tune/tuneup.c (fftmes): New function
5384 (mpn_mul_fft_lcm): New function, copied from mpn/generic/mul_fft.c.
5385 (fftfill): New function, code taken from mul_fft.c (mpn_mul_fft).
5386 (cached_measure): New function.
5388 * gmp-impl.h (struct fft_table_nk): Moved from mul_fft.c.
5389 (MUL_FFT_TABLE3, SQR_FFT_TABLE3): Provide dummy versions for tuneup
5391 (FFT_TABLE3_SIZE): Increase value for tuneup builds.
5393 * mpn/generic/mul_fft.c: Handle a new FFT threshold table type ("3").
5394 Misc cleanups to old table type code.
5396 2010-01-16 Torbjorn Granlund <tege@gmplib.org>
5398 * mpn/x86_64/darwin.m4: Fix typo in last change.
5400 2010-01-15 Torbjorn Granlund <tege@gmplib.org>
5402 * gmp-h.in (__GMP_EXTERN_INLINE): Remove "extern" for newer Sun C.
5404 * gmp-impl.h (GMP_LIMB_BYTES): New define.
5406 * mpn/x86_64/darwin.m4 (LEA): New define.
5408 * mpn/x86/invert_limb.asm (approx_tab): Use DEF_OBJECT.
5409 Rename and globalise it to work around Mac OS bug.
5411 With Philip McLaughlin:
5412 * mpn/x86_64/gcd_1.asm (ctz_table): Don't use local prefix, but
5413 use DEF_OBJECT...END_OBJECT.
5414 Keep stack pointer at ABI mandated alignment over call.
5416 2010-01-12 Torbjorn Granlund <tege@gmplib.org>
5418 * tune/speed.c (routine): Remove obsolete mpn_dc_tdiv_qr and
5420 * tune/common.c (speed_mpn_dc_tdiv_qr, speed_mpn_dcpi1_div_qr_n):
5421 Remove now unused functions.
5422 * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_N,
5423 SPEED_ROUTINE_MPN_DC_DIVREM_SB, SPEED_ROUTINE_MPN_DC_TDIV_QR): Remove
5426 * mpn/x86_64/fat/fat_entry.asm (mpn_cpuid_available): Remove function.
5428 * ltmain.sh: Upgrade from 1.5.24 to 2.2.6b.
5430 * .bootstrap: Remove explicit versions.
5432 * doc/gmp.texi (Block-wise Barrett Division): New node.
5434 * mpn/generic/powm.c: Change some #if to plain 'if' to avoid fat build
5437 2010-01-11 Torbjorn Granlund <tege@gmplib.org>
5439 * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): Accept arguments for size
5441 * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
5442 (speed_mpn_sbpi1_divappr_q, speed_mpn_dcpi1_divappr_q): Pass size
5443 limits for SPEED_ROUTINE_MPN_PI1_DIV.
5445 * tune/speed.c (routine): Allow .r argument for mpn_sbpi1_divappr_q and
5446 mpn_dcpi1_divappr_q.
5448 2010-01-08 Torbjorn Granlund <tege@gmplib.org>
5450 * Version 5.0.0 released.
5452 * mpn/generic/div_q.c: Handle mpn_*_divappr_q returning high limb
5455 2010-01-07 Torbjorn Granlund <tege@gmplib.org>
5457 * Update MUL_FFT_TABLE2 and SQR_FFT_TABLE2 for many machines.
5459 * mpn/generic/mu_div_q.c: Account for divisor truncation error as well
5460 as mpn_mu_divappr_q's error.
5462 * mpn/generic/mu_div_q.c: Handle mpn_preinv_mu_divappr_q returning a
5465 * tests/mpn/t-bdiv.c: Move a random call for debugability.
5466 * tests/mpn/t-div.c: Likewise.
5468 * mpn/generic/mu_divappr_q.c: Rewrite quotient round-up code.
5470 * mpn/generic/mu_div_qr.c: Handle carry-out from a carry propagation
5472 * mpn/generic/mu_divappr_q.c: Likewise.
5474 * mpn/generic/mu_divappr_q.c
5475 (mpn_preinv_mu_divappr_q, mpn_mu_divappr_q): Declare dividend constant.
5476 * gmp-impl.h: Likewise.
5478 * perfpow.c (mpn_perfect_power_p): Call mpn_divexact instead of
5479 mpn_bdiv_q (with too little scratch space!).
5482 * tests/mpn/t-div.c (check_one): Get rid of the poorly managed variable
5485 * mpn/minithres/gmp-mparam.h: Add all lately defined thresholds.
5487 * mpn/generic/div_q.c: Use SB division for small quotients as well as
5488 small divisors. Fix typo in itch call.
5490 2010-01-06 Niels Möller <nisse@lysator.liu.se>
5492 * tests/mpn/t-div.c (check_one): Checking based on multiplication,
5493 refmpn_mul, rather than refmpn_tdiv_qr.
5495 2010-01-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
5497 * mpn/generic/toom8h_mul.c: Avoid overflows of mp_size_t.
5499 2010-01-06 Torbjorn Granlund <tege@gmplib.org>
5501 * gmp-h.in (__GNU_MP__): Bump.
5502 (__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
5504 * mp-h.in (__GNU_MP__): Bump.
5505 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
5508 * doc/gmp.texi: Rewrite mpn_gcdext text. Remove some out-of-date
5509 text in Algorithms chapter.
5511 * mpn/generic/div_q.c: Properly handle np=scratch. Fix critical typo
5512 in final adjustment code. Misc cleanups.
5514 * mpn/generic/rootrem.c: Use mpn_div_q.
5515 * mpz/tdiv_q.c: Likewise.
5517 * tests/mpn/t-div.c: Test mpn_div_q.
5518 (SIZE_LOG): Up to 17.
5520 * mpn/generic/div_q.c: New file.
5521 * configure.in (gmp_mpn_functions): Add div_q.
5523 * mpn/generic/mu_div_q.c: Actually declare dividend constant.
5525 2010-01-04 Torbjorn Granlund <tege@gmplib.org>
5527 * tune/tuneup.c (fft): Separate tuning of modf and full products.
5528 (struct fft_param_t): New field, mul_modf_function.
5529 (tune_fft_sqr): Fix typo.
5530 (tune_fft_mul, tune_fft_sqr): Initialise mul_modf_function field.
5531 * tune/common.c (speed_mpn_fft_mul, speed_mpn_fft_sqr): New functions.
5533 * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Clean up.
5535 * mpn/generic/mul.c: Simplify rational expression.
5537 * gmp-impl.h: Cleanup threshold variables; remove obsolete ones and
5538 make all possibly needed definitions for existing ones.
5539 * tune/tuneup.c (tune_mul): Write fractions-compensated values to
5540 threshold variables.
5542 2010-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
5544 * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
5547 * mpn/generic/toom_interpolate_6pts.c: Small reorganisation.
5549 2010-01-03 Torbjorn Granlund <tege@gmplib.org>
5551 * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
5552 INV_MULMOD_BNM1_THRESHOLD/2 instead.
5554 * gmp-impl.h (INV_APPR_THRESHOLD, INV_MULMOD_BNM1_THRESHOLD): Default
5556 * mpn/generic/invert.c, mpn/generic/invertappr.c: ...not here.
5558 * tests/mpn/t-div.c: Rewrite operand generation code.
5560 2010-01-02 Torbjorn Granlund <tege@gmplib.org>
5562 * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
5563 INV_MULMOD_BNM1_THRESHOLD.
5565 2010-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
5567 * mpn/generic/dcpi1_div_q.c: Handle divappr approximation problem more
5569 * mpn/generic/mu_div_q.c: Likewise.
5571 * mpn/generic/invert.c: Remove duplicated code.
5573 2010-01-01 Torbjorn Granlund <tege@gmplib.org>
5575 * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to 0.
5577 * mpn/generic/mu_div_qr.c: Rewrite to use mpn_mulmod_bnm1. Clean up
5578 scratch usage. Improve itch functions.
5579 * mpn/generic/mu_divappr_q.c: Likewise.
5580 * mpn/generic/mu_bdiv_qr.c: Likewise.
5581 * mpn/generic/mu_div_q.c: Likewise.
5583 * mpn/generic/dcpi1_bdiv_qr.c: Add parameter ASSERTs.
5584 * mpn/generic/dcpi1_bdiv_q.c: Likewise.
5586 * tests/mpn/t-bdiv.c: Replace with unit testing code, based on t-div.c.
5587 Increase COUNT to 500.
5589 * tests/mpn/t-div.c: Avoid generating too small test operands.
5590 Move SB suppression limit downwards. Increase COUNT to 200.
5592 2009-12-31 Torbjorn Granlund <tege@gmplib.org>
5594 * mpn/generic/tdiv_qr.c: Handle numerator/remainder overlap in MU case.
5596 * tests/tests.h (TESTS_REPS): New macro.
5597 * tests/mpz/dive.c: Use larger operands, decrease default reps, use
5599 * tests/mpz/convert.c: Likewise.
5600 * tests/mpz/t-sqrtrem.c: Likewise.
5601 * tests/mpz/reuse: Likewise.
5602 * tests/mpz/t-root.c: Likewise.
5603 * tests/mpz/t-tdiv.c: Likewise.
5604 * tests/mpz/t-gcd.c: Likewise.
5605 * tests/mpz/t-powm.c: Likewise.
5607 2009-12-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
5609 * mpn/generic/toom8_sqr.c (SQR_TOOM8_MAX): Avoid overflow.
5610 * mpn/generic/toom6_sqr.c (SQR_TOOM6_MAX): Likewise.
5612 * mpn/generic/mulmod_bnm1.c: Don't mention MISUSE any more,
5613 simply consider UNLIKELY any unexpected size.
5615 2009-12-31 Torbjorn Granlund <tege@gmplib.org>
5617 * tune/tuneup.c (speed_mpn_sbordcpi1_div_qr): New function.
5618 (tune_mu_div): Use it.
5620 2009-12-30 Torbjorn Granlund <tege@gmplib.org>
5622 * tune/tuneup.c (tune_mu_bdiv, tune_dc_bdiv, tune_mu_div)
5623 (tune_dc_div): Clear global s.r to make speed functions do 2n/n.
5625 * tune/speed.c (routine): New entries for mpn_mu_div_qr and
5626 mpn_mupi_div_qr. Allow .r parameter for mpn_sbpi1_div_qr,
5628 * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV, SPEED_ROUTINE_MPN_MU_DIV_QR)
5629 (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Handle .r parameter.
5631 * tests/mpz/t-tdiv.c: Increase operands size again.
5633 * mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
5635 * mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
5638 2009-12-29 Torbjorn Granlund <tege@gmplib.org>
5640 * tune/tuneup.c (tune_mu_div): Tune MUPI_DIV_QR_THRESHOLD.
5641 * tune/speed.h (struct speed_params): Allow 3 source operands.
5642 (SPEED_ROUTINE_MPN_MUPI_DIV_QR): New macro.
5643 * tune/common.c (speed_mpn_mupi_div_qr): New function.
5645 * mpn/generic/tdiv_qr.c: Call mpn_mu_div_qr.
5647 * tests/mpz/t-tdiv.c: Use larger test operands.
5649 * mpn/generic/mu_div_qr.c (mpn_mu_div_qr2): Remove code for dn==1.
5651 * mpz/mul.c: Call mpn_sqr directly. Use PTR,SIZ,ALLOC.
5653 * tune/tuneup.c (tune_mu_div): Set min_size to 6, DC functions require
5656 * tests/mpn/t-div.c: Call mu_div functions with operands that generate
5657 a high quotient limb.
5659 * mpn/generic/mu_div_qr.c: Rewrite to return a high quotient limb,
5660 to let dividend argument be constant, and as a general cleanup.
5661 * mpn/generic/mu_divappr_q.c: Likewise.
5662 * mpn/generic/mu_div_q.c: Likewise.
5663 * gmp-impl.h: Update declarations of changed functions.
5665 * mpn/generic/invertappr.c (mpn_invertappr): Allocate scratch space
5666 when caller passed NULL.
5668 2009-12-28 Torbjorn Granlund <tege@gmplib.org>
5670 * mpn/generic/toom_couple_handling.c: Prefix name with mpn_.
5671 * gmp-impl.h: Likewise.
5672 * mpn/generic/toom63_mul.c: Likewise.
5673 * mpn/generic/toom6_sqr.c: Likewise.
5674 * mpn/generic/toom6h_mul.c: Likewise.
5675 * mpn/generic/toom8_sqr.c: Likewise.
5676 * mpn/generic/toom8h_mul.c: Likewise.
5678 * configure.in (gmp_mpn_functions_optional) Move "com" from here...
5679 (gmp_mpn_functions): ...to here.
5680 * mpn/generic/com.c: New file.
5681 * (mpn_com): New name for mpn_com_n. Make public.
5682 * (mpn_neg): Analogous changes.
5684 * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Set step_factor.
5686 * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
5689 * tests/devel/try.c: Test mpn_lshiftc.
5690 * tests/refmpn.c (refmpn_com): New function.
5691 (refmpn_lshiftc): Likewise.
5693 * configure.in (gmp_mpn_functions_optional) Move lshiftc from here...
5694 (gmp_mpn_functions): ...to here.
5695 * mpn/generic/lshiftc.c: New file.
5696 * mpn/x86_64/lshiftc.asm: New file.
5697 * mpn/x86_64/core2/lshiftc.asm: New file.
5698 * mpn/generic/mul_fft.c (mpn_lshiftc): Remove.
5700 * mpn/x86_64/core2/lshift.asm: Tweak for better Core iN performance.
5701 * mpn/x86_64/core2/rshift.asm: Likewise.
5703 2009-12-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
5705 * mpn/generic/mul.c: Use toom6h and toom8h for almost balanced.
5707 * mpn/generic/mullo_n.c (mpn_dc_mullo_n): New ratio, to be used in
5710 2009-12-27 Torbjorn Granlund <tege@gmplib.org>
5712 * (mpn_sqr): New name for mpn_sqr_n. Many files affected.
5714 * tune/tuneup.c (tune_mullo): Up step_factor for MULLO_MUL_N_THRESHOLD.
5715 (tune_invertappr, tune_invert, tune_binvert): Let max_size default.
5717 * tune/tuneup.c (tune_mu_div, tune_mu_bdiv) New functions.
5718 * tune/speed.h (SPEED_ROUTINE_MPN_MU_DIV_Q): New macro.
5719 (SPEED_ROUTINE_MPN_MU_DIV_QR): Likewise.
5720 (SPEED_ROUTINE_MPN_MU_BDIV_Q): Likewise.
5721 (SPEED_ROUTINE_MPN_MU_BDIV_QR): Likewise.
5722 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add bdiv_q.c and bdiv_qr.c.
5723 * tune/common.c (speed_mpn_mu_div_qr): New function.
5724 (speed_mpn_mu_divappr_q): Likewise.
5725 (speed_mpn_mu_div_q): Likewise.
5726 (speed_mpn_mu_bdiv_q): Likewise.
5727 (speed_mpn_mu_bdiv_qr): Likewise.
5729 * mpn/*/gmp-mparam.h: Fix incorrect MOD_1U_TO_MOD_1_1_THRESHOLD 0
5732 * gmp-impl.h (MODEXACT_1_ODD_THRESHOLD): Remove.
5733 (BMOD_1_TO_MOD_1_THRESHOLD): New parameter, with the reverse meaning of
5734 MODEXACT_1_ODD_THRESHOLD.
5735 (MPN_MOD_OR_MODEXACT_1_ODD): Use BMOD_1_TO_MOD_1_THRESHOLD.
5736 * mpn/generic/divis.c, mpz/{cong.c,cong_ui.c,divis_ui.c}: Likewise.
5737 * tune/tuneup.c (tune_modexact_1_odd): Tune BMOD_1_TO_MOD_1_THRESHOLD;
5738 Do not assume native mpn_modexact_1_odd is faster than mpn_mod_1.
5739 (tuned_speed_mpn_mod_1): Remove variable.
5740 (tune_mod_1): Fix thinkos. Suppress printing of "always" etc.
5741 (all): Measure for divrem_1, mod_1, divexact_1, etc first, since Toom
5742 depends on some of them.
5744 * mpn/generic/toom22_mul.c (TOOM22_MUL_REC): New name for
5747 2009-12-26 Niels Möller <nisse@lysator.liu.se>
5749 * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Relax
5752 * mpn/generic/toom32_mul.c (mpn_toom32_mul): Relax requirement on
5753 input sizes, to support s+t>=n (used to be s+t>=n+2). Keep high
5754 limbs of the evaluated values in scalar variables.
5756 * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Remove
5759 * mpn/generic/toom32_mul.c (mpn_toom32_mul): Fixed left-over use
5760 of mpn_addsub_n which should be mpn_add_n_sub_n.
5762 2009-12-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
5764 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add new toom files (spotted by Torbjorn).
5766 * gmp-impl.h (mpn_toom6_sqr_itch): Rename to mpn_toom6_mul_n_itch and redefine.
5767 (mpn_toom8_sqr_itch): Rename to mpn_toom8_mul_n_itch and redefine.
5768 * mpn/generic/mul_n.c: Use renamed _itch macros.
5770 2009-12-25 Niels Möller <nisse@lysator.liu.se>
5772 * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Tightened requirements.
5773 * gmp-impl.h (mpn_toom32_mul_itch): Updated. Less scratch needed
5774 by toom32 itself, and also the pointwise multiplications are
5775 currently mpn_mul_n with no supplied scratch.
5776 * mpn/generic/toom32_mul.c (mpn_toom32_mul): Reorganized
5777 interpolation to use less scratch space. No longer supports the
5778 most extreme size ratios.
5780 2009-12-25 Torbjorn Granlund <tege@gmplib.org>
5782 * tune/tuneup.c (tune_preinv_mod_1): Purge.
5783 (tune_mod_1): Use speed_mpn_mod_1_tune for
5784 PREINV_MOD_1_TO_MOD_1_THRESHOLD
5786 * mpn/generic/dcpi1_divappr_q.c: Handle 2n/n properly. Don't use full
5787 precision in mpn_sbpi1_divappr_q call. Misc cleanup.
5789 * tune/tuneup.c (tune_mod_1): Add a check_size for
5790 PREINV_MOD_1_TO_MOD_1_THRESHOLD.
5792 2009-12-24 Torbjorn Granlund <tege@gmplib.org>
5794 * tune/mod_1_div.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
5795 (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
5796 * tune/mod_1_inv.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
5797 (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
5799 * gmp-impl.h (USE_PREINV_MOD_1): Remove.
5800 (MPN_MOD_OR_PREINV_MOD_1): Define to choose functions dynamically in
5801 terms of PREINV_MOD_1_TO_MOD_1_THRESHOLD (used to choose statically
5802 using USE_PREINV_MOD_1).
5803 * mpn/generic/perfsqr.c (PERFSQR_MOD_PP): Corresponding updates.
5805 * tune/tuneup.c (tune_mod_1): Rewrite.
5806 * gmp-impl.h (MOD_1N_TO_MOD_1_1_THRESHOLD): New.
5807 (MOD_1U_TO_MOD_1_1_THRESHOLD): New name for MOD_1_1_THRESHOLD.
5808 (MOD_1_1_TO_MOD_1_2_THRESHOLD): Mew name for MOD_1_2_THRESHOLD.
5809 (MOD_1_2_TO_MOD_1_4_THRESHOLD): New name for MOD_1_4_THRESHOLD.
5810 * mpn/generic/mod_1.c: Corresponding updates.
5812 2009-12-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
5814 * mpn/generic/mul_n.c: Use also toom6h and toom8h.
5815 * mpn/generic/sqr_n.c: Use also toom6 and toom8.
5816 * gmp-impl.h: Initial support for tuning of Toom-6half and Toom-8half.
5817 * tune/tuneup.c: Tune Toom-6half and Toom-8half thresholds.
5819 2009-12-24 Torbjorn Granlund <tege@gmplib.org>
5821 * mpn/generic/mod_1_4.c: Get ASSERT right.
5822 * mpn/generic/mod_1_3.c: Likewise.
5823 * mpn/generic/mod_1_2.c: Likewise.
5825 * mpn/generic/powm_sec.c: Use SQR_TOOM2_THRESHOLD as limit for a native
5826 mpn_sqr_basecase, not TUNE_SQR_TOOM2_MAX.
5828 2009-12-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
5830 * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
5831 mpn_toom8h_mul and mpn_toom8_sqr speed.
5833 * mpn/generic/toom_eval_pm2exp.c: Fix ASSERTs.
5835 * mpn/generic/toom8h_mul.c: New file.
5836 * mpn/generic/toom8_sqr.c: New file.
5837 * mpn/generic/toom_interpolate_16pts.c: New file.
5838 * gmp-impl.h: Provide corresponding declarations.
5839 * configure.in (gmp_mpn_functions): List toom_interpolate_16pts,
5840 toom8h_mul, and toom8h_sqr.
5841 * tests/mpn/t-toom8h.c: New test program.
5843 * mpn/generic/toom6_sqr.c: New file, was part of toom6h_mul.
5844 * mpn/generic/toom6h_mul.c: Removed _sqr.
5846 * mpn/generic/mulmod_bnm1.c: Nailify CRT.
5847 * mpn/generic/sqrmod_bnm1.c: Likewise.
5849 * mpn/generic/mullo_n.c: Split dc_mullo_n function;
5850 ALLOC memory at once.
5852 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Update.
5854 * mpn/generic/toom6h_mul.c: Add prefix to toom_interpolate_12pts.
5855 * mpn/generic/toom_interpolate_12pts.c: Likewise.
5857 * mpn/generic/invertappr.c (mpn_bc_invertappr): Use mpn_divrem_2.
5858 * mpn/generic/invert.c: Faster basecase, use mpn_sbpi1_div_q.
5860 * mpn/generic/toom_eval_pm2exp.c: Assert support for degree 3.
5861 * mpn/generic/toom6h_mul.c: Avoid obsolete _itch function.
5863 2009-12-23 Torbjorn Granlund <tege@gmplib.org>
5865 * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
5866 mpn_mod_1_1p, mpn_mod_1s_2p, mpn_mod_1s_3p, mpn_mod_1s_4p.
5868 * tests/mpz/t-powm.c: Test mpz_powm_sec.
5870 * mpz/powm_sec.c: New file.
5871 * gmp-h.in: Declare it.
5872 * Makefile.am, mpz/Makefile.am: Compile it.
5873 * doc/gmp.texi: Document it.
5875 * mpn/generic/powm_sec.c (mpn_powm_sec_itch): New function.
5876 (mpn_powm_sec): Use passed scratch, no local allocation.
5877 Allow exp argument = 1.
5878 (win_size): Start loop from 1.
5880 * mpn/generic/powm.c (win_size): Start loop from 1.
5882 2009-12-22 Torbjorn Granlund <tege@gmplib.org>
5884 * tests/mpn/t-div.c: New file.
5885 * tests/mpn/Makefile.am: Compile it.
5887 * mpn/generic/mu_divappr_q.c: Handle quotient overflow.
5889 * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): New function.
5891 2009-12-22 Niels Möller <nisse@lysator.liu.se>
5893 * mpn/generic/sbpi1_div_q.c: Use udiv_qr_3by2. Intended to change
5894 nothing after preprocessing.
5896 * mpn/generic/sbpi1_divappr_q.c: For the last call to udiv_qr_3by2,
5897 avoid using memory locations as output parameters, and revert to
5898 explicitly copying n1 and n0 to memory.
5900 * gmp-impl.h (udiv_qr_3by2): Tweaked to expand to precisely the
5901 same code as was used before the introduction of this macro.
5902 Eliminated some local variables, instead do multiple updates to
5903 the output parameters.
5905 2009-12-22 Torbjorn Granlund <tege@gmplib.org>
5907 * tests/mpn/t-toom6h.c (MIN_AN): Set to MUL_TOOM6H_THRESHOLD to avoid
5908 invalid recursive sizes.
5910 * tests/mpn/t-bdiv.c: Get itch function calls right.
5912 * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Rewrite.
5913 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify.
5915 * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Simplify, don't allocate.
5916 (mpn_bdiv_qr_itch): Conditionalise on MU_BDIV_QR_THRESHOLD.
5918 2009-12-18 Niels Möller <nisse@lysator.liu.se>
5920 * tests/mpn/t-bdiv.c: Add red-zones.
5922 2009-12-21 Torbjorn Granlund <tege@gmplib.org>
5924 * mpn/generic/sbpi1_div_q.c: Fix fixup code to work for qn = 0.
5926 * mpn/generic/dcpi1_divappr_q.c: Handle qn = 1 and qn = 2 for initial
5927 quotient block (code block copied from dcpi1_div_qr.c).
5929 * mpn/generic/dcpi1_div_qr.c: Rewrite singular case giving q limb of
5930 GMP_NUMB_MAX. Remove an impossible qn = 0 case.
5932 * mpn/generic/dcpi1_bdiv_q.c: Remove a spurious mpn_sub_1.
5934 * mpn/generic/mul.c: Put back call to mpn_mul_n.
5936 * tune/tuneup.c (all): Call tune_mulmod_bnm1 before tuning fft due to
5937 dependency on mulmod_bnm1 from both mul_fft_mul and from mullo_n.
5939 * mpn/generic/dcpi1_divappr_q.c: ASSERT that dn >= 6 and nn > dn.
5940 * mpn/generic/dcpi1_div_q.c: ASSERT that dn >= 6 and nn-dn >= 3.
5941 * mpn/generic/dcpi1_div_qr.c: ASSERT that dn >= 6 and nn-dn >= 3.
5943 * mpn/generic/bdiv_q_1.c (mpn_pi1_bdiv_q_1): Renamed from
5945 * All references changed.
5947 * configure.in: Add --enable-old-fft-full.
5948 * tune/speed.c (routine): Conditionalise mpn_mul_fft_full references on
5950 * tune/common.c (speed_mpn_mul_fft_full)
5951 (speed_mpn_mul_fft_full_sqr): Likewise.
5952 * mpn/generic/mul_fft.c (mpn_mul_fft_full): Include iff
5955 2009-12-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
5957 * gmp-impl.h (mpn_toom6h_mul_itch): New inline function.
5958 (MUL_TOOM6H_THRESHOLD): Default value.
5959 (SQR_TOOM6_THRESHOLD): Default value.
5960 * mpn/generic/toom6h_mul.c: Remove definitions moved to gmp-impl.h.
5961 * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
5962 mpn_toom6h_mul and mpn_toom6_sqr speed.
5964 * mpn/generic/toom63_mul.c: Remove unused TMP_*.
5966 * mpn/generic/toom_eval_pm2rexp.c: New file.
5967 * gmp-impl.h: Provide corresponding declaration.
5968 * configure.in (gmp_mpn_functions): List toom_eval_pm2rexp.
5969 * mpn/generic/toom6h_mul.c: Use shared toom_eval_pm2rexp.
5971 * mpn/generic/toom_couple_handling.c: New file, helper function
5972 for high degree Toom.
5973 * gmp-impl.h: Provide corresponding declaration.
5974 * configure.in (gmp_mpn_functions): List toom_couple_handling.
5975 * mpn/generic/toom6h_mul.c: Use shared toom_couple_handling.
5976 * mpn/generic/toom63_mul.c: Likewise.
5978 * mpn/generic/toom6h_mul.c: New file.
5979 * mpn/generic/toom_interpolate_12pts.c: New file.
5980 * gmp-impl.h: Provide corresponding declarations.
5981 * configure.in (gmp_mpn_functions): List toom_interpolate_12pts,
5983 * tests/mpn/t-toom6h.c: New test program.
5985 * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1): Use ref_mul.
5986 * tests/mpn/t-sqrmod_bnm1.c (ref_sqrmod_bnm1): Likewise.
5988 2009-12-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
5990 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): New CRT.
5991 * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
5993 2009-12-20 Torbjorn Granlund <tege@gmplib.org>
5995 * Change all bit counts for bignums to use mp_bitcnt_t.
5997 * mpn/generic/bdivmod.c: File removed. All references purged.
5999 * mpn/generic/mul_fft.c (mpn_mul_fft_full): Disable.
6001 * gmp-impl.h: Define mpn_fft_mul as an alias for mpn_nussbaumer_mul.
6002 * mpn/generic/mul.c: Refer mpn_fft_mul.
6003 * mpn/generic/mul_n.c: Likewise.
6004 * mpn/generic/sqr_n.c: Likewise.
6005 * mpn/generic/mullo_n.c: Likewise.
6007 * mpn/generic/mul.c: Loop also over mpn_nussbaumer_mul, as suggested by
6008 Marco. Use TMP_SALLOC_LIMBS in more places. Clean up ws allocation.
6010 2009-12-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
6012 * mpn/generic/toom_interpolate_8pts.c: Nailify.
6014 2009-12-19 Torbjorn Granlund <tege@gmplib.org>
6016 * mpn/generic/mul.c: Major rewrite. Use toom43, toom53, toom63.
6017 Call mpn_nussbaumer_mul for largest operands.
6019 * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM43_MUL): New macro.
6020 (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM32_MUL): New macro.
6021 (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM53_MUL): New macro.
6022 (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM32_MUL): New macro.
6023 (SPEED_ROUTINE_MPN_TOOM42_FOR_TOOM53_MUL): New macro.
6024 (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM42_MUL): New macro.
6025 * tune/common.c (speed_mpn_toom63_mul): New function.
6026 (speed_mpn_toom32_for_toom43_mul): New function.
6027 (speed_mpn_toom43_for_toom32_mul): New function.
6028 (speed_mpn_toom32_for_toom53_mul): New function.
6029 (speed_mpn_toom53_for_toom32_mul): New function.
6030 (speed_mpn_toom42_for_toom53_mul): New function.
6031 (speed_mpn_toom53_for_toom42_mul): New function.
6032 * tune/tuneup.c (tune_mul_n): New name for old tune_mul.
6033 (tune_sqr_n): New name for old tune_sqr.
6034 (tune_mul): New function, for unbalanced multiplication.
6035 * gmp-impl.h: Provide declarations for corresponding threshold vars.
6037 * gmp-impl.h (mpn_rsh1add_nc, mpn_rsh1sub_nc): Declare.
6038 * mpn/asm-defs.m4: Likewise.
6039 * configure.in: Add corresponding HAVE_NATIVEs.
6040 * mpn/x86_64/rsh1aors_n.asm: Add _nc entry point.
6042 2009-12-18 Niels Möller <nisse@lysator.liu.se>
6044 * mpz/divexact.c: Rewrite to use mpn_divexact.
6046 * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Deleted some unused
6049 * mpn/generic/toom52_mul.c (mpn_toom52_mul)
6050 [HAVE_NATIVE_mpn_add_n_sub_n]: Moved declaration of cy to avoid a
6053 * gmp-impl.h (gmp_pi1_t): Eliminated inv21 member.
6054 (invert_pi1): ...and don't store it here.
6056 * mpn/generic/toom63_mul.c (mpn_toom63_mul): Simplified
6057 calculation of block size n.
6058 * gmp-impl.h (mpn_toom63_mul_itch): Likewise.
6060 * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
6063 2009-12-18 Torbjorn Granlund <tege@gmplib.org>
6065 * tests/mpn/t-toom63.c: New test program.
6067 2009-12-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
6069 * mpn/generic/invert.c: Nailify.
6070 * mpn/generic/invertappr.c: Nailify.
6071 * mpn/generic/mulmod_bnm1.c: Nailify.
6072 * mpn/generic/sqrmod_bnm1.c: Nailify.
6074 * tests/mpn/t-invert.c: New test program.
6076 * mpn/generic/toom63_mul.c: New file.
6077 * mpn/generic/toom_interpolate_8pts.c: New file.
6078 * gmp-impl.h: Provide corresponding declarations.
6079 * configure.in (gmp_mpn_functions): List toom_interpolate_8pts and
6082 2009-12-17 Torbjorn Granlund <tege@gmplib.org>
6084 * mpn/generic/mul.c: Move allocation of ws to where it is used.
6085 Identify toom22, 32, 42, in that order (in two places). Use midline
6086 between toom22, 32, 42.
6087 * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): Call also
6090 * doc/gmp.texi: Update References section. Update Contributors
6091 section. Misc updates.
6093 * gmp-impl.h: Renew default values for all THRESHOLDs.
6095 2009-12-17 Niels Möller <nisse@lysator.liu.se>
6097 * mpn/generic/divexact.c (mpn_divexact): Don't require that the
6098 dividend is normalized. Use MPN_DIVREM_OR_PREINV_DIVREM_1. When
6099 shifting, allocate and process only the low qn+1 limbs. Eliminated
6100 code for the impossible case nn < qn.
6102 * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): Added some input
6105 * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): In the case that
6106 the initial quotient block is a single limb, use 3/2 division,
6107 thereby eliminating the only use of gmp_pi1_t->inv21.
6109 2009-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
6111 * mpn/generic/invert.c: Added some comment.
6112 * mpn/generic/invertappr.c: Slightly better threshold handling.
6113 * gmp-impl.h (INV_NEWTON_THRESHOLD): Default to 200.
6115 * mpn/generic/nussbaumer_mul.c: New file.
6116 * configure.in (gmp_mpn_functions): Add nussbaumer_mul.
6117 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add nussbaumer_mul.
6118 * gmp-impl.h (mpn_nussbaumer_mul): Added prototype and name-mangling.
6119 * tune/speed.h (speed_mpn_nussbaumer_mul): Declare function.
6120 * tune/common.c (speed_mpn_nussbaumer_mul): New function.
6121 * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul.
6123 * mpn/generic/sqrmod_bnm1.c: New file.
6124 * configure.in (gmp_mpn_functions): Add sqrmod_bnm1.
6125 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqrmod_bnm1.
6126 * gmp-impl.h (mpn_sqrmod_bnm1): Added prototype and name-mangling.
6127 (SQRMOD_BNM1_THRESHOLD): support for the new threshold.
6128 * tune/speed.h (speed_mpn_sqrmod_bnm1): Declare function.
6129 * tune/common.c (speed_mpn_sqrmod_bnm1): New function.
6130 * tune/speed.c (routine): Add speed_mpn_sqrmod_bnm1.
6131 * tests/mpn/t-mulmod_bnm1.c: Attribution.
6132 * tests/mpn/t-sqrmod_bnm1.c: New test file.
6133 * tests/mpn/Makefile.am (check_PROGRAMS): Add t-sqrmod_bnm1.
6135 * tune/tuneup.c: Tune SQRMOD_BNM1_THRESHOLD.
6137 * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Mimic fft_mul,
6138 use squaring if operands coincide.
6139 * tune/speed.h (speed_mpn_nussbaumer_mul_sqr): Declare function.
6140 * tune/common.c (speed_mpn_nussbaumer_mul_sqr): New function.
6141 * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul_sqr.
6143 2009-12-17 Torbjorn Granlund <tege@gmplib.org>
6145 * mpn/generic/bdiv_q.c (mpn_bdiv_q_itch): Rewrite.
6147 2009-12-16 Torbjorn Granlund <tege@gmplib.org>
6149 * tests/mpn/t-bdiv.c (bdiv_q_valid_p, bdiv_qr_valid_p): Call refmpn_mul
6150 instead of refmpn_mul_basecase.
6151 * tests/mpn/toom-shared.h: Likewise.
6152 * tests/refmpn.c (refmpn_mullo_n,refmpn_sqr,refmpn_mul_any): Likewise.
6154 * minithres/gmp-mparam.h: Add new thresholds, trim old values.
6156 * mpn/generic/powm.c: Use mp_bitcnt_t for bit counts.
6157 Handle REDC_1_TO_REDC_N_THRESHOLD < MUL_TOOM22_THRESHOLD in
6158 non-WANT_REDC_2 INNERLOOP expansion code.
6159 * mpn/generic/powm_sec.c: Use mp_bitcnt_t for bit counts.
6161 2009-12-16 Niels Möller <nisse@lysator.liu.se>
6163 * tests/mpz/t-gcd.c (main): Added test case to exercise the
6164 unlikely u0 == u1 case in mpn_gcdext_lehmer_n.
6166 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Get ASSERT
6169 2009-12-16 Torbjorn Granlund <tege@gmplib.org>
6171 * tests/mpz/t-mul.c: Misc cleanups.
6172 (mul_basecase): Remove.
6173 (ref_mpn_mul): Remove.
6174 * tests/refmpn.c (refmpn_mul): New function, mainly from t-mul.c's
6176 (refmpn_mullo_n): Add a missing free.
6178 * tune/speed.c (routine): Measure speed_mpn_{sb,dc}pi1_div_qr,
6179 mpn_{sb,dc}pi1_divappr_q, mpn_{sb,dc}pi1_bdiv_qr, and
6180 mpn_{sb,dc}pi1_bdiv_q.
6182 * mpn/generic/invertappr.c: New file, meat from invert.c.
6183 * mpn/generic/invert.c: Leave just mpn_invert.c.
6184 * configure.in (gmp_mpn_functions): Add invertappr.
6185 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invertappr.c.
6186 * gmp-impl.h (mpn_invert_itch, mpn_invertappr_itch): New macros.
6188 2009-12-15 Torbjorn Granlund <tege@gmplib.org>
6190 * mpn/generic/gcdext_subdiv_step.c: Get an ASSERT right.
6192 2009-12-15 Niels Möller <nisse@lysator.liu.se>
6194 * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): A very small step
6195 towards nail support.
6197 2009-12-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
6199 * gmp-impl.h (mpn_ni_invertappr): Added prototype and name-mangling.
6200 * mpn/generic/mulmod_bnm1.c: Comment representation of class [0].
6202 2009-12-14 Niels Möller <nisse@lysator.liu.se>
6204 * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Use
6207 2009-12-14 Torbjorn Granlund <tege@gmplib.org>
6209 * tune/tuneup.c (tune_binvert): Remove BINV_MULMOD_BNM1_THRESHOLD
6210 tuning, it was always zero and caused BINV_NEWTON_THRESHOLD to be
6211 wrong (as pointed out by Marco).
6212 * (BINV_MULMOD_BNM1_THRESHOLD): Clean from other files too.
6214 2009-12-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
6216 * mpn/generic/invert.c: Improved comments.
6217 (mpn_bc_invertappr): Conditionally re-enable mpn_dcpi1_divappr_q.
6219 2009-12-14 Niels Möller <nisse@lysator.liu.se>
6221 * gmp-impl.h (udiv_qr_3by2): Fix typo in argument list.
6223 2009-12-13 Niels Möller <nisse@lysator.liu.se>
6225 * gmp-impl.h (udiv_qr_3by2): New macro.
6226 * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): Use udiv_qr_3by2.
6228 2009-12-13 Torbjorn Granlund <tege@gmplib.org>
6230 * mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q): Avoid a buffer
6233 * mpn/generic/mul_fft.c (mpn_mul_fft_full): Handle carry-out from 2nd
6234 mpn_mul_fft, add an ASSERT for the 1st mpn_mul_fft. Replace some
6235 comments on cc's range with ASSERTs.
6237 * mpn/generic/gcdext.c (compute_v): Normalise tp[] after mpn_mul.
6239 * mpz/powm.c: Rework buffer handling.
6241 2009-12-13 Niels Möller <nisse@lysator.liu.se>
6243 * tests/mpn/toom-shared.h (main): Use refmpn_mul_basecase to check
6244 results (slow!). Iteration counts of all toom tests reduced
6247 2009-12-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
6249 * mpn/generic/invert.c (mpn_invertapp): Split in _bc and _ni.
6250 (mpn_bc_invertappr): New function, the basecase.
6251 (mpn_ni_invertapp): New function, Newton iteration.
6252 (mpn_invert): Use mpn_ni_invertapp.
6253 * tune/tuneup.c (tune_invert): Min for INV_APPR_THRESHOLD.
6254 (tune_invertappr): Min for INV_NEWTON_THRESHOLD.
6256 * tune/speed.h (SPEED_ROUTINE_MPN_NI_INVERTAPPR): New macro.
6257 (speed_mpn_ni_invertappr): Declare function.
6258 * tune/common.c (speed_mpn_ni_invertappr): New function.
6259 * tune/speed.c (routine): Add speed_mpn_ni_invertappr.
6261 * tune/tuneup.c (tune_invertappr): Use speed_mpn_ni_invertappr to
6262 tune INV_MULMOD_BNM1_THRESHOLD.
6264 2009-12-12 Torbjorn Granlund <tege@gmplib.org>
6266 * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Rewrite.
6268 2009-12-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
6270 * tests/mpn/t-mulmod_bnm1.c (main): Disable B^n+1 stressing test
6273 * mpn/generic/invert.c: Complete rewrite. Uses Newton iterations.
6274 * gmp-impl.h (mpn_invertappr): Added prototype and name-mangling.
6275 (mpn_invertappr_itch): Added prototype and name-mangling.
6276 (INV_APPR_THRESHOLD): Support for a new tunable const.
6277 * tune/speed.h (SPEED_ROUTINE_MPN_INVERTAPPR): New macro.
6278 (speed_mpn_invertappr): Declare function.
6279 * tune/common.c (speed_mpn_invertappr): New function.
6280 * tune/speed.c (routine): Add speed_mpn_invertappr.
6281 * tune/tuneup.c (tune_invertappr): New function: was tune_invert.
6282 (tune_invert): Now tune only INV_APPR_THRESHOLD.
6283 (all): Enable call to tune_invert and tune_invertappr.
6285 2009-12-11 Torbjorn Granlund <tege@gmplib.org>
6287 * mpn/generic/binvert.c: Use mpn_mulmod_bnm1 instead of FFT wrapping.
6288 Old, evidently broken wrapping code removed.
6289 * tune/tuneup.c (tune_binvert): Tune BINV_MULMOD_BNM1_THRESHOLD.
6290 * gmp-impl.h: Provide declarations for corresponding threshold var.
6292 * tests/mpn/t-bdiv.c (COUNT): Decrease to keep run time reasonable.
6294 * tune/tuneup.c (tune_invert): Tune INV_MULMOD_BNM1_THRESHOLD.
6295 * gmp-impl.h: Provide declarations for corresponding threshold var.
6297 * tests/mpn/t-mulmod_bnm1.c: Avoid a division by zero.
6299 * configure.in: Set up different paths for different 64-bit sparc
6301 * mpn/sparc64/ultrasparc34/gmp-mparam.h: New file.
6303 2009-12-10 Torbjorn Granlund <tege@gmplib.org>
6305 * mpn/*/gmp-mparam.h: Regenerate many of these files.
6307 2009-12-10 Niels Möller <nisse@lysator.liu.se>
6309 * gmp-impl.h (mpn_divexact): Removed scratch pointer from
6311 * mpn/generic/gcdext.c (divexact): Deleted, moved to...
6312 * mpn/generic/divexact.c (mpn_divexact): New implementation (moved
6313 from gcdext.c). The bidirectional divexact is kept but #if:ed out.
6314 Interface change, since the new code doesn't take a scratch
6317 * tests/mpn/t-mulmod_bnm1.c (main): Ensure that an >= bn. Lowered
6318 MIN_N to 1. Various fixes to handle n == 1 properly.
6320 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Small interface
6321 change, require an >= bn.
6323 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Fixed non-recursive
6324 case to not write beyond end of result area.
6326 2009-12-09 Torbjorn Granlund <tege@gmplib.org>
6328 * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): New macro, made
6329 from now deleted SPEED_ROUTINE_MPN_MULMOD_BNM1.
6330 * tune/common.c (speed_mpn_bc_mulmod_bnm1): New function.
6331 (speed_mpn_mulmod_bnm1): Use SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL.
6332 * tune/speed.c (routine): Add mpn_bc_mulmod_bnm1.
6334 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
6336 * tune/tuneup.c (tune_mulmod_bnm1): Rewrite.
6338 2009-12-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
6340 * mpn/generic/mulmod_bnm1.c (mpn_bc_mulmod_bnm1,
6341 mpn_bc_mulmod_bnp1): Added a parameter for scratch area, possibly
6342 same as result area (as suggested by Niels Möller).
6343 (mpn_mulmod_bnm1): Calls changed accordingly.
6345 2009-12-08 Niels Möller <nisse@lysator.liu.se>
6347 * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]: Use
6348 table lookup for count_trailing_zeros. Binary algorithm still
6349 disabled by default.
6351 * mpn/generic/gcdext.c (divexact): Local definition of divexact,
6353 (compute_v): Use it.
6355 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-bdiv.
6357 * tests/mpn/t-bdiv.c: New file.
6359 * mpn/generic/bdiv_q.c (mpn_bdiv_q): Fixed bad quotient length,
6360 should have qn == nn.
6362 * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Pass correct nn length to
6363 the lower-level functions.
6365 2009-12-08 Torbjorn Granlund <tege@gmplib.org>
6367 * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): New define.
6368 * tune/common.c (speed_mpn_mulmod_bnm1_rounded): New function.
6369 * tune/speed.c (routine): Add mpn_mulmod_bnm1_rounded for measuring
6370 mpn_mulmod_bnm1 at recommended sizes.
6372 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
6373 (mpn_bc_mulmod_bnm1): Use mpn_add_n instead of mpn_add.
6375 * tune/speed.c (routine): Add mpn_invert.
6377 * tune/tuneup.c (tune_invert): New function.
6378 * tune/speed.h (SPEED_ROUTINE_MPN_INVERT): New macro.
6379 * tune/common.c (speed_mpn_invert): New function.
6380 * gmp-impl.h: Provide declarations for corresponding threshold var.
6381 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invert.c.
6383 2009-12-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
6385 * tests/devel/try.c: Test mpn_addlsh2_n and mpn_{add,sub}lsh_n;
6386 mpn_rsblsh_n now tests all shift values.
6387 * tests/refmpn.c (refmpn_addlsh_n, refmpn_sublsh_n): New functions.
6388 (refmpn_addlsh1_n): Use generic refmpn_addlsh_n.
6389 (refmpn_sublsh1_n): Use generic refmpn_sublsh_n.
6390 (refmpn_addlsh2_n): New function.
6391 * tests/tests.h: Declare new functions.
6393 2009-12-06 Torbjorn Granlund <tege@gmplib.org>
6395 * tune/tuneup.c (tune_mulmod_bnm1): Up min_size to 12.
6397 * Globally: Rename *mullow* to *mullo*, *MULLOW* to *MULLO*.
6399 * configure.in: Don't include ev5 directory for ev6* and ev7. Misc
6400 alpha path cleanups.
6401 * mpn/alpha/add_n.asm: Replaced by mpn/alpha/ev5/add_n.asm.
6402 * mpn/alpha/sub_n.asm: Replaced by mpn/alpha/ev5/sub_n.asm.
6403 * mpn/alpha/lshift.asm: Replaced by mpn/alpha/ev5/lshift.asm.
6404 * mpn/alpha/rshift.asm: Replaced by mpn/alpha/ev5/rshift.asm.
6405 * mpn/alpha/com_n.asm: New, moved from mpn/alpha/ev5/rshift.asm.
6406 * mpn/alpha/ev5/diveby3.asm: New, moved from mpn/alpha/diveby3.asm.
6408 * mpn/powerpc64/mode64/diveby3.asm: Remove, it is slower than
6409 mpn_bdiv_dbm1c on all hardware.
6411 * mpn/generic/powm_sec.c: Rework logic for mpn_sqr_basecase size limit.
6413 * gmp-impl.h (mpn_redc_1_sec): Declare.
6414 * configure.in (gmp_mpn_functions): Add redc_1_sec.
6416 2009-12-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
6418 * tests/devel/try.c (try_one): DATA_SRC0_HIGHBIT sets the high bit.
6420 2009-12-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
6422 * mpn/generic/toom_eval_dgr3_pm1.c: Change return value: 0 or ~0.
6423 * mpn/generic/toom_eval_dgr3_pm2.c: Likewise.
6424 * mpn/generic/toom_eval_pm1.c: Likewise.
6425 * mpn/generic/toom_eval_pm2exp.c: Likewise.
6426 * mpn/generic/toom_eval_pm2.c: Rewrite to use mpn_addlsh2_n.
6428 * mpn/generic/toom_interpolate_5pts.c: Param sa is a flag, not a sign.
6430 * mpn/generic/toom33_mul.c: Adapt to changes above.
6431 * mpn/generic/toom3_sqr.c: Likewise.
6432 * mpn/generic/toom42_mul.c: Likewise.
6433 * mpn/generic/toom43_mul.c: Reduce branches.
6434 * mpn/generic/toom44_mul.c: Likewise.
6435 * mpn/generic/toom53_mul.c: Likewise.
6436 * mpn/generic/toom62_mul.c: Likewise.
6438 * mpn/generic/toom52_mul.c: Use toom_eval_ functions.
6440 * mpn/generic/toom4_sqr.c: Avoid C99 construct.
6441 * mpn/generic/toom_interpolate_7pts.c: Likewise.
6443 2009-12-05 Torbjorn Granlund <tege@gmplib.org>
6445 * mpn/generic/redc_1_sec.c: New file.
6446 * mpn/generic/powm_sec.c: Use redc_1_sec. Use dummy full subtract
6447 instead of mpn_cmp since the latter leaks to the side channel.
6448 (mpn_local_sqr_n): New function, with associated macros.
6449 (mpn_powm_sec): Use mpn_local_sqr_n.
6451 * configure.in (HAVE_NATIVE): Add missing functions, then sort.
6453 2009-12-04 Torbjorn Granlund <tege@gmplib.org>
6455 * tune/tuneup.c (tune_dc_div): Up min_size to 6.
6456 (tune_mod_1): Set MOD_1_1_THRESHOLD min_size to 2.
6458 * tune/speed.h: Negate "binvert"-type inverses, as required.
6460 * mpn/generic/redc_1.c: Add ASSERTs.
6461 * mpn/generic/redc_2.c: Likewise.
6463 * mpn/generic/sbpi1_bdiv_q.c: Simplify loops, indexing.
6465 2009-12-03 Yann Droneaud <yann@droneaud.fr>
6467 * acinclude.m4 ([long long reliability test 1]): Add a "static" for C99
6468 inline semantics compatibility.
6470 2009-12-03 Torbjorn Granlund <tege@gmplib.org>
6472 * configure.in: Move intptr_t test into common AC_CHECK_TYPES.
6474 * mpn/generic/gcdext.c: Add a TMP_FREE.
6476 2009-12-03 Niels Möller <nisse@lysator.liu.se>
6478 * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
6479 Added various masking tricks.
6481 * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
6482 Reimplemented binary gcdext, with proper canonicalization.
6484 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Handle v == 0
6486 * mpn/generic/gcdext_1.c (mpn_gcdext_1): Allow inputs with a < b,
6487 assertions fixed accordingly.
6489 2009-12-03 Torbjorn Granlund <tege@gmplib.org>
6491 * tune/tuneup.c: Tune DC_DIVAPPR_Q_THRESHOLD. Rewrite
6492 DC_DIV_QR_THRESHOLD tuning code.
6493 (tune_dc_div): Rewrite.
6494 * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): New macro.
6495 * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
6496 speed_mpn_sbpi1_divappr_q, speed_mpn_sbpi1_bdiv_qr): New functions.
6497 * gmp-impl.h: Provide declarations for corresponding threshold vars.
6498 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_divappr_q.c.
6500 * tune/tuneup.c (tune_binvert): Up max_size.
6502 2009-12-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
6504 * tests/devel/try.c: Test mpn_rsblsh2_n and mpn_rsblsh_n.
6505 * tests/refmpn.c (refmpn_rsblsh_n, refmpn_rsblsh2_n): New functions.
6506 (refmpn_rsblsh1_n): Use generic refmpn_rsblsh_n.
6507 * tests/tests.h: Declare new functions.
6509 2009-12-03 Niels Möller <nisse@lysator.liu.se>
6511 * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step):
6512 Select the right cofactor in the cases A == B or A == 2B.
6514 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Deleted
6515 handling of ap[0] == 0 and bp[0] == 0; these cases don't happen.
6516 Select the right cofactor in the case ap[0] == bp[0].
6517 * mpn/generic/gcdext.c (mpn_gcdext): Analogous changes.
6519 2009-12-02 Niels Möller <nisse@lysator.liu.se>
6521 * gmp-h.in (mpn_gcdext_1): Updated prototype.
6522 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
6523 signed cofactors from gcdext_1.
6524 * mpn/generic/gcdext_1.c (mpn_gcdext_1): Use Euclid's algorithm,
6525 and return signed cofactors.
6527 2009-12-02 Torbjorn Granlund <tege@gmplib.org>
6529 * doc/gmp.texi (Low-level Functions): Document mpn_sqr_n.
6531 * tune/speed.c (routine): Add mpn_binvert.
6533 * tune/tuneup.c: Tune BINV_NEWTON_THRESHOLD.
6534 (tune_binvert): New function.
6535 * tune/speed.h (SPEED_ROUTINE_MPN_BINVERT): New macro.
6536 * tune/common.c (speed_mpn_binvert): New function.
6537 * gmp-impl.h: Provide declarations for corresponding threshold var.
6538 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add binvert.c.
6540 * tune/tuneup.c: Tune DC_BDIV_QR_THRESHOLD and DC_BDIV_Q_THRESHOLD.
6541 (tune_dc_bdiv): New function.
6542 (tune_dc_div): New name for tune_dc.
6543 * tune/speed.h (SPEED_ROUTINE_MPN_PI1_BDIV_QR,
6544 SPEED_ROUTINE_MPN_PI1_BDIV_Q): New macros.
6545 * tune/common.c (speed_mpn_sbpi1_bdiv_qr, speed_mpn_dcpi1_bdiv_qr,
6546 speed_mpn_sbpi1_bdiv_q, speed_mpn_dcpi1_bdiv_q): New functions.
6547 * gmp-impl.h: Provide declarations for corresponding threshold vars.
6548 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_bdiv_qr.c and
6551 2009-12-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
6553 * mpn/generic/toom53_mul.c: Removed double computation of vinf.
6555 * mpn/x86_64/aorrlsh_n.asm: Correct return value for rsblsh_n.
6556 * mpn/asm-defs.m4 (define_mpn): Add rsblsh_n.
6557 * gmp-impl.h (mpn_rsblsh_n): Added prototype and name-mangling.
6559 * mpn/generic/fib2_ui.c: Reduce the amount of temporary storage.
6562 2009-12-01 Torbjorn Granlund <tege@gmplib.org>
6564 * mpn/generic/redc_n.c: Rework temp allocation.
6566 * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n_itch): Add pi1 also
6569 * mpn/generic/dcpi1_bdiv_q.c: Get the mpn_sbpi1_bdiv_q call right.
6572 * tune/speed.c (routine): Fix typo in last change.
6575 * tune/speed.h (SPEED_ROUTINE_REDC_N): Set min size properly.
6577 2009-12-01 Niels Möller <nisse@lysator.liu.se>
6579 * tune/speed.c (routine): Added mpn_toom42_mul and mpn_redc_n.
6580 * tune/speed.h (SPEED_ROUTINE_MPN_TOOM42_MUL): New macro.
6581 (speed_mpn_toom42_mul): Declare function.
6582 * tune/common.c (speed_mpn_toom42_mul): New function.
6583 * gmp-impl.h (MPN_TOOM42_MUL_MINSIZE): New constant.
6585 2009-11-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
6587 * mpn/generic/fib2_ui.c: Use mpn_rsblsh2_n.
6589 2009-11-29 Torbjorn Granlund <tege@gmplib.org>
6591 * mpn/x86_64/pentium4/gmp-mparam.h
6592 (HAVE_NATIVE_mpn_addlsh1_n, HAVE_NATIVE_mpn_sublsh1_n): Don't undef.
6594 * Makefile.am (EXTRA_DIST): Remove macos.
6596 2009-11-28 Torbjorn Granlund <tege@gmplib.org>
6598 * tune/tuneup.c (tune_redc): Set min_size to 16 for redc_n tuning.
6600 * mpn/x86_64/sqr_basecase.asm (SQR_TOOM2_THRESHOLD_MAX): Avoid quoting
6601 to allow configure.in parse it more easily. Trim from 120 to 80.
6603 2009-11-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
6605 * mpn/generic/mulmod_bnm1.c: Basecases made simpler, this also corrects
6606 a bug affecting previous version.
6608 2009-11-28 Torbjorn Granlund <tege@gmplib.org>
6610 * configure.in: Handle atom also in 32-bit mode.
6611 * mpn/x86/atom/gmp-mparam.h: New file.
6613 * gmp-impl.h (MULMOD_BNM1_THRESHOLD): Default.
6615 * mpn/generic/redc_n.c: Use mpn_mulmod_bnm1 instead of mpn_mul_n.
6617 * Use TMP_ALLOC_LIMBS consistently.
6618 * Finish renaming BITS_PER_MP_LIMB to GMP_LIMB_BITS.
6620 * macos: Remove entire directory.
6622 2009-11-27 Torbjorn Granlund <tege@gmplib.org>
6624 * mpn/x86_64/corei/gmp-mparam.h: New file.
6625 * mpn/x86_64/core2/gmp-mparam.h: Now for just core2.
6626 * mpn/powerpc64/mode64/p3/gmp-mparam.h: New file.
6627 * mpn/powerpc64/mode64/p4/gmp-mparam.h: New file.
6628 * mpn/powerpc64/mode64/p5/gmp-mparam.h: New file.
6630 * config.guess: Return "corei" for core i7 and core i5.
6631 * config.sub: Recognise "corei".
6632 * acinclude.m4 (X86_64_PATTERN): Add corei.
6633 * configure.in (powerpc): Set up more CPU-specific paths.
6634 (x86): Handle corei.
6636 * mpz/powm.c: Allow input operand overlap also when exponent = 1.
6639 2009-11-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
6641 * tests/mpn/t-mulmod_bnm1.c: New test file.
6642 * tests/mpn/Makefile.am (check_PROGRAMS): Add t-mulmod_bnm1.
6644 * mpn/generic/mullow_n.c: Comments on Mulders' trick implementation.
6646 2009-11-26 Torbjorn Granlund <tege@gmplib.org>
6648 * mpn/generic/powm.c: Make comments reflect current code state.
6650 * tests/devel/try.c: Make mpn_mullow_n testing actually work.
6652 2009-11-25 Torbjorn Granlund <tege@gmplib.org>
6654 * mpz/powm.c: Clean up unused defs.
6656 2009-11-24 Torbjorn Granlund <tege@gmplib.org>
6658 * tune/tuneup.c (tune_redc): Rewrite.
6659 * mpn/generic/powm.c: Use REDC_1_TO_REDC_2_THRESHOLD,
6660 REDC_1_TO_REDC_N_THRESHOLD, and REDC_2_TO_REDC_N_THRESHOLD.
6661 Get rid of previous REDC params, including LOCAL_REDC_N_THRESHOLD.
6662 (WANT_REDC_2): Define.
6663 * gmp-impl.h: Corresponding changes.
6665 2009-11-23 Torbjorn Granlund <tege@gmplib.org>
6667 * mpn/generic/powm.c: Fix typo.
6668 Define LOCAL_REDC_N_THRESHOLD, use in REDC_2_THRESHOLD...
6669 REDC_N_THRESHOLD chain.
6671 2009-11-22 Torbjorn Granlund <tege@gmplib.org>
6673 * tune/tuneup.c (tune_mullow): Set min_size to 1.
6675 * mpn/generic/powm_sec.c: Use just mpn_mul_basecase and
6676 mpn_sqr_basecase for multiplication and squaring.
6678 * tune/tuneup.c: Tune REDC_2_THRESHOLD and REDC_N_THRESHOLD.
6679 (tune_redc): New function.
6680 (tune_powm): Remove function.
6681 * tune/speed.h (SPEED_ROUTINE_REDC_2, SPEED_ROUTINE_REDC_N): New.
6682 * tune/common.c (speed_mpn_redc_2, speed_mpn_redc_n): New.
6684 * mpz/powm.c: Complete rewrite. Use mpn_powm and mpn_powlo.
6685 * mpn/generic/powm.c: Rewrite.
6686 * mpn/generic/redc_n.c: New file.
6687 * configure.in (gmp_mpn_functions): Add redc_n.
6688 * gmp-impl.h (REDC_2_THRESHOLD, REDC_N_THRESHOLD): Default, and define
6691 2009-11-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
6693 * mpn/generic/mullow_n.c: Disable Mulders' trick for small operands,
6694 use fft for bigger ones.
6695 * tests/mpn/t-mullo.c: New test file.
6697 2009-11-22 Torbjorn Granlund <tege@gmplib.org>
6699 * tune/tuneup.c (tune_mullow): Rewrite.
6701 2009-11-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
6703 * gmp-impl.h: Removed unused macros (CACHED_ABOVE_THRESHOLD and
6704 CACHED_BELOW_THRESHOLD).
6706 * mpn/generic/mullow_n.c: Use Mulders' trick.
6707 * tune/tuneup.c (tune_mullow): MULLOW_MUL_N_THRESHOLD range of
6708 search depends on FFT tuning;
6709 (all): Anticipate tune_fft_{mul,sqr}.
6711 * tune/speed.c (routine): Add entry related to mpn_mulmod_bnm1.
6713 2009-11-19 Niels Möller <nisse@lysator.liu.se>
6715 * mpn/generic/toom_eval_dgr3_pm2.c (mpn_toom_eval_dgr3_pm2)
6716 [HAVE_NATIVE_mpn_add_n_sub_n]: Fixed typo in mpn_add_n_sub_n call
6717 (spotted by Marco Bodrato).
6718 * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): Likewise.
6719 * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Likewise.
6721 * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2) [HAVE_NATIVE_mpn_addlsh_n]:
6722 Fixed missing declaration.
6724 * mpn/asm-defs.m4 (define_mpn): Add addlsh_n.
6725 * gmp-impl.h (mpn_addlsh_n): Added prototype and name-mangling.
6727 2009-11-19 Niels Möller <nisse@lysator.liu.se>
6729 * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): New file.
6730 * mpn/generic/toom53_mul.c (mpn_toom53_mul): Use mpn_toom_eval_pm2.
6731 * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
6732 * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
6734 2009-11-18 Torbjorn Granlund <tege@gmplib.org>
6736 * gmp-impl.h (mpn_and_n, etc): Adapt to now-public logic functions.
6738 * config.guess: Recognise VIA nano.
6739 * config.sub: Likewise.
6740 * configure.in: Generalise x86_64 support; recognise VIA nano.
6742 2009-11-16 Torbjorn Granlund <tege@gmplib.org>
6744 * tune/speed.c (routine): Add measurement of mpn_addlsh2_n,
6745 mpn_sublsh2_n, mpn_rsblsh2_n.
6746 * tune/common.c: Add speed routines for lsh2 functions.
6748 * mpn/generic/divis.c: Use MU_BDIV_QR_THRESHOLD.
6750 * configure.in (gmp_mpn_functions_optional): Add *lsh_n functions.
6752 * mpn/generic/toom_eval_pm2exp.c: Make HAVE_NATIVE_mpn_addlsh_n code
6755 * mpn/x86_64/aorrlsh2_n.asm: Optimise inner loop.
6757 * configure.in (gmp_mpn_functions_optional): Remove copyi,copyd, they
6758 are now in gmp_mpn_functions. Analogously move logical functions.
6760 2009-11-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
6762 * mpn/generic/toom53_mul.c: Use addlsh2 for evaluation (and fix typo).
6763 * mpn/generic/toom_eval_dgr3_pm2.c: Likewise (affects toom44 and 43).
6765 * mpn/asm-defs.m4: Fix comments for op_lsh2 new functions.
6766 * gmp-impl.h: Likewise.
6767 * tests/mpz/t-fac_ui.c: Fix a comment.
6769 2009-11-15 Torbjorn Granlund <tege@gmplib.org>
6771 * mpn/x86_64/aorrlsh2_n.asm: New file.
6772 * configure.in: Add support for addlsh2_n, sublsh2_n, and rsblsh2_n,
6774 * gmp-impl.h (mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n): Declare.
6775 * mpn/asm-defs.m4: Likewise.
6777 * mpn/generic/copyi.c: New file.
6778 * mpn/generic/copyd.c: Likewise.
6779 * mpn/generic/zero.c: Likewise.
6780 * gmp-h.in: Declare new functions.
6781 * configure.in (gmp_mpn_functions): Add new functions.
6783 2009-11-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
6785 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): fix typo
6787 * mpn/generic/toom33_mul.c: Use rsblsh1 for evaluation.
6788 * mpn/generic/toom3_sqr.c: Likewise.
6790 2009-11-14 Torbjorn Granlund <tege@gmplib.org>
6792 * mpn/generic/toom52_mul.c: Use mpn_addlsh1_n.
6794 * mpn/generic/toom52_mul.c: Toggle the right flag bit in an
6795 HAVE_NATIVE_mpn_add_n_sub_n arm.
6797 * tests/mpz/t-remove.c: New file.
6799 * mpn/generic/remove.c: Major overhaul. Add parameter 'cap'.
6801 * mpn/generic/binvert.c: Fix typo in last change.
6803 * mpn/generic/bdiv_qr.c: Make it actually work. Also use passed-in
6806 * mpn/generic/mu_bdiv_qr.c: Reset FFT parameters for each call.
6808 2009-11-12 Torbjorn Granlund <tege@gmplib.org>
6810 * mpn/x86/k7/gcd_1.asm (MASK): Compute from MAXSHIFT.
6812 2009-11-11 Torbjorn Granlund <tege@gmplib.org>
6814 * mpn/generic/binvert.c: Simplify, fix comments.
6816 * tests/devel/try.c: Test mpn_invert and mpn_binvert.
6818 * tests/refmpn.c (refmpn_invert, refmpn_binvert): New functions.
6819 * tests/tests.h: Declare new functions.
6821 2009-11-10 Torbjorn Granlund <tege@gmplib.org>
6823 * configure.in: Supply compiler options for atom in 32-bit mode.
6825 * acinclude.m4 (X86_64_PATTERN): New.
6826 * configure.in: Setup and use X86_64_PATTERN.
6828 * mpn/x86_64/fat/fat.c: New file.
6829 * mpn/x86_64/fat/fat_entry.asm: New file.
6830 * mpn/x86_64/fat: Copy C placeholder files from mpn/x86/fat.
6831 * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): New, copied from
6832 mpn/x86/x86-defs.m4.
6833 * configure.in: Move down x86 fat setup code until after ABI has been
6834 determined; generalise to handle x86_64.
6836 2009-11-09 Torbjorn Granlund <tege@gmplib.org>
6838 * mpn/x86/fat/mod_1.c: New file.
6840 * acinclude.m4 (GMP_C_FOR_BUILD_ANSI): Avoid poor quoting.
6842 2009-11-08 Torbjorn Granlund <tege@gmplib.org>
6844 * gmp-impl.h (MPN_LOGOPS_N_INLINE): Rewrite, update interface. Callers
6846 * mpn/generic/logops_n.c: New file.
6847 * doc/gmp.texi (Low-level Functions): Document logical mpn functions.
6849 2009-11-07 Torbjorn Granlund <tege@gmplib.org>
6851 * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): Adapt to new
6852 mpn_mulmod_bnm1 interface.
6854 2009-11-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
6856 * mpn/generic/mulmod_bnm1.c: New interface, with size
6857 specified for all operands in mpn_mulmod_bnm1.
6858 * gmp-impl.h: Changed mpn_mulmod_bnm1 prototype.
6860 2009-11-05 Torbjorn Granlund <tege@gmplib.org>
6862 * mpn/x86/k7/gcd_1.asm: Actually use div-reduced value.
6865 * mpn/x86_64/gcd_1.asm: New file.
6867 2009-11-03 Torbjorn Granlund <tege@gmplib.org>
6869 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqr_n.c.
6871 2009-11-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
6873 * mpn/generic/toom_interpolate_6pts.c: removed an addmul_1 and cleanup.
6875 2009-11-02 Torbjorn Granlund <tege@gmplib.org>
6877 * configure.in (gmp_mpn_functions): Remove obsolete functions
6878 dc_divrem_n and sb_divrem_mn.
6879 * gmp-impl.h: Misc cleanup.
6880 (mpn_sb_divrem_mn, mpn_dc_divrem_n): Remove.
6881 (DIV_DC_THRESHOLD): Remove.
6882 * mpn/generic/dc_divrem_n.c: Remove.
6883 * mpn/generic/sb_divrem_mn.c: Remove.
6884 * mpn/generic/tdiv_qr.c: Use DC_DIV_QR_THRESHOLD, not DIV_DC_THRESHOLD.
6886 * tests/devel/try.c: Replace mpn_sb_divrem_mn by mpn_sbpi1_div_qr.
6887 * tests/refmpn.c (refmpn_sb_div_qr): New name for refmpn_sb_divrem_mn.
6889 * tune/Makefile.am (libspeed_la_SOURCES): Remove sb_div.c and sb_inv.c.
6890 (TUNE_MPN_SRCS_BASIC): Remove sb_divrem_mn.c.
6891 * tune/common.c (speed_mpn_dcpi1_div_qr_n): New function.
6892 Remove mpn_sb_divrem_mn related functions.
6893 * tune/speed.c (routine): Remove entries related to mpn_dc_divrem and
6895 (routine): New entry for mpn_dc_div_qr_n.
6896 * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_CALL): Compute inverse
6897 needed by pi1 calls.
6898 (SPEED_ROUTINE_MPN_SB_DIVREM_M3): Remove.
6899 * tune/tuneup.c (tune_sb_preinv): Remove.
6900 (tune_dc): Update to measure DC_DIV_QR_THRESHOLD.
6902 * mpn/generic/sb_divappr_q.c: Remove.
6904 2009-11-01 Torbjorn Granlund <tege@gmplib.org>
6906 * gmp-impl.h: Misc minor cleanups.
6908 2009-10-31 Torbjorn Granlund <tege@gmplib.org>
6910 * gmp-impl.h (toom itch functions): Simplify, make some into macros.
6911 (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Remove.
6912 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove.
6913 * mpn/generic/mul_n.c (mpn_sqr_n): Move from here...
6914 * mpn/generic/sqr_n.c: ...to this new file.
6915 * configure.in (gmp_mpn_functions): Add sqr_n.
6918 MUL_TOOM3_THRESHOLD => MUL_TOOM33_THRESHOLD,
6919 MUL_KARATSUBA_THRESHOLD => MUL_TOOM22_THRESHOLD,
6920 SQR_KARATSUBA_THRESHOLD => SQR_TOOM2_THRESHOLD,
6921 and associated names analogously.
6923 2009-10-31 Niels Möller <nisse@lysator.liu.se>
6925 * mpn/generic/toom_interpolate_7pts.c: Changed evaluation points,
6926 replacing -1/2 by -2.
6927 * mpn/generic/toom44_mul.c: Updated to use new evaluation points,
6928 and use mpn_toom_eval_dgr3_pm2.
6929 * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Likewise.
6930 * mpn/generic/toom53_mul.c (mpn_toom53_mul): Updated to use new
6931 evaluation points, and use mpn_toom_eval_pm1 and
6932 mpn_toom_eval_pm2exp.
6933 * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
6935 * mpn/generic/toom_eval_pm2exp.c: New file.
6936 * mpn/generic/toom_eval_pm1.c: New file.
6938 * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
6939 mpn_toom_eval_dgr3_pm2.
6941 2009-10-30 Torbjorn Granlund <tege@gmplib.org>
6943 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom2* and toom3* files.
6945 2009-10-30 Niels Möller <nisse@lysator.liu.se>
6947 * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
6948 * gmp-impl.h: Added prototype for mpn_toom_eval_dgr3_pm2.
6949 * mpn/generic/toom_eval_dgr3_pm2.c: New file.
6951 2009-10-29 Niels Möller <nisse@lysator.liu.se>
6953 * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
6954 mpn_toom_eval_dgr3_pm1.
6955 * mpn/generic/toom42_mul.c (mpn_toom42_mul): Likewise.
6957 2009-10-29 Torbjorn Granlund <tege@gmplib.org>
6959 * mpn/generic/mulmod_bnm1.c: Replace some add_1 by INCR.
6961 * gmp-impl.h (mpn_mulmod_bnm1_itch): New macro.
6963 * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Call mpn_mul_fft.
6964 (mpn_mulmod_bnm1_next_size): Adopt to SS FFT.
6966 * mpn/generic/mul_fft.c (mpn_mul_fft): Make it return high limb.
6967 (mpn_mul_fft_internal): Likewise.
6969 * mpn/generic/mulmod_bnm1.c: New file, by Niels Möller.
6970 * configure.in (gmp_mpn_functions): Add mulmod_bnm1.
6971 * gmp-impl.h: Add related declarations.
6972 * tune/tuneup.c: Tune MULMOD_BNM1_THRESHOLD.
6973 * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): New macro.
6974 * tune/common.c (speed_mpn_mulmod_bnm1): New function.
6975 * Makefile.am (TUNE_MPN_SRCS_BASIC): Add mulmod_bnm1.c.
6977 * gmp-impl.h (mpn_kara_mul_n, mpn_kara_sqr_n): Remove declarations.
6978 * tune/common.c: Remove/rename kara functions.
6979 * tune/speed.h: Likewise.
6981 * tests/devel/try.c: Clean up usage of %p printf arguments.
6983 * gmp-impl.h: Update MUL/SQR MINSIZE macros to reflect new function
6984 names and limitations
6985 * tune/tuneup.c: Use updated macro names.
6986 * tune/speed.h: Likewise.
6987 * tests/devel/try.c: Test new mul/sqr functions, remove old tests.
6989 2009-10-29 Niels Möller <nisse@lysator.liu.se>
6991 * tune/speed.c: Added support for mpn_toom4_sqr,
6993 * tune/speed.h (SPEED_ROUTINE_MPN_TOOM4_SQR): New macro.
6994 (SPEED_ROUTINE_MPN_KARA_MUL_N): Deleted.
6995 (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Deleted.
6996 (SPEED_ROUTINE_MPN_TOOM2_SQR): Use mpn_toom2_sqr_itch.
6998 * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove
7000 (mpn_toom2_sqr_itch): Add margin for recursive calls.
7002 2009-10-28 Niels Möller <nisse@lysator.liu.se>
7004 * mpn/generic/mul_n.c (mpn_kara_mul_n): Deleted old Karatsuba
7006 (mpn_kara_sqr_n): Likewise deleted.
7008 * mpn/generic/mul_n.c (mpn_sqr_n): Use mpn_toom2_sqr and
7009 mpn_toom3_sqr, not the old implementations.
7011 * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE): Deleted, replaced by
7012 mpn_toom33_mul_itch.
7013 (MPN_TOOM3_SQR_N_TSIZE): Deleted, replaced by
7015 (mpn_toom33_mul_itch): Needs more scratch.
7016 (mpn_toom3_sqr_itch): Likewise.
7017 * tune/speed.h (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Use
7018 mpn_toom33_mul_itch.
7019 (SPEED_ROUTINE_MPN_TOOM3_SQR_N): Use mpn_toom3_sqr_itch.
7020 * mpn/generic/mul_n.c (mpn_mul_n): Use mpn_toom33_mul_itch.
7021 (mpn_sqr_n): Use mpn_toom3_sqr_itch.
7023 * mpn/generic/toom33_mul.c (mpn_toom33_mul): Avoid TMP_ALLOC. Needs
7024 some more supplied scratch instead.
7025 * mpn/generic/toom3_sqr.c (mpn_toom3_sqr): Likewise.
7027 2009-10-26 Torbjorn Granlund <tege@gmplib.org>
7029 * gmp-impl.h (invert_pi1): Streamline, as suggested by Niels.
7031 2009-10-24 Torbjorn Granlund <tege@gmplib.org>
7033 * mpn/generic/bdiv_q.c: Update to call new functions.
7034 * mpn/generic/bdiv_qr.c: Likewise.
7035 * mpn/generic/binvert.c: Likewise.
7036 * mpn/generic/divexact.c: Likewise.
7037 * mpn/generic/divis.c: Likewise.
7038 * mpn/generic/perfpow.c: Likewise.
7039 * mpn/generic/tdiv_qr.c: Likewise.
7040 * mpn/generic/dcpi1_bdiv_q.c: New file.
7041 * mpn/generic/dcpi1_bdiv_qr.c: New file.
7042 * mpn/generic/dcpi1_div_q.c: New file.
7043 * mpn/generic/dcpi1_div_qr.c: New file.
7044 * mpn/generic/dcpi1_divappr_q.c: New file.
7045 * mpn/generic/sbpi1_bdiv_q.c: New file.
7046 * mpn/generic/sbpi1_bdiv_qr.c: New file.
7047 * mpn/generic/sbpi1_div_q.c: New file.
7048 * mpn/generic/sbpi1_div_qr.c: New file.
7049 * mpn/generic/sbpi1_divappr_q.c: New file.
7050 * mpn/generic/dc_bdiv_q.c: Removed.
7051 * mpn/generic/dc_bdiv_qr.c: Removed.
7052 * mpn/generic/dc_div_q.c: Removed.
7053 * mpn/generic/dc_div_qr.c: Removed.
7054 * mpn/generic/dc_divappr_q.c: Removed.
7055 * mpn/generic/sb_bdiv_q.c: Removed.
7056 * mpn/generic/sb_bdiv_qr.c: Removed.
7057 * mpn/generic/sb_div_q.c: Removed.
7058 * mpn/generic/sb_div_qr.c: Removed.
7060 * configure.in (gmp_mpn_functions): Add new division functions, remove
7061 obsolete division functions.
7063 * gmp-impl.h: Add declarations of new division functions, remove
7064 corresponding obsolete declarations.
7065 (gmp_pi1_t, gmp_pi2_t): New types.
7066 (invert_pi1): New macro for computing 2/1 and 3/2 inverses.
7068 2009-10-23 Niels Möller <nisse@lysator.liu.se>
7070 * gmp-impl.h (mpn_toom62_mul_itch): New function.
7072 * tests/mpn/t-toom53.c: New test program.
7073 * tests/mpn/t-toom62.c: New test program.
7075 2009-10-23 Torbjorn Granlund <tege@gmplib.org>
7077 * mpn/generic/get_d.c: Fix code handling denorms for 64-bit machines.
7078 * tests/mpf/t-get_d.c (test_denorms): New function.
7080 2009-10-23 Niels Möller <nisse@lysator.liu.se>
7082 * mpn/generic/toom52_mul.c (mpn_toom52_mul): Use supplied scratch
7083 space, not TMP_ALLOC. Interface change, now requires input sizes
7084 such that s + t >= 5.
7086 * gmp-impl.h (mpn_toom52_mul_itch): New function.
7088 * tests/mpn/t-toom52.c: New test program.
7090 2009-10-22 Torbjorn Granlund <tege@gmplib.org>
7092 * mpn/x86_64/sqr_basecase.asm: Tune for speed and a 7% size decrease.
7094 2009-10-22 Niels Möller <nisse@lysator.liu.se>
7096 * tests/mpn/t-toom44.c: New test program.
7097 * tests/mpn/t-toom33.c: New test program.
7099 * tests/mpn/toom-shared.h (main): Reorganized input generation.
7100 Users are now supposed to define macros MAX_AN, MIN_BN and MAX_BN.
7101 Updated existing toom test programs.
7103 2009-10-22 Torbjorn Granlund <tege@gmplib.org>
7105 * tests/devel/try.c: Fix typos in last change.
7107 2009-10-21 Torbjorn Granlund <tege@gmplib.org>
7109 * mpn/asm-defs.m4 (define_mpn): Add mullow_basecase.
7111 * tests/devel/try.c: Test mpn_mullow_n.
7113 * tests/refmpn.c (refmpn_mullow_n): New function.
7114 * tests/tests.h: Declare it.
7116 2009-10-21 Niels Möller <nisse@lysator.liu.se>
7118 * tests/mpn/toom-shared.h (main): Check for writes outside of the
7119 product or scratch area.
7121 * gmp-impl.h (mpn_toom43_mul_itch): New function.
7123 * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use supplied scratch
7124 space, not TMP_ALLOC. Interface change, now requires input sizes
7125 such that s + t >= 5.
7127 2009-10-20 Niels Möller <nisse@lysator.liu.se>
7129 * tests/mpn/toom-shared.h (MIN_BLOCK): New constant, which can be
7130 overridden by users. Needed by t-toom42 and t-toom43.
7132 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom32,
7133 t-toom42 and t-toom43.
7134 * tests/mpn/t-toom43.c: New test program.
7135 * tests/mpn/t-toom42.c: New test program.
7136 * tests/mpn/t-toom32.c: New test program.
7138 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom22.
7139 * tests/mpn/t-toom22.c: New test file.
7140 * tests/mpn/toom-shared.h: New file. Test framework for Toom
7143 2009-10-14 Niels Möller <nisse@lysator.liu.se>
7145 * mpn/generic/hgcd.c (mpn_hgcd_itch): Thanks to the new
7146 mpn_matrix22_mul_strassen, the scratch need is reduced by 16%.
7148 2009-10-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
7150 * mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): New
7151 Strassen-like algorithm, to reduce the amount of temporary
7153 (mpn_matrix22_mul_itch): Updated to reflect the reduced storage
7156 2009-10-03 Torbjorn Granlund <tege@gmplib.org>
7158 * Rename mpn_addsub_n to mpn_add_n_sub_n.
7160 2009-10-01 Torbjorn Granlund <tege@gmplib.org>
7162 * mpn/generic/tdiv_qr.c: Call mpn_divrem_1 and mpn_dc_div_qr instead of
7165 * mpn/generic/mul_n.c: Call toom22 and toom33 instead of old functions.
7167 * mpn/generic/toom42_mul.c (TOOM42_MUL_N_REC): Renamed from
7168 TOOM22_MUL_N_REC. Unconditionally call the generic mpn_mul_n.
7169 * mpn/generic/toom32_mul.c: Analogous changes.
7171 2009-09-28 Niels Möller <nisse@lysator.liu.se>
7173 * mpn/x86_64/invert_limb.asm: Rewrite. Exploit cancellation in the
7176 2009-09-27 Niels Möller <nisse@lysator.liu.se>
7178 * mpn/x86/invert_limb.asm: Reduce register usage. Eliminated $1
7179 arguments to add, sub and shift.
7181 2009-09-25 Niels Möller <nisse@lysator.liu.se>
7183 * mpn/x86/invert_limb.asm: New file.
7185 2009-09-24 Torbjorn Granlund <tege@gmplib.org>
7187 * mpn/generic/toom33_mul.c: Use new toom functions for all recursive
7189 * mpn/generic/toom3_sqr.c: Likewise.
7190 * mpn/generic/toom44_mul.c: Likewise.
7191 * mpn/generic/toom4_sqr.c: Likewise.
7193 * mpn/generic/add_n.c: Relax operand overlap ASSERTs.
7194 * mpn/generic/sub_n.c: Likewise.
7196 2009-09-15 Torbjorn Granlund <tege@gmplib.org>
7198 Suggested by Uwe Mueller:
7199 * printf/doprnt.c: Use "%ld" for exponent printing.
7200 * printf/doprntf.c (__gmp_doprnt_mpf): Make expval "long".
7202 2009-09-14 Torbjorn Granlund <tege@gmplib.org>
7204 * configure.in: Handle mingw64.
7205 * gmp-impl.h (gmp_intptr_t): Declare.
7206 * tests/amd64check.c (calling_conventions_values): Use CNST_LIMB.
7207 * tests/memory.c: Use gmp_intptr_t; print pointers using C90 "%p".
7208 * tests/misc.c: Use gmp_intptr_t.
7209 * tests/mpq/t-get_str.c: Print pointers using C90 "%p".
7211 2009-08-12 Torbjorn Granlund <tege@gmplib.org>
7213 * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Remove silly ASSERT code.
7215 * mpn/asm-defs.m4 (define_mpn): Remove mod_1s_1p, add mod_1_1p.
7217 * mpn/arm/invert_limb.asm: Complete rewrite.
7219 * longlong.h: Document LONGLONG_STANDALONE and NO_ASM.
7221 2009-08-05 Torbjorn Granlund <tege@gmplib.org>
7223 * tests/mpz/dive_ui.c (check_random): Avoid zero divisors.
7225 2009-07-31 Torbjorn Granlund <tege@gmplib.org>
7227 * mpn/generic/mod_1_1.c: Tweak to handle any modulus (possibility
7228 pointed out by Per Austrin).
7229 (mpn_mod_1_1p): Renamed from mpn_mod_1s_1p.
7230 (mpn_mod_1_1p_cps): Renamed from mpn_mod_1s_1p_cps.
7231 *mpn/generic/mod_1.c (mpn_mod_1): Reorganise to call mpn_mod_1_1p for
7234 2009-07-28 Torbjorn Granlund <tege@gmplib.org>
7236 * configure.in: Pass arch for x86 also in 64-bit mode.
7238 2009-07-26 Torbjorn Granlund <tege@swox.com>
7240 * config.guess (_cpuid): Recognise more Intel "Core" processors.
7242 2009-07-13 Torbjorn Granlund <tege@gmplib.org>
7244 * mpf/eq.c: Rewrite.
7246 * tests/mpf/t-eq.c: New test.
7248 2009-07-06 Torbjorn Granlund <tege@gmplib.org>
7250 * gmp-impl.h (__mp_bases): Remove this alias.
7252 * mpf/get_str.c: Use less overflow prone expression for computing limb
7254 * mpz/inp_str.c: Likewise.
7255 * mpf/set_str.c: Likewise.
7256 * mpz/set_str.c: Likewise.
7258 2009-07-03 Niels Möller <nisse@lysator.liu.se>
7260 * mpn/generic/gcd_1.c (mpn_gcd_1): Use masking tricks to reduce
7261 the number of branches in the loop.
7263 2009-06-28 Torbjorn Granlund <tege@gmplib.org>
7265 * demos/factorize.c (factor_using_pollard_rho): Rewrite.
7267 * mpz/clears.c: New file.
7268 * mpq/clears.c: New file.
7269 * mpf/clears.c: New file.
7270 * gmp-h.in (mpz_clears, mpq_clears, mpf_clears): Declare.
7271 * mpz/Makefile.am: Add clears.c.
7272 * mpq/Makefile.am: Add clears.c.
7273 * mpf/Makefile.am: Add clears.c.
7274 * Makefile.am: Add these also to respective OBJECTS variables.
7275 * doc/gmp.texi: Document inits function and clears functions.
7277 2009-06-20 Torbjorn Granlund <tege@gmplib.org>
7279 * mp-h.in (mp_bitcnt_t): Declare here too.
7281 2009-06-19 Torbjorn Granlund <tege@gmplib.org>
7283 * mpq/inits.c: New file.
7284 * mpf/inits.c: New file.
7285 * gmp-h.in (mpz_inits, mpq_inits, mpf_inits): Declare .
7287 * mpn/generic/remove.c: New file.
7288 * configure.in (gmp_mpn_functions): Add remove.
7289 * gmp-impl.h (mpn_remove): Declare.
7291 * gmp-h.in (mp_bitcnt_t): New basic type.
7292 * mpn/generic/perfpow.c (mp_bitcnt_t): Remove private definition.
7294 * mpn/generic/bdiv_qr.c: Make it actually work.
7296 * mpn/x86_64/core2/aorsmul_1.asm: Rewrite to use shorter pipeline and
7297 to need fewer registers.
7299 2009-06-17 Torbjorn Granlund <tege@gmplib.org>
7301 * mpn/x86_64/rsh1aors_n.asm: New file.
7302 * mpn/x86_64/rsh1add_n.asm: Remove.
7303 * mpn/x86_64/rsh1sub_n.asm: Remove.
7305 * mpz/inits.c: New file.
7307 * gen-trialdivtab.c: Wrap limb constants into CNST_LIMB.
7310 * mpn/generic/perfpow.c (binv_root, binv_sqroot): Change from being
7311 recursive to being iterative.
7312 (mpn_perfect_power_p): Reorganise temp memory usage to avoid a buffer
7313 overrun. Trim allocation of next and prev. Never create oversize
7314 products in the multiplicity binary search.
7316 * mpn/generic/dc_div_q.c: Add missing TMP_FREE.
7318 2009-06-16 Torbjorn Granlund <tege@gmplib.org>
7321 * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
7323 2009-06-16 Martin Boij <mboij@kth.se>
7325 * mpn/generic/perfpow.c (logs): Use more conservative table.
7327 2009-06-15 Torbjorn Granlund <tege@gmplib.org>
7329 * mpn/pa64/aors_n.asm: New file.
7330 * mpn/pa64/add_n.asm: Remove.
7331 * mpn/pa64/sub_n.asm: Remove.
7333 * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
7335 2009-06-14 Torbjorn Granlund <tege@gmplib.org>
7337 * mpn/x86_64/bdiv_q_1.asm: Optimise away a mov insn.
7338 * mpn/x86_64/dive_1.asm: Likewise.
7340 * mpn/generic/perfpow.c (binv_root): Use mpn_bdiv_q_1, not
7341 mpn_divexact_itch for 2-adic division.
7342 (all functions): Micro optimise.
7344 * Makefile.am (libmp_la_SOURCES): Add nextprime.c.
7346 2009-06-13 Torbjorn Granlund <tege@gmplib.org>
7348 * gmp-h.in (mpn_perfect_power_p): Declare.
7349 * configure.in (gmp_mpn_functions): Add perfpow.
7350 * mpz/perfpow.c: Now trivial, simply calls mpn_perfect_power_p.
7352 2009-06-13 Martin Boij <mboij@kth.se>
7354 * mpn/generic/perfpow.c: New file.
7355 * tests/mpz/t-perfpow.c: Rewrite.
7357 2009-06-12 Torbjorn Granlund <tege@gmplib.org>
7359 * mpn/generic/bdiv_qr.c: New file.
7360 * mpn/generic/bdiv_q.c: New file.
7361 * configure.in (gmp_mpn_functions): Add bdiv_qr and bdiv_q.
7362 * gmp-impl.h: Declare new functions.
7364 * nextprime.c: New file.
7365 * gmp-impl.h (gmp_primesieve_t, gmp_init_primesieve, gmp_nextprime):
7367 * Makefile.am (libgmp_la_SOURCES): Add nextprime.c.
7369 2009-06-11 Torbjorn Granlund <tege@gmplib.org>
7371 * mpn/generic/trialdiv.c: New file.
7372 * gen-trialdivtab.c: New file.
7373 * configure.in (gmp_mpn_functions): Add trialdiv.
7374 * gmp-impl.h (mpn_trialdiv): Declare
7375 * Makefile.am: Add rules for gen-trialdivtab and trialdiv.
7377 * longlong.h (arm count_leading_zeros): Define for armv5.
7379 * gmp-impl.h: Move down toom itch functions to after we've #defined
7382 * dumbmp.c (isprime): Replace with slightly less inefficient code.
7383 (mpz_tdiv_r): New function.
7385 2009-06-11 Niels Möller <nisse@lysator.liu.se>
7387 Support for mpn_toom32_mul in speed:
7388 * tune/speed.c (routine): Added mpn_toom32_mul.
7389 * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_MUL): New macro.
7390 * tune/common.c (speed_mpn_toom32_mul): New function.
7392 * gmp-impl.h (mpn_toom32_mul_itch): Count scratch space needed
7393 for the calls to mpn_toom22_mul.
7394 (ABOVE_THRESHOLD): Moved this and related macros so it can be used
7395 by mpn_toom32_mul_itch.
7396 (mpn_toom22_mul_itch): Count scratch space for recursive calls.
7398 2009-06-11 Torbjorn Granlund <tege@gmplib.org>
7400 * mpn/x86/k7/mod_1_4.asm: New file, mainly for k7, but perhaps useful
7401 also for k6 and non-sse p6.
7403 2009-06-10 Torbjorn Granlund <tege@gmplib.org>
7405 * mpn/x86_64/mod_1_4.asm: Minor size reducing tweaks.
7407 * mpn/x86/mod_1.asm: Remove obsolete file.
7408 * mpn/x86/k7/mmx/mod_1.asm: Likewise.
7409 * mpn/x86/pentium4/sse2/mod_1.asm: Likewise.
7410 * mpn/x86/p6/mod_1.asm: Likewise.
7411 * mpn/x86/pentium/mod_1.asm: Likewise.
7413 2009-06-08 Niels Möller <nisse@lysator.liu.se>
7415 * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Reorganized, to reduce
7416 the need for scratch space, and get rid of TMP_ALLOC. Also use
7417 mpn_toom_eval_dgr3_pm1.
7419 * mpn/generic/toom_interpolate_6pts.c (mpn_toom_interpolate_6pts):
7420 Stricter ASSERTs based on maximum size of polynomial coefficients.
7421 Improved comments on the signedness of intermediate values.
7423 2009-06-07 Torbjorn Granlund <tege@gmplib.org>
7425 * mpn/generic/toom2_sqr.c: Make it actually work.
7427 * mpn/generic/toom3_sqr.c: Reduce local scratch space.
7429 2009-06-05 Torbjorn Granlund <tege@gmplib.org>
7431 * mpn/generic/mul_fft.c (FFT_TABLE2_SIZE): Default to 200.
7432 (MUL_FFT_TABLE2_SIZE, SQR_FFT_TABLE2_SIZE): Let these decide
7433 FFT_TABLE2_SIZE if they are defined.
7434 (struct nk): Use bit field.
7436 2009-06-05 Niels Möller <nisse@lysator.liu.se>
7438 * mpn/generic/toom44_mul.c (mpn_toom44_mult): Use
7439 mpn_toom_eval_dgr3_pm1.
7441 * mpn/generic/toom_eval_dgr3_pm1.c: New file.
7443 * mpn/generic/toom_interpolate_7pts.c (mpn_toom_interpolate_7pts):
7444 Minor cleanup, use mpn_add rather than mpn_add_n + MPN_INCR_U.
7446 * mpn/generic/toom44_mul.c (mpn_toom44_mul): Reorganized, to
7447 reduce the need for scratch space, and get rid of TMP_ALLOC.
7449 2009-06-05 Torbjorn Granlund <tege@gmplib.org>
7451 * mpn/generic/toom_interpolate_7pts.c: Fall back mpn_divexact_byN to
7452 mpn_bdiv_q_1_pi1, if the latter is NATIVE.
7454 2009-06-04 Torbjorn Granlund <tege@gmplib.org>
7456 * mpn/x86_64/bdiv_q_1.asm: New file.
7458 * configure.in (HAVE_NATIVE): Add recently added functions.
7459 (GMP_MULFUNC_CHOICES): Handle addlsh_n, sublsh_n, rsblsh_n.
7461 * tune/common.c (speed_mpn_bdiv_q_1, speed_mpn_bdiv_q_1_pi1):
7463 * tune/speed.c (routine): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
7464 * tune/speed.h (SPEED_ROUTINE_MPN_BDIV_Q_1_PI1): New #define.
7465 (SPEED_ROUTINE_MPN_BDIV_Q_1): Mew #define.
7467 * configure.in (gmp_mpn_functions): Add bdiv_q_1.
7468 * mpn/generic/bdiv_q_1.c: New file.
7469 * mpn/asm-defs.m4 (define_mpn): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
7470 * gmp-impl.h (mpn_bdiv_q_1, mpn_bdiv_q_1_pi1): Declare.
7472 * mpn/x86_64/lshift.asm: Cleanup.
7473 * mpn/x86_64/rshift.asm: Cleanup.
7475 * mpn/x86_64/addlsh1_n.asm: Removed.
7476 * mpn/x86_64/aorrlsh1_n.asm: Generalised addlsh1_n.asm to handle
7477 addlsh1_n and rsblsh1_n functionality.
7479 * tests/refmpn.c (refmpn_rsblsh1_n): New function.
7480 * tests/devel/try.c: Test mpn_rsblsh1_n.
7481 * tests/tests.h: Declare refmpn_rsblsh1_n.
7482 * tune/common.c (speed_mpn_rsblsh1_n): New function.
7483 * tune/speed.c (routine): Add mpn_rsblsh1_n.
7484 * tune/speed.h (mpn_rsblsh1_n): Declare.
7486 * configure.in (gmp_mpn_functions_optional): Add rsblsh1_n.
7487 (GMP_MULFUNC_CHOICES): Handle rsblsh1_n defined with a mulfunc.
7488 * mpn/asm-defs.m4 (define_mpn): Add rsblsh1_n.
7489 * gmp-impl.h (mpn_rsblsh1_n): Declare.
7491 * mpn/generic/toom32_mul.c: Consistently use TOOM22_MUL_N_REC.
7493 2009-06-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
7495 * mpn/generic/toom43_mul.c: New file.
7496 * mpn/generic/toom52_mul.c: New file.
7497 * mpn/generic/toom_interpolate_6pts.c: New file.
7499 2009-06-03 Torbjorn Granlund <tege@gmplib.org>
7501 * configure.in (gmp_mpn_functions): Add toom43_mul, toom52_mul, and
7502 toom_interpolate_6pts, but also some previously forgotten functions.
7503 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Likewise.
7504 * gmp-impl.h: Declare new functions. Sort toom function declarations.
7506 * gmp-impl.h: Rename toom4_* flags enum to toom7_*. Relevant C files
7509 * mpn/generic/toom_interpolate_7pts (divexact_2exp): Remove.
7511 2009-06-02 Torbjorn Granlund <tege@gmplib.org>
7513 * demos/factorize.c: Add -q command line option.
7515 2009-06-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
7517 * mpn/generic/toom_interpolate_7pts.c: Streamline, resulting in speed
7520 * mpn/generic/toom_interpolate_5pts.c: Likewise, but also completely
7521 do away with explicit scratch space.
7522 * gmp-impl.h (mpn_toom_interpolate_5pts): Update prototype.
7524 * mpn/generic/mul_n.c (mpn_toom3_sqr_n, mpn_toom3_mul_n):
7525 Update toom_interpolate_5pts call without scratch space parameter.
7526 * mpn/generic/toom3_sqr.c: Likewise.
7527 * mpn/generic/toom42_mul.c: Likewise.
7528 * mpn/generic/toom33_mul.c: Likewise.
7530 * mpn/generic/toom33_mul.c: Reduce local scratch space.
7531 * mpn/generic/toom32_mul.c: Rewrite to not use local scratch space.
7533 2009-06-02 Torbjorn Granlund <tege@gmplib.org>
7535 * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): New macro, use it for
7538 2009-06-01 Torbjorn Granlund <tege@gmplib.org>
7540 * mpn/generic/mul.c: Loop to avoid excessive recursion in toom33 and
7541 toom44 slicing code.
7543 * mpz/remove.c: Correctly handle multiplicity that does not fit an int.
7545 * Makefile.am (dist-hook): Check library version consistency.
7547 * mpn/generic/mul.c: Rewrite.
7549 2009-05-29 Torbjorn Granlund <tege@gmplib.org>
7551 * tests/mpz/t-divis.c (check_random): Create huge test operands.
7553 * mpn/generic/toom44_mul.c: Allocate temp space using one TMP_ALLOC
7554 call, not multiple TMP_SALLOC.
7555 * mpn/generic/toom4_sqr.c: Likewise.
7557 * gmp-impl.h (mpn_toom22_mul_itch): Replace totally wrong code.
7559 * mpn/generic/mullow_n.c: Relax overlap requirement implied by ASSERT.
7561 * mpn/generic/divis.c: Rewrite.
7563 * gmp-impl.h (mpn_mu_bdiv_qr): Now returns mp_limb_t.
7564 (mpn_toom2_sqr_itch): Simplify.
7566 * mpn/generic/mu_bdiv_qr.c: Implement properly.
7568 2009-05-27 Torbjorn Granlund <tege@gmplib.org>
7570 * mpn/generic/mod_1_1.c: Add proper ASSERT functionality cps function.
7571 * mpn/generic/mod_1_2.c: Likewise.
7572 * mpn/generic/mod_1_3.c: Likewise.
7573 * mpn/generic/mod_1_4.c: Likewise.
7575 * tune: Add speed measuring of toom22, toom33, and toom44.
7577 * mpn/generic/toom22_mul.c: Handle potentially unbalanced coefficient
7580 2009-05-26 Torbjorn Granlund <tege@gmplib.org>
7582 * tests/mpz/t-mul.c (ref_mpn_mul): Use mpn_toom44_mul in FFT range for
7583 better huge-operands performance.
7585 2009-05-24 Torbjorn Granlund <tege@gmplib.org>
7587 * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Try "$L" too, before "$".
7589 2009-05-23 Torbjorn Granlund <tege@gmplib.org>
7591 * gmp-impl.h (mpn_mod_1s_1p,mpn_mod_1s_2p,mpn_mod_1s_3p,mpn_mod_1s_4p):
7592 Declare using __GMP_ATTRIBUTE_PURE.
7594 * tune/tuneup.c (tune_mod_1): Specify check_size for measuring mod_1_N
7596 (one): Remove redundant size loop exit condition.
7598 2009-05-20 Torbjorn Granlund <tege@gmplib.org>
7600 * mpn/x86/pentium4/sse2/mod_1_4.asm: New file.
7601 * mpn/x86/p6/sse2/mod_1_4.asm: New file (grabbing pentium4 code).
7603 2009-05-18 Torbjorn Granlund <tege@gmplib.org>
7605 * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 4.
7606 (__GNU_MP_VERSION_PATCHLEVEL): Set to -1.
7608 * mpn/x86_64/mod_1_4.asm: New file.
7610 * mpn/asm-defs.m4: Correct names for mod_1_N functions.
7611 Add defines for corresponding cps functions.
7613 * mpn/generic/mod_1_2.c: Support any sizes > 1.
7614 * mpn/generic/mod_1_3.c: Likewise.
7615 * mpn/generic/mod_1_4.c: Likewise.
7617 2009-05-12 Torbjorn Granlund <tege@gmplib.org>
7619 * Version 4.3.1 released.
7621 2009-05-11 Torbjorn Granlund <tege@gmplib.org>
7623 * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
7625 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
7628 2009-05-09 Torbjorn Granlund <tege@gmplib.org>
7630 * tests/mpz: Add MPZ_CHECK_FORMAT to many tests.
7632 2009-05-07 Torbjorn Granlund <tege@gmplib.org>
7634 * mpn/x86/pentium4/sse2/mul_basecase.asm: Avoid L(ret), "ret" is
7635 defined in x86-defs.m4.
7637 2009-05-06 Torbjorn Granlund <tege@gmplib.org>
7639 * mpn/x86/p6/aors_n.asm: Use L() for labels.
7640 * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
7641 * mpn/x86/pentium4/sse2/mul_1.asm: Likewise.
7642 * mpn/x86/pentium4/sse2/mul_basecase.asm: Likewise.
7643 * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
7644 * mpn/x86_64/lshift.asm: Likewise.
7645 * mpn/x86_64/rshift.asm: Likewise.
7647 * tests/cxx/t-locale.cc (point_string): Declare as extern "C" to
7648 placate compilers that mangle variable names.
7650 2009-05-04 Torbjorn Granlund <tege@gmplib.org>
7652 * tests/mpz/t-gcd.c: Generate operands that are multiple of each other.
7654 2009-05-01 Torbjorn Granlund <tege@gmplib.org>
7656 * gmp-h.in (__GMP_EXTERN_INLINE): Support for more systems.
7657 (gmp_randinit_set): Add missing __GMP_DECLSPEC.
7659 2009-04-28 Torbjorn Granlund <tege@gmplib.org>
7661 * mpn/generic/neg_n.c: New file.
7662 * configure.in (gmp_mpn_functions): Add neg_n.
7663 * mpn/asm-defs.m4 (define_mpn): Add neg_n.
7664 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add neg_n.c.
7665 * gmp-h.in: Handle mpn_neg_n properly.
7667 * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Nailify.
7669 * mpn/generic/gcdext.c: Change some MPN_NORMALIZE to
7670 MPN_NORMALIZE_NOT_ZERO.
7671 * mpn/generic/gcdext_lehmer.c: Likewise.
7672 Add a MPN_NORMALIZE_NOT_ZERO.
7674 * mpn/generic/binvert.c: Remove own mpn_neg_n.
7676 * tests/mpz/t-gcd.c: Add some MPZ_CHECK_FORMAT calls.
7678 2009-04-27 Torbjorn Granlund <tege@gmplib.org>
7680 * mpn/Makefile.am (TARG_DIST): Add minithres.
7682 * mpn/generic/bdiv_dbm1c.c: Handle nails.
7684 2009-04-26 Torbjorn Granlund <tege@gmplib.org>
7686 * config.guess: Recognise more POWER processor types.
7688 2009-04-25 Torbjorn Granlund <tege@gmplib.org>
7690 * mpn/x86/pentium4/sse2/popcount.asm: Work around Apple reloc bug.
7691 * mpn/x86/darwin.m4: Define symbol "DARWIN".
7693 2009-04-19 Torbjorn Granlund <tege@gmplib.org>
7695 * mpn/generic/powm.c (mpn_redc_n): Use ASSERT_ALWAYS, not abort().
7696 * mpn/generic/powm_sec.c: Likewise.
7698 * mpn/powerpc64/aix.m4 (EXTERN_FUNC): New define. Add dummy variants
7700 * mpn/powerpc64/mode64/divrem_1.asm: Use EXTERN_FUNC.
7701 * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
7703 2009-04-16 Torbjorn Granlund <tege@gmplib.org>
7705 * mpn/x86_64/x86_64-defs.m4 (JUMPTABSECT): New define.
7706 * mpn/x86_64/darwin.m4: Likewise.
7707 * mpn/x86_64/sqr_basecase.asm: Rework switch code using JUMPTABSECT.
7709 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
7710 Remove an unused variable.
7712 * mpn/x86/x86-defs.m4 (LEA): Get SIZE arguments right.
7714 2009-04-14 Torbjorn Granlund <tege@gmplib.org>
7716 * Version 4.3.0 released.
7718 * scanf/doscan.c (__gmp_doscan): Pad 3-operand scanf call with dummy
7720 * scanf/sscanffuns.c (scan): Disable vsscanf variant for now.
7722 2009-04-13 Torbjorn Granlund <tege@gmplib.org>
7724 * scanf/sscanffuns.c (scan): Rewrite to use stdarg.
7726 * tests/mpz/t-root.c: Rewrite. Add unconditional gcc 4.3.2 tests.
7728 2009-04-09 Torbjorn Granlund <tege@gmplib.org>
7730 * mpn/generic/powm.c: New file.
7731 * mpn/generic/powlo.c: New file.
7732 * mpn/generic/powm_sec.c: New file.
7733 * configure.in (gmp_mpn_functions): List new functions.
7735 2009-04-08 Torbjorn Granlund <tege@gmplib.org>
7737 * mpz/urandomm.c: Amend last fix.
7739 2009-04-06 Torbjorn Granlund <tege@gmplib.org>
7741 * configure.in: Support Sun cc for x86_64.
7743 * mpz/urandomm.c: Handle operand overlap.
7745 2009-03-11 Torbjorn Granlund <tege@gmplib.org>
7747 * configure.in (powerpc): Brave removing -Wa,-mppc64, in the hope that
7748 GCC now passes the proper options.
7750 2009-03-09 Torbjorn Granlund <tege@gmplib.org>
7752 * mpn/x86_64/divrem_1.asm: Add a nop to save a cycle in unnormalised
7755 2009-03-05 Torbjorn Granlund <tege@gmplib.org>
7757 * ia64/gmp-mparam.h, arm/gmp-mparam.h, x86/p6/mmx/gmp-mparam.h,
7758 pa32/hppa2_0/gmp-mparam.h sparc32/v9/gmp-mparam.h: Update.
7760 2009-03-03 Torbjorn Granlund <tege@gmplib.org>
7762 * mpn/ia64/bdiv_dbm1c.asm: Accept/return carry.
7764 2009-03-02 Torbjorn Granlund <tege@gmplib.org>
7766 * configure.in (64-bit sparc/solaris): Pass -xO3, not -O3 to solaris
7769 2009-03-01 Torbjorn Granlund <tege@gmplib.org>
7771 * longlong.h (mips, powerpc): Provide assembly-free umul_ppmm for newer
7774 2009-02-04 Torbjorn Granlund <tege@gmplib.org>
7776 * mpn/generic/redc_2.c: Remove code for testing and timing. Update
7777 to current FSF header.
7778 * mpn/generic/redc_1.c: Update to current FSF header.
7780 2009-01-21 Torbjorn Granlund <tege@gmplib.org>
7782 * mpz/powm.c (redc): Remove.
7783 (mpz_powm): Use mpn_redc_1 instead of redc.
7785 * tests/mpz/t-powm.c: Rewrite reference code.
7787 2009-01-18 Torbjorn Granlund <tege@gmplib.org>
7789 * tests/mpz: Increase reps for many tests.
7791 * mpn/generic/rootrem.c (mpn_rootrem_internal): Use MPN_DECR_U instead of
7792 mpn_sub_1 (works around gcc 4.3 bugs and is also faster).
7794 2009-01-16 Torbjorn Granlund <tege@gmplib.org>
7796 * tests/tests.h: Declare refmpn_divrem_2.
7798 2009-01-15 Torbjorn Granlund <tege@gmplib.org>
7800 * mpz/perfpow.c: Add TMP_FREE before every return statement.
7802 * mpn/generic/rootrem.c (mpn_rootrem_internal): Add a missing TMP_FREE.
7804 * configure.in (gcc_cflags, gcc_64_cflags): Revert from -O3 to -O2,
7805 the change was accidental and cause too much miscompilation.
7807 2009-01-14 Torbjorn Granlund <tege@gmplib.org>
7809 * tune/tuneup.c (tune_mod_1): Run MOD_1_x_THRESHOLD tests also when
7810 longlong.h specified UDIV_PREINV_ALWAYS.
7812 * mpn/generic/mod_1.c (mpn_mod_1): Properly check for normalisation
7815 2009-01-13 Torbjorn Granlund <tege@gmplib.org>
7817 * tune/tuneup.c (tune_mod_1): Tune for MOD_1_1_THRESHOLD,
7818 MOD_1_2_THRESHOLD, and MOD_1_4_THRESHOLD.
7820 * mpn/generic/mod_1.c: Rewrite.
7821 * mpn/generic/mod_1_1.c: New file.
7822 * mpn/generic/mod_1_2.c: New file.
7823 * mpn/generic/mod_1_3.c: New file.
7824 * mpn/generic/mod_1_4.c: New file.
7825 * configure.in (gmp_mpn_functions): Add mod_1_*.
7826 * mpn/asm-defs.m4 (define_mpn): Add mod_1_*.
7827 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mod_1_*.c.
7828 * gmp-impl.h: Declare new mpn_mod_1s_* functions and associated
7830 (udiv_rnd_preinv): New macro.
7832 2009-01-12 Torbjorn Granlund <tege@gmplib.org>
7834 * tune/tuneup.c (tune_gcd_dc,tune_gcdext_dc): Lower step_factor to 0.1.
7836 2009-01-08 Torbjorn Granlund <tege@gmplib.org>
7838 * tests/mpz/t-nextprime.c: New test file.
7839 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-nextprime.
7842 * mpz/nextprime.c: Handle large prime gaps by limiting incr.
7844 2009-01-04 Torbjorn Granlund <tege@gmplib.org>
7846 * mpz/and.c, mpz/ior.c, mpz/xor.c: Re-read only necessary source
7847 pointers after reallocation. Misc cleanup.
7849 * gmp-impl.h (MPN_TOOM44_MAX_N): New define, replaces MPN_TOOM3_MAX_N.
7851 * mpn/x86/fat/diveby3.c: New file.
7853 2008-12-30 Niels Möller <nisse@lysator.liu.se>
7855 * doc/gmp.texi (Greatest Common Divisor Algorithms): Updated
7856 section on GCD algorithms.
7858 2008-12-29 Torbjorn Granlund <tege@gmplib.org>
7860 * doc/gmp.texi (Multiplication Algorithms): Add descriptions of Toom-4
7861 and unbalanced multiplication.
7862 (Radix to Binary): Add warning that text is outdated,
7863 (Contributors): Fix typos.
7865 * mpn/generic/toom*.c: Use coherent MAYBE_ macros for trimming
7866 unreachable recursive functions.
7867 * gmp-impl.h: Update toom itch functions.
7869 * mpn/x86_64/sqr_basecase.asm: Slightly increase stack allocation, to
7872 2008-12-28 Torbjorn Granlund <tege@gmplib.org>
7874 * mpn/x86_64/pentium4/aors_n.asm: Tune prologue code.
7876 * mpn/x86_64/pentium4/aorslsh1_n.asm: New file.
7878 * mpn/x86_64/darwin.m4: Define symbol "DARWIN".
7879 * mpn/x86_64/invert_limb.asm: Work around darwin quirks.
7881 * mpn/x86_64/sqr_basecase.asm: Further optimize, support Darwin.
7883 * mpn/x86_64/invert_limb.asm: New file.
7885 2008-12-27 Torbjorn Granlund <tege@gmplib.org>
7887 * mpn/x86_64/core2/aorslsh1_n.asm: New file.
7889 2008-12-26 Torbjorn Granlund <tege@gmplib.org>
7891 * mpz/perfpow.c: Handle negative arguments properly.
7892 * tests/mpz/t-perfpow.c: New file.
7893 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-perfpow.
7895 2008-12-23 Torbjorn Granlund <tege@gmplib.org>
7897 * tests/mpz/t-mul.c (dump_abort): Improve error message.
7899 * gcd.c gcd_subdiv_step.c gcdext.c gcdext_subdiv_step.c:
7900 Remove private mpn_zero_p.
7902 * tune/tuneup.c (tune_mul): Tune for MUL_TOOM44_THRESHOLD.
7903 (tune_sqr): Tune for SQR_TOOM4_THRESHOLD.
7905 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom44_mul.c and
7908 * configure.in (gmp_mpn_functions): Toom function updates.
7910 * Rename mpn/mul_toomMN.c to mpn/toomMN_mul.c. Function names changed
7913 * mpn/toomMN_mul.c: Add scratch parameter. Do recursive multiplies
7914 properly. Misc tuning. Remove CHECK and TIMING code.
7916 * mpn/toom2_sqr.c, mpn/toom3_sqr.c, mpn/toom4_sqr.c: New files.
7918 * gmp-impl.h (mpn_toomMN_mul_itch): Several new functions.
7919 (mpn_zero_p): New functions.
7920 Add various TOOM4/TOOM44 related parameters.
7921 Update mpn_toomMN_mul prototypes.
7923 * mpn/generic/mul_n.c (mpn_mul_n): Call mpn_toom44_mul. Use TMP_BALLOC
7925 (mpn_sqr_n): Analogous changes.
7927 * mpn/generic/mul.c: Update unbalanced toom code to pass scratch space.
7929 2008-12-21 Torbjorn Granlund <tege@gmplib.org>
7931 * mpz/nextprime.c: Add TMP_SDECL/MARK/FREE.
7933 2008-12-20 Torbjorn Granlund <tege@gmplib.org>
7935 * mpn/generic/sqrtrem.c (mpn_sqrtrem1): Rewrite, improve interface.
7936 (invsqrttab): New table, remove table approx_tab.
7937 (mpn_sqrtrem2): Optimize, update mpn_sqrtrem1 call.
7938 (mpn_sqrtrem): Update mpn_sqrtrem1 call.
7940 2008-12-18 Torbjorn Granlund <tege@gmplib.org>
7942 * mpz/nextprime.c: Run 10 mpz_millerrabin tests (was 5).
7943 Give credit to authors.
7945 * mpn/x86_64/redc_1.asm: Align stack as mandated by ABI.
7947 * mpn/x86_64/divrem_2.asm: Add some comments.
7949 * mpn/x86_64/darwin.m4: New file.
7950 * configure.in: Use x86_64/darwin.m4.
7952 2008-12-15 Torbjorn Granlund <tege@gmplib.org>
7954 * doc/projects.html: Remove GCD and division projects, update text on
7957 * doc/tasks.html: Add a caution about that the file is somewhat
7960 2008-12-14 Torbjorn Granlund <tege@gmplib.org>
7962 * mpn/alpha/ev6/aorsmul_1.asm: New file (same code for mpn_addmul_1,
7963 much improved for mpn_submul_1).
7964 * mpn/alpha/ev6/addmul_1: File removed.
7965 * mpn/alpha/ev6/submul_1: File removed.
7967 2008-12-09 Torbjorn Granlund <tege@gmplib.org>
7970 * mpn/x86_64/mul_basecase.asm: Further tweaks for code size and speed.
7972 * mpn/powerpc64/mode64/divrem_1.asm: Rewrite.
7974 * mpn/powerpc64/mode64/mul_basecase.asm: New file.
7976 2008-12-08 Torbjorn Granlund <tege@gmplib.org>
7978 * mpn/powerpc64/mode64/gmp-mparam.h: New file.
7980 * gmp-impl.h: Additional cleanups.
7981 (mpn_set_str_compute_powtab): New prototype.
7982 (mpn_powm, mpn_powlo): New prototypes.
7984 * mpz/pow_ui.c: Handle some small exponents locally.
7986 2008-12-07 Torbjorn Granlund <tege@gmplib.org>
7988 * mpn/generic/set_str.c: Remove prototypes (they are in gmp-impl.h).
7990 * tune/set_strs.c, tune/set_strb.c: Make prototypes effective by moving
7991 the #define mpn_set_str* before including gmp-impl.h.
7993 * All files: Change _PROTO => __GMP_PROTO.
7995 * tune/speed.c (routine): Remove non-working choice mpn_set_str_subquad.
7996 * tune/common.c (speed_mpn_dc_set_str): Remove, it is broken.
7998 * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Make this static,
8001 * gmp-impl.h: Major cleanup.
8002 (Remove formal parameter names. Use __GMP_PROTO consistently. Move
8003 __GMP_PROTO and __MPN use to adjacent lines for declared function.
8004 Fix typos. Remove code inside #if 0.)
8006 * configure.in (gmp_mpn_functions): Add mul_toom33. Reformat.
8008 2008-12-05 Torbjorn Granlund <tege@gmplib.org>
8010 * mpn/generic/redc_1.c: New file.
8011 * mpn/generic/redc_2.c: New file.
8013 * configure.in (gmp_mpn_functions): List redc_1 and redc_2.
8014 (HAVE_NATIVE): Likewise.
8016 * tune/common.c (speed_mpn_redc_1): Renamed from speed_redc.
8017 * tune/speed.c (routine): Remove "redc", and "mpn_redc_1".
8018 * tune/speed.h (SPEED_ROUTINE_REDC_1): Renamed from SPEED_ROUTINE_REDC.
8020 * tune/tuneup.c (tune_powm): Update redc call.
8022 2008-12-04 Torbjorn Granlund <tege@gmplib.org>
8024 * mpn/x86_64/sqr_basecase.asm: Inline a combined diagonal product code
8025 and addlsh1 loop. Misc cleanup.
8027 2008-12-02 Torbjorn Granlund <tege@gmplib.org>
8029 * mpn/x86_64/sqr_basecase.asm: New file.
8031 2008-11-30 Torbjorn Granlund <tege@gmplib.org>
8033 * mpn/generic/sqr_basecase.c: Fix typo in mpn_addmul_2s variant.
8035 2008-11-28 Torbjorn Granlund <tege@gmplib.org>
8037 * mpn/x86_64/redc_1.asm: Rewrite.
8039 2008-11-27 Torbjorn Granlund <tege@gmplib.org>
8041 * tests/refmpn.c (refmpn_redc_1): New function.
8043 2008-11-25 Torbjorn Granlund <tege@gmplib.org>
8045 * mpn/x86/k7/aorsmul_1.asm: Actually handle mpn_submul_1.
8047 2008-11-23 Torbjorn Granlund <tege@gmplib.org>
8049 * mpn/x86_64/divrem_1.asm: Rewrite.
8051 * alpha/divrem_2.asm: New file.
8052 * powerpc32/divrem_2.asm: New file.
8053 * powerpc64/mode64/divrem_2.asm: New file.
8054 * x86/divrem_2.asm: New file.
8055 * x86_64/divrem_2.asm: New file.
8056 * tests/refmpn.c (refmpn_divrem_2): New function.
8058 2008-11-22 Torbjorn Granlund <tege@gmplib.org>
8060 * mpn/x86/k7/mul_1.asm: Rewrite for smaller size and better speed.
8061 * mpn/x86/k7/aorsmul_1.asm: Likewise.
8063 * acinclude.m4 (GMP_VERSION): Include last component even when zero.
8065 2008-11-21 Torbjorn Granlund <tege@gmplib.org>
8067 * mpn/x86_64/README: Rewrite.
8069 * tests/devel/try.c (malloc_region, mprotect_maybe): Add casts for
8070 printf type correctness.
8072 * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
8074 * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
8077 2008-11-20 Torbjorn Granlund <tege@gmplib.org>
8079 * gmp-impl.h: Rename modlimb_invert to binvert_limb.
8080 * tune/speed.h: Likewise.
8081 * tune/modlinv.c: Likewise.
8082 * tune/common.c: Likewise.
8083 * tests/t-modlinv.c: Likewise.
8084 * tests/t-constants.c: Likewise.
8085 * mpn/sparc64/mode1o.c: Likewise.
8086 * mpn/alpha/dive_1.c: Likewise.
8087 * mpn/sparc64/dive_1.c: Likewise.
8088 * mpn/generic/mode1o.c: Likewise.
8089 * mpn/generic/dive_1.c: Likewise.
8090 * mpn/generic/bdivmod.c: Likewise.
8091 * mpn/alpha/mode1o.asm: Likewise.
8092 * mpn/asm-defs.m4: Likewise.
8093 * mpn/ia64/mode1o.asm: Likewise.
8094 * mpn/powerpc32/README: Likewise.
8095 * mpn/powerpc32/mode1o.asm: Likewise.
8096 * mpn/powerpc64/mode64/dive_1.asm: Likewise.
8097 * mpn/powerpc64/mode64/mode1o.asm: Likewise.
8098 * mpn/x86/dive_1.asm: Likewise.
8099 * mpn/x86/k6/mmx/dive_1.asm: Likewise.
8100 * mpn/x86/k6/mode1o.asm: Likewise.
8101 * mpn/x86/k7/dive_1.asm: Likewise.
8102 * mpn/x86/k7/mode1o.asm: Likewise.
8103 * mpn/x86/p6/dive_1.asm: Likewise.
8104 * mpn/x86/p6/mode1o.asm: Likewise.
8105 * mpn/x86/pentium/dive_1.asm: Likewise.
8106 * mpn/x86/pentium/mode1o.asm: Likewise.
8107 * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
8108 * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
8109 * mpn/x86_64/dive_1.asm: Likewise.
8110 * mpn/x86_64/mode1o.asm: Likewise.
8112 * mpn/x86_64/aors_n.asm: Replace with slightly faster, more alignment
8115 2008-11-18 Torbjorn Granlund <tege@gmplib.org>
8117 * configure.in: Remove gcd_finda related declarations.
8118 * gmp-impl.h (mpn_gcd_finda): Remove declaration.
8119 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Remove gcd_finda.
8120 * mpn/asm-defs.m4: Remove define_mpn(gcd_finda).
8121 * mpn/x86/k6/gcd_finda.asm: Remove file.
8122 * tests/devel/try.c (param_init): Remove mpn_gcd_finda.
8123 (choice_array): Remove mpn_gcd_finda.
8124 * tests/mpn/t-instrument.c (check): Remove testing of mpn_gcd_finda.
8125 * tests/refmpn.c (refmpn_gcd_finda): Remove.
8126 * tests/tests.h (refmpn_gcd_finda): Remove declaration.
8127 * tune/common.c (speed_mpn_gcd_finda): Remove.
8128 * tune/gcd_finda_gen.c: Remove file.
8129 * tune/speed.h (speed_mpn_gcd_finda): Remove declaration.
8130 * tune/speed.c (routine): Remove mpn_gcd_finda entry.
8132 * tests/mpz/t-powm.c: Print test number when failing a test.
8134 * mpn/x86_64/redc_1.asm (CALL): Move from here...
8135 * mpn/x86_64/x86_64-defs.m4: ...to here.
8137 * gmp-impl.h (mpn_jacobi_base): Remove parameter names.
8139 2008-11-11 Torbjorn Granlund <tege@gmplib.org>
8141 * tests/mpf/t-conv.c: Add some specific tests, supplementing the random
8144 2008-11-09 Torbjorn Granlund <tege@gmplib.org>
8146 * mpf/set_str.c: Default 'base' before letting exp_base inherit it.
8148 * tests/cxx/t-prec.cc: Use the right precision for all float constants.
8150 2008-11-08 Torbjorn Granlund <tege@gmplib.org>
8152 * doc/gmp.texi (Float Comparison): Update mpf_eq documentation.
8154 * mpf/eq.c: Compare the right number of bits.
8156 2008-11-02 Torbjorn Granlund <tege@gmplib.org>
8158 Undo, it made testing too slow:
8159 * tests/mpz/t-mul.c: Use slower geometric progression for operand
8162 * mpn/x86/k7/mod_34lsub1.asm: Use movzb for masking low 8 bits.
8164 2008-10-31 Niels Möller <nisse@lysator.liu.se>
8166 * mpn/generic/hgcd2.c (div1): New function (taken from old gcdext
8168 (mpn_hgcd2): Use single precision for the second half of the work.
8170 2008-10-30 Torbjorn Granlund <tege@gmplib.org>
8172 * mpn/x86/p6/sse2/gmp-mparam.h: New file.
8174 2008-10-29 Torbjorn Granlund <tege@gmplib.org>
8176 * configure.in (x86 fat_path): Add "x86/p6/sse2".
8178 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Recognize sse2 capable p6
8181 * mpn/x86/p6/sse2/mul_1.asm: New file.
8182 * mpn/x86/p6/sse2/addmul_1.asm: New file.
8183 * mpn/x86/p6/sse2/submul_1.asm: New file.
8184 * mpn/x86/p6/sse2/mul_basecase.asm: New file.
8185 * mpn/x86/p6/sse2/sqr_basecase.asm: New file.
8186 * mpn/x86/p6/sse2/popcount.asm: New file.
8188 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Handle "extended" fields for
8191 2008-10-28 Torbjorn Granlund <tege@gmplib.org>
8193 From Mickael Gastineau:
8194 * gmp-h.in (gmp_urandomm_ui, gmp_urandomb_ui): Add __GMP_DECLSPEC.
8196 2008-10-27 Torbjorn Granlund <tege@gmplib.org>
8198 * gmp-h.in (mpn_gcdext_1): Remove bogus __GMP_ATTRIBUTE_PURE.
8200 2008-10-27 Niels Möller <nisse@lysator.liu.se>
8202 * tune/common.c (speed_mpn_hgcd): Call mpn_hgcd_matrix_init once
8203 for each call to mpn_hgcd.
8204 (speed_mpn_hgcd_lehmer): Likewise.
8206 2008-10-26 Torbjorn Granlund <tege@gmplib.org>
8208 * configure.in: Point to p6/sse2 for pentiumm and core2.
8210 * gmp-impl.h (mpn_add_nc, mpn_sub_nc): Move these macros to after fat
8213 * tune/common.c, tune/speed.c, tune/speed.h:
8214 Add speed measurement of mpn_bdiv_dbm1c.
8216 2008-10-24 Torbjorn Granlund <tege@gmplib.org>
8218 * mpn/x86_64/gmp-mparam.h (MUL_FFT_TABLE2, SQR_FFT_TABLE2): Extend.
8220 * mpz/nextprime.c: Move declarations to function beginning.
8222 2008-10-23 Niels Möller <nisse@lysator.liu.se>
8224 * gmp-impl.h (DECL_gcdext_1): Deleted.
8226 2008-10-22 Torbjorn Granlund <tege@gmplib.org>
8228 * mpn/x86_64/atom/aors_n.asm: New file.
8229 * mpn/x86_64/atom/gmp-mparam.h: New file.
8231 2008-10-21 Torbjorn Granlund <tege@gmplib.org>
8234 * mpz/nextprime.c: Rewrite.
8236 * tests/devel/try.c (main): Use strtol for 's' and 'S' optargs.
8238 * mpn/x86_64/pentium4/rshift.asm: Misc cleanups.
8239 * mpn/x86_64/pentium4/lshift.asm: Likewise.
8241 * mpn/x86_64/pentium4/aors_n.asm: Use fewer registers.
8243 * configure.in: Set up specific path for x86_64/atom.
8245 2008-10-21 Niels Möller <nisse@lysator.liu.se>
8247 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Removed
8249 * mpn/generic/qstack.c: Deleted obsolete file.
8251 2008-10-20 Torbjorn Granlund <tege@gmplib.org>
8253 * mpn/x86_64/core2/aorsmul_1.asm: New file.
8255 2008-10-19 Torbjorn Granlund <tege@gmplib.org>
8257 * mpn/x86_64/aors_n.asm: Remove redundant MULFUNC_PROLOGUE.
8259 * gmp-impl.h (popc_limb): Remove redundant checks of GMP_LIMB_BITS
8260 inside several of these macros.
8262 2008-10-17 Torbjorn Granlund <tege@gmplib.org>
8264 * tests/mpz/t-mul.c: Use slower geometric progression for operand
8265 sizes. Do every other tests for same size operands.
8267 2008-10-15 Torbjorn Granlund <tege@gmplib.org>
8269 * mpn/x86_64/mul_basecase.asm: Simplify addressing in epilogue.
8271 * mpn/mips64/divrem_1.asm: Remove file, it is n32-only, and uses an old
8274 * config.guess, config.sub, configure.in: Support Intel Atom processor.
8276 2008-10-10 Torbjorn Granlund <tege@gmplib.org>
8278 * mpq/mul.c: Fix typo in last change.
8280 2008-10-09 Torbjorn Granlund <tege@gmplib.org>
8282 * tests/refmpn.c (refmpn_sb_divrem_mn): Work around a gcc bug.
8284 2008-10-08 Torbjorn Granlund <tege@gmplib.org>
8286 * mpq/mul.c: Use TMP_ALLOC. Cleanup.
8287 * mpq/div.c: Likewise.
8289 * mpn/x86_64/mul_basecase.asm: Use lea directly for loading entry point
8292 2008-10-09 Niels Möller <nisse@lysator.liu.se>
8294 * mpn/x86/k7/gmp-mparam.h: Updated GCD-related values.
8296 2008-10-05 Torbjorn Granlund <tege@gmplib.org>
8298 * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Do store
8299 mpn_fft_norm_modF return value, if (rec).
8301 2008-10-04 Torbjorn Granlund <tege@gmplib.org>
8303 * mpn/x86_64/aorsmul_1.asm: Replace with faster code.
8304 * mpn/x86_64/mul_1.asm: Likewise.
8305 * mpn/x86_64/addmul_2.asm: Likewise.
8306 * mpn/x86_64/mul_2.asm: Likewise.
8307 * mpn/x86_64/mul_basecase.asm: Likewise.
8309 2008-10-02 Torbjorn Granlund <tege@gmplib.org>
8311 * mpn/minithres/gmp-mparam.h: Update FFT values.
8313 2008-10-02 Niels Möller <nisse@lysator.liu.se>
8315 * hgcd.c (mpn_hgcd_matrix_mul): Fixed normalization bug.
8317 2008-09-24 Torbjorn Granlund <tege@gmplib.org>
8319 * configure.in: Handle --enable-minithres.
8320 * mpn/minithres/gmp-mparam.h: Update all values.
8322 2008-09-22 Torbjorn Granlund <tege@gmplib.org>
8324 * tune/speed.c (routine): New entry for mpn_mul.
8325 * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Renamed from
8326 SPEED_ROUTINE_MPN_MUL_BASECASE.
8327 (speed_mpn_mul): Renamed from speed_mpn_mul_basecase.
8328 (SPEED_ROUTINE_MPN_MUL): Allocate our own memory of xp operand.
8330 * tune/common.c: Corresponding changes.
8332 2008-09-22 Niels Möller <nisse@lysator.liu.se>
8334 * mpn/generic/gcdext.c (hgcd_mul_matrix_vector): New function,
8335 replaces addmul2_n. Needs less copying.
8336 (mpn_gcdext): Use hgcd_mul_matrix_vector. Updated for interface
8337 change in mpn_gcdext_subdiv_step
8339 * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Rewritten to use
8340 mpn_hgcd_mul_matrix1_vector.
8341 (hgcd_step): Updated for interface change in
8342 mpn_hgcd_mul_matrix1_inverse_vector.
8344 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
8345 interface changes in mpn_hgcd_mul_matrix1_vector,
8346 mpn_hgcd_mul_matrix1_inverse_vector and mpn_gcdext_subdiv_step.
8348 * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Updated for
8349 interface change in mpn_hgcd_mul_matrix1_inverse_vector.
8351 * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): Use
8352 separate scratch arguments for the quotient and for the cofactor
8355 * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Interface
8356 change. Store first element in rp and leave ap unmodified. No
8357 additional scratch space or copying needed. Callers that require
8358 modification in place still need to copy one of the inputs.
8359 (mpn_hgcd_mul_matrix1_inverse_vector): Likewise.
8361 2008-09-22 Niels Möller <nisse@lysator.liu.se> <nisse@king.swox.se>
8363 * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Use mpn_addaddmul_1msb0.
8364 * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Likewise.
8366 * mpn/generic/gcd.c: Use libspeed for timing measurements.
8368 * gmp-impl.h: Declare mpn_addaddmul_1msb0.
8369 * mpn/asm-defs.m4: Added addaddmul_1msb0.
8370 * mpn/x86_64/addaddmul_1msb0.asm: New file.
8371 * configure.in (gmp_mpn_functions_optional): Added
8373 (HAVE_NATIVE): List addaddmul_1msb0.
8375 2008-09-21 Torbjorn Granlund <tege@gmplib.org>
8377 * mpn/generic/get_str.c (GET_STR_DC_THRESHOLD): Remove default.
8378 (GET_STR_PRECOMPUTE_THRESHOLD): Likewise.
8381 * gmp-impl.h (mpn_dc_set_str_itch): Allocate GMP_LIMB_BITS more limbs.
8384 * mpn/generic/set_str.c:
8385 (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
8387 2008-09-18 Torbjorn Granlund <tege@gmplib.org>
8389 * mpn/alpha/ev6/gmp-mparam.h (DIVEXACT_BY3_METHOD): Define.
8391 * mpn/ia64/diveby3.asm: Remove.
8392 * mpn/x86/diveby3.asm: Remove.
8393 * mpn/x86/k6/diveby3.asm: Remove.
8394 * mpn/x86/k7/diveby3.asm: Remove.
8395 * mpn/x86/p6/diveby3.asm: Remove.
8396 * mpn/x86/pentium/diveby3.asm: Remove.
8397 * mpn/x86_64/diveby3.asm: Remove.
8398 * mpn/x86/pentium4/sse2/diveby3.asm: Remove.
8400 * configure.in (HAVE_NATIVE): List divexact_by3c.
8402 * gmp-impl.h (mpn_divexact_by3c): Override gmp-h.in's definition.
8403 (DIVEXACT_BY3_METHOD): Don't default to 0 if
8404 HAVE_NATIVE_mpn_divexact_by3c.
8406 2008-09-18 Niels Möller <nisse@lysator.liu.se>
8408 * mpn/generic/gcd.c (main): Added code for tuning of CHOOSE_P.
8410 * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Assert that inputs are
8413 2008-09-17 Niels Möller <nisse@lysator.liu.se> <nisse@king.swox.se>
8415 * mpn/generic/gcdext.c (mpn_gcdext): p = n/5 caused a
8416 slowdown for large inputs. As a compromise, use p = n/2 for the
8417 first iteration, and p = n/3 for the rest. Handle the first
8418 iteration specially, since the initial u0 and u1 are trivial.
8420 * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
8423 * mpn/generic/gcdext.c (CHOOSE_P): New macro. Use p = n/5.
8424 (mpn_gcdext): Use CHOOSE_P, and generalized the calculation of
8427 * tune/tuneup.c (tune_hgcd): Use default step factor.
8429 * mpn/x86_64/gmp-mparam.h: (GCD_DC_THRESHOLD): Reduced from 493 to
8432 * mpn/generic/gcd.c (CHOOSE_P): New macro, to determine the
8433 split when calling hgcd. Use p = 2n/3, as that seems better than
8434 the more obvious split p = n/2.
8435 (mpn_gcd): Use CHOOSE_P, and generalized the calculation of
8438 2008-09-16 Torbjorn Granlund <tege@gmplib.org>
8440 * mpn/generic/toom_interpolate_7pts.c: Use new mpn_divexact_byN
8443 * gmp-impl.h (mpn_divexact_by3, mpn_divexact_by5, mpn_divexact_by7,
8444 mpn_divexact_by9, mpn_divexact_by11, mpn_divexact_by13,
8445 mpn_divexact_by15): New macros, defined in terms of mpn_bdiv_dbm1.
8447 * configure.in (gmp_mpn_functions): List bdiv_dbm1c.
8448 (HAVE_NATIVE): Likewise.
8449 * mpn/asm-defs.m4: Define bdiv_dbm1c.
8450 * gmp-impl.h (mpn_bdiv_dbm1c): Declare.
8451 (mpn_bdiv_dbm1): New macro.
8452 * mpn/generic/bdiv_dbm1c.c: New file.
8453 * mpn/alpha/bdiv_dbm1c.asm: New file.
8454 * mpn/ia64/bdiv_dbm1c.asm: New file.
8455 * mpn/powerpc32/bdiv_dbm1c.asm: New file.
8456 * mpn/powerpc64/mode64/bdiv_dbm1c.asm: New file.
8457 * mpn/x86/bdiv_dbm1c.asm: New file.
8458 * mpn/x86_64/bdiv_dbm1c.asm: New file.
8460 * mpn/generic/diveby3.c: Add mpn_bdiv_dbm1c based function.
8461 Choose function depending on DIVEXACT_BY3_METHOD.
8462 * gmp-impl.h (DIVEXACT_BY3_METHOD): Provide default.
8464 2008-09-16 Niels Möller <nisse@lysator.liu.se>
8466 * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Moved function to
8467 gcdext.c, where it is used.
8468 * mpn/generic/gcdext.c (addmul2_n): Moved and renamed, was
8469 mpn_hgcd_addmul2_n. Made static. Deleted input normalization.
8470 Deleted rn argument.
8471 (mpn_gcdext): Updated calls to addmul2_n, and added assertions.
8473 * gmp-impl.h (MPN_HGCD_MATRIX_INIT_ITCH): Increased storage by four limbs.
8474 (MPN_HGCD_LEHMER_ITCH): Reduced storage by one limb.
8475 (MPN_GCD_SUBDIV_STEP_ITCH): Likewise.
8476 (MPN_GCD_LEHMER_N_ITCH): Likewise.
8478 * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Use two extra limbs.
8479 (hgcd_step): Use overlapping arguments to mpn_tdiv_qr.
8480 (mpn_hgcd_matrix_mul): Deleted normalization code. Tigher bounds
8481 for the element size of the product. Needs two extra limbs of
8482 storage for the elements.
8483 (mpn_hgcd_itch): Updated storage calculation.
8485 * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Use
8486 overlapping arguments to mpn_tdiv_qr. Use mpn_zero_p.
8488 * mpn/generic/gcd.c (mpn_gcd): Use mpn_zero_p.
8490 2008-09-15 Niels Möller <nisse@lysator.liu.se>
8492 * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Updated for deleted
8494 (hgcd_matrix_update_q): Likewise.
8495 (mpn_hgcd_matrix_mul): Likewise.
8496 (mpn_hgcd_itch): Updated calculation of scratch space.
8498 * gmp-impl.h (struct hgcd_matrix): Deleted tp pointer.
8499 (MPN_HGCD_MATRIX_INIT_ITCH): Reduced storage.
8500 (mpn_hgcd_step, MPN_HGCD_STEP_ITCH): Deleted declarations.
8502 2008-09-15 Niels Möller <nisse@lysator.liu.se> <nisse@king.swox.se>
8504 * mpn/x86_64/gmp-mparam.h (MATRIX22_STRASSEN_THRESHOLD): New
8507 * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Use mpn_matrix22_mul.
8508 (mpn_hgcd_itch): Updated calculation of scratch space. Use
8509 count_leading_zeros to get the recursion depth.
8511 * mpn/generic/gcd.c (mpn_gcd): Fixed calculation of scratch space,
8512 and use mpn_hgcd_itch.
8514 2008-09-15 Niels Möller <nisse@lysator.liu.se>
8516 * tune/tuneup.c (tune_matrix22_mul): New function.
8519 * tune/common.c (speed_mpn_matrix22_mul): New function.
8521 * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added matrix22_mul.c.
8523 * tests/mpn/t-matrix22.c: Use MATRIX22_STRASSEN_THRESHOLD to
8524 select sizes for tests.
8526 * gmp-impl.h (MATRIX22_STRASSEN_THRESHOLD): New threshold
8528 * configure.in (gmp_mpn_functions): Added matrix22_mul.
8529 * gmp-impl.h: Added declarations for mpn_matrix22_mul and related
8532 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
8534 * tests/mpn/Makefile.am (check_PROGRAMS): Added t-matrix22.
8536 * tests/mpn/t-matrix22.c: New file.
8537 * mpn/generic/matrix22_mul.c: New file.
8539 2008-09-11 Niels Möller <nisse@king.swox.se>
8541 * tune/tuneup.c: Updated tuning of gcdext.
8543 * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
8546 2008-09-11 Niels Möller <nisse@lysator.liu.se>
8548 * gmp-impl.h: Updated for gcdext changes.
8549 (GCDEXT_DC_THRESHOLD): New constant, renamed from
8550 GCDEXT_SCHOENHAGE_THRESHOLD.
8552 * mpn/generic/gcdext.c (compute_v): Accept non-normalized a and b
8554 (mpn_gcdext): Rewrote and simplified. Now uses the new mpn_hgcd
8557 * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Renamed from addmul2_n
8558 and made non-static. Changed interface to take non-normalized
8559 inputs, and only two size arguments.
8560 (mpn_hgcd_matrix_mul): Simplified using new mpn_hgcd_addmul2_n.
8562 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): Deleted
8564 (mpn_gcdext_lehmer_n): Renamed from mpn_gcd_lehmer. Now takes
8565 inputs of equal size. Moved the code for the division step to a
8566 separate function...
8567 * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): New
8570 * configure.in (gmp_mpn_functions): Added gcdext_subdiv_step.
8572 2008-09-10 Torbjorn Granlund <tege@gmplib.org>
8574 * tests/devel/anymul_1.c: Include <string.h>.
8576 * gmp-h.in: Unconditionally include <cstdio>.
8578 2008-09-10 Niels Möller <nisse@lysator.liu.se>
8580 * tune/common.c: #if:ed out speed_mpn_gcd_binary and
8581 speed_mpn_gcd_accel.
8582 * tune/speed.c (routine): #if:ed out mpn_gcd_binary, mpn_gcd_accel
8584 * tune/Makefile.am (libspeed_la_SOURCES): Removed gcd_bin.c
8585 gcd_accel.c gcd_finda_gen.c.
8586 * tune/tuneup.c: Enable tuning of GCD_DC_THRESHOLD.
8588 * mpn/generic/gcd.c (mpn_gcd): Rewrote and simplified. Now uses
8589 the new mpn_hgcd interface.
8591 * */gmp-mparam.h: Renamed GCD_SCHOENHAGE_THRESHOLD to
8594 * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Renamed (was
8595 mpn_gcd_lehmer). Now takes inputs of equal size.
8597 * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer): Reintroduced gcd_2,
8598 to get better performance for small inputs.
8600 * mpn/generic/hgcd.c: Don't hardcode small HGCD_THRESHOLD.
8601 * mpn/x86_64/gmp-mparam.h (HGCD_THRESHOLD): Reduced from 145 to
8603 * */gmp-mparam.h: Renamed HGCD_SCHOENHAGE_THRESHOLD to
8606 2008-09-09 Torbjorn Granlund <tege@gmplib.org>
8608 * doc/gmp.texi: Fix a typo and clarify mpn_gcdext docs.
8610 2008-09-09 Niels Möller <nisse@lysator.liu.se>
8612 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Adapted
8613 to new hgcd interface.
8615 * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): New macro.
8617 * hgcd.c (mpn_hgcd_lehmer): Renamed function, from hgcd_base. Made
8620 * gcd_lehmer.c (mpn_gcd_lehmer): Use hgcd2 also for n == 2.
8622 * gcdext_lehmer.c (mpn_gcdext_lehmer): Simplified code for
8623 division step. Added proper book-keeping of swaps, which affect
8624 the sign of the returned cofactor.
8626 * tests/mpz/t-gcd.c (one_test): Display co-factor when mpn_gcdext
8629 * gcd_lehmer.c (mpn_gcd_lehmer): At end of loop, need to handle
8630 the special case n == 1 correctly.
8632 * gcd_subdiv_step.c (mpn_gcd_subdiv_step): Simplified function.
8633 The special cancellation logic is not needed here.
8635 2008-09-08 Torbjorn Granlund <tege@gmplib.org>
8637 * mpn/generic/invert.c: Add working but slow code.
8639 * mpn/x86_64/x86_64-defs.m4 (R32, R8): New macros.
8641 * mpn/ia64/submul_1.asm: Move some labels for broader assembler
8644 * gmp-impl.h (mpn_mul_3, mpn_mul_4): Declare.
8645 * tests/tests.h (refmpn_mul_3, refmpn_mul_4): Declare.
8646 * tests/try.c (param_init): Set things up for mpn_mul_3 and mpn_mul_4.
8647 (choice_array): Likewise.
8649 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES):
8650 Add mul_3.c and mul_4.
8651 * mpn/asm-defs.m4: Define mul_3 and mul_4.
8652 * tests/refmpn.c (refmpn_mul_N): New function.
8653 (refmpn_mul_2): Remove old definition, call refmpn_mul_N.
8654 (refmpn_mul_3, refmpn_mul_4): New functions.
8655 * tune/common.c (speed_mpn_mul_3, speed_mpn_mul_4): New functions.
8656 * tune/speed.h (speed_mpn_mul_3, speed_mpn_mul_4): Declare.
8657 * tune/speed.c (routine): New entries for mpn_mul_2 and mpn_mul_3.
8659 * ltmain.sh: Update to libtool 1.5.24.
8661 * mpn/generic/mul_toom22.c: Compute s and t more cleverly.
8663 2008-09-08 Niels Möller <nisse@lysator.liu.se>
8665 * tests/mpn/t-hgcd.c: Updated tests. Rewrite of hgcd_ref.
8667 * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): New function.
8668 (mpn_gcdext_lehmer): Various bugfixes.
8670 * gcdext.c (mpn_gcdext): Allocate scratch space for gcdext_lehmer.
8672 * mpn/generic/gcd_lehmer.c (gcd_2): ASSERT that inputs are odd.
8673 (mpn_gcd_lehmer): Added tp argument, for scratch space. Make both
8674 arguments odd before calling gcd_2.
8676 * mpn/generic/hgcd.c (mpn_hgcd): Allow the trivial case n <= 2,
8677 and return 0 immediately.
8679 * gmp-impl.h (MPN_EXTRACT_NUMB): New macro.
8681 * configure.in (gmp_mpn_functions): Added gcdext_lehmer.
8683 2008-09-05 Torbjorn Granlund <tege@gmplib.org>
8685 * mpn/generic/toom_interpolate_7pts.c: Use mpn_divexact_by3c instead of
8688 * doc/texinfo.tex: Update to 2007-06-29.13.
8690 * doc/gmp.texi: Update GMP site URL. Fix some typos.
8692 * demos/pexpr.c (main): Allow bases up to 62.
8694 * gmp-impl.h: Remove formal parameter names from function prototypes.
8696 * config.guess: Recognize recent AMD and Itanium CPUs.
8697 Default X86 CPU recognition to configfsf.guess' value.
8699 * configure.in: Handle core2 separately from athlon64.
8701 2008-09-05 Niels Möller <nisse@lysator.liu.se>
8703 * */Makefile.in, configure, aclocal.m4, config.in: Removed files
8704 from repository. They're instead generated by automake and
8705 autoconf before distribution.
8707 2008-08-25 Torbjorn Granlund <tege@gmplib.org>
8709 * mpf/set_str.c: Allocate mantissa space based on mantissa size,
8710 not on destination variable space.
8711 * mpf/set_str.c: Accept unary plus before exponent.
8713 2008-08-06 Torbjorn Granlund <tege@gmplib.org>
8715 * mpn/generic/mul_toom22.c: Add statistics gathering functionality,
8716 triggered by cpp predef STAT.
8719 * mpn/generic/mul_toom22.c: Decrease scratch space usage.
8721 2008-08-02 Torbjorn Granlund <tege@gmplib.org>
8723 * tests/misc/t-scanf.c: Avoid negative arguments to _ui functions.
8724 * tests/misc/t-printf.c: Likewise.
8726 * acinclude.m4 (X86_PATTERN): Add geode.
8728 * acinclude.m4 (CL_AS_NOEXECSTACK): Avoid -q flag to grep.
8730 2008-08-01 Torbjorn Granlund <tege@gmplib.org>
8732 * acinclude.m4 (CL_AS_NOEXECSTACK): New.
8733 * configure.in: Use CL_AS_NOEXECSTACK.
8734 * mpn/Makeasm.am: Use ASM_FLAGS (defined by CL_AS_NOEXECSTACK).
8736 * gmpxx.h (__GMP_DBL_LIMBS): Use DBL_MAX_EXP instead of
8737 std::numeric_limits<double>::max_exponent for better portability.
8739 2008-07-29 Torbjorn Granlund <tege@gmplib.org>
8741 * gmpxx.h (__GMP_DBL_LIMBS): New #define.
8742 (__GMP_ULI_LIMBS): New #define.
8743 (__GMPXX_TMP_UI): New macro.
8744 (__GMPXX_TMP_SI): New macro.
8745 (__GMPXX_TMP_D): New macro.
8746 (struct __gmp_binary_and): Rewrite, using the new macros.
8747 (struct __gmp_binary_ior): Likewise.
8748 (struct __gmp_binary_xor): Likewise.
8750 2008-07-28 Torbjorn Granlund <tege@gmplib.org>
8752 * tests/cxx/t-binary.cc: Add some tests for logical operations.
8754 2008-07-24 Torbjorn Granlund <tege@gmplib.org>
8756 * gmpxx.h: Use __GMPZ_* instead of __GMPZZ_* for bitwise ops, remove
8758 Remove repeated #undefs.
8759 (__gmp_alloc_cstring): Declare freefunc as extern "C".
8761 2008-07-23 Torbjorn Granlund <tege@gmplib.org>
8763 * gmp-h.in (__GMP_CC): New define, undocumented for now.
8764 (__GMP_CFLAGS): Likewise.
8766 2008-07-21 Torbjorn Granlund <tege@gmplib.org>
8768 * tests/amd64check.c: Fix a printf type clash.
8770 * mpz/realloc.c: Amend last fix.
8772 * gmp-h.in: Include <cstdlib> for C++.
8773 * gmp-h.in: Handle new gcc 4.3 inline semantics defaults.
8775 * configfsf.guess: Update to version of 2008-04-14.
8776 * configfsf.sub: Update to version of 2008-06-16.
8778 * configure.in: Separate core2 and athlon64 flags handling.
8780 2008-06-19 Torbjorn Granlund <tege@gmplib.org>
8782 * config.guess: Recognize pentiumm and AMD geode.
8783 * config.sub: Likewise.
8784 * configure.in: Likewise.
8786 2008-06-02 Torbjorn Granlund <tege@gmplib.org>
8788 * configure.in: Disallow odd nails sizes.
8789 * configure.in: Inherit default gcc_cflags/gcc_64_cflags everywhere.
8791 2008-05-23 Torbjorn Granlund <tege@gmplib.org>
8793 * mpz/init2.c: Rewrite to avoid internal overflow and to detect mpz_t
8795 * mpz/realloc2.c: Likewise.
8796 * mpz/realloc.c: Detect mpz_t overflow.
8798 2008-05-22 Torbjorn Granlund <tege@gmplib.org>
8800 * configure.in (sparc): Remove -fast, it causes documented
8803 * config.guess: Properly handle the "extended" variants of x86 cpuid.
8805 2008-05-09 Torbjorn Granlund <tege@gmplib.org>
8807 * gmp-impl.h (mpn_mul_fft): Now void.
8808 (udiv_qrnnd_preinv3): Special case for constant (nl).
8810 2008-05-08 Torbjorn Granlund <tege@gmplib.org>
8812 * mpn/generic/mul_fft.c: Clean up types in TRACE (printf (...)).
8813 (TRACE): Redefine to allow command line control.
8814 (mpn_mul_fft_internal): Now void, remove return value.
8815 (mpn_mul_fft): Likewise.
8816 (MPN_FFT_TABLE2_SIZE): Up size fro 256 to 512.
8817 (mpn_fft_fft): Call mpn_fft_mul_2exp_modF just once instead of twice,
8818 then add/subtract result. Get rid of temp allocation as a result.
8819 Remove some redundant CNST_LIMB.
8820 (mpn_fft_fftinv): Analogous changes.
8821 (mpn_fft_sub_modF): Re-enable, now needed by mpn_fft_fft and
8824 2008-03-10 Torbjorn Granlund <tege@gmplib.org>
8826 * tests/mpz/t-mul.c (main): Let GMP_CHECK_FFT mean largest allowed
8827 power-of-2 of test operands.
8829 2008-02-28 Torbjorn Granlund <tege@gmplib.org>
8831 * tests/cxx/t-binary.cc (check_mpz): Expect floor rounding for right
8834 2008-02-27 Torbjorn Granlund <tege@gmplib.org>
8836 * mpz/mul_i.h: Check sml's size (not the signed small_mult).
8838 * longlong.h (umul_ppmm) [alpha]: Define using __builtin_alpha_umulh
8841 * longlong.h (count_trailing_zeros): Force destination register mode.
8843 * gmpxx.h (struct __gmp_binary_rshift): Use floor rounding, not
8846 * gmpxx.h (__gmp_binary_and, __gmp_binary_ior, __gmp_binary_xor):
8847 Add variants with unsigned long int argument.
8849 * config.sub: Recog geode.
8850 * config.guess: Likewise.
8851 * acinclude.m4 (X86_PATTERN): Likewise.
8853 2008-02-10 Torbjorn Granlund <tege@gmplib.org>
8855 * mpn/x86/p6/aors_n.asm: Use Zdisp to work around GNU as bug.
8856 * mpn/x86/x86-defs.m4 (Zdisp): Add more instructions.
8858 2008-02-08 Torbjorn Granlund <tege@gmplib.org>
8860 * mpn/x86_64/aors_n.asm: New file.
8861 * mpn/x86_64/add_n.asm: Delete.
8862 * mpn/x86_64/sub_n.asm: Delete.
8864 2008-02-07 Torbjorn Granlund <tege@gmplib.org>
8866 * mpn/x86/k6/mmx/dive_1.asm: Fix typo in last change.
8868 2007-12-10 Torbjorn Granlund <tege@swox.com>
8870 * mpf/set_str.c (mpf_set_str): Write own code for converting the
8871 exponent, avoids strtol base < 36 limitation.
8873 2007-10-28 Torbjorn Granlund <tege@swox.com>
8875 * gmp-impl.h (mpn_dc_get_str_itch): New macro.
8876 (mpn_dc_get_str_powtab_alloc): New macro.
8877 (struct powers): Add field "shift".
8879 * mpn/generic/get_str.c: Compute powers without low zero limbs; all
8880 functions modified. Correct temporary allocation. Misc cleanups.
8882 * mpn/generic/set_str.c: Compute powers without low zero limbs; all
8884 (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
8886 2007-10-26 Torbjorn Granlund <tege@swox.com>
8888 * mpn/generic/set_str.c: Remove default thresholds, not in gmp-impl.h.
8889 (mpn_dc_set_str): Insert ASSERT_ALWAYS in a presumably dead code arm.
8891 2007-10-22 Torbjorn Granlund <tege@swox.com>
8893 * gmp-impl.h (mpn_add_nc): Define as inline function, unless NATIVE.
8894 (mpn_sub_nc): Likewise.
8896 2007-10-17 Torbjorn Granlund <tege@swox.com>
8898 * tests/misc/t-printf.c: Fix a printf type clash.
8899 * tests/mpq/t-get_str.c: Likewise.
8900 * tests/mpz/t-import.c: Likewise.
8902 * acinclude.m4: Conditionally disable some tests when compiled by a C++
8905 * gmp-impl.h (udiv_qrnnd_preinv3): Remove an unused variable.
8907 * mpn/generic/hgcd.c: Add some WANT_ASSERTs to shut up warnings.
8909 2007-10-08 Torbjorn Granlund <tege@swox.com>
8911 * mpn/powerpc64/elf.m4 (LEAL): Define as an alias for LEA.
8912 * mpn/powerpc32/darwin.m4 (LEAL): Likewise.
8913 * mpn/powerpc64/aix.m4: Likewise.
8915 * mpn/powerpc64/vmx/popcount.asm: Use LEAL.
8917 * mpn/powerpc64/darwin.m4 (LEAL): New name for LEA, since it is only
8918 usable for local symbols.
8919 (LEA): Replace with code for external references.
8921 * mpn/powerpc32/vmx/mod_34lsub1.asm: Use LEAL.
8923 2007-10-07 Torbjorn Granlund <tege@swox.com>
8925 * mpn/x86/dive_1.asm: Use LEA, remove explicit movl_eip_*.
8926 * mpn/x86/k6/mode1o.asm: Likewise.
8927 * mpn/x86/k6/mmx/dive_1.asm: Likewise.
8928 * mpn/x86/k7/dive_1.asm: Likewise.
8929 * mpn/x86/k7/mode1o.asm: Likewise.
8930 * mpn/x86/p6/dive_1.asm: Likewise.
8931 * mpn/x86/p6/mode1o.asm: Likewise.
8932 * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
8933 * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
8934 * mpn/x86/pentium4/sse2/popcount.asm: Likewise.
8936 * mpn/x86/p6/aors_n.asm: Table cycle counts.
8938 * mpn/x86/k7/mod_34lsub1.asm: Fix over-optimistic cycle count claims.
8940 * mpn/x86/x86-defs.m4 (DEF_OBJECT, END_OBJECT): New define's.
8942 * mpn/x86/darwin.m4 (LEA): Put also movl_eip_XX into EPILOGUE_cpu.
8943 Expect target register to have prepended %.
8945 * mpn/x86_64/add_n.asm: Use L() for labels.
8946 * mpn/x86_64/addlsh1_n.asm: Likewise.
8947 * mpn/x86_64/addmul_2.asm: Likewise.
8948 * mpn/x86_64/aorrlsh_n.asm: Likewise.
8949 * mpn/x86_64/aorsmul_1.asm: Likewise.
8950 * mpn/x86_64/com_n.asm: Likewise.
8951 * mpn/x86_64/copyd.asm: Likewise.
8952 * mpn/x86_64/copyi.asm: Likewise.
8953 * mpn/x86_64/diveby3.asm: Likewise.
8954 * mpn/x86_64/logops_n.asm: Likewise.
8955 * mpn/x86_64/lshsub_n.asm: Likewise.
8956 * mpn/x86_64/mul_1.asm: Likewise.
8957 * mpn/x86_64/mul_2.asm: Likewise.
8958 * mpn/x86_64/mul_basecase.asm: Likewise.
8959 * mpn/x86_64/popham.asm: Likewise.
8960 * mpn/x86_64/redc_1.asm: Likewise.
8961 * mpn/x86_64/rsh1add_n.asm: Likewise.
8962 * mpn/x86_64/rsh1sub_n.asm: Likewise.
8963 * mpn/x86_64/rshift.asm: Likewise.
8964 * mpn/x86_64/sub_n.asm: Likewise.
8965 * mpn/x86_64/sublsh1_n.asm Likewise.
8966 * mpn/x86_64/pentium4/aors_n.asm: Likewise.
8967 * mpn/x86_64/pentium4/lshift.asm: Likewise.
8968 * mpn/x86_64/pentium4/rshift.asm: Likewise.
8970 * mpn/x86_64/x86_64-defs.m4: New file, defining LEA, DEF_OBJECT, and
8973 * mpn/generic/mul.c: Put TMP_DECL as last decl.
8975 2007-10-06 Torbjorn Granlund <tege@swox.com>
8977 * mpn/x86/pentium4/sse2/popcount.asm: New file.
8979 2007-09-26 Torbjorn Granlund <tege@swox.com>
8981 * mpz/get_str.c: Cast a char index to int to shut up compilers.
8983 * mpn/generic/dc_div_qr.c: Pass dummy scratch argument to mpn_invert.
8984 * mpn/generic/dc_divappr_q.c: Likewise.
8985 * mpn/generic/mu_div_qr.c: Likewise.
8986 * mpn/generic/mu_divappr_q.c: Likewise.
8987 * mpn/generic/mu_div_q.c: Likewise.
8988 * mpn/generic/divexact.c: Likewise.
8990 * mpn/generic/invert.c: New file, placeholder for now.
8992 2007-09-24 Torbjorn Granlund <tege@swox.com>
8994 * mpn/generic/toom_interpolate_5pts.c: New file, contents from
8996 * mpn/generic/mul_n.c (mpn_toom3_interpolate): Function removed.
8998 * mpn/generic/toom_interpolate_7pts.c: New file.
9000 * mpn/x86/k7/mmx/popham.asm: Table cycle counts.
9002 * mpn/x86/k6/README: Update URLs.
9004 * mpn/powerpc32/README: Update URL's, company names.
9006 * mpn/generic/get_d.c: Complete rewrite.
9008 * mpn/generic/mul_toom33.c: New file.
9010 * mpn/generic/mul_toom22.c: Make orthogonal with other toomXY files.
9011 * mpn/generic/mul_toom32.c: Likewise.
9012 * mpn/generic/mul_toom42.c: Likewise.
9014 * mpn/alpha/invert_limb.asm: Update cycle counts. Fix a comment typo.
9016 * mpf/get_str.c: Include stdlib.h, not stdio.h for NULL.
9018 * doc/gmp.texi: Fix a typo.
9020 * memory.c (__gmp_default_allocate, __gmp_default_reallocate):
9021 Cast size operands in error fprintf's.
9023 * longlong.h (sub_ddmmss) [powerpc 64]: Add more variants for constant
9026 * gmp-impl.h (udiv_qrnnd_preinv3): New define.
9027 * gmp-impl.h (ULONG_PARITY): Exclude masquerading __INTEL_COMPILER from
9030 * gmp-h.in (mpn_neg_n): New function.
9032 2007-09-18 Torbjorn Granlund <tege@swox.com>
9034 * demos/pexpr.c (main): Add -v option.
9035 (enum op_t): New tag TIMING.
9036 (mpz_eval_expr): Execute TIMING.
9037 (fns): Add TIMING entry.
9039 * gmp-impl.h: Add decls and THRESHOLDs for new toom multiplication
9040 functions and division functions.
9042 2007-09-10 Torbjorn Granlund <tege@swox.com>
9044 * mpn/powerpc32/addlsh1_n.asm: Use L() for labels.
9045 * mpn/powerpc32/sublsh1_n.asm: Likewise.
9047 2007-09-09 Torbjorn Granlund <tege@swox.com>
9049 * mpn/x86/x86-defs.m4 (LEA): New define.
9050 * mpn/x86/darwin.m4: New file, for now just defining LEA.
9051 * configure.in: Pick up x86/darwin.m4.
9052 * mpn/x86/*: Use LEA for PIC references.
9054 * configure.in: For X86/32, treat core2 like pentium3.
9056 2007-09-06 Torbjorn Granlund <tege@swox.com>
9058 * tests/amd64check.c (calling_conventions_values): Put constants,
9059 dynamic values in this array (was in scalars).
9060 (calling_conventions_check): Corresponding changes.
9061 * tests/amd64call.asm: Rewrite to be PIC, smaller, using amd64check.c's
9064 2007-09-04 Torbjorn Granlund <tege@swox.com>
9066 * mpn/x86/pentium4/sse2/mul_basecase.asm: Misc cleanups.
9067 * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
9069 * mpn/x86_64/mod_34lsub1.asm: Optimize loop, reduce code size.
9071 * tests/amd64call.asm: Remove bogus no-op moves.
9073 2007-09-03 Torbjorn Granlund <tege@swox.com>
9075 From Richard Guenther:
9076 * gmp-h.in (__GMP_EXTERN_INLINE): Declare conditionally on
9077 __GNUC_STDC_INLINE__.
9079 * tests/cxx/t-locale.cc: #include <cstdlib>, for abort.
9081 * mpn/x86_64/core2/popcount.asm: New file.
9082 * mpn/x86_64/pentium4/popcount.asm: New file.
9084 * mpn/x86_64/addmul_2.asm: New file.
9085 * mpn/x86_64/mul_2.asm: New file.
9087 * mpn/x86_64/aorsmul_1.asm: Use 32-bit mov for zeroing registers
9090 2007-09-01 Torbjorn Granlund <tege@swox.com>
9092 * configure.in: Handle athlon64, core2, and pentium4 separately for
9095 * config.sub: Recog athlon64, core2, and opteron.
9097 * config.guess: Do two x86 variants, for 32-bit ABI and 64-bit ABI.
9098 Return "athlon64" and "core2", not x86_64.
9100 2007-08-31 Torbjorn Granlund <tege@swox.com>
9102 From Patrick Pelissier:
9103 * gmp-h.in: Don't refer to FILE from C++ unless we've seen FILE.
9105 2007-08-30 Torbjorn Granlund <tege@swox.com>
9107 * demos/isprime.c: Include string.h for strcmp.
9109 * demos/factorize.c (main): Declare to int.
9111 2007-06-22 Torbjorn Granlund <tege@swox.com>
9113 * mpn/x86_64/pentium4/lshift.asm: Minor tuning.
9114 * mpn/x86_64/pentium4/rshift.asm: Likewise.
9116 2007-05-30 Torbjorn Granlund <tege@swox.com>
9118 * mpn/powerpc64/mode64/aors_n.asm: Add _nc entry points.
9120 2007-05-22 Torbjorn Granlund <tege@swox.com>
9122 * tests/memory.c: Cast calls to new mem* calls to avoid unaligned ops.
9124 2007-05-16 Torbjorn Granlund <tege@swox.com>
9126 * tests/mpz/convert.c: Tweak operand sizes for best coverage.
9128 * tests/memory.c: Add red zones around allocations.
9130 2007-05-15 Torbjorn Granlund <tege@swox.com>
9132 * mpn/ia64/mul_1.asm: Make mul_1c entry point actually work.
9134 * mpn/generic/set_str.c (mpn_dc_set_str): Avoid calling mpn_add_n when
9137 * tests/mpz/convert.c (string_urandomb): New function.
9138 (main): Use it by enabling ifdef'ed out code.
9140 2007-04-30 Torbjorn Granlund <tege@swox.com>
9142 * mpn/x86_64/mul_basecase.asm: Complete rewrite.
9144 * mpn/x86_64/copyi.asm: Use short shift-by-one form. Misc cleanups.
9145 * mpn/x86_64/copyi.asm: Likewise.
9146 * mpn/x86_64/popham.asm: Likewise.
9148 * mpn/x86_64/aorsmul_1.asm: Cleanup formatting.
9150 2007-04-25 Torbjorn Granlund <tege@swox.com>
9152 * mpz/divexact.c: Handle undefined case of |N| < |D| to avoid segfaults.
9154 2007-02-24 Torbjorn Granlund <tege@swox.com>
9156 * doc/gmp.texi (Toom 3-Way Multiplication): Fix typo.
9157 (mpz_scan0, mpz_scan1): Fix typos.
9158 (Float Internals): Rewrite paragraph about struct types.
9160 2007-02-12 Torbjorn Granlund <tege@swox.com>
9162 * mpn/x86/pentium4/sse2/sqr_basecase.asm: Complete rewrite (except
9165 2007-02-05 Torbjorn Granlund <tege@swox.com>
9167 * mpn/generic/mul_fft.c (mpn_fft_fft): New name for mpn_fft_fft_sqr,
9168 old mpn_fft_fft removed.
9169 (mpn_mul_fft_internal): Call mpn_fft_fft separately for each operand.
9170 (mpn_fft_add_modF): Rewrite to avoid random branches.
9171 (mpn_fft_sub_modF): Likewise.
9173 * mpn/x86/pentium4/sse2/addmul_1.asm: Complete rewrite.
9174 * mpn/x86/pentium4/sse2/mul_1.asm: Complete rewrite.
9175 * mpn/x86/pentium4/sse2/mul_basecase.asm: Complete rewrite, based on
9176 new addmul and mul code.
9178 2007-01-31 Torbjorn Granlund <tege@swox.com>
9180 * mpn/generic/get_str.c (mpn_sb_get_str): Get loop count for frac
9183 * mpn/powerpc32/vmx/mod_34lsub1.asm: New file.
9185 * mpn/powerpc32/aors_n.asm: New file, complete rewrite.
9186 * mpn/powerpc32/add_n.asm: Remove.
9187 * mpn/powerpc32/sub_n.asm: Remove.
9189 2007-01-25 Torbjorn Granlund <tege@swox.com>
9191 * mpn/x86_64/core2/aors_n.asm: Add _nc entry points, minor cleanups.
9193 * mpn/x86_64/core2/lshift.asm: Rewrite.
9194 * mpn/x86_64/core2/rshift.asm: Rewrite.
9196 * mpn/x86_64/pentium4/lshift.asm: Swap some loop insns for a small
9198 * mpn/x86_64/pentium4/rshift.asm: New file, based on lshift.asm.
9200 * mpn/x86_64/pentium4/gmp-mparam.h: New file.
9202 * mpn/x86_64/pentium4/aors_n.asm: Complete rewrite of add/subtract
9204 * mpn/x86_64/pentium4/add_n.asm: Remove.
9205 * mpn/x86_64/pentium4/sub_n.asm: Remove.
9207 2007-01-20 Torbjorn Granlund <tege@swox.com>
9209 * mpn/x86_64/lshift.asm: Add special case for cnt=1.
9211 2007-01-19 Torbjorn Granlund <tege@swox.com>
9213 * mpn/x86_64/aorsmul_1.asm: New file, written from scratch, finally at
9214 3.0 c/l on K8 (addmul_1 was 3.3; submul_1 was 3.5).
9215 * mpn/x86_64/addmul_1.asm: Remove.
9216 * mpn/x86_64/submul_1.asm: Remove.
9218 2006-12-29 Torbjorn Granlund <tege@swox.com>
9220 * randmt.c (__gmp_randclear_mt): Initialize ALLOC field, like in
9221 __gmp_randinit_mt_noseed.
9222 (__gmp_randclear_mt, __gmp_randinit_mt_noseed): Make similar functions
9224 (__gmp_randclear_mt): Pass actually allocated size.
9226 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mul_toom22.c,
9227 mul_toom32.c, mul_toom42.c.
9229 * configure.in: Recognize athlon64 and core2 as alternatives to x86_64.
9230 Provide special settings for core2.
9232 * configure.in (gmp_mpn_functions): Add mul_toom22, mul_toom32,
9235 * mpn/generic/mul_toom22.c: New file.
9236 * mpn/generic/mul.c: Use mpn_mul_toom22. Trim cutoff points between
9237 the mpn_mul_toomN2 functions. Handle balanced operands at function
9240 2006-12-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
9242 * mpn/generic/mul_n.c: Rewrite interpolation code.
9244 2006-12-28 Torbjorn Granlund <tege@swox.com>
9246 * mpn/generic/mul_toom32.c: New file.
9247 * mpn/generic/mul_toom42.c: New file.
9248 * mpn/generic/mul.c: Use mpn_mul_toom32 and mpn_mul_toom42 for
9249 unbalanced operands.
9251 2006-12-17 Torbjorn Granlund <tege@swox.com>
9253 * mpn/x86_64/aorrlsh_n.asm: New file.
9254 * mpn/x86_64/lshsub_n.asm: New file.
9256 * mpn/x86_64/core2/aors_n.asm: New file.
9257 * mpn/x86_64/core2/lshift.asm: New file.
9258 * mpn/x86_64/core2/rshift.asm: New file.
9260 * mpn/x86/p6/aors_n.asm: Replace K7 grabbing code with P6 specific
9263 * mpn/x86/p6/lshsub_n.asm: New file.
9265 2006-11-23 Torbjorn Granlund <tege@swox.com>
9267 * tune/speed.h (SPEED_ROUTINE_MPN_MUL_BASECASE): Allocate space for xp
9268 locally, s->xp might be insufficient.
9270 2006-11-22 Torbjorn Granlund <tege@swox.com>
9272 * randmt.c (__gmp_randinit_mt_noseed): Initialize ALLOC field of result
9275 2006-11-06 Torbjorn Granlund <tege@swox.com>
9277 * tune/set_strp.c: New file.
9279 2006-11-04 Torbjorn Granlund <tege@swox.com>
9281 * extract-dbl.c: Rewrite to handle nails better, and for general
9284 * mpz/bin_uiui.c: Simplify.
9286 * longlong.h (umul_ppmm) [mmix]: New.
9288 * tune/tuneup.c, tune/common.c, tune/speed.c, tune/speed.h,
9289 tune/set_strb.c, tune/set_strs.c: Add tuning and speed measurements
9290 of separate SET_STR_DC_THRESHOLD and SET_STR_PRECOMPUTE_THRESHOLD.
9291 Add tuning and speed measurement of mpn_addsub_n.
9293 2006-10-31 Torbjorn Granlund <tege@swox.com>
9295 * gmpxx.h: Remove ternary stuff, it is hardly an optimization and it
9296 writes to destination before reading all source operands.
9298 2006-10-25 Torbjorn Granlund <tege@swox.com>
9300 * mpn/generic/set_str.c: Complete rewrite.
9301 * mpn/generic/get_str.c: Likewise.
9303 * gmp-impl.h (struct powers, powers_t): New types.
9304 Restructure GET_STR_* and SET_STR_* thresholds.
9306 2006-09-21 Torbjorn Granlund <tege@swox.com>
9308 * mpn/generic/rootrem.c: Remove some redundant casts.
9310 2006-07-12 Torbjorn Granlund <tege@swox.com>
9312 * mpn/alpha/ev6/nails/addmul_2.asm: Make it run at claimed speed.
9313 * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
9315 * mpf/get_str.c: Avoid copying result when not needed. Misc cleanups.
9317 * tests/amd64call.asm: Use jmp instead of jmpq to placate Solaris.
9319 2006-06-30 Torbjorn Granlund <tege@swox.com>
9321 * configure.in (powerpc-*): Remove repeated path component.
9323 2006-06-15 Torbjorn Granlund <tege@swox.com>
9325 * configure.in: (ia64-*-linux*): Don't use -O3.
9327 2006-06-14 Torbjorn Granlund <tege@swox.com>
9329 * mpq/get_str.c: Fix upper base limit boundary in an ASSERT.
9331 * tests/refmpn.c (refmpn_sb_divrem_mn): Use ASSERT_CARRY for add-back.
9333 2006-05-31 Torbjorn Granlund <tege@swox.com>
9335 * tests/mpz/t-set_d.c (check_data): Add more data points.
9337 * mpz/set_d.c: Handle negative return values from __gmp_extract_double.
9339 2006-05-17 Torbjorn Granlund <tege@swox.com>
9341 * configure.in: Clear out gcc_cflags_cpu and gcc_cflags_arch for a fat
9344 2006-05-16 Torbjorn Granlund <tege@swox.com>
9346 * demos/primes.c (find_primes): Increase mpz_probab_prime_p cnt to 10.
9348 * mpn/generic/addsub_n.c: Fix criteria form when to call _nc functions.
9350 2006-05-12 Torbjorn Granlund <tege@swox.com>
9352 * config.guess: Recognize more ppc processor types.
9354 2006-05-11 Torbjorn Granlund <tege@swox.com>
9356 * tune/speed.c (usage): Update URL for gnuplot and quickplot.
9358 2006-05-10 Torbjorn Granlund <tege@swox.com>
9360 * configure.in (powerpc-*-*): Pass -maltivec to assembler for
9363 2006-05-08 Torbjorn Granlund <tege@swox.com>
9365 * mpn/powerpc32/aix.m4 (LEA): Remove [RW] attribute.
9367 2006-05-03 Torbjorn Granlund <tege@swox.com>
9369 * mpn/powerpc64/vmx/popcount.asm: Conditionally zero extend n.
9371 2006-04-27 Torbjorn Granlund <tege@swox.com>
9373 * mpz/divexact.c: Call mpz_tdiv_q for large operands.
9375 * configure.in (powerpc-*-darwin): Remove -fast, it affects PIC.
9377 2006-04-26 Torbjorn Granlund <tege@swox.com>
9379 * config.guess: Try to recognize Ultrasparc T1 (as ultrasparct1).
9380 * config.sub: Handle ultrasparct1.
9382 2006-04-25 Torbjorn Granlund <tege@swox.com>
9384 * mpn/sparc64/gmp-mparam.h: Retune, without separation of GNUC and
9387 2006-04-20 Torbjorn Granlund <tege@swox.com>
9389 * tests/mpz/convert.c: Increase operands range.
9391 2006-04-19 Torbjorn Granlund <tege@swox.com>
9393 * configure.in: Support powerpc eABI.
9394 * mpn/powerpc32/eabi.m4: New file.
9396 * configure.in: Support powerpc *bsd.
9397 * mpn/powerpc64/elf.m4: New name for mpn/powerpc64/linux64.m4.
9398 * mpn/powerpc32/elf.m4: New name for mpn/powerpc32/linux.m4.
9400 * mpn/powerpc64/linux64.m4 (ASM_END): Quote TOC_ENTRY.
9402 2006-04-18 Torbjorn Granlund <tege@swox.com>
9404 * configure.in (gmp_mpn_functions_optional): Add lshiftc.
9405 (HAVE_NATIVE): Add lshiftc.
9407 * mpn/powerpc64/mode64/invert_limb.asm: Use LEA, not LDSYM.
9408 * mpn/powerpc64/mode64/mode1o.asm: Likewise.
9409 * mpn/powerpc64/mode64/dive_1.asm: Likewise.
9411 * mpn/powerpc64/linux64.m4 (TOC_ENTRY): Define to empty.
9412 * mpn/powerpc64/aix.m4 (TOC_ENTRY): Likewise.
9413 * mpn/powerpc32/aix.m4 (TOC_ENTRY): Likewise.
9415 * mpn/powerpc32/aix.m4 (EXTERN): New, copied form powerpc64/aix.m4.
9416 * mpn/powerpc32/mode1o.asm: Use EXTERN.
9417 * mpn/powerpc32/linux.m4 (EXTERN): Provide dummy definition.
9418 * mpn/powerpc32/darwin.m4 (EXTERN): Likewise.
9420 2006-04-13 Torbjorn Granlund <tege@swox.com>
9422 * mpn/generic/mul_fft.c: Use new thresholds mechanism if MUL_FFT_TABLE2
9424 (mpn_lshiftc): New name for mpn_lshift_com (for consistency with some
9425 stuff already in 4.1.4.
9426 (mpn_fft_mul_2exp_modF): Reorganize initial operand reductions to avoid
9429 * tests/devel/try.c (choice_array): Add mpn_addsub_n[c].
9431 2006-04-11 Torbjorn Granlund <tege@swox.com>
9433 * aclocal.m4: Regenerate with patched libtool.
9435 * mpn/asm-defs.m4 (ASM_END): Provide (empty) default.
9437 2006-04-08 Torbjorn Granlund <tege@swox.com>
9439 * configure.in (gmp_mpn_functions_optional): Add addsub.
9441 * gmpxx.h: Remove missed MPFR references.
9443 * gmp-impl.h (LIMBS_PER_DOUBLE): Adjust formula to not be pessimistic.
9445 * gmp-impl.h (TMP_*, WANT_TMP_DEBUG): Don't expect marker argument;
9446 define TMP_SALLOC and TMP_BALLOC.
9448 * mpn/minithres/gmp-mparam.h: New file.
9450 * tests/mpz/t-io_raw.c: Fix printf type/arg mismatches.
9451 * tests/mpz/t-export.c: Likewise.
9452 * tests/mpz/io.c: Likewise.
9453 * tests/t-constants.c: Likewise.
9455 * mpn/ia64/popcount.asm: Append "cond.dptk" to conditional branches to
9457 * mpn/ia64/hamdist.asm: Likewise.
9458 * mpn/ia64/lorrshift.asm: Likewise.
9459 * mpn/ia64/dive_1.asm: Likewise.
9461 2006-04-05 Torbjorn Granlund <tege@swox.com>
9463 * tal-notreent.c (__gmp_tmp_mark): Add "struct" tag for tmp_marker.
9464 (__gmp_tmp_free): Likewise.
9466 * mpn/generic/mul_fft.c: Optimize many scalar divisions and mod
9467 operations into masks and shifts.
9468 (mpn_fft_mul_modF_K): Fix a spurious ASSERT_NOCARRY.
9470 2006-03-26 Torbjorn Granlund <tege@swox.com>
9472 * Version 4.2 released.
9474 * mpn/powerpc64/aix.m4 (LEA): Renamed from LDSYM.
9475 * mpn/powerpc64/darwin.m4: Likewise.
9476 * mpn/powerpc64/linux64.m4: Likewise.
9477 * mpn/powerpc64/vmx/popcount.asm: Use LEA, not LDSYM.
9479 2006-03-23 Torbjorn Granlund <tege@swox.com>
9481 * gmp-impl.h: (class gmp_allocated_string): Prefix strlen with std::.
9483 * gmpxx.h (__GMP_DEFINE_TERNARY_EXPR2): Remove for now.
9484 (struct __gmp_ternary_addmul2): Likewise.
9485 (struct __gmp_ternary_submul2): Likewise.
9487 * gmpxx.h: #include <cstring>.
9488 (struct __gmp_alloc_cstring): Prefix strlen with std::.
9490 * mpn/x86/pentium/com_n.asm: Add TEXT and ALIGN.
9491 * mpn/x86/pentium/copyi.asm: Likewise.
9492 * mpn/x86/pentium/copyd.asm: Likewise.
9494 2006-03-22 Torbjorn Granlund <tege@swox.com>
9496 * gmp-h.in: Add a "using std::FILE" for C++.
9497 (_GMP_H_HAVE_FILE): Check also _ISO_STDIO_ISO_H.
9499 * gmpxx.h: Remove mpfr code.
9500 * tests/cxx: Likewise.
9502 * gmp-impl.h (FORCE_DOUBLE): Rename a tempvar to avoid a clash with
9503 GNU/Linux public include file.
9505 * configure.in (powerpc64, darwin): New optional, gcc_cflags_subtype.
9506 Grab powerpc32/darwin.m4 for ABI=mode32.
9508 * configure.in: Use host_cpu whenever just the cpu type is needed.
9510 2006-03-08 Torbjorn Granlund <tege@swox.com>
9512 * mpz/get_si.c: Fix a typo.
9514 * tests/mpq/t-get_d.c (check_random): Improve random generation for
9517 2006-02-28 Torbjorn Granlund <tege@swox.com>
9519 * tests/mpq/t-get_d.c (check_random): New function.
9520 (main): Call check_random.
9522 * mpq/set_d.c: Make choices based on LIMBS_PER_DOUBLE, not
9523 BITS_PER_MP_LIMB. Make it work for LIMBS_PER_DOUBLE == 4.
9526 * mpz/set_d.c: Make it work for LIMBS_PER_DOUBLE == 4.
9528 * extract-dbl.c: Make it work for LIMBS_PER_DOUBLE > 3.
9530 2006-02-27 Torbjorn Granlund <tege@swox.com>
9532 * mpz/cmp_d.c: Declare `i'.
9533 * mpz/cmpabs_d.c: Likewise.
9535 2006-02-23 Torbjorn Granlund <tege@swox.com>
9537 * mpn/powerpc32/vmx/copyd.asm: Set right VRSAVE bits.
9538 * mpn/powerpc32/vmx/copyi.asm: Likewise.
9540 2006-02-22 Torbjorn Granlund <tege@swox.com>
9542 * mpn/powerpc32/vmx/logops_n.asm: New file.
9544 * mpn/powerpc32/diveby3.asm: Rewrite.
9546 2006-02-21 Torbjorn Granlund <tege@swox.com>
9548 * mpn/powerpc32/vmx/copyi.asm: New file.
9549 * mpn/powerpc32/vmx/copyd.asm: New file.
9551 2006-02-17 Torbjorn Granlund <tege@swox.com>
9553 * mpn/alpha/ev6/nails/aors_n.asm (CYSH): Import proper setting from
9556 2006-02-16 Torbjorn Granlund <tege@swox.com>
9558 * mpn/alpha/ev6/addmul_1.asm: Correct slotting comments.
9560 2006-02-15 Torbjorn Granlund <tege@swox.com>
9562 * tests/devel/anymul_1.c: Copy error reporting code from addmul_N.c.
9564 * tests/devel/addmul_N.c: New file.
9565 * tests/devel/mul_N.c: New file.
9567 * mpn/alpha/default.m4 (PROLOGUE_cpu): Align functions at 16-byte
9570 * mpn/alpha/ev6/nails/aors_n.asm: New file.
9571 * mpn/alpha/ev6/nails/add_n.asm: Remove.
9572 * mpn/alpha/ev6/nails/sub_n.asm: Remove.
9574 * mpn/alpha/ev6/nails/addmul_1.asm: Rewrite.
9575 * mpn/alpha/ev6/nails/submul_1.asm: Likewise.
9576 * mpn/alpha/ev6/nails/mul_1.asm: Likewise.
9578 * mpn/alpha/ev6/nails/addmul_2.asm: Use L() for labels.
9579 * mpn/alpha/ev6/nails/addmul_3.asm: Use L() for labels.
9580 * mpn/alpha/ev6/nails/addmul_4.asm: Use L() for labels.
9582 2006-02-13 Torbjorn Granlund <tege@swox.com>
9584 * mpn/powerpc32/diveby3.asm: Trivially reorder loop insns to save
9587 * mpn/x86_64/dive_1.asm: Use movabsq to support large model non-PIC.
9589 * mpn/x86_64/rsh1add_n.asm: Replace high register with rbx.
9590 * mpn/x86_64/rsh1sub_n.asm: Likewise.
9592 2006-02-10 Torbjorn Granlund <tege@swox.com>
9594 * mpn/powerpc64/sqr_diagonal.asm: Software pipeline.
9596 * mpn/powerpc64/vmx/popcount.asm: Add prefetching.
9598 2006-02-07 Torbjorn Granlund <tege@swox.com>
9600 * mpn/powerpc64/mode64/diveby3.asm: Rewrite.
9602 2006-02-04 Torbjorn Granlund <tege@swox.com>
9604 * mpn/powerpc64/vmx/popcount.asm: Remove mpn_hamdist partial code.
9605 Move compare for huge n so that it is always executed.
9607 2006-02-03 Torbjorn Granlund <tege@swox.com>
9609 * mpn/powerpc32/linux.m4 (LEA): Add support for PIC.
9611 * configure.in (powerpc): New optional, gcc_cflags_subtype.
9613 * mpn/x86_64/pentium4/add_n.asm: New file.
9614 * mpn/x86_64/pentium4/sub_n.asm: New file.
9615 * mpn/x86_64/pentium4/lshift.asm: New file.
9617 * mpn/powerpc64/linux64.m4 (PROLOGUE_cpu): Align function start to
9619 * mpn/powerpc64/aix.m4: Likewise.
9620 * mpn/powerpc64/darwin.m4: Likewise.
9622 * mpn/powerpc64/copyi.asm: Align loop to 16-multiple.
9623 * mpn/powerpc64/copyd.asm: Likewise
9625 * configure.in (powerpc): Add vmx to relevant paths.
9627 * mpn/powerpc64/linux64.m4 (DEF_OBJECT): Accept 2nd argument, for
9629 * mpn/powerpc64/aix.m4: Likewise.
9630 * mpn/powerpc64/darwin.m4: Likewise.
9632 * mpn/powerpc32/linux.m4 (DEF_OBJECT, END_OBJECT): New macros,
9633 inherited from powerpc64 versions.
9634 * mpn/powerpc32/aix.m4: Likewise.
9635 * mpn/powerpc32/darwin.m4: Likewise.
9637 * mpn/powerpc64/vmx/popcount.asm: New file, for ppc32 and ppc64.
9638 * mpn/powerpc32/vmx/popcount.asm: New file, grabbing above file.
9640 2006-01-22 Torbjorn Granlund <tege@swox.com>
9642 * configure.in: Generalize OS-dependent patterns for powerpcs.
9644 2006-01-20 Torbjorn Granlund <tege@swox.com>
9646 * mpn/x86_64/popham.asm: Optimize.
9648 * config.guess: Recognize power4 and up under linux-gnu.
9649 * config.sub: Generalize power recognition code.
9650 * acinclude.m4 (POWERPC64_PATTERN): Add 64-bit powerpc processors.
9651 * configure.in: Recognize powerpc processors masquerading as power
9654 2006-01-19 Torbjorn Granlund <tege@swox.com>
9656 * mpn/x86_64/logops_n.asm: Rewrite for more stable speed and smaller
9658 * mpn/x86_64/com_n.asm: Likewise.
9660 2006-01-18 Torbjorn Granlund <tege@swox.com>
9662 * mpn/x86_64/addlsh1_n.asm: Rewrite to use indexed addressing.
9663 * mpn/x86_64/sublsh1_n.asm: Likewise.
9665 2006-01-17 Torbjorn Granlund <tege@swox.com>
9667 * mpn/generic/diveby3.c: Use GMP standard parameter names. Nailify
9668 alternative code. Use restrict for params.
9670 * configure.in: Recognize andn_n as not needing nailification.
9672 * tests/mpq/t-equal.c (check_various): Disable a test that gives common
9673 factors for GMP_NUMB_BITS == 62.
9675 2006-01-16 Torbjorn Granlund <tege@swox.com>
9677 * mpn/generic/get_str.c (mpn_sb_get_str): Fix digit count computation,
9678 was inaccurate for nails.
9680 2006-01-15 Torbjorn Granlund <tege@swox.com>
9682 * mpn/x86_64/mode1o.asm: Remove unneeded carry register zeroing.
9684 2006-01-08 Torbjorn Granlund <tege@swox.com>
9686 * mpn/alpha/ev6/sqr_diagonal.asm: New file.
9688 2006-01-06 Torbjorn Granlund <tege@swox.com>
9690 * mpn/powerpc64/mode64/mod_34lsub1.asm: Tune to 1.5 c/l.
9692 * mpn/generic/mullow_n.c (MUL_BASECASE_ALLOC): New #define.
9693 (mpn_mullow_n): Use it.
9695 * mpn/powerpc64/mode64/dive_1.asm: Use EXTERN.
9696 * mpn/powerpc64/mode64/mode1o.asm: Likewise.
9698 * mpn/powerpc64/aix.m4 (EXTERN): Define to import symbol.
9699 (LDSYM): Remove [RW] attribute.
9700 * mpn/powerpc64/linux64.m4 (EXTERN): Dummy definition.
9701 * mpn/powerpc64/darwin.m4 (EXTERN): Likewise.
9703 2006-01-05 Torbjorn Granlund <tege@swox.com>
9705 * mpn/powerpc64/mode64/mode1o.asm: New file.
9707 * mpn/powerpc64/mode64/dive_1.asm: Use L() for labels. Invoke ASM_END.
9709 * mpn/powerpc64/mode64/invert_limb.asm: Invoke ASM_END.
9711 * mpn/powerpc64/linux64.m4: Move toc entry generation from direct at
9712 DEF_OBJECT to delayed via LDSYM, define ASM_END to output it.
9713 * mpn/powerpc64/aix.m4: Likewise.
9714 * mpn/powerpc64/darwin.m4: Define a dummy ASM_END.
9716 * mpn/powerpc64/mode64/addmul_1.asm: Add POWER5 timings.
9717 * mpn/powerpc64/mode64/mul_1.asm: Likewise.
9719 * mpn/powerpc64/mode64/submul_1.asm: Tweak to save 1.5 c/l for POWER5.
9721 2006-01-04 Torbjorn Granlund <tege@swox.com>
9723 * mpn/powerpc64/mode64/dive_1.asm: New file.
9725 * mpn/powerpc64/mode64/invert_limb.asm: Add missing ASM_START.
9727 * mpn/powerpc64/mode64/addmul_1.asm: Fix a comment typo.
9729 * mpn/x86_64/diveby3.asm: Rewrite.
9731 2006-01-03 Torbjorn Granlund <tege@swox.com>
9733 * configure.in: Update bugs reporting address.
9735 * mpn/powerpc64/mode64/diveby3.asm: Trim a cycle off of POWER4 timing.
9738 2006-01-02 Torbjorn Granlund <tege@swox.com>
9740 * mpn/powerpc64/linux64.m4 (CALL): New macro.
9741 * mpn/powerpc64/aix.m4: Likewise.
9742 * mpn/powerpc64/darwin.m4: Likewise, also define macro "DARWIN".
9744 2005-12-28 Torbjorn Granlund <tege@swox.com>
9746 * mpn/powerpc64/mode64/mod_34lsub1.asm: New file.
9748 2005-12-26 Torbjorn Granlund <tege@swox.com>
9750 * mpn/x86_64/mod_34lsub1.asm: New file.
9752 2005-12-20 Torbjorn Granlund <tege@swox.com>
9754 * mpn/x86_64/submul_1.asm: Save a push/pop by not using register r12.
9755 Use addq instead of leaq for pointer updates; schedule them. (These
9756 changes shaves one cycle of overhead and 0.25 c/l.)
9758 2005-12-18 Torbjorn Granlund <tege@swox.com>
9760 * mpf/ui_div.c: Implement workaround for GCC bug triggered on alpha.
9761 * mpf/set_q.c: Likewise.
9763 2005-12-16 Torbjorn Granlund <tege@swox.com>
9765 * mpn/generic/tdiv_qr.c: Remove statement with no effect.
9766 Rename dead variable to `dummy'.
9768 2005-12-15 Torbjorn Granlund <tege@swox.com>
9770 * demos/pexpr.c (setup_error_handler): Add a missing ";".
9772 2005-11-27 Torbjorn Granlund <tege@swox.com>
9774 * mpn/generic/mul.c: Crudely call mpn_mul_fft_full before checking
9775 for unbalanced operands.
9777 * mpn/generic/mul_fft.c: Remove many scalar divisions.
9778 (mpn_mul_fft_lcm): Simplify.
9779 (mpn_mul_fft_decompose): Rewrite to handle arbitrarily unbalanced
9782 2005-11-22 Torbjorn Granlund <tege@swox.com>
9784 * configure.in: Properly recognize all 32-bit Solaris releases.
9786 2005-11-10 Torbjorn Granlund <tege@swox.com>
9788 * mpn/generic/mul_fft.c: Inline mpn_fft_mul_2exp_modF,
9789 mpn_fft_add_modF and mpn_fft_normalize.
9791 2005-11-02 Torbjorn Granlund <tege@swox.com>
9793 * tests/mpz/reuse.c: Increase operand size, decrease # of reps.
9795 * mpz/rootrem.c: Adapt to new mpn_rootrem.
9796 * mpz/root.c: Likewise.
9798 * tests/mpz/reuse.c: Test mpz_rootrem.
9800 With Paul Zimmermann:
9801 * mpn/generic/rootrem.c: Complete rewrite.
9803 2005-10-31 Torbjorn Granlund <tege@swox.com>
9805 * mpz/pprime_p.c (mpz_probab_prime_p): Considerably limit trial
9808 * mpz/perfpow.c (mpz_perfect_power_p): Use mpz_divisible_ui_p instead
9811 * mpz/divegcd.c: Correct probability number for GCD == 1.
9813 * mpn/x86_64/mul_basecase.asm: Remove an obsolete comment.
9815 * mpn/x86: Add cycle counts for array of x86 processors.
9817 * mpn/x86/k7/mod_34lsub1.asm: Remove spurious mentions of ebp.
9819 * mpn/powerpc32: Add POWER5 timings.
9821 * mpn/powerpc32/README: Describe global reference variations.
9823 * mpn/ia64/divrem_2.asm: Add some comments.
9825 * mpn/ia64/divrem_1.asm: Reformat.
9827 * mpn/ia64/addmul_2.asm: Correct a comment on slotting.
9828 * mpn/ia64/logops_n.asm: Likewise.
9830 * mpn/ia64/addmul_1.asm: Remove a redundant preg mutex decl.
9832 * mpn/generic/dive_1.c: Whitespace cleanup.
9834 * mpn/alpha/ev6/nails/addmul_1.asm: Correct comments on slotting.
9835 * mpn/alpha/ev6/nails/addmul_2.asm: Likewise.
9836 * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
9838 * mpf/out_str.c: List some allocation improvement ideas.
9840 * doc/gmp.texi: Update many URLs and email addresses.
9842 * gmp-h.in (_GMP_H_HAVE_FILE): Check also _STDIO_H_INCLUDED.
9844 2005-10-26 Torbjorn Granlund <tege@swox.com>
9846 * tune/tuneup.c (tune_mullow): Update param.max_size for each threshold
9849 * configure.in (POWERPC64_PATTERN/*-*-darwin*): Set
9850 SPEED_CYCLECOUNTER_OBJ_mode64 and cyclecounter_size_mode64.
9851 (POWERPC64_PATTERN/*-*-linux*): Likewise.
9853 2005-10-03 Torbjorn Granlund <tege@swox.com>
9855 * demos/factorize.c (factor_using_division_2kp): Honor verbose flag.
9856 (factor_using_pollard_rho): Divide out new factor before it's
9857 clobbered. Don't stop factoring after a composite factor was found.
9859 2005-09-17 Torbjorn Granlund <tege@swox.com>
9861 * demos/pexpr.c (fns): Add factorial keywords.
9863 2005-08-16 Torbjorn Granlund <tege@swox.com>
9865 * tune/Makefile.am (EXTRA_DIST): Change "amd64" => "x86_64".
9866 * mpn/Makefile.am (TARG_DIST): Change "amd64" => "x86_64".
9868 2005-08-15 Torbjorn Granlund <tege@swox.com>
9870 * configure.in: Change "amd64" => "x86_64".
9872 2005-06-13 Torbjorn Granlund <tege@swox.com>
9874 * mpn/generic/pre_mod_1.c: Canonicalize variable names.
9876 * mpn/generic/divrem.c: Rate qxn test as UNLIKELY.
9878 * mpn/generic/gcdext.c (sanity_check_row): Invoke TMP_MARK.
9880 * tune/tuneup.c (tune_mullow): Fix all max_size fields.
9882 * gmp-impl.h (SQR_TOOM3_THRESHOLD_LIMIT): New #define.
9883 * tune/tuneup.c (tune_sqr): Use SQR_TOOM3_THRESHOLD_LIMIT.
9884 (sqr_toom3_threshold): Initialize from SQR_TOOM3_THRESHOLD_LIMIT.
9886 * mpn/generic/mul_n.c (mpn_sqr_n): Use SQR_TOOM3_THRESHOLD_LIMIT.
9888 * gmp-impl.h (mpn_nand_n, mpn_iorn_n, mpn_nior_n, mpn_xnor_n):
9891 2005-06-13 Niels Möller <nisse@lysator.liu.se>
9893 * mpn/generic/gcdext.c (gcdext_schoenhage): Check for the
9894 (unlikely) case that one of the hgcd/euclid steps results in two
9895 remainders of one limb each. Then use gcdext_1.
9897 2005-06-12 Torbjorn Granlund <tege@swox.com>
9899 * mpn/alpha/ev6/sub_n.asm: Analogous changes as to add_n.asm last.
9901 2005-06-11 Torbjorn Granlund <tege@swox.com>
9903 * mpn/alpha/ev6/add_n.asm: Rewrite inner loop to load later.
9904 Add mpn_add_nc entry.
9906 * mpn/alpha/ev6/addmul_1.asm: Remove redundant initial loads.
9908 2005-06-09 Torbjorn Granlund <tege@swox.com>
9910 * mpn/ia64/dive_1.asm: Fix issues with HP-UX.
9912 2005-06-08 Torbjorn Granlund <tege@swox.com>
9914 * mpn/ia64/diveby3.asm: Update TODO list.
9916 * mpn/ia64/mode1o.asm: Fix comment typos.
9918 * mpn/ia64/dive_1.asm: New file.
9920 2005-06-07 Torbjorn Granlund <tege@swox.com>
9922 * mpn/ia64/mode1o.asm: Add prefetching.
9924 * mpn/generic/dive_1.c: Use variable h for upper umul_ppmm result.
9926 2005-06-06 Torbjorn Granlund <tege@swox.com>
9928 * mpn/ia64/hamdist.asm: Complete rewrite.
9929 * mpn/ia64/popcount.asm: Rewrite to use multi-pronged feed-in.
9931 * mpn/ia64/aors_n.asm: Rewrite feed-in code.
9932 * mpn/ia64/rsh1aors_n.asm: Likewise.
9933 * mpn/ia64/aorslsh1_n.asm: Likewise.
9934 * mpn/ia64/lorrshift.asm: Likewise.
9936 2005-06-04 Torbjorn Granlund <tege@swox.com>
9938 * tests/devel/try.c (choice_array): Exclude mpn_preinv_mod_1 unless
9940 (choice_array): Exclude mpn_sqr_basecase if SQR_KARATSUBA_THRESHOLD
9943 2005-06-03 Torbjorn Granlund <tege@swox.com>
9945 * mpn/alpha/ev6/addmul_1.asm: Prefix all labels with "$".
9946 * mpn/alpha/ev6/mul_1.asm: Likewise.
9948 2005-06-02 Torbjorn Granlund <tege@swox.com>
9950 * tests/refmpn.c (refmpn_divmod_1c_workaround): Implement workaround
9951 to gcc 3.4.x bug triggered on powerpc64 with 32-bit ABI.
9953 2005-06-01 Torbjorn Granlund <tege@swox.com>
9955 * tests/devel/try.c (main): Fix a typo.
9957 2005-05-31 Torbjorn Granlund <tege@swox.com>
9959 * mpn/alpha/ev6/addmul_1.asm: Rewrite for L1 cache, add prefetch.
9961 2005-05-30 Torbjorn Granlund <tege@swox.com>
9963 * tests/misc.c (tests_rand_start): Mask random seed to 32 bits.
9965 2005-05-29 Torbjorn Granlund <tege@swox.com>
9967 * mpn/powerpc64/mode32/mul_1.asm: Handle BROKEN_LONGLONG_PARAM.
9968 * mpn/powerpc64/mode32/addmul_1.asm: Likewise.
9969 * mpn/powerpc64/mode32/submul_1.asm: Likewise.
9971 * mpn/powerpc32/mode1o.asm: Rewrite to actually work.
9973 * mpn/powerpc32/aix.m4 (LEA): New macro.
9974 (ASM_END): New macro.
9976 * mpn/powerpc32/linux.m4: New file.
9977 * mpn/powerpc32/darwin.m4: New file.
9978 * configure.in: Use linux.m4 and darwin.m4.
9979 (powerpc64-linux-gnu): Add support for mode32.
9981 2005-05-25 Torbjorn Granlund <tege@swox.com>
9983 * mpn/generic/mullow_n.c: Remove FIXME mentioning fixed flaw.
9985 * tests/mpz/t-cmp_d.c (check_one): Fix printf fmt string typo.
9987 * demos/isprime.c: #include stdlib.h.
9988 * tests/rand/t-urbui.c: Likewise.
9989 * tests/rand/t-urmui.c: Likewise.
9991 * tests/mpz/t-popcount.c (check_random): Remove spurious printf arg.
9993 * mpn/ia64/lorrshift.asm: Cleanup code layout.
9994 * mpn/ia64/popcount.asm: Likewise.
9996 2005-05-24 Torbjorn Granlund <tege@swox.com>
9998 * tests/devel/try.c (param_init) [TYPE_GET_STR]: Set retval field.
9999 (compare): Handle SIZE_GET_STR as SIZE_RETVAL.
10001 * tests/refmpn.c (refmpn_get_str): Rewrite to make it work.
10003 2005-05-23 Torbjorn Granlund <tege@swox.com>
10005 * mpn/amd64/add_n.asm: Add mpn_add_nc entry point.
10006 * mpn/amd64/sub_n.asm: Add mpn_sub_nc entry point.
10008 * longlong.h (many places): Remove lvalue casts.
10010 * gmp-impl.h (MPF_SIGNIFICANT_DIGITS): Cast prec to avoid overflow
10013 * mpn/alpha/ev6/add_n.asm: Prefetch using ldl.
10014 * mpn/alpha/ev6/sub_n.asm: Likewise.
10016 * mpn/alpha/ev6/slot.pl (optable): Recognize negq and ldl.
10018 * mpn/ia64/aors_n.asm: Prefetch using lfetch.
10019 * mpn/ia64/lorrshift.asm: Likewise.
10020 * mpn/ia64/popcount.asm: Likewise.
10021 * mpn/ia64/diveby3.asm: Likewise.
10023 2005-05-22 Torbjorn Granlund <tege@swox.com>
10025 * mpn/alpha/ev67/popcount.asm: Prefetch.
10026 * mpn/alpha/ev67/hamdist.asm: Prefetch.
10028 * longlong.h (add_ssaaaa) [x86]: Remove lvalue casts.
10029 (sub_ddmmss) [x86]: Likewise.
10031 * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Add DATA_SRC1_ODD.
10032 (param_init) [TYPE_MPZ_KRONECKER]: Clear inherited DATA_SRC1_ODD.
10033 (param_init) [TYPE_DIVEXACT_1]: Use symbolic name DIVISOR_LIMB.
10035 2005-05-21 Torbjorn Granlund <tege@swox.com>
10037 * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Initialize divisor
10038 field according to UDIV_NEEDS_NORMALIZATION.
10040 * mpz/mul_i.h: Remove left-over TMP_XXXX marker arguments.
10042 2005-05-20 Torbjorn Granlund <tege@swox.com>
10044 * mpn/x86/pentium4/sse2/addmul_1.asm (mpn_addmul_1c): Put carry in
10047 * mpn/generic/sqr_basecase.c (mpn_sqr_basecase, addmul_2 version):
10048 Avoid accesses out-of-bound in MPN_SQR_DIAGONAL applicate code.
10050 2005-05-19 Torbjorn Granlund <tege@swox.com>
10052 * mpn/alpha/diveby3.asm: Make it actually work.
10054 * gmp-impl.h (MULLOW_BASECASE_THRESHOLD_LIMIT): New #define.
10055 * mpn/generic/mullow_n.c: Use fixed stack allocation for the smallest
10056 operands; use TMP_S* allocation for medium operands.
10058 * gmp-impl.h: Remove nested TUNE_PROGRAM_BUILD test.
10060 2005-05-18 Torbjorn Granlund <tege@swox.com>
10062 * mpn/generic/mul_n.c: Make squaring and multiplication code more
10063 similar. Use TMP_S* functions.
10065 * gmp-impl.h (TMP_DECL, TMP_MARK, TMP_FREE): Get rid of argument.
10066 (TMP_SALLOC): New macro for "small" allocations.
10067 (TMP_BALLOC): New macro for "big" allocations.
10068 (TMP_SDECL, TMP_SMARK, TMP_SFREE): New macros for functions that use
10070 (WANT_TMP_ALLOCA): Make default functions choose alloca or reentrant
10071 functions, depending on size.
10073 * *.c: Remove TMP_XXXX marker arguments.
10075 * acinclude.m4 (WANT_TMP): Want tal-reent.lo also for alloca case.
10077 2005-05-16 Torbjorn Granlund <tege@swox.com>
10079 * mpn/ia64/gmp-mparam.h: Further extend FFT tables.
10081 2005-05-15 Torbjorn Granlund <tege@swox.com>
10083 * gmp-impl.h (udiv_qrnnd_preinv2): Pull an add into add_ssaaaa.
10084 (udiv_qrnnd_preinv2gen): Likewise.
10086 2005-05-14 Torbjorn Granlund <tege@swox.com>
10088 * longlong.h (add_ssaaaa) [x86_64]: Restrict allowed immediate
10090 * (sub_ddmmss) [x86_64]: Likewise.
10092 2005-05-02 Torbjorn Granlund <tege@swox.com>
10094 * acinclude.m4 (GMP_HPC_HPPA_2_0): Make gmp_tmp_v1 sed pattern handle
10095 version numbers like B.11.X.32509-32512.GP.
10097 * mpn/m68k/aors_n.asm: Correct MULFUNC_PROLOGUE.
10099 * mpn/powerpc64/mode64/aors_n.asm: Add a MULFUNC_PROLOGUE.
10101 * mpf/inp_str.c: Use plain int for mpf_set_str return value (works
10104 * acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly
10106 (long long reliability test 1): New GMP_PROG_CC_WORKS_PART test.
10107 (long long reliability test 2): New GMP_PROG_CC_WORKS_PART test.
10109 * configure.in: Add mode64 support for darwin. Use darwin.m4.
10110 Add cflags_opt flags for mode32 darwin.
10112 * mpn/powerpc64: Use L() for all asm files.
10114 * mpn/asm-defs.m4 (PIC_ALWAYS): Define PIC just iff PIC_ALWAYS = "yes".
10116 * mpn/powerpc64/darwin.m4: New file.
10118 * mpn/powerpc64/linux64.m4: Remove TOCREF, add LDSYM.
10119 Rework DEF_OBJECT to need just one argument.
10120 * mpn/powerpc64/aix.m4: Likewise.
10122 * mpn/powerpc64/mode64/invert_limb.asm: Load approx_tab address with
10123 LDSYM. Optimize somewhat. Remove 2nd DEF_OBJECT operand.
10125 2005-05-01 Torbjorn Granlund <tege@swox.com>
10127 * mpn/generic/popham.c: Compute final summation differently for 64-bit.
10129 * tests/mpz/t-popcount.c (check_random): New function.
10132 2005-04-28 Torbjorn Granlund <tege@swox.com>
10134 * mpn/amd64/add_n.asm: Use r9 instead of rbx to save push/pop.
10135 * mpn/amd64/sub_n.asm: Likewise.
10137 2005-04-09 Torbjorn Granlund <tege@swox.com>
10139 * mpn/powerpc64/copyi.asm: If HAVE_ABI_mode32, ignore upper 32 bits of
10140 mp_size_t argument.
10141 * mpn/powerpc64/copyd.asm: Likewise.
10142 * mpn/powerpc64/sqr_diagonal.asm: Likewise.
10143 * mpn/powerpc64/lshift.asm: Likewise.
10144 * mpn/powerpc64/rshift.asm: Likewise.
10145 * mpn/powerpc64/logops_n.asm: Likewise.
10146 * mpn/powerpc64/com_n.asm: Likewise.
10148 2005-04-08 Torbjorn Granlund <tege@swox.com>
10150 * mpn/generic/rootrem.c: Allocate PP_ALLOC limbs also for qp.
10152 2005-04-07 Torbjorn Granlund <tege@swox.com>
10154 * mpn/powerpc32/add_n.asm: Add nc entry point.
10155 * mpn/powerpc32/sub_n.asm: Likewise.
10157 * mpn/amd64/*.asm: Add Prescott/Nocona cycle/limb numbers.
10159 * mpn/alpha/add_n.asm: Add correct cycle/limb numbers.
10160 * mpn/alpha/sub_n.asm: Likewise.
10161 * mpn/alpha/ev5/add_n.asm: Likewise.
10162 * mpn/alpha/ev5/sub_n.asm: Likewise.
10164 2005-03-31 Torbjorn Granlund <tege@swox.com>
10166 * mpn/x86/k7/gmp-mparam.h: Fix typo in last change.
10168 2005-03-19 Torbjorn Granlund <tege@swox.com>
10170 * mpn/amd64/gmp-mparam.h: Update.
10172 * mpn/alpha/gmp-mparam.h: Update.
10173 * mpn/alpha/ev5/gmp-mparam.h: Update.
10174 * mpn/alpha/ev6/gmp-mparam.h: Update.
10176 * mpn/ia64/gmp-mparam.h: Update.
10178 * mpn/x86/p6/mmx/gmp-mparam.h: Update.
10179 * mpn/x86/pentium4/sse2/gmp-mparam.h: Update.
10180 * mpn/x86/k7/gmp-mparam.h: Update.
10182 * tests/mpz/t-gcd.c (main): Honor command line reps argument.
10184 * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Simplify and correct code
10185 for generating test operands.
10187 2005-03-17 Niels Möller <nisse@lysator.liu.se>
10189 * mpn/generic/hgcd.c (qstack_adjust): New argument d, saying how much
10190 to adjust the top quotient.
10191 (hgcd_adjust): The quotient can be off by either 1 or 2.
10193 2005-03-16 Torbjorn Granlund <tege@swox.com>
10195 * tests/mpz/t-gcd.c (MAX_SCHOENHAGE_THRESHOLD): Set to largest of
10196 gcd,gcdext thresholds.
10198 2005-03-15 Niels Möller <nisse@lysator.liu.se>
10200 * mpn/generic/gcdext.c (gcdext_schoenhage): When calling gcdext_lehmer,
10201 reuse all temporary limb storage, including the storage used for the
10204 2005-03-09 Torbjorn Granlund <tege@swox.com>
10206 * mpn/amd64/logops_n.asm: Add MULFUNC_PROLOGUE.
10208 2005-03-05 Torbjorn Granlund <tege@swox.com>
10210 * mpn/amd64/gmp-mparam.h: Extend MUL_FFT_TABLE and SQR_FFT_TABLE.
10211 * mpn/ia64/gmp-mparam.h: Likewise.
10213 2005-02-17 Torbjorn Granlund <tege@swox.com>
10215 * mpn/ia64/divrem_1.asm: Add preinv entry point.
10217 2005-01-13 Torbjorn Granlund <tege@swox.com>
10219 * gmp-impl.h (MPN_SIZEINBASE): Count bits in type size_t.
10220 (MPN_SIZEINBASE_16): Likewise.
10222 2004-12-17 Torbjorn Granlund <tege@swox.com>
10224 * tune/speed.c (run_gnuplot): Use lines, not linespoints.
10225 Output a reset gnuplot command initially.
10227 2004-12-04 Torbjorn Granlund <tege@swox.com>
10229 * mpn/generic/random2.c (gmp_rrandomb): Rework again.
10230 * mpz/rrandomb.c (gmp_rrandomb): Likewise.
10232 * mpn/amd64/redc_1.asm: Call via PLT when PIC.
10234 2004-11-29 Torbjorn Granlund <tege@swox.com>
10236 * mpn/amd64/divrem_1.asm: Add preinv entry point.
10237 * mpn/amd64/gmp-mparam.h: Set USE_PREINV_DIVREM_1 to 1.
10239 2004-11-24 Torbjorn Granlund <tege@swox.com>
10241 * mpn/alpha/diveby3.asm: Use correct prefetch instruction.
10243 2004-11-19 Torbjorn Granlund <tege@swox.com>
10245 * mpn/alpha/diveby3.asm: Add ",gp" glue in PROLOGUE.
10246 Add r31 dummy operand to `br' instruction.
10248 2004-11-17 Torbjorn Granlund <tege@swox.com>
10250 * mpn/powerpc64/mode64/addmul_1.asm: Rewrite.
10251 * mpn/powerpc64/mode64/mul_1.asm: Rewrite.
10253 * configure.in: Invoke AC_C_RESTRICT.
10255 2004-11-16 Torbjorn Granlund <tege@swox.com>
10257 * mpn/alpha/diveby3.asm: New file.
10259 2004-11-13 Torbjorn Granlund <tege@swox.com>
10261 * mpn/amd64/popham.asm: New file.
10263 2004-11-12 Torbjorn Granlund <tege@swox.com>
10265 * mpn/amd64/add_n.asm: Correct cycle count.
10266 * mpn/amd64/sub_n.asm: Likewise.
10268 * mpn/amd64/dive_1.asm: Speed divisors with many factors of 2.
10270 2004-11-11 Torbjorn Granlund <tege@swox.com>
10272 * mpn/amd64/dive_1.asm: New file.
10274 2004-11-10 Torbjorn Granlund <tege@swox.com>
10276 * mpn/generic/popham.c: Add comment.
10278 2004-11-09 Torbjorn Granlund <tege@swox.com>
10280 * mpn/amd64/com_n.asm: New file.
10282 * mpn/amd64/logops_n.asm: New file.
10284 2004-11-08 Torbjorn Granlund <tege@swox.com>
10286 * mpn/powerpc64/com_n.asm: New file.
10288 2004-11-05 Torbjorn Granlund <tege@swox.com>
10290 * mpn/amd64/diveby3.asm: New file.
10292 * config.guess: Strip any PPC string in /proc/cpuinfo.
10293 Recognize 970 in that code.
10295 2004-11-01 Torbjorn Granlund <tege@swox.com>
10297 * mpn/amd64/mul_basecase.asm: New file.
10299 * mpn/amd64/redc_1.asm: New file.
10301 2004-10-25 Torbjorn Granlund <tege@swox.com>
10303 * mpn/powerpc64/mode64/addlsh1_n.asm: Correct cycle counts.
10305 * mpn/powerpc64/README: Update POWER5/PPC970 pipeline information.
10307 * mpn/generic/mul_basecase.c (MAX_LEFT): Add comment.
10309 * doc/gmp.texi: Consistently use "x86" denotation.
10310 (Assembler SIMD Instructions): Mention SSE2 usage.
10312 * demos/pexpr.c (main): Handle "negative" base in mpz_sizeinbase call.
10314 2004-10-18 Torbjorn Granlund <tege@swox.com>
10316 * mpn/powerpc64/mode64/submul_1.asm: Shave 2 cycles/limb with new carry
10319 2004-10-16 Torbjorn Granlund <tege@swox.com>
10321 * configure.in: Support icc under x86.
10322 (ia64-*-linux*): Pass -no-gcc to icc.
10324 2004-10-15 Torbjorn Granlund <tege@swox.com>
10326 * longlong.h (ia64 umul_ppmm): Add version for icc.
10328 * configure.in: Support icc under ia64-*-linux*.
10330 * acinclude.m4: New "compiler works" test for icc 8.1 bug.
10331 (GMP_PROG_CC_IS_GNU): Don't let Intel's icc fool us it is GCC.
10333 2004-10-14 Torbjorn Granlund <tege@swox.com>
10335 * mpn/generic/gcdext.c: Add a few missing TMP_MARK.
10337 2004-10-14 Torbjorn Granlund <tege@swox.com>
10339 * acinclude.m4 (GMP_ASM_W32): Try also "data4".
10341 * mpn/ia64/logops_n.asm: Don't use naked "br", rejected by Intel
10343 * mpn/ia64/aors_n.asm: Likewise.
10345 * mpn/ia64/divrem_2.asm: Add ".prologue".
10347 * mpn/ia64/hamdist.asm: Put alloc first in bundle, enforced by the
10350 * longlong.h: Exclude masquerading __INTEL_COMPILER from ia64 asm.
10351 * gmp-impl.h: Likewise.
10353 2004-10-12 Torbjorn Granlund <tege@swox.com>
10355 * mpn/ia64/mul_2.asm: Rewrite function entry code, write new code for
10357 * mpn/ia64/addmul_2.asm: Likewise.
10359 * tests/devel/try.c: Handle mpn_mul_2 like mpn_addmul_2.
10361 * tune/speed.c (routine): Make R parameter optional for mpn_mul_2.
10363 2004-10-11 Torbjorn Granlund <tege@swox.com>
10365 * mpn/sparc64/addmul_1.asm: Update a comment.
10367 * tests/devel/aors_n.c: #include tests.h.
10368 * tests/devel/anymul_1.c: Likewise.
10369 * tests/devel/shift.c: Likewise.
10370 * tests/devel/copy.c: Likewise.
10372 * tests/devel/aors_n.c: Handle also mpn_addlsh1_n, mpn_sublsh1_n,
10373 mpn_rsh1add_n, and mpn_rsh1sub_n.
10375 * mpn/ia64/submul_1.asm: Add TODO item.
10377 * mpn/ia64/aors_n.asm: Rewrite function entry code (again).
10378 * mpn/ia64/aorslsh1_n.asm: Likewise.
10379 * mpn/ia64/logops_n.asm: Likewise.
10381 * mpn/ia64/rsh1aors_n.asm: Tune function entry and feed-in code.
10382 * mpn/ia64/lorrshift.asm: Likewise. Remove several spurious loads.
10384 * tests/devel/Makefile.am (EXTRA_PROGRAMS): Updates for yesterday's
10385 file removals and additions.
10387 2004-10-10 Torbjorn Granlund <tege@swox.com>
10389 * mpn/ia64/copyi.asm: Tune function entry code.
10390 * mpn/ia64/copyd.asm: Likewise.
10392 * mpn/ia64/logops_n.asm: Tune function entry and feed-in code for speed
10394 * mpn/ia64/aors_n.asm: Likewise.
10396 * mpn/powerpc64/logops_n.asm: Correct cycles counts.
10397 * mpn/powerpc64/mode64/aors_n.asm: Likewise.
10399 * tests/devel/copy.c: Handle both MPN_COPY_INCR and MPN_COPY_DECR.
10401 * tests/devel/logops_n.c: New file, handle all logical operations.
10403 * tests/devel/anymul_1.c: New file, handle mpn_mul_1, mpn_addmul_1, and
10405 * tests/devel/mul_1.c: Remove.
10406 * tests/devel/addmul_1.c: Remove.
10407 * tests/devel/submul_1.c: Remove.
10409 * tests/devel/shift.c: New file, handle mpn_lshift and mpn_rshift.
10410 * tests/devel/lshift.c: Remove.
10411 * tests/devel/rshift.c: Remove.
10413 * tests/devel/aors_n.c: New file, handle mpn_add_n and mpn_sub_n.
10414 * tests/devel/add_n.c: Remove.
10415 * tests/devel/sub_n.c: Remove.
10417 2004-10-09 Torbjorn Granlund <tege@swox.com>
10419 * mpn/powerpc64/linux64.m4: Define DEF_OBJECT, END_OBJECT, and TOCREF.
10420 * mpn/powerpc64/aix.m4: Likewise.
10421 * mpn/powerpc64/mode64/invert_limb.asm: Use DEF_OBJECT, END_OBJECT, and
10422 TOCREF for approx_tab.
10424 * mpn/amd64/mul_1.asm: Add mpn_mul_1c entry point.
10426 2004-10-08 Torbjorn Granlund <tege@swox.com>
10428 * mpn/powerpc64/copyi.asm: New file.
10429 * mpn/powerpc64/copyd.asm: New file.
10430 * gmp-h.in: Remove PPC MPN_COPY variants.
10431 * gmp-impl.h: Likewise.
10433 * mpn/powerpc64/logops_n.asm: New file.
10435 * mpn/powerpc64/mode64/invert_limb.asm: New file.
10437 2004-10-07 Torbjorn Granlund <tege@swox.com>
10439 * mpn/powerpc64/mode64/aors_n.asm: New file, optimized for POWER4 and
10441 * mpn/powerpc64/mode64/add_n.asm: Delete.
10442 * mpn/powerpc64/mode64/sub_n.asm: Delete.
10444 * configfsf.guess: Patch HP-UX code to accommodate HP compiler's new
10445 inability to read from stdin.
10447 * mpn/powerpc64/mode64/addsub_n.asm: Remove accidentally added file.
10449 2004-10-02 Torbjorn Granlund <tege@swox.com>
10451 * mpn/amd64/README: Update for new developments, fix typos.
10453 * mpn/amd64/mul_1.asm: Tweak addressing (3.25 => 3.0 cycles/limb).
10455 * mpn/amd64/addmul_1.asm: Remove unreachable code block.
10457 2004-09-30 Torbjorn Granlund <tege@swox.com>
10459 * mpn/amd64/addmul_1.asm: Rewrite, now 3.25 cycles/limb.
10461 * mpn/ia64/addmul_1.asm: Slightly enhance cross-jumping for code
10463 * mpn/ia64/mul_1.asm: Analogous changes.
10465 2004-09-29 Torbjorn Granlund <tege@swox.com>
10467 * gmp-impl.h (x86 ULONG_PARITY): Work around GCC change of "q" register
10470 2004-09-28 Torbjorn Granlund <tege@swox.com>
10472 * mpn/ia64/divrem_1.asm: Add cycle counts to loop.
10474 * mpn/ia64/divrem_2.asm: New file.
10476 2004-09-28 Paul Zimmermann <Paul.Zimmermann@loria.fr>
10478 * mpn/generic/mul_fft.c (mpn_mul_fft): Fix a bug in the choice of the
10479 recursive fft parameters.
10481 2004-09-20 Torbjorn Granlund <tege@swox.com>
10483 * tests/misc.c (tests_rand_start): Default to strtoul for re-seeding.
10485 * tests/mpz/t-mul.c (ref_mpn_mul): Fudge tmp allocation for toom3.
10487 2004-09-19 Torbjorn Granlund <tege@swox.com>
10489 * tests/misc.c (tests_rand_start): Shift tv_usec for better seeding.
10491 2004-09-18 Torbjorn Granlund <tege@swox.com>
10493 * tests/misc.c (tests_rand_start): Invoke fflush after printing seed.
10495 * tests/mpz/t-mul.c (main): Check environment for GMP_CHECK_FFT, run
10496 extra FFT tests if set.
10497 (ref_mpn_mul): Use library code for kara and toom, but skewded so that
10498 we never use the same algorithm that we're testing.
10499 (mul_kara): Delete.
10500 (debug_mp): Print just one line of large numbers.
10501 (ref_mpn_mul): Rework usage of tp temporary space.
10503 2004-09-15 Torbjorn Granlund <tege@swox.com>
10505 * mpn/ia64/mul_2.asm: For HAVE_ABI_32, convert vp.
10506 * mpn/ia64/addmul_2.asm: Likewise.
10508 2004-09-13 Torbjorn Granlund <tege@swox.com>
10510 * mpn/ia64/invert_limb.asm: Rewrite.
10512 * mpn/ia64/logops_n.asm: Insert some more stops.
10514 2004-09-12 Torbjorn Granlund <tege@swox.com>
10516 * mpn/ia64/gmp-mparam.h: Update.
10517 * mpn/amd64/gmp-mparam.h: Update.
10519 * mpn/ia64/sqr_diagonal.asm: Shave off a few cycles.
10521 2004-09-11 Torbjorn Granlund <tege@swox.com>
10523 * mpn/ia64/mul_2.asm: New file.
10524 * mpn/ia64/addmul_2.asm: New file.
10526 * mpn/ia64/addmul_1.asm: Tune a cycle from prologue.
10528 * mpn/ia64/lorrshift.asm: Insert stops after several branches.
10529 * mpn/ia64/aorslsh1_n.asm: Likewise.
10530 * mpn/ia64/rsh1aors_n.asm: Likewise.
10532 * mpn/generic/sqr_basecase.c: In variant for HAVE_NATIVE_mpn_addmul_2,
10533 accumulate carry also for when HAVE_NATIVE_mpn_addlsh1_n.
10535 2004-09-07 Torbjorn Granlund <tege@swox.com>
10537 * mpn/ia64/submul_1.asm: Rewrite.
10539 * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
10540 * mpn/ia64/mul_1.asm: Likewise.
10542 2004-09-02 Torbjorn Granlund <tege@swox.com>
10544 * mpn/ia64/mul_1.asm: Optimize feed-in code.
10545 * mpn/ia64/addmul_1.asm: Rewrite feed-in code.
10547 2004-08-29 Torbjorn Granlund <tege@swox.com>
10549 * tests/mpz/t-sizeinbase.c: Disable mpz_fake_bits and check_sample.
10551 2004-07-16 Torbjorn Granlund <tege@swox.com>
10553 * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
10555 2004-06-17 Kevin Ryde <kevin@swox.se>
10557 * doc/gmp.texi: Use @. when sentence ends with a capital, for good
10559 (Language Bindings): Add gmp-d, reported by Ben Hinkle. Update SWI
10560 Prolog URL, reported by Jan Wielemaker.
10562 2004-06-09 Torbjorn Granlund <tege@swox.com>
10564 * configure.in: Handle --enable-fat. Use that to enable x86 fat
10565 builds, remove magic meaning of i386-*-*.
10567 2004-06-03 Kevin Ryde <kevin@swox.se>
10569 * gmp-impl.h (memset): Use a local char* pointer, in case parameter is
10570 something else (eg. tune/common.c). Reported by Emmanuel Thomé.
10572 2004-06-01 Kevin Ryde <kevin@swox.se>
10574 * config.guess (i?86-*-*): Avoid "Illegal instruction" message which
10575 goes to stdout on 80386 freebsd4.9.
10577 2004-05-23 Niels Möller <nisse@lysator.liu.se>
10579 * mpn/generic/gcdext.c (gcdext_1_u): New function.
10580 (mpn_gcdext): Use it.
10582 2004-05-23 Torbjorn Granlund <tege@swox.com>
10584 * mpn/generic/gcdext.c (gcdext_1_odd): Use masking to avoid jumps.
10586 2004-05-22 Torbjorn Granlund <tege@swox.com>
10588 * mpn/x86/pentium4/sse2/addmul_1.asm: Add Prescott cycle numbers.
10590 * mpn/amd64/divrem_1.asm: Shave a cycle from fraction development code.
10592 * mpn/powerpc32/lshift.asm: Add more cycle numbers.
10593 * mpn/powerpc32/rshift.asm: Likewise.
10595 * mpn/ia64/addmul_1.asm: Reformat.
10597 2004-05-21 Torbjorn Granlund <tege@swox.com>
10599 * gmp-impl.h (mpn_mullow_n, mpn_mullow_basecase): Declare.
10601 * tune/Makefile.am: Compile gcdext.c.
10603 * gmp-impl.h (GET_STR_THRESHOLD_LIMIT): Lower outrageous value to 150.
10604 (GCDEXT_SCHOENHAGE_THRESHOLD): Set reasonable default. Override when
10605 TUNE_PROGRAM_BUILD.
10606 (GCDEXT_THRESHOLD): Remove.
10608 * tune/tuneup.c (gcdext_schoenhage_threshold): New variable.
10609 (gcdext_threshold): Remove variable.
10610 (tune_gcd_schoenhage): Lower step_factor to 0.1.
10611 (tune_gcdext_schoenhage): New function, based on tune_gcd_schoenhage.
10612 (tune_gcdext): Remove function.
10613 (all): Corresponding changes.
10615 2004-05-21 Niels Möller <nisse@lysator.liu.se>
10617 * mpn/generic/gcdext.c: Complete rewrite. Uses fast Lehmer code for
10618 small operands, and Schoenhage code for large operands.
10620 * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Ensure first operand is
10621 not smaller than 2nd operand.
10623 2004-05-17 Kevin Ryde <kevin@swox.se>
10625 * gmp-h.in (mpz_get_ui): Use #if instead of plain if, and for nails
10626 use ?: same as normal case, to avoid warnings from Borland C++ 6.0.
10627 Reported by delta trinity.
10629 2004-05-15 Kevin Ryde <kevin@swox.se>
10631 * tune/time.c (getrusage_backwards_p): New function
10632 (speed_time_init): Use it to exclude broken netbsd1.4.1 getrusage.
10633 * configure.in (m68*-*-netbsd1.4*): Remove code pretending getrusage
10635 * tune/README (NetBSD 1.4.1 m68k): Update notes.
10637 * configure.in (mips*-*-* ABI=n32): Remove gcc_n32_ldflags and
10638 cc_n32_ldflags, libtool knows to put the linker in n32 mode.
10640 2004-05-15 Torbjorn Granlund <tege@swox.com>
10642 * config.guess (powerpc*-*-*): Add more processor types to mfpvr code.
10643 * configure.in: Generalize powerpc subtype matching code.
10645 * mpz/fac_ui.c: Misc cleanups, spelling corrections.
10647 2004-05-14 Kevin Ryde <kevin@swox.se>
10649 * mpf/sub.c: When one operand cancels high limbs of the other, strip
10650 high zeros on the balance before truncating to destination precision.
10651 Truncating first loses accuracy and can lead to a result 0 despite
10652 operands being not equal. Reported by John Abbott.
10653 Also, ensure exponent is zero when result is zero, for instance if
10654 operands are exactly equal.
10655 * tests/mpf/t-sub.c (check_data): New function, exercising these.
10657 2004-05-12 Kevin Ryde <kevin@swox.se>
10659 * configure.in (AC_PROG_RANLIB): New macro, supposedly required by
10660 automake, though it doesn't complain.
10662 * demos/expr/Makefile.am (ARFLAGS): Add a default setting, to
10663 workaround an automake bug.
10665 2004-05-10 Kevin Ryde <kevin@swox.se>
10667 * */Makefile.in, install-sh, aclocal.m4: Update to automake 1.8.4.
10669 * doc/gmp.texi (Demonstration Programs): Add a remark about expression
10670 evaluation in the main gmp library.
10672 * demos/expr/exprfa.c (mpf_expr_a): Correction to mpX_init, use
10673 mpf_init2 to follow requested precision.
10674 * demos/expr/exprza.c, demos/expr/exprqa.c: Use wrappers for mpX_init,
10675 to make parameters match.
10677 * demos/expr/run-expr.c: Don't use getopt, to avoid needing configury
10678 for optarg declaration. Remove TRY macro, rename foo and bar to var_a
10679 and var_b, for clarity.
10680 * demos/expr/expr-impl.h: Don't use expr-config.h.
10681 * configure.in (demos/expr/expr-config.h): Remove.
10682 * demos/expr/expr-config.in: Remove file.
10684 2004-05-08 Kevin Ryde <kevin@swox.se>
10686 * doc/configuration (Configure): Update for current automake not
10687 copying acinclude.m4 into aclocal.m4.
10689 * configure.in, Makefile.am, doc/gmp.texi, doc/configuration,
10690 tests/cxx/Makefile.am, demos/expr/Makefile.am, demos/expr/README,
10691 demos/expr/expr.c, demos/expr/expr.h, demos/expr/expr-config-h.in,
10692 demos/expr/expr-impl.h, demos/expr/run-expr.c, demos/expr/t-expr.c:
10693 MPFR now published separately, remove various bits.
10694 * mpfr/*, tests/cxx/t-headfr.cc, demos/expr/exprfr.c,
10695 demos/expr/exprfra.c: Remove.
10697 2004-05-07 Kevin Ryde <kevin@swox.se>
10699 * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Amend c++ shared library
10700 path hack, on k62-unknown-dragonfly1.0 /usr/bin/make runs its commands
10701 "set -e", so we need an "|| true" in case there's nothing to copy (for
10702 instance in a static build).
10704 2004-05-06 Kevin Ryde <kevin@swox.se>
10706 * mpn/alpha/mode1o.c: Remove, in favour of ...
10707 * mpn/alpha/mode1o.asm: New file.
10708 * mpn/alpha/alpha-defs.m4 (bwx_available_p): New macro.
10710 * tune/amd64.asm: Save rbx in r10 rather than on the stack.
10712 * configure.in (x86_64-*-*): Try also "-march=k8 -mno-sse2", in case
10713 we're in ABI=32 on an old OS not supporting xmm regs.
10714 (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): Run these tests under
10715 -march=k8 too, and not under ABI=64.
10717 * doc/gmp.texi (Converting Integers): For mpz_get_d, note truncation
10718 and overflows. For mpz_get_d_2exp note truncation, note result if
10719 OP==0, and cross reference libc frexp.
10720 (Rational Conversions): For mpq_get_d, note truncation and overflows.
10721 (Converting Floats): For mpf_get_d, note truncation and overflows.
10722 For mpf_get_d_2exp, note truncation, note result if OP==0.
10723 (Assembler Code Organisation): Note nails subdirectories.
10724 Clarification of get_d_2exp OP==0 reported by Sylvain Pion.
10726 2004-05-05 Torbjorn Granlund <tege@swox.com>
10728 * mpn/generic/mullow_n.c, mpn/generic/mullow_basecase.c: New files
10729 (mainly by Niels Möller).
10730 * configure.in, mpn/Makefile.am: Add them.
10732 * gmp-impl.h (MULLOW_BASECASE_THRESHOLD, MULLOW_DC_THRESHOLD,
10733 MULLOW_MUL_N_THRESHOLD): Override for TUNE_PROGRAM_BUILD.
10735 * tune/Makefile.am: Compile mullow_n.c.
10736 * tune/common.c (speed_mpn_mullow_n, speed_mpn_mullow_basecase):
10738 * tune/speed.c (routine): Add entries for mpn_mullow_n and
10739 mpn_mullow_basecase.
10740 * tune/speed.h (SPEED_ROUTINE_MPN_MULLOW_N_CALL,
10741 SPEED_ROUTINE_MPN_MULLOW_BASECASE): New #defines.
10742 * tune/tuneup.c (tune_mullow): New function.
10744 * gmp-impl.h (invert_limb): Compute branch-freely.
10746 2004-05-02 Kevin Ryde <kevin@swox.se>
10748 * mpn/amd64/mode1o.asm: Use movabsq to support large model non-PIC.
10749 Use 32-bit insns to save code bytes, and to save a couple of cycles on
10750 the initial setup multiplies.
10752 2004-05-01 Kevin Ryde <kevin@swox.se>
10754 * doc/gmp.texi (References): Update gcc online docs url to
10757 * configure.in (mips*-*-irix[6789]*): Correction to m4 quoting of this
10758 pattern. (Believe the mips64*-*-* part also used picks up all current
10759 irix6 tuples anyway.) Reported by Rainer Orth.
10761 2004-04-30 Kevin Ryde <kevin@swox.se>
10763 * acinclude.m4 (GMP_PROG_CC_X86_GOT_EAX_EMITTED,
10764 GMP_ASM_X86_GOT_EAX_OK): New macros.
10765 (GMP_PROG_CC_WORKS): Use them to detect an old gas bug tickled by
10766 recent gcc. Reported by David Newman.
10768 * doc/gmp.texi (Reentrancy): Note also gmp_randinit_default as an
10769 alternative to gmp_randinit.
10771 2004-04-29 Torbjorn Granlund <tege@swox.com>
10773 * configfsf.guess: Update to 2004-03-12.
10774 * configfsf.sub: Likewise.
10776 2004-04-27 Torbjorn Granlund <tege@swox.com>
10778 * mpz/rrandomb.c (gmp_rrandomb): Rework to avoid extra limb allocation
10779 and to generate even numbers.
10780 * mpn/generic/random2.c (gmp_rrandomb): Likewise.
10782 2004-04-25 Kevin Ryde <kevin@swox.se>
10784 * gmp-impl.h (FORCE_DOUBLE): Don't use an asm with a match constraint
10785 on a memory output, apparently not supported and provokes a warning
10788 2004-04-24 Kevin Ryde <kevin@swox.se>
10790 * longlong.h (count_leading_zeros_gcc_clz,
10791 count_trailing_zeros_gcc_ctz): New macros.
10792 (count_leading_zeros, count_trailing_zeros) [x86]: Use them on gcc
10795 * configure.in (x86-*-* gcc_cflags_cpu): Give a -mtune at the start of
10796 each option list, for use by gcc 3.4 to avoid deprecation warnings
10799 * mpz/aorsmul.c, mpz/aorsmul_i.c, mpz/cfdiv_q_2exp.c,
10800 mpz/cfdiv_r_2exp.c, mpq/aors.c, mpf/ceilfloor.c: Give REGPARM_ATTR()
10801 on function definition too, as demanded by gcc 3.4.
10803 2004-04-22 Kevin Ryde <kevin@swox.se>
10805 * tests/rand/t-lc2exp.c (check_bigc1): New test.
10807 * doc/fdl.texi: Tweak @appendixsubsec -> @appendixsec to match our
10808 preference for this in an @appendix, and because texi2pdf doesn't
10809 support @appendixsubsec directly within an @appendix.
10811 2004-04-20 Kevin Ryde <kevin@swox.se>
10813 * doc/texinfo.tex: Update to 2004-04-07.08 from texinfo 4.7.
10814 * doc/gmp.texi, mpfr/mpfr.texi (@copying): Don't put a line break in
10815 @ref within @copying, recent texinfo.tex doesn't like that.
10817 * demos/perl/GMP.xs (static_functable): Treat cygwin the same as mingw
10820 * */Makefile.in, install-sh: Update to automake 1.8.3.
10821 * ltmain.sh, aclocal.m4, configure: Update to libtool 1.5.6.
10823 * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): Use a compile-time constant
10824 expression, rather than a configure test.
10825 * acinclude.m4, configure.in (GMP_C_RIGHT_SHIFT): Remove, no longer
10827 * tests/t-hightomask.c: New file.
10828 * tests/Makefile.am (check_PROGRAMS): Add it.
10830 * macos/configure (parse_top_configure): Look for PACKAGE_NAME and
10831 PACKAGE_VERSION now used by autoconf.
10832 (what_objects): Only demand 9 object files, as for instance occurs in
10833 the scanf directory.
10834 (asm files): Transform labels L(foo) -> Lfoo. Take func name from
10835 PROLOGUE to support empty "EPILOGUE()". Recognise and substitute
10836 register name "define()"s.
10837 * macos/Makefile.in (CmnObjs): Add tal-notreent.o.
10839 2004-04-19 Torbjorn Granlund <tege@swox.com>
10841 * tune/speed.h (SPEED_ROUTINE_MPN_ROOTREM): New #define.
10842 (speed_mpn_rootrem): Declare.
10843 * tune/common.c (speed_mpn_rootrem): New function.
10844 * tune/speed.c (routine): Add entry for mpn_rootrem.
10846 2004-04-16 Kevin Ryde <kevin@swox.se>
10848 * doc/fdl.texi: Update from FSF, just fixing a couple of typos.
10850 * macos/configure, macos/Makefile.in: Add printf and scanf directories.
10852 * tests/mpz/t-gcd.c (check_data): New function, exercising K6
10855 2004-04-14 Kevin Ryde <kevin@swox.se>
10857 * doc/gmp.texi (Reentrancy, Random State Initialization): Note
10858 gmp_randinit use of gmp_errno is not thread safe. Reported by Vincent
10861 * doc/gmp.texi (Random State Initialization): Add index entries for
10862 gmp_errno and constants.
10864 * mpn/m68k/README: Update _SHORT_LIMB -> __GMP_SHORT_LIMB.
10866 * configure.in (--enable-mpbsd): Typo Berkley -> Berkeley in help msg.
10868 2004-04-12 Kevin Ryde <kevin@swox.se>
10870 * demos/perl/GMP.xs (static_functable): New macro, use it for all
10871 function tables, to support mingw DLL builds.
10872 * demos/perl/INSTALL (NOTES FOR PARTICULAR SYSTEMS): Remove note on
10873 DLLs, should be ok now.
10875 * demos/perl/sample.pl: Print the module and library versions in use.
10877 * demos/perl/GMP.pm, Makefile.PL (VERSION): Set to '2.00'.
10878 * demos/perl/GMP.pm (COPYRIGHT): New in the doc section.
10880 * Makefile.am: Note 4.1.3 libtool versioning info, and REVISION policy.
10882 * tal-debug.c: Add <stdlib.h> for abort.
10884 2004-04-07 Torbjorn Granlund <tege@swox.com>
10886 * tests/refmpf.c (refmpf_add_ulp): Adjust exponent when needed.
10888 * mpn/generic/random2.c: Rewrite (clone mpz/rrandomb.c).
10890 2004-04-07 Kevin Ryde <kevin@swox.se>
10892 * mpn/x86/k6/gcd_finda.asm: Correction jbe -> jb in initial setups.
10893 Zero flag is wrong here, it relects only the high limb of the compare,
10894 leading to n1>=n2 not satisfied and wrong results. cp[1]==0x7FFFFFFF
10895 with cp[0]>=0x80000001 provokes this.
10897 * doc/gmp.texi (BSD Compatible Functions): Note "pow" name clash under
10898 the pow function description too.
10899 (Language Bindings): Add XEmacs (betas at this stage). Reported by
10902 * tests/refmpn.c (refmpn_mod2): Correction to ASSERTs, r==a is allowed.
10904 * gen-psqr.c (generate_mod): Cast mpz_invert_ui_2exp args, for K&R.
10905 * gen-bases.c, gen-fib.c, gen-psqr.c: For mpz_out_str, use stdout
10906 instead of 0, in case a K&R treats int and FILE* params differently.
10908 2004-04-04 Kevin Ryde <kevin@swox.se>
10910 * gmp-impl.h (BSWAP_LIMB) [amd64]: New macro.
10911 (FORCE_DOUBLE): Use this for amd64 too.
10913 * tests/amd64check.c, tests/amd64call.asm: New files, derived in part
10914 from x86check.c and x86call.asm.
10915 * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add them.
10916 * configure.in (x86_64-*-* ABI=64): Use them.
10918 2004-04-03 Kevin Ryde <kevin@swox.se>
10920 * mpn/amd64/mode1o.asm: New file.
10921 * mpn/amd64/amd64-defs.m4 (ASSERT): New macro.
10923 * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/pentium4/sse2/divrem_1.asm: Add
10924 note on how "dr" part of algorithm is handled.
10926 * mpn/x86/k7/dive_1.asm, mpn/x86/k7/mod_34lsub1.asm,
10927 mpn/x86/k7/mode1o.asm: Note Hammer (32-bit mode) speeds.
10929 2004-03-31 Kevin Ryde <kevin@swox.se>
10931 * doc/gmp.texi (Language Bindings): Add GOO, MLGMP and Numerix.
10933 * mpf/mul_2exp.c, mpf/div_2exp.c: Rate u==0 as UNLIKELY.
10935 2004-03-28 Torbjorn Granlund <tege@swox.com>
10937 * mpn/amd64/divrem_1.asm: Trim a few cycles.
10939 2004-03-27 Torbjorn Granlund <tege@swox.com>
10941 * mpn/amd64/sublsh1_n.asm: Fix typo.
10943 * mpn/generic/divrem_1.c: Fix typo.
10945 * mpn/generic/sqr_basecase.c: Fix typo.
10947 * mpn/amd64/divrem_1.asm: New file.
10949 2004-03-20 Kevin Ryde <kevin@swox.se>
10951 * longlong.h (power, powerpc): Add comments on how we select this code.
10953 * gmp-h.in (mpz_get_ui): Use ?: instead of mask style, gcc treats the
10954 two identically but ?: is a bit clearer.
10956 * insert-dbl.c: Remove file, no longer used, scaling is now integrated
10958 * Makefile.am (libgmp_la_SOURCES): Remove insert-dbl.c.
10959 * gmp-impl.h (__gmp_scale2): Remove prototype.
10961 2004-03-17 Kevin Ryde <kevin@swox.se>
10963 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init, fake_cpuid_table): Add x86_64.
10965 * mpq/get_d.c: Use mpn_tdiv_qr, demand den>0 per canonical form.
10967 2004-03-16 Torbjorn Granlund <tege@swox.com>
10969 * mpn/generic/sqr_basecase.c: Add versions using mpn_addmul_2 and
10972 2004-03-14 Kevin Ryde <kevin@swox.se>
10974 * mpf/mul_ui.c: Incorporate carry from low limbs, for exactness.
10975 * tests/mpf/t-mul_ui.c: New file.
10976 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
10978 * mpf/div.c: Use mpn_tdiv_qr. Use just one TMP_ALLOC. Use full
10979 divisor, since truncating can lose accuracy.
10980 * tests/mpf/t-div.c: New file.
10981 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
10983 * tests/mpf/t-set_q.c, tests/mpf/t-ui_div.c (check_various): Amend
10985 * tests/mpf/t-ui_div.c (check_rand): Exercise r==v overlap.
10987 * tests/refmpf.c, tests/tests.h (refmpf_set_overlap): New function.
10989 * mpf/cmp_si.c [nails]: Correction, cast vval in exp comparisons, for
10990 when vval=-0x800..00 and limb==longlong.
10992 * mpf/cmp_si.c [nails]: Correction, return usign instead of 1 when
10993 uexp==2 but value bigger than an mp_limb_t.
10994 * tests/mpf/t-cmp_si.c (check_data): Add test cases.
10996 * tests/trace.c (mpf_trace): Use ABS(mp_trace_base) to allow for
10997 negative bases used for upper case hex in integer traces.
10999 2004-03-12 Torbjorn Granlund <tege@swox.com>
11001 * mpn/generic/sb_divrem_mn.c: Correct header comment.
11003 2004-03-11 Kevin Ryde <kevin@swox.se>
11005 * aclocal.m4, configure, ltmain.sh: Downgrade to libtool 1.5, version
11006 1.5.2 doesn't remove .libs/*.a files when rebuilding, which is bad for
11007 development when changing contents or with duplicate named files like
11010 Revert this, ie restore AR_FLAGS=cq:
11011 * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
11012 does this itself on detecting duplicate object filenames in piecewise
11015 * randbui.c, randmui.c [longlong+nails]: Correction to conditionals
11018 * mpz/aors_ui.h, mpz/cdiv_q_ui.c, mpz/cdiv_qr_ui.c, mpz/cdiv_r_ui.c,
11019 mpz/cdiv_ui.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr_ui.c, mpz/fdiv_r_ui.c,
11020 mpz/fdiv_ui.c, mpz/gcd_ui.c, mpz/iset_ui.c, mpz/lcm_ui.c,
11021 mpz/set_ui.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr_ui.c, mpz/tdiv_r_ui.c,
11022 mpz/tdiv_ui.c, mpz/ui_sub.c, mpf/div_ui.c, mpf/mul_ui.c
11023 [longlong+nails]: Amend #if to avoid warnings about shift amount.
11025 2004-03-07 Kevin Ryde <kevin@swox.se>
11027 * mpf/reldiff.c: Use rprec+ysize limbs for d, to ensure accurate
11028 result. Inline mpf_abs(d,d) and mpf_cmp_ui(x,0), and rate the latter
11031 * mpf/ui_div.c: Use mpn_tdiv_qr. Use just one TMP_ALLOC. Use full
11032 divisor, since truncating can lose accuracy.
11033 * tests/mpf/t-ui_div.c: New file.
11034 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
11036 * mpf/set_q.c: Expand TMP_ALLOC_LIMBS_2, to make conditional clearer
11037 and avoid 1 limb alloc when not wanted.
11039 * gmp-impl.h (WANT_TMP_DEBUG): Define to 0 if not defined.
11040 (TMP_ALLOC_LIMBS_2): Use "if" within macro rather than "#if", for less
11041 preprocessor conditionals.
11043 * mpf/mul_2exp.c, mpf/div_2exp.c: Add some comments.
11045 * tests/refmpn.c (refmpn_sb_divrem_mn, refmpn_tdiv_qr): Nailify.
11047 2004-03-04 Kevin Ryde <kevin@swox.se>
11049 * gen-psqr.c (print): Add CNST_LIMB in PERFSQR_MOD_TEST, for benefit
11051 * tests/mpn/t-perfsqr.c (PERFSQR_MOD_1): Use CNST_LIMB for K&R.
11053 * doc/configuration (Configure): Remove mkinstalldirs, no longer used.
11055 * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
11056 does this itself on detecting duplicate object filenames in piecewise
11059 * configure.in (hppa2.0*-*-*): Test sizeof(long) == 4 or 8 to verify
11060 ABI=2.0n versus ABI=2.0w. In particular this lets CC=cc_bundled
11061 correctly fall back to ABI=2.0n (we don't automatically add CC=+DD64
11062 to that compiler, currently).
11064 * doc/gmp.texi (Reentrancy): Note C++ mpf_class constructors using
11065 global default precision.
11066 (Random State Miscellaneous): Describe gmp_urandomb_ui as giving N
11068 (C++ Interface Floats): Describe operator= copying the value, not the
11069 precision, and what this can mean about copy constructor versus
11070 default constructor plus assignment.
11072 * mpf/set_q.c: Use mpn_tdiv_qr rather than mpn_divrem, so no shifting.
11073 Don't truncate the divisor, it can make the result inaccurate.
11074 * tests/mpf/t-set_q.c: New file.
11075 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
11077 * mpf/set.c: Use MPN_COPY_INCR, in case r==u and ABSIZ(u) > PREC(r)+1.
11078 No actual bug here, because MPN_COPY has thusfar been an alias for
11079 MPN_COPY_INCR, only an ASSERT failure.
11080 * tests/mpf/t-set.c: New file.
11081 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
11083 * mpf/set.c, mpf/iset.c: Do MPN_COPY last, for possible tail call.
11085 * mpf/set_d.c: Rate d==0 as UNLIKELY. Store size before extract call,
11086 to shorten lifespan of "negative".
11088 * mpf/init.c, mpf/init2.c, mpf/iset_d.c, mpf/iset_si.c,
11089 mpf/iset_str.c, mpf/iset_ui.c: Store prec before alloc call, for one
11090 less live quantity across that call.
11091 * mpf/init.c, mpf/init2.c, mpf/iset_str.c: Store size and exp before
11092 alloc call, to overlap with other operations.
11094 * tests/refmpf.c, tests/tests.h (refmpf_fill, refmpf_normalize,
11095 refmpf_validate, refmpf_validate_division): New functions.
11097 * tests/refmpn.c, tests/tests.h (refmpn_copy_extend,
11098 refmpn_lshift_or_copy_any, refmpn_rshift_or_copy_any): New functions.
11100 * tal-debug.c: Add <string.h> for strcmp.
11102 * tests/cxx/t-istream.cc (check_mpz, check_mpq, check_mpf): Use size_t
11103 for loop index, to quieten g++ warning.
11105 2004-03-02 Kevin Ryde <kevin@swox.se>
11107 * tests/mpn/t-hgcd.c: Use __GMP_PROTO on prototypes.
11109 2004-03-01 Torbjorn Granlund <tege@swox.com>
11111 With Karl Hasselström:
11112 * mpn/generic/dc_divrem_n.c (mpn_dc_div_2_by_1): New function, with
11113 meat from old mpn_dc_divrem_n. Accept scratch parameter. Rewrite to
11114 avoid a recursive call.
11115 (mpn_dc_div_3_by_2): New function, with meat from old
11116 mpn_dc_div_3_halves_by_2. Accept scratch parameter.
11117 (mpn_dc_divrem_n): Now just allocate scratch space and call new
11120 2004-02-29 Kevin Ryde <kevin@swox.se>
11122 * longlong.h (count_leading_zeros) [alpha gcc]: New version, inlining
11123 mpn/alpha/cntlz.asm cmpbge technique.
11125 * aclocal.m4, configure, install-sh, missing, ltmain.sh,
11126 */Makefile.in: Update to automake 1.8.2 and libtool 1.5.2.
11128 * doc/gmp.texi (C++ Interface Integers): Note / and % rounding follows
11130 (Exact Remainder): Index entries for divisibility testing algorithm.
11132 * tune/time.c (speed_endtime): Return 0.0 for negative time measured.
11133 Revise usage comments for clarity.
11134 * tune/common.c (speed_measure): Recognise speed_endtime 0.0 for
11135 failed measurement.
11137 * tests/mpn/t-get_d.c (check_rand): Correction to nhigh_mask setup.
11139 2004-02-27 Torbjorn Granlund <tege@swox.com>
11141 * tune/tuneup.c (tune_dc, tune_set_str): Up param.step_factor.
11143 * tests/mpz/t-gcd.c: Decrease # of tests to 50.
11145 2004-02-27 Kevin Ryde <kevin@swox.se>
11147 * tests/devel/try.c: Add a comment that this is not for Cray systems.
11149 * mpf/set_q.c: Don't support den(q)<0, demand canonical form in the
11152 2004-02-24 Torbjorn Granlund <tege@swox.com>
11155 * mpn/generic/mul_fft.c (mpn_fft_add_modF): Loop until normalization
11158 2004-02-22 Kevin Ryde <kevin@swox.se>
11160 * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_OS_X86_XMM, GMP_PROG_CXX_WORKS):
11161 Remove files that might look like compiler output, so our "||"
11162 alternatives are not fooled.
11164 * acinclude.m4 (GMP_PROG_CC_WORKS): Add test for lshift_com code
11165 mis-compiled by certain IA-64 HP cc at +O3.
11167 * gmp-impl.h (USE_LEADING_REGPARM): Disable under prof or gprof, for
11168 the benefit of freebsd where .mcount clobbers registers. Spotted by
11170 * configure.in (WANT_PROFILING_PROF, WANT_PROFILING_GPROF): New
11173 2004-02-21 Kevin Ryde <kevin@swox.se>
11175 * configure.in (sparc64-*-*bsd*): Amend -m32 setup for ABI=32, so it's
11176 not used in ABI=64 on the BSD systems.
11178 2004-02-18 Niels Möller <nisse@lysator.liu.se>
11180 * tests/mpz/t-gcd.c (gcdext_valid_p): New function.
11181 (ref_mpz_gcd): Deleted function.
11182 (one_test): Rearranged to call mpz_gcdext first, so that the
11183 returned value can be validated.
11184 (main): Don't use ref_mpz_gcd.
11186 2004-02-18 Torbjorn Granlund <tege@swox.com>
11188 * gmp-impl.h (MPN_TOOM3_MAX_N): Move to !WANT_FFT section.
11190 * tests/mpz/t-mul.c: Exclude special huge operands unless WANT_FFT.
11192 * mpz/rrandomb.c (gmp_rrandomb): Rewrite.
11194 * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Remove write-only variable c5.
11196 2004-02-18 Kevin Ryde <kevin@swox.se>
11198 * mpf/iset_si.c, mpf/iset_ui.c, mpf/set_si.c, mpf/set_ui.c [nails]:
11199 Always store second limb, to avoid a conditional.
11201 * tests/mpf/t-get_ui.c: New file.
11202 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
11203 * tests/mpf/t-get_si.c (check_limbdata): Further tests.
11204 * gmp-impl.h (MP_EXP_T_MAX, MP_EXP_T_MIN): New defines.
11206 * mpf/get_ui.c, mpf/get_si.c: Remove size==0 test, it's covered by
11207 other conditions. Attempt greater clarity by expressing conditions as
11208 based on available data range.
11209 * mpf/get_si.c [nails]: Correction, don't bail on exp > abs_size,
11210 since may still have second limb above radix point available.
11211 * mpf/get_ui.c: Nailify.
11213 2004-02-16 Kevin Ryde <kevin@swox.se>
11215 * mpz/scan0.c, mpz/scan1.c: Use count_trailing_zeros, instead of
11216 count_leading_zeros on limb&-limb.
11218 * mpf/sqrt.c: Use "/ 2" for exp, avoiding C undefined behaviour on
11219 ">>" of negatives. Correction to comment, exp is rounded upwards.
11220 SIZ(r) always prec now, no need for tsize expression. Store EXP(r)
11221 and SIZ(r) where calculated to reduce variable lifespans. Make tsize
11222 mp_size_t not mp_exp_t, though of course those are currently the same.
11224 * gmp-h.in (GMP_ERROR_ALLOCATE, GMP_ERROR_BAD_STRING,
11225 GMP_ERROR_UNUSED_ERROR): Remove, never used or documented, and we
11226 don't want to use globals for communicating error information.
11228 * mpz/gcd_ui.c [nails]: Correction, actually return a value.
11230 * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails==1]: Add code.
11232 2004-02-15 Kevin Ryde <kevin@swox.se>
11234 * tests/mpz/t-jac.c (check_data): Remove unnecessary variable
11237 2004-02-14 Torbjorn Granlund <tege@swox.com>
11239 * mpn/ia64/aors_n.asm: Break a group with a RAW conflict.
11241 2004-02-14 Kevin Ryde <kevin@swox.se>
11243 * acinclude.m4 (GMP_C_RIGHT_SHIFT): Note that it's "long"s which we're
11246 * mpn/generic/mul_n.c: Add some remarks about toom3 high zero
11249 * mpn/generic/scan0.c, mpn/generic/scan1.c: Remove design issue
11250 remarks. What to do about going outside `up' space is a problem, but
11251 anything to address it would be an incompatible change.
11253 2004-02-12 Torbjorn Granlund <tege@swox.com>
11255 * tests/mpn/t-hgcd.c: Remove unused variables.
11257 * mpn/ia64/hamdist.asm: Remove bundling incompatible with HP-UX
11258 assembler. Misc HP-UX changes.
11259 * mpn/ia64/gcd_1.asm: Add some syntax to placid the HP-UX assembler.
11261 2004-02-11 Kevin Ryde <kevin@swox.se>
11263 * longlong.h (power, powerpc): Use HAVE_HOST_CPU_FAMILY_power and
11264 HAVE_HOST_CPU_FAMILY_powerpc rather than various cpp defines.
11266 * gmp-impl.h: Add remarks about limits.h and Cray etc.
11268 * mpn/ia64/mul_1.asm: Don't put .pred directives on labelled lines,
11269 hpux 11.23 assembler doesn't like that.
11270 * mpn/ia64/README: Add a note on this.
11272 * dumbmp.c (mpz_mul): Set ALLOC(r) for new data block used. Reported
11275 * mpn/pa32/README, mpn/pa64/README (REFERENCES): New sections.
11277 2004-02-10 Torbjorn Granlund <tege@swox.com>
11279 * tests/mpz/t-gcd.c: Decrease # of tests run.
11281 * mpn/*/gmp-mparam.h: Add HGCD values, update TOOM values.
11283 2004-02-01 Torbjorn Granlund <tege@swox.com>
11286 * config.guess: Recognize AMD's hammer processors, return x86_64.
11288 2004-01-31 Niels Möller <nisse@lysator.liu.se>
11290 * mpn/generic/hgcd.c (mpn_cmp_sum3): Declare static.
11292 2004-01-25 Niels Möller <nisse@lysator.liu.se>
11294 * tests/mpn/Makefile.am (check_PROGRAMS): Add t-hgcd.
11296 * mpn/generic/hgcd.c (hgcd_jebelean): Simplify, use mpn_cmp_sum3.
11297 (mpn_cmp_sum3): New function.
11298 (mpn_diff_smaller_p): Remove.
11299 (hgcd_final, hgcd_jebelean, hgcd_small_1, hgcd_small_2, euclid_step):
11300 Remove tp,talloc arguments. Callers changed.
11302 2004-01-25 Torbjorn Granlund <tege@swox.com>
11304 * tune/tuneup.c (all): Reenable calls of tune_gcd_schoenhage and
11307 * mpn/generic/gcd.c: Reenable Schoenhage code.
11310 * mpn/generic/hgcd.c: Add const and inline to several functions.
11311 (qstack_push_start qstack_push_end qstack_push_quotient): Remove.
11312 (euclid_step): Insert removed functions here.
11313 (hgcd_adjust): Simplify, don't handle d != 1.
11314 (qstack_adjust): Corresponding changes.
11315 (mpn_hgcd2_lehmer_step): Remove redundant tests for bh against zero.
11316 (hgcd_start_row_p): Tweak.
11317 (hgcd_final): Shorten life of ralloc.
11319 2004-01-24 Kevin Ryde <kevin@swox.se>
11321 * tests/mpf/t-sqrt.c (check_rand1): Further diagnostic printouts.
11323 * mpn/generic/sqrtrem.c (mpn_sqrtrem): Add ASSERT_MPN.
11324 (mpn_dc_sqrtrem): Add casts for K&R.
11326 * mpf/sqrt_ui.c: Nailify.
11328 * mpf/set_z.c: Do MPN_COPY last, for possible tail call.
11330 * doc/gmp.texi (Miscellaneous Float Functions): For mpf_random2, note
11331 exponent is in limbs.
11333 * mpn/ia64/README: Add remark about concentrating on itanium-2.
11335 2004-01-22 Kevin Ryde <kevin@swox.se>
11337 * mpf/sqrt.c: Change tsize calculation to get prec limbs result
11338 always, previously got prec+1 when exp was odd.
11339 * tests/mpf/t-sqrt.c (check_rand1): New function, code from main.
11340 (check_rand2): New function.
11342 * mpf/sqrt_ui.c: Change rsize calculation to get prec limbs result,
11343 previously got prec+1.
11344 * tests/mpf/t-sqrt_ui.c: New file.
11345 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
11347 * tests/refmpf.c, tests/tests.h (refmpf_add_ulp,
11348 refmpf_set_prec_limbs): New functions.
11350 * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Remove x86+m68k force to double,
11351 mpn_get_d now does this. Remove res==1.0 check for round upwards,
11352 mpn_get_d now rounds towards zero. Move exp store to make mpn_get_d a
11355 * configure.in (x86-*-*): Use ABI=32 rather than ABI=standard.
11356 Use gcc -m32 when available, to force mode on bi-arch amd64 gcc.
11357 * configure.in, acinclude.m4 (x86_64-*-*): Merge into plain x86 setups
11358 as ABI=64. Support ABI=32, using athlon code. Use gcc -mcpu=k8,
11360 (amd64-*-*): Remove pattern, config.sub only gives x86_64.
11361 * doc/gmp.texi (ABI and ISA): Add x86_64 dual ABIs.
11363 * mpn/amd64/README: Add reference to ABI spec.
11365 2004-01-17 Niels Möller <nisse@lysator.liu.se>
11367 * mpn/generic/hgcd.c (hgcd_adjust): Backed out mpn_addlsh1_n
11370 * mpn/generic/hgcd.c (hgcd_adjust): Fixed calls of mpn_addlsh1_n.
11372 2004-01-17 Kevin Ryde <kevin@swox.se>
11374 * tune/README: Remove open/mpn versions of toom3, no longer exist.
11375 * tune/powerpc64.asm: Remove unused L(again).
11376 * tune/time.c (mftb): Note single mftb possible for powerpc64.
11378 * mpn/generic/mode1o.c: Use "c<s" to do underflow detection in last
11379 step, for better parallelism.
11381 * mpn/generic/get_d.c: Preserve comments about hppa fcnv,udw,dbl from
11382 previous mpz_get_d code.
11384 * tune/freq.c: Add some comments about systems not covered.
11386 * gmp-h.in (_GMP_H_HAVE_FILE): Add _MSL_STDIO_H for Metrowerks.
11387 Reported by Tomas Zahradnicky.
11389 2004-01-16 Niels Möller <nisse@lysator.liu.se>
11391 * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use MPN_DECR_U.
11392 (hgcd_adjust): Use mpn_addlsh1_n when available.
11394 2004-01-16 Kevin Ryde <kevin@swox.se>
11396 * configure.in (powerpc64-*-linux*): Try gcc64. Try -m64 with
11397 "cflags_maybe" to get it used in all probing. Add sizeof-long-8 test
11398 to check the mode is right if -m64 is not applicable.
11400 2004-01-15 Kevin Ryde <kevin@swox.se>
11402 * configure.in (--with-readline=detect): Check for readline/readline.h
11403 and readline/history.h. Report result of detection.
11405 2004-01-14 Niels Möller <nisse@lysator.liu.se>
11407 * tune/speed.c (routine): Disabled speed_mpn_hgcd_lehmer.
11408 * tune/common.c (speed_mpn_hgcd_lehmer): Disabled function.
11410 * mpn/generic/hgcd.c (mpn_hgcd_lehmer_itch, mpn_hgcd_lehmer)
11411 (mpn_hgcd_equal): Deleted functions.
11413 * mpn/generic/gcd.c (hgcd_start_row_p): Deleted function.
11414 (gcd_schoenhage): Deleted assertion code using mpn_hgcd_lehmer.
11416 * mpn/generic/hgcd.c (hgcd_final): Fixed ASSERT typos.
11417 (mpn_hgcd): To use Lehmer's algorithm, call hgcd_final directly,
11418 not mpn_hgcd_lehmer.
11420 * mpn/generic/gcd.c (gcd_schoenhage): Updated for changes to
11421 mpn_hgcd and mpn_hgcd_fix. (Schoenhage code is still disabled).
11423 * gmp-impl.h (mpn_hgcd_fix): Updated prototype.
11425 * mpn/generic/hgcd.c (mpn_hgcd_fix): Replaced a bunch of arguments
11426 by a pointer const struct hgcd_row *s. Updated callers.
11428 * mpn/generic/hgcd.c (hgcd_start_row_p): Use const for the input.
11429 Moved function definition before hgcd_jebelean.
11430 (hgcd_jebelean): Interface change, analogous to hgcd2.
11431 (mpn_hgcd_fix): Normalize v. Require that v > 0.
11432 (hgcd_adjust): Fix bug in carry update.
11433 (mpn_hgcd): Reorganized again, to adapt to mpn_hgcd/hgcd_jebelean
11434 now sometimes returning 1. Reintroduced hgcd_adjust.
11436 * mpn/generic/hgcd.c (hgcd_final): Streamlined logic for the first
11439 * mpn/generic/hgcd2.c (mpn_hgcd2): Interface change. Return 1
11440 instead of 2, in the no progress case r0=A, r1=B.
11442 * mpn/generic/hgcd.c (hgcd_adjust): Changed arguments and return
11443 value. Now takes a struct hgcd_row * and the uv size, and returns
11445 (hgcd_final): Special handling of the case hgcd2 returning 1. Now
11446 uses hgcd_adjust, instead of a full Euclid division.
11448 2004-01-13 Niels Möller <nisse@lysator.liu.se>
11450 * mpn/generic/hgcd.c (euclid_step, hgcd_case0): Merged into a
11451 single function euclid_step.
11452 (mpn_hgcd): Reorganized the logic for the second recursive call.
11453 Avoid unnecessary Euclid steps.
11455 * tests/mpn/t-hgcd.c (hgcd_values): One more test value.
11457 * tests/mpn/t-hgcd.c (hgcd_values): Added values that trigged the
11460 * mpn/generic/hgcd.c (hgcd_jebelean): Fixed off by one error.
11461 (mpn_hgcd): Simplified the logic for the first recursive call. Now
11462 it uses only the correct values from the recursive call, and
11463 doesn't do tricks with hgcd_adjust (hgcd_adjust will probably be
11464 reintroduced later, though).
11466 * tests/mpn/t-hgcd.c (mpz_mpn_equal, hgcd_ref_equal)
11467 (hgcd_ref_init, hgcd_ref_clear): New functions.
11468 (hgcd_ref): Reference implementation of hgcd, using mpz.
11469 (one_test): Use hgcd_ref. Don't use mpn_hgcd_lehmer.
11470 (main): Skip one_step if both input values are zero.
11472 2004-01-12 Niels Möller <nisse@lysator.liu.se>
11474 * mpn/generic/hgcd.c (hgcd_final): Rewritten, now uses Lehmer
11475 steps instead of a division loop.
11476 (mpn_hgcd_lehmer): Deleted old Lehmer code, instead just
11477 initialize and then call hgcd_final.
11479 * tests/tests.h: Added refmpn_free_limbs prototype.
11480 * tests/refmpn.c (refmpn_free_limbs): New function.
11482 * tests/mpn/t-hgcd.c: Try the same kind of random inputs as for
11485 2004-01-11 Niels Möller <nisse@lysator.liu.se>
11487 * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Rewritten, after some more
11488 analysis of the size reduction for one Lehmer step.
11490 * tests/mpn/t-hgcd.c: New file.
11492 2004-01-11 Torbjorn Granlund <tege@swox.com>
11495 * mpn/generic/hgcd.c (hgcd_normalize): Fix ASSERTs.
11496 (hgcd_mul): Normalize R[1].uvp[1]. Add some more ASSERTs.
11497 (hgcd_update_uv): Streamline. ASSERT that input and output is
11500 2004-01-11 Kevin Ryde <kevin@swox.se>
11502 * mpn/alpha/ev6/slot.pl: New file, derived in part from
11503 mpn/x86/k6/cross.pl.
11505 * mpn/alpha/alpha-defs.m4 (ASSERT): New macro.
11507 * mpn/asm-defs.m4 (m4_ifdef): New macro, avoiding OSF 4.0 m4 bug.
11508 (m4_assert_defined): Use it.
11510 * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (LDGP): New macro.
11511 * mpn/alpha/ev67/gcd_1.asm: Use it to re-establish gp after jsr.
11513 * configure.in, demos/calc/Makefile.am: Use -lcurses or -lncurses with
11514 readline, when available.
11516 * longlong.h (sub_ddmmss) [generic]: Use al<bl for the borrow rather
11517 than __x>al, since the former can be done without waiting for __x,
11518 helping superscalar chips, in particular alpha ev5 and ev6.
11520 * longlong.h (sub_ddmmss) [ia64]: New macro.
11522 * tests/t-sub.c: New file.
11523 * tests/Makefile.am (check_PROGRAMS): Add it.
11524 * tests/refmpn.c, tests/tests.h (refmpn_sub_ddmmss): New function.
11526 2004-01-09 Kevin Ryde <kevin@swox.se>
11528 * mpn/x86/p6/mod_34lsub1.asm: New file, derived in part from
11529 mpn/x86/mod_34lsub1.asm.
11531 * configure.in (IA64_PATTERN): Use -mtune on gcc 3.4.
11533 2004-01-07 Kevin Ryde <kevin@swox.se>
11535 * gmp-h.in, mp-h.in (__GMP_SHORT_LIMB): Renamed from _SHORT_LIMB, to
11536 keep in our namespace. (Not actually used anywhere currently.)
11537 Reported by Patrick Pelissier.
11539 * mp-h.in: Use "! defined (__GMP_WITHIN_CONFIGURE)" in the same style
11540 as gmp-h.in (though mp-h.in is not actually used during configure).
11542 * mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
11543 Use __dllexport__ and __dllimport__ to keep out of application
11544 namespace. Same previously done in gmp-h.in.
11546 2004-01-06 Kevin Ryde <kevin@swox.se>
11548 * configfsf.sub, configfsf.guess: Update to 2004-01-05.
11549 * configure.in (amd64-*-* | x86_64-*-*): Update comments on what
11550 configfsf.sub does.
11552 2004-01-04 Kevin Ryde <kevin@swox.se>
11554 * mpn/alpha/README (REFERENCES): Add tru64 assembly manuals.
11555 (ASSEMBLY RULES): Note what gcc says about !literal! etc.
11557 2004-01-03 Kevin Ryde <kevin@swox.se>
11559 * mpn/alpha/ev67/gcd_1.asm: New file.
11561 * mpn/x86/pentium4/sse2/rsh1add_n.asm: New file, derived in part from
11562 mpn/x86/pentium4/sse2/addlsh1_n.asm.
11564 * mpn/x86/p6/p3mmx/popham.asm: Note measured speeds.
11566 * mpn/ia64/hamdist.asm: Correction to inputs vs locals in alloc (makes
11567 no difference to the generated code). Corrections to a couple of
11570 * mpn/x86/pentium4/sse2/addlsh1_n.asm (PARAM_CARRY): Remove macro, not
11571 used, no such parameter.
11573 * mpn/generic/gcd.c: Use <stdio.h> for NULL.
11575 * doc/gmp.texi (Single Limb Division): Correction to tex expression
11576 for (1/2)x1. And minor wording tweaks elsewhere.
11578 * gmp-impl.h (mpn_rsh1add_n, mpn_rsh1sub_n): Correction to comments
11579 about how carries returned.
11581 * longlong.h (umul_ppmm) [generic]: Add comments about squaring
11582 (dropped from tasks list)
11584 2003-12-31 Kevin Ryde <kevin@swox.se>
11586 * demos/perl/GMP.xs (scan0, scan1): Return ~0 for not-found.
11587 * demos/perl/GMP.pm: Describe this, remove the note about ULONG_MAX
11588 being the same as ~0 (which is not true in old perl).
11589 * demos/perl/test.pl: Update tests.
11590 * demos/perl/typemap (gmp_UV): New type.
11592 * demos/perl/test.pl (fits_slong_p): Comment out uv_max test, it won't
11593 necessarily exceed a long.
11595 * demos/perl/GMP.pm: Add a remark about get_str to the bugs section.
11597 * mpn/generic/sqrtrem.c, mpz/fac_ui.c, tests/mpf/reuse.c: Add casts
11599 * tests/mpf/t-muldiv.c: Make ulimb, vlimb into ulongs, which is how
11600 they're used, for the benefit of K&R calling.
11602 * doc/gmp.texi (Square Root Algorithm): Add a summary of the algorithm.
11603 And add further index entries in various places.
11605 * mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
11607 * gmp-impl.h, mpn/generic/mul_n.c (mpn_addlsh1_n, mpn_sublsh1_n,
11608 mpn_rsh1add_n, mpn_rsh1sub_n): Move descriptions to gmp-impl.h with
11609 the prototypes, for ease of locating.
11611 2003-12-30 Torbjorn Granlund <tege@swox.com>
11613 * tune/tuneup.c (all): Disable calls of tune_gcd_schoenhage and
11616 2003-12-29 Torbjorn Granlund <tege@swox.com>
11618 * tests/mpz/t-gcd.c: Rewrite, based on suggestions by Kevin.
11620 * mpn/ia64/mul_1.asm: Amend TODO list.
11622 * mpn/sparc64/README: Remove mpn_Xmul_2, done.
11623 Add blurb about L1 cache conflicts.
11625 * mpn/generic/gcd.c: Disable Schoenhage code for now.
11627 2003-12-29 Kevin Ryde <kevin@swox.se>
11629 * mpn/generic/mul_fft.c, mpz/root.c, mpq/cmp_ui.c: Add casts for K&R.
11631 2003-12-27 Kevin Ryde <kevin@swox.se>
11633 * tests/mpz/t-mul.c (mul_kara, mul_basecase): Use __GMP_PROTO.
11635 * mpn/generic/gcd.c (NHGCD_SWAP4_2, NHGCD_SWAP3_LEFT),
11636 mpn/generic/hgcd.c (HGCD_SWAP4_LEFT, HGCD_SWAP4_RIGHT, HGCD_SWAP4_2,
11637 HGCD_SWAP3_LEFT): Aggregate initializers for automatics is an
11640 * Makefile.am (AUTOMAKE_OPTIONS): Restore this, giving no directory on
11641 ansi2knr to avoid a circular build rule.
11642 * configure.in (AM_INIT_AUTOMAKE): Note options also in Makefile.am.
11644 * configure.in (cflags_maybe): Don't loop adding cflags_maybe if the
11645 user has set CFLAGS.
11647 2003-12-24 Torbjorn Granlund <tege@swox.com>
11649 * mpn/generic/gcd.c (gcd_schoenhage_itch): Avoid unary "+".
11650 (mpn_gcd): Allocate scratch space on heap for gcd_schoenhage.
11651 (mpn_gcd): Don't invoke MPN_NORMALIZE on input operands.
11653 2003-12-23 Kevin Ryde <kevin@swox.se>
11655 * configure.in (*sparc*-*-*): Test sizeof(long)==4 or 8 for ABIs, to
11656 get the right mode when the user sets the CFLAGS.
11657 (testlist): Introduce "any_<abi>_testlist" to apply to all compilers.
11659 * demos/perl/typemap (MPZ_ASSUME, MPQ_ASSUME, MPF_ASSUME): Remove
11660 output rules, these are only meant for inputs.
11661 (MPZ_MUTATE): Remove, not used since changes for magic.
11663 * demos/perl/GMP.xs (mpz_class_hv, mpq_class_hv, mpf_class_hv): New
11664 variables, initialized in BOOT.
11665 * demos/perl/GMP.xs, demos/perl/typemap: Use them and explicit
11666 sv_bless, to save a gv_stashpv for every new object.
11668 2003-12-22 Kevin Ryde <kevin@swox.se>
11670 * mpn/alpha/mode1o.c, mpn/alpha/dive_1.c: Moved from ev5/mode1o.c and
11671 ev5/dive_1.c, these are good for ev4, and would like them in a generic
11674 2003-12-21 Kevin Ryde <kevin@swox.se>
11676 * doc/gmp.texi (Integer Logic and Bit Fiddling): Say "bitwise" in
11677 mpz_and, mpz_ior and mpz_xor, to avoid any confusion with what C means
11678 by "logical". Reported by Rüdiger Schütz.
11680 * gmp-h.in (_GMP_H_HAVE_FILE): Note why defined(EOF) is not good.
11682 2003-12-20 Torbjorn Granlund <tege@swox.com>
11684 * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use mpn_cmp instead of
11685 mpn_sub_n where possible. Use mp_size_t for relevant variables.
11687 2003-12-20 Kevin Ryde <kevin@swox.se>
11689 * tune/speed.h (SPEED_TMP_ALLOC_LIMBS): Correction to last change,
11690 don't want "- 1" on the TMP_ALLOC_LIMBS.
11692 * demos/expr/expr.h: Test #ifdef MPFR_VERSION_MAJOR for when mpfr.h is
11693 included, not GMP_RNDZ which is now an enum.
11695 * demos/expr/exprfra.c (e_mpfr_ulong_p): Use mpfr_integer_p and
11697 (e_mpfr_get_ui_fits): Use mpfr_get_ui.
11699 * mpfr/*: Update to mpfr cvs head 2003-12-20.
11701 * configure, config.in: Update to autoconf 2.59.
11702 * */Makefile.in, configure, aclocal.m4, ansi2knr.c, install-sh,
11703 doc/mdate-sh: Update to automake 1.8.
11705 * mkinstalldirs: Remove, not required by automake 1.8.
11706 * doc/gmp.texi (Build Options): HTML is a usual target in automake 1.8.
11708 * configure.in (AC_PREREQ): Require autoconf 2.59.
11709 (AM_INIT_AUTOMAKE): Require automake 1.8.
11710 (AC_C_INLINE): Use rather than GMP_C_INLINE, now has #ifndef
11711 __cplusplus we want.
11712 (gettimeofday): Use AC_CHECK_FUNCS rather than our workaround code,
11715 * acinclude.m4 (GMP_C_INLINE): Remove.
11716 (GMP_H_EXTERN_INLINE): Use AC_C_INLINE.
11717 (GMP_PROG_AR): Comment on automake $ARFLAGS.
11719 2003-12-19 Niels Möller <nisse@lysator.liu.se>
11721 * mpn/generic/hgcd.c (mpn_diff_smaller_p): Rewrote function. Tried
11722 to explain how it works.
11723 (slow_diff_smaller_p, wrap_mpn_diff_smaller_p) [WANT_ASSERT]: Use
11724 CPP to wrap assertion checks around all calls to
11725 mpn_diff_smaller_p.
11727 * mpn/generic/hgcd.c (mpn_addmul2_n_1) [nails]: Fixed carry handling.
11729 * mpn/generic/hgcd.c (mpn_diff_smaller_p) [nails]: Use
11730 GMP_NUMB_MAX, not MP_LIMB_T_MAX.
11731 (mpn_hgcd_itch): Improved size calculation.
11732 (mpn_hgcd_max_recursion): Moved function from qstack.c. Should to
11733 be recompiled when HGCD_SCHOENHAGE_THRESHOLD is tuned.
11735 * mpn/generic/qstack.c (mpn_hgcd_max_recursion): ... moved from
11738 2003-12-19 Torbjorn Granlund <tege@swox.com>
11740 * tests/mpf/t-get_d.c: Print message before aborting.
11742 * mpn/generic/hgcd2.c (mpn_hgcd2): Substitute always-zero variable
11743 with 0. Remove bogus comment.
11745 * mpn/generic/get_d.c: Make ONE_LIMB case actually work for nails.
11747 2003-12-18 Niels Möller <niels@lysator.liu.se>
11749 * mpn/generic/hgcd.c (hgcd_update_r): Assert that the output r2 is
11750 smaller than the input r1.
11752 2003-12-18 Torbjorn Granlund <tege@swox.com>
11754 * mpz/get_d.c: Don't include longlong.h.
11756 * tests/mpz/t-mul.c (ref_mpn_mul): Handle un == vn specially, to avoid
11757 a dummy r/w outside of allocated area.
11759 2003-12-18 Kevin Ryde <kevin@swox.se>
11761 * mpn/alpha/unicos.m4 (ALIGN): Add comments on what GCC does.
11763 * configure.in (fat setups), acinclude.m4 (GMP_INIT): Obscure
11764 include() from automake 1.8 aclocal.
11765 * acinclude.m4: Quote names in AC_DEFUN, for automake 1.8 aclocal.
11767 2003-12-17 Niels Möller <nisse@lysator.liu.se>
11769 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer) [nails]:
11770 Enabled code also for GMP_NAIL_BITS > 0.
11771 * tune/speed.c [nails]: Enable speed_mpn_hgcd and
11772 speed_mpn_hgcd_lehmer.
11773 * tune/tuneup.c (tune_hgcd) [nails]: Likewise.
11775 * mpn/generic/gcd.c [nails]: Use Schönhage's algorithm also for
11778 * mpn/generic/hgcd.c [nails]: Enable the code for GMP_NAIL_BITS > 0.
11779 (MPN_EXTRACT_LIMB) [nails]: Handle nails.
11780 (__gmpn_hgcd_sanity): Allocate temporaries on the heap, not on the
11781 stack. Also check that r[i] >= r[i+1].
11782 (mpn_hgcd2_lehmer_step) [nails]: Handle nails.
11783 (mpn_hgcd_lehmer): When we temporarily have r3 > r2, avoid
11784 trigging that assert in __gmpn_hgcd_sanity.
11785 (mpn_hgcd): Likewise.
11787 * mpn/generic/hgcd2.c (div2) [nails]: Alternative nail-aware
11789 (SUB_2): New macro of Kevin's, which reduces do sub_ddmmss in the
11791 (HGCD2_STEP): Use SUB_2, not sub_ddmmss. Added alternative version
11793 (mpn_hgcd2) [nails]: Use SUB_2, not sub_ddmmss. New nail-aware
11794 code for checking Jebelean's condition.
11796 2003-12-13 Kevin Ryde <kevin@swox.se>
11798 * mpq/get_d.c: Amend comments per mpn_get_d change.
11799 (limb2dbl): Remove, no longer used.
11801 * gmp-impl.h (DIVREM_1_NORM_THRESHOLD etc) [nails]: Correction to
11802 comments, MP_SIZE_T_MAX means preinv never.
11804 * gmp-impl.h (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD) [nails]:
11805 Remove overrides, divexact_1 and modexact_1 have been nailified.
11807 * mpz/inp_str.c (mpz_inp_str_nowhite): Use ASSERT_ALWAYS for EOF value
11810 * tests/refmpn.c (refmpn_rsh1add_n, refmpn_rsh1sub_n): Parens around
11811 GMP_NUMB_BITS - 1 with ">>", to quieten gcc -Wall.
11812 * tests/t-constants.c (main), tests/t-count_zeros.c (check_clz),
11813 tests/t-modlinv.c (one), tests/mpz/t-jac.c (try_si_zi),
11814 tests/mpq/t-get_d.c (check_onebit): : Correction to printfs.
11815 * tests/mpn/t-fat.c: Add <string.h> for memcpy.
11816 * tests/mpz/t-scan.c (check_ref): Remove unused variable "isigned".
11817 * tests/mpq/t-get_d.c (check_onebit): Remove unused variable "limit".
11818 * tests/mpf/t-set_si.c, tests/mpf/t-set_ui.c (check_data): Braces for
11820 * tests/devel/try.c (mpn_divexact_by3_fun, mpn_modexact_1_odd_fun):
11821 Correction to return values.
11823 * doc/gmp.texi (Miscellaneous Integer Functions): Note mpz_sizeinbase
11824 can be used to locate the most significant bit. Reword a bit for
11827 2003-12-12 Niels Möller <niels@lysator.liu.se>
11829 * mpn/generic/hgcd.c (__gmpn_hgcd_sanity): Fixed stack buffer
11831 * mpn/generic/hgcd.c: Improved comments.
11833 2003-12-11 Torbjorn Granlund <tege@swox.com>
11835 * gmp-impl.h: Change asm => __asm__, tabify.
11836 * mpz/get_d_2exp.c: Likewise.
11837 * mpf/get_d_2exp.c: Likewise.
11839 * tests/cxx/t-ops.cc: #if .. #endif out tests that cause ambiguities.
11841 2003-12-10 Torbjorn Granlund <tege@swox.com>
11843 * tests/mpz/t-gcd.c: Generate operands with sizes as a geometric
11844 progression, to allow for larger operands and less varying timing.
11846 * tune/tuneup.c (tune_gcd_schoenhage): Set param.step_factor.
11847 (tune_hgcd): Likewise.
11849 2003-12-10 Kevin Ryde <kevin@swox.se>
11851 * demos/perl/test.pl: Should be $] for perl version in old perl.
11853 * configure.in (sparc64-*-*): Single block of gcc configs for all
11854 systems, on unknown systems try both ABI 32 and 64.
11856 * configure.in (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New AC_SUBSTs with
11857 options to generate .def files with windows DLLs.
11858 * Makefile.am (libgmp_la_LDFLAGS, libgmpxx_la_LDFLAGS): Use them.
11860 * mpn/generic/gcd.c: Use ABOVE_THRESHOLD / BELOW_THRESHOLD, to follow
11861 convention and cooperate with tune/tuneup.c.
11863 * tune/tuneup.c (tune_gcd_schoenhage): Increase max_size to 3000, side
11864 default 1000 is approx the crossover point on athlon.
11866 * tune/common.c, tune/speed.c, tune/speed.h, tune/speed-ext.c,
11867 tune/tuneup.c (SPEED_TMP_ALLOC_LIMBS): Take variable as parameter
11868 rather than returning a value, avoids alloca in a function call.
11869 * tune/common.c, tune/speed.h (speed_tmp_alloc_adjust): Remove, now
11870 inline in SPEED_TMP_ALLOC_LIMBS, and using ptr-NULL for alignment
11873 * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal,
11874 __gmp_binary_less, __gmp_binary_less_equal, __gmp_binary_greater,
11875 __gmp_binary_greater_equal, __gmp_cmp_function): Use mpfr_cmp_si and
11877 * tests/cxx/t-ops.cc: Exercise this.
11879 * demos/perl/Makefile.PL: Don't install sample.pl and test2.pl.
11881 * demos/perl/GMP.xs (use_sv): Prefer PV over IV or NV to avoid any
11883 * demos/perl/test.pl: Exercise this.
11885 * demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage.
11886 * demos/perl/test.pl: Exercise this.
11888 2003-12-08 Kevin Ryde <kevin@swox.se>
11890 * demos/perl/GMP.pm: Correction to canonicalize example.
11892 * demos/perl/GMP.xs: New type check scheme, support magic scalars,
11893 support UV when available. Remove some unused local variables.
11894 (coerce_long): Check range of double.
11895 (get_d_2exp): Remove stray printf.
11897 * demos/perl/test.pl: Exercise magic, rearrange to make it clearer
11898 what's being tested.
11900 2003-12-07 Kevin Ryde <kevin@swox.se>
11902 * mpn/generic/hgcd.c (mpn_hgcd): Use BELOW_THRESHOLD, to follow the
11903 convention of N<THRESH for the lower algorithm, not <=. Fixes
11904 algorithm selection in tuneup.c.
11906 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Use intended
11907 align_xp, align_yp.
11909 * tune/tuneup.c (mul_toom3_threshold): Use MUL_TOOM3_THRESHOLD_LIMIT,
11910 for the benefit of ASSERT in mpn_mul_n.
11912 * tune/tuneup.c (tune_mul): Correction to toom3 param.min_size, should
11913 use MPN_TOOM3_MUL_N_MINSIZE.
11915 * tune/speed.c (check_align_option): Correction to printf format.
11916 * tune/freq.c (freq_sysctl_hw_model): Remove unused "i" variable.
11918 * scanf/doscan.c: Correction to a couple of trace printfs.
11919 Add <stdlib.h> for strtol.
11921 * tests/misc/t-scanf.c (test_sscanf_eof_ok): New function.
11922 (check_misc): Use it to suppress tests broken by libc.
11923 And should be EOF rather than -1 in various places.
11925 2003-12-06 Torbjorn Granlund <tege@swox.com>
11927 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
11928 Move SPEED_TMP_ALLOC_LIMBS invocations out from calls.
11930 * mpn/generic/get_str.c (mpn_get_str, POW2_P case):
11931 Don't append extra '\0' byte.
11933 2003-12-05 Niels Möller <niels@lysator.liu.se>
11935 * tune/common.c (speed_mpn_hgcd_lehmer, speed_mpn_hgcd):
11936 Updated for the renaming hgcd_sanity -> ASSERT_HGCD.
11938 * mpn/generic/gcd.c (gcd_schoenhage): TMP_DECL must be the final
11939 declaration in the declaration section of a block.
11941 * tune/speed.h (mpn_gcd_accel): Added prototype.
11943 2003-12-05 Torbjorn Granlund <tege@swox.com>
11945 * randmt.c (__gmp_mt_recalc_buffer): Put parens around "&" expressions
11948 * mpf/get_str.c: Remove unused variable "fracn".
11950 2003-12-03 Kevin Ryde <kevin@swox.se>
11952 * configure.in, Makefile.am (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New
11953 AC_SUBSTs, use them to create .def files with Windows DLLs.
11954 * doc/gmp.texi (Notes for Particular Systems): Update notes on mingw
11957 * mpz/export.c: Allow NULL for countp.
11958 * doc/gmp.texi (Integer Import and Export): Describe this.
11959 Suggested by Jack Lloyd.
11961 * mpn/x86/p6/aors_n.asm: New file, grabbing the K7 code.
11962 Superiority of this reported by Patrick Pelissier.
11964 2003-11-30 Kevin Ryde <kevin@swox.se>
11966 * mpn/alpha/ev67/popcount.asm, mpn/alpha/ev67/hamdist.asm: New files.
11968 * mpn/alpha/ev67: New directory.
11969 * configure.in (alphaev67, alphaev68, alphaev7*): Use it.
11971 * doc/gmp.texi (GMPrefu, GMPpxrefu): Change back to plain ref and
11972 pxref, remove macros.
11973 (GMPreftopu, GMPpxreftopu): Remove URL parameter, rename to GMPreftop
11975 (Debugging): Remove debauch, seems to have disappeared.
11976 (Language Bindings): Corrections to URLs for CLN, Omni F77, Pike.
11978 2003-11-29 Kevin Ryde <kevin@swox.se>
11980 * demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
11983 * demos/perl/GMP.xs (fits_slong_p): Use LONG_MAX+1 to avoid possible
11984 rounding of 0x7F..FF in a double on 64-bit systems.
11986 * configure.in (ppc601-*-*): Remove this case, it never matched
11987 anything, the name adopted is powerpc601.
11988 (powerpc601-*-*): Use gcc -mcpu=601, xlc -qarch=601.
11990 * configure.in: Introduce ${cc}_cflags_maybe, used if they work.
11991 (*sparc*-*-*) [ABI=32]: Add gcc_cflags_maybe=-m32 to force that mode.
11993 * doc/gmp.texi (Introduction to GMP): Add AMD64 to optimizations list.
11994 (Build Options): Add cpu types alphaev7 and amd64. Update texinfo
11995 html cross reference.
11997 2003-11-28 Niels Möller <nisse@lysator.liu.se>
11999 * tune/tuneup.c (tune_hgcd): Disable if GMP_NAIL_BITS > 0.
12000 * tune/speed.c (routine): Likewise.
12001 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Likewise.
12003 * mpn/generic/gcd.c, mpn/generic/hgcd.c, mpn/generic/hgcd2.c
12004 [GMP_NAIL_BITS]: Disabled new code if we have nails.
12006 * mpn/generic/gcd.c (MPN_LEQ_P): Copied macro definition (needed
12007 for compilation with --enable-assert).
12009 * tune/tuneup.c (hgcd_schoenhage_threshold,
12010 gcd_schoenhage_threshold): New variables.
12011 (tune_hgcd, tune_gcd_schoenhage): New functions.
12012 (all): Call tune_hgcd and tune_gcd_schoenhage.
12014 * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer)
12015 (speed_mpn_gcd_accel): New functions.
12016 * tune/speed.c (routine): Added mpn_hgcd, mpn_hgcd_lehmer and
12018 * tune/speed.h: Added corresponding prototypes.
12020 * tune/gcd_accel.c: New file.
12022 * tune/gcd_bin.c (GCD_SCHOENHAGE_THRESHOLD): Set to MP_SIZE_T_MAX.
12024 * tune/Makefile.am (libspeed_la_SOURCES): Added gcd_accel.c.
12025 (TUNE_MPN_SRCS_BASIC): Added hgcd.c.
12027 * mpn/x86/k7/gmp-mparam.h (HGCD_SCHOENHAGE_THRESHOLD)
12028 (GCD_SCHOENHAGE_THRESHOLD): Tuned values.
12030 * mpn/generic/gcd.c (mpn_gcd, gcd_binary_odd): Renamed the
12031 old mpn_gcd function (which implements accelerated binary gcd) to
12033 (gcd_binary): New function, with the additional book keeping
12034 needed when using gcd_binary_odd to compute the gcd of non-odd
12036 (hgcd_tdiv): New function.
12037 (gcd_lehmer): New function, currently #if:ed out.
12038 (hgcd_start_row_p): New function, duplicatd from hgcd.c.
12039 (gcd_schoenhage_itch): New function.
12040 (gcd_schoenhage): New function.
12041 (mpn_gcd): New advertised gcd function, which calls
12042 mpn_gcd_binary_odd or mpn_gcd_schoenhage, depending on the size of
12045 * mpn/generic/hgcd.c (mpn_hgcd2_lehmer_step): Renamed function
12046 (was lehmer_step), and made non-static. Updated callers.
12048 * gmp-impl.h (GCD_LEHMER_THRESHOLD): #if:ed out this macro.
12049 (mpn_hgcd2_lehmer_step): Added prototype.
12051 2003-11-27 Niels Möller <nisse@lysator.liu.se>
12053 * tests/mpz/t-gcd.c (gcd_values): Moved definition, so that we
12054 don't need to forward declare the array.
12056 2003-11-26 Niels Möller <nisse@lysator.liu.se>
12058 * mpn/generic/hgcd.c (mpn_hgcd2_fix): Deleted duplicate definition
12059 (the function belongs to hgcd2.c).
12061 2003-11-26 Torbjorn Granlund <tege@swox.com>
12063 * tests/mpz/t-gcd.c: Generate random operands up to 32767 bits;
12064 decrease # of test to 1000.
12065 (gcd_values): Remove oversize test case.
12067 2003-11-26 Niels Möller <niels@lysator.liu.se>
12069 * gmp-impl.h: Added name mangling for hgcd-related functions. Also
12071 (MPN_LEQ_P, MPN_EXTRACT_LIMB): Moved macros to hgcd.c.
12072 * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
12073 Adapted to name changes.
12075 * tests/mpz/t-gcd.c (main): Added some tests with non-random
12078 2003-11-25 Niels Möller <nisse@lysator.liu.se>
12080 * gmp-impl.h (MPN_LEQ_P, MPN_EXTRACT_LIMB): New macros.
12081 (struct qstack, struct hgcd2_row, struct hgcd2, struct hgcd_row)
12082 (struct hgcd): New structs. Also added prototypes for new hgcd,
12083 hgcd2, qstack and gcd functions.
12085 * configure.in (gmp_mpn_functions): Added hgcd2, hgcd and qstack.
12087 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added hgcd2.c,
12088 hgcd.c and qstack.c.
12090 * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
12091 New files, needed for the sub-quadratic gcd.
12093 2003-11-25 Kevin Ryde <kevin@swox.se>
12095 * doc/gmp.texi (Language Bindings): Add Axiom.
12097 2003-11-22 Kevin Ryde <kevin@swox.se>
12099 * mpn/alpha/README: More notes on assembler syntax variations.
12101 * mpn/alpha/alpha-defs.m4, mpn/alpha/unicos.m4 (unop): Should be ldq_u
12102 not bis, and move to alpha-defs.m4 since it can be happily used
12105 * mpn/alpha/alpha-defs.m4, mpn/alpha/default.m4, mpn/alpha/unicos.m4
12106 (bigend): Move to alpha-defs.m4 and base it on HAVE_LIMB_BIG_ENDIAN or
12107 HAVE_LIMB_LITTLE_ENDIAN, so as not to hard code system endianness.
12109 * mpn/alpha/alpha-defs.m4: New file.
12110 * configure.in (alpha*-*-*): Use it.
12112 2003-11-21 Kevin Ryde <kevin@swox.se>
12114 * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-21.
12116 * mpn/alpha/ev5/com_n.asm: Change "not" to "ornot r31", since "not"
12117 isn't recognised by on Cray Unicos. Add missing "gp" to PROLOGUE.
12118 * mpn/alpha/README: Add a note on "not".
12120 2003-11-19 Torbjorn Granlund <tege@swox.com>
12122 * mpn/alpha/aorslsh1_n.asm: Slightly rework feed-in code, avoiding
12123 spurious reads beyond operand limits.
12125 * mpn/alpha/ev5/com_n.asm: Add ASM_START/ASM_END.
12127 * mpn/generic/mul_fft.c (mpn_fft_zero_p): Remove unused function.
12128 (mpn_lshift_com): Make static, nailify properly.
12130 2003-11-19 Kevin Ryde <kevin@swox.se>
12132 * mpn/generic/diveby3.c: Use a "q" variable to make it clearer what
12135 * mpn/powerpc32/750/lshift.asm, mpn/powerpc32/750/rshift.asm: New
12138 * mpn/alpha/ev5/com_n.asm: New file.
12140 * doc/gmp.texi (Assembler Functional Units, Assembler Writing Guide):
12141 New sections by Torbjorn, tweaked by me.
12143 2003-11-17 Torbjorn Granlund <tege@swox.com>
12145 * mpn/powerpc32: Add power4/powerpc970 cycle counts.
12146 Use cmpwi instead of cmpi to placate darwin.
12148 2003-11-15 Kevin Ryde <kevin@swox.se>
12150 * config.guess: Add comments on MacOS "machine" command.
12152 * tests/devel/try.c (main): Use gmp_randinit_default explicitly on
12153 __gmp_rands, since RANDS doesn't allow seeding.
12155 * doc/gmp.texi (Assigning Integers): Remove notes on possible change
12156 to disallow whitespace, this would be an incompatible change and
12157 really can't be made.
12158 (Toom 3-Way Multiplication): Updates for Paul's new code.
12160 * mpn/generic/mul_n.c (toom3_interpolate, mpn_toom3_mul_n): Put
12161 if/else braces around whole of #if code, for readability.
12163 * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
12164 refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps
12167 * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-15.
12169 2003-11-14 Torbjorn Granlund <tege@swox.com>
12171 * mpn/alpha/aorslsh1_n.asm: Use Cray-friendly syntax for "br".
12173 2003-11-13 Torbjorn Granlund <tege@swox.com>
12175 * mpn/alpha/aorslsh1_n.asm: New file.
12177 2003-11-12 Kevin Ryde <kevin@swox.se>
12179 * acinclude.m4 (GMP_PROG_CC_WORKS): Add case provoking AIX power2
12180 assembler, test code by Torbjorn.
12181 * configure.in (power*-*-*): Add a comment about -mcpu=rios2 fallback.
12183 * tune/speed.c (main): Use gmp_randinit_default explicitly on
12184 __gmp_rands, since RANDS doesn't allow seeding.
12186 * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-12.
12188 * gmp-impl.h, randmt.h (__gmp_randinit_mt_noseed): Move prototype to
12189 gmp-impl.h, for use by RANDS.
12191 * mpn/Makeasm.am (.s, .S, .asm): Quote $< in test -f, per automake.
12192 (.obj): Use test -f and $(CYGPATH_W) as per automake.
12194 2003-11-11 Kevin Ryde <kevin@swox.se>
12196 * configure.in: Make umul and udiv standard-optional objects, rather
12197 than under various extra_functions.
12199 * mpn/pa32/hppa1_1/pa7100/add_n.asm,
12200 mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
12201 mpn/pa32/hppa1_1/pa7100/lshift.asm,
12202 mpn/pa32/hppa1_1/pa7100/rshift.asm,
12203 mpn/pa32/hppa1_1/pa7100/sub_n.asm,
12204 mpn/pa32/hppa1_1/pa7100/submul_1.asm: Use LDEF for labels.
12206 * mpf/set_str.c: Don't use memcmp for decimal point testing, just a
12207 loop is enough and avoids any chance of memcmp reading past the end of
12210 * randmts.c, randmt.h: New files.
12211 * Makefile.am (libgmp_la_SOURCES): Add them.
12212 * randmt.c: Move seeding to randmts.c, common defines in randmt.h.
12213 * gmp-impl.h (RANDS): Use __gmp_randinit_mt_noseed.
12214 * tests/misc.c (tests_rand_start): Use gmp_randinit_default
12215 explicitly, not RANDS.
12217 * mpn/ia64/ia64-defs.m4 (PROLOGUE_cpu): Use 32-byte alignment, for the
12218 benefit of itanium 2.
12219 * mpn/ia64/gcd_1.asm: Remove own .align 32.
12221 * mpn/ia64/ia64-defs.m4 (ALIGN): New define, using IA64_ALIGN_OK.
12222 * mpn/ia64/hamdist.asm: Use ALIGN instead of .align.
12224 * acinclude.m4 (GMP_ASM_IA64_ALIGN_OK): New macro.
12225 * configure.in (IA64_PATTERN): Use it.
12226 * mpn/ia64/README: Add notes on gas big endian align problem.
12228 2003-11-10 Torbjorn Granlund <tege@swox.com>
12230 * mpn/ia64/mul_1.asm: Rewrite.
12232 2003-11-08 Torbjorn Granlund <tege@swox.com>
12234 * mpn/x86/aors_n.asm: Align loop to a multiple of 16. Also align
12235 M4_function_n to a multiple of 16, to minimize alignment padding.
12236 Update P6 cycle counts reflecting improvements with new alignment.
12238 2003-11-07 Kevin Ryde <kevin@swox.se>
12240 * gmp-impl.h (HAVE_HOST_CPU_alpha_CIX): New define.
12241 (ULONG_PARITY, popc_limb): Use it, to pick up ev7 as well as 67 and 68.
12242 * longlong.h (count_leading_zeros, count_trailing_zeros): Ditto.
12244 * doc/gmp.texi (Notes for Package Builds): Add notes on multi-ABI
12246 (ABI and ISA): Add GNU/Linux ABI=64.
12247 (Binary GCD): Add notes on 1x1 GCD algorithms.
12249 * mpn/alpha/README: Add some literature references.
12251 * mpn/ia64/mode1o.asm: Various corrections to initial checkin.
12252 * mpn/ia64/ia64-defs.m4 (ASSERT): Correction to arg quoting.
12254 2003-11-05 Torbjorn Granlund <tege@swox.com>
12256 * mpn/powerpc64/linux64.m4: New file.
12257 * configure.in (POWERPC64_PATTERN): Handle *-*-linux*.
12260 * mpn/ia64/logops_n.asm: New file.
12262 2003-11-05 Kevin Ryde <kevin@swox.se>
12264 * tune/freq.c (freq_sysctl_hw_model): Relax to just look for "%u MHz",
12265 for the benefit of sparc cypress under netbsd 1.6.1.
12267 * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-05.
12269 * mpn/alpha/ev5/dive_1.c: New file.
12271 * configure.in (x86_64-*-*): Accept together with amd64-*-*.
12273 * tune/speed.c: Check range of -x,-y,-w,-W alignment specifiers.
12274 * tune/speed.h (CACHE_LINE_SIZE): Amend comments.
12276 2003-11-04 Torbjorn Granlund <tege@swox.com>
12278 * tune/speed.c: Fix typo in testing HAVE_NATIVE_mpn_modexact_1_odd.
12280 2003-11-03 Kevin Ryde <kevin@swox.se>
12282 * mpn/ia64/hamdist.asm: New file.
12283 * mpn/ia64/mode1o.asm: New file.
12284 * mpn/ia64/ia64-defs.m4 (ASSERT): New macro.
12286 * tests/mpz/t-set_d.c (check_2n_plus_1): New test.
12288 2003-11-01 Kevin Ryde <kevin@swox.se>
12290 * mpz/fac_ui.c (BSWAP_ULONG) [limb==2*long]: Remove this case, it
12291 provokes code gen problems on HP cc.
12292 (BSWAP_ULONG) [generic]: Rename __dst variable to avoid conflicts with
12294 Fix by Jason Moxham.
12296 * mpn/powerpc32/mode1o.asm: Use 16-bit i*i for early out, no need to
12297 truncate divisor. Amend stated 750/7400 speeds, and note operands
12298 that give the extremes.
12300 * mpz/set_d.c: Don't use a special case for d < MP_BASE_AS_DOUBLE, gcc
12301 3.3 -mpowerpc64 on darwin gets ulonglong->double casts wrong.
12303 * mpn/generic/diveby3.c: Show a better style carry handling in the
12304 alternative pipelined sample code.
12306 Revert this, the longlong.h macros need -mpowerpc64:
12307 * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
12308 * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
12311 2003-10-31 Torbjorn Granlund <tege@swox.com>
12313 * mpn/powerpc64/mode64/submul_1.asm: Move an instruction to save a
12316 * mpn/powerpc64/mode64/divrem_1.asm: Fix several syntax problems
12317 revealed on Mac OS X.
12319 * mpn/powerpc64/mode64/*.asm: Add cycle counts for POWER4.
12321 * mpn/powerpc64/sqr_diagonal.asm: Rewrite to save a cycle on POWER4.
12323 2003-10-31 Kevin Ryde <kevin@swox.se>
12325 * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-31.
12327 * mpn/powerpc64/README: Add subdirectory organisation notes.
12329 * tests/mpn/t-get_d.c: Don't use limits.h, LONG_MIN is wrong on gcc
12330 2.95 with -mcpu=ultrasparc.
12332 * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
12333 * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
12336 * configure.in (powerpc64-*-darwin*) [ABI=mode32]: Use gcc -mcpu flags.
12338 * mpn/ia64/divrem_1.asm, mpn/ia64/gcd_1.asm: Use "C" for comments.
12339 * mpn/ia64/README, mpn/ia64/ia64-defs.m4: Note this.
12341 * mpn/ia64/ia64-defs.m4: Renamed from default.m4, per other defs files.
12342 * configure.in (IA64_PATTERN): Update GMP_INCLUDE_MPN.
12344 * doc/gmp.texi (Notes for Particular Systems): Remove m68k ABI notes
12345 for -mshort and PalmOS, now works.
12346 (References): Correction, GMP Square Root proof already there, just
12347 wanting URL from RRRR 4475.
12349 2003-10-29 Kevin Ryde <kevin@swox.se>
12351 * configure.in (sparc*-*-*): Use gcc -m32 when that option works, to
12352 force 32-bit mode on dual 32/64 configurations like GNU/Linux.
12353 (sparc64-*-linux*): Add support for ABI=64.
12355 * mpn/generic/pre_divrem_1.c: In fraction part, use CNST_LIMB(0) with
12356 udiv_qrnnd_preinv to avoid warning about shift > type.
12358 * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-29.
12360 * tests/cxx/t-istream.cc: Avoid tellg() checks if putback() doesn't
12361 update that, avoids certain g++ 2.96 problems.
12363 * tests/mpn/t-fat.c: New file.
12364 * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
12366 * configure.in (CPUVEC_INSTALL, ITERATE_FAT_THRESHOLDS): New macros
12368 * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Use CPUVEC_INSTALL instead
12369 of memcpy. Correction to location of "initialized" set. Improve
12372 2003-10-27 Torbjorn Granlund <tege@swox.com>
12374 * mpn/sparc64/mul_1.asm: Change addcc => add in a few places.
12375 * mpn/sparc64/addmul_1.asm: Likewise.
12377 * mpn/sparc32/v9/mul_1.asm: Apply cross-jumping.
12378 * mpn/sparc32/v9/addmul_1.asm: Likewise.
12379 * mpn/sparc32/v9/submul_1.asm: Likewise.
12380 * mpn/sparc32/v9/sqr_diagonal.asm: Likewise.
12382 2003-10-27 Kevin Ryde <kevin@swox.se>
12384 * tests/cxx/t-misc.cc: Don't use <climits>, on g++ 2.95.4 (debian 3.0)
12385 -mcpu=ultrasparc LONG_MIN is wrong and kills the compile.
12387 * tests/cxx/t-istream.cc: Correction to tellg tests, don't assume
12388 streampos is zero based.
12390 * configure.in (HAVE_HOST_CPU_FAMILY_alpha): New define for config.h.
12391 * mpn/generic/get_d.c: Use it instead of __alpha for alpha workaround,
12392 since Cray cc doesn't define __alpha.
12394 * mpn/x86/README: Revise PIC coding notes a bit, add gcc visibility
12397 2003-10-25 Kevin Ryde <kevin@swox.se>
12399 * mpn/ia64/gcd_1.asm: New file.
12401 * tune/many.pl: Allow for PROLOGUE(fun,...), as used on alpha.
12403 * doc/gmp.texi (C++ Formatted Input): Describe base indicator handling.
12405 * tests/cxx/t-istream.cc: New file.
12406 * tests/cxx/Makefile.am: Add it.
12408 * cxx/ismpznw.cc: New file, integer input without whitespace ...
12409 * cxx/ismpz.cc: ... from here.
12410 * gmp-impl.h (__gmpz_operator_in_nowhite): Add prototype.
12411 * cxx/ismpq.cc: Rewrite using mpz input routines. Change to accept a
12412 separate base indicator on numerator and denominator. Fix base
12413 indicator case where "123/0456" would stop at "123/0".
12414 * Makefile.am, cxx/Makefile.am: Add cxx/ismpznw.cc.
12416 * tests/mpz/t-set_d.c: New file, derived from tests/mpz/t-set_si.c
12417 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
12419 * mpn/m68k/lshift.asm, mpn/m68k/rshift.asm: Support 16-bit int and
12421 * mpn/m68k/README: Add notes on this.
12422 * configure.in (SIZEOF_UNSIGNED): New define in config.m4.
12423 * mpn/m68k/m68k-defs.m4 (m68k_definsn): Add cmpw, movew.
12424 Reported by Patrick Pelissier.
12426 * mpn/m68k/t-m68k-defs.pl: Don't use -> with hashes, to avoid
12427 deprecation warnings from perl 5.8.
12429 * configure.in (viac3-*-*): Use just x86/pentium in $path not x86/p6.
12430 If gcc is to be believed the old C3s don't have cmov.
12432 * Makefile.am: Amend comments about not building from libtool
12433 convenience libraries.
12435 * mpn/asm-defs.m4 (PROLOGUE): Use m4_file_seen, for correct filename
12436 in missing EPILOGUE error messages.
12437 (m4_file_seen): Amend comments about where used.
12439 * Makefile.am (CXX_OBJECTS): Remove $U, C++ files are not subject to
12442 * gmp-h.in (mpn_divmod_1): Use __GMP_CAST, to avoid warnings in
12443 applications using g++ -Wold-style-cast.
12445 * mpn/z8000/README: New file.
12447 2003-10-22 Kevin Ryde <kevin@swox.se>
12449 * mpn/generic/get_d.c (CONST_1024, CONST_NEG_1023,
12450 CONST_NEG_1022_SUB_53): Replace ALPHA_WORKAROUND with a non-gcc-ism,
12451 and use on Cray Unicos alpha too, which has the same problem.
12453 * configure.in (powerpc64-*-darwin*): Make ABI=32 available as the
12454 final fallback, remove mode64 until we know how it will work.
12456 * doc/gmp.texi (Build Options): Add powerpc970 to available CPUs.
12457 (ABI and ISA): Add mode32 for Darwin.
12459 * configure.in (gettimeofday): Use an explicit AC_TRY_LINK, to avoid
12460 known autoconf 2.57 problems with gettimeofday in AC_CHECK_FUNCS on
12463 * configure.in (powerpc*-*-*): Use ABI=32 instead of ABI=standard for
12464 the default 32-bit ABI. Fixes powerpc64-*-aix* which is documented as
12465 choices "aix64 32" but had "aix64 standard".
12467 * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-22.
12469 * doc/gmp.texi (Notes for Particular Systems): Note m68k gcc -mshort
12470 and PalmOS calling conventions not supported. Reported by Patrick
12472 (References): Add Paul Zimmermann's Inria 4475 paper.
12474 2003-10-21 Torbjorn Granlund <tege@swox.com>
12476 * mpn/ia64/submul_1.asm: Slightly reschedule loop to accommodate
12477 Itanium 2 getf.sig latency.
12479 2003-10-21 Kevin Ryde <kevin@swox.se>
12481 * tests/mpn/t-instrument.c: Add mpn_addlsh1_n, mpn_rsh1add_n,
12482 mpn_rsh1sub_n, mpn_sub_nc, mpn_sublsh1_n. Typo in mpn_preinv_divrem_1
12485 2003-10-20 Torbjorn Granlund <tege@swox.com>
12487 * mpn/powerpc64/mode32/add_n.asm: New file.
12488 * mpn/powerpc64/mode32/sub_n.asm: New file.
12489 * mpn/powerpc64/mode32/mul_1.asm: New file.
12490 * mpn/powerpc64/mode32/addmul_1.asm: New file.
12491 * mpn/powerpc64/mode32/submul_1.asm: New file.
12493 2003-10-19 Torbjorn Granlund <tege@swox.com>
12495 * longlong.h (AMD64): __x86_64__ => __amd64__.
12496 (64-bit powerpc): Only define carry-dependent macros if
12499 * acinclude.m4 (POWERPC64_PATTERN): Add powerpc970-*-*.
12501 * configure.in (POWERPC64_PATTERN): Handle *-*-darwin*.
12502 (POWERPC64_PATTERN, *-*-aix*): Prepend powerpc64/mode64 to path_aix64.
12504 * mpn/powerpc64/mode64/mul_1.asm: Change cal => addi.
12505 * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
12506 * mpn/powerpc64/mode64/submul_1.asm: Likewise.
12507 * mpn/powerpc64/sqr_diagonal.asm: Likewise.
12509 * mpn/powerpc64/mode64/mul_1.asm: Move from "..".
12510 * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
12511 * mpn/powerpc64/mode64/submul_1.asm: Likewise.
12512 * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
12513 * mpn/powerpc64/mode64/rsh1sub_n.asm: Likewise.
12514 * mpn/powerpc64/mode64/add_n.asm: Likewise.
12515 * mpn/powerpc64/mode64/addsub_n.asm: Likewise.
12516 * mpn/powerpc64/mode64/sub_n.asm: Likewise.
12517 * mpn/powerpc64/mode64/addlsh1_n.asm: Likewise.
12518 * mpn/powerpc64/mode64/diveby3.asm: Likewise.
12519 * mpn/powerpc64/mode64/rsh1add_n.asm: Likewise.
12520 * mpn/powerpc64/mode64/sublsh1_n.asm: Likewise.
12522 * mpn/powerpc64/lshift.asm: Handle mode32 ABI.
12523 * mpn/powerpc64/rshift.asm: Likewise.
12524 * mpn/powerpc64/umul.asm: Likewise.
12526 * tune/powerpc64.asm: Make it actually work.
12528 2003-10-19 Kevin Ryde <kevin@swox.se>
12530 * mpn/generic/get_d.c: Add a workaround for alpha gcc signed constant
12533 * gmpxx.h (gmp_randclass gmp_randinit_lc_2exp_size constructor): Throw
12534 std::length_error if size is too big.
12535 * tests/cxx/t-rand.cc (check_randinit): Exercise this.
12537 * mpn/x86/pentium4/sse2/addlsh1_n.asm: New file, derived in part from
12538 mpn/x86/pentium4/sse2/add_n.asm.
12540 * doc/gmp.texi (C++ Interface Integers, C++ Interface Rationals, C++
12541 Interface Floats): Note std::invalid_argument exception for invalid
12542 strings to constructors and operator=.
12543 (C++ Interface Random Numbers): Note std::length_error exception for
12544 size too big in gmp_randinit_lc_2exp_size.
12546 2003-10-18 Kevin Ryde <kevin@swox.se>
12548 * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-18.
12550 * gmpxx.h (mpz_class, mpq_class, mpf_class, mpfr_class constructors
12551 and operator= taking string or char*): Throw std::invalid_argument if
12552 string cannot be converted.
12553 * tests/cxx/t-constr.cc, tests/cxx/t-assign.cc: Exercise this.
12555 * cxx/ismpz.cc, cxx/ismpq.cc, cxx/ismpf.cc: Use istream std::locale
12556 ctype facet for isspace when available. Only accept space at the
12557 start of the input, same as g++ libstdc++. Use ASSERT_NOCARRY to
12558 check result of mpz_set_str etc.
12559 * cxx/ismpf.cc: Don't accept "@" for exponent indicator.
12561 * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Remove
12562 _open and _mpn variants of mpn_toom3_mul_n, only one style now.
12563 * tune/mul_n_open.c, tune/mul_n_mpn.c: Remove files.
12565 * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
12566 (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
12568 * tests/mpz/t-import.c, tests/mpz/t-export.c: Use octal for character
12569 constants, hex is an ANSI-ism.
12571 * mpn/alpha/ev5/mode1o.c: Corrections to ASSERTs, as per
12572 mpn/generic/mode1o.c.
12574 * mpn/generic/diveby3.c: Add commented out alternative code and notes
12575 for taking the multiply off the dependent chain. Amend/clarify some
12576 of the other comments.
12578 * configure.in (powerpc970-*-*): Use gcc -mcpu=970 when available.
12579 (powerpc7400-*-*): Fallback on gcc -mcpu=750 if -mcpu=7400 not
12582 * doc/gmp.texi (C++ Formatted Input): Note locale digit grouping not
12584 (C++ Formatted Input, C++ Formatted Output): Cross reference class
12585 interface on overloading.
12587 * mpn/m68k/README: Add various ideas from doc/tasks.html.
12589 * mpn/m88k/README: New file.
12591 2003-10-16 Torbjorn Granlund <tege@swox.com>
12593 * config.sub: Recognize powerpc970.
12595 2003-10-15 Torbjorn Granlund <tege@swox.com>
12597 * config.guess: Recognize powerpc970 under MacOS.
12599 2003-10-15 Kevin Ryde <kevin@swox.se>
12601 * configure.in, acinclude.m4 (GMP_C_RIGHT_SHIFT): New test.
12602 * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
12603 (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
12605 * mpn/amd64/amd64-defs.m4: New file, with a non-aligning PROLOGUE.
12606 * configure.in (amd64-*-*): Use it.
12607 * mpn/amd64/addlsh1_n.asm: Add ALIGN(16).
12609 * mpfr/*: Update to mpfr cvs 2003-10-15.
12611 * mpn/generic/get_d.c: Rewrite, simplifying and truncating towards
12612 zero unconditionally.
12613 * tests/mpn/t-get_d.c: Add various further tests.
12614 * gmp-impl.h (FORCE_DOUBLE): New macro.
12616 * gmp-h.in (__mpz_struct): Add comment on __mpz_struct getting into
12617 C++ mangled function names.
12619 * doc/gmp.texi (Build Options): Update notes for new doc subdir.
12620 (Low-level Functions): Note mpn functions don't check for zero limbs
12621 etc, it's up to an application to strip.
12623 * doc/configuration (Configure): mdate-sh now in doc subdir, add
12626 2003-10-14 Torbjorn Granlund <tege@swox.com>
12628 * mpn/ia64/lorrshift.asm: Rewrite.
12630 * mpn/ia64/diveby3.asm: Remove explicit bundling; add branch hints.
12632 2003-10-13 Torbjorn Granlund <tege@swox.com>
12634 * mpn/ia64/diveby3.asm: New file.
12636 2003-10-13 Kevin Ryde <kevin@swox.se>
12638 * mpn/powerpc32/mod_34lsub1.asm: New file.
12640 * mpn/powerpc32/diveby3.asm, mpn/powerpc64/diveby3.asm: src[] in
12641 second operand of mullw, to allow possible early-out, which the
12642 0xAA..AB inverse cannot give. This improvement noticed by Torbjorn.
12644 * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Print to config.log whether
12645 local label is purely temporary or appears in object files, for
12646 development purposes.
12648 * doc/gmp.texi, doc/fdl.texi, doc/texinfo.tex, doc/mdate-sh: Moved
12650 * doc/Makefile.am: New file.
12651 * configure.in (AC_OUTPUT): Add doc/Makefile.
12652 * Makefile.am (SUBDIRS): Move doc subdirectory from EXTRA_DIST.
12653 (info_TEXINFOS, gmp_TEXINFOS): Moved to doc/Makefile.am.
12654 * mpfr/Makefile.am (mpfr_TEXINFOS): fdl.texi now in doc subdir.
12655 (TEXINFO_TEX): texinfo.tex now in doc subdir.
12656 (AM_MAKEINFOFLAGS): Set -I to doc subdir.
12658 * mpz/and.c: For positive/positive, use mpn_and_n, rate a realloc as
12661 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Don't test
12662 for high zero limbs.
12664 2003-10-12 Torbjorn Granlund <tege@swox.com>
12666 * mpn/powerpc64/diveby3.asm: New file (trivial edits of
12667 powerpc32/diveby3.asm).
12669 * mpn/powerpc32/diveby3.asm: Update cycle counts with more processors.
12670 * mpn/powerpc32/sqr_diagonal.asm: Likewise.
12672 * mpn/pa64/add_n.asm: Correct PA8500 cycle counts.
12673 * mpn/pa64/sub_n.asm: Likewise.
12675 * mpn/m68k/aors_n.asm (INPUT PARAMETERS): Fix typo.
12676 * mpn/m68k/lshift.asm: Likewise.
12677 * mpn/m68k/rshift.asm: Likewise.
12679 * mpn/m68k/README: Correct an URL; add some STATUS comments.
12681 * mpn/ia64/aorslsh1_n.asm: Avoid shrp when shl/shr works just as well.
12683 * mpn/powerpc32/addlsh1_n.asm: New file.
12684 * mpn/powerpc32/sublsh1_n.asm: New file.
12686 2003-10-12 Kevin Ryde <kevin@swox.se>
12688 * mpn/sparc64/divrem_1.c, mpn/sparc64/mod_1.c: New files.
12689 * mpn/sparc64/sparc64.h (HALF_ENDIAN_ADJ, count_leading_zeros_32,
12690 invert_half_limb, udiv_qrnnd_half_preinv): New macros.
12692 * gmp-impl.h (udiv_qrnnd_preinv2): Use a ? : for getting the n1 bit,
12693 so as not to depend on signed right shifts being arithmetic.
12695 * mpn/powerpc32/diveby3.asm: New file.
12697 * mpn/generic/divrem_1.c: Use CNST_LIMB(0) to avoid warnings from
12698 udiv_qrnnd_preinv about shift count when int<long. Do the same with
12699 udiv_qrnnd, for consistency.
12701 * Makefile.am (install-data-hook): Print a warning recommending "make
12702 check" to watch out for compiler bugs. Proposed by Torbjorn.
12704 * mpn/ia64/README (mpn_lshift, mpn_rshift): Amend prospective itanium2
12705 speed, 0.75 c/l with shrp plus shl/shr.
12707 * mpn/ia64/popcount.asm: Add comment on optimality.
12709 2003-10-11 Torbjorn Granlund <tege@swox.com>
12711 * mpn/ia64/rsh1aors_n.asm: New file.
12713 * mpn/asm-defs.m4: Handle rsh1aors_n.
12715 * configure.in (tmp_mulfunc): Handle rsh1aors_n.
12717 2003-10-11 Kevin Ryde <kevin@swox.se>
12719 * mpn/x86/pentium4/sse2/diveby3.asm: Remove non-PIC RODATA memory
12720 access for 0xAAAAAAAB constant.
12722 * gmp-impl.h (popc_limb, ULONG_PARITY) [ev67, ev68]: Add gcc asm
12723 versions using ctpop.
12725 * mpn/x86/k6/aorsmul_1.asm: Tweak some comments, remove M4_description
12726 and M4_desc_retval used only in comments.
12728 * mpn/x86/k6/mul_basecase.asm: Add comment on using mpn_mul_1.
12730 2003-10-09 Torbjorn Granlund <tege@swox.com>
12732 * mpn/powerpc64/addlsh1_n.asm: Tweak for 0.25 c/l better loop speed.
12733 * mpn/powerpc64/sublsh1_n.asm: Likewise.
12735 2003-10-09 Kevin Ryde <kevin@swox.se>
12737 * mpfr/*: Update to mpfr cvs 2003-10-09.
12739 * tests/devel/try.c (_SC_PAGESIZE): Define from _SC_PAGE_SIZE on
12740 systems which use that, eg. hpux 9.
12742 2003-10-07 Kevin Ryde <kevin@swox.se>
12744 * tune/freq.c (freq_sysctl_hw_model): Correction to last sscanf change.
12746 * configure.in: Check for psp_iticksperclktick in struct pst_processor.
12747 * tune/freq.c (freq_pstat_getprocessor): Use this.
12749 * tests/devel/try.c (divisor_array): Add a couple of half-limb values.
12751 * acinclude.m4 (GMP_PROG_CC_WORKS): Correction to last change, need to
12752 set result "yes" when cross compiling.
12754 2003-10-06 Torbjorn Granlund <tege@swox.com>
12756 * mpn/generic/mul_n.c: Use __GMPN_ADD_1/_GMPN_SUB_1 instead of
12757 mpn_add_1 and mpn_sub_1.
12759 * mpn/pa64/aorslsh1_n.asm: Schedule register save and restore code.
12761 2003-10-05 Torbjorn Granlund <tege@swox.com>
12763 * mpn/pa64/mul_1.asm: Misc comment cleanups.
12764 * mpn/pa64/addmul_1.asm: Likewise.
12765 * mpn/pa64/submul_1.asm: Likewise.
12767 * mpn/pa64/README: Correct cycle counts.
12769 * mpn/pa64/aorslsh1_n.asm: New file.
12771 2003-10-04 Kevin Ryde <kevin@swox.se>
12773 * tune/freq.c (freq_sysctl_hw_model, freq_sunos_sysinfo,
12774 freq_sco_etchw, freq_bsd_dmesg, freq_irix_hinv): Demand matching of
12775 MHz etc at end of sscanf format string. In particular need this for
12776 freq_bsd_dmesg on i486-pc-freebsd4.7 to avoid the 486 cpu being used
12779 * tests/misc.c, tests/tests.h (tests_setjmp_sigfpe,
12780 tests_sigfpe_handler, tests_sigfpe_done, tests_sigfpe_target,
12781 tests_dbl_mant_bits): New.
12783 * configure.in (viac3*-*-*): Add gcc VIA c3 options.
12785 * mpfr/*: Update to mpfr cvs 2003-10-04.
12787 * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
12788 refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps.
12789 * tests/tests.h (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
12790 refmpn_rsh1sub_n): Add prototypes.
12792 * tests/devel/try.c, tune/many.pl: Add mpn_addlsh1_n, mpn_sublsh1_n,
12793 mpn_rsh1add_n, mpn_rsh1sub_n.
12795 2003-10-03 Torbjorn Granlund <tege@swox.com>
12797 * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
12798 refmpn_rsh1sub_n): New functions.
12800 2003-10-03 Paul Zimmermann <Paul.Zimmermann@loria.fr>
12802 * mpn/generic/mul_n.c (toom3_interpolate): Use mpn_add_1/mpn_sub_1
12803 instead of MPN_INCR_/MPN_DECR_U.
12805 2003-10-02 Torbjorn Granlund <tege@swox.com>
12807 * configure.in (ia64*-*-hpux*): Fall back to +O1, not +O.
12809 2003-10-02 Kevin Ryde <kevin@swox.se>
12811 * configure.in (ia64*-*-hpux*): For cc, let +O optimization level
12812 fallback if +O3 doesn't work.
12814 * acinclude.m4 (GMP_PROG_CC_WORKS): Add a test of __builtin_alloca
12815 when available, to pick up Itanium HP-UX cc internal errors in +O2.
12816 Provoking code by Torbjorn.
12818 2003-10-01 Torbjorn Granlund <tege@swox.com>
12820 * mpn/ia64/gmp-mparam.h: Retune.
12822 * mpn/asm-defs.m4: Handle aorslsh1_n.
12824 * configure.in (tmp_mulfunc): Handle aorslsh1_n.
12826 * mpn/ia64/aorslsh1_n.asm: New file.
12828 * mpn/ia64/aors_n.asm: New file, complete rewrite of mpn_add_n and
12830 * mpn/ia64/add_n.asm: Replace by aors_n.asm.
12831 * mpn/ia64/sub_n.asm: Replace by aors_n.asm.
12833 2003-10-01 Kevin Ryde <kevin@swox.se>
12835 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Make bad ARM last byte into a
12836 separate case and consider it non-IEEE, since it looks like this is
12837 due to some sort of restricted or incorrect software floats.
12839 * demos/calc/Makefile.am: Use automake yacc/lex support, seems fine in
12840 separate objdir now.
12842 * cxx/dummy.cc: Moved from top-level dummy.cc.
12843 * Makefile.am (libgmpxx_la_SOURCES): Update to cxx/dummy.cc,
12844 correction to comment about this.
12846 2003-09-30 Torbjorn Granlund <tege@swox.com>
12848 * demos/pexpr.c: Correct documentation of -split.
12849 (TIME): Remove cast of result to double.
12850 (main): Change timing variables to int.
12851 (main): #ifdef LIMIT_RESOURCE_USAGE, don't convert numbers of more than
12854 2003-09-28 Torbjorn Granlund <tege@swox.com>
12856 * mpn/*/*.asm: Clean up spacing, tabify.
12858 * mpn/alpha/rshift.asm: Table cycle counts.
12859 * mpn/alpha/lshift.asm: Likewise.
12860 * mpn/alpha/ev5/rshift.asm: Likewise.
12861 * mpn/alpha/ev5/lshift.asm: Likewise.
12862 * mpn/alpha/ev6/add_n.asm: Likewise.
12863 * mpn/alpha/ev6/sub_n.asm: Likewise.
12865 * mpn/ia64/lorrshift.asm: Amend comments about performance.
12867 * mpn/pa64/mul_1.asm: Fix comment typo.
12868 * mpn/pa64/addmul_1.asm: Likewise.
12869 * mpn/pa64/submul_1.asm: Likewise.
12871 * mpn/amd64/addlsh1_n.asm: Save/restore carry using two insn to break
12872 recurrency. Add remarks about possible further speedup.
12873 * mpn/amd64/sublsh1_n.asm: Likewise.
12875 * mpn/amd64/rsh1add_n.asm: Add remarks about possible further speedup.
12876 * mpn/amd64/rsh1sub_n.asm: Likewise.
12878 2003-09-27 Torbjorn Granlund <tege@swox.com>
12880 * mpn/powerpc64/README: Update with POWER4/PPC970 pipeline info.
12882 * mpn/powerpc64/rsh1add_n.asm: New file.
12883 * mpn/powerpc64/rsh1sub_n.asm: New file.
12884 * mpn/powerpc64/rshift.asm: Rewrite.
12885 * mpn/powerpc64/lshift.asm: Rewrite.
12887 2003-09-26 Torbjorn Granlund <tege@swox.com>
12889 * mpn/powerpc64/addlsh1_n.asm: New file.
12890 * mpn/powerpc64/sublsh1_n.asm: New file.
12892 2003-09-25 Torbjorn Granlund <tege@swox.com>
12894 * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
12895 speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): Conditionalize on
12896 corresponding HAVE_NATIVE_*.
12898 2003-09-25 Kevin Ryde <kevin@swox.se>
12900 * mpz/combit.c: Use GMP_NUMB_BITS not BITS_PER_MP_LIMB.
12902 * demos/expr/exprfr.c: Allow for mpfr_inf_p, mpfr_nan_p and
12903 mpfr_number_p merely returning non-zero, rather than 1 or 0.
12905 * demos/expr/exprfr.c, demos/expr/t-expr.c: Add erf, integer_p, zeta.
12907 * demos/expr/Makefile.am (LDADD): Update comments on $(LIBM).
12909 2003-09-24 Torbjorn Granlund <tege@swox.com>
12911 * tune/speed.c (routine): Add entires for mpn_addlsh1_n, mpn_sublsh1_n,
12912 mpn_rsh1add_n, and mpn_rsh1sub_n.
12914 * tune/speed.h: Declare speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
12915 speed_mpn_rsh1add_n, and speed_mpn_rsh1sub_n.
12917 * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
12918 speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): New functions.
12920 * gmp-impl.h: Declare mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsh1add_n, and
12923 * mpn/asm-defs.m4: Add define_mpn's for addlsh1_n, sublsh1_n,
12924 rsh1add_n, and rsh1sub_n.
12926 * mpn/powerpc64/*.asm: Add cycle counts in consistent style. Misc
12929 * mpn/amd64/gmp-mparam.h: Retune.
12931 * configure.in: Add #undefs for HAVE_NATIVE_mpn_addlsh1_n,
12932 HAVE_NATIVE_mpn_sublsh1_n, HAVE_NATIVE_mpn_rsh1add_n,
12933 HAVE_NATIVE_mpn_rsh1sub_n.
12934 (gmp_mpn_functions_optional): List addlsh1_n, sublsh1_n, rsh1add_n,
12937 * mpn/amd64/addlsh1_n.asm: New file.
12938 * mpn/amd64/sublsh1_n.asm: New file.
12939 * mpn/amd64/rsh1add_n.asm: New file.
12940 * mpn/amd64/rsh1sub_n.asm: New file.
12942 2003-09-24 Kevin Ryde <kevin@swox.se>
12944 * mpfr/*: Update to mpfr cvs 2003-09-24.
12946 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Remove conftest* temporary files.
12948 2003-09-23 Torbjorn Granlund <tege@swox.com>
12950 * gmp-impl.h (MUL_TOOM3_THRESHOLD, SQR_TOOM3_THRESHOLD): Now 128.
12952 2003-09-23 Kevin Ryde <kevin@swox.se>
12954 * gmp-h.in (gmp_randinit_set): Use __gmp_const rather than const.
12956 2003-09-22 Torbjorn Granlund <tege@swox.com>
12958 * tune/mul_n_mpn.c: (__gmpn_sqr_n): New #define.
12959 * tune/mul_n_open.c (__gmpn_sqr_n): New #define.
12961 * mpn/generic/mul.c (mpn_sqr_n): Move from here...
12962 * mpn/generic/mul_n.c (mpn_sqr_n): ...to here.
12963 (mpn_sqr_n): Allocate workspace for toom3 using TMP_* mechanism except
12964 for very large operands when !WANT_FFT.
12966 * mpn/generic/mul_n.c: Add a missing ";". Misc comment fixes.
12968 * mpn/generic/mul.c: Remove spurious #include <stdio.h>.
12970 * mpn/x86/k7/gmp-mparam.h: Retune.
12972 * mpn/generic/mul_n.c (mpn_mul_n): Allocate workspace for toom3 using
12973 TMP_* mechanism except for very large operands when !WANT_FFT.
12975 * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE):
12976 Define conditionally on WANT_FFT and HAVE_NATIVE_mpn_sublsh1_n.
12977 (MPN_TOOM3_MAX_N): New #define.
12979 * mpn/amd64/gmp-mparam.h: Retune.
12981 * mpn/Makefile.am (TARG_DIST): Add amd64.
12983 * mpn/generic/sqr_basecase.c: Use mpn_addlsh1_n when available.
12985 * mpn/generic/mul_n.c: Use proper form for HAVE_NATIVE macros.
12987 2003-09-22 Kevin Ryde <kevin@swox.se>
12989 * mpfr/*: Update to mpfr cvs 2003-09-22.
12991 2003-09-21 Kevin Ryde <kevin@swox.se>
12993 * mpn/x86/pentium4/sse2/gmp-mparam.h (USE_PREINV_DIVREM_1,
12994 USE_PREINV_MOD_1): Set to 1 for new asm versions.
12996 * mpfr/*: Update to mpfr cvs 2003-09-21.
12998 2003-09-21 Paul Zimmermann <Paul.Zimmermann@loria.fr>
13000 * mpn/generic/mul_n.c (mpn_toom3_mul_n): Conditionally use
13001 mpn_sublsh1_n, mpn_rsh1add_n and mpn_rsh1sub_n, in addition to
13002 mpn_addlsh1_n. Avoid all copying, at the expense of some additional
13005 * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Accomodate
13008 2003-09-19 Kevin Ryde <kevin@swox.se>
13010 * mpn/x86/pentium4/sse2/divrem_1.asm, mpn/x86/pentium4/sse2/mod_1.asm:
13013 2003-09-16 Kevin Ryde <kevin@swox.se>
13015 * tune/speed.c (run_one): Don't scale the -1.0 not-available return.
13016 Print "n/a" for times not-available.
13018 2003-09-13 Paul Zimmermann <Paul.Zimmermann@loria.fr>
13020 * mpn/generic/mul_n.c (toom3_interpolate): New function.
13021 (mpn_toom3_mul_n, mpn_toom3_sqr_n): Call toom3_interpolate.
13023 2003-09-12 Torbjorn Granlund <tege@swox.com>
13025 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove unused
13027 (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use offset `+ 1', not `+ 2' in last
13030 2003-09-12 Paul Zimmermann <Paul.Zimmermann@loria.fr>
13032 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Rewrite.
13034 2003-09-12 Torbjorn Granlund <tege@swox.com>
13036 * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Reformulate
13037 to use the same form as MPN_TOOM3_MUL_N_TSIZE.
13038 (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Update for new Toom3
13040 * mpn/generic/mul_n.c (evaluate3, interpolate3, add2Times): Remove.
13041 (USE_MORE_MPN): Remove.
13043 2003-08-31 Kevin Ryde <kevin@swox.se>
13045 * mpfr/*: Update to mpfr cvs 2003-08-31.
13047 2003-08-30 Kevin Ryde <kevin@swox.se>
13049 * mpfr/*: Update to mpfr cvs 2003-08-30.
13051 2003-08-29 Torbjorn Granlund <tege@swox.com>
13053 * mpn/amd64/copyi.asm: New file.
13054 * mpn/amd64/copyd.asm: New file.
13055 * mpn/amd64/README: New file.
13057 2003-08-28 Torbjorn Granlund <tege@swox.com>
13059 * mpn/amd64/lshift.asm: New file.
13060 * mpn/amd64/rshift.asm: New file.
13061 * mpn/amd64/gmp-mparam.h: Retune.
13063 2003-08-23 Kevin Ryde <kevin@swox.se>
13065 * tune/freq.c (freq_getsysinfo): Correction to speed_cycletime value
13068 * mpz/rootrem.c, gmp-h.in, gmp.texi (mpz_rootrem): Don't return
13069 exactness indication, can get that from testing the remainder.
13071 * mpn/x86/k7/aors_n.asm, mpn/x86/k7/mmx/copyi.asm: Amend to comments
13072 about loads and stores and what speed should be possible.
13074 2003-08-22 Torbjorn Granlund <tege@swox.com>
13076 * mpn/amd64/add_n.asm: New file.
13077 * mpn/amd64/sub_n.asm: New file.
13078 * mpn/amd64/mul_1.asm: New file.
13079 * mpn/amd64/addmul_1.asm: New file.
13080 * mpn/amd64/submul_1.asm: New file.
13082 2003-08-19 Kevin Ryde <kevin@swox.se>
13084 * longlong.h (add_ssaaaa, sub_ddmmss) [hppa 64]: Move down into main
13085 __GNUC__ block. Exclude for _LONG_LONG_LIMB (ie. ABI=2.0n) since
13086 these forms are only for ABI=2.0w.
13088 * longlong.h (count_leading_zeros) [__mcpu32__]: Check __mcpu32__ to
13089 avoid bfffo on GCC 3.4 in CPU32 mode. Reported by Bernardo Innocenti.
13091 * longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force
13092 64-bit register destination. Pointed out by Torbjorn.
13094 * mpz/combit.c: Correction to carry handling when extending a
13095 negative, and use __GMPN_ADD_1. Correction to complement limb for a
13096 negative when there's a non-zero low limb.
13097 * tests/mpz/bit.c (check_clr_extend, check_com_negs): Exercise these.
13099 * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add
13101 * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Rand.pm,
13102 demos/perl/test.pl: Add gmp_urandomb_ui, gmp_urandomm_ui.
13103 (GMP::Rand::randstate): Accept a randstate object to copy.
13104 * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Mpz.pm,
13105 demos/perl/test.pl: Add combit, rootrem.
13107 2003-08-19 Torbjorn Granlund <tege@swox.com>
13109 * tune/Makefile.am (EXTRA_DIST): Add amd64.asm.
13111 2003-08-17 Kevin Ryde <kevin@swox.se>
13113 * gmpxx.h [__MPFR_H]: Include full <iostream> for inlines.
13114 * tests/cxx/t-headfr.cc: New file, exercising this.
13115 * tests/cxx/Makefile.am: Add it.
13117 * tests/cxx/t-constr.cc: Include config.h for WANT_MPFR.
13119 * gmpxx.h: Correction to temp variable type in mpf -> mpfr assignment.
13120 Reported by Derrick Bass.
13121 * tests/cxx/t-assign.cc (check_mpfr): Exercise this.
13123 * configure.in (WANT_MPFR): AC_DEFINE this, for the benefit of
13124 tests/cxx/t-*.cc. (Was always meant to have been defined.)
13125 * tests/cxx/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpfr.
13127 * gmpxx.h: __gmp_default_rounding_mode -> __gmpfr_default_rounding_mode
13128 (struct __gmp_hypot_function): Correction to mpfr_hypot addition.
13129 * tests/cxx/t-misc.cc (check_mpfr_hypot): Corrections to mpfr/long
13132 2003-08-16 Torbjorn Granlund <tege@swox.com>
13134 * configure.in (amd64): New.
13136 * mpn/amd64/gmp-mparam.h: New file.
13138 * tune/amd64.asm: New file, derived in part from tune/pentium.asm.
13140 2003-08-15 Kevin Ryde <kevin@swox.se>
13142 * tune/freq.c (freq_irix_hinv): Reinstate, for the benefit of IRIX 6.2.
13143 (freq_attr_get_invent): Conditionalize on INFO_LBL_DETAIL_INVENT too.
13145 2003-08-14 Kevin Ryde <kevin@swox.se>
13147 * mpq/get_d.c: Use mpn_get_d.
13148 * tests/mpq/t-get_d.c (check_onebit): New test.
13150 * gmp.texi (Notes for Particular Systems): Under x86 cpu types, note
13151 i386 is a fat binary, remove pentium4 recommendation since i386 is now
13152 quite reasonable for p4.
13153 (Notes for Particular Systems): Under Windows DLLs, remove caveat
13154 about --enable-cxx now ok, update .lib creation for new libtool,
13155 remove .exp not needed for MS C.
13156 (Notes for Package Builds): i386 is a fat binary.
13157 (Reentrancy): Remove SCO ctype.h note, don't want to list every system
13158 misfeature, and was quite possibly for non-threading mode anyway.
13159 (Autoconf): Remove notes on gmp 2 detection, too old to want to
13160 encourage anyone to use.
13161 (Karatsuba Multiplication): Correction to threshold increase/decrease
13162 for a and b terms. Reported by Richard Brent and Paul Zimmermann.
13163 Also add various further index entries.
13165 * tune/freq.c (freq_attr_get_invent): New function.
13166 (freq_irix_hinv): Remove, in favour or freq_attr_get_invent.
13167 * configure.in (AC_CHECK_FUNCS): Add attr_get.
13168 (AC_CHECK_HEADERS): Add invent.h, sys/attributes.h, sys/iograph.h.
13170 2003-08-03 Kevin Ryde <kevin@swox.se>
13172 * tune/tuneup.c (tune_mul): Use MUL_KARATSUBA_THRESHOLD_LIMIT.
13174 2003-08-02 Kevin Ryde <kevin@swox.se>
13176 * mpn/asm-defs.m4: Tweak some comments, add hpux11 to m4wrap 0xFF
13179 * configure.in (*-*-sco3.2v5*): Remove lt_cv_archive_cmds_need_lc=no,
13180 since libtool no longer uses it. This was a workaround fixing ctype.h
13181 in SCO 5 shared libraries; not sure if libtool now gets it right on
13182 its own, let's hope so.
13184 * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Remove, libtool no
13185 longer demands HOST_CC.
13187 * configure.in: When C or C++ compiler not found, refer user to
13190 * configure.in (i386-*-*): Turn i386 into a fat binary build.
13191 * mpn/x86/fat/fat.c, mpn/x86/fat/fat_entry.asm,
13192 mpn/x86/fat/gmp-mparam.h, mpn/x86/fat/gcd_1.c, mpn/x86/fat/mode1o.c:
13194 * gmp-impl.h (struct cpuvec_t) [x86 fat]: New structure.
13195 * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB) [x86 fat]: Define.
13196 * mpn/asm-defs.m4 (foreach): New macro.
13197 * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): New define.
13198 * mpn/x86/sqr_basecase.asm: New file, primarily as a fallback for fat
13200 * mpn/x86/p6/gmp-mparam.h, mpn/x86/p6/mmx/gmp-mparam.h: Add comments
13201 about fat binary SQR_KARATSUBA_THRESHOLD for p6 and p6/mmx.
13203 * configure.in: Add various supports for fat binaries, via fat_path,
13204 fat_functions and fat_thresholds variables.
13205 * acinclude.m4 (GMP_STRIP_PATH): Mung $fat_path too.
13206 (GMP_FAT_SUFFIX, GMP_REMOVE_FROM_LIST): New macros.
13207 * gmp-impl.h: Add various supports for fat binaries.
13208 (DECL_add_n etc): New macros.
13209 (mpn_mul_basecase etc): Define only if not already defined.
13210 * mpn/asm-defs.m4 (m4_config_gmp_mparam): Mention fat binary.
13211 (MPN): Use m4_unquote, for the benefit of fat binary name expansion.
13212 * doc/configuration: Notes on fat binaries.
13213 * gmp-impl.h (MUL_TOOM3_THRESHOLD_LIMIT): Define always.
13214 (MUL_KARATSUBA_THRESHOLD_LIMIT): New define.
13215 * mpn/generic/mul.c, mpn/generic/mul_n.c: Use these.
13216 * tune/divrem1div.c, tune/divrem1inv.c, tune/mod_1_div.c,
13217 tune/mod_1_inv.c: Define OPERATION_divrem_1 and OPERATION_mod_1, to
13218 tell fat.h what's being done.
13220 * config.guess (alpha-*-*): Update comments on what configfsf.guess
13221 does and doesn't do for us.
13223 2003-07-31 Kevin Ryde <kevin@swox.se>
13225 * config.guess: Remove $dummy.o files everywhere, in case vendor
13226 compilers produce that even when not asked.
13228 * demos/perl/GMP.xs (class_or_croak): Rename "class" parameter to
13230 (coerce_ulong, coerce_long): Move croaks to stop g++ 3.3 complaining
13231 about uninitialized variables.
13233 * demos/perl/INSTALL: Add notes on building with a DLL.
13235 * longlong.h (count_trailing_zeros) [x86_64]: Ensure bsfq destination
13236 is a 64-bit register. Diagnosed by Francois G. Dorais.
13238 2003-07-31 Torbjorn Granlund <tege@swox.com>
13240 * longlong.h [ppc]: Remove nested test for vxworks.
13242 2003-07-24 Kevin Ryde <kevin@swox.se>
13244 * gmpxx.h (struct __gmp_binary_multiplies): Use mpz_mul_si for
13245 mpz*long and long*mpz.
13246 * tests/cxx/t-ops.cc (check_mpz): Exercise mpz*long and mpz*ulong.
13248 * cxx/ismpf.cc: Use std::locale decimal point when available. Expect
13249 localeconv available always.
13250 * tests/cxx/t-locale.cc: Enable check_input tests.
13252 * gmpxx.h (struct __gmp_hypot_function): Use mpfr_hypot.
13253 * tests/cxx/t-misc.cc (check_mpfr_hypot): New tests.
13255 * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-ops.cc,
13256 tests/cxx/t-prec.cc, tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc:
13257 Include config.h for WANT_MPFR.
13259 * tests/mpz/bit.c (check_single): Correction to a diagnostic print.
13261 2003-07-24 Niels Möller <nisse@lysator.liu.se>
13263 * mpz/combit.c: New file.
13264 * Makefile.am, mpz/Makefile.am: Add it.
13265 * gmp-h.in (mpz_combit): Add prototype.
13266 * tests/mpz/bit.c (check_single): Exercise mpz_combit.
13268 2003-07-16 Kevin Ryde <kevin@swox.se>
13270 * mpn/generic/get_d.c: Correction to infinity handling for large exp.
13272 2003-07-14 Kevin Ryde <kevin@swox.se>
13274 * mpz/get_d.c, mpz/get_d_2exp.c, mpf/get_d.c, mpf/get_d_2exp.c: Use
13277 * mpn/generic/get_d.c: New file, based on mpz/get_d.c and insert-dbl.c.
13278 * configure.in, mpn/Makefile.am: Add it.
13279 * gmp-impl.h (mpn_get_d): Add prototype.
13281 * tests/mpn/t-get_d.c: New file.
13282 * tests/mpn/Makefile.am: Add it.
13284 * tests/mpz/t-get_d_2exp.c (check_onebit, check_round): Test negatives.
13285 (check_onebit): Add a few more bit sizes.
13287 * tests/misc.c, tests/tests.h (tests_isinf): New function.
13289 2003-07-12 Kevin Ryde <kevin@swox.se>
13291 * configure.in (GMP_PROG_CXX_WORKS): Include $CPPFLAGS, same as
13292 automake does in the actual build.
13294 * acinclude.m4 (GMP_PROG_CXX_WORKS): In the namespace test, declare
13295 namespace before trying to use. In std iostream test, provoke a
13296 failure from Compaq C++ in pre-standard mode.
13298 2003-07-08 Kevin Ryde <kevin@swox.se>
13300 * acinclude.m4 (GMP_PROG_CC_WORKS): Use separate compiles for various
13301 known problems, and indicate to the user the reason for rejecting.
13302 (GMP_PROG_CXX_WORKS): Ditto, and insist on being able to execute each
13305 2003-07-05 Kevin Ryde <kevin@swox.se>
13307 * config.sub: Add comments to our alias transformations.
13309 * configfsf.sub, configfsf.guess: Update to 2003-07-04.
13311 * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_PROG_CC_WORKS_LONGLONG): Show
13312 failing program in config.log, per other autoconf tests.
13314 * configure.in (i786-*-*): Recognise as pentium4, per configfsf.sub.
13316 2003-06-28 Kevin Ryde <kevin@swox.se>
13318 * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Avoid res==1.0 when floats round
13321 * tests/mpz/t-get_d_2exp.c: New file.
13322 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
13323 * tests/mpf/t-get_d_2exp.c: New file.
13324 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13325 * tests/x86call.asm, test/tests.h (x86_fldcw, x86_fstcw): New
13327 * tests/misc.c, tests/tests.h (tests_hardware_getround,
13328 tests_hardware_setround): New functions.
13330 2003-06-25 Kevin Ryde <kevin@swox.se>
13332 * mpn/sparc64/dive_1.c: New file.
13334 * mpn/sparc64/sparc64.h: New file.
13335 * mpn/sparc64/mode1o.c: Remove things now in sparc64.h.
13337 * mpfr/*: Update to mpfr cvs 2003-06-25.
13339 * acinclude.m4 (GMP_PROG_CC_WORKS): In last change provoking gnupro
13340 gcc, don't use ANSI style function definition.
13342 2003-06-22 Kevin Ryde <kevin@swox.se>
13344 * mpn/pa32/hppa1_1/udiv.asm: Remove .proc, .entry, .exit and .procend,
13345 handled by PROLOGUE and EPILOGUE. Comment out .callinfo, per other
13348 * gmpxx.h (mpz_class __gmp_binary_divides, __gmp_binary_modulus): Fix
13349 long/mpz and long%mpz for dividend==LONG_MIN divisor==-LONG_MIN.
13350 (mpz_class __gmp_binary_modulus): Fix mpz%long for negative dividend.
13351 * tests/cxx/t-ops.cc (check_mpz): Add test cases for these, merging
13352 operator/ and operator% sections for clarity.
13354 2003-06-21 Kevin Ryde <kevin@swox.se>
13356 * mpfr/*: Update to mpfr cvs 2003-06-21.
13358 * acinclude.m4 (GMP_PROG_CC_WORKS): Add code by Torbjorn provoking an
13359 ICE from gcc 2.9-gnupro-99r1 under -O2 -mcpu=ev6.
13360 * configure.in (alpha*-*-* gcc_cflags_cpu): Fallback on -mcpu=ev56 for
13363 * gmpxx.h (get_d): Remove comments about long double, double is
13364 correct for get_d, a future long double form would be get_ld.
13366 2003-06-19 Kevin Ryde <kevin@swox.se>
13368 * mpfr/*: Update to mpfr cvs 2003-06-19.
13370 * mpn/generic/dive_1.c: Share src[0] fetch among all cases. No need
13371 for separate final umul_ppmm in even case, make it part of the loop.
13373 * mpz/get_d_2exp.c, mpq/set_si.c, mpq/set_ui.c: Nailify.
13375 * mpf/iset_si.c: Rewrite using mpf/set_si.c code, in particular this
13377 * tests/mpf/t-set_si.c: Nailify tests.
13379 * mpf/iset_ui.c: Nailify, as per mpf/set_ui.c
13380 * tests/mpf/t-set_ui.c: New file.
13381 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
13383 2003-06-15 Kevin Ryde <kevin@swox.se>
13385 * mpfr/*: Update to mpfr cvs 2003-06-15.
13387 * mpn/x86/k6/mode1o.asm: Remove a bogus ASSERT.
13389 2003-06-12 Kevin Ryde <kevin@swox.se>
13391 * configure.in (--enable-assert): Emit WANT_ASSERT to config.m4.
13392 * mpn/powerpc32/powerpc-defs.m4, mpn/x86/x86-defs.m4 (ASSERT): Check
13393 WANT_ASSERT is defined.
13395 * mpn/sparc32/v9/udiv.asm: Amend heading, this file is for sparc v9.
13397 * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): In libtool openbsd hack,
13398 disard error messages from cp, for the benefit of --disable-shared or
13399 systems not using names libgmp.so.*.
13401 * tests/devel/try.c (try_one): When overlapping, copy source data
13402 after filling dst. Previously probably used only DEADVAL in
13405 2003-06-11 Torbjorn Granlund <tege@swox.com>
13407 * mpf/random2.c: Rewrite. Ignore sign of exp parameter.
13409 2003-06-10 Kevin Ryde <kevin@swox.se>
13411 * mpn/sparc64/mode1o.c: New file.
13413 2003-06-09 Torbjorn Granlund <tege@swox.com>
13415 * mpn/powerpc32/lshift.asm: Add more cycle counts.
13416 * mpn/powerpc32/rshift.asm: Add more cycle counts.
13418 * mpn/ia64/addmul_1.asm: Reformat comments for 80 columns.
13420 * gmp-impl.h (udiv_qrnnd_preinv1): New name for udiv_qrnnd_preinv.
13421 (udiv_qrnnd_preinv2): New name for udiv_qrnnd_preinv2norm.
13422 (udiv_qrnnd_preinv): New #define, making udiv_qrnnd_preinv2
13424 * tune/speed.c: Corresponding changes.
13425 * tune/speed.h: Likewise.
13426 * tune/common.c: Likewise.
13428 * mpf/get_str.c: Simplify `off' computation.
13430 * longlong.h: Tabify.
13432 2003-06-09 Kevin Ryde <kevin@swox.se>
13434 * gmp.texi (ABI and ISA): FreeBSD has sparc64 too, just say "BSD" to
13435 cover all flavours.
13436 * configure.in: Ditto in some comments.
13438 * mpfr/*: Update to mpfr cvs 2003-06-09.
13440 * tests/cxx/Makefile.am (LDADD): Add -L$(top_builddir)/$(LIBS), for
13441 the benefit of gcc 3.2 on itanium2-hp-hpux11.22.
13443 * tune/many.pl (mul_2): Add speed routine settings.
13444 (MAKEFILE): Close when done, for the benefit of development hackery.
13446 2003-06-08 Kevin Ryde <kevin@swox.se>
13448 * mpfr/*: Update to mpfr cvs 2003-06-08.
13450 * mpn/x86/x86-defs.m4 (femms): Remove fallback to emms.
13451 (cmovCC, psadbw): Remove simulated versions.
13452 (cmov_available_p, psadbw_available_p): Remove.
13453 This trickery was only ever for development purposes on machines
13454 without those instructions. Removing it simplifies gmp and in
13455 particular avoids complications for fat binary builds. Development
13456 can be done with a wrapper around "as" if really needed.
13458 * mpn/x86/divrem_1.asm: Don't use loop_or_decljnz, now K6 has its own
13459 mpn/x86/k6/divrem_1.asm. Amend K6 comments now moved to there.
13460 * mpn/x86/x86-defs.m4 (loop_or_decljnz): Remove, no longer used.
13462 * mpn/x86/k6/divrem_1.asm: New file, derived from mpn/x86/divrem_1.asm.
13464 * mpn/x86/k6/pre_mod_1.asm: Remove comments now in mpn/x86/mod_1.asm.
13466 * mpn/x86/mod_1.asm: Put mpn_mod_1c after mpn_mod_1 for better branch
13467 prediction. Put done_zero at end for less wastage in alignment. Use
13468 decl+jnz unconditionally since in fact it's ok on k6. Amend comments.
13470 2003-06-07 Kevin Ryde <kevin@swox.se>
13472 * mpn/generic/mode1o.c: Fix ASSERTs on return value.
13474 * gmp.texi (Build Options): Add viac3 and viac32 cpu types.
13475 (ABI and ISA): Note on sparcv9 ABI=32 vs ABI=64 speed. More indexing.
13477 * configfsf.guess, configfsf.sub: Update to 2003-06-06.
13478 * config.guess: Remove $RANDOM hack supporting netbsd 1.4, not needed
13479 by new configfsf.guess.
13481 2003-06-06 Torbjorn Granlund <tege@swox.com>
13483 * mpn/ia64/submul_1.asm: Add branch over .align block.
13485 2003-06-05 Torbjorn Granlund <tege@swox.com>
13487 * longlong.h (add_ssaaaa) [pa64]: Output zero operand as register 0.
13488 Allow more immediate operands.
13489 (sub_ddmmss) [pa64]: Likewise.
13490 (add_ssaaaa) [pa32]: Likewise.
13491 (sub_ddmmss) [pa32]: Likewise.
13493 * mpn/pa64: Change ".level 2.0W" to ".level 2.0w" to please
13494 picky GNU assembler.
13496 2003-06-05 Kevin Ryde <kevin@swox.se>
13498 * gmp.texi (Integer Special Functions): In mpz_array_init, fix type
13499 shown for integer_array and give an example use.
13501 2003-06-04 Torbjorn Granlund <tege@swox.com>
13503 * mpf/set_str.c (mpf_set_str): Work around gcc 2 bug triggered on
13506 2003-06-03 Kevin Ryde <kevin@swox.se>
13508 * mpn/x86/pentium/README: Add 7 c/l mmx mul_1, tweak wordings.
13510 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Use octal char constants in test
13511 program, hex is not supported by K&R.
13513 2003-06-02 Torbjorn Granlund <tege@swox.com>
13515 * mpn/mips64/divrem_1.asm: New file.
13517 2003-06-01 Torbjorn Granlund <tege@swox.com>
13519 * mpn/powerpc32/lshift.asm: Reformat code.
13520 * mpn/powerpc32/rshift.asm: Reformat code.
13522 2003-05-30 Kevin Ryde <kevin@swox.se>
13524 * tests/misc.c (tests_start): Set stdout and stderr to unbuffered, to
13525 avoid any chance of losing output on segv etc.
13527 2003-05-28 Torbjorn Granlund <tege@swox.com>
13529 * mpf/get_str.c: Move label `done' to match TMP_MARK and TMP_FREE.
13530 Remove redundant variable prec.
13532 2003-05-26 Torbjorn Granlund <tege@swox.com>
13534 * tests/mpz/convert.c: Test bases up to 62.
13536 * tests/mpf/t-conv.c: Test bases up to 62.
13538 * demos/pexpr.c: Don't iterate to get accurate timing.
13540 * mpf/set_str.c (mpn_pow_1_highpart): Cleanup.
13542 * mp_dv_tab.c: Fix typo.
13544 * mpf/get_str.c: Rewrite (now sub-quadratic).
13546 2003-05-22 Kevin Ryde <kevin@swox.se>
13548 * tests/mpn/t-divrem_1.c: New file.
13549 * tests/mpn/Makefile.am: Add it.
13551 2003-05-22 Torbjorn Granlund <tege@swox.com>
13553 * config.sub: Recognize viac3* processors.
13555 2003-05-20 Torbjorn Granlund <tege@swox.com>
13557 * mpn/sparc64/addmul_2.asm: New file.
13559 2003-05-19 Torbjorn Granlund <tege@swox.com>
13561 * configure.in: Recognize alphaev7* as alphaev67.
13563 * config.guess: Recognize viac3* processors.
13564 * configure.in: Set up path for viac3* processors.
13565 * acinclude.m4 (X86_PATTERN): Include viac3* processors.
13567 2003-05-19 Kevin Ryde <kevin@swox.se>
13569 * tune/freq.c (freq_pstat_getprocessor): New function.
13570 (freq_all): Use it.
13571 * configure.in (AC_CHECK_HEADERS): Add sys/pstat.h.
13572 (AC_CHECK_FUNCS): Add pstat_getprocessor.
13574 2003-05-15 Kevin Ryde <kevin@swox.se>
13576 * mpn/generic/mul_fft.c (mpn_mul_fft_decompose): Remove "inline",
13577 since the code is a bit too big. gcc doesn't actually inline when
13578 alloca (TMP_ALLOC) is used anyway.
13580 2003-05-13 Kevin Ryde <kevin@swox.se>
13582 * gmp.texi (Notes for Particular Systems): Libtool directory is .libs
13583 not _libs for mingw dll. Reported by Andreas Fabri.
13585 2003-05-07 Kevin Ryde <kevin@swox.se>
13587 * acinclude.m4 (GMP_PROG_CC_WORKS): Add code to generate sse2/xmm code
13588 from gcc -march=pentium4, to check the assembler supports that.
13589 (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): New macros.
13590 * configure.in (pentium4-*-*): Use them to see if gcc -march=pentium4
13593 2003-05-06 Kevin Ryde <kevin@swox.se>
13595 * mpz/com.c: Rate size==0 as UNLIKELY, fix comment to mpn_add_1.
13597 * tune/freq.c (<sys/sysinfo.h>): Include only when needed for
13598 getsysinfo(), to avoid a problem with this file on AIX 5.1.
13600 2003-05-03 Torbjorn Granlund <tege@swox.com>
13602 * mpf/set_str.c: Do not ignore supposedly superfluous digits (in part
13603 reverting last change).
13605 2003-05-03 Kevin Ryde <kevin@swox.se>
13607 * gmp.texi: Use @code for files in @cindex entries, it looks nicer
13610 * Makefile.am: Note gmp 4.1.1 and 4.1.2 version info.
13612 * configure.in, acinclude.m4 (GMP_CRAY_OPTIONS): New macro for Cray
13613 system setups, letting AC_REQUIRE do its job instead of a hard coded
13616 * config.guess: Amend fake RANDOM to avoid ". configfsf.guess" which
13617 segfaults on Debian "ash" 0.4.16.
13619 2003-05-01 Kevin Ryde <kevin@swox.se>
13621 * configure.in (AC_CHECK_FUNCS): Add getsysinfo.
13622 (AC_CHECK_HEADERS): Add sys/sysinfo.h and machine/hal_sysinfo.h.
13623 * tune/freq.c (freq_getsysinfo): New function.
13624 (freq_all): Use it.
13625 (freq_sysctlbyname_i586_freq, freq_sysctlbyname_tsc_freq,
13626 freq_sysctl_hw_cpufrequency, freq_sysctl_hw_model): Set
13627 speed_cycletime before trying to print it, when verbose.
13629 2003-04-28 Torbjorn Granlund <tege@swox.com>
13631 * mpf/set_str.c: Major overhaul.
13632 (mpn_pow_1_highpart): New helper function, meat extracted from
13635 2003-04-24 Kevin Ryde <kevin@swox.se>
13637 * acinclude.m4 (GMP_GCC_ARM_UMODSI): Quote result string against m4.
13639 * configure, ltmain.sh, aclocal.m4: Update to libtool 1.5.
13641 * longlong.h (add_ssaaaa) [all]: Remove first "%" commutative in each,
13642 since gcc only supports one per asm.
13644 * printf/doprnt.c: Add M for mp_limb_t.
13645 * tests/misc/t-printf.c: Exercise this.
13647 * tests/mpz/t-cmp_d.c: Test infinities.
13648 * tests/mpf/t-cmp_d.c: New file.
13649 * tests/mpf/Makefile.am: Add it.
13651 * mpz/cmp_d.c, mpz/cmpabs_d.c, mpf/cmp_d.c: NaN invalid, Inf bigger
13653 * mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
13655 * configure.in (AC_CHECK_FUNCS): Add raise.
13656 * invalid.c: New file.
13657 * Makefile.am: Add it.
13658 * gmp-impl.h (__gmp_invalid_operation): Add prototype.
13659 (DOUBLE_NAN_INF_ACTION): New macro.
13661 * tests/trace.c, tests/tests.h (d_trace): New function.
13662 * tests/misc.c, tests/tests.h (tests_infinity_d): New function.
13663 * tests/misc.c (mpz_erandomb, mpz_errandomb): Use gmp_urandomm_ui.
13665 * tune/tuneup.c, tune/common.c, tests/devel/try.c: Cast various
13666 mp_size_t values for printf %ld in case mp_size_t==int. Use
13667 gmp_printf for mp_limb_t values.
13669 * gmp.texi (Nomenclature and Types): Add mp_exp_t, mp_size_t,
13670 gmp_randstate_t. Note ulong for bit counts and size_t for byte
13671 counts. Don't bother with @noindent.
13672 (Debugging): New valgrind is getting MMX/SSE.
13673 (Integer Comparisons): mpz_cmp_d and mpz_cmpabs_d on NaNs and Infs.
13674 (Float Comparison): mpf_cmp_d behaviour on NaNs and Infs.
13675 (Low-level Functions): Note with mpn_hamdist what hamming distance is.
13676 (Formatted Output Strings): Add type M.
13677 (Internals): Remove remarks on ulong bits and size_t bytes. Move int
13678 field remarks to ...
13679 (Integer Internals, Float Internals): ... here.
13681 2003-04-19 Kevin Ryde <kevin@swox.se>
13683 * configure.in (*sparc*-*-* ABI=32): Add umul to extra_functions.
13685 * mpn/x86/p6/mul_basecase.asm: New file.
13687 2003-04-18 Kevin Ryde <kevin@swox.se>
13689 * configure.in (m68060-*-*): Fallback to gcc -m68000 when -m68060 not
13690 available, and don't use mpn/m68k/mc68020 asm routines. (Avoids 32x32
13691 mul and 64/32 div which trap to the kernel on 68060. Advice by
13693 * mpn/m68k/README: Update notes on directory usage.
13695 * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Add a hack to let the
13696 test programs run with a shared libgmpxx on openbsd 3.2.
13698 * gmp.texi (Language Bindings): Add Guile.
13700 2003-04-12 Kevin Ryde <kevin@swox.se>
13702 * configure.in (cygwin*, mingw*, pw32*, os2*): Add
13703 -Wl,--export-all-symbols to GMP_LDFLAGS, no longer the default in
13704 latest mingw and libtool.
13706 * acinclude.m4 (GMP_ASM_COFF_TYPE): New macro.
13707 * configure.in (x86s): Use it.
13708 * mpn/x86/x86-defs.m4 (COFF_TYPE): New macro.
13709 (PROLOGUE_cpu): Use it, for the benefit of mingw DLLs.
13711 * gmp-impl.h (mpn_copyi, mpn_copyd): Add __GMP_DECLSPEC.
13713 * gmp.texi (Known Build Problems): Remove windows test program .exe
13714 repeated built, fixed by new libtool. Remove MacOS C++ shared library
13715 creation, fixed by new libtool.
13716 (Notes for Package Builds, Known Build Problems): Remove DESTDIR notes
13717 on libgmpxx, fixed in new libtool.
13719 2003-04-10 Torbjorn Granlund <tege@swox.com>
13721 * configure.in: Match turbosparc.
13722 * config.guess: Recognize turbosparc (just for *bsd for now).
13724 2003-04-09 Kevin Ryde <kevin@swox.se>
13726 * mpf/mul_ui.c [nails]: Call mpf_mul to handle v > GMP_NUMB_MAX.
13728 * tests/mpz/t-mul.c (main): Don't try FFT sizes when FFT disabled via
13729 MP_SIZE_T_MAX, eg. for nails.
13731 * tests/cxx/t-ternary.cc: Split up tests to help compile speed and
13734 * tests/devel/try.c: Print seed under -R, add -E to reseed, use ulong
13737 * gmp.texi: Add @: after various abbreviations, more index entries.
13738 (leftarrow): New macro, for non-tex.
13739 (Random State Initialization): Remove commented gmp_randinit_lc, not
13740 going to be implemented.
13741 (Random Number Algorithms): New section.
13742 (References): Add Matsumoto and Nishimura on Mersenne Twister, add
13743 Bertot, Magaud and Zimmermann on GMP Square Root.
13745 2003-04-06 Kevin Ryde <kevin@swox.se>
13747 * tests/mpz/t-gcd_ui.c: New file.
13748 * tests/mpz/Makefile.am: Add it.
13750 * mpz/gcd_ui.c: Correction to return value on longlong limb systems,
13751 limb might not fit a ulong.
13753 2003-04-04 Kevin Ryde <kevin@swox.se>
13755 * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
13758 2003-04-02 Kevin Ryde <kevin@swox.se>
13760 * configure.in (*-*-cygwin*): No longer force lt_cv_sys_max_cmd_len,
13761 libtool has addressed this now.
13762 (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): Remove this, libtool _LT_AC_LOCK
13763 no longer needs it.
13765 * acinclude.m4 (GMP_PROG_AR): Also set ac_cv_prog_AR and
13766 ac_cv_prog_ac_ct_AR when adding flags to AR, so they're not lost by
13767 libtool's call to AC_CHECK_TOOL.
13769 2003-04-01 Kevin Ryde <kevin@swox.se>
13771 * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
13774 * configure.in (AC_PROG_F77): Add a dummy AC_PROVIDE to stop libtool
13775 running F77 probes.
13777 * randlc2x.c (gmp_rand_lc_struct): Add comments about what exactly is
13779 (randseed_lc): Rename seedp to seedz to avoid confusion with seedp in
13780 the lc function. Suggested by Pedro Gimeno.
13781 (gmp_randinit_lc_2exp): Use __GMP_ALLOCATE_FUNC_TYPE. No need for
13782 "+1" in mpz_init2 of _mp_seed. Don't bother with mpz_init2 for _mp_a.
13784 2003-03-29 Kevin Ryde <kevin@swox.se>
13786 * configure.in (m68k-*-*): Use -O2, no longer need to fallback to -O.
13787 * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): Remove macro.
13789 * configure.in (AC_CHECK_TYPES): Add notes on why tested.
13791 * gmp.texi (GMPrefu, GMPpxrefu, GMPreftopu, GMPpxreftopu): New macros,
13792 use them for all external references to get URLs into HTML output.
13793 (Random State Initialization): Add gmp_randinit_set.
13794 (Random State Miscellaneous): New section.
13796 2003-03-29 Kevin Ryde <kevin@swox.se>
13798 * randbui.c, randmui.c: New files.
13799 * Makefile.am: Add them.
13800 * gmp-h.in (gmp_urandomb_ui, gmp_urandomm_ui): Add prototypes.
13801 * tests/rand/t-urbui.c, tests/rand/t-urmui.c: New files.
13802 * tests/rand/Makefile.am: Add them.
13804 * gmp-impl.h (gmp_randstate_srcptr): New typedef.
13805 (gmp_randfnptr_t): Add randiset_fn.
13806 * randiset.c: New file.
13807 * Makefile.am: Add it.
13808 * gmp-h.in (gmp_randinit_set): Add prototype.
13809 * randlc2x.c, randmt.c: Add gmp_randinit_set support.
13810 * tests/rand/t-iset.c: New file.
13811 * tests/rand/Makefile.am: Add it.
13813 * tests/misc.c, tests/tests.h (call_rand_algs): New function.
13815 2003-03-27 Kevin Ryde <kevin@swox.se>
13817 * mpz/bin_uiui.c: Use plain "*" for kacc products rather than
13818 umul_ppmm since high not needed, except for an ASSERT now amended.
13820 2003-03-26 Kevin Ryde <kevin@swox.se>
13822 * demos/expr/exprfr.c (cbrt, cmpabs, exp2, gamma, nextabove,
13823 nextbelow, nexttoward): New functions.
13824 * demos/expr/t-expr.c: Exercise these.
13826 * mpfr/*: Update to mpfr cvs 2003-03-26.
13828 * gmp-impl.h (MPZ_REALLOC): Use UNLIKELY, to expect no realloc.
13830 * tune/time.c (cycles_works_p): Scope variables down to relevant part
13831 to avoid warnings about unused.
13833 * configfsf.guess, configfsf.sub: Update to 2003-02-22.
13834 * config.guess: Fake a $RANDOM variable when running configfsf.guess,
13835 to workaround a problem on m68k NetBSD 1.4.1.
13837 * mpz/fac_ui.c: Remove unused variable "z1".
13839 * tune/freq.c (freq_irix_hinv): Allow "Processor 0" line from IRIX 6.5.
13841 2003-03-24 Torbjorn Granlund <tege@swox.com>
13843 * randlc2x.c (randget_lc): Remove write-only variable rn.
13844 * mpf/eq.c: Remove write-only variable usign.
13845 * gen-psqr.c (main): Remove write-only variable numb_bits.
13847 2003-03-17 Torbjorn Granlund <tege@swox.com>
13849 * Makefile.am (libgmp_la_SOURCES): Add mp_dv_tab.c.
13850 (libmp_la_SOURCES): Add mp_dv_tab.c.
13852 * mpn/alpha/invert_limb.asm: Add a few comments.
13854 * mp_dv_tab.c: New file, defining __gmp_digit_value_tab.
13856 * mpz/set_str.c: Get rid of function digit_value_in_base and use table
13857 __gmp_digit_value_tab instead.
13858 * mpz/inp_str.c: Likewise.
13859 * mpf/set_str.c: Likewise.
13860 * mpbsd/min.c: Likewise.
13861 * mpbsd/xtom.c: Likewise.
13863 * mpz/set_str.c: Allow bases <= 62. Return error for invalid bases.
13864 * mpz/inp_str.c: Likewise.
13865 * mpf/set_str.c: Likewise.
13866 * mpz/out_str.c: Likewise.
13867 * mpz/get_str.c: Likewise.
13868 * mpf/get_str.c: Likewise.
13870 * mpz/inp_str.c: Restucture to allocate more string space just
13872 * mpbsd/min.c: Likewise.
13874 * longlong.h (__udiv_qrnnd_c): Remove redundant casts.
13875 (32-bit sparc): Test HAVE_HOST_CPU_supersparc in addition to various
13876 sparc_v8 spellings.
13878 2003-03-17 Kevin Ryde <kevin@swox.se>
13880 * mpfr/*: Update to mpfr cvs 2003-03-17.
13882 2003-03-15 Kevin Ryde <kevin@swox.se>
13884 * Makefile.am (EXTRA_libgmp_la_SOURCES): Use this for TMP_ALLOC
13885 sources, instead of a libdummy.la.
13887 2003-03-16 Torbjorn Granlund <tege@swox.com>
13889 * config.guess: Recognize supersparc and microsparc for *BSD systems.
13890 Generalize some superscalar recognition patterns.
13892 2003-03-14 Torbjorn Granlund <tege@swox.com>
13894 * mpn/sparc64/udiv.asm: New file.
13896 2003-03-13 Torbjorn Granlund <tege@swox.com>
13898 * mpn/sparc64: Table cycle counts. Update some comments.
13900 * mpn/powerpc64/divrem_1.asm: New file.
13902 2003-03-10 Torbjorn Granlund <tege@swox.com>
13904 * mpn/generic/mul.c (mpn_mul): Don't blindly expect
13905 MUL_KARATSUBA_THRESHOLD to be a constant.
13907 2003-03-07 Torbjorn Granlund <tege@swox.com>
13909 * mpn/generic/mul.c (mpn_mul): New operand splitting code for
13910 avoiding cache misses when un >> MUL_KARATSUBA_THRESHOLD > vn.
13911 (MUL_BASECASE_MAX_UN): New #define, default to 500 for now.
13913 2003-03-07 Kevin Ryde <kevin@swox.se>
13915 * Makefile.am: Put gmp.h and mp.h under $(exec_prefix)/include.
13916 * gmp.texi (Build Options): Add notes on this.
13917 Reported by Vincent Lefèvre.
13919 2003-03-06 Kevin Ryde <kevin@swox.se>
13921 * configure.in (alpha*-*-* gcc): Add asm option before testing -mcpu,
13922 for the benefit of gcc 2.9-gnupro-99r1 on alphaev68-dec-osf5.1 which
13923 doesn't otherwise put the assembler in the right mode for -mcpu=ev6.
13925 2003-03-05 Torbjorn Granlund <tege@swox.com>
13927 * mpn/powerpc32/powerpc-defs.m4: Set up renaming for v registers.
13929 * mpz/powm.c (redc): Instead of repeated mpn_incr_u invocations,
13930 accumulate carries and add at the end.
13931 (mpz_powm): Trim tp allocation, now as redc doesn't need carry guard.
13933 2003-02-25 Torbjorn Granlund <tege@swox.com>
13935 * mpn/x86/pentium4/copyd.asm: Correct header comment.
13937 * mpn/arm/addmul_1.asm: Correct cycle counts.
13938 * mpn/arm/submul_1.asm: Likewise.
13940 2003-02-20 Kevin Ryde <kevin@swox.se>
13942 * demos/factorize.c (factor_using_pollard_rho): Test k>0 to avoid
13943 infinite loop if k=0 and gcd!=1 reveals a factor. Reported by John
13946 * gmp.texi, fdl.texi: Update to FDL version 1.2.
13948 2003-02-18 Torbjorn Granlund <tege@swox.com>
13950 * mpn/arm/mul_1.asm: Fix typo introduced in last change.
13952 2003-02-17 Torbjorn Granlund <tege@swox.com>
13954 * mpn/ia64/gmp-mparam.h: Retune.
13956 * mpn/sparc64/copyi.asm: Add some header comments.
13957 * mpn/sparc64/copyd.asm: Likewise.
13959 * mpn/arm/mul_1.asm: Put vl operand last for umull/umlal.
13960 Add some header comments.
13961 * mpn/arm/addmul_1.asm: Rewrite.
13962 * mpn/arm/submul_1.asm: Rewrite.
13963 * mpn/arm/gmp-mparam.h: Retune.
13965 2003-02-16 Torbjorn Granlund <tege@swox.com>
13967 * mpn/arm/copyi.asm: New file.
13968 * mpn/arm/copyd.asm: New file.
13970 2003-02-16 Kevin Ryde <kevin@swox.se>
13972 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Tolerate incorrect last data
13973 byte seen on an arm system.
13975 2003-02-15 Torbjorn Granlund <tege@swox.com>
13977 * mpn/arm/gmp-mparam.h: Retune.
13979 2003-02-13 Torbjorn Granlund <tege@swox.com>
13981 * mpn/powerpc32/750/com_n.asm: Add more cycle counts.
13983 2003-02-13 Kevin Ryde <kevin@swox.se>
13985 * configure.in (AC_PREREQ): Bump to 2.57.
13987 * configure.in, acinclude.m4 (GMP_GCC_WA_OLDAS): New macro, applying
13988 -Wa,-oldas only when necessary.
13990 * configure.in (powerpc*-*-*): Don't use -Wa,-mppc with gcc, it
13991 overrides options recent gcc adds for -mcpu, making generated code
13994 * tune/tuneup.c (mpn_fft_table): Remove definition, it's in mul_fft.c.
13996 2003-02-12 Torbjorn Granlund <tege@swox.com>
13998 * mpn/x86/pentium4/sse2/gmp-mparam.h: Retune.
13999 * mpn/x86/k7/gmp-mparam.h: Retune.
14000 * mpn/x86/k6/gmp-mparam.h: Retune.
14001 * mpn/x86/p6/gmp-mparam.h: Retune.
14002 * mpn/x86/p6/mmx/gmp-mparam.h: Retune.
14004 * tests/mpz/t-mul.c (main): Rewrite FFT testing code.
14006 2003-02-10 Torbjorn Granlund <tege@swox.com>
14008 * config.guess: Recognize "power2" systems.
14010 * mpn/powerpc64/gmp-mparam.h: Fix indentation.
14011 * mpn/power/gmp-mparam.h: Retune.
14012 * mpn/alpha/ev6/nails/gmp-mparam.h: Retune.
14013 * mpn/sparc64/gmp-mparam.h: Retune.
14014 * mpn/pa64/gmp-mparam.h: Retune.
14015 * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
14016 * mpn/sparc32/v8/gmp-mparam.h: Retune.
14017 * mpn/mips64/gmp-mparam.h: Retune.
14018 * mpn/alpha/ev6/gmp-mparam.h: Retune.
14019 * mpn/powerpc32/gmp-mparam.h: Retune.
14020 * mpn/powerpc32/750/gmp-mparam.h: Retune.
14021 * mpn/alpha/ev5/gmp-mparam.h: Retune.
14022 * mpn/m68k/gmp-mparam.h: Retune.
14023 * mpn/cray/gmp-mparam.h: Set GET_STR_PRECOMPUTE_THRESHOLD.
14025 * configure.in: Undo this, problem doesn't happen any more:
14026 (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
14028 2003-02-03 Kevin Ryde <kevin@swox.se>
14030 * gmp-impl.h (MPN_NORMALIZE, MPN_NORMALIZE_NOT_ZERO): Add parens
14031 around macro parameters. Reported by Jason Moxham.
14033 2003-02-01 Kevin Ryde <kevin@swox.se>
14035 * gmp.texi (Low-level Functions): No overlap permitted by mpn_mul_n.
14036 Reported by Jason Moxham.
14037 (Formatted Input Strings): Correction to strtoul cross reference
14039 (BSD Compatible Functions): Add index entry for MINT.
14041 2003-01-29 Torbjorn Granlund <tege@swox.com>
14043 * gmp-impl.h (mpn_mul_fft): Now returns int.
14045 2003-01-29 Paul Zimmermann <Paul.Zimmermann@loria.fr>
14047 * mpn/generic/mul_fft.c: Major rewrite.
14049 2003-01-25 Kevin Ryde <kevin@swox.se>
14051 * config.guess (powerpc*-*-*): Remove $dummy.core file when mfpvr
14053 (trap): Remove $dummy.core on abnormal termination too.
14055 * mpfr/*: Update to mpfr cvs 2003-01-25.
14057 2003-01-24 Torbjorn Granlund <tege@swox.com>
14059 * mpn/ia64/README: Update cycle counts to match current code.
14061 2003-01-18 Kevin Ryde <kevin@swox.se>
14063 * mpfr/*: Update to mpfr cvs 2003-01-18.
14065 2003-01-17 Torbjorn Granlund <tege@swox.com>
14067 * gmp.texi: Canonicalize URLs.
14069 2003-01-15 Kevin Ryde <kevin@swox.se>
14071 * gmp.texi (Notes for Particular Systems): Add hardware floating point
14074 * mpfr/*, configure, aclocal.m4, config.in: Update to mpfr cvs
14077 2003-01-11 Kevin Ryde <kevin@swox.se>
14079 * mpfr/*: Update to mpfr cvs 2003-01-11.
14081 2003-01-09 Kevin Ryde <kevin@swox.se>
14083 * mpfr/get_str.c: Update to mpfr cvs 2003-01-09.
14085 * doc/configuration: Various updates.
14087 2003-01-06 Torbjorn Granlund <tege@swox.com>
14089 * mpn/alpha/copyi.asm: Avoid `nop' mnemonic, unsupported on Cray.
14090 * mpn/alpha/copyd.asm: Likewise.
14092 2003-01-05 Kevin Ryde <kevin@swox.se>
14094 * demos/expr/t-expr.c (check_r): Tolerate mpfr_set_str new return
14097 * configure, aclocal.m4 (*-*-osf4*, *-*-osf5*): Regenerate with
14098 libtool patch to avoid bash printf option problem when building shared
14099 libraries with cxx.
14101 * configure.in (pentium4-*-*): Use "-march=pentium4 -mno-sse2" since
14102 sse2 causes buggy code from gcc 3.2.1 and is only supported on new
14105 * acinclude.m4 (GMP_PROG_NM): Add some notes about failures, per
14106 report by Krzysztof Kozminski.
14108 * gmp-h.in (mpz_mdivmod_ui, mpz_mmod_ui): Add parens around "r".
14110 * gmp-h.in (__GMP_CAST): New macro, clean to g++ -Wold-style-cast.
14111 (GMP_NUMB_MASK, mpz_cmp_si, mpq_cmp_si, mpz_odd_p, mpn_divexact_by3,
14112 mpn_divmod): Use it. Reported by Krzysztof Kozminski.
14113 (mpz_odd_p): No need for the outermost cast to "int".
14114 * tests/cxx/t-cast.cc: New file.
14115 * tests/cxx/Makefile.am: Add it.
14117 2003-01-04 Kevin Ryde <kevin@swox.se>
14119 * mpfr/set_str.c: Update to mpfr cvs 2003-01-04.
14121 * demos/expr/exprfra.c (e_mpfr_number): Tolerate recent mpfr_set_str
14122 returning count of characters accepted.
14124 2003-01-03 Torbjorn Granlund <tege@swox.com>
14126 * mpn/alpha/copyi.asm: New file.
14127 * mpn/alpha/copyd.asm: New file.
14129 2003-01-03 Kevin Ryde <kevin@swox.se>
14131 * demos/expr/t-expr.c: Use __gmpfr on some mpfr internals that have
14134 * mpfr/*, aclocal.m4, config.in, configure: Update to mpfr cvs
14137 * gmp.texi (Introduction to GMP): Mention release announcements
14138 mailing list, and put home page and ftp before mailing lists.
14140 2002-12-28 Torbjorn Granlund <tege@swox.com>
14142 * mpn/generic/mul_fft.c (mpn_fft_next_size): Simplify.
14144 2002-12-28 Kevin Ryde <kevin@swox.se>
14146 * acinclude.m4 (M68K_PATTERN): New macro.
14147 (GMP_GCC_M68K_OPTIMIZE): Use it to avoid m6811 and friends.
14148 * configure.in: Ditto.
14150 * tests/mpz/t-import.c, tests/mpz/t-export.c: Use '\xHH' to avoid
14151 warnings about char overflows.
14152 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Ditto.
14154 2002-12-28 Pedro Gimeno <pggimeno@wanadoo.es>
14156 * randmt.c (randseed_mt, default_state): Fix off-by-one bug on padding.
14157 (randseed_mt): Add ASSERT checking result of mpz_export.
14159 2002-12-24 Kevin Ryde <kevin@swox.se>
14161 * gmp.texi (Integer Import and Export): Clarify treatment of signs,
14162 reported by Kent Boortz.
14164 * randmt.c: Use gmp_uint_least32_t.
14165 (randseed_mt): Add nails to mpz_export in case mt[i] more than 32 bits.
14167 * gmp-impl.h (gmp_uint_least32_t): New typedef, replacing GMP_UINT32.
14168 * configure.in (AC_CHECK_TYPES): Add uint_least32_t.
14169 (AC_CHECK_SIZEOF): Add unsigned short.
14171 2002-12-22 Kevin Ryde <kevin@swox.se>
14173 * gmp-impl.h (ULONG_PARITY) [generic C]: Mask result to a single bit.
14174 (ULONG_PARITY) [_CRAY, __ia64]: New macros.
14175 * tests/t-parity.c: New test.
14176 * tests/Makefile.am (check_PROGRAMS): Add it.
14178 * longlong.h (count_trailing_zeros) [ia64]: New macro.
14180 * tests/t-count_zeros.c (check_various): Remove unused variable "n".
14182 * mpn/x86/README: Revise notes on PIC, PLT and GOT.
14184 * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add "mt"
14185 to GMP::Rand::randstate.
14187 2002-12-22 Pedro Gimeno <pggimeno@wanadoo.es>
14189 * randmt.c (randseed_mt): Fix bug that might cause the generator to
14190 return all zeros with certain seeds. Fix WARM_UP==0 case.
14191 (gmp_randinit_mt): Initialize to a known state by default.
14192 (randget_mt): Remove check for uninitialized buffer: no longer needed.
14193 (recalc_buffer): Use ?: instead of two-element array.
14195 * tests/rand/t-mt.c: New test.
14196 * tests/rand/Makefile.am (check_PROGRAMS): Add it.
14198 2002-12-21 Kevin Ryde <kevin@swox.se>
14200 * cxx/osdoprnti.cc: Use <cstdarg> and <cstring> rather than <stdarg.h>
14201 and <string.h>. No need for <stdio.h>.
14203 * demos/expr/expr.c, demos/expr/exprfa.c, demos/expr/exprfra.c,
14204 demos/expr/exprza.c: Use mp_get_memory_functions, not
14205 __gmp_allocate_func etc.
14206 * demos/expr/t-expr.c: Don't use gmp-impl.h.
14207 (numberof): New macro.
14209 * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
14210 __gmp_free_func): Move declarations to gmp-impl.h
14212 * mp_get_fns.c: New file.
14213 * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
14214 * gmp-h.in (mp_get_memory_functions): Add prototype.
14215 * gmp.texi (Custom Allocation): Add mp_get_memory_functions, refer to
14216 "free" not "deallocate" function.
14217 * gmpxx.h (struct __gmp_alloc_cstring): Use mp_get_memory_functions,
14218 not __gmp_free_func.
14220 * gmp-impl.h [__cplusplus]: Add <cstring> for strlen.
14221 (gmp_allocated_string): Hold length in a field.
14222 * cxx/osdoprnti.cc, cxx/osmpf.cc: Use this.
14224 2002-12-20 Torbjorn Granlund <tege@swox.com>
14226 * tests/mpz/t-perfsqr.c (check_sqrt): Print more variables upon
14229 * mpn/generic/rootrem.c: In Newton loop, pad qp with leading zero.
14231 2002-12-19 Torbjorn Granlund <tege@swox.com>
14233 * mpn/generic/rootrem.c: Allocate 1.585 (log2(3)) times more space
14234 for pp temporary to allow for worst case overestimate of root.
14237 * tests/mpz/t-root.c: Generalize and speed up.
14239 2002-12-19 Kevin Ryde <kevin@swox.se>
14241 * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt test.
14243 * gmp-h.in: Don't bother trying to support Compaq C++ in pre-standard
14245 * gmp.texi (Notes for Particular Systems): Compaq C++ must be used in
14246 "standard" iostream mode.
14248 2002-12-18 Torbjorn Granlund <tege@swox.com>
14250 * mpn/alpha/mod_34lsub1.asm: Add code for big-endian, using existing
14251 little-endian code only if HAVE_LIMB_LITTLE_ENDIAN is defined.
14253 2002-12-18 Kevin Ryde <kevin@swox.se>
14255 * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): New
14256 defines in config.m4.
14258 2002-12-17 Torbjorn Granlund <tege@swox.com>
14260 * printf/printffuns.c (gmp_fprintf_reps): Make it actually work
14263 2002-12-17 Kevin Ryde <kevin@swox.se>
14265 * tune/freq.c: Add <string.h> for memcmp.
14267 * mpz/pprime_p.c: Use MPN_MOD_OR_MODEXACT_1_ODD.
14269 * gmp.texi (Formatted Output Strings): %a and %A are C99 not glibc.
14270 (Formatted Input Strings): Type "l" is for double too. Hex floats are
14271 accepted for mpf_t.
14272 (Formatted Input Functions): Describe tightened parse rule, clarify
14273 return value a bit.
14275 * scanf/doscan.c: Add hex floats, tighten matching to follow C99, for
14276 instance "0x" is no longer acceptable to "%Zi".
14277 Rename "invalid" label to avoid "invalid" variable, SunOS cc doesn't
14278 like them the same.
14279 * tests/misc/t-scanf.c: Update tests.
14280 * tests/misc/t-locale.c (check_input): Don't let "0x" appear from fake
14283 * config.guess (sparc*-*-*): Look at BSD sysctl hw.model to recognise
14286 * mpfr/tests/dummy.c: New file.
14287 * mpfr/tests/Makefile.am (libfrtests_a_SOURCES): Add it.
14289 2002-12-14 Kevin Ryde <kevin@swox.se>
14291 * mpbsd/Makefile.am (nodist_libmpbsd_la_SOURCES): Move these mpz
14292 sources to libmpbsd_la_SOURCES directly, automake 1.7.2 now gets the
14293 ansi2knr setups right for sources in other directories.
14295 * mpfr/tests/Makefile.am: Add libfrtests.a in preparation for new mpfr.
14297 2002-12-13 Kevin Ryde <kevin@swox.se>
14299 * mpfr/Makefile.am (mpfr_TEXINFOS, AM_MAKEINFOFLAGS): Allow for
14300 fdl.texi in recent mpfr.
14302 * configure.in (AC_PROG_EGREP): Ensure this is run outside the Cray
14303 conditional AC_EGREP_CPP.
14305 * configure.in (alpha*-*-*): Use gcc -Wa,-oldas if it works, to avoid
14306 problems with new compaq "as" on OSF 5.1.
14308 * mpn/Makefile.am (EXTRA_DIST): Remove Makeasm.am, automake 1.7.2 does
14311 * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Remove this hack, fixed by
14314 * configure.in (AC_CONFIG_LIBOBJ_DIR): Set to mpfr, for the benefit of
14315 new mpfr using LIBOBJ.
14317 * configure.in: (AM_INIT_AUTOMAKE): Use "gnu no-dependencies
14318 $(top_builddir)/ansi2knr".
14319 * */Makefile.am (AUTOMAKE_OPTIONS): Remove, now in configure.in.
14321 * configure, config.in, INSTALL.autoconf: Update to autoconf 2.57.
14322 * */Makefile.in, configure, aclocal.m4, install-sh, mkinstalldirs:
14323 Update to automake 1.7.2.
14325 * gmp.texi (Build Options): Add hppa64 to cpu types.
14326 (ABI and ISA): Add gcc to hppa 2.0.
14327 (Debugging): Add maximum debuggability config options.
14328 (Language Bindings): Add Arithmos, reported by Johan Vervloet.
14329 (Formatted Output Strings): 128 bits is about 40 digits, ll is only
14330 for long long not long double.
14331 (Formatted Input Strings): ll is only for long long not long double.
14333 * mpz/divis.c, mpz/divis_ui.c, mpz/cong.c, mpz/cong_ui.c: Allow d=0,
14334 under the rule n==c mod d iff exists q satisfying n=c+q*d.
14335 * gmp.texi (Integer Division): Describe this.
14336 Suggested by Jason Moxham.
14338 2002-12-13 Pedro Gimeno <pggimeno@wanadoo.es>
14340 * randlc2x.c (lc): Remove check for seedn < an, which is now
14341 superfluous. Add ASSERT to ensure it's correct. Add ASSERT to check
14342 precondition of __GMPN_ADD.
14343 (gmp_randinit_lc_2exp): Avoid reallocation by allocating one extra bit
14344 for both seed and a. Simplify seedn < p->_cn case.
14346 * tests/rand/t-lc2exp.c (check_bigs): Test negative seeds.
14348 2002-12-12 Torbjorn Granlund <tege@swox.com>
14350 * mpn/pa32/pa-defs.m4 (PROLOGUE_cpu): Zap spurious argument to `.proc'.
14351 Add empty `.callinfo'.
14353 2002-12-11 Torbjorn Granlund <tege@swox.com>
14355 * mpn/x86/pentium4/sse2/addmul_1.asm: Don't reuse `ret' symbol for a
14358 2002-12-11 Kevin Ryde <kevin@swox.se>
14360 * configure.in (hppa*-*-*): Don't use gcc -mpa-risc-2-0 in ABI=1.0.
14362 * mpn/pa32/pa-defs.m4: New file, arranging for .proc/.procend.
14363 * configure.in (hppa*-*-*): Use it.
14365 * printf/doprnt.c: Comments on "ll" versus "L".
14367 * tests/mpz/t-div_2exp.c: Reduce tests, especially the random ones.
14369 2002-12-11 Torbjorn Granlund <tege@swox.com>
14371 * mpz/get_d.c (limb2dbl): New macro for conversion to `double'.
14372 Define it to something non-trivial for 64-bit hppa.
14373 * mpq/get_d.c: Likewise.
14374 * mpf/get_d.c: Likewise.
14376 * mpn/x86/pentium4/sse2/addmul_1.asm: Unroll to save one c/l.
14378 2002-12-09 Kevin Ryde <kevin@swox.se>
14380 * tune/Makefile.am: Don't use -static under --disable-static, it tends
14382 * configure.in (ENABLE_STATIC): New AM_CONDITIONAL.
14384 * gmp-h.in: Use <iostream> instead of <iosfwd> with Compaq C++ in
14385 pre-standard I/O mode.
14387 * tests/mpz/t-jac.c, tests/mpz/t-scan.c: Reduce tests.
14389 2002-12-08 Kevin Ryde <kevin@swox.se>
14391 * configure.in (*-*-ultrix*): Remove forcible --disable-shared,
14392 believe this was a generic problem with libtool, now gone.
14394 2002-12-08 Torbjorn Granlund <tege@swox.com>
14396 * gmp-impl.h (USE_LEADING_REGPARM): Disable for PIC code generation.
14398 2002-12-07 Torbjorn Granlund <tege@swox.com>
14400 * tests/cxx/t-misc.cc (check_mpq): Use 0/1 for canonical 0 in
14403 * configure.in (hppa2.0*-*-*): Pass +O2 instead of +O3 to work around
14404 compiler bug with mpfr/tests/tdiv.
14406 2002-12-07 Kevin Ryde <kevin@swox.se>
14408 * configure.in (hppa2.0*-*-* ABI=2.0n): Make -mpa-risc-2-0 optional.
14409 New hppa-level-2.0 test using GMP_HPPA_LEVEL_20 to detect assembler
14411 * acinclude.m4 (GMP_PROG_CC_WORKS): Add code that provokes an error
14412 from gcc -mpa-risc-2-0 if the assembler doesn't know 2.0 instructions.
14413 (GMP_HPPA_LEVEL_20): New macro.
14415 2002-12-07 Pedro Gimeno <pggimeno@wanadoo.es>
14417 * gmp-impl.h (gmp_randfnptr_t.randseed_fn) Return void.
14418 (LIMBS_PER_ULONG, MPN_SET_UI): New macros.
14419 (MPZ_FAKE_UI): Rename couple of parameters.
14421 * randlc2x.c (gmp_rand_lc_struct): _mp_c and _mp_c_limbs replaced
14422 with mpn style _cp and _cn. All callers changed.
14423 (randseed_lc): Fix limbs(seed) > bits_to_limbs(m2exp) case.
14424 Remove return value.
14425 (gmp_randinit_lc_2exp): Attempt to avoid redundant reallocation.
14427 * randmt.c (mangle_seed): New function by Kevin.
14428 (randseed_mt): Use it instead of mpz_powm, for performance. Remove
14429 return value. Remove commented out code (an inferior alternative to
14432 * randsdui.c (gmp_randseed_ui): Use MPZ_FAKE_UI.
14434 * tests/rand/t-lc2exp.c (check_bigm, check_bigs): New tests.
14435 * tests/rand/t-urndmm.c: Add L to constants in calls, for K&R.
14437 2002-12-06 Torbjorn Granlund <tege@swox.com>
14439 * configure.in: Remove -g.
14440 (hppa*-*-*): Pass -Wl,+vnocompatwarnings with +DA2.0.
14442 2002-12-05 Torbjorn Granlund <tege@swox.com>
14444 * mpn/pa64/sqr_diagonal.asm: Remove .entry, .proc, .procend.
14445 * mpn/pa64/udiv.asm: Likewise.
14447 2002-12-05 Kevin Ryde <kevin@swox.se>
14449 * mpn/pa64/sub_n.asm: Remove space in "sub, db" which gas objects to.
14450 * mpn/pa64/*.asm, tune/hppa2.asm: Use ".level 2.0" for 2.0n, since gas
14451 doesn't like ".level 2.0N".
14453 * configure.in (hppa*-*-*): Group path and flags choices, for clarity.
14454 (hppa1.0*-*-*): Use gcc -mpa-risc-1-0 when available.
14455 (hppa2.0*-*-*): Ditto -mpa-risc-2-0.
14456 (*-*-hpux*): Exclude ABI=2.0w for hpux[1-9] and hpux10, rather than
14457 the converse of allowing it for hpux1[1-9]; ie. list the bad systems
14458 rather than try to guess the good systems.
14459 (hppa2.0*-*-*) [ABI=2.0n ABI=2.0w]: Add gcc to likely compilers.
14460 (hppa*-*-*) [gcc]: Test sizeof(long) to differentiate a 32-bit or
14461 64-bit build of the compiler.
14462 (hppa64-*-*): Add this as equivalent to hppa2.0-*-*.
14463 * acinclude.m4 (GMP_C_TEST_SIZEOF): New macro.
14465 * tests/tests.h (ostringstream::str): Must null-terminate
14466 ostrstream::str() for the string constructor.
14468 2002-12-04 Torbjorn Granlund <tege@swox.com>
14470 * mpn/pa32/hppa1_1/udiv.asm: Don't wrap symbol to INT64 in L() stuff.
14472 * longlong.h (mpn_udiv_qrnnd_r based udiv_qrnnd): Fix typo.
14474 * mpn/powerpc32/powerpc-defs.m4: Define float registers with `f'
14477 2002-12-04 Kevin Ryde <kevin@swox.se>
14479 * gmp.texi (Floating-point Functions): Note the mantissa is binary and
14480 decimal fractions cannot be represented exactly. Suggested by Serge
14482 (Known Build Problems): Note libtool stripping options when linking.
14483 Reported by Vincent Lefevre.
14485 * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Don't make an empty result a
14486 failure, that's a valid result.
14487 (GMP_ASM_GLOBL): Establish this from the host cpu type.
14488 (IA64_PATTERN): New macro.
14489 (GMP_PROG_EXEEXT_FOR_BUILD, GMP_C_FOR_BUILD_ANSI,
14490 GMP_CHECK_LIBM_FOR_BUILD): Remove temporary files created.
14491 * configure.in: Use IA64_PATTERN.
14493 2002-12-03 Torbjorn Granlund <tege@swox.com>
14495 * tune/hppa.asm: Use config.m4.
14496 * tune/hppa2.asm: Likewise.
14497 * tune/hppa2w.asm: Likewise.
14499 * mpn/pa64: Use LDEF.
14501 2002-12-03 Kevin Ryde <kevin@swox.se>
14503 * INSTALL: Use return rather than exit in the example programs.
14504 Suggested by Richard Dawe.
14506 * gmp.texi (Build Options): Move non-unix notes to ...
14507 (Notes for Particular Systems): ... here. Mention MS Interix,
14508 reported by Paul Leyland.
14509 (C++ Interface Random Numbers): Add gmp_randinit_mt to examples.
14511 * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Must test empty suffix first,
14512 for the benefit of hppa hp-ux.
14513 (GMP_ASM_UNDERSCORE): Grep the output of "nm" instead of trying to
14514 construct an asm file, and in case of failure fallback on no
14515 underscore and a warning.
14517 * longlong.h (count_leading_zeros, count_trailing_zeros) [ev67, ev68]:
14518 Restrict __asm__ ctlz and cttz to __GNUC__.
14520 * gen-psqr.c (HAVE_CONST, const): New macros.
14522 * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt.
14524 2002-12-02 Torbjorn Granlund <tege@swox.com>
14526 * gmp-impl.h: Split popc_limb again, combined version gives too many
14529 2002-12-01 Torbjorn Granlund <tege@swox.com>
14531 * mpn/generic/gcdext.c (div1): Disable unused function.
14533 * mpz/root.c: Don't include stdlib.h or longlong.h.
14534 * mpz/rootrem.c: Likewise.
14536 * extract-dbl.c: abort => ASSERT_ALWAYS.
14537 * mpz/set_d.c: Likewise.
14538 * mpn/generic/tdiv_qr.c: Likewise.
14540 * gen-psqr.c (f_cmp_fraction, f_cmp_divisor): Change parameter to
14541 `const void *', to match qsort spec.
14543 2002-12-01 Kevin Ryde <kevin@swox.se>
14545 * gmp.texi (Integer Division): Fix a couple of @math's for tex.
14546 Use @dots in more places.
14548 * tests/cxx/t-locale.cc: Test non std::locale systems too.
14549 * tests/cxx/clocale.c: New file, reinstating what was localeconv.c,
14550 and subverting nl_langinfo too.
14551 * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
14553 * tests/tests.h (ostringstream, istringstream): Provide fakes of these
14554 if <sstream> not available.
14555 * tests/cxx/t-locale.cc, tests/cxx/t-ostream.cc: Remove <sstream>.
14556 * configure.in (AC_CHECK_HEADERS) [C++]: Add <sstream>.
14558 2002-11-30 Torbjorn Granlund <tege@swox.com>
14560 * printf/doprnt.c (__gmp_doprnt): Comment out a `break' to shut up
14563 * mpn/ia64/invert_limb.asm: Add `many' hints to return insns.
14565 * mpn/ia64/divrem_1.asm: Allocate more local registers; put b0 in
14568 * mpn/ia64/popcount.asm: Properly restore register ar.lc.
14570 * longlong.h (umul_ppmm) [ia64]: Form both product parts in asm.
14572 * mpz/bin_uiui.c: Cast umul_ppmm operands.
14574 * scanf/doscan.c (gmpscan): Remove unused label store_get_digits.
14576 * gmp-impl.h: #undef MIN and MAX before #defining.
14578 * mpn/ia64/copyi.asm: Add `;' after bundle declarators.
14579 * mpn/ia64/copyd.asm: Likewise.
14581 * mpn/ia64/divrem_1.asm: Add some syntax to placid the HP-UX assembler.
14583 2002-11-30 Kevin Ryde <kevin@swox.se>
14585 * configure.in (AC_CHECK_HEADERS): Add nl_types.h.
14586 * tests/misc/t-locale.c: Use this, for nl_item on netbsd 1.4.1.
14588 2002-11-29 Torbjorn Granlund <tege@swox.com>
14590 * tests/devel/addmul_1.c: Provide prototype for mpn_print.
14591 (OPS): Account for function overhead.
14592 * tests/devel/{submul_1.c,mul_1.c,add_n.c,sub_n.c}: Likewise.
14594 * mpn/ia64/addmul_1.asm: Rewrite.
14596 2002-11-28 Torbjorn Granlund <tege@swox.com>
14598 * mpn/ia64/sqr_diagonal.asm: Don't allocate any registers.
14600 * mpn/ia64/submul_1.asm: Adapt to Itanium 2.
14602 * mpn/ia64/mul_1.asm: Fix typo in HAVE_ABI_32 code.
14604 * mpn/ia64/add_n.asm: Rewrite.
14605 * mpn/ia64/sub_n.asm: Rewrite.
14607 2002-11-28 Kevin Ryde <kevin@swox.se>
14609 * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Use this rather
14611 * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Use this for
14612 x86call.asm and x86check.c rather than libdummy.
14614 2002-11-27 Torbjorn Granlund <tege@swox.com>
14616 * tests/mpz/t-mul.c: Implement reference Karatsuba multiplication.
14617 Rewrite testing scheme to run fewer really huge tests.
14619 2002-11-26 Torbjorn Granlund <tege@swox.com>
14621 * tests: Decrease repetition count for some of the slowest tests.
14623 * mpn/ia64/divrem_1.asm: New file.
14625 2002-11-25 Torbjorn Granlund <tege@swox.com>
14627 * mpfr/tests/tdiv.c: Decrease number of performed tests.
14629 2002-11-23 Torbjorn Granlund <tege@swox.com>
14631 * mpn/ia64/mul_1.asm: Rewrite.
14633 2002-11-23 Kevin Ryde <kevin@swox.se>
14635 * mpn/ia64/README: Add some references.
14637 * gmp.texi (Build Options): Add itanium and itanium2, mention DocBook
14638 and XML from makeinfo, add texinfo top level cross reference.
14639 (Integer Division): Try to clarify 2exp functions a bit.
14640 (C++ Interface Floats): Giving bad string to constructor is undefined.
14641 (C++ Interface Integers, C++ Interface Rationals): Ditto, and show
14642 default base in prototype, not the description.
14644 * config.sub, config.guess, configure.in (itanium, itanium2): New cpu
14647 * tests/misc/t-printf.c, tests/misc/t-scanf.c (check_misc): Suppress
14648 %zd test on glibc prior to 2.1, it's not supported.
14650 2002-11-22 Torbjorn Granlund <tege@swox.com>
14652 * mpn/ia64/copyi.asm: Optimize for Itanium 2.
14653 * mpn/ia64/copyd.asm: Likewise.
14655 2002-11-20 Torbjorn Granlund <tege@swox.com>
14657 * mpn/ia64/sqr_diagonal.asm: New file.
14659 * mpn/ia64/submul_1.asm: Handle vl == 0 specially.
14661 2002-11-20 Kevin Ryde <kevin@swox.se>
14663 * tests/cxx/t-locale.cc: Test with locales imbued into stream, use
14664 <sstream>, eliminated some C-isms. istream tests disabled, not yet
14666 * tests/cxx/Makefile.am (t_locale_SOURCES): Remove localeconv.c.
14667 * tests/cxx/localeconv.c: Remove file.
14669 * configure.in (AC_CHECK_TYPES) [C++]: Add std::locale.
14670 * printf/doprntf.c: Add decimal point parameter, remove localeconv use.
14671 * gmp-impl.h (__gmp_doprnt_mpf): Update prototype, bump symbol to
14672 __gmp_doprnt_mpf2 to protect old libgmpxx.
14673 * cxx/osmpf.cc: Use this with ostream locale decimal_point facet.
14674 * printf/doprnt.c: Ditto, with GMP_DECIMAL_POINT.
14676 * gmp-h.in: More comments on __declspec for windows DLLs.
14678 * mpf/set_str.c, scanf/doscan.c: Cast through "unsigned char" for
14679 decimal point string, same as input chars.
14681 * configure.in (AC_CHECK_HEADERS): Add langinfo.h.
14682 (AC_CHECK_FUNCS): Add nl_langinfo.
14683 * gmp-impl.h (GMP_DECIMAL_POINT): New macro.
14684 * mpf/out_str.c, mpf/set_str.c, scanf/doscan.c: Use it, and don't
14685 bother with special code for non-locale systems.
14686 * tests/misc/t-locale.c: Subvert nl_langinfo too.
14688 * configure.in, acinclude.m4 (GMP_ASM_X86_GOT_UNDERSCORE): New macro.
14689 * mpn/x86/x86-defs.m4 (_GLOBAL_OFFSET_TABLE_): New macro, inserting
14690 extra underscore for OpenBSD.
14691 * mpn/x86/README (_GLOBAL_OFFSET_TABLE_): Update notes.
14692 Reported by Christian Weisgerber.
14694 * tests/cxx/t-rand.cc (check_randinit): New function, collecting up
14697 * tests/cxx/t-ostream.cc: Use <sstream> instead of <strstream>, use
14698 compare instead of strcmp.
14700 * gmpxx.h (__gmp_randinit_lc_2exp_size_t): Return type is int.
14702 2002-11-18 Kevin Ryde <kevin@swox.se>
14704 * tune/speed.c (r_string): Use CNST_LIMB with <N>bits, spotted by
14707 2002-11-19 Torbjorn Granlund <tege@swox.com>
14709 * mpn/ia64/mul_1.asm: Remove redundant cmp from prologue code.
14710 Streamline prologue.
14711 * mpn/ia64/addmul_1.asm: Likewise.
14712 * mpn/ia64/submul_1.asm: New file.
14713 * mpn/ia64/submul_1.c: Remove.
14715 2002-11-17 Torbjorn Granlund <tege@swox.com>
14717 * mpn/generic/popham.c: New file, using new faster algorithm.
14718 * mpn/generic/popcount.c: Remove.
14719 * mpn/generic/hamdist.c: Remove.
14721 * mpn/ia64/addmul_1.asm: Don't clobber callee-saves register f16.
14722 * mpn/ia64/mul_1.asm: Likewise.
14724 * mpn/ia64/addmul_1.asm: Add pred.rel declarations. Resolve RAW
14725 hazards for condition code registers, duplicating code as needed. Add
14726 prediction to all branches.
14727 * mpn/ia64/mul_1.asm: Likewise.
14728 * mpn/ia64/add_n.asm: Likewise.
14729 * mpn/ia64/sub_n.asm: Likewise.
14730 * mpn/ia64/copyi.asm: Likewise.
14731 * mpn/ia64/copyd.asm: Likewise.
14733 * mpn/generic/random2.c: Add a cast to silence some compilers.
14735 2002-11-16 Torbjorn Granlund <tege@swox.com>
14737 * mpz/powm.c: Cap allocation by limiting k to 10 (512 precomputed
14740 2002-11-16 Kevin Ryde <kevin@swox.se>
14742 * configure.in, gmp.texi: Remove powerpc64 ABI=32L, doesn't work and
14743 is unlikely to ever do so.
14744 * configure.in: Allow ABI=32 for powerpc64.
14745 Reported by David Edelsohn.
14747 2002-11-14 Kevin Ryde <kevin@swox.se>
14749 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add addmul_2.c
14750 addmul_3.c addmul_4.c addmul_5.c addmul_6.c addmul_7.c addmul_8.c.
14752 * gmp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
14753 Use __dllexport__ and __dllimport__ to keep out of application
14756 2002-11-14 Gerardo Ballabio <gerardo.ballabio@unimib.it>
14758 * gmpxx.h (__gmp_randinit_default_t, __gmp_randinit_lc_2exp_t,
14759 __gmp_randinit_lc_2exp_size_t): Use extern "C" { typedef ... }, for
14760 the benefit of g++ prior to 3.2.
14762 2002-11-12 Kevin Ryde <kevin@swox.se>
14764 * gmpxx.h (gmp_randclass constructors): Patch from Roberto Bagnara to
14765 use extern "C" on C function pointer arguments.
14767 2002-11-09 Kevin Ryde <kevin@swox.se>
14769 * configure.in, Makefile.am, printf/Makefile.am,
14770 printf/repl-vsnprintf.c: Handle vsnprintf replacement with C
14773 * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Workaround troubles recent
14774 HP cc +O3 causes for AC_CHECK_FUNCS.
14776 * gmp.texi (Notes for Particular Systems): Add Sparc app regs.
14777 (Debugging): Note gcc -fstack options to detect overflow.
14778 (Formatted Output Strings, Formatted Input Strings): Format strings
14781 2002-11-06 Torbjorn Granlund <tege@swox.com>
14783 * mpn/generic/tdiv_qr.c: Remove a bogus assert.
14785 2002-11-05 Torbjorn Granlund <tege@swox.com>
14787 * mpn/generic/tdiv_qr.c: Remove two dead mpn_divrem_2 calls.
14789 2002-11-04 Kevin Ryde <kevin@swox.se>
14791 * acinclude.m4 (GMP_C_INLINE): Don't define "inline" for C++.
14793 * demos/expr/expr-impl.h (stdarg.h): Test __DECC same as gmp.h.
14795 * mpbsd/mtox.c, printf/obprintf.c, printf/obvprintf.c,
14796 scanf/vsscanf.c, demos/expr/expr.c, demos/expr/exprf.c,
14797 demos/expr/exprfa.c, demos/expr/exprfr.c, demos/expr/exprq.c,
14798 demos/expr/exprz.c, demos/expr/exprza.c: Add <string.h> for strlen and
14801 2002-11-02 Kevin Ryde <kevin@swox.se>
14803 * longlong.h: Test __x86_64__ not __x86_64. Reported by Andreas
14806 * mpz/import.c, mpz/export.c: Use char* subtract from NULL to get
14807 pointer alignment, for the benefit of Cray vector systems.
14809 * cxx/ismpf.cc: Use <clocale>.
14810 * tests/cxx/t-locale.cc: No need to conditionalize <clocale>.
14812 * scanf/doscan.c: Don't use isascii, rely on C99 ctype.h.
14814 * gmp.texi (Build Options): Describe CC_FOR_BUILD, cross reference
14816 (ABI and ISA): Add powerpc620 and powerpc630 to powerpc64, add NetBSD
14817 and OpenBSD sparc64.
14818 (Notes for Package Builds): Cross reference libtool manual.
14819 (Notes for Particular Systems): Add OpenBSD to non-MMX versions of gas.
14820 (Known Build Problems): Add MacOS X C++ shared libraries.
14822 2002-10-31 Kevin Ryde <kevin@swox.se>
14824 * gmp-impl.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
14825 tests/devel/try.c, tests/tests.h, tests/refmpn.c (mpn_addmul_5,
14826 mpn_addmul_6, mpn_addmul_7, mpn_addmul_8): Add testing and measuring.
14827 * configure.in (config.in): Add #undefs of HAVE_NATIVE_mpn_addmul_5,
14828 HAVE_NATIVE_mpn_addmul_6, HAVE_NATIVE_mpn_addmul_7,
14829 HAVE_NATIVE_mpn_addmul_8.
14830 (gmp_mpn_functions_optional): Add addmul_5 addmul_6 addmul_7 addmul_8.
14832 * tests/devel/try.c (ASSERT_CARRY): Remove, now in gmp-impl.h
14833 (try_one): Do dest setups after sources, for benefit of
14836 2002-11-01 Torbjorn Granlund <tege@swox.com>
14838 * mpn/generic/tdiv_qr.c: Avoid quadratic behaviour for
14839 sub-division when numerator is more than twice the size of the
14840 denominator. Simplify loop logic for the same case. Clean up a
14843 2002-10-29 Torbjorn Granlund <tege@swox.com>
14845 * configure.in (*-cray-unicos*): Pass -hnofastmd again.
14847 2002-10-25 Torbjorn Granlund <tege@swox.com>
14849 * tests/tadd.c: Disable test of denorms.
14851 2002-10-23 Linus Nordberg <linus@swox.se>
14853 * gmp.texi (Introduction to GMP): Update section about mailing
14856 2002-10-23 Kevin Ryde <kevin@swox.se>
14858 * gmp-h.in (__GMP_ATTRIBUTE_PURE): Suppress this when
14859 __GMP_NO_ATTRIBUTE_CONST_PURE is defined.
14860 * gmp-impl.h (ATTRIBUTE_CONST): Ditto.
14861 * tune/common.c: Use __GMP_NO_ATTRIBUTE_CONST_PURE.
14863 * tune/speed.h, tune/many.pl: Remove ATTRIBUTEs from prototypes.
14864 * tune/speed.h: Remove various "dummy" variables attempting to keep
14865 "pure" calls live, no longer necessary. They weren't sufficient for
14866 recent MacOS cc anyway.
14868 2002-10-21 Torbjorn Granlund <tege@swox.com>
14870 * mpn/cray/ieee/addmul_1.c: Handle overlap as in mul_1.c.
14871 * mpn/cray/ieee/submul_1.c: Likewise.
14873 2002-10-19 Kevin Ryde <kevin@swox.se>
14875 * configure.in (sparcv9 etc -*-*bsd*): Add support for NetBSD and
14876 OpenBSD sparc64. Reported by Christian Weisgerber.
14877 (AC_CHECK_HEADERS): Add sys/param.h for sys/sysctl.h on *BSD.
14879 * demos/calc/calc.y: Change ={ to {, needed for bison 1.50.
14881 * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]:
14884 * mpz/set_str.c, mpf/set_str.c, mpbsd/xtom.c, scanf/sscanffuns.c: Cast
14885 chars through "unsigned char" to zero extend, required by C99 ctype.h.
14887 2002-10-18 Torbjorn Granlund <tege@swox.com>
14889 * tests/mpz/t-root.c: Test also mpz_rootrem.
14891 * mpn/generic/rootrem.c: Avoid overflow problem when n is huge.
14893 * mpz/root.c: Avoid overflow problems in allocation computation; also
14894 simplify it. Misc cleanups.
14896 * mpz/rootrem.c: New file.
14897 * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
14899 2002-10-17 Torbjorn Granlund <tege@swox.com>
14901 * gmp-impl.h (popc_limb): Combine variants.
14903 2002-10-14 Kevin Ryde <kevin@swox.se>
14905 * configure.in (AC_CHECK_HEADERS): Add sys/time.h for sys/resource.h
14906 test, needed by SunOS, and next autoconf will insist headers actually
14909 2002-10-08 Kevin Ryde <kevin@swox.se>
14911 * tune/time.c (speed_time_init): Allow for Cray times() apparently
14912 being a cycle counter.
14914 * dumbmp.c (mpz_get_str): Fix buf size allocation.
14916 * tests/trace.c, tests/tests.h (mp_limb_trace): New function.
14918 * tune/speed-ext.c (SPEED_EXTRA_PROTOS): Use __GMP_PROTO.
14919 * tests/devel/try.c (malloc_region): Add a cast for SunOS cc.
14921 * configure.in (AC_CHECK_FUNCS): Add strerror.
14922 (AC_CHECK_DECLS): Add sys_errlist, sys_nerr.
14923 * tune/time.c, tests/devel/try.c: Use them.
14925 2002-10-05 Kevin Ryde <kevin@swox.se>
14927 * configure.in (AC_CHECK_HEADERS): Test float.h, not in SunOS cc.
14928 * printf/repl-vsnprintf.c: Use this.
14930 * configure.in (*sparc*-*-*): Collect up various options for clarity,
14931 use gcc -mcpu=supersparc and ultrasparc3, use cc -xchip, don't use
14932 -xtarget=native, use cc configs with acc, merge SunOS bundled cc and
14935 * gmp-impl.h (gmp_randfnptr_t): Use __GMP_PROTO.
14936 (MPZ_REALLOC): Cast _mpz_realloc return value to mp_ptr, for the
14937 benefit of SunOS cc which requires pointers of the same type on the
14940 * dumbmp.c (mpz_realloc): Add a cast to avoid a warning from SunOS cc.
14942 * acinclude.m4: Allow for i960 b.out default cc output.
14944 * gmp.texi (Random State Initialization): Add gmp_randinit_mt.
14945 (Perfect Square Algorithm): Describe new mpn_mod_34lsub1 use.
14946 (Factorial Algorithm): Describe Jason's new code.
14947 (Binomial Coefficients Algorithm): Ideas about improvements
14948 moved to doc/projects.html.
14949 (Contributors): Add Jason Moxham and Pedro Gimeno.
14951 2002-10-03 Kevin Ryde <kevin@swox.se>
14953 * gen-psqr.c: New file.
14954 * Makefile.am, mpn/Makefile.am: Use it to generate mpn/perfsqr.h.
14955 * mpn/generic/perfsqr.c: Use generated data, put mod 256 data into
14956 limbs to save space, use mpn_mod_34lsub1 when good.
14957 * tests/mpn/t-perfsqr.c: New file.
14958 * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
14959 * tests/mpz/t-perfsqr.c (check_modulo): New test.
14960 (check_sqrt): New function holding current tests.
14962 * configure.in (AC_INIT): Modernize to package name and version here
14963 rather than AM_INIT_AUTOMAKE, add bug report email.
14964 (AC_CONFIG_SRCDIR): New macro.
14966 * gmp-impl.h (ROUND_UP_MULTIPLE): Fix for non-power-of-2 moduli (not
14967 normal in current uses), clarify the comments a bit.
14969 2002-09-30 Kevin Ryde <kevin@swox.se>
14971 * mpn/Makeasm.am (.s.lo): Add --tag=CC for the benefit of CCAS!=CC,
14972 same as .S.lo and .asm.lo.
14974 * Makefile.am (gen-fac_ui, gen-fib, gen-bases): Quote source files in
14975 test -f stuff to avoid Sun make rewriting them.
14977 2002-09-28 Kevin Ryde <kevin@swox.se>
14979 * tests/devel/try.c, tune/speed.c: Avoid strings longer than C99
14982 * tests/refmpn.c, tests/tests.h (refmpn_zero_extend, refmpn_normalize,
14983 refmpn_sqrtrem): New functions.
14984 * tests/devel/try.c (TYPE_SQRTREM): Use refmpn_sqrtrem.
14985 (compare): Correction to tr->dst_size subscripting.
14987 * dumbmp.c: Add several new functions, allow for initial n<d in
14988 mpz_tdiv_q (now in mpz_tdiv_qr actually).
14990 * gen-bases.c (chars_per_limb): Get GMP_NUMB_BITS for base==2,
14991 similarly other powers of 2, which this was in the past.
14992 * tests/refmpn.c (refmpn_chars_per_limb): Ditto.
14993 * tests/mpn/t-mp_bases.c: Test chars_per_limb for power-of-2 bases too.
14995 * Makefile.am, mpz/Makefile.am: Setups for gen-fac_ui.c generating
14998 2002-09-28 Jason Moxham <J.L.Moxham@maths.soton.ac.uk>
15000 * dumbmp.c (mpz_pow_ui, mpz_addmul_ui, mpz_root): New functions.
15001 * gen-fac_ui.c: New file.
15002 * mpz/fac_ui.c: Rewrite.
15004 2002-09-26 Kevin Ryde <kevin@swox.se>
15006 * tests/cxx/localeconv.c: New file, split from t-locale.cc.
15007 * tests/cxx/t-locale.cc: Use it.
15008 * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
15010 * tests/cxx/Makefile.am: Updates for Gerardo's new test programs.
15012 2002-09-26 Gerardo Ballabio <gerardo.ballabio@unimib.it>
15014 * gmpxx.h (__gmp_cmp_function): Bug fixes in double/mpq and
15015 double/mpfr comparisons.
15017 * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-constr.cc,
15018 tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: Revise and add various
15019 tests, including some for mpfr, some split from t-expr.cc.
15020 * tests/cxx/t-locale.cc: Modernize include files.
15021 * tests/cxx/t-ostream.cc: Modernize include files, use cout rather
15022 than printf for diagnostics.
15023 * tests/cxx/t-misc.cc, tests/cxx/t-rand.cc: New file, split from
15025 * tests/cxx/t-ops.cc: New file, some split from t-allfuns.cc.
15026 * tests/cxx/t-prec.cc: New file.
15027 * tests/cxx/t-allfuns.cc, tests/cxx/t-expr.cc: Remove files.
15029 2002-09-25 Torbjorn Granlund <tege@swox.com>
15031 * configure.in (*-cray-unicos*): Remove -hscalar0, it causes too much
15032 performance loss. Let's trust Cray to fix their compilers.
15034 2002-09-24 Torbjorn Granlund <tege@swox.com>
15036 * mpn/powerpc32/add_n.asm: Rewrite.
15037 * mpn/powerpc32/sub_n.asm: Rewrite.
15039 2002-09-24 Pedro Gimeno <pggimeno@wanadoo.es>
15041 * randlc2x.c: Prepare for nails by changing type of _mp_c to mpz_t,
15042 make _mp_seed fixed-size, disallow SIZ(a)==0 to optimize comparisons
15044 * gmp-impl.h (MPZ_FAKE_UI): New macro.
15046 * randmt.c: Some constants made long for K&R compliance; remove UL at
15047 the end of other constants; use mp_size_t where appropriate; use
15048 mpz_export to split the seed.
15050 * gmp-impl.h: Remove type cast in RNG_FNPTR and RNG_STATE, to allow
15051 them to be used as lvalues.
15052 * randclr.c, randlc2x.c, randmt.c, randsd.c: All callers changed.
15054 * mpz/urandomm.c: Replace mpn_cmp with MPN_CMP.
15056 * tests/rand/gen.c: Get rid of gmp_errno.
15058 2002-09-24 Kevin Ryde <kevin@swox.se>
15060 * gmp.texi (Custom Allocation): Keep allocate_function etc out of the
15061 function index by using @deftypevr.
15062 More index entries.
15064 2002-09-24 Gerardo Ballabio <gerardo.ballabio@unimib.it>
15066 * gmpxx.h (mpfr_class constructors from strings): Precision was set
15067 incorrectly, fixed.
15069 2002-09-23 Torbjorn Granlund <tege@swox.com>
15071 * mpf/urandomb.c: Don't crash for overlarge nbits argument.
15072 Let nbits==0 mean to fill number with random bits.
15074 2002-09-21 Torbjorn Granlund <tege@swox.com>
15076 * mpn/alpha/mod_34lsub1.asm: Add r31 dummy operand to `br' instruction.
15078 2002-09-20 Gerardo Ballabio <gerardo.ballabio@unimib.it>
15080 * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal): Fix broken
15081 mpq/double functions.
15083 2002-09-18 Torbjorn Granlund <tege@swox.com>
15085 * randmt.c (randget_mt): Fix typo.
15087 2002-09-18 Kevin Ryde <kevin@swox.se>
15089 * gmp-impl.h (_gmp_rand): Avoid evaluating "state" more than once, for
15090 the benefit places calling it with RANDS.
15092 * randmt.c (randseed_mt): Use mpz_init for mod and seed1, for safety.
15094 * tune/tuneup.c (sqr_karatsuba_threshold): Initialize to
15095 TUNE_SQR_KARATSUBA_MAX so mpn_sqr_n works for randmt initialization.
15097 * gmp.texi (Integer Comparisons): Remove mention of non-existent
15098 mpz_cmpabs_si, reported by Conrad Curry.
15100 * tune/speed.c, tune/speed.h, tune/common.c: Add gmp_randseed,
15101 gmp_randseed_ui and mpz_urandomb.
15103 2002-09-18 Pedro Gimeno <pggimeno@wanadoo.es>
15105 * tests/rand/gen.c: Add mt, remove lc and bbs.
15107 * Makefile.am (libgmp_la_SOURCES): Add randmt.c, remove randlc.c and
15110 * randmt.c: New file.
15111 * gmp-h.in (gmp_randinit_mt): Add prototype.
15112 * randdef.c: Use gmp_randinit_mt.
15114 * gmp-impl.h (RNG_FNPTR, RNG_STATE): New macros.
15115 (gmp_randfnptr_t): New structure.
15116 (_gmp_rand): Now a macro not a function.
15117 * gmp-h.in (__gmp_randata_lc): Remove, now internal to randlc2x.c.
15118 (__gmp_randstate_struct): Revise comments on field usage.
15119 * randsd.c, randclr.c: Use function pointer scheme.
15120 * randsdui.c: Use gmp_randseed.
15121 * randraw.c: Remove file.
15122 * randlc2x.c: Collect up lc_2exp related code from randsd.c, randclr.c
15123 and randraw.c, use function pointer scheme, integrate seed==0/a==0
15124 into main case and fix case where bits(a) < m2exp.
15126 * randlc.c: Remove file, never documented and never worked.
15127 * gmp-h.in (gmp_randinit_lc): Remove prototype.
15129 2002-09-16 Torbjorn Granlund <tege@swox.com>
15131 * mpn/alpha/mod_34lsub1.asm: New file.
15133 2002-09-16 Kevin Ryde <kevin@swox.se>
15135 * configure.in, acinclude.m4 (GMP_C_RESTRICT): Remove this, not
15136 currently used, and #define restrict upsets Microsoft C headers on
15137 win64. Reported by David Librik.
15139 * configure.in (x86): Add gcc 3.2 -march and -mcpu flags, remove some
15140 unnecessary -march=i486 fallbacks.
15142 * gmp.texi (Notes for Particular Systems): Note cl /MD is required for
15143 Microsoft C and MINGW to cooperate on I/O. Explained by David Librik.
15144 (Language Bindings): Add linbox.
15145 * gmp.texi (Language Bindings):
15147 2002-09-12 Kevin Ryde <kevin@swox.se>
15149 * mpz/aorsmul_i.c: Allow for w==x overlap with nails. Test
15150 BITS_PER_ULONG > GMP_NUMB_BITS rather than GMP_NAIL_BITS != 0.
15151 * tests/mpz/t-aorsmul.c: Test this.
15153 * tune/common.c: mpn_mod_34lsub1 only exists for GMP_NUMB_BITS%4==0
15154 * tune/speed.c: Add mpn_mod_34lsub1.
15156 2002-09-10 Pedro Gimeno <pggimeno@wanadoo.es>
15158 * rand.c: Remove old disabled BBS code.
15159 * mpf/urandomb.c: Use BITS_TO_LIMBS.
15161 2002-09-10 Kevin Ryde <kevin@swox.se>
15163 * gmp.texi (Multiplication Algorithms): FFT is now enabled by default.
15165 2002-09-10 Pedro Gimeno <pggimeno@wanadoo.es>
15167 * mpz/urandomm.c: Use mpn level functions, avoid an infinite loop if
15168 _gmp_rand forever returns all "1" bits.
15169 * tests/rand/t-urndmm.c: New file
15170 * tests/rand/Makefile.am (check_PROGRAMS): Add it.
15172 * gmp-impl.h (BITS_TO_LIMBS): New macro.
15173 * mpz/urandomb.c: Use it, and use MPZ_REALLOC.
15175 2002-09-08 Kevin Ryde <kevin@swox.se>
15177 * acinclude.m4 (GMP_GCC_WA_MCPU): New macro.
15178 * configure.in (alpha*-*-*): Use it to avoid -Wa,-mev67 if gas isn't
15179 new enough to know ev67. Reported by David Bremner.
15181 2002-07-30 Gerardo Ballabio <gerardo.ballabio@unimib.it>
15183 * gmpxx.h (__gmpz_value etc): Remove, use mpz_t etc instead.
15184 (__gmp_expr): Reorganise specializations, use __gmp_expr<T,T> not
15186 (mpfr evals): Remove mode parameter, was always
15187 __gmp_default_rounding_mode anyway.
15189 2002-09-07 Kevin Ryde <kevin@swox.se>
15191 * gmp-h.in, mp-h.in: Use #ifdef for tests, for the benefit of
15192 applications using gcc -Wundef.
15194 * longlong.h: Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB for all alphas,
15195 since mpn/alpha/cntlz.asm always goes into libgmp.so, even for ev67
15196 and ev68 which don't need it. Reported by David Bremner.
15198 * gmp.texi (Demonstration Programs): New section, expanding on what
15199 was under "Build Options".
15200 (Converting Floats): Don't need \ for _ in @var within @math.
15201 Add and amend various index entries.
15203 * demos/qcn.c: Add -p prime limit option.
15205 2002-08-30 Kevin Ryde <kevin@swox.se>
15207 * mpz/pprime_p.c: Handle small negatives with isprime, in particular
15208 must do so for n==-2.
15209 * tests/mpz/t-pprime_p.c: New file.
15210 * tests/mpz/Makefile.am: Add it.
15212 2002-08-26 Torbjorn Granlund <tege@swox.com>
15214 * gmp.texi (Converting Floats): Fix typo in mpf_get_d_2exp docs,
15215 reported by Paul Zimmermann.
15217 2002-08-26 Kevin Ryde <kevin@swox.se>
15219 * configure.in: Echo the ABI being tried for the compilers.
15220 (powerpc*-*-*): Use powerpc64/aix.m4 for ABI=aix64 too.
15221 (AC_CHECK_FUNCS): Add strtol, for tests/rand/gen.c.
15223 2002-08-24 Kevin Ryde <kevin@swox.se>
15225 * configure.in (HAVE_HOST_CPU_, HAVE_HOST_CPU_FAMILY_, HAVE_NATIVE_):
15226 Setup templates for these using AH_VERBATIM rather than acconfig.h,
15227 preferred by latest autoconf. Prune lists to just things used.
15228 * acconfig.h: Remove file.
15230 * mpn/powerpc32/mode1o.asm: Forgot ASM_START.
15232 * tune/time.c (have_cgt_id): Renamed from HAVE_CGT_ID so avoid
15233 confusion with autoconf outputs, and turn it into a "const" variable.
15235 2002-08-23 Torbjorn Granlund <tege@swox.com>
15237 * configure.in: Choose powerpc32/aix.m4 or powerpc64/aix.m4 based on
15238 ABI, not configuration triple.
15240 * mpz/pprime_p.c: Partially undo last change--handle small and
15241 negative numbers in the same test.
15243 2002-08-22 Kevin Ryde <kevin@swox.se>
15245 * gmp-impl.h (MUL_FFT_THRESHOLD, SQR_FFT_THRESHOLD): Note
15246 mpn/generic/mul_fft.c is not nails-capable, and don't bother setting
15247 other FFT data for nails.
15249 * configfsf.guess: Update to 2002-08-19.
15250 * configfsf.sub: Update to 2002-08-20.
15252 * config.guess (powerpc*-*-*): Use a { } construct to suppress SIGILL
15255 2002-08-20 Kevin Ryde <kevin@swox.se>
15257 * gmp.texi (Build Options): Add ia64 under cpu types.
15258 (ABI and ISA): Describe IRIX 6 ABI=o32.
15259 (Notes for Particular Systems): Remove -march=pentiumpro, now ok.
15260 (Known Build Problems): Binutils 2.12 is ok for libgmp.a.
15261 (Emacs): New section.
15262 (Language Bindings): Update MLton URL, reported by Stephen Weeks.
15263 (Prime Testing Algorithm): New section.
15264 Don't put a blank line after @item in @table since it can make a page
15265 break between the heading and the entry.
15266 Misc tweaks elsewhere, in particular more index entries.
15268 * mpz/millerrabin.c: Need x to be size+1 for change to urandomm.
15270 * gmp-impl.h: Comments on the use of __GMP_DECLSPEC.
15272 * tune/time.c (freq_measure_mftb_one): Use struct_timeval, for the
15275 * tests/refmpn.c, tests/tests.h (ref_addc_limb, ref_subc_limb):
15276 Renamed from add and sub, following gmp-impl.h ADDC_LIMB and SUBC_LIMB.
15278 2002-08-17 Kevin Ryde <kevin@swox.se>
15280 * mpn/powerpc32/mode1o.asm: New file.
15281 * configure.in, acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): New macro.
15282 * mpn/asm-defs.m4: Use it to help setting up PIC.
15284 * configure.in (AC_PREREQ): Bump to 2.53.
15286 * mpn/powerpc32/powerpc-defs.m4 (ASSERT): New macro.
15287 (PROLOGUE_cpu): New macro, giving ALIGN(4) not 8.
15289 2002-08-16 Torbjorn Granlund <tege@swox.com>
15291 * mpn/m68k/lshift.asm: Fix typo in !scale_available_p code.
15292 * mpn/m68k/rshift.asm: Likewise.
15294 2002-08-16 Kevin Ryde <kevin@swox.se>
15296 * configure.in (--enable-profiling=instrument): New option.
15297 * gmp.texi (Profiling): Describe it.
15298 * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_instrument, ret_internal):
15300 (call_mcount): Share PIC setups with call_instrument.
15301 * mpn/x86/*.asm: Use ret_internal.
15302 * mpn/asm-defs.m4 (m4_unquote): New macro.
15303 * tests/mpn/t-instrument.c: New file.
15304 * tests/mpn/Makefile.am: Add it.
15306 * mpn/alpha/umul.asm: Add ASM_END.
15308 2002-08-12 Kevin Ryde <kevin@swox.se>
15310 * mpz/pprime_p.c: Fake up a local mpz_t to take abs(n), rather than
15311 using mpz_init etc.
15313 * mpz/millerrabin.c: Use mpz_urandomm for uniform selection of x,
15314 reported by Jason Moxham. Exclude x==n-1, ie. -1 mod n. Use
15315 gmp_randinit_default.
15317 * mpn/alpha/umul.asm: Use "r" registers, for the benefit of Unicos.
15319 * tests/devel/try.c: Add mpn_copyi and mpn_copyd.
15321 2002-08-09 Kevin Ryde <kevin@swox.se>
15323 * Makefile.am: Remove configure.lineno from DISTCLEANFILES and gmp.tmp
15324 from MOSTLYCLEANFILES, automake does these itself now.
15326 * */Makefile.in, aclocal.m4, configure, install-sh, missing,
15327 mkinstalldirs: Update to automake 1.6.3.
15329 * mpn/ia64/README: Some notes on assembler syntax.
15331 * mpn/ia64/add_n.asm, mpn/ia64/sub_n.asm: Add .body.
15332 * mpn/ia64/add_n.asm, mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm,
15333 mpn/ia64/sub_n.asm: Position .save ar.lc just before relevant
15335 * mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm: Add .save ar.pfs and pr.
15336 * mpn/ia64/copyd.asm, mpn/ia64/copyi.asm: Correction to .body position.
15337 * mpn/ia64/lorrshift.asm: Add .prologue stuff.
15339 * configure.in (*-*-unicos*): Remove forcible --disable-shared,
15340 libtool gets this right itself now.
15342 2002-08-07 Kevin Ryde <kevin@swox.se>
15344 * mpn/x86/pentium/mmx/hamdist.asm: New file, adapted from
15345 mpn/x86/pentium/mmx/popham.asm.
15346 * mpn/x86/pentium/mmx/popham.asm: Remove file, not faster than plain
15347 mpn/x86/pentium/popcount.asm for the popcount.
15349 * mpn/alpha/umul.asm: Use PROLOGUE/EPILOGUE, rename it mpn_umul_ppmm.
15350 * configure.in (alpha*-*-*): Add umul to extra_functions.
15352 * mpz/remove.c: Make src==0 return 0, not do DIVIDE_BY_ZERO.
15354 2002-08-05 Torbjorn Granlund <tege@swox.com>
15356 * acconfig.h: Remove spurious undefs for mpn_divrem_newton and
15357 mpn_divrem_classic.
15359 2002-08-05 Kevin Ryde <kevin@swox.se>
15361 * tests/refmpn.c, tests/tests.h, tests/misc/t-printf.c,
15362 tests/mpf/t-trunc.c, tests/mpn/t-mp_bases.c, tests/mpn/t-scan.c,
15363 tests/mpq/t-cmp_ui.c, tests/mpz/bit.c, tests/mpz/t-aorsmul.c,
15364 tests/mpz/t-powm_ui.c tests/mpz/t-root.c, tests/mpz/t-scan.c: More
15365 care with long and mp_size_t parameters, for the benefit of K&R.
15367 * demos/perl/GMP.pm, demos/perl/GMP.xs, demos/perl/GMP/Mpz.pm,
15368 demos/perl/test.pl: Add mpz_import and mpz_export.
15369 * demos/perl/GMP.pm: Remove "preliminary" warning.
15371 * mpn/lisp/gmpasm-mode.el: Set add-log-current-defun-header-regexp to
15372 pick up m4 defines etc.
15374 * Makefile.am (libgmpxx_la_DEPENDENCIES): libgmp.la should be here,
15375 not libgmpxx_la_LIBADD, for the benefit of "make -j2".
15377 * mpn/ia64/*.asm [hpux ABI=32]: Extend 32-bit operands to 64-bits, not
15378 optimal and might not be sufficient, but seems to work.
15380 2002-08-03 Kevin Ryde <kevin@swox.se>
15382 * gmp.texi (Profiling): Use a table and expand for clarity.
15383 (Integer Special Functions): New section for mpz_array_init,
15384 _mpz_realloc, mpz_getlimbn and mpz_size, to discourage their use.
15386 * configure.in (*-*-msdosdjgpp*): Remove forcible --disable-shared,
15387 libtool gets this right itself now.
15389 2002-07-30 Kevin Ryde <kevin@swox.se>
15391 * mpn/powerpc32/lshift.asm, mpn/powerpc32/rshift.asm: Lose final mr,
15392 and make final stwu into an stw.
15394 * gmp.texi (Known Build Problems): An easier workaround for DESTDIR,
15395 using LD_LIBRARY_PATH.
15396 (C++ Interface MPFR): Remove mpfrxx.h.
15398 * mpfrxx.h: Remove file.
15399 * Makefile.am: Remove mpfrxx.h.
15400 * tests/cxx/Makefile.am: Add Gerardo's new test programs.
15402 2002-07-30 Gerardo Ballabio <gerardo.ballabio@unimib.it>
15404 * gmpxx.h: Use mpz_addmul etc for ternary a+b*c etc. Reorganise some
15405 macros for maintainability. Merge mpfrxx.h.
15406 * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: Various updates.
15407 * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc,
15408 tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: New files.
15410 2002-07-27 Kevin Ryde <kevin@swox.se>
15412 * longlong.h (count_trailing_zeros) [ia64 __GNUC__]: Don't use
15413 __builtin_ffs for now, doesn't seem to work.
15415 * configure.in: Establish CONFIG_SHELL to avoid a problem with
15416 AC_LIBTOOL_SYS_MAX_CMD_LEN on ia64-*-hpux*.
15418 * tune/speed.h (SPEED_ROUTINE_MPN_GCD_FINDA): Don't let calls to
15419 mpn_gcd_finda go dead.
15421 * mpn/generic/tdiv_qr.c: Inline mpn_rshift and MPN_COPY of 2 limbs.
15423 2002-07-24 Kevin Ryde <kevin@swox.se>
15425 * demos/primes.c: Use __GMP_PROTO and don't use signed, for the
15428 * demos/calc/calclex.l: Add <string.h> for strcmp.
15430 * mpn/ia64/invert_limb.asm: Use .rodata which works on ia64-*-hpux*
15431 and should be standard, rather than worrying about RODATA.
15433 * gmp.texi (Function Classes): Add cross references.
15434 (Integer Import and Export): Fix return value grouping.
15436 * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add // for
15437 ia64. Add notes on what the various styles are for.
15439 * mpn/ia64/default.m4 (ASM_START): Define to empty, not dnl, so as not
15440 to kill text on the same line.
15441 (EPILOGUE_cpu): Force a newline after "#", so as not to suppress macro
15442 expansion in the rest of the EPILOGUE line.
15444 2002-07-21 Kevin Ryde <kevin@swox.se>
15446 * tune/speed.h: Fix some missing _PROTOs.
15448 * Makefile.am (DISTCLEANFILES): Add configure.lineno.
15450 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Define
15451 HAVE_DOUBLE_IEEE_BIG_ENDIAN and HAVE_DOUBLE_IEEE_LITTLE_ENDIAN in
15453 * mpn/ia64/invert_limb.asm: Add big-endian data.
15455 * tests/mpz/t-jac.c (try_si_zi): Correction to "a" parameter type.
15457 2002-07-20 Kevin Ryde <kevin@swox.se>
15459 * mpz/bin_ui.c, mpz/jacobi.c, mpz/pprime_p.c, mpn/generic/divis.c:
15460 More care with long and mp_size_t parameters, for the benefit of K&R.
15462 * gmp-impl.h (invert_limb): Use parens around macro arguments.
15463 (mpn_invert_limb): Give prototype and define unconditionally.
15465 * gmp-impl.h (CACHED_ABOVE_THRESHOLD, CACHED_BELOW_THRESHOLD): New
15467 * mpn/generic/sb_divrem_mn.c: Use them to help gcc let preinv code go
15468 dead when not wanted.
15470 2002-07-17 Kevin Ryde <kevin@swox.se>
15472 * tests/refmpz.c (refmpz_hamdist): Ensure mp_size_t parameters are
15473 that type, for the benefit of hpux ia64 bundled cc ABI=64.
15475 * configure.in (ia64*-*-hpux*): Need +DD64 in cc_64_cppflags to get
15476 the right headers for ansi2knr.
15478 * acinclude.m4 (GMP_TRY_ASSEMBLE, GMP_ASM_UNDERSCORE): Use $CPPFLAGS
15479 with $CCAS and when linking, as done by the makefiles.
15480 (GMP_ASM_X86_MMX, GMP_ASM_X86_SSE2): Show $CPPFLAGS in diagnostics.
15482 * gmp-impl.h (ieee_double_extract): Setup using HAVE_DOUBLE_IEEE_*.
15483 (GMP_UINT32): New define, 32 bit type for ieee_double_extract.
15484 * configure.in: Add AC_CHECK_SIZEOF unsigned.
15485 * configure.in, acinclude.m4 (GMP_IMPL_H_IEEE_FLOATS): Remove.
15486 (GMP_C_DOUBLE_FORMAT): Instead warn about unknown float here.
15488 * configure.in, acinclude.m4 (GMP_C_SIZES): Remove.
15489 * acinclude.m4 (GMP_INCLUDE_GMP_H_BITS_PER_MP_LIMB): Remove this
15490 scheme, not required.
15491 * configure.in (unsigned long, mp_limb_t): Run AC_CHECK_SIZEOF for
15492 these unconditionally, check mp_limb_t against gmp-mparam.h values.
15493 * gmp-impl.h (BYTES_PER_MP_LIMB, BITS_PER_MP_LIMB): Define based on
15494 SIZEOF_MP_LIMB_T if not provided by gmp-mparam.h.
15495 (BITS_PER_ULONG): Define here now.
15497 * gmp.texi (ABI and ISA): Add HP-UX IA-64 choices.
15498 (Random State Initialization): Typo in m2exp described for
15499 gmp_randinit_lc_2exp_size.
15500 (Formatted Output Functions): Clarify gmp_obstack_printf a bit.
15501 (Formatted Input Strings): Typo in %n summary.
15503 * mpz/inp_raw.c (NTOH_LIMB_FETCH): Use simple generic default, since
15504 endianness detection is now cross-compile friendly.
15505 * mpz/out_raw.c (HTON_LIMB_STORE): Ditto.
15507 * mpz/fib_ui.c: Nailify.
15508 * mpz/random.c: Nailify.
15510 * mpfr/acinclude.m4 (MPFR_CONFIGS): Patch by Vincent for an apparent
15511 float rounding gremlin on powerpc.
15513 2002-07-15 Kevin Ryde <kevin@swox.se>
15515 * Makefile.am (PRINTF_OBJECTS): Avoid ending in a backslash, hpux ia64
15516 make doesn't like that.
15518 * mpn/ia64/*.asm: Add .sptk to unconditional branches, add ";" after
15519 .mib etc, for the benefit of hpux.
15521 * configure.in (ia64*-*-*): Use ABI=64 on non-HPUX systems, for
15524 * gmp-impl.h (ieee_double_extract): Test __sparc__, used by gcc 3.1.
15525 Reported by nix@esperi.demon.co.uk.
15526 * mpfr/mpfr-math.h (_MPFR_NAN_BYTES etc): Ditto.
15528 2002-07-13 Kevin Ryde <kevin@swox.se>
15530 * mpn/powerpc32/rshift.asm: Rewrite, transformed from lshift.asm.
15532 * tune/tuneup.c (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD):
15533 Always zero for native mpn_divexact_1, mpn_modexact_1_odd.
15535 * gmp-h.in (__GMP_EXTERN_INLINE): Don't use this during configure,
15536 ie. __GMP_WITHIN_CONFIGURE, to avoid needing dependent routines.
15537 * acinclude.m4 (GMP_H_EXTERN_INLINE): Consequent changes.
15539 * gmp-impl.h, mpn/asm-defs.m4 (mpn_addmul_2, mpn_addmul_3,
15540 mpn_addmul_4): Add prototypes and defines.
15542 * gmp.texi (Number Theoretic Functions): Clarify return value.
15543 Reported by Peter Keller.
15545 2002-07-10 Kevin Ryde <kevin@swox.se>
15547 * configure.in, acinclude.m4 (GMP_PROG_LEX): Remove this in favour of
15548 AM_PROG_LEX, now ok when lex is missing.
15550 * longlong.h (count_leading_zeros) [pentiummmx]: Don't use __clz_tab
15551 variant under LONGLONG_STANDALONE.
15552 (count_trailing_zeros) [ia64 __GNUC__]: Use __builtin_ffs.
15554 * gmp-impl.h (popc_limb): Add an ia64 asm version.
15555 (DItype): Use HAVE_LONG_LONG to choose long long, avoiding _LONGLONG
15556 which is in gcc but means something unrelated in MS Visual C 7.0.
15557 Reported by David Librik.
15559 * mpz/divexact.c: Add an ASSERT that den divides num.
15561 * mpn/asm-defs.m4 (LDEF): New macro.
15562 (INT32, INT64): Use it.
15563 * mpn/pa32/*.asm: Use it.
15564 * mpn/pa32/README: Update notes on labels.
15566 * tests/refmpn.c, tests/tests.h, tests/t-bswap.c (ref_bswap_limb):
15567 Renamed from refmpn_bswap_limb.
15568 * tests/t-bswap.c: Add tests_start/tests_end for randomization.
15570 * tests/refmpn.c, tests/tests.h (ref_popc_limb): New function.
15571 * tests/t-popc.c: New file.
15572 * tests/Makefile.am: Add it.
15574 * mpn/ia64/invert_limb.asm: Use RODATA since ".section .rodata" is not
15575 accepted by ia64-*-hpux*.
15577 * acinclude.m4 (GMP_ASM_BYTE): New macro.
15578 (GMP_ASM_ALIGN_LOG, GMP_ASM_W32): Use it.
15579 (GMP_ASM_LABEL_SUFFIX): Use test compiles, not $host.
15580 (GMP_ASM_GLOBL): Ditto, and add .global for ia64-*-hpux*.
15581 (GMP_ASM_GLOBL_ATTR): Use GMP_ASM_GLOBL result, not $host.
15582 (GMP_ASM_LSYM_PREFIX): Allow any "a-z" nm symbol code, add ".text" to
15583 test program, required by ia64-*-hpux*.
15584 (GMP_ASM_LABEL_SUFFIX): Make LABEL_SUFFIX just the value, not a "$1:",
15585 the former being how it's currently being used in fact.
15587 * configure.in, acinclude.m4 (GMP_PROG_CC_WORKS_LONGLONG): New macro.
15588 * configure.in (ia64-*-hpux*): Add 32 and 64 bit ABI modes.
15590 2002-07-06 Kevin Ryde <kevin@swox.se>
15592 * tests/cxx/t-allfuns.cc: New file.
15593 * tests/cxx/Makefile.am: Add it.
15595 * mpz/clrbit.c, mpz/setbit.c: Only MPN_NORMALIZE if high limb changes
15596 to zero. Use _mpz_realloc return value.
15598 * gmp.texi (Build Options, C++ Formatted Output, C++ Formatted Input):
15599 Cross reference to Headers and Libraries for libgmpxx stuff.
15600 (Low-level Functions): mpn_divexact_by3 result based on GMP_NUMB_BITS.
15601 mpn_set_str takes "unsigned char *", reported by Mark Sofroniou.
15602 (C++ Interface General): Describe linking with libgmpxx and libgmp.
15604 2002-07-01 Kevin Ryde <kevin@swox.se>
15606 * tune/tuneup.c, gmp-impl.h: Eliminate the array of thresholds in
15607 one(), tune just one at a time and let the callers hand dependencies.
15608 Eliminate the second_start_min hack, handle SQR_KARATSUBA_THRESHOLD
15609 oddities in tune_sqr() instead.
15611 * mpn/pa64/umul.asm, mpn/pa64/udiv.asm, mpn/asm-defs.m4, acconfig.h,
15612 longlong.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
15613 tests/devel/try.c: Introduce mpn_umul_ppmm_r and mpn_udiv_qrnnd_r
15614 rather than having variant parameter order for mpn_umul_ppmm and
15615 mpn_udiv_qrnnd on pa64.
15617 * gmp-h.in (mpz_export): Remove a spurious parameter name.
15618 * gmp-impl.h (mpn_rootrem): Use __MPN.
15620 2002-06-29 Kevin Ryde <kevin@swox.se>
15622 * longlong.h (udiv_qrnnd) [hppa32]: Remove mpn_udiv_qrnnd version, the
15623 general mechanism for that suffices.
15625 * mpf/inp_str.c: Fix returned count of chars read, reported by Paul
15626 Zimmermann. Also fix a memory leak for invalid input.
15627 * tests/mpf/t-inp_str.c: New file.
15628 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
15630 * tests/devel/try.c (mpn_mod_34lsub1): Only exists for
15631 GMP_NUMB_BITS%4==0.
15632 (SIZE2_FIRST): Respect option_firstsize2 for "fraction" case.
15634 * mpn/generic/diveby3.c: Further nailifications.
15635 * gmp-impl.h (MODLIMB_INVERSE_3): Allow for GMP_NUMB_BITS odd.
15636 (GMP_NUMB_CEIL_MAX_DIV3, GMP_NUMB_CEIL_2MAX_DIV3): New constants.
15637 * tests/t-constants.c: Check them.
15639 * gmp-h.in (__GMP_CRAY_Pragma): New macro.
15640 (__GMPN_COPY_REST): Use it.
15641 * gmp-impl.h (CRAY_Pragma): Use it.
15643 2002-06-25 Kevin Ryde <kevin@swox.se>
15645 * mpz/import.c, mpz/export.c: Cast data pointer through "char *" in
15646 alignment tests, for the benefit of Cray vector systems.
15648 * configure.in (x86-*-*): Remove -march=pentiumpro check, seems ok
15650 * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO, GMP_GCC_VERSION_GE): Remove
15651 macros, no longer needed
15653 * acinclude.m4 (GMP_ASM_RODATA): Remove temporary files.
15655 * configure.in (GMP_ASM_GLOBL_ATTR): Reposition to avoid duplication
15656 through AC_REQUIRE.
15658 2002-06-23 Kevin Ryde <kevin@swox.se>
15660 * tests/mpz/t-fib_ui.c (check_fib_table): Check table values, not just
15661 that they're non-zero.
15663 * acinclude.m4 (GMP_GCC_ARM_UMODSI): Match bad "gcc --version" output
15664 exactly, rather than parsing it with GMP_GCC_VERSION_GE.
15665 (GMP_ASM_UNDERSCORE): Use GLOBL_ATTR.
15667 * mpn/pa32/udiv.asm, mpn/pa32/hppa1_1/udiv.asm, mpn/pa64/udiv.asm:
15668 Renamed from udiv_qrnnd.asm, for consistency with other udiv's.
15669 * mpn/pa64/umul.asm: Renamed from umul_ppmm.asm likewise.
15670 * configure.in (hppa*-*-*): Update extra_functions.
15671 (NAILS_SUPPORT): Remove umul_ppmm, udiv_qrnnd, udiv_fp, udiv_nfp from
15672 nails-neutral list, no longer needed.
15674 * gmp-h.in (__DECC): Add notes on testing this for ANSI-ness.
15675 (__GMP_EXTERN_INLINE): Add static __inline for DEC C.
15676 (mpz_mod_ui): Move up to main section, it's still documented.
15678 2002-06-22 Kevin Ryde <kevin@swox.se>
15680 * mpz/jacobi.c, mpz/kronsz.c, mpz/kronuz.c, mpz/kronzs.c,
15681 mpz/kronzu.c: Allow for odd GMP_NUMB_BITS, tweak a few variable setups.
15682 * gmp-impl.h (JACOBI_STRIP_LOW_ZEROS): New macro.
15684 * mpn/generic/mod_34lsub1.c: Nailify.
15685 * tests/devel/try.c (CNST_34LSUB1): Nailify.
15686 * gmp-impl.h (ADDC_LIMB): New macro.
15688 * gmpxx.h (mpf_class::get_str): Make exponent mp_exp_t&, default
15689 base=10 and ndigits=0.
15690 (mpz_class::set_str, mpq_class::set_str, mpf_class::set_str): Add
15691 versions accepting "const char *".
15692 * mpfrxx.h (mpfr_class::get_str, mpfr_class::set_str): Ditto, and
15693 uncommenting set_str and operator=.
15694 * gmp.texi (C++ Interface Integers, C++ Interface Rationals)
15695 (C++ Interface Floats): Update.
15697 * gmp-impl.h (modlimb_invert): Merge the <=64bits and general versions.
15698 (const, signed): Move to near top of file, fixes --enable-alloca=debug
15701 * gen-fib.c: New file, derived from mainline in mpn/generic/fib2_ui.c.
15702 * dumbmp.c (mpz_init_set_ui): New function.
15703 * Makefile.am, mpn/Makefile.am: Generate fib_table.h, mpn/fib_table.c.
15704 * gmp-impl.h: Use fib_table.h, add __GMP_DECLSPEC to __gmp_fib_table
15705 (for the benefit of tests/mpz/t-fib_ui.c).
15706 * mpn/generic/fib2_ui.c: Remove __gmp_fib_table and generating code.
15708 * Makefile.am: Add mp.h to BUILT_SOURCES, distclean all BUILT_SOURCES,
15711 * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_BRANCHES):
15712 Don't let "unknown" get into the cache variables.
15713 (GMP_ASM_TEXT): See what assembles, don't hard-code hpux and aix.
15714 (GMP_PROG_EXEEXT_FOR_BUILD): Add ,ff8 for RISC OS, per autoconf cvs.
15715 (GMP_PROG_CPP_FOR_BUILD): Restructure per AC_PROG_CPP, print correct
15716 result if CPP_FOR_BUILD overrides the cache variable.
15717 (GMP_PROG_CC_FOR_BUILD_WORKS): New macro split from
15718 GMP_PROG_CC_FOR_BUILD. Allow for "conftest" default compiler output.
15719 * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Reinstate this,
15720 separating HOST_CC establishment from GMP_PROG_CC_FOR_BUILD.
15722 * configure.in (mpn_objs_in_libgmp): Move mpn/mp_bases.lo ...
15723 * Makefile.am (MPN_OBJECTS): ... to here, add $U, and arrange
15724 MPN_OBJECTS to be common between libgmp and libmp.
15726 2002-06-20 Torbjorn Granlund <tege@swox.com>
15728 * mpn/generic/mul_n.c (TOOM3_MUL_REC, TOOM3_SQR_REC): Don't check if
15729 basecase is to be invoked when *_TOOM3_THRESHOLD is more than 3 times
15730 the corresponding *_THRESHOLD.
15732 2002-06-20 Kevin Ryde <kevin@swox.se>
15734 * mpn/ia64/submul_1.c: Add missing TMP_DECL, TMP_MARK, TMP_FREE.
15735 Reported by Paul Zimmermann.
15737 * configure.in, acinclude.m4 (AC_DEFINE): Make templates read "Define
15738 to 1", for clarity as per autoconf.
15739 * acinclude.m4 (GMP_OPTION_ALLOCA): Group WANT_TMP templates.
15741 2002-06-20 Gerardo Ballabio <gerardo.ballabio@unimib.it>
15743 * gmpxx.h, mpfrxx.h: Remove mpz_classref, let mpq_class::get_num and
15744 mpq_class::get_den return mpz_class& as per the documentation.
15745 Reported by Roberto Bagnara.
15747 2002-06-18 Kevin Ryde <kevin@swox.se>
15749 * tests/rand/t-lc2exp.c: New file.
15750 * tests/rand/Makefile.am: Add it, and use tests/libtests.la.
15752 * randraw.c (lc): Pad seed==0 case with zero limbs, return same
15753 (m2exp+1)/2 bits as normal, right shift "c" result as normal.
15755 * configure.in: Don't bother with line numbers in some diagnostics.
15756 (*-*-mingw*): Use -mno-cygwin if it works, suggested by delta trinity.
15758 * tests/mpz/Makefile.am, tests/mpq/Makefile.am,
15759 tests/misc/Makefile.am, (CLEANFILES): Set to *.tmp for test program
15760 temporaries, to get t-scanf.tmp and reduce future maintenance.
15762 2002-06-16 Torbjorn Granlund <tege@swox.com>
15764 * mpn/generic/get_str.c (mpn_dc_get_str): Pass scratch memory area in
15765 new `tmp' parameter. Trim allocation needs by reusing input parameter.
15767 2002-06-15 Torbjorn Granlund <tege@swox.com>
15769 * mpn/sparc32/v9/udiv.asm: New file.
15771 2002-06-15 Kevin Ryde <kevin@swox.se>
15773 * acinclude.m4 (GMP_GCC_VERSION_GE): Correction to recognising mingw
15774 gcc 3.1 version number. Reported by Jim Fougeron.
15776 * configure.in (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): New define, to make
15777 AC_LIBTOOL_WIN32_DLL work with autoconf 2.53.
15779 * acinclude.m4 (GMP_C_SIZES): Establish BITS_PER_MP_LIMB as a value,
15780 not an expression, for the benefit of the gen-bases invocation.
15782 * config.guess (CC_FOR_BUILD): Try c99, same as configfsf.guess.
15784 2002-06-15 Paul Zimmermann <Paul.Zimmermann@loria.fr>
15786 * mpfr/set_q.c: Allow for 1 bit numerator or denominator.
15788 2002-06-14 Kevin Ryde <kevin@swox.se>
15790 * configure.in (AC_C_BIGENDIAN): Use new style action parameters.
15792 * randlc2x.c: Allow for a<0, allow for c>=2^m2exp.
15793 * randraw.c (lc): Allow for a==0.
15795 * mpn/sparc32/udiv.asm: Renamed from udiv_fp.asm. Don't know if float
15796 is the best way for v7, but it's what configure has chosen since gmp 3.
15797 * configure.in (*sparc*-*-* ABI=32): extra_functions="udiv" for all,
15798 in particular sparc32/v8/udiv.asm is faster (on ultrasparc2) than
15799 udiv_fp previously used for v9 chips.
15801 * gen-bases.c: New file, derived from mpn/mp_bases.c.
15802 * dumbmp.c: New file, mostly by Torbjorn, some by me.
15803 * configure.in, acinclude.m4 (GMP_PROG_CC_FOR_BUILD,
15804 GMP_PROG_CPP_FOR_BUILD, GMP_PROG_EXEEXT_FOR_BUILD,
15805 GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): New macros.
15806 (GMP_PROG_HOST_CC): Remove, superceded by GMP_PROG_CC_FOR_BUILD.
15807 * Makefile.am: Run gen-bases to create mp_bases.h and mpn/mp_bases.c.
15808 * gmp-impl.h: Use mp_bases.h.
15809 * mpn/mp_bases.c: Remove file.
15810 * mpn/Makefile.am: mp_bases.c now in nodist_libmpn_la_SOURCES.
15812 * tests/mpz/t-cmp_d.c (check_one_2exp): Use volatile to force to
15813 double, fixes gcc 3.1 with -O4. Reported by Michael Lee.
15814 * configure.in (AC_C_VOLATILE): New macro.
15816 * tests/misc/t-scanf.c: (fromstring_gmp_fscanf): Add missing va_end.
15817 Don't mix varargs and fixed args functions, not good on x86_64.
15818 Reported by Marcus Meissner.
15820 * Makefile.am (EXTRA_DIST): Remove mpfr/README, now in mpfr/Makefile.in
15822 * configure, config.in, INSTALL.autoconf: Update to autoconf 2.53.
15823 * */Makefile.in, install-sh, mdate-sh, missing, aclocal.m4, configure:
15824 Update to automake 1.6.1.
15825 * configfsf.guess, configfsf.sub: Update to 2002-05-29.
15827 2002-06-12 Kevin Ryde <kevin@swox.se>
15829 * acinclude.m4 (GMP_GCC_VERSION_GE): Recognise mingw gcc 3.1 version.
15830 (GMP_PROG_CC_WORKS): Allow for a_out.exe, as per autoconf.
15831 (GMP_GCC_NO_CPP_PRECOMP, GMP_ASM_UNDERSCORE): Ditto, plus a.exe.
15833 2002-06-09 Torbjorn Granlund <tege@swox.com>
15835 * randraw.c (lc): Remove broken ASSERT_ALWAYS.
15837 * mpn/x86: Update gmp-mparam.h files with current measures *_THRESHOLD
15839 * mpn/x86/p6/mmx/gmp-mparam.h: New file.
15841 2002-06-09 Kevin Ryde <kevin@swox.se>
15843 * mpn/x86/*/gmp-mparam.h (USE_PREINV_DIVREM_1): Add tuned settings.
15845 * acconfig.h (HAVE_NATIVE_mpn_preinv_divrem_1): New template.
15847 * tests/refmpn.c, tests/tests.h (refmpn_chars_per_limb,
15848 refmpn_big_base): New functions.
15849 * tests/mpn/t-mp_bases.c: Use them, and don't test big_base_inverted
15850 unless it's being used.
15852 * gmp.texi (Notes for Particular Systems): Using Microsoft C with DLLs.
15853 (Known Build Problems): Notes on MacOS and GCC.
15854 (Integer Logic and Bit Fiddling): Use ULONG_MAX for maximum ulong.
15855 (Low-level Functions): mpn_get_str accepts base==256.
15856 (Formatted Output Functions): Note output is not atomic.
15857 (Internals): Note mp_size_t for limb counts.
15859 * mp-h.in, gmp-h.in (mp_ptr, mp_srcptr, mp_size_t, mp_exp_t): Remove
15860 these types from mp.h, not needed.
15862 * mpfr/tests/tadd.c, mpfr/tests/tmul.c (check): Apply a hack to the
15863 parameter order to make sparc gcc 2.95.2 happy.
15865 * doc/configuration: Notes on bootstrapping.
15867 2002-06-08 Kevin Ryde <kevin@swox.se>
15869 * mpfr/tests/tsqrt.c, mpfr/tests/tsqrt_ui.c: Suppress tests if sqrt is
15870 not affected by mpfr_set_machine_rnd_mode.
15872 * mpfr/mul_2si.c: Workaround a mips gcc 2.95.3 bug under -O2 -mabi=n32.
15874 * configure.in (alphev56): Fix to use ev5 path.
15876 2002-06-06 Kevin Ryde <kevin@swox.se>
15878 * gmp-h.in: Use __gmp_const not const, in a number of places.
15880 * configure.in (sparc): Use ABI=32 instead of ABI=standard on v7 and
15881 v8, for consistency with v9 choices.
15882 (sparc64): Restrict GMP_ASM_SPARC_REGISTER to ABI=64.
15883 (x86): Move MMX $path munging to before printout.
15884 (CCAS): Move upward to support this.
15886 * gmp-impl.h (modlimb_invert): Merge macros for specific limb sizes,
15887 add a version for arbitrary limb size, use GMP_NUMB_BITS.
15888 (modlimb_invert, MODLIMB_INVERSE_3): Fix comments to say GMP_NUMB_BITS.
15890 * gmp-h.in (__GMP_LIKELY, __GMP_UNLIKELY): New macros.
15891 (mpz_getlimbn, mpz_perfect_square_p, mpz_popcount): Use them, make the
15892 fetch or mpn call likely, unconditionally calculate the alternative so
15893 as to avoid an "else" clause.
15894 * gmp-impl.h (LIKELY, UNLIKELY): Aliases.
15896 * configure.in, mpfr/tests/Makefile.am: Add $LIBM to $LIBS for
15897 MPFR_CONFIGS so it detects fesetround, and let it go through to
15899 * mpfr/rnd_mode.c: Use gmp-impl.h to get MPFR_HAVE_FESETROUND.
15901 * tests/mpz/t-sizeinbase.c: Disable fake bits test, such pointer
15902 setups are bogus and have been seen failing on hppa.
15904 * tests/misc.c, tests/refmpz.c, tests.tests.h, tests/mpz/t-cong.c:
15905 Rename mpz_flipbit to refmpz_combit and move from misc.c to refmpz.c.
15907 2002-06-05 Torbjorn Granlund <tege@swox.com>
15909 * tests/mpz/t-powm_ui.c Print proper routine name in error message.
15911 2002-06-03 Kevin Ryde <kevin@swox.se>
15913 * tune/time.c, tune/freq.c, tune/speed.h: Add powerpc mftb support.
15914 (FREQ_MEASURE_ONE): Move to speed.h, fix tv_sec factor.
15915 (freq_measure): Use for mftb measuring too.
15916 * tune/powerpc.asm, tune/powerpc64.asm: New files.
15917 * configure.in, tune/Makefile.am: Add them.
15919 * gmp-impl.h (popc_limb): Add versions for Cray and fallback for
15920 arbitrary limb size.
15922 * mpn/sparc32/sparc-defs.m4: New file.
15923 * configure.in (sparc*-*-*): Use it.
15924 * acinclude.m4 (GMP_ASM_SPARC_REGISTER): New macro.
15925 * configure.in (sparc64): Use it. Also, use -Wc,-m64 for linking.
15926 * mpn/sparc64/add_n.asm, mpn/sparc64/addmul_1.asm,
15927 mpn/sparc64/copyd.asm, mpn/sparc64/copyi.asm, mpn/sparc64/lshift.asm,
15928 mpn/sparc64/mul_1.asm, mpn/sparc64/rshift.asm,
15929 mpn/sparc64/sqr_diagonal.asm, mpn/sparc64/sub_n.asm,
15930 mpn/sparc64/submul_1.asm: Use REGISTER for .register.
15932 2002-06-01 Kevin Ryde <kevin@swox.se>
15934 * mpz/powm_ui.c: Fix for result range in certain circumstances.
15936 * mpn/x86/k6/diveby3.asm: Speedup to 10 c/l, same as divexact_1.
15937 Anomaly pointed out by Alexander Kruppa.
15939 2002-05-31 Torbjorn Granlund <tege@swox.com>
15941 * mpz/export.c: Cast pointer via `unsigned long' when checking
15942 alignment to avoid compiler warnings.
15944 2002-05-29 Kevin Ryde <kevin@swox.se>
15946 * gmp-impl.h (BSWAP_LIMB): Versions for m68k, powerpc, and arbitrary
15948 * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_m68k): New define.
15950 2002-05-27 Torbjorn Granlund <tege@swox.com>
15952 * mpn/generic/mul_basecase.c: Improve MAX_LEFT handling, returning
15953 when possible. Add code for mpn_addmul_5 and mpn_addmul_6.
15955 2002-05-25 Kevin Ryde <kevin@swox.se>
15957 * tune/tuneup.c: Misc nailifications, and disable preinv thresholds
15959 * tune/speed.h: Use GMP_NUMB_HIGHBIT with mpn_sb_divrem_mn and
15961 * mpz/powm.c (redc): Nailify q.
15963 * tests/mpn/t-scan.c: Reduce the amount of testing, to go faster.
15965 2002-05-23 Torbjorn Granlund <tege@swox.com>
15967 * Version 4.1 released.
15969 * mpn/alpha/ev6/nails/gmp-mparam.h: New file.
15971 * tests/devel/add_n.c (refmpn_add_n): Nailify.
15972 * tests/devel/sub_n.c (refmpn_sub_n): Nailify.
15973 * tests/devel/addmul_1.c (refmpn_addmul_1): Nailify.
15974 * tests/devel/submul_1.c (refmpn_submul_1): Nailify.
15976 * mpn/alpha/ev6/nails/add_n.asm: New file.
15977 * mpn/alpha/ev6/nails/sub_n.asm: New file.
15978 * mpn/alpha/ev6/nails/mul_1.asm: New file.
15979 * mpn/alpha/ev6/nails/submul_1.asm: New file.
15981 2002-05-22 Torbjorn Granlund <tege@swox.com>
15983 * mpn/alpha/ev6/nails/addmul_1.asm: New file.
15985 * mpz/inp_str.c (mpz_inp_str_nowhite): Nailify.
15987 * mpn/generic/mul_basecase.c: Update pointers before conditional
15988 MAX_LEFT break statements.
15990 2002-05-21 Torbjorn Granlund <tege@swox.com>
15992 * tests/mpz/t-gcd.c: Test mpz_gcd_ui.
15994 * mpz/lcm_ui.c: Nailify.
15996 * mpz/gcd_ui.c: Nailify. Make it work as documented, allowing
15997 NULL to be passed for result parameter. Fix gcd(0,0) case.
15999 * mpz/set_str.c: Nailify.
16001 * randlc2x.c (gmp_randinit_lc_2exp): Nailify.
16003 From Jakub Jelinek:
16004 * longlong.h (add_ssaaaa,sub_ddmmss) [64-bit sparc]:
16005 Make it actually work.
16007 2002-05-18 Torbjorn Granlund <tege@swox.com>
16009 * mpf/ui_div.c: Shut up compiler warning.
16011 * mpn/generic/mul_basecase.c: Use mpn_addmul_2, mpn_addmul_3, and
16012 mpn_addmul_4, as available.
16014 * mpn/alpha/ev6/nails/addmul_2.asm: Adjust NAILS_SUPPORT decls.
16015 * mpn/alpha/ev6/nails/addmul_3.asm: Likewise
16016 * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
16018 * configure.in (*-cray-unicos*): Back again to -hscalar0.
16019 (gmp_mpn_functions_optional): Add mul_3, mul_4, addmul_2, addmul_3,
16021 * acconfig.h: Add #undefs for new optional mpn functions.
16023 2002-05-18 Kevin Ryde <kevin@swox.se>
16025 * gmp.texi (Integer Import and Export): Mention Cray unfilled words.
16027 * mpz/set_d.c, mpq/set_d.c: Use LIMBS_PER_DOUBLE for the output of
16028 __gmp_extract_double. Reported by Henrik Johansson.
16030 2002-05-17 Torbjorn Granlund <tege@swox.com>
16032 * mpn/alpha/ev6/nails/addmul_2.asm: New file.
16033 * mpn/alpha/ev6/nails/addmul_3.asm: New file.
16034 * mpn/alpha/ev6/nails/addmul_4.asm: New file.
16036 * mpn/generic/dump.c: Rewrite and nailify.
16038 2002-05-16 Kevin Ryde <kevin@swox.se>
16040 * mpfr/Makefile.am (EXTRA_DIST): Add BUGS file.
16042 2002-05-15 Torbjorn Granlund <tege@swox.com>
16044 * configure.in (*-cray-unicos*): Remove -hscalar0, add -hnofastmd
16045 as workaround for compiler bug.
16046 (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
16048 2002-05-14 Torbjorn Granlund <tege@swox.com>
16050 * configure.in (*-cray-unicos*): Pass -hscalar0 to work around
16051 compiler bug for mpz/import.c.
16053 2002-05-11 Torbjorn Granlund <tege@swox.com>
16055 * mpz/import.c: Cast pointer via `unsigned long' when checking
16056 alignment to avoid compiler warnings.
16058 * mpn/generic/rootrem.c: Adjust allocation of qp temporary area.
16060 2002-05-09 Kevin Ryde <kevin@swox.se>
16062 * mpz/import.c: Corrections to size store, special case tests, and
16063 general case ACCUMULATE.
16064 * tests/mpz/t-import.c, tests/mpz/t-export.c: More test data.
16066 2002-05-09 Torbjorn Granlund <tege@swox.com>
16068 * mpn/generic/rootrem.c: Use temp space for root, copy value in place
16070 * mpz/root.c: Don't allocate extra limb for root value.
16071 * mpz/perfpow.c: Undo last change.
16073 2002-05-08 Torbjorn Granlund <tege@swox.com>
16075 * gmp-impl.h (powerpc BSWAP_LIMB_FETCH): Rename local variable to make
16076 it not clash with caller.
16078 * mpn/generic/rootrem.c: New file.
16079 * configure.in (gmp_mpn_functions): Add rootrem and pow_1.
16080 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add rootrem.c and
16082 * gmp-impl.h (mpn_rootrem): Add declaration.
16083 * mpz/perfpow.c: Amend allocations for mpn_rootrem requirements.
16084 * mpz/root.c: Rewrite to use mpn_rootrem.
16086 2002-05-08 Kevin Ryde <kevin@swox.se>
16088 * gmp-impl.h (MUL_KARATSUBA_THRESHOLD etc): Remove forced nail values.
16090 * mpf/fits_u.h, mpf/fits_s.h, tests/mpf/t-fits.c: Ignore fraction
16091 part, making the code match the documentation.
16093 * gmpxx.h (struct __gmp_binary_minus): Use mpz_ui_sub.
16095 2002-05-07 Kevin Ryde <kevin@swox.se>
16097 * mpn/powerpc32/README: New file.
16099 * mpz/root.c: Use unsigned long with mpz_sub_ui not mp_limb_t.
16101 * tune/README: Misc updates including sparc32/v9 smoothness, low res
16102 timebase, and mpn_add_n operand overlaps.
16103 * tune/many.pl: Add udiv.asm support.
16105 * gmp.texi (Build Options): A couple of --build better as --host.
16106 (Known Build Problems, Notes for Package Builds): Add DESTDIR problem.
16107 (Compatibility with older versions): Compatible with 4.x versions.
16108 (Converting Integers): Remove mpz_get_ui + mpz_tdiv_q_2exp decompose.
16109 (Integer Import and Export): New section.
16110 (Miscellaneous Integer Functions): Clarify mpz_sizeinbase returns 1
16112 (Language Bindings): Add GNU Pascal.
16113 (Low-level Functions): Add GMP_NUMB_MAX.
16115 * tests/mpz/t-import.c, tests/mpz/t-export.c, tests/mpz/t-get_d.c:
16117 * tests/mpz/Makefile.am: Add them.
16119 * mpz/import.c, mpz/export.c: New files.
16120 * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
16122 * gmp-h.in, gmp-impl.h (GMP_NUMB_MAX): Move to gmp.h.
16123 * gmp-impl.h (CNST_LIMB): Add cast to mp_limb_t to ensure unsigned.
16124 (CRAY_Pragma, MPN_REVERSE, MPN_BSWAP, MPN_BSWAP_REVERSE,
16125 ASSERT_ALWAYS_LIMB, ASSERT_ALWAYS_MPN): New macros.
16126 (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS_MPN.
16128 2002-05-07 Torbjorn Granlund <tege@swox.com>
16130 * mpz/aors_ui.h: Nailify.
16132 * tests/mpz/t-addsub.c: New file.
16133 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-addsub.
16135 * mpz/ui_sub.c: New file.
16136 * mpz/Makefile.am (libmpz_la_SOURCES): Add ui_sub.c.
16137 * Makefile.am (MPZ_OBJECTS): Ditto.
16138 * gmp-h.in (mpz_ui_sub): Add declaration.
16140 * gmp-impl.h (MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc
16143 * gmp-h.in (mpn_pow_1): Add declaration.
16145 * mpn/generic/pow_1.c: Handle exp <= 1. Reverse rp/tp parity scheme
16148 * Rename MP_LIMB_T_HIGHBIT => GMP_LIMB_HIGHBIT.
16150 2002-05-06 Torbjorn Granlund <tege@swox.com>
16152 * demos/pexpr.c (main): Don't call mpz_sizeinbase with negative base.
16154 * randraw.c (lc): Remove an unused variable.
16156 * mpn/generic/get_str.c: Clarify an algorithm description.
16158 * tests/mpf/t-trunc.c: Nailify.
16159 * tests/mpf/t-set_si.c: Disable for nails.
16161 * mpf/cmp_si.c: Nailify.
16162 * mpf/cmp_ui.c: Nailify.
16163 * mpf/div.c: Nailify.
16164 * mpf/div_2exp.c: Nailify.
16165 * mpf/div_ui.c: Nailify.
16166 * mpf/eq.c: Nailify.
16167 * mpf/get_d.c: Nailify.
16168 * mpf/get_d_2exp.c: Nailify.
16169 * mpf/get_si.c: Nailify.
16170 * mpf/get_str.c: Nailify.
16171 * mpf/get_ui.c: Nailify.
16172 * mpf/mul_2exp.c: Nailify.
16173 * mpf/random2.c: Nailify.
16174 * mpf/set_q.c: Nailify.
16175 * mpf/set_si.c: Nailify.
16176 * mpf/set_str.c: Nailify.
16177 * mpf/set_ui.c: Nailify.
16178 * mpf/sub.c: Nailify.
16179 * mpf/ui_div.c: Nailify.
16180 * mpf/ui_sub.c: Nailify.
16181 * mpf/urandomb.c: Nailify.
16183 * gmp-impl.h (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Nailify.
16185 * mpz/get_si.c: Misc variable name changes.
16187 * mpf/fits_u.h: Rewrite - nailify.
16188 * mpf/fits_s.h: Likewise.
16190 * mpz/mod.c: Disambiguate if-statament with extra {}.
16192 * mpf/int_p.c: Fix type of size variables.
16193 * mpf/get_ui: Likewise.
16194 * mpf/get_si: Likewise.
16195 * mpq/equal.c: Likewise.
16196 * mpq/get_d.c: Likewise.
16197 * mpz/cmp_d.c: Likewise.
16198 * mpz/cmpabs_d.c: Likewise.
16199 * mpz/divis_2exp.c: Likewise.
16200 * mpz/kronuz.c: Likewise.
16201 * mpz/kronzu.c: Likewise.
16202 * mpz/kronzs.c: Likewise.
16203 * mpz/kronsz.c: Likewise.
16204 * mpz/scan0.c: Likewise.
16205 * mpz/scan1.c: Likewise.
16206 * mpz/tstbit.c: Likewise.
16207 * mpz/cong_2exp.c: Likewise.
16208 * mpz/divis.c: Likewise.
16210 2002-05-04 Torbjorn Granlund <tege@swox.com>
16212 * mpn/generic/gcd.c: Additional nailify changes.
16214 2002-05-04 Kevin Ryde <kevin@swox.se>
16216 * gmp-h.in (__GNU_MP_VERSION): Set to 4.1.
16217 * Makefile.am (-version-info): Bump for new release.
16219 2002-04-30 Torbjorn Granlund <tege@swox.com>
16221 * mpn/generic/divrem_1.c: Additional nailify changes.
16222 * mpn/generic/mod_1.c: Likewise.
16224 * tests/mpq/t-get_d.c: Print floats with all 16 digits.
16226 * mpq/get_d.c: Nailify.
16228 * tests/mpq/t-set_f.c: Disable for nails.
16230 * mpz/get_d.c: Nailify.
16232 * gmp-impl.h (LIMBS_PER_DOUBLE, MP_BASE_AS_DOUBLE): Nailify.
16234 * gmp-h.in (__GMPZ_FITS_UTYPE_P): Cast maxval to before shifting it.
16236 * extract-dbl.c: Nailify.
16238 2002-04-29 Torbjorn Granlund <tege@swox.com>
16240 * mpq/md_2exp.c (mord_2exp): Nailify.
16242 * mpq/cmp_ui.c: Nailify.
16244 * mpq/cmp.c (mpq_cmp): Nailify.
16246 * mpn/generic/gcd.c: Nailify. GNUify code layout.
16248 * mpn/generic/gcdext.c: Nailify. Misc changes.
16250 * tests/mpz/t-sqrtrem.c: Let argv[1] mean # of repetitions.
16251 * tests/mpz/t-gcd.c: Likewise.
16253 * mpz/gcd.c: Nailify.
16255 * mpn/generic/random.c: Nailify.
16257 * gmp-impl.h (modlimb_invert): Nailify.
16259 2002-04-27 Torbjorn Granlund <tege@swox.com>
16261 * mpn/generic/gcdext.c (div2): Remove qh parameter.
16262 (mpn_gcdext): Streamline double-limb code.
16263 Move GCDEXT_THRESHOLD check to after initial division.
16265 2002-04-27 Kevin Ryde <kevin@swox.se>
16267 * gmp-impl.h (JACOBI_MOD_OR_MODEXACT_1_ODD): Allow for odd
16270 * tune/time.c (sgi_works_p): Allow for 64-bit counter, and fix
16271 SGI_CYCLECNTR_SIZE handling.
16273 * demos/expr/exprfr.c: Add nan and inf constants.
16274 * demos/expr/t-expr.c: Exercise them.
16276 2002-04-26 Torbjorn Granlund <tege@swox.com>
16278 * mpz/cmp_ui.c: Fix overflow conditions for nails.
16280 * gmp-h.in (mpz_get_ui): Fix typo from last change.
16282 * mpz/n_pow_ui.c: Adjust allocation for nails.
16283 (GMP_NUMB_HALFMAX): Renamed from MP_LIMB_T_HALFMAX.
16284 Fix umul_ppmm invocation for for nails.
16286 2002-04-24 Torbjorn Granlund <tege@swox.com>
16288 * mpn/generic/gcdext.c: Simplify by using mpn_tdiv_qr instead of
16291 2002-04-24 Kevin Ryde <kevin@swox.se>
16293 * configure.in (*-*-cygwin*): Give a sensible default command line
16294 limit, to avoid blowups reported by Jim Fougeron on windows 9x.
16295 (--enable-nails): Make the default 2, since mp_bases has data for that.
16297 * mpfr/mpfr-math.h (__mpfr_nan): Use a "double" for the bytes, to
16298 avoid a mis-conversion on alpha gcc 3.0.2.
16299 (_MPFR_INFP_BYTES, _MPFR_INFM_BYTES): Should be a zero mantissa.
16301 2002-04-23 Torbjorn Granlund <tege@swox.com>
16303 * mpz/dive_ui.c: Fix typo.
16305 * mpz/fits_s.h: Rewrite.
16307 * mpz/jacobi.c: Nailify.
16308 * mpz/kronuz.c: Additional nailify changes.
16309 * mpz/kronsz.c: Likewise.
16311 2002-04-23 Kevin Ryde <kevin@swox.se>
16313 * demos/expr/Makefile.am (LDADD): Add $(LIBM) for the benefit of mpfr.
16315 * mpz/divis_ui.c, mpz/cong_ui.c: Nailify.
16316 * mpn/generic/bdivmod.c, mpz/divexact.c, mpz/dive_ui.c: Nailify.
16317 * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem.c,
16318 mpn/generic/divrem_2.c: Nailify ASSERTs.
16319 * mpn/x86/k6/mmx/logops_n.asm, mpn/x86/k6/mmx/com_n.asm: Nailify.
16320 * mpz/inp_raw.c, mpz/out_raw.c: Nailify.
16321 * mpz/kronzu.c, mpz/kronuz.c, mpz/kronzs.c, mpz/kronsz.c: Nailify.
16322 * mpn/generic/divis.c, mpz/cong.c, mpz/cong_2exp.c: Nailify.
16323 * gmp-impl.h (NEG_MOD): Nailify.
16325 * gmp-impl.h, mpn/mp_bases.c: Add back GMP_NUMB_BITS==30 bases data.
16327 * mpfr/get_d.c: Patch from Paul to avoid problem with constant folding
16330 * mpn/lisp/gmpasm-mode.el: Remove mention of defunct LF macro.
16332 2002-04-22 Torbjorn Granlund <tege@swox.com>
16334 * demos/pexpr.c: Handle "binomial" operator.
16336 * mpz/cmp_ui.c: Move assignments of `up' out of conditionals.
16338 * mpn/generic/gcdext.c: Fix fencepost error in STAT code.
16340 * gmp-impl.h (mpn_com_n): Nailify.
16342 * tests/mpz/t-cdiv_ui.c: New file.
16343 * tests/mpz/Makefile.am (check_PROGRAMS): Add t-cdiv_ui.
16344 * mpz/cdiv_qr_ui.c: Nailify.
16345 * mpz/cdiv_q_ui.c: Nailify.
16346 * mpz/cdiv_r_ui.c: Nailify.
16347 * mpz/cdiv_ui.c: Nailify.
16349 * tests/misc/t-printf.c (CHECK_N): Add cast to allow `char' to be an
16351 * tests/misc/t-scanf.c: Likewise.
16353 * mpz/mul_i.h: Rework nails code to handle parameter overlap.
16355 * tests/mpz/t-set_f.c: Disable for nails.
16357 2002-04-21 Torbjorn Granlund <tege@swox.com>
16359 * mpz/set_si.c: Add cast to support LONG_LONG_LIMB.
16360 * mpz/iset_si.c: Likewise.
16362 * mpz/bin_ui.c: Nailify.
16363 * mpz/bin_uiui.c: Nailify.
16365 * mpz/cmpabs_ui.c: Nailify.
16367 * tests/mpz/t-aorsmul.c: Nailify.
16368 * mpz/aorsmul_i.c (mpz_addmul_ui, mpz_submul_ui): Nailify better.
16370 2002-04-20 Torbjorn Granlund <tege@swox.com>
16372 * tests/mpz/t-fdiv_ui.c: Check mpz_fdiv_ui.
16373 * tests/mpz/t-tdiv_ui.c: Check mpz_tdiv_ui.
16375 * mpz/tdiv_ui.c: Rewrite nails code.
16376 * mpz/fdiv_ui.c: Nailify.
16378 * tests/mpz/t-tdiv_ui.c: Check returned remainders.
16379 * tests/mpz/t-fdiv_ui.c: Merge in recent t-tdiv_ui changes.
16381 * mpz/tdiv_q_ui.c: Remove spurious TMP_* calls.
16383 * mpz/fdiv_qr_ui.c: Nailify.
16384 * mpz/fdiv_q_ui.c: Nailify.
16385 * mpz/fdiv_r_ui.c: Nailify.
16387 * mpz/get_si.c: Misc nailify changes to shut up compiler warnings.
16389 * mpz/ui_pow_ui.c: Fix typo in last change.
16391 2002-04-20 Kevin Ryde <kevin@swox.se>
16393 * tests/misc/t-printf.c, tests/misc/t-scanf.c: Check all %n types.
16395 * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/p6/mmx/divrem_1.asm
16396 (mpn_preinv_divrem_1): New entrypoint.
16397 (mpn_divrem_1): Avoid a branch when testing high<divisor.
16398 * mpn/asm-defs.m4: Add define_mpn(preinv_divrem_1).
16399 * configure.in: Allow divrem_1.asm to provide mpn_preinv_divrem_1.
16401 * gmp-impl.h [nails]: Add #undefs of MUL_KARATSUBA_THRESHOLD etc, to
16402 override CPU gmp-mparam.h. Remove JACOBI_BASE_METHOD override since
16403 it's nails-neutral.
16405 * tests/mpn/t-mp_bases.c: New file.
16406 * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
16407 * tests/t-constants.c: Move MP_BASES constants checks to it.
16409 * mpn/mp_bases.c: Fix big_base_inverted values for nails.
16410 * gmp-impl.h (MP_BASES_BIG_BASE_INVERTED_10,
16411 MP_BASES_NORMALIZATION_STEPS_10): Fix nails values.
16412 (MP_BASES_*): Remove GMP_NUMB_BITS == 30 data.
16414 * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm: Add
16415 NAILS_SUPPORT indicators.
16417 * configure.in: Grep for NAILS_SUPPORT in cpu-specific code, and look
16418 in "nails" subdirectories, print path used.
16419 * mpn/asm-defs.m4 (NAILS_SUPPORT): New macro.
16421 * mpfr/mpfr-test.h: Include config.h, for the benefit of test programs
16422 not using gmp-impl.h.
16424 2002-04-19 Torbjorn Granlund <tege@swox.com>
16426 * tests/mpz/t-scan.c: Nailify.
16428 * mpz/tdiv_qr_ui.c: Nailify.
16429 * mpz/tdiv_q_ui.c: Nailify.
16430 * mpz/tdiv_r_ui.c: Nailify.
16431 * mpz/tdiv_ui.c: Nailify.
16433 * mpz/cmp_ui.c: Nailify.
16435 * mpz/ui_pow_ui.c: Misc nailify changes to shut up compiler warnings.
16437 * mpz/scan0.c: Nailify.
16438 * mpz/scan1.c: Nailify.
16440 * tests/mpz/t-sizeinbase.c (mpz_fake_bits): Nailify.
16442 2002-04-18 Torbjorn Granlund <tege@swox.com>
16444 * mpz/aorsmul_i.c: Nailify.
16446 * mpz/cmp_si.c: Nailify (botched).
16448 * mpz/ui_pow_ui.c: Nailify.
16450 * gmp-h.in (__GMPZ_FITS_UTYPE_P): Nailify.
16452 * mpz/fits_s.h: Nailify.
16454 * tests/mpz/bit.c (check_tstbit): Nailify.
16456 From Paul Zimmermann:
16457 * mpn/generic/sqrtrem.c: Nailify.
16459 * mpz/n_pow_ui.c: Nailify.
16461 * mpz/cfdiv_r_2exp.c: Nailify.
16463 * randraw.c (lc): Undo: Let mpn_rshift put result in place to avoid
16466 2002-04-17 Torbjorn Granlund <tege@swox.com>
16468 * mpz/clrbit.c: Add two GMP_NUMB_MASK masks after addition.
16470 * mpn/generic/random2.c (LOGBITS_PER_BLOCK): Decrease to 4.
16472 * gmp-impl.h (nail DIV_DC_THRESHOLD): Decrease to 50 to allow fast
16475 * mpn/generic/random2.c: Nailify.
16477 * mpz/fac_ui.c: Nailify.
16479 * mpz/mul_i.h: #if ... #endif code block to shut up gcc warnings.
16481 * mpn/generic/sqrtrem.c: Adopt to GNU coding standards.
16482 (mpn_dc_sqrtrem): New name for mpn_dq_sqrtrem.
16483 Partial nailification.
16485 * configure.in: As a temporary hack, clear extra_functions for nails
16488 * gmp-h.in (mpz_get_ui): #if ... #endif else code block to shut up gcc
16491 2002-04-17 Kevin Ryde <kevin@swox.se>
16493 * texinfo.tex: Update to 2002-03-26.08 per texinfo 4.2.
16494 * gmp.texi: Must have @top in @ifnottex (or @contents doesn't come out
16497 * mpn/generic/scan0.c, mpn/generic/scan1.c: Nailify.
16499 * tests/mpn/t-scan.c: New file.
16500 * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
16502 * tests/refmpn.c, tests/tests.h (refmpn_tstbit): Use unsigned long for
16504 (refmpn_setbit, refmpn_clrbit, refmpn_scan0, refmpn_scan1): New
16507 * mpfr/cmp_ui.c (mpfr_cmp_si_2exp): Fix b==0 i!=0 case.
16509 2002-04-17 Gerardo Ballabio <gerardo.ballabio@unimib.it>
16511 * gmpxx.h, mpfrxx.h: Remove mpfr_class bool combinations, remove
16512 mpfr_class::get_str2, use mp_rnd_t for rounding modes, use
16513 8*sizeof(double) for mpfr_t's holding doubles.
16515 2002-04-17 Torbjorn Granlund <tege@swox.com>
16517 * mpz/powm.c: Nailify.
16518 * mpz/powm_ui.c: Nailify.
16520 2002-04-16 Torbjorn Granlund <tege@swox.com>
16522 * mpz/hamdist.c: Nailify.
16523 * tests/misc.c (urandom): Nailify.
16525 * mpz/get_si.c: Nailify.
16526 * gmp-h.in (mpz_get_ui): Nailify. Streamline (and probably upset
16529 * gmp-impl.h (mp_bases[10] values): Add versions for GMP_NUMB_BITS
16530 being 28, 60, and 63.
16531 * mpn/mp_bases.c: Add tables for GMP_NUMB_BITS being 28, 60, and 63.
16533 * mpz/iset_si.c: Nailify.
16534 * mpz/iset_ui.c: Nailify
16536 * tests/mpz/convert.c (main): Print test number in error message.
16538 * mpn/generic/get_str.c (mpn_sb_get_str): Shift up `frac' into nails
16539 field after bignum division.
16541 2002-04-16 Kevin Ryde <kevin@swox.se>
16543 * gmp-h.in, gmp-impl.h (GMP_NAIL_MASK): Move to gmp.h.
16545 * gmp.texi: Use @documentdescription and @copying, per texinfo 4.2.
16546 (Low-level Functions): Clarify mpn_gcd overlap requirements, rewrite
16547 mpn_set_str description, add nails section.
16548 (C++ Interface General): Remove bool from types that mix with classes.
16549 (Language Bindings): Add STklos, GNU Smalltalk, Regina.
16550 (Binary to Radix, Radix to Binary): Describe new code.
16551 (Assembler Cache Handling): More notes, mostly by Torbjorn.
16553 * macos/configure (%vars): Remove __GMP from substitutions, per change
16556 * mpn/generic/dive_1.c: Nailify.
16557 * mpn/generic/mode1o.c: Nailify, remove bogus ASSERT in commented-out
16558 alternate implementation.
16559 * gmp-impl.h (SUBC_LIMB): New macro.
16561 * tests/devel/try.c (validate_divexact_1): Correction to compare.
16562 (udiv_qrnnd): New testing.
16563 (SHIFT_LIMIT): Nailify.
16564 (-b): New option, remove spurious "H" from getopt string.
16566 * mpz/clrbit.c: Nailify.
16567 * tests/mpz/t-hamdist.c: Nailify.
16568 * gmp-impl.h (MPN_FIB2_SIZE): Nailify.
16569 (PP): Nailify conditionals.
16570 * tests/mpz/t-fib_ui.c (MPZ_FIB_SIZE_FLOAT): Nailify.
16572 * configure.in, acinclude.m4: Establish GMP_NAIL_BITS and
16573 GMP_LIMB_BITS for gmp-h.in configure tests.
16575 * mpfr/*, configure.in: Update to final mpfr 2.0.1.
16576 * mpfr/acinclude.m4 (MPFR_CONFIGS): Use $host, not uname stuff.
16577 * mpfr/tests/tout_str.c: Patch from Paul for denorm fprintf tests.
16579 2002-04-15 Torbjorn Granlund <tege@swox.com>
16581 * mpn/generic/divrem_1.c (EXTRACT): Remove.
16583 * tests/mpz/t-tdiv_ui.c (dump_abort): Accept argument for error string.
16585 * mpz/rrandomb.c: Nailify. Needs further work.
16587 * mpn/generic/mod_1.c: Nailify.
16589 * gmp-impl.h: Set various *_THRESHOLD values to be used for nails to
16590 avoid not yet qualified algorithms.
16591 (MPZ_CHECK_FORMAT): Check that nail part is zero.
16593 * tests/mpz/t-mul.c (main): Test squaring even for huge operands.
16594 (base_mul): Nailify.
16595 (dump_abort): Accept argument for error string. Print product
16598 * mpn/generic/set_str.c: Nailify.
16600 * gmp-h.in (__GMPN_ADD, __GMPN_SUB): Nailify.
16602 2002-04-14 Torbjorn Granlund <tege@swox.com>
16604 * randraw.c (lc): Return non-nonsense return value for seed=0 case.
16605 Check for m2exp being non-zero early; remove all other tests of m2exp.
16606 Remove redundant MPN_ZERO call.
16607 Let mpn_rshift put result in place to avoid extra MPN_COPY.
16608 Remove confusing comment before function `lc' describing BBS algorithm.
16609 Misc simplification and cleanups.
16610 Nailify. Needs further work.
16612 * mpz/set_si.c: Nailify.
16613 * mpz/set_ui.c: Nailify.
16614 * mpz/mul_i.h: Nailify.
16616 * tests/mpz/t-mul_i.c: Actually test _ui routines. Add some more test
16619 * mpn/generic/mul_n.c: Finish nailifying toom3 code.
16621 2002-04-13 Kevin Ryde <kevin@swox.se>
16623 * mpfr/*: Update to another new mpfr 2.0.1.
16624 * configure.in, Makefile.am, mpfr/Makefile.am, mpfr/tests/Makefile.am:
16625 Use MPFR_CONFIGS macro, establish separate MPFR_CFLAGS for mpfr build.
16627 * mpfr/tests/Makefile.am: Correction to convenience rule for libmpfr.a.
16629 2002-04-11 Kevin Ryde <kevin@swox.se>
16631 * mpfr/set_q.c: gmp-impl.h before mpfr.h to avoid _PROTO redefine.
16633 * mpfr/*, configure.in: Update to new mpfr 2.0.1.
16635 * tests/refmpn.c (refmpn_udiv_qrnnd, refmpn_divmod_1c_workaround):
16638 * tests/t-constants.c (MODLIMB_INVERSE_3): Nailify tests.
16639 (MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): Only
16640 check these under USE_PREINV_DIVREM_1.
16641 * tests/t-modlinv.c: Nailify tests.
16643 2002-04-11 Gerardo Ballabio <gerardo.ballabio@unimib.it>
16645 * gmpxx.h: Remove bool combinations, remove mpf_class::get_str2, only
16648 2002-04-11 Torbjorn Granlund <tege@swox.com>
16650 * mpn/generic/diveby3.c: Nailify.
16651 * gmp-impl.h (MODLIMB_INVERSE_3): Nailify.
16653 * mpn/generic/mul_n.c: Nailify Toom3 code.
16655 2002-04-10 Kevin Ryde <kevin@swox.se>
16657 * gmp-impl.h (MPN_KARA_MUL_N_MINSIZE, MPN_KARA_SQR_N_MINSIZE): Set to
16658 3, as needed by nails case.
16660 * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails]: Fix vl
16661 assert, add rp,n and up,n asserts.
16663 * mpfr/Makefile.am: Add new mpfr-math.h, install mpf2mpfr.h.
16665 2002-04-10 Torbjorn Granlund <tege@swox.com>
16667 * mpn/generic/divrem_1.c: Nailify. Update mp_size_t variables to use
16668 `n' suffix instead of `size' suffix.
16669 * mpn/generic/divrem_2.c: Likewise.
16670 * mpn/generic/sb_divrem_mn.c: Nailify.
16671 * mpn/generic/tdiv_qr.c: Nailify.
16672 (SHL): Remove silly macro.
16674 * mpn/generic/mul_n.c (mpn_kara_mul_n): Replace open-coded increment by
16675 mpn_incr_u call. Handle nails in ws[n] increment.
16676 * mpn/generic/mul_n.c (mpn_kara_sqr_n): Likewise.
16678 * gmp-h.in (GMP_NUMB_MASK): New #define.
16679 (__GMPN_AORS_1): Add version for nails.
16681 * gmp-impl.h (GMP_NUMB_MASK): Comment out, now in gmp.h.
16682 (mpn_incr_u): Don't assume `incr' is non-zero.
16683 (mpn_decr_u): Similarly.
16685 2002-04-09 Kevin Ryde <kevin@swox.se>
16687 * mpfr/*, configure.in: Update to mpfr 2.0.1.
16689 * tests/refmpn.c (refmpn_mul_1c, lshift_make): Corrections for nails.
16690 * tssts/refmpn.c, tests/tests.h (refmpn_cmp_allowzero): New function.
16692 * mpn/generic/mul_1.c [nails]: Fix vl assert, add {up,n} assert.
16694 * mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
16695 mpn/pa32/hppa1_1/pa7100/submul_1.asm: Rename "size" define, to avoid
16696 ELF .size directive. Reported by LaMont Jones.
16698 * tests/mpz/t-set_si.c: Add nails support.
16700 2002-04-05 Torbjorn Granlund <tege@swox.com>
16702 * gmp-impl.h: Replace nail mpn_incr_u, mpn_decr_u with faster versions.
16703 (mp_bases[10] values): Check GMP_NUMB_BITS instead of BITS_PER_MP_LIMB.
16704 Add GMP_NUMB_BITS == 30 version.
16705 (__gmp_doprnt, etc): Remove parameter names.
16707 * mpn/generic/mul_n.c: Nailify Karatsuba code.
16708 * mpn/generic/get_str.c: Nailify.
16709 * mpn/generic/sqr_basecase.c: Nailify.
16710 * mpn/generic/lshift.c: Nailify.
16711 * mpn/generic/rshift.c: Likewise.
16712 * mpn/generic/add_n.c: Nailify. Revamp non-nail code.
16713 * mpn/generic/sub_n.c: Likewise.
16714 * mpn/generic/mul_1.c: Likewise.
16715 * mpn/generic/addmul_1.c: Likewise.
16716 * mpn/generic/submul_1.c: Likewise.
16718 2002-04-02 Kevin Ryde <kevin@swox.se>
16720 * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE) [powerpc]:
16721 Corrections to constraints, and restrict to bigendian.
16723 2002-03-31 Kevin Ryde <kevin@swox.se>
16725 * tests/mpz/dive.c: Better diagnostics.
16727 * tests/devel/try.c (mpn_get_str, mpn_umul_ppmm_r): New tests.
16729 * tests/misc.c, tests/tests.h (byte_diff_lowest, byte_diff_highest):
16732 * tests/t-bswap.c: New file.
16733 * tests/Makefile.am (check_PROGRAMS): Add it.
16735 * tests/mpn/t-aors_1.c, tests/mpn/t-iord_u.c: Add nails support.
16737 * gmp-impl.h (MPN_IORD_U) [x86]: Eliminate unnecessary jiord and iord,
16738 rename "n" to incr per generic versions, restrict to nails==0.
16739 (mpn_incr_u, mpn_decr_u): Add nails support.
16740 (GMP_NAIL_LOWBIT, GMP_NUMB_MAX): New macros.
16742 * tests/trace.c, tests/tests.h (byte_trace, byte_tracen): New
16744 * tests/trace.c: Handle NULL operands.
16746 * tests/refmpn.c, tests/devel/try.c, tune/speed.c: Add preliminary
16749 * tests/refmpn.c, test/tests.h (byte_overlap_p, refmpn_equal_anynail,
16750 refmpn_umul_ppmm_r, refmpn_udiv_qrnnd_r, refmpn_get_str,
16751 refmpn_bswap_limb, refmpn_random, refmpn_random2, refmpn_bswap_limb):
16754 * gmp-impl.h, tests/refmpn.c (ASSERT_LIMB): Renamed from
16757 * mpn/x86/*/*.asm, mpn/powerpc32/*/*.asm, mpn/powerpc64/*/*.asm: Put
16758 speeds after the copyright notice, so as to keep that clear.
16760 2002-03-29 Kevin Ryde <kevin@swox.se>
16762 * configure.in (powerpc*-*-aix*): Correction to xlc -qarch selection,
16765 2002-03-28 Torbjorn Granlund <tege@swox.com>
16767 * mpn: Fix spacing in many files.
16769 * mpn/generic/aorsmul_1.c: Split into addmul_1.c and submul_1.c.
16770 * mpn/generic/aors_n.c: Split into add_n.c and sub_n.c.
16772 * mpn/pa64/add_n.asm: Trim another 0.125 cycle/limb. Fix a comment.
16773 * mpn/pa64/sub_n.asm: Likewise.
16775 * mpn/pa64/mul_1.asm: Change comclr, comb to proper forms cmpclr, cmpb.
16776 * mpn/pa64/addmul_1.asm: Likewise.
16777 * mpn/pa64/submul_1.asm: Likewise.
16779 2002-03-28 Kevin Ryde <kevin@swox.se>
16781 * gmp.texi (Converting Integers): Fix type of exp in mpz_get_d_2exp,
16782 reported by epl@unimelb.edu.au.
16783 (References): Update Burnikel and Ziegler URL, reported by Keith
16786 * gmp-h.in, mp-h.in, configure.in, acinclude.m4: Remove __GMP from
16787 AC_SUBSTs, since autoconf says leading "_" in makefile variables is
16790 * demos/expr/run-expr.c: Declare optarg, optind, opterr if necessary.
16791 * configure.in, demos/expr/expr-config-h.in: Configs for this.
16793 2002-03-27 Torbjorn Granlund <tege@swox.com>
16795 * mpn/Makefile.am (TARG_DIST): Remove pa64w and hppa, add pa32.
16797 * configure.in (path_20w): Remove pa64w.
16799 * mpn/pa64/udiv_qrnnd.asm: Tweak for PA8000 performance comparative to
16802 2002-03-26 Torbjorn Granlund <tege@swox.com>
16804 * mpn/pa32: New name for mpn/hppa.
16805 * configure.in: Corresponding changes.
16807 * mpn/pa64/umul_ppmm.asm: New file, generalized for both 2.0N and 2.0W.
16808 * mpn/pa64/umul_ppmm.S: Remove.
16810 * mpn/pa64/udiv_qrnnd.asm: Generalize for both 2.0N and 2.0W.
16811 * mpn/pa64w/udiv_qrnnd.asm: Remove.
16813 2002-03-26 Kevin Ryde <kevin@swox.se>
16815 * mpfr/tests/tdiv.c, mpfr/tests/tui_div.c: Don't depend on nan and inf
16816 handling in "double", for the benefit of alpha.
16818 * configure (hppa2.0w): Set path to "pa64w pa64".
16820 * acinclude.m4, configure.in (GMP_C_INLINE): New macro.
16821 * acinclude.m4 (GMP_H_EXTERN_INLINE): Use it, and fix "yes" handling.
16823 2002-03-25 Torbjorn Granlund <tege@swox.com>
16825 * mpn/pa64w/add_n.s: Remove.
16826 * mpn/pa64w/sub_n.s: Remove.
16827 * mpn/pa64w/lshift.s: Remove.
16828 * mpn/pa64w/rshift.s: Remove.
16829 * mpn/pa64w/mul_1.S: Remove.
16830 * mpn/pa64w/addmul_1.S: Remove.
16831 * mpn/pa64w/submul_1.S: Remove.
16832 * mpn/pa64w/sqr_diagonal.asm: Remove.
16834 * mpn/pa64/mul_1.asm: New file with twice faster code; generalized
16835 for both 2.0N and 2.0W.
16836 * mpn/pa64/submul_1.asm: Likewise.
16837 * mpn/pa64/mul_1.S: Remove.
16838 * mpn/pa64/submul_1.S: Remove.
16840 * mpn/pa64/sqr_diagonal.asm: Generalize for both 2.0N and 2.0W.
16842 * mpn/pa64/add_n.asm: New file, generalized for both 2.0N and 2.0W.
16843 * mpn/pa64/sub_n.asm: Likewise.
16844 * mpn/pa64/lshift.asm: Likewise.
16845 * mpn/pa64/rshift.asm: Likewise.
16846 * mpn/pa64/add_n.s: Remove.
16847 * mpn/pa64/sub_n.s: Remove.
16848 * mpn/pa64/lshift.s: Remove.
16849 * mpn/pa64/rshift.s: Remove.
16851 2002-03-24 Kevin Ryde <kevin@swox.se>
16853 * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE): New macros.
16854 * mpz/inp_raw.c, mpz/out_raw.c: Use them.
16855 * acconfig.h (HAVE_HOST_CPU): Add some powerpc types.
16857 * mpn/powerpc32/750/com_n.asm: New file.
16859 * mpfr/tests/tout_str.c: Disable random tests, since they fail on
16860 alphaev56-unknown-freebsd4.1 and do nothing by default.
16862 * mpfr/tests/tsqrt.c: Don't depend on nan, inf or -0 in "double", for
16863 the benefit of alpha.
16864 * mpfr/sqrt.c: Clear nan flag on -0.
16866 * demos/factorize.c: Use mpn_random() instead of random(), to avoid
16867 portability problems.
16869 * demos/isprime.c (print_usage_and_exit): Declare as "void" to avoid
16872 * demos/pexpr.c (setup_error_handler): Corrections to sigstack code.
16874 * demos/calc/calc.y: Add some `;'s to make bison 1.34 happy.
16876 2002-03-23 Torbjorn Granlund <tege@swox.com>
16878 * mpn/pa64/addmul_1.asm: New file with twice faster code; generalized
16879 for both 2.0N and 2.0W.
16881 2002-03-22 Kevin Ryde <kevin@swox.se>
16883 * tune/time.c: Add SGI hardware counter measuring method, change some
16884 abort()s into ASSERT_FAIL()s.
16886 * configure.in (AC_CHECK_HEADERS): Add fcntl.h and sys/syssgi.h.
16887 (AC_CHECK_FUNCS): Add syssgi.
16889 * configure.in, mpfr/Makefile.am, mpfr/tests/Makefile.am: Use
16890 -mieee-with-inexact or -ieee_with_inexact for mpfr on alpha, so
16893 * mpfr/isinteger.c: Fix a memory leak.
16895 2002-03-21 Torbjorn Granlund <tege@swox.com>
16897 * tune/speed.c (struct choice_t): Make `r' an mp_limb_t.
16899 2002-03-21 Kevin Ryde <kevin@swox.se>
16901 * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): Use an
16902 AH_VERBATIM and better explanation.
16903 * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Similarly for the HAVE_DOUBLE
16906 * gmp.texi (Number Theoretic Functions): Clarify sign of GCD returned
16909 * demos/pexpr.c, demos/pexpr-config-h.in, configure.in: Use an
16910 autoconf test for stack_t.
16912 * configure.in, gmp-h.in, mp-h.in, macos/configure, tests/mpz/reuse.c,
16913 tests/mpf/reuse.c: Use __GMP_LIBGMP_DLL to enable windows declspec,
16914 don't require _WIN32 (etc), remove __GMP_LIBGMP_SHARED and
16915 __GMP_LIBGMP_STATIC.
16917 * gmp-impl.h (mp_bases): Add __GMP_DECLSPEC, for the benefit of
16918 tests/t-constants.c.
16920 * tune/many.pl, tune/speed.h: Remove suffix hack for back.asm.
16922 2002-03-21 Paul Zimmermann <Paul.Zimmermann@loria.fr>
16924 * mpfr/sin_cos.c (mpfr_sin_cos): New file.
16925 * mpfr/mpfr.h, mpfr/mpfr.texi, mpfr/Makefile.am: Add it.
16926 * mpfr/tan.c: Fix sign in 2nd and 4th quadrants.
16928 * mpfr/log10.c: Fix hangs on certain inputs.
16930 2002-03-20 Torbjorn Granlund <tege@swox.com>
16932 * demos/pexpr.c (setup_error_handler): Declare `s', the first
16933 sigaltstack parameter, using `stack_t' just on AIX.
16935 2002-03-19 Torbjorn Granlund <tege@swox.com>
16937 * mpn/powerpc32/mul_1.asm: Use free caller-saves registers instead
16938 of the callee-saves r30 and r31.
16940 2002-03-19 Kevin Ryde <kevin@swox.se>
16942 * tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
16943 previously got the wrong result from "bogomips".
16945 * mpn/powerpc32/add_n.asm, mpn/powerpc32/sub_n.asm: Rewrite, faster on
16946 750, and smaller too.
16947 * mpn/powerpc32/*.asm: Use L(), add some measured speeds.
16949 * longlong.h (count_trailing_zeros) [vax]: Add a version using ffs,
16952 2002-03-17 Kevin Ryde <kevin@swox.se>
16954 * tune/speed.c, tune/speed.h, tune/common.c, many.pl: Use optional
16955 ".r" to specify operand overlaps for mpn_add_n, mpn_sub_n and logops.
16956 Remove mpn_add_n_inplace and mpn_add_n_self.
16957 * tune/many.pl: Fix MULFUNC_PROLOGUE parsing.
16959 * gmp.texi (Known Build Problems): Note `make' problem with long
16960 libgmp.la dependencies list.
16962 * printf/doprnt.c, scanf/doscan.c (%zn): Remove test of non-existent
16963 HAVE_SIZE_T, just use size_t unconditionally.
16964 * printf/doprnt.c (%zd etc): Fix 'z' type parsing.
16965 * tests/misc/t-printf.c, tests/misc/t-scanf.c: More tests.
16967 * configure.in: Use AC_COPYRIGHT.
16968 Add m4_pattern_allow(GMP_MPARAM_H_SUGGEST).
16970 * tune/Makefile.am (libdummy.la): Remove this, sqr_basecase.c already
16971 gets an ansi2knr rule from nodist_tuneup_SOURCES.
16973 * longlong.h (count_leading_zeros) [pentiumpro gcc<3]: Test
16974 HAVE_HOST_CPU_i686 too.
16976 * mpz/out_raw.c (HTON_LIMB_STORE): Fix a typo in big endian #if.
16978 2002-03-14 Kevin Ryde <kevin@swox.se>
16980 * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm,
16981 mpn/x86/k6/mmx/com_n.asm: Add nails support.
16983 * texinfo.tex: Update to 2002-03-01.06 (per texinfo 4.1).
16984 * gmp.texi (@ma): Remove, @math does this now.
16986 * mpfr/tests/reuse.c: Clear op1 and op2 flags only in their respective
16989 * configure.in (--enable-cxx): Correction to the default stated in the
16991 (power*-*-aix*, not powerpc): Use aix.m4, don't run
16992 GMP_ASM_POWERPC_R_REGISTERS or use powerpc-defs.m4.
16994 2002-03-13 Torbjorn Granlund <tege@swox.com>
16996 * mpn/sparc32/gmp-mparam.h: New file.
16998 2002-03-13 Kevin Ryde <kevin@swox.se>
17000 * demos/expr/exprfr.c: More mpfr functions, corrections to agm, cos,
17001 sin, rename log2 constant to loge2 to make room for log2 function.
17002 * demos/expr/t-expr.c: More tests.
17004 * mpz/inp_raw.c (NTOH_LIMB_FETCH) [generic 16bit]: Remove spurious "+".
17006 * mpfr/acos.c: Avoid a memory leak for certain operands.
17008 * acinclude.m4, configure.in (GMP_C_DOUBLE_FORMAT): New macro.
17010 * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
17011 GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
17012 Change ac_objext to OBJEXT, which is the documented variable.
17014 * config.guess (powerpc*-*-*): Use #ifdef on constants POWER_630 etc
17015 in the AIX test, since old versions don't have them all.
17017 2002-03-11 Kevin Ryde <kevin@swox.se>
17019 * configure.in (LIBC211): New AC_DEFINE, for mpfr.
17021 * configure.in (mips*-*-*): Support ABI=o32 on irix 6, allow gcc 2.7.2
17022 to fall back on it, but detect it doesn't work with gcc 2.95. Use
17023 single mips-defs.m4 for both mips32 and mips64.
17024 * acinclude.m4 (GMP_GCC_MIPS_O32): New macro.
17025 * mpn/mips32/mips-defs.m4: Renamed from mips.m4.
17026 * mpn/mips64/mips.m4: Remove (was a copy of mips32/mips.m4).
17028 * mpn/powerpc32/750: New directory.
17029 * configure.in (powerpc740, powerpc750, powerpc7400): Use it.
17030 * mpn/powerpc32/750/gmp-mparam.h: New file.
17032 * config.sub, gmp.texi (ultrasparc1): Remove this, just use plain
17035 2002-03-10 Kevin Ryde <kevin@swox.se>
17037 * mpfr: Update to 20020301, except internal_ceil_exp2.c,
17038 internal_ceil_log2.c, internal_floor_log2.c renamed to i_ceil_exp2.c,
17039 i_ceil_log2.c, i_floor_log2.c to be unique in DOS 8.3. And sqrtrem.c
17040 removed since no longer required.
17041 * mpfr/mpfr.texi: Fix some formatting.
17042 * mpfr/tests/reuse.c: Patch by Paul to fix test4 variable handling.
17043 * mpfr/sinh.c: Patch by Paul to fix err calculation when t==0.
17044 * mpfr/tests/tget_d.c: Disable until portability of rnd_mode.c can be
17047 * configure.in (powerpc*-*-*): Separate gcc and xlc cpu flags setups
17050 * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]: New
17053 2002-03-07 Kevin Ryde <kevin@swox.se>
17055 * gmp.texi (Build Options): Note all the ultrasparcs accepted.
17056 (Language Bindings): Add Math::BigInt::GMP.
17058 * config.sub (ultrasparc2i): New cpu type.
17059 * config.guess (sparc-*-*, sparc64-*-*): Add some exact CPU detection.
17061 2002-03-05 Kevin Ryde <kevin@swox.se>
17063 * longlong.h (count_leading_zeros, count_trailing_zeros) [alphaev67,
17064 alphaev68]: Use ctlz and cttz insns (as per gcc longlong.h).
17065 (count_leading_zeros) [sparclite]: Fix parameter order (as per gcc
17067 * acconfig.h (HAVE_HOST_CPU_alphaev68): New define.
17069 * config.guess [i?86-*-*]: Suppress error messages if compiler not
17070 found or test program won't run.
17071 [rs6000-*-*, powerpc-*-*]: Force code alignment for mfpvr test.
17073 2002-03-04 Torbjorn Granlund <tege@swox.com>
17075 * mpn/generic/pow_1.c: New file.
17077 2002-03-03 Kevin Ryde <kevin@swox.se>
17079 * gmp.texi (Build Options): Note compiler must be able to fully link,
17080 add alphapca57 and alphaev68, give a clearer example of MPN_PATH
17081 (Debugging): Add notes on valgrind.
17082 (C++ Formatted Output): Clarify mpf showbase handling, in particular
17083 note "00.4" in octal.
17085 * printf/doprntf.c: Do a showbase on octal float fractions, for
17086 instance "00.4" where previously it gave "0.4".
17087 * tests/cxx/t-ostream.cc: Update.
17089 * gmp-h.in, mp-h.in (__GMP_DECLSPEC, __GMP_DECLSPEC_XX): Test
17090 __WIN32__ for Borland C, reported by "delta trinity".
17092 * gmp-h.in, mp-h.in: Use <cstddef> for size_t under C++, suggested by
17093 Hans Aberg some time ago.
17094 * gmp-h.in (<iosfwd>): Move to top of file for clarity.
17096 * Makefile.am (libgmpxx_la_SOURCES): Use dummy.cc to force C++.
17097 (CXX_OBJECTS): Add osfuns$U.lo.
17098 * dummy.cc: New file.
17099 * cxx/Makefile.am (INCLUDES): Use __GMP_WITHIN_GMPXX.
17100 (libcxx_la_SOURCES): Add osfuns.cc.
17101 * gmp-h.in (__GMP_DECLSPEC_XX): New define, use it on libgmpxx funs.
17102 * gmp-impl.h: Add __GMP_DECLSPEC to libgmp functions used by libgmpxx.
17104 * longlong.h (COUNT_TRAILING_ZEROS_TIME): Remove, no longer used.
17106 * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): Correction to
17107 __totbits for nails.
17109 * gmp-impl.h (JACOBI_LS0): Test size before limb, to pacify valgrind.
17110 (JACOBI_0LS): Ditto, and fix parens around arguments.
17112 * mpn/x86/x86-defs.m4 (call_mcount): Add a counter to make data labels
17113 unique, since simplified L() scheme no longer gives that effect.
17114 (notl_or_xorl_GMP_NUMB_MASK): New macro.
17115 Add m4_assert_numargs in a few places.
17117 * configure.in (*sparc*): Fix cycle counter setups for ABI=64.
17119 2002-02-28 Torbjorn Granlund <tege@swox.com>
17121 * mpn/vax/gmp-mparam.h: New file.
17123 2002-02-28 Kevin Ryde <kevin@swox.se>
17125 * gmp-h.in (gmp_errno, gmp_version): Move into extern "C" block,
17126 reported by librik@panix.com.
17128 * gmp-h.in, mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT):
17129 Use __declspec(dllexport) and __declspec(dllimport) on Borland.
17130 * gmp-h.in (_GMP_H_HAVE_FILE): Test __STDIO_H for Borland.
17131 Reported by "delta trinity".
17133 * gmp-impl.h (va_copy): Fall back on memcpy, not "=".
17135 * mpn/generic/pre_mod_1.c: Add a comment about obsolescence.
17137 * tune/time.c (MICROSECONDS_P): Don't trust time differences of 1
17140 * tests/cxx/t-ostream.cc: Use "const char *" not just "char *" for
17141 test data strings, avoids warnings on Sun CC.
17143 2002-02-27 Torbjorn Granlund <tege@swox.com>
17145 * configure.in: For sparc under solaris2.[7-9], pass -fsimple=1 to
17146 disable some crazy -fast optimizations.
17148 2002-02-25 Torbjorn Granlund <tege@swox.com>
17150 * configure.in: For sparc under solaris2.[7-9], pass -fns=no to enable
17151 denorm handling under -fast.
17153 2002-02-25 Kevin Ryde <kevin@swox.se>
17155 * configure.in (alpha*-*-*): Rearrange -mcpu selection for gcc,
17156 provide an ev67 -> ev6 fallback. Fix -arch,-tune selection for DEC C.
17157 Allow ~ for space in optional options lists.
17159 * tune/tuneup.c (tune_preinv_divrem_1): Compare against an assembler
17160 mpn_divrem_1 if it exists, not the generic C mpn_divrem_1_div.
17161 (tune_preinv_mod_1): Ditto with mpn_mod_1.
17163 * tune/time.c (DIFF_SECS_ROUTINE): Eliminate the unused "type"
17164 parameter, try to make the code a bit clearer.
17166 * tune/freq.c: Reduce the period measured for cycles versus
17167 gettimeofday, add cycles versus microsecond getrusage.
17169 * mpz/array_init.c: "i" should be mp_size_t, noticed by E. Khong.
17171 2002-02-24 Torbjorn Granlund <tege@swox.com>
17173 * configure.in: For sparc under solaris2.[7-9], pass -fast instead of
17174 other optimization options.
17176 2002-02-23 Kevin Ryde <kevin@swox.se>
17178 * mpn/asm-defs.m4 (GMP_NUMB_MASK): New macro.
17179 (PROLOGUE, EPILOGUE): Relax quoting for the benefit of tune/many.pl
17180 when GSYM_PREFIX non-empty.
17182 * tune/time.c, tune/speed.h (speed_time_init): Include clock tick
17183 period in speed_time_string.
17184 * tune/time.c, configure.in (clock_gettime): New measuring method.
17186 * tune/many.pl: Add -DHAVE_NATIVE_mpn_foo to C objects, to avoid
17187 conflicts with a macro version in gmp-impl.h, eg. mpn_com_n.
17189 2002-02-22 Torbjorn Granlund <tege@swox.com>
17191 * demos/pexpr.c: Increase RLIMIT_STACK to 4Mibyte.
17193 2002-02-22 Kevin Ryde <kevin@swox.se>
17195 * tune/tuneup.c: Don't confuse gcc with mipspro cc in diagnostic.
17197 2002-02-20 Torbjorn Granlund <tege@swox.com>
17199 * configure.in (mips*-*-irix[6789]*]): Set `extra_functions_n32', not
17202 * printf/doprnt.c: Conditionally include inttypes.h.
17203 * printf/repl-vsnprintf.c: Likewise.
17204 * scanf/doscan.c: Likewise.
17206 2002-02-20 Kevin Ryde <kevin@swox.se>
17208 * mpn/x86/k7/mmx/com_n.asm: New file.
17210 * mpz/n_pow_ui.c (SWAP_RP_TP): Use ASSERT_CODE on ralloc and talloc,
17211 to ensure they needn't live past the initial allocs in a normal build.
17213 * mpn/generic/mod_34lsub1.c: Note this is for internal use.
17215 2002-02-19 Torbjorn Granlund <tege@swox.com>
17217 * Clean up *_THRESHOLD names. Many files affected.
17219 * mpn/mips32: Asm-ify 32-bit mips code.
17220 Move files from `mips2' to `mips32' directory.
17221 * mpn/mips64: Move files from `mips3' to `mips64' directory.
17222 * configure.in: Change `mips2' => `mips32' and `mips3' => `mips64'.
17224 2002-02-19 Kevin Ryde <kevin@swox.se>
17226 * acinclude.m4, configure.in (GMP_PROG_LEX): New macro.
17228 * tune/tuneup.c (one): Start next threshold at a max of previous ones,
17229 in order to get a good starting point for TOOM3_SQR_THRESHOLD if
17230 KARATSUBA_SQR_THRESHOLD is 0 (ie. using mpn_mul_basecase only).
17232 * configure.in, tune/tuneup.c (GMP_MPARAM_H_SUGGEST): New AC_DEFINE
17233 replacing GMP_MPARAM_H_FILENAME. Suggest a new file in a cpu specific
17234 subdirectory rather than mpn/generic.
17236 * acinclude.m4 (POWERPC64_PATTERN): New macro.
17237 * configure.in (powerpc*-*-*): Use it.
17238 (powerpc*-*-*): Use umul in 32L and aix64.
17239 (mips*-*-*): Use umul, 32 and 64 bit versions.
17241 2002-02-18 Torbjorn Granlund <tege@swox.com>
17243 * longlong.h: Add basic x86-64 support.
17245 2002-02-17 Torbjorn Granlund <tege@swox.com>
17247 * demos/pexpr.c: Support `-X' for upper case hex, make `-x' output
17250 * mpn/mips2/umul.s: Make it actually work.
17251 * mpn/mips3/umul.asm: New file.
17253 * mpn/mips2/gmp-mparam.h: New file.
17255 2002-02-16 Torbjorn Granlund <tege@swox.com>
17257 * mpn/generic/get_str.c (mpn_sb_get_str): Round frac upwards after
17260 2002-02-16 Kevin Ryde <kevin@swox.se>
17262 * config.guess (alpha-*-*): Do alpha exact cpu probes on any system,
17263 and only if configfsf.guess gives a plain "alpha".
17265 * acinclude.m4 (GMP_PROG_CC_WORKS): Detect a gcc 3.0.3 powerpc64
17266 linker invocation problem.
17268 2002-02-15 Torbjorn Granlund <tege@swox.com>
17270 * mpn/generic/get_str.c (mpn_sb_get_str): For base 10, develop initial
17271 digits using umul_ppmm, then switch to plain multiplication.
17273 * config.guess: Rewrite Alpha subtype detection code for *bsd systems.
17275 2002-02-15 Kevin Ryde <kevin@swox.se>
17277 * gmp.texi (Build Options): Note powerpc exact cpu types.
17278 (Debugging): Advertise DEBUG in memory.c.
17280 * config.sub, config.guess: Add some powerpc exact cpus.
17281 * configure.in: Add configs for them.
17283 * memory.c [__NeXT__]: Remove unused #define of "static".
17284 (__gmp_default_allocate, __gmp_default_reallocate): Print size if
17285 allocation fails, don't use perror.
17287 * gmp-h.in: g++ 3 demands __GMP_NOTHROW is before other attributes.
17289 2002-02-14 Torbjorn Granlund <tege@swox.com>
17291 * mpn/alpha/mul_1.asm: Fix typo preventing build on T3E systems.
17293 2002-02-14 Kevin Ryde <kevin@swox.se>
17295 * tune/tuneup.c (tune_set_str): Increase max_size, for the benefit of
17298 * macos/README: Bug reports to bug-gmp@gnu.org, clarify MacOS X a bit.
17300 * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Add missing TMP_FREE.
17302 * tune/speed.c, tune/tuneup.c: Allow for speed_cycletime of 0.0 in
17303 some diagnostic printouts.
17304 * tune/time.c (speed_cycletime): Note can be 0.0.
17306 2002-02-12 Torbjorn Granlund <tege@swox.com>
17308 * mpn/alpha/mul_1.asm: Add mpn_mul_1c entry.
17310 * mpn/pa64w/sqr_diagonal.asm: Use L() for labels.
17312 2002-02-11 Torbjorn Granlund <tege@swox.com>
17314 * mpn/generic/get_str.c (mpn_sb_get_str): Change declaration of rp to
17315 accommodate tuneup compiles.
17317 2002-02-11 Kevin Ryde <kevin@swox.se>
17319 * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (PROLOGUE_cpu): Add
17321 * mpn/alpha/default.m4 (PROLOGUE_cpu): use ALIGN instead of ".align".
17323 * gmp.texi (Debugging): Notes on Checker.
17324 (Other Multiplication): Move note on float FFTs to here.
17325 (Assembler Floating Point): New text and revisions by Torbjorn,
17326 picture formatting by me.
17327 Simplify tex pictures elsewhere a bit, share heights, eliminate some
17328 gaps at line joins.
17330 2002-02-11 Torbjorn Granlund <tege@swox.com>
17332 * mpn/generic/get_str.c (mpn_sb_get_str): Rewrite to generate fraction
17333 limbs and use multiplication for digit development. Trim allocation of
17334 buf. Get rid of code for !USE_MULTILIMB.
17336 2002-02-10 Torbjorn Granlund <tege@swox.com>
17338 * mpn/generic/set_str.c (mpn_set_str): Undo this:
17339 Change invocations of mpn_add_1 to instead use mpn_incr_u.
17341 * tests/mpz/convert.c: Free str only after it is used in error message.
17343 * mpn/generic/get_str.c (mpn_sb_get_str): Combine tail code for base 10
17346 * mpn/mp_bases.c: Add entries for base 256. Remove __ prefix from
17348 * gmp-impl.h (__mp_bases): Remove superflous `mp_' part of name, making
17349 it __gmpn_bases instead of __gmpn_mp_bases.
17350 (mp_bases): New #define.
17351 * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Allow bases up to 256.
17352 (SPEED_ROUTINE_MPN_GET_STR): Likewise.
17354 2002-02-09 Torbjorn Granlund <tege@swox.com>
17356 * mpn/generic/set_str.c (mpn_set_str): Use mpn_mul_1c if available.
17357 Change invocations of mpn_add_1 to instead use mpn_incr_u.
17359 2002-02-09 Kevin Ryde <kevin@swox.se>
17361 * mpz/array_init.c, mpz/cfdiv_q_2exp.c, mpz/cfdiv_r_2exp.c,
17362 mpz/cong_2exp.c, mpz/divis_2exp.c, mpz/hamdist.c, mpz/init2.c,
17363 mpz/mul_2exp.c, mpz/realloc2.c, mpz/scan0.c, mpz/scan1.c,
17364 mpz/setbit.c, mpz/tdiv_q_2exp.c, mpz/tdiv_r_2exp.c, mpz/tstbit.c,
17365 mpz/urandomb.c: Use GMP_NUMB_BITS.
17367 * mpz/iset_str.c [__CHECKER__]: Store a dummy value to the low limb to
17368 stop it appearing uninitialized.
17370 * gmp-h.in (__GMP_NOTHROW): New macro.
17371 (mp_set_memory_functions, mpz_cmp, mpz_cmp_si, mpz_cmp_ui, mpz_cmpabs,
17372 mpz_cmpabs_ui, mpz_congruent_2exp_p, mpz_divisible_2exp_p,
17373 mpz_fits_sint_p, mpz_fits_slong_p, mpz_fits_sshort_p, mpz_fits_uint_p,
17374 mpz_fits_ulong_p, mpz_fits_ushort_p, mpz_get_si, mpz_get_ui,
17375 mpz_getlimbn, mpz_hamdist, mpz_popcount, mpz_scan0, mpz_scan1,
17376 mpz_size, mpz_sizeinbase, mpz_swap, mpz_tstbit, mpq_equal, mpq_swap,
17377 mpf_cmp, mpf_cmp_si, mpf_cmp_ui, mpf_fits_sint_p, mpf_fits_slong_p,
17378 mpf_fits_sshort_p, mpf_fits_uint_p, mpf_fits_ulong_p,
17379 mpf_fits_ushort_p, mpf_get_default_prec, mpf_get_prec, mpf_get_si,
17380 mpf_get_ui, mpf_integer_p, mpf_set_default_prec, mpf_set_prec_raw,
17381 mpf_size, mpf_swap, mpn_add_1, mpn_cmp, mpn_hamdist, mpn_popcount,
17382 mpn_sub_1): Use it.
17384 * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): New macros from
17385 mpn_sizeinbase, and use GMP_NUMB_BITS.
17386 * mpz/get_str.c, mpz/sizeinbase.c, mpbsd/mout.c, tune/speed.h: Use
17388 * mpbsd/mtox.c: Use MPN_SIZEINBASE_16.
17390 * configure.in, mpn/Makefile.am, gmp-impl.h (mpn_sizeinbase): Remove.
17391 * mpn/generic/sizeinbase.c: Remove file.
17393 * gmp-impl.h (MPN_GET_STR_SIZE): Remove.
17394 * tests/mpn/t-g_str_size.c: Remove file.
17395 * tests/mpn/Makefile.am: Update.
17397 * Makefile.am (dist-hook): Don't distribute cvs merge ".#" files.
17399 2002-02-08 Torbjorn Granlund <tege@swox.com>
17401 * configure.in: Override extra_functions for all sparcv8 systems, not
17404 2002-02-06 Kevin Ryde <kevin@swox.se>
17406 * tune/tuneup.c (tune_mul, tune_sqr): Disable FFTs until tuned.
17407 * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix memory clobber in
17408 destination cache priming.
17410 * printf/doprnt.c: Fix parsing of %s and %p conversions.
17411 * tests/misc/t-printf.c (check_misc): Add some tests.
17413 2002-02-03 Torbjorn Granlund <tege@swox.com>
17415 * mpn/sparc32/v8/udiv.asm: New file, from v8/supersparc.
17417 * mpn/generic/set_str.c: Rename indigits_per_limb => chars_per_limb.
17418 Remove redundant chars_per_limb. Reverse 4 loops in basecase code for
17419 speed. Use MP_BASES_CHARS_PER_LIMB_10.
17421 2002-02-03 Kevin Ryde <kevin@swox.se>
17423 * acinclude.m4 (GMP_PROG_NM): Ensure -B or -p get used when doing a
17424 cross compile with the native nm, helps OSF for instance.
17425 (GMP_ASM_LSYM_PREFIX): Remove ".byte 0" for the benefit of irix 6,
17426 allow "N" from nm for OSF, allow for "t" for other systems, but prefer
17427 no mention of the symbol at all.
17429 * tune/tuneup.c (print_define_remark): New function.
17430 Turn some "#if"s into plain "if"s.
17432 * tune/tuneup.c, gmp-impl.h, tune/Makefile.am
17433 (GET_STR_BASECASE_THRESHOLD, GET_STR_PRECOMPUTE_THRESHOLD): Tune these.
17434 * mpn/generic/get_str.c [TUNE_PROGRAM_BUILD]: Cope with non-constant
17435 GET_STR_PRECOMPUTE_THRESHOLD.
17437 2002-02-02 Torbjorn Granlund <tege@swox.com>
17439 * mpn/generic/get_str.c (mpn_get_str): Fix typo in a declaration.
17441 2002-02-02 Kevin Ryde <kevin@swox.se>
17443 * mpn/generic/set_str.c: Use MP_PTR_SWAP and POW2_P, add __GMP_PROTO
17444 to convert_blocks prototype, disable SET_STR_BLOCK_SIZE sanity check.
17446 * tune/set_strb.c, tune/set_strs.c: New files.
17447 * tune/speed.h, tune/speed.c, tune/common.c,tune/Makefile.am: Add them.
17448 * tune/tuneup.c: Tune SET_STR_THRESHOLD.
17449 (DEFAULT_MAX_SIZE): Renamed from MAX_SIZE, allow any param.max_size[].
17451 2002-02-01 Torbjorn Granlund <tege@swox.com>
17453 * tests/mpz/convert.c: Increase operand size. Add (yet disabled) code
17454 for testing with random strings.
17456 * mpn/generic/get_str.c (mpn_get_str): Rewrite to become sub-quadratic.
17457 (mpn_dc_get_str, mpn_sb_get_str): New functions.
17459 2002-01-31 Kevin Ryde <kevin@swox.se>
17461 * gmpxx.h (cmp): Renamed from "compare".
17463 * configure.in (AC_C_BIGENDIAN): Don't abort when cross compiling.
17464 (PROLOGUE): Allow new style optional second parameter when grepping.
17466 * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
17467 GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
17468 Use $ac_objext for object filenames.
17469 (GMP_ASM_UNDERSCORE): Use CCAS to assemble.
17471 * demos/pexpr-config-h.in: New file.
17472 * configure.in: Generate demos/pexpr-config.h.
17473 (AC_CHECK_FUNCS): Add clock, cputime, setrlimit, sigaction,
17474 sigaltstack, sigstack.
17475 * acinclude.m4 (GMP_SUBST_CHECK_FUNCS, GMP_SUBST_CHECK_HEADERS): New
17477 * demos/pexpr.c: Use pexpr-config.h, not various #ifdefs.
17478 (setup_error_handler): Use signal if sigaction not available, allow
17479 for SIGBUS missing on mingw.
17480 (main): Use time() for random seed if gettimeofday not available.
17481 (cleanup_and_exit): Move SIGFPE out of LIMIT_RESOURCE_USAGE.
17483 2002-01-30 Torbjorn Granlund <tege@swox.com>
17485 * mpn/generic/set_str.c: Rewrite to become sub-quadratic.
17486 (convert_blocks): New function.
17488 2002-01-30 Kevin Ryde <kevin@swox.se>
17490 * gmp-impl.h (GMP_NUMB_MASK, GMP_NAIL_MASK, GMP_NUMB_HIGHBIT,
17491 ASSERT_MPN, ASSERT_MP_LIMB_T): New macros.
17493 * mpn/generic/fib2_ui.c: Use GMP_NUMB_BITS, simplify the data
17494 generator program, share __gmp_fib_table initializers between bit
17495 sizes, cope with bit sizes other than those specifically setup.
17496 * gmp-impl.h (FIB_TABLE_LIMIT, FIB_TABLE_LUCNUM_LIMIT): Corresponding
17497 rearrangement of conditionals.
17498 * tests/mpz/t-fib_ui.c (check_fib_table): New test.
17500 2002-01-28 Kevin Ryde <kevin@swox.se>
17502 * mpz/set_si.c, mpz/iset_si.c: Store to _mp_d[0] unconditionally, use
17503 an expression for _mp_size.
17505 * mpz/init.c, mpz/init2.c, mpz/iset.c, mpq/init.c [__CHECKER__]: Store
17506 dummy values to low limbs to stop them appearing uninitialized.
17508 2002-01-26 Kevin Ryde <kevin@swox.se>
17510 * mpfr/mpfr-test.h (MAX, MIN, ABS): Use instead a patch from Paul and
17513 2002-01-24 Kevin Ryde <kevin@swox.se>
17515 * configure.in: Extra quoting to get argument help messages right.
17517 * gmp.texi (Efficiency): Suggest hex or octal for input and output.
17518 (Formatted Output Strings): Mention "*" for width and precision.
17520 * mpn/generic/sizeinbase.c: New file, adapted from mpz/sizeinbase.c.
17521 Use POW2_P, use __mp_bases[base].big_base for log2(base).
17522 * configure.in, mpn/Makefile.am: Add it.
17523 * gmp-impl.h: Add prototype.
17524 * mpz/sizeinbase.c, tune/speed.h, mpn/generic/get_str.c,
17525 mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c: Use it.
17526 * mpz/get_str.c: Write directly to user buffer, skip at most one
17527 leading zero, eliminate special case for x==0.
17528 * mpbsd/mtox.c: Allocate exact result space at the start, eliminate
17529 special case for x==0.
17530 * mpbsd/mout.c: Only need to skip one high zero with mpn_sizeinbase.
17532 * configure.in (--enable-nails): New option.
17533 (GMP_NAIL_BITS, GMP_LIMB_BITS, GMP_NUMB_BITS): New defines for gmp.h
17535 * gmp-h.in: Add templates.
17537 * mpfr/mpfr-test.h (MAX, MIN, ABS): Use #ifndef to avoid a redefine
17540 2002-01-23 Torbjorn Granlund <tege@swox.com>
17542 * mpn/generic/get_str.c: Correct type of `out_len'.
17544 2002-01-22 Kevin Ryde <kevin@swox.se>
17546 * mpn/generic/pre_divrem_1.c: Corrections to some ASSERTs.
17548 * mpfr/mul_ui.c: Don't call mpn_lshift with 0 shift.
17550 * mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
17552 2002-01-21 Torbjorn Granlund <tege@swox.com>
17554 * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
17556 (64-bit powerpc add_ssaaaa): Likewise.
17558 2002-01-20 Kevin Ryde <kevin@swox.se>
17560 * acinclude.m4 (GMP_FUNC_VSNPRINTF): Use %n to better detect sparc
17561 solaris 2.7 problems.
17563 2002-01-19 Torbjorn Granlund <tege@swox.com>
17565 * demos/pexpr.c (mpz_eval_expr): Optimize s^rhs for -1 <= s <= 1.
17566 (cleanup_and_exit): Improve error message wording.
17568 2002-01-19 Kevin Ryde <kevin@swox.se>
17570 * mpfr/mpfr.h (_PROTO): Use __GMP_PROTO, for compatibility with
17573 2002-01-17 Torbjorn Granlund <tege@swox.com>
17575 * mpfr/mpfr-test.h: Test "__hpux", not "hpux". Mask off mrand48
17576 return value to 31 bits to work around sloppy mpfr #include practices.
17578 * mpfr/tests/*.c: Use #include "", not <>, for gmp.h and mpfr.h.
17579 Make sure to #include mpfr-test.h from all files that use random().
17581 2002-01-17 Kevin Ryde <kevin@swox.se>
17583 * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE_TYPE): New macro.
17584 * gmp-impl.h, mpz/get_str.c, mpz/out_raw.c, mpq/get_str.c,
17585 mpq/set_str.c, mpf/get_str.c, printf/asprntffuns.c, printf/doprnt.c,
17586 printf/repl-vsnprintf.c, printf/snprntffuns.c, scanf/doscan.c,
17587 mpbsd/mtox.c: Some fixes to compile as C++.
17589 * mpn/generic/jacbase.c (JACOBI_BASE_METHOD): New tuned parameter,
17590 replacing COUNT_TRAILING_ZEROS_TIME test. Add a third method too.
17591 * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
17592 measuring of mpn_jacobi_base methods.
17593 * tune/jacbase1.c, tune/jacbase2.c, tune/jacbase3.c: New files.
17594 * tune/tuneup.c (JACOBI_BASE_METHOD): Tune this.
17595 * mpn/x86/*/gmp-mparam.h (COUNT_TRAILING_ZEROS_TIME): Remove macro.
17597 * gmp-h.in: Use __gmp prefix on variables in inlines.
17599 * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Remove __i, unused.
17601 * mpn/generic/mul_fft.c: Use HAVE_NATIVE_mpn_addsub_n, not ADDSUB.
17602 Use CNST_LIMB for some constants.
17604 2002-01-15 Kevin Ryde <kevin@swox.se>
17606 * tests/mpbsd/Makefile.am: Add a convenience rule for ../libtests.la.
17608 * printf/Makefile.am: libdummy.la should be in EXTRA_LTLIBRARIES.
17610 * mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
17611 mpf_get_str give the same for ndigits==0.
17613 * mpfr/exceptions.c (mpfr_set_emin, mpfr_set_emax): Work around a
17614 powerpc64 gcc 3.0 -O2 bug.
17616 * tests/memory.c, tests/tests.h (tests_memory_validate): New function.
17618 2002-01-14 Kevin Ryde <kevin@swox.se>
17620 * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem_1.c,
17621 mpn/generic/divrem_2.c, mpn/generic/mod_1.c: Don't use UMUL_TIME and
17622 UDIV_TIME, just default to preinv.
17623 * gmp-impl.h (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Ditto.
17624 (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD): Don't use UMUL_TIME
17625 and UDIV_TIME, make default thresholds 0.
17626 (UDIV_NORM_PREINV_TIME, UDIV_UNNORM_PREINV_TIME): Remove macros.
17627 * mpn/x86/*/gmp-mparam.h (UMUL_TIME, UDIV_TIME,
17628 UDIV_NORM_PREINV_TIME): Remove macros.
17630 * gmp.texi (Headers and Libraries): New section, being the header
17631 notes from "GMP Basics" and some new stuff.
17632 (Parameter Conventions): Notes on "const" parameters.
17633 (Formatted Output Strings): Add type N, tweak some wording.
17635 * tests/refmpn.c (refmpn_divmod_1c): Avoid a bug in i386 gcc 3.0.
17637 2002-01-12 Kevin Ryde <kevin@swox.se>
17639 * mpz/root.c: Add <stdlib.h>, for abort().
17641 * mpfr/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
17642 * mpfr/mpfr.h, mpfr/mpfr-tests.h, reuse.c, tadd.c, tadd_ui.c, tagm.c,
17643 tatan.c, tcmp2.c, tcos.c, tdiv.c, tdiv_ui.c, teq.c, texp.c,
17644 tget_str.c, thyperbolic.c, tlog.c, tmul.c, tout_str.c, tpow.c,
17645 trandom.c, tset_z.c, tsin.c, tsqrt.c, tsqrt_ui.c, tsub_ui.c, ttan.c,
17646 tui_div.c: Fixes for K&R.
17648 * tests/misc/t-scanf.c (check_misc, check_misc):
17650 * tests/mpz/t-inp_str.c, tests/mpq/t-inp_str.c, tests/misc/t-scanf.c:
17651 Avoid strings in ASSERT, not enjoyed by K&R.
17652 * gmp-impl.h (ASSERT): Note this.
17654 * tests/tests.h (refmpn_mod_34lsub1): Add __GMP_PROTO.
17656 * mpbsd/Makefile.am: Avoid an automake problem with ansi2knr and
17657 sources in a different directory.
17659 * printf/repl-vsnprintf.c: Test HAVE_LONG_DOUBLE for long double.
17661 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mod_34lsub1.c,
17662 mul_2.c, pre_divrem_1.c.
17664 * gmp-h.in, gmp-impl.h (mpn_add_nc, mpn_addmul_1c, mpn_addsub_n,
17665 mpn_addsub_nc, mpn_divrem_1c, mpn_dump, mpn_mod_1c, mpn_mul_1c,
17666 mpn_mul_basecase, mpn_sqr_n, mpn_sqr_basecase, mpn_sub_nc,
17667 mpn_submul_1c): Move to gmp-impl.h, since they're undocumented.
17669 * gmp-impl.h (mpn_reciprocal): Remove, unused.
17671 * tune/many.pl (cntlz, cnttz): Use new SPEED_ROUTINE_COUNT_ZEROS.
17673 2002-01-11 Kevin Ryde <kevin@swox.se>
17675 * mpn/hppa/*.asm, mpn/pa64/*.asm, mpn/pa64w/*.asm: Use L().
17677 2002-01-08 Kevin Ryde <kevin@swox.se>
17679 * mpn/asm-defs.m4 (PROLOGUE, EPILOGUE): New scheme, optional function
17680 name to EPILOGUE, check for missing or wrong function name EPILOGUE.
17681 * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/m68k/m68k-defs.m4,
17682 mpn/mips3/mips.m4, mpn/ia64/default.m4, mpn/powerpc32/aix.m4,
17683 mpn/powerpc64/aix.m4, mpn/x86/x86-defs.m4: Consequent updates, add a
17685 * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/alpha/cntlz.asm,
17686 mpn/alpha/invert_limb.asm (PROLOGUE_GP): Change to an optional "gp"
17687 parameter on plain PROLOGUE.
17689 * gmp.texi (Low-level Functions): mpn_get_str doesn't clobber an extra
17690 limb, and doesn't clobber at all for power of 2 bases.
17691 (Language Bindings): Add python gmpy.
17693 * mpz/get_str.c: Determine realloc size arithmetically.
17695 * mpbsd/mtox.c: Size memory block returned to actual space needed.
17696 * gmp.texi (BSD Compatible Functions): Describe this.
17698 * mpz/get_str.c: Don't copy mpn_get_str input for power of 2 bases.
17699 * mpbsd/mtox.c: Ditto, and as a side effect avoid a memory leak from a
17702 * mpz/get_str.c, mpbsd/mout.c: No longer need for +1 limb for
17703 mpn_get_str clobber.
17705 * gmp-impl.h (MPN_GET_STR_SIZE): New macro.
17706 * mpn/generic/get_str.c, mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c,
17707 tune/speed.h: Use it.
17708 * tests/mpn/t-g_str_size.c: New test.
17709 * tests/mpn/Makefile.am: Add it.
17711 * gmp-impl.h (POW2_P): New macro.
17712 * mpn/generic/get_str.c, tests/misc.c: Use it.
17714 * printf/doprnt.c: Add "N" for mpn, share some code between N, Q and Z.
17715 * tests/misc/t-printf.c: Add tests.
17716 * gmp-impl.h (ASSERT_CODE): New macro.
17718 * tests/mpbsd/t-mtox.c: New test.
17719 * tests/mpbsd/Makefile.am: Add it.
17720 (allfuns_LDADD): Don't link against libgmp when testing everything in
17723 2002-01-07 Torbjorn Granlund <tege@swox.com>
17725 * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Rewrite generic versions.
17727 2002-01-06 Kevin Ryde <kevin@swox.se>
17729 * mpn/generic/pre_divrem_1.c: Don't support size==0.
17730 * tests/devel/try.c: Update.
17732 * mpn/generic/get_str.c: Add special case for base==10.
17733 * gmp-impl.h (MP_BASES_CHARS_PER_LIMB_10, MP_BASES_BIG_BASE_10,
17734 MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): New
17736 * tests/t-constants.c: Add checks.
17737 * mpn/mp_bases.c [GENERATE_TABLE]: Print defines for gmp-impl.h, print
17738 all standard bits-per-limb by default.
17740 * demos/pexpr.c, demos/expr/expr.h, demos/expr/expr-impl.h: Use
17743 * gmp-h.in (mpn_divexact_by3c): Remove variables from prototype, to
17744 keep out of application namespace.
17746 2002-01-04 Torbjorn Granlund <tege@swox.com>
17748 * gmp-impl.h: Move _PROTO declaration to before its first usages.
17750 2002-01-04 Kevin Ryde <kevin@swox.se>
17752 * gmp-h.in, mp-h.in, tests/tests.h: Rename _PROTO to __GMP_PROTO, and
17753 don't use #ifndef just define it ourselves.
17754 * gmp-impl.h: Provide _PROTO as an alias for __GMP_PROTO, to avoid big
17755 edits internally, for the moment.
17757 2002-01-03 Torbjorn Granlund <tege@swox.com>
17759 * tune/speed.c (usage): Insert "\n\" into a string.
17761 2001-12-30 Torbjorn Granlund <tege@swox.com>
17763 * mpn/pa64/udiv_qrnnd.c: Remove file.
17764 * mpn/pa64w/udiv_qrnnd.c: Remove file.
17766 * gmp-impl.h (MPN_IORD_U): Change formatting (labels in pos 0, insns
17768 (MPN_INCR_U): Use "addl $1,foo; jc", not "incl foo; jz".
17770 * gmp-impl.h (udiv_qrnnd_preinv): Use plain subtract, not sub_ddmmss,
17773 2001-12-30 Kevin Ryde <kevin@swox.se>
17775 * mpn/generic/get_str.c (udiv_qrnd_unnorm): New macro.
17776 Use "do while" for dig_per_u loop since it's non-zero.
17777 * acconfig.h (HAVE_HOST_CPU_m68k etc): Add templates.
17779 * mpn/generic/mul_basecase.c, mpz/mul.c, mpz/n_pow_ui.c,
17780 mpn/x86/pentium/mul_2.asm, tests/devel/try.c, tests/tests.h,
17781 tests/refmpn.c, tune/speed.c, tune/speed.h, tune/common.c,
17782 tune/many.pl (mpn_mul_2): New parameter style.
17783 * gmp-impl.h (mpn_mul_2): Add prototype.
17784 * configure.in (gmp_mpn_functions_optional): Add mul_2.
17786 * longlong.h (__vxworks__): Remove from powerpc tests, not correct,
17787 not on its own at least.
17789 * tune/speed.c: Add "aas" to specify 0xAA..AA data.
17791 * tune/tuneup.c (print_define_end): Indicate "never" and "always".
17793 2001-12-29 Torbjorn Granlund <tege@swox.com>
17795 * mpq/set_d.c: ANSI-fy.
17796 * mpz/invert.c: Use PTR and SIZ (cosmetic change).
17798 * mpz/cong.c: Rename `xor' to `sign' to avoid C++ reserved word.
17800 2001-12-28 Torbjorn Granlund <tege@swox.com>
17802 * mpn/sparc64/sqr_diagonal.asm: New file.
17804 2001-12-28 Kevin Ryde <kevin@swox.se>
17806 * mpn/generic/get_str.c: Avoid one mpn_divrem_1 by running main loop
17807 only until msize==1.
17809 * tune/tuneup.c: Break up all() for clarity.
17810 (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Compare against plain
17811 division udiv_qrnnd, not the tuned and possibly preinv version.
17813 * tune/freq.c: Split sysctl and sysctlbyname probes into separate
17814 functions, shorten some identifiers, put descriptions inside
17815 functions, define functions unconditionally and do nothing if
17816 requisites not available.
17818 * mpz/inp_raw.c: Avoid a gcc 3.0 powerpc64 bug on AIX.
17820 * acinclude.m4, configure.in (GMP_C_RESTRICT): New macro.
17822 * mpfr/sin.c: Patch from Paul to fix sign of sin(3pi/2).
17824 * demos/calc/calc.y: Improve some error messages.
17826 2001-12-28 Torbjorn Granlund <tege@swox.com>
17828 * mpn/sparc64/mul_1.asm: Rename r72 -> r80.
17829 * mpn/sparc64/addmul_1.asm: Likewise.
17831 2001-12-27 Torbjorn Granlund <tege@swox.com>
17833 * mpn/generic/tdiv_qr.c: Misc formatting cleanups.
17834 For switch case 2, replace `dn' with its value (2).
17836 2001-12-25 Torbjorn Granlund <tege@swox.com>
17838 * tests/devel/mul_1.c: Add FIXED_XLIMB.
17839 * tests/devel/addmul_1.c: Likewise.
17840 * tests/devel/submul_1.c: Likewise.
17842 * tests/devel/add_n.c: Improve error message.
17843 Accept command line argument for # of tests.
17844 * tests/devel/sub_n.c: Likewise.
17846 * tests/devel/: Remove CLOCK settings.
17848 * mpn/sparc32/v9/mul_1.asm: Rewrite.
17849 * mpn/sparc32/v9/addmul_1.asm: Rewrite.
17850 * mpn/sparc32/v9/submul_1.asm: Rewrite.
17852 2001-12-24 Torbjorn Granlund <tege@swox.com>
17854 * mpn/sparc64/mul_1.asm: Get rid of global constant 0.0 (L(noll)).
17855 * mpn/sparc64/addmul_1.asm: Likewise.
17857 2001-12-23 Torbjorn Granlund <tege@swox.com>
17859 * mpn/generic/get_str.c: Move final ASSERT to just before zero fill
17862 2001-12-22 Torbjorn Granlund <tege@swox.com>
17864 * mpn/generic/get_str.c: Move ASSERTs out of loops. Split digit
17865 generation code into two loops, saving a test of msize in the loop.
17867 2001-12-22 Kevin Ryde <kevin@swox.se>
17869 * mpn/x86/x86-defs.m4, mpn/x86/*/*.asm: Remove L / LF scheme putting
17870 function name in local labels.
17872 * mpn/generic/get_str.c: Use mpn_preinv_divrem_1, add a couple of
17875 * mpn/generic/pre_divrem_1.c: New file.
17876 * configure.in (gmp_mpn_functions): Add it.
17877 * gmp-impl.h (mpn_preinv_divrem_1): Add prototype.
17878 (USE_PREINV_DIVREM_1, MPN_DIVREM_OR_PREINV_DIVREM_1): New macros.
17879 * tests/devel/try.c, tune/speed.c, tune/speed.h, tune/common.c,
17880 tune/many.pl, tune/Makefile.am (mpn_preinv_divrem_1): Add testing and
17882 * tune/tuneup.c: Determine USE_PREINV_DIVREM_1.
17883 * tune/pre_divrem_1.c: New file.
17884 * tests/refmpn.c, tests/tests.h (refmpn_preinv_divrem_1): New function.
17886 * tests/mpz/t-io_raw.c: New file.
17887 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
17889 * mpz/inp_raw.c, mpz/out_raw.c: Rewrite.
17890 * acinclude.m4, configure.in (AC_C_BIGENDIAN): New test.
17891 * gmp-impl.h (BSWAP_LIMB): New macro.
17893 * acinclude.m4 (GMP_PROG_CC_WORKS): For a native compile, demand
17894 executables will run, per AC_PROG_CC. This detects ABI=64 is unusable
17895 in a native sparc solaris 7 build with the kernel in 32-bit mode.
17896 * gmp.texi (ABI and ISA): Add notes on this, add an example configure
17899 * tune/tuneup.c, configure.in: Print the gmp-mparam.h filename.
17900 * tune/tuneup.c: Print the CPU frequency.
17902 * tune/time.c, tune/speed.h: Add s390 "stck" method, flatten
17903 conditionals in speed_time_init a bit, use have_* variables to let
17904 some code go dead in speed_starttime and speed_endtime.
17906 * tune/freq.c (speed_cpu_frequency_irix_hinv): New function.
17908 * Makefile.am, configure.in: Restore mpfr.
17910 * configure.in: Add --with-readline, AC_PROG_YACC and AM_PROG_LEX.
17911 * demos/calc/calc.y, demos/calc/calclex.l: Add readline support, add
17913 * demos/calc/Makefile.am: Add calcread.c, calc-common.h, use $(YACC),
17914 $(LEX) and $(LEXLIB).
17915 * demos/calc/calcread.c, demos/calc/calc-common.h,
17916 demos/calc/calc-config-h.in, demos/calc/README: New files.
17918 * configure.in: Put demos/expr configs in expr-config.h.
17919 * demos/expr/expr-config-h.in: New file.
17920 * demos/expr/expr-impl.h: Renamed from expr-impl-h.in, get configs
17921 from expr-config.h.
17922 * demos/expr/Makefile.am: Update.
17924 * demos/expr/exprfr.c: Use mpfr_sin and mpfr_cos, remove some spurious
17927 2001-12-20 Torbjorn Granlund <tege@swox.com>
17929 * mpn/sparc64/mul_1.asm: Trim an instruction.
17930 * mpn/sparc64/addmul_1.asm: Likewise.
17932 * mpn/ia64/add_n.asm: Rewrite.
17933 * mpn/ia64/sub_n.asm: Rewrite.
17935 2001-12-19 Torbjorn Granlund <tege@swox.com>
17937 * mpn/ia64/mul_1.asm: Rewrite.
17938 * mpn/ia64/addmul_1.asm: Rewrite.
17939 * mpn/ia64/submul_1.c: Use TMP_ALLOC_LIMBS.
17941 * tests/devel/mul_1.c: Improve error message.
17942 Accept command line argument for # of tests.
17943 * tests/devel/addmul_1.c: Likewise.
17944 * tests/devel/submul_1.c: Likewise.
17946 2001-12-18 Torbjorn Granlund <tege@swox.com>
17948 * mpn/mips3/mul_1.asm: Add NOPs to save a cycle on R1x000.
17950 2001-12-18 Kevin Ryde <kevin@swox.se>
17952 * gmpxx.h (gmp_randclass): Don't allow copy constructors or "=",
17953 implementation by Gerardo.
17955 * gmp-h.in (operator<<, operator>>): Remove parameter names from
17956 prototypes, to keep out of user namespace.
17958 * acinclude.m4 (GMP_FUNC_VSNPRINTF): Let the test program work as C++.
17960 2001-12-16 Torbjorn Granlund <tege@swox.com>
17962 * mpn/sparc64/mul_1.asm: Rewrite.
17963 * mpn/sparc64/addmul_1.asm: Rewrite.
17964 * mpn/sparc64/submul_1.asm: Rewrite.
17966 * mpn/sparc64/addmul1h.asm: Remove.
17967 * mpn/sparc64/submul1h.asm: Remove.
17968 * mpn/sparc64/mul1h.asm: Remove.
17970 2001-12-15 Kevin Ryde <kevin@swox.se>
17972 * gmp-h.in (mpn_add, mpn_add_1, mpn_cmp, mpn_sub, mpn_sub_1): Follow
17973 __GMP_INLINE_PROTOTYPES for whether to give prototype with inline.
17975 * configure.in (i686*-*-*, pentiumpro-*-*, pentium[23]-*-*,
17976 athlon-*-*, pentium4-*-*): Fall back on -march=pentium if
17977 -march=pentiumpro or higher is not good (eg. solaris cmov).
17979 2001-12-12 Torbjorn Granlund <tege@swox.com>
17981 * gmp-impl.h (MPN_ZERO): Rewrite generic version to be similar to
17984 2001-12-12 Kevin Ryde <kevin@swox.se>
17986 * acinclude.m4 (GMP_PROG_CC_WORKS): Detect cmov problems with gcc
17987 -march=pentiumpro on solaris 2.8.
17989 * tune/common.c, tune/speed.h: Allow for commas in count_leading_zeros
17990 and count_trailing_zeros macros.
17992 * demos/expr/Makefile.am: Distribute exprfr.c and exprfra.c.
17994 * tune/Makefile.am (speed_ext_SOURCES): Should be speed-ext.c.
17996 2001-12-10 Torbjorn Granlund <tege@swox.com>
17998 * mpn/s390/addmul_1.asm: New file.
17999 * mpn/s390/submul_1.asm: New file.
18000 * mpn/s390/mul_1.asm: New file.
18001 * mpn/s390/gmp-mparam.h: Update.
18003 2001-12-07 Kevin Ryde <kevin@swox.se>
18005 * gmp-h.in, mp-h.in, gmp-impl.h: __GMP_DECLSPEC at start of
18006 prototypes, for the benefit of Microsoft C.
18008 * gmp.texi (Introduction to GMP): Mention ABI and ISA section.
18009 (Known Build Problems): Recommend GNU sed on solaris 2.6.
18010 (Assigning Integers): Direct feedback to bug-gmp.
18011 (References): Typo Knuth vol 2 is from 1998.
18013 * gmpxx.h (gmp_randclass): Add initializers for gmp_randinit_default
18014 and gmp_randinit_lc_2exp_size.
18015 gmp.texi (C++ Interface Random Numbers): Describe them.
18017 * tests/misc/t-locale.c, tests/cxx/t-locale.cc: Ensure mpf_clear is
18018 done when the localconv override doesn't work. Reported by Mike
18021 * printf/doprnti.c: Don't showbase on a zero mpq denominator.
18022 * tests/misc/t-printf.c, tests/cxx/t-ostream.c: Add test cases.
18024 2001-12-04 Kevin Ryde <kevin@swox.se>
18026 * gmp.texi (Known Build Problems): Update to gmp_randinit_lc_2exp_size
18027 for the sparc solaris 2.7 problem.
18028 (Reentrancy): SCO ctype.h affects all text-based input functions.
18029 (Formatted Output Strings): Correction to the mpf example.
18030 (Single Limb Division): Correction, should be q-1 not q+1.
18031 (Extended GCD): Clarify why single-limb is inferior.
18032 (Raw Output Internals): Clarify size is twos complement, note limb
18033 order means _mp_d doesn't get directly read or written.
18034 (Contributors): Clarify mpz_jacobi.
18035 And a couple of formatting tweaks elsewhere.
18037 * tests/cxx/t-headers.cc: New file.
18038 * tests/cxx/Makefile.am: Add it.
18040 * gmpxx.h: Add <strstream>, needed by mpf_class::get_str2.
18042 * gmp-h.in (mpq_inp_str, mpn_hamdist): Add __GMP_DECLSPEC.
18044 2001-12-01 Torbjorn Granlund <tege@swox.com>
18046 * Version 4.0 released.
18048 * mpfr/README: Replace contents with explanation of why mpfr is gone.
18050 2001-12-01 Kevin Ryde <kevin@swox.se>
18052 * Makefile.am, configure.in: Temporarily remove mpfr, just leave a
18055 * mpn/Makefile.am (EXTRA_DIST): Add Makeasm.am.
18057 2001-11-30 Gerardo Ballabio <ballabio@sissa.it>
18059 * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: New files.
18060 * tests/cxx/Makefile.am (check_PROGRAMS): Add them.
18062 2001-11-30 Kevin Ryde <kevin@swox.se>
18064 * mpfr: Update to 2001-11-16. Patch TMP handling of agm.c and sqrt.c,
18065 use plain mpn_sqrtrem in sqrt.c, separate .c files for floor and ceil,
18066 disable an expression style assert in add1.c.
18068 * mpn/s370: Rename to s390.
18069 * configure.in (s3[6-9]0*-*-*): Update.
18070 * mpn/Makefile.am (TARG_DIST): Add s390.
18072 * mpz/fits_s.c, mpf/fits_s.c, mpf/fits_u.c: Remove files, unused since
18073 change to .h style.
18075 2001-11-29 Torbjorn Granlund <tege@swox.com>
18077 * gmp-h.in: Declare mpz_get_d_2exp and mpf_get_d_2exp.
18078 * Makefile.am: Add mpz/get_d_2exp$U.lo and mpf/get_d_2exp$U.lo.
18079 * mpf/Makefile.am: Add get_d_2exp.c.
18080 * mpz/Makefile.am: Add get_d_2exp.c.
18082 2001-11-29 Kevin Ryde <kevin@swox.se>
18084 * mpn/*/gmp-mparam.h: Update measured thresholds.
18085 * mpn/s370/gmp-mparam.h: New file.
18087 * mpz/millerrabin.c: Mark for internal use only, for now.
18088 * gmp.texi (Number Theoretic Functions): Remove documentation.
18090 2001-11-28 Torbjorn Granlund <tege@swox.com>
18092 * mpf/get_d_2exp.c: New file.
18093 * mpz/get_d_2exp.c: New file.
18095 * mpz/realloc2.c: Fix typo. Make more similar to mpz_realloc.
18096 * mpz/realloc.c: Use __GMP_REALLOCATE_FUNC_LIMBS.
18098 2001-11-27 Gerardo Ballabio <ballabio@sissa.it>
18100 * gmpxx.h, mpfrxx.h: Various updates and improvements.
18102 2001-11-27 Kevin Ryde <kevin@swox.se>
18104 * gmp.texi (Useful Macros and Constants): Add gmp_version, add @findex
18105 for mp_bits_per_limb.
18107 * demos/perl/GMP.pm, demos/perl/GMP.xs: Use new style gmp_randinit's.
18108 * demos/perl/test.pl: Update for this, and for mpz_perfect_power_p
18109 handling of 0 and 1.
18111 2001-11-26 Torbjorn Granlund <tege@swox.com>
18113 * mpz/realloc.c: Clear variable when decreasing allocation to less than
18114 needed. Misc updates.
18116 2001-11-25 Kevin Ryde <kevin@swox.se>
18118 * tests/misc/t-locale.c: Avoid printf in the normal case, since the
18119 replacement localeconv breaks it on SunOS 4.
18121 * gmp.texi (Build Options, Notes for Package Builds): Note libgmpxx
18122 depends on libgmp from same GMP version.
18124 * acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
18126 * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is
18127 writable, if necessary.
18129 * tests/misc/t-scanf.c: Ensure sscanf arguments are writable, always.
18130 * configure.in (AC_CHECK_DECLS): Remove sscanf, no longer required.
18132 * configure.in (none-*-*): Fix default CFLAGS setups.
18134 * doc/configuration: Misc updates.
18136 2001-11-23 Kevin Ryde <kevin@swox.se>
18138 * mpz/init2.c, mpz/realloc2.c: New files.
18139 * Makefile.am, mpz/Makefile.am: Add them.
18140 * gmp-h.in: Add prototypes.
18141 * gmp.texi (Efficiency): Mention these instead of _mpz_realloc.
18142 (Initializing Integers): Add documentation, reword other parts.
18144 2001-11-22 Torbjorn Granlund <tege@swox.com>
18146 * mpn/cray/ieee/addmul_1.c: Fix logic for more_carries scalar loop.
18147 * mpn/cray/ieee/submul_1.c: Likewise.
18149 2001-11-20 Kevin Ryde <kevin@swox.se>
18151 * gmp.texi (Known Build Problems): Note an out of memory on DJGPP.
18152 (Function Classes): Update function counts.
18153 Misc tweaks elsewhere.
18155 * configure.in (AC_CHECK_DECLS): Add sscanf.
18156 * tests/misc/t-scanf.c: Use it, for the benefit of SunOS 4.
18158 * tal-debug.c, gmp-impl.h: More checks of TMP_DECL/TMP_MARK/TMP_FREE
18161 * mpfr/Makefile.am (AR): Explicit AR=@AR@ to override automake
18162 default, necessary for powerpc64 ABI=aix64.
18164 2001-11-18 Torbjorn Granlund <tege@swox.com>
18166 * mpz/powm.c: Move TMP_MARK to before any TMP_ALLOCs.
18168 2001-11-18 Kevin Ryde <kevin@swox.se>
18170 * configure.in (--enable-fft): Make this the default.
18171 * gmp.texi (Build Options): Update.
18173 * Makefile.am (libmp_la_DEPENDENCIES): Revise mpz objects needed by
18176 * gmp.texi (Random State Initialization): Add gmp_randinit_default and
18177 gmp_randinit_lc_2exp_size, mark gmp_randinit as obsolete.
18178 (Random State Seeding): New section, taken from "Random State
18179 Initialization" and "Random Number Functions".
18181 * configure.in (AC_CHECK_DECLS): Add fgetc, fscanf, ungetc.
18182 * scanf/fscanffuns.c: Use these, for the benefit of SunOS 4.
18184 * gmp-impl.h, gmp-h.in (__gmp_default_fp_limb_precision): Move back to
18185 gmp-impl.h now not required for inlined mpf.
18187 * randlc2s.c (gmp_randinit_lc_2exp_size): New file, the size-based LC
18188 selection from rand.c.
18189 * rand.c (gmp_randinit): Use it.
18190 * randdef.c (gmp_randinit_default): New file.
18191 * gmp-impl.h (RANDS): Use it.
18192 (ASSERT_CARRY): New macro.
18193 * gmp-h.in (gmp_randinit_default, gmp_randinit_lc_2exp_size: Add
18195 * Makefile.am (libgmp_la_SOURCES): Add randdef.c and randlc2s.c.
18197 * printf/asprntffuns.c: Include config.h before using its defines.
18199 * gmp-impl.h: Move C++ <string> to top of file to avoid the memset
18200 redefine upsetting configure tests. Remove <iostream> since <iosfwd>
18203 2001-11-16 Kevin Ryde <kevin@swox.se>
18205 * gmp.texi (Integer Exponentiation): mpz_powm supports negative
18207 (Assigning Floats, I/O of Floats, C++ Formatted Output, C++ Formatted
18208 Input): Decimal point follows locale.
18209 (Formatted Output Strings): %n accepts any type.
18210 (Formatted Input Strings): New section.
18211 (Formatted Input Functions): New section.
18212 (C++ Class Interface): Corrections and clarifications suggested by
18215 * scanf/doscan.c, scanf/fscanf.c, scanf/fscanffuns.c, scanf/scanf.c,
18216 scanf/sscanf.c, scanf/sscanffuns.c, scanf/vfscanf.c, scanf/vscanf.c,
18217 scanf/vsscanf.c, scanf/Makefile.am, tests/misc/t-scanf.c: New files.
18218 * gmp-h.in, gmp-impl.h, Makefile.am, configure.in: Consequent
18221 * tests/misc: New directory.
18222 * tests/misc/Makefile.am: New file.
18223 * tests/misc/t-locale.c: New file.
18224 * tests/misc/t-printf.c: Moved from tests/printf.
18225 * tests/printf: Remove directory.
18226 * configure.in, tests/Makefile.am: Update.
18228 * tests/cxx/t-locale.cc: New file.
18229 * tests/cxx/Makefile.am: Add it.
18231 * mpf/set_str.c, cxx/ismpf.cc: Use localeconv for the decimal point.
18233 * acinclude.m4 (GMP_ASM_X86_MCOUNT): Update to $lt_prog_compiler_pic
18234 for current libtool, recognise non-PIC style mcount in windows DLLs.
18236 * gmp-impl.h (__gmp_replacement_vsnprintf): Add prototype.
18238 * gmp-impl.h (__gmp_rands, __gmp_rands_initialized,
18239 modlimb_invert_table): Add __GMP_DECLSPEC for the benefit of test
18240 programs using them from a windows DLL.
18241 * longlong.h (__clz_tab): Ditto.
18243 * mpn/x86/t-zdisp2.pl: New file.
18245 * mpn/x86/pentium4/README: New file.
18247 2001-11-15 Torbjorn Granlund <tege@swox.com>
18249 * mpz/powm.c (HANDLE_NEGATIVE_EXPONENT): #define to 1.
18250 * tests/mpz/reuse.c (main): Use mpz_invert to avoid undefined mpz_powm
18253 2001-11-14 Torbjorn Granlund <tege@swox.com>
18255 * mpz/powm_ui.c: Rewrite along the lines of mpz/powm.c (except still no
18257 * mpz/powm.c: Adjust for negative b, after exponentiation done. Add
18258 (still disabled) code for handling negative exponents. Misc cleanups.
18260 2001-11-14 Kevin Ryde <kevin@swox.se>
18262 * mpf/out_str.c: Use localeconv for the decimal point.
18264 * tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
18265 available (eg. on mingw).
18267 2001-11-11 Kevin Ryde <kevin@swox.se>
18269 * gmp-h.in: Remove parameter names from prototypes, to keep out of
18270 application namespace.
18272 2001-11-08 Kevin Ryde <kevin@swox.se>
18274 * acinclude.m4 (GMP_GCC_VERSION_GE): Fix sed regexps to work on
18277 * printf/doprnt.c: Support %n of all types, per glibc.
18279 * gmp-h.in, gmp-impl.h, mpf/abs.c, mpf/neg.c, mpf/get_prc.c,
18280 mpf/get_dfl_prec.c, mpf/set_dfl_prec.c, mpf/set_prc_raw.c,
18281 mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Revert mpf inlining, in order
18282 to leave open the possibility of keeping binary compatibility if mpf
18285 * mpn/x86/k7/mmx/lshift.asm, mpn/x86/k7/mmx/rshift.asm: Use Zdisp to
18286 force code size for computed jumps.
18287 * mpn/x86/k6/mod_34lsub1.asm, mpn/x86/k6/k62mmx/copyd.asm: Use Zdisp
18288 to force good code alignment.
18289 * mpn/x86/x86-defs.m4 (Zdisp): More instructions.
18291 * mpn/x86/pentium/sqr_basecase.asm, mpn/x86/k7/mmx/mod_1.asm,
18292 mpn/x86/k7/mmx/popham.asm: Remove some unnecessary "0" address offsets.
18294 * mpq/set_si.c, mpq/set_ui.c: Set _mp_den._mp_size correctly if den==0.
18296 2001-11-07 Torbjorn Granlund <tege@swox.com>
18298 * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Work around gas bug.
18300 * mpn/asm-defs.m4 (PROLOGUE): Change alignment to 8 (probably a good
18301 idea in general; required for hppa/hppa1_1/udiv_qrnnd.asm).
18303 2001-11-06 Torbjorn Granlund <tege@swox.com>
18305 * gmp-impl.h (MPN_COPY_INCR): Prepend local variable by `__'.
18306 (MPN_COPY_DECR): Likewise.
18308 2001-11-05 Torbjorn Granlund <tege@swox.com>
18310 * mpz/powm.c: Call mpn functions, not mpz functions, for computation
18311 mod m. Streamline allocations to use a mixture of stack allocation and
18312 heap allocation. Add currently disabled phi(m) exponent reduction
18313 code. Misc optimizations and cleanups.
18315 2001-11-05 Kevin Ryde <kevin@swox.se>
18317 * mpq/inp_str.c: Remove unused variable "ret".
18319 * mpn/x86/k7/sqr_basecase.asm: Fix a 0(%edi) to use Zdisp, so the
18320 computed jumps hit the right spot on old gas.
18322 * mpq/canonicalize.c: DIVIDE_BY_ZERO if denominator is zero.
18324 * mpn/lisp/gmpasm-mode.el (comment-start-skip): Correction to the way
18325 the first \( \) pair is setup.
18326 (gmpasm-font-lock-keywords): Don't fontify the space before a "#" etc.
18327 Misc tweaks to some comments.
18329 2001-11-03 Torbjorn Granlund <tege@swox.com>
18331 * tests/refmpn.c (refmpn_overlap_p): Reverse return values.
18333 2001-11-02 Kevin Ryde <kevin@swox.se>
18335 * tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
18336 longer done by configure.
18338 * mpn/x86/pentium4/mmx/popham.asm: New file.
18340 * mpn/x86/x86-defs.m4 (psadbw): New macro.
18341 * mpn/x86/k7/mmx/popham.asm: Use it.
18343 * tests/refmpn.c (refmpn_overlap_p): New function, independent of
18346 2001-10-31 Torbjorn Granlund <tege@swox.com>
18348 * tests/mpz/t-powm.c: Print proper error message when finding
18351 2001-10-31 Kevin Ryde <kevin@swox.se>
18353 * mpn/x86/pentium/mod_34lsub1.asm: New file.
18354 * mpn/x86/k7/mod_34lsub1.asm: New file.
18355 * mpn/x86/mod_34lsub1.asm: New file.
18357 2001-10-30 Kevin Ryde <kevin@swox.se>
18359 * tests/printf/t-printf.c (check_misc): Add checks from the glibc docs.
18360 (check_vasprintf, check_vsnprintf): Run these unconditionally.
18362 * gmp-impl.h (ASSERT_MPQ_CANONICAL): New macro.
18363 * mpq/cmp.c, mpq/cmp_si.c, mpq/cmp_ui.c, mpq/equal.c: Add ASSERTs for
18364 canonical inputs, where correctness depends on it.
18366 * mpn/lisp/gmpasm-mode.el (comment-start-skip): Add "dnl".
18368 2001-10-27 Torbjorn Granlund <tege@swox.com>
18370 * demos/pexpr.c: Remove some unused variables.
18371 (main): Allocate more buffer space to accommodate minus sign.
18373 2001-10-27 Kevin Ryde <kevin@swox.se>
18375 * gmp-impl.h, mpn/asm-defs.m4, configure.in, tune/speed.h,
18376 tune/speed.c, tune/common.c, tune/many.pl, tests/devel/try.c: Add
18378 * tests/refmpn.c, tests/tests.h (refmpn_mod_34lsub1): New function.
18380 * mpn/generic/mod_34lsub1.c: New file.
18381 * mpn/x86/k6/mod_34lsub1.asm: New file.
18382 * mpn/x86/pentium4/sse2/mod_34lsub1.asm: New file.
18383 * mpn/x86/x86-defs.m4 (Zdisp): Add another instruction.
18385 * gmp-h.in, gmpxx.h: Use <iosfwd> not whole <iostream>.
18387 * gmp.texi (Known Build Problems): Add note on test programs with
18390 2001-10-26 Kevin Ryde <kevin@swox.se>
18392 * tests/mpq/t-get_d.c: Limit the size of "eps" for vax.
18394 * gmp.texi (maybepagebreak): New macro, use it in a few places.
18395 (Notes for Particular Systems): C++ Windows DLLs are not supported.
18396 (Known Build Problems): Note sparc solaris 2.7 gcc 2.95.2 shared
18398 (Autoconf): Tweak version numbers shown.
18399 (Integer Roots): mpz_perfect_square_p and mpz_perfect_power_p consider
18400 0 and 1 perfect powers, mpz_perfect_power_p accepts negatives.
18401 (Number Theoretic Functions): Add mpz_millerrabin, combined with a
18402 reworded mpz_probab_prime_p.
18403 (Formatted Output Strings): Misc clarifications.
18404 (Formatted Output Functions): gmp_asprintf, gmp_vasprintf,
18405 gmp_snprintf, gmp_vsnprintf always available.
18406 (C++ Formatted Output): Misc rewordings.
18407 (Formatted Input): New chapter.
18408 (C++ Class Interface): New chapter, by Gerardo and me.
18409 (Language Bindings): Update GMP++ now in GMP.
18410 (C++ Interface Internals): New section, by Gerardo and me.
18412 * printf/repl-vsnprintf.c: New file.
18413 * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am: Use it
18414 if libc vsnprintf missing or bad.
18415 * configure.in (AC_CHECK_FUNCS): Add strnlen.
18417 * printf/snprntffuns.c, printf/vasprintf.c: Use
18418 __gmp_replacement_vsnprintf if libc vsnprintf not available.
18419 * printf/asprintf.c, printf/snprintf.c, printf/vasprintf.c,
18420 printf/vsnprintf.c: Provide these functions unconditionally.
18421 * acinclude.m4 (GMP_FUNC_VSNPRINTF): Remove warning about omissions
18422 when vsnprintf not available.
18424 2001-10-24 Kevin Ryde <kevin@swox.se>
18426 * configure, aclocal.m4: Regenerate with a libtool patch for a stray
18427 quote in AC_LIBTOOL_PROG_LD_SHLIBS under mingw and cygwin.
18429 * gmp-impl.h (modlimb_invert): More comments.
18431 * printf/doprnt.c, printf/doprnti.c: Use the precision field to print
18433 * tests/printf/t-printf.c: Test this.
18434 * cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
18436 * tune/speed.c, tune/speed.h, tune/common.c: Add mpn_mul_1_inplace.
18438 2001-10-23 Torbjorn Granlund <tege@swox.com>
18440 * mpz/pprime_p.c (mpz_millerrabin): Remove function and its descendant.
18442 * mpz/millerrabin.c: New file with code from pprime.c.
18443 * mpz/Makefile.am: Compile millerrabin.c.
18444 * Makefile.am (MPZ_OBJECTS): Ditto.
18445 * gmp-h.in: Declare mpz_millerrabin.
18447 2001-10-22 Torbjorn Granlund <tege@swox.com>
18449 * tests/mpz/t-perfsqr.c: New file.
18450 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
18452 * demos/factorize.c (factor): Check for number to factor == 0.
18453 (main): When invoked without arguments, read from stdin.
18455 * mpz/perfpow.c: Add code to handle negative perfect powers ((-b)^odd).
18456 Treat 0 and 1 as perfect powers.
18458 * mpn/sparc32/v9/sqr_diagonal.asm: Jump past .align.
18460 2001-10-21 Torbjorn Granlund <tege@swox.com>
18462 * mpn/generic/perfsqr.c (sq_res_0x100): Remove bogus final `,'.
18463 (mpn_perfect_square_p): Suppress superfluous `&1' in sq_res_0x100 test.
18464 (mpn_perfect_square_p, O(n) test): Improve comments. Combine remainder
18465 tests for some small primes. Don't share code for different limb
18466 sizes. Use single `if' with many `||' for better code density.
18468 2001-10-22 Kevin Ryde <kevin@swox.se>
18470 * demos/perl/GMP.xs (mutate_mpz, tmp_mpf_grow): Make these "static".
18472 * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm
18473 (mpn_popcount_table): Use GSYM_PREFIX.
18475 2001-10-19 Kevin Ryde <kevin@swox.se>
18477 * mpn/x86/*.asm: Add some measured speeds on various x86s.
18479 * tests/mpz/reuse.c, tests/mpf/reuse.c: Disable tests when using a
18480 windows DLL, because certain global variable usages won't compile.
18482 * configure.in (AC_CHECK_FUNCS): Add alarm.
18483 * tests/spinner.c: Conditionalize alarm and SIGALRM availability, for
18484 the benefit of mingw32.
18486 * acinclude.m4 (GMP_ASM_TYPE, GMP_ASM_SIZE): Suppress .type and .size
18489 * acinclude.m4 (GMP_PROG_HOST_CC): New macro.
18490 * configure.in: Use it for windows DLL cross-compiles.
18491 * aclocal.m4, configure: Regenerate with libtool patch to hold HOST_CC
18492 in the generated libtool script.
18494 * aclocal.m4, configure: Regenerate with libtool patch to suppress
18495 warnings when probing command line limit on FreeBSD.
18497 * demos/qcn.c (M_PI): Define if not already provided, helps mingw32.
18499 2001-10-17 Kevin Ryde <kevin@swox.se>
18501 * printf/doprnt.c: Use <stdint.h> for intmax_t.
18503 * longlong.h: Recognise __sparcv8 for gcc on Solaris. Reported by
18504 Mark Mentovai <mark@mentovai.com>.
18506 * gmp-impl.h (gmp_allocated_string): No need for inline on member funs.
18508 2001-10-16 Kevin Ryde <kevin@swox.se>
18510 * gmp.texi (Debugging): Add mpatrol.
18511 (Integer Comparisons, Comparing Rationals, Float Comparison): Index
18512 entries for sign tests.
18513 (I/O of Floats): Clarify mpf_out_str exponent is in decimal.
18514 (C++ Formatted Output): mpf_t operator<< exponent now in decimal.
18515 (FFT Multiplication): Use an ascii art sigma.
18516 (Contributors): Add Gerardo Ballabio.
18518 * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Always give mpf_t
18519 exponent in decimal, irrespective of ios::hex or ios::oct.
18520 * tests/cxx/t-ostream.cc (check_mpf): Update.
18522 * printf/doprnt.c: Support %lln and %hhn.
18524 * mpn/x86/pentium4/sse2/submul_1.asm: Use a psubq to negate the
18525 initial carry (helps the submul_1c case), and improve the comments.
18527 2001-10-11 Kevin Ryde <kevin@swox.se>
18529 * acinclude.m4, configure.in (GMP_IMPL_H_IEEE_FLOATS): New macro.
18531 * ltmain.sh: Send some rm errors to /dev/null, helps during compiles
18532 on Solaris 2.7 and HP-UX 10.
18534 * tal-notreent.c: Renamed from stack-alloc.c.
18535 * Makefile.am, acinclude.m4, gmp-impl.h: Update.
18537 * gmp-h.in: Don't give both prototypes and inlines, except on gcc.
18539 * gmp-h.in, gmp-impl.h: Use #includes to get necessary standard
18540 classes, add std:: to prototypes.
18541 * cxx/*.cc, tests/cxx/t-ostream.cc: Add "use namespace std".
18542 * acinclude.m4 (GMP_PROG_CXX_WORKS): Ditto.
18544 * tests/*/Makefile.in, mpfr/tests/Makefile.in: Regenerate with
18545 automake patch to avoid Ultrix problem with empty $(TESTS).
18547 * */Makefile.in: Regenerate with automake patch to only rm *_.c in
18548 "make clean" when ansi2knr actually in use, helps DOS 8.3.
18550 * Makefile.in: Regenerate with automake patch to fix stamp-h
18551 numbering, avoiding an unnecessary config.status run.
18553 2001-10-09 Torbjorn Granlund <tege@swox.com>
18555 * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Use L macros for labels.
18556 Quote L reloc operator.
18558 * gmp-impl.h: Declare class string.
18560 * mpn/asm-defs.m4 (INT32, INT64): Quote $1 to prevent further
18563 * mpn/alpha/ev6/mul_1.asm: New file.
18565 2001-10-09 Kevin Ryde <kevin@swox.se>
18567 * gmp.texi (Introduction to GMP): Add pentium 4 to optimized CPUs.
18568 (Build Options): Note macos directory.
18569 (Notes for Package Builds): GMP 4 series binary compatible with 3.
18570 (Known Build Problems): Remove $* and ansi2knr note, now fixed, except
18571 possibly under --host=none.
18572 (Formatted Output Strings): Remove -1 prec for all digits.
18574 * mpz/add.c, mpz/sub.c: Don't use mpz path on #include (helps macos).
18575 * mpbsd/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpz.
18577 * printf/doprnt.c, tests/printf/t-printf.c: Remove support for %.*Fe
18578 prec -1 meaning all digits.
18580 * acinclude.m4 (GMP_PROG_AR): Override libtool, use AR_FLAGS="cq".
18581 (GMP_HPC_HPPA_2_0): Print version string to config.log.
18583 * Makefile.am (AUTOMAKE_OPTIONS): Remove check-news (permission notice
18584 in NEWS file is too big).
18585 (dist-hook): Don't distribute numbered or unnumbered emacs backups.
18587 * Makefile.am, cxx/Makefile.am: Updates for Gerardo's stuff.
18589 2001-10-09 Gerardo Ballabio <ballabio@sissa.it>
18591 * cxx/isfuns.cc: New file.
18592 * gmp-impl.h: Add prototypes.
18593 * cxx/ismpf.cc, cxx/ismpq.cc, cxx/ismpz.cc: New files.
18594 * gmp-h.in: Add prototypes.
18595 * gmpxx.h, mpfrxx.h: New files.
18597 2001-10-08 Kevin Ryde <kevin@swox.se>
18599 * configure.in (with_tags): Establish a default based on --enable-cxx.
18601 * aclocal.m4: Regenerate with libtool patches for sed char range to
18602 help Cray, LTCC quotes and +Z warnings grep to help HP-UX.
18604 * gmp-impl.h (doprnt_format_t, doprnt_memory_t, doprnt_reps_t,
18605 doprnt_final_t): Use _PROTO.
18607 2001-10-05 Torbjorn Granlund <tege@swox.com>
18609 * mpn/asm-defs.m4 (INT32, INT64): Use LABEL_SUFFIX.
18611 * mpn/hppa: Convert files to `.asm'.
18613 2001-10-05 Kevin Ryde <kevin@swox.se>
18615 * mpn/Makeasm.am (.S files): Revert to separate CPP and CCAS, use
18616 cpp-ccas, and only pass CPPFLAGS to CPP, not whole CFLAGS.
18617 * mpn/cpp-ccas: New file.
18618 * mpn/Makefile.am (EXTRA_DIST): Add it.
18620 * tune/common.c, tune/speed.h: Change SPEED_ROUTINE_MPN_COPY_CALL uses
18621 to SPEED_ROUTINE_MPN_COPY or new SPEED_ROUTINE_MPN_COPY_BYTES. Avoids
18622 macro expansion problems on Cray.
18624 * configure.in (AC_PROG_CXXCPP): Add this, to make libtool happier.
18626 2001-10-04 Torbjorn Granlund <tege@swox.com>
18628 * mpz/rrandomb.c (gmp_rrandomb): Change bit_pos to be 0-based (was
18629 1-based); shift 2 (was 1) when making bit mask. These two changes
18630 avoid undefined shift counts.
18631 (gmp_rrandomb): Avoid most calls to _gmp_rand by caching random values.
18633 * mpn/generic/random2.c: Changes for mirroring mpz/rrandomb.c.
18635 2001-10-04 Kevin Ryde <kevin@swox.se>
18637 * gmp.texi (Build Options): Add --enable-cxx.
18638 (Notes for Particular Systems): Mention pentium4 performance and SSE2.
18639 (Known Build Problems): Remove vax jsobgtr note, no longer needed.
18640 (Converting Floats): Tweak mpf_get_str description.
18641 (Low-level Functions): Correction to mpn_gcdext destination space
18643 (C++ Formatted Output): New section.
18644 (Language Bindings): Add ALP
18645 (Contributors): Add Paul Zimmermann's square root, update my things.
18647 * acinclude.m4 (GMP_PROG_CC_IS_GNU, GMP_PROG_CXX_WORKS): Send compiler
18648 errors to config.log.
18650 * mpq/Makefile.am (INCLUDES): Remove -DOPERATION_$*, not needed.
18652 * mpn/x86/*.asm: Change references to old README.family to just README.
18654 * mpz/README: Remove file, now adequately covered in the manual.
18656 2001-10-03 Torbjorn Granlund <tege@swox.com>
18658 * mpn/x86/pentium4/copyi.asm: New file.
18659 * mpn/x86/pentium4/copyd.asm: New file.
18661 * gmp-impl.h: Implement separate MPN_COPY_INCR and MPN_COPY_DECR
18662 macros for CRAY systems.
18663 (CRAY _MPN_COPY): Delete.
18665 2001-10-02 Kevin Ryde <kevin@swox.se>
18667 * tests/mpz/t-popcount.c (check_data): Use "~ (unsigned long) 0" to
18668 avoid compiler warnings on sco.
18670 * mpbsd/Makefile.am: Compile mpz files directly, no copying.
18671 Use mpz/add.c and mpz/sub.c rather than mpz/aors.c.
18672 (INCLUDES): Remove -DOPERATION_$*, no longer needed (by mpz).
18674 * mpz/aors.h: Renamed from mpz/aors.c.
18675 * mpz/add.c, mpz/sub.c: New files, using mpz/aors.h.
18676 * mpz/aors_ui.h: Renamed from mpz/aors_ui.c.
18677 * mpz/add_ui.c, mpz/sub_ui.c: New files, using mpz/aors_ui.h.
18678 * mpz/fits_s.h: Renamed and adapted from mpz/fits_s.c.
18679 * mpz/fits_sshort.c, mpz/fits_sint.c, mpz/fits_slong.c: New files.
18680 * mpz/mul_i.h: Renamed from mpz/mul_siui.c.
18681 * mpz/mul_ui.c, mpz/mul_ui.c: New files, using mpz/mul_i.h.
18682 * mpz/Makefile.am: Consequent updates.
18683 (INCLUDES): Remove -DOPERATION_$*.
18685 * mpf/fits_s.h: Renamed and adapted from mpf/fits_s.c.
18686 * mpf/fits_sshort.c, mpf/fits_sint.c, mpf/fits_slong.c: New files.
18687 * mpf/fits_u.h: Renamed and adapted from mpf/fits_u.c.
18688 * mpf/fits_ushort.c, mpf/fits_uint.c, mpf/fits_ulong.c: New files.
18689 * mpf/Makefile.am: Consequent updates.
18690 (INCLUDES): Remove -DOPERATION_$*.
18692 * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Don't use ios::hex etc
18693 as cases in a switch, they're not constant in g++ 3.0.
18695 * mpn/Makeasm.am (.s.o, .s.obj, .S.o, .S.obj, .asm.o, .asm.obj):
18696 Locate source file with test -f the same as automake.
18697 (.S): Let CCAS do the preprocessing, and run libtool for .S.lo.
18698 (.asm.lo): Run libtool via m4-ccas to get new style foo.lo right.
18699 (COMPILE_FLAGS): Add $(DEFAULT_INCLUDES), per new automake.
18700 * mpn/m4-ccas: New file.
18701 * mpn/Makefile.am (EXTRA_DIST): Add it.
18702 * mpn/asm-defs.m4: Add m4_not_for_expansion(`DLL_EXPORT').
18703 * mpn/x86/x86-defs.m4: Undefine PIC if DLL_EXPORT is set.
18704 * configure.in (CFLAGS_PIC, ASMFLAGS_PIC): Remove, no longer needed.
18706 * acinclude.m4 (GMP_FUNC_VSNPRINTF): Warn what's omitted when
18707 vsnprintf not available.
18709 * mpn/underscore.h: Remove file, not used since m68k converted to asm.
18710 * mpn/Makefile.am (EXTRA_DIST): Remove it.
18712 * tests/refmpz.c: Add <stdlib.h>, for free().
18714 2001-10-01 Torbjorn Granlund <tege@swox.com>
18716 * mpn/x86/pentium4/sse2/submul_1.asm: Apply some algebraic
18718 * mpn/x86/pentium4/sse2/addmul_1.asm: Comment.
18720 2001-10-01 Kevin Ryde <kevin@swox.se>
18722 * configure.in (--enable-cxx): New option for C++ support.
18723 Add cxx and tests/cxx subdirectories.
18724 * ltmain.sh, aclocal.m4: Update to libtool 2001-09-30.
18726 * cxx/Makefile.am, cxx/Makefile.in, cxx/osdoprnti.cc, cxx/osfuns.cc,
18727 cxx/osmpf.cc, cxx/osmpq.cc, cxx/osmpz.cc: New files.
18728 * Makefile.am: Add them, in new libgmpxx.
18729 * gmp-h.in, gmp-impl.h: Prototypes and support.
18730 * tests/cxx/Makefile.am, tests/cxx/Makefile.in,
18731 tests/cxx/t-ostream.cc: New files.
18733 * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL,
18734 SPEED_ROUTINE_MPN_GCDEXT_ONE): mpn_gcdext needs size+1 for
18735 destinations. Found by Torbjorn.
18737 * gmp-h.in (__GNU_MP__, __GNU_MP_VERSION): Bump to 4.0.
18738 * mp-h.in (__GNU_MP__): Ditto.
18739 * gmp.texi, Makefile.am, compat.c: Amend version 3.2 to 4.0.
18741 * acinclude.m4 (GMP_PROG_CXX_WORKS): New macro.
18742 (GMP_PROG_CC_WORKS): Write "conftest" test program, not a.out.
18744 * gmp-impl.h (struct gmp_asprintf_t): Moved from printf/vasprintf.c.
18745 (GMP_ASPRINTF_T_INIT): New macro.
18746 (GMP_ASPRINTF_T_NEED): New macro, adapted from vasprintf.c NEED().
18747 * printf/vasprintf.c: Use these.
18749 * printf/asprntffuns.c: New file.
18750 * printf/Makefile.am, Makefile.am: Add it.
18751 * printf/asprntffuns.c, printf/vasprintf.c, gmp-impl.h
18752 (__gmp_asprintf_memory, __gmp_asprintf_reps, __gmp_asprintf_final):
18753 Move to asprntffuns.c, rename to __gmp and make global, remove
18754 spurious formal parameters from __gmp_asprintf_final.
18756 * configure.in (j90-*-*, sv1-*-*): Don't duplicate $path in $add_path.
18757 (*-*-mingw*): Don't assemble with -DPIC (as per cygwin).
18759 * printf/snprntffuns.c (gmp_snprintf_final): Remove spurious formal
18762 * tune/tuneup.c (POWM_THRESHOLD): Reduce stop_factor to 1.1 to help
18763 Cray vector systems.
18765 * tests/misc.c (tests_rand_start): Print GMP_CHECK_RANDOMIZE=NN to
18766 facilitate cut and paste when re-running.
18767 * tests/mpz/t-inp_str.c (check_data): Add more diagnostic prints.
18769 2001-09-30 Kent Boortz <kent@swox.com>
18771 * macos/configure, macos/Makefile.in, macos/README: Updates for gmp 4.
18772 * gmp-h.in (_GMP_H_HAVE_FILE): Recognise Apple MPW.
18774 2001-09-30 Torbjorn Granlund <tege@swox.com>
18776 * mpn/cray/ieee/submul_1.c: Rewrite. Streamline multiplications;
18777 use `majority' logic.
18779 2001-09-27 Torbjorn Granlund <tege@swox.com>
18781 * gmp-h.in (__GMPN_AORS_1): Rewrite to work around Cray compiler bug.
18783 2001-09-26 Torbjorn Granlund <tege@swox.com>
18785 * mpn/x86/pentium4/sse2/gmp-mparam.h: New file.
18787 2001-09-26 Kevin Ryde <kevin@swox.se>
18789 * mpn/x86/pentium4/sse2/dive_1.asm: New file.
18790 * mpn/x86/pentium4/sse2/submul_1.asm: New file.
18791 * mpn/x86/pentium4/sse2/sqr_basecase.asm: New file.
18793 * mpn/x86/pentium/copyi.asm: New file, based on past work by Torbjorn.
18794 * mpn/x86/pentium/copyi.asm: New file, ditto.
18795 * mpn/x86/pentium/com_n.asm: Rewrite, ditto.
18797 * printf/snprntffuns.c (gmp_snprintf_format): Copy va_list in case
18798 vsnprintf trashes it.
18799 * printf/vasprintf.c (gmp_asprintf_format): Ditto.
18800 * gmp-impl.h, doprnt.c (va_copy): Move to gmp-impl.h.
18802 * tests/mpz/t-cmp_d.c (check_low_z_one): Patch by Torbjorn for vax
18803 limited float range.
18805 2001-09-23 Torbjorn Granlund <tege@swox.com>
18807 * mpn/vax/lshift.s: Change `jsob*' to `sob*'.
18808 * mpn/vax/rshift.s: Likewise.
18810 2001-09-23 Kevin Ryde <kevin@swox.se>
18812 * mpn/x86/pentium4/sse2/mul_basecase.asm: Some simple but real code.
18814 * printf/doprnt.c: Use va_copy for va_list variables, copy function
18815 parameter in case it's call-by-reference.
18817 * tune/freq.c (speed_cpu_frequency_bsd_dmesg): New function.
18818 (speed_cpu_frequency_table): Use it.
18820 * tune/many.pl (popcount, hamdist): Fix declared return value.
18821 (sb_divrem_mn): Remove a spurious duplicate entry.
18822 (CLEAN): Add tmp-$objbase.c when using that for .h files.
18823 (macro_speed): Give a default for .h files.
18824 Add ATTRIBUTE_CONST or __GMP_ATTRIBUTE_PURE as appropriate.
18826 * tune/speed.h (SPEED_ROUTINE_MPN_MOD_CALL,
18827 SPEED_ROUTINE_MPN_PREINV_MOD_1, SPEED_ROUTINE_MPN_POPCOUNT,
18828 SPEED_ROUTINE_MPN_HAMDIST, SPEED_ROUTINE_MPN_GCD_1N,
18829 SPEED_ROUTINE_MPN_GCD_1_CALL, SPEED_ROUTINE_MPZ_JACOBI): Use return
18830 values so gcc 3 won't discard calls to pure or const functions.
18831 (mpn_mod_1_div, mpn_mod_1_inv): Add __GMP_ATTRIBUTE_PURE.
18833 2001-09-22 Torbjorn Granlund <tege@swox.com>
18835 * mpn/x86/pentium4/sse2/mul_basecase.asm: New file, placeholder
18836 for real code, hiding the default x86 mul_basecase.asm.
18838 2001-09-22 Kevin Ryde <kevin@swox.se>
18840 * configure.in (AC_PREREQ): Bump to 2.52.
18841 (m4_pattern_forbid, m4_pattern_allow): New calls, forbid GMP_.
18842 (AC_CHECK_HEADERS): Remove sys/types.h, already done by autoconf.
18843 * acinclude.m4, configure.in (GMP_GCC_NO_CPP_PRECOMP): New macro.
18845 * tests/devel/try.c (TYPE_PREINV_MOD_1): Don't run size==0.
18846 (malloc_region): Need fd=-1 for mmap MAP_ANON on BSD.
18848 2001-09-20 Torbjorn Granlund <tege@swox.com>
18850 * mpz/cong.c (mpz_congruent_p): Fix one-limb c<d test.
18852 * longlong.h: Rewrite __i370__ smul_ppmm; enable also for __s390__.
18854 * configure.in: Add support for IBM 360, 370, 390 families.
18856 2001-09-20 Kevin Ryde <kevin@swox.se>
18858 * mpn/x86/pentium4/sse2/diveby3.asm: New file.
18859 * mpn/x86/pentium4/sse2/mode1o.asm: New file.
18861 2001-09-16 Kevin Ryde <kevin@swox.se>
18863 * printf/doprnt.c: '#' means showpoint and showtrailing for %e, %f, %g.
18864 * tests/printf/t-printf.c (check_f): More test cases.
18866 2001-09-15 Torbjorn Granlund <tege@swox.com>
18868 * gmp-h.in (__GMPN_AORS_1): Remove param TEST, add OP and CB.
18869 Postpone zeroing of (cout).
18870 (__GMPN_ADD_1, __GMPN_SUB_1): Corresponding changes.
18872 2001-09-14 Kevin Ryde <kevin@swox.se>
18874 * ChangeLog: Merge in tests/rand/ChangeLog.
18875 * tests/rand/ChangeLog: Remove file.
18877 * printf/doprnt.c: Fix handling of a plain format after a GMP one; no
18878 need to protect against negative precision internally.
18879 * tests/printf/t-printf.c (check_misc): More checks.
18881 2001-09-12 Torbjorn Granlund <tege@swox.com>
18883 * mpn/cray/ieee/invert_limb.c: Add a PROLOGUE in a comment to have
18884 HAVE_NATIVE_... defined.
18886 2001-09-11 Kevin Ryde <kevin@swox.se>
18888 * configure.in, gmp-h.in (__GMP_HAVE_HOST_CPU_FAMILY_power,
18889 __GMP_HAVE_HOST_CPU_FAMILY_powerpc): New AC_SUBSTs.
18890 * gmp-h.in (__GMPN_COPY_INCR): Use them to select the power/powerpc
18891 code, rather than preprocessor defines.
18893 * acinclude.m4, configure.in (GMP_H_ANSI): New macro.
18895 * gmp-h.in (__GMP_EXTERN_INLINE): Add a definition for SCO 8 cc.
18897 * gmp-h.in, version.c (gmp_version): Make the pointer "const" as well
18900 * acinclude.m4, configure.in (GMP_PROG_CC_IS_XLC): Recognise xlc when
18901 invoked under another name (cc, xlc128, etc).
18902 * acinclude.m4 (GMP_PROG_CC_IS_GCC): Print a message when recognised.
18904 2001-09-11 Torbjorn Granlund <tege@swox.com>
18906 * gmp-h.in: Let __DECC mean __GMP_HAVE_CONST, etc.
18907 * mp-h.in: Likewise.
18909 2001-09-10 Torbjorn Granlund <tege@swox.com>
18911 * mpn/x86/pentium4/mmx/lshift.asm: New file.
18912 * mpn/x86/pentium4/mmx/rshift.asm: New file.
18914 * tests/mpn/t-iord_u.c (check_incr_data): Work around HP compiler bug.
18915 (check_decr_data): Likewise.
18917 2001-09-08 Kevin Ryde <kevin@swox.se>
18919 * gmp.texi (Integer Logic and Bit Fiddling): Update mpz_hamdist
18920 behaviour, clarify mpz_popcount a touch.
18921 (Language Bindings): Add mlton, fix alphabetical order.
18922 (Single Limb Division): Describe 2 or 1/2 limbs at a time style.
18924 * configure.in (AC_CHECK_FUNCS): Add mmap.
18925 * tests/devel/try.c (malloc_region): Use mmap if available.
18927 * tests/refmpz.c, tests/tests.h (refmpz_hamdist): New function.
18928 * tests/mpz/t-hamdist.c: New file.
18929 * tests/mpz/Makefile.am: Add it.
18931 * mpz/hamdist.c: Support neg/neg operands.
18933 * macos/Makefile.in: Remove dual compile of mpq/aors.c and
18934 mpn/generic/popham.c.
18936 * gmp-impl.h (popc_limb): New macro, adapted from mpn/generic/popham.c.
18937 For 64-bits reuse 0x33...33 constant.
18938 * mpn/generic/popcount.c, mpn/generic/hamdist.c: Split from popham.c,
18939 use popc_limb macro, remove unused "i", don't bother with "register"
18941 * mpn/generic/popham.c: Remove file.
18943 * ltmain.sh, configure, aclocal.m4: Update to libtool 1.4.1, with one
18944 ltdll.c generation patch.
18945 * doc/configuration: Misc updates, note libtool patch used.
18947 * mpn/x86/pentium4/sse2/mul_1.asm: Use pointer increments not indexed
18948 addressing, to get 4.0 c/l flat.
18950 * tests/mpq/t-cmp_si.c (check_data): Use ULONG_MAX for denominators.
18952 * tests/misc.c (mpz_negrandom): Use given rstate, not RANDS.
18954 2001-09-07 Torbjorn Granlund <tege@swox.com>
18956 * mpn/x86/pentium4/sse2/addmul_1.asm: New file.
18958 2001-09-04 Kevin Ryde <kevin@swox.se>
18960 * tune/freq.c: Define a HAVE for each speed_cpu_frequency routine to
18961 avoid duplicating conditionals.
18962 (speed_cpu_frequency_sco_etchw): New function.
18963 (speed_cpu_frequency_table): Use it.
18964 * tune/README: Mention SCO openunix 8 /etc/hw.
18966 * mpz/fib_ui.c: Use ?: to avoid a gcc 3 bug on powerpc64.
18967 Store back a carry for limb<long.
18969 * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/k7/mmx/mod_1.asm,
18970 mpn/x86/p6/mmx/divrem_1.asm: Fix a couple of comments.
18972 * config.guess: Give m68020 for 68020 or better, not m68k.
18973 * configfsf.guess: Update to 2001-09-04.
18975 2001-09-02 Kevin Ryde <kevin@swox.se>
18977 * configure.in (m68k-*-*): Let m68k mean 68000, not 68020.
18978 * gmp.texi (Notes for Particular Systems): Update.
18980 * gmp-impl.h (union ieee_double_extract) [m68k]: Use longs, since int
18981 might be only 16 bits.
18983 * tests/mpq/t-aors.c: New file.
18984 * tests/mpq/Makefile.am: Add it.
18986 * tests/refmpq.c: New file.
18987 * tests/Makefile.am: Add it.
18988 * tests/tests.h: Add prototypes.
18990 * mpq/aors.c: Share object code for mpq_add and mpq_sub.
18991 * Makefile.am, mpq/Makefile.am: Single mpq/aors.lo now.
18993 * tests/devel/try.c (TYPE_SUBMUL_1): Use correct reference routine.
18995 2001-08-30 Kevin Ryde <kevin@swox.se>
18997 * mpn/x86/x86-defs.m4 (cmov_available_p): Add pentium4.
18999 * gmp-h.in: Put #define renamings with prototypes.
19000 Remove commented out #defines of gmp-impl.h things.
19001 (mpn_invert_limb): Remove #define, already in gmp-impl.h.
19002 (mpn_lshiftc, mpn_rshiftc): Remove #defines, unused.
19003 (mpn_addsub_nc): Add prototype to #define.
19005 2001-08-28 Kevin Ryde <kevin@swox.se>
19007 * gmp.texi: Switch to GFDL.
19008 (Top): Arrange copyright and conditions to appear here too. For
19009 clarity have all this before the miscellaneous macro definitions.
19010 (Copying): Refer to COPYING.LIB file, mention plain GPL2 in demo
19012 (Contributors, References): Use @appendix rather than @unnumbered.
19013 (GNU Free Documentation License): New appendix.
19014 (@contents): Move to start of document, use only for tex (not html).
19015 (Debugging): Add leakbug.
19016 (Build Options): Add pentium4.
19017 (I/O of Rationals): Add mpq_inp_str.
19019 * fdl.texi: New file, with two @appendix directive tweaks.
19020 * Makefile.am (gmp_TEXINFOS): Add it.
19022 * tests/mpz/io.c: Check mpz_inp_str return against ftell, send error
19023 messages just to stdout.
19025 * mpz/inp_str.c, gmp-impl.h (__gmpz_inp_str_nowhite): New function,
19026 and share a __gmp_free_func call.
19027 * mpq/inp_str.c: New file.
19028 * Makefile.am, mpq/Makefile.am: Add it.
19029 * tests/mpq/t-inp_str.c: New file.
19030 * tests/mpq/Makefile.am (check_PROGRAMS): Add it.
19032 * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_power,
19033 HAVE_HOST_CPU_FAMILY_powerpc, HAVE_HOST_CPU_FAMILY_x86): AC_DEFINEs
19034 for processor families.
19035 * gmp-impl.h: Use them, rather than cpp defines.
19037 * demos/Makefile.am (primes_LDADD): Use $(LIBM), for log().
19039 * tune/many.pl, tune/Makefile.am: Fix some from clean and distclean.
19041 2001-08-26 Kevin Ryde <kevin@swox.se>
19043 * tests/devel/try.c (ARRAY_ITERATION): Make types match on "?:" legs.
19044 (TYPE_MPZ_JACOBI, TYPE_MPZ_KRONECKER): Remove some superseded code.
19046 * tests/printf/t-printf.c (check_plain): Don't compare "all digits"
19047 precision against plain printf.
19049 * tune/Makefile.am: Eliminate empty TUNE_MPZ_SRCS.
19051 * configure, config.in, INSTALL.autoconf: Update to autoconf 2.52.
19052 * */Makefile.in, mdate-sh, missing, aclocal.m4, configure: Update to
19054 * configfsf.guess, configfsf.sub: Update to 2001-08-23.
19056 2001-08-24 Torbjorn Granlund <tege@swox.com>
19058 * demos/primes.c: Complete rewrite.
19060 2001-08-24 Kevin Ryde <kevin@swox.se>
19062 * longlong.h: Test __ppc__ for apple darwin cc, reported by Jon
19063 Becker. Also test __POWERPC__, PPC and __vxworks__.
19065 * tune/speed.h (speed_cyclecounter) [x86]: Don't clobber ebx in PIC.
19067 2001-08-22 Kevin Ryde <kevin@swox.se>
19069 * configure.in (x86 mmx): Correction to mmx path stripping.
19071 2001-08-17 Kevin Ryde <kevin@swox.se>
19073 * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am,
19074 tests/printf/Makefile.am, gmp-h.in, gmp-impl.h, gmp.texi: Remove C++
19075 support, for the time being.
19076 * printf/doprntfx.cc, doprntix.cc, osfuns.cc, osmpf.cc, osmpq.cc,
19077 osmpz.cc, tests/printf/t-ostream.cc: Remove files.
19079 * printf/doprnt.c, printf/doprntf.c, gmp-impl.h: Use a single
19080 __gmp_doprnt_mpf, rather than a separate ndigits calculation.
19081 * printf/doprnt.c, printf/doprntf.c, gmp-impl.h, gmp.texi,
19082 tests/printf/t-printf.c: Let empty or -1 prec mean all digits for mpf.
19083 * printf/doprnt.c, tests/printf/t-printf.c: Accept h or l in %n; let
19084 negative "*" style width mean left justify.
19086 * gmp-impl.h, mpf/get_str.c (MPF_SIGNIFICANT_DIGITS): New macro,
19087 extracted from mpf/get_str.c.
19089 * libmp.sym: New file.
19090 * Makefile.am (libmp_la_LDFLAGS): Use it.
19091 (DISTCLEANFILES): Remove asm-syntax.h, no longer generated.
19092 Remove some comments about "make check".
19094 * demos/perl/GMP.pm, GMP.xs, GMP/Mpf.pm: Add printf and sprintf,
19095 change get_str to string/exponent for floats, remove separate
19097 * demos/perl/GMP/Mpf.pm (overload_string): Use $# (default "%.g").
19098 * demos/perl/typemap: Fix some duplicate string entries.
19099 * demos/perl/test.pl: Update tests, split overloaded constants into ...
19100 * demos/perl/test2.pl: ... this new file.
19101 * demos/perl/Makefile.PL (clean): Add test.tmp.
19103 2001-08-16 Kevin Ryde <kevin@swox.se>
19105 * printf/snprntffuns.c (gmp_snprintf_format): Correction to bufsize-1
19106 return value handling.
19108 * demos/calc/calc.y: Reposition "%{" so copyright notice gets into
19111 * INSTALL: Use gmp_printf.
19113 2001-08-14 Kevin Ryde <kevin@swox.se>
19115 * mpz/inp_str.c: Fix return value (was 1 too big).
19116 * tests/mpz/t-inp_str.c: New file.
19117 * tests/mpz/Makefile.am: Add it.
19119 * mpn/x86/pentium4/sse2/add_n.asm: New file.
19120 * mpn/x86/pentium4/sse2/sub_n.asm: New file.
19121 * mpn/x86/pentium4/sse2/mul_1.asm: New file.
19123 2001-08-12 Kevin Ryde <kevin@swox.se>
19125 * printf/sprintffuns.c, printf/doprntf.c: Don't use sprintf return
19126 value (it's a pointer on SunOS 4).
19128 * acinclude.m4 (GMP_ASM_X86_SSE2, GMP_STRIP_PATH): New macros.
19129 * configure.in: Add pentium4 support.
19130 * mpn/x86/pentium4, mpn/x86/pentium4/mmx, mpn/x86/pentium4/sse2: New
19132 * mpn/x86/README: Update.
19134 2001-08-10 Torbjorn Granlund <tege@swox.com>
19136 * demos/pexpr.c (setup_error_handler): Catch also SIGABRT.
19138 2001-07-31 Kevin Ryde <kevin@swox.se>
19140 * tests/refmpn.c (refmpn_mul_1c): Allow low to high overlaps.
19142 * gmp-h.in, gmp-impl.h (_gmp_rand): Move prototype to gmp-impl.h.
19144 * tune/Makefile.am (EXTRA_DIST): Add many.pl.
19146 2001-07-28 Kevin Ryde <kevin@swox.se>
19148 * gmp.texi (Random Number Functions): Old rand functions no longer use
19151 * configure.in, acinclude.m4 (GMP_FUNC_VSNPRINTF): New macro.
19153 * mpn/generic/get_str.c: Add an ASSERT for high limb non-zero.
19155 2001-07-24 Kevin Ryde <kevin@swox.se>
19157 * gmp.texi (Build Options): Add --enable-cxx.
19158 (Converting Floats): Note mpf_get_str only generates accurately
19159 representable digits.
19160 (Low-level Functions): Note mpn_get_str requires non-zero high limb.
19161 (Formatted Output): New chapter.
19162 (Multiplication Algorithms): Use @quotation with @multitable.
19163 (Toom-Cook 3-Way Multiplication): Ditto.
19165 * tests/memory.c (tests_free_nosize): New function.
19166 * tests/tests.h (tests_allocate etc): Add prototypes.
19168 * tests/printf: New directory.
19169 * tests/printf/Makefile.am, t-printf.c, t-ostream.cc: New files.
19170 * configure.in, tests/Makefile.am: Add them.
19172 * configure.in, acinclude.m4 (GMP_PROG_CXX): New macro.
19173 * configure.in (--enable-cxx): New option.
19174 (AC_CHECK_HEADERS): Add locale.h and sys/types.h, remove unistd.h.
19175 (AC_CHECK_TYPES): Add intmax_t, long double, long long, ptrdiff_t,
19177 (AC_CHECK_FUNCS): Add localeconv, memset, obstack_vprintf, snprintf,
19179 (AC_CHECK_DECLS): Add vfprintf.
19181 * gmp-h.in, gmp-impl.h: Additions for gmp_printf etc.
19183 * printf: New directory.
19184 * printf/Makefile.am, asprintf.c, doprnt.c, doprntf.c, doprntfx.cc,
19185 doprnti.c, doprntix.cc, fprintf.c, obprintf.c, obprntffuns.c,
19186 obvprintf.c, osfuns.cc, osmpf.cc, osmpq.cc, osmpz.cc, printf.c,
19187 printffuns.c, snprintf.c, snprntffuns.c, sprintf.c, sprintffuns.c,
19188 vasprintf.c, vfprintf.c, vprintf.c, vsnprintf.c, vsprintf.c: New
19190 * configure.in, Makefile.am: Add them.
19192 * configure.in (HAVE_INLINE): Remove AC_DEFINE, unused.
19193 (AC_CHECK_TYPES): Don't test for void, assume it always exists.
19195 * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE): New macro.
19196 * mpz/get_str.c, mpq/get_str.c, mpf/get_str.c: Use it.
19198 * gmp-impl.h (mpn_fib2_ui): Use __MPN.
19199 (MPN_COPY_DECR): Fix an ASSERT.
19200 (CAST_TO_VOID): Remove macro.
19202 * gmp-h.in (mpq_out_str): Give #define even without prototype.
19203 (mpz_cmp_d, mpz_cmpabs_d): Corrections to #defines.
19205 * tests/devel/try.c: Add mpn_add and mpn_sub, don't use CAST_TO_VOID.
19207 2001-07-23 Torbjorn Granlund <tege@swox.com>
19209 * config.guess: Recognize pentium4.
19210 * config.sub: Recognize pentium4.
19212 2001-07-17 Kevin Ryde <kevin@swox.se>
19214 * gmp-h.in (__GMPN_AORS_1): Remove x86 and gcc versions, leave just
19216 (__GMPN_ADD, __GMPN_SUB): New macros, rewrite of mpn_add and mpn_sub.
19217 (mpn_add, mpn_sub): Use them.
19218 (__GMPN_COPY_REST): New macro.
19220 * gmp-h.in, gmp-impl.h, acinclude.m4: Remove __GMP_ASM_L and
19221 __GMP_LSYM_PREFIX, revert to ASM_L in gmp-impl.h and AC_DEFINE of
19224 2001-07-11 Kevin Ryde <kevin@swox.se>
19226 * gmp-h.in (__GMPN_ADD_1 etc) [x86]: Don't use this on egcs 2.91.
19228 * mpz/fits_uint.c, fits_ulong.c, mpz/fits_ushort.c: Split up fits_u.c.
19229 * mpz/fits_u.c: Remove file.
19230 * mpz/Makefile.am, macos/Makefile.in: Update.
19232 * tests/refmpn.c,tests.h (refmpn_copy): New function.
19233 * tests/devel/try.c (TYPE_ZERO): No return value from call.
19234 (TYPE_MODEXACT_1_ODD, TYPE_MODEXACT_1C_ODD): Share call with
19235 TYPE_MOD_1 and TYPE_MOD_1C.
19236 (MPN_COPY, __GMPN_COPY, __GMPN_COPY_INCR): Add testing.
19238 2001-07-10 Kevin Ryde <kevin@swox.se>
19240 * gmp-h.in (__GMPN_COPY): Add form to help gcc on power and powerpc.
19241 * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR, MPN_ZERO): Ditto.
19242 * mpn/powerpc64/copyi.asm, mpn/powerpc64/copyd.asm: Remove files.
19244 * mpz/tdiv_ui.c: Eliminate some local variables (seems to save code on
19245 i386 gcc 2.95.x), remove a bogus comment about quotient.
19247 * errno.c, gmp-impl.h (__gmp_exception, __gmp_divide_by_zero,
19248 __gmp_sqrt_of_negative): New functions.
19249 * gmp-impl.h (GMP_ERROR, DIVIDE_BY_ZERO, SQRT_OF_NEGATIVE): Use them.
19251 * randclr.c, randraw.c: Use ASSERT(0) for unrecognised algorithms.
19253 2001-07-07 Kevin Ryde <kevin@swox.se>
19255 * configure.in (powerpc*-*-*): Use -no-cpp-precomp for Darwin.
19257 * tests/mpbsd/t-itom.c: Renamed from t-misc.c.
19258 * tests/mpbsd/t-misc.c: Remove file.
19259 * tests/mpbsd/Makefile.am: Update.
19261 * tests/mpf/t-set_si.c,t-cmp_si.c,t-gsprec.c: Split from t-misc.c.
19262 * tests/mpf/t-misc.c: Remove file.
19263 * tests/mpf/Makefile.am: Update.
19265 * tests/mpz/t-oddeven.c,t-set_si.c,t-cmp_si.c: Split from t-misc.c.
19266 * tests/mpz/t-misc.c: Remove file.
19267 * tests/mpz/Makefile.am: Update.
19269 * stack-alloc.c: Add some alignment ASSERTs.
19271 * gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
19273 * tests/devel/try.c (MPN_ZERO): Add testing.
19274 * tune/speed.c,speed.h,common.c,many.pl (MPN_ZERO): Add measuring.
19276 * mpn/x86/divrem_1.asm: Update a remark about gcc and "loop".
19278 * tests/mpq/t-cmp_si.c: New file.
19279 * tests/mpq/Makefile.am: Add it.
19281 * tests/misc.c,tests.h (mpq_set_str_or_abort): New function.
19283 * mpq/cmp_si.c: New file.
19284 * Makefile.am, mpq/Makefile.am: Add it.
19285 * gmp-h.in (mpq_cmp_si): Add prototype.
19286 * gmp.texi (Comparing Rationals): Add doco.
19288 * gmp-h.in (_GMP_H_HAVE_FILE): Add _FILE_DEFINED for microsoft, add
19289 notes on what symbols are for what systems.
19291 2001-07-06 Torbjorn Granlund <tege@swox.com>
19293 * longlong.h (ibm032 umul_ppmm): Fix typo.
19294 * longlong.h (sparclite sdiv_qrnnd): Fix typo.
19296 2001-07-03 Kevin Ryde <kevin@swox.se>
19298 * mpz/bin_ui.c (DIVIDE): Use MPN_DIVREM_OR_DIVEXACT_1.
19299 * mpz/bin_uiui.c (MULDIV): Ditto, and use local variables for size and
19302 * acinclude.m4 (GMP_INCLUDE_GMP_H): New macro, use it everywhere gmp.h
19303 is wanted at configure time.
19304 * acinclude.m4, configure.in (GMP_H_EXTERN_INLINE, GMP_H_HAVE_FILE):
19307 * gmp-h.in (__GMP_EXTERN_INLINE): Set to "inline" for C++.
19308 (mpn_add, mpn_sub): Use new style __GMP_EXTERN_INLINE.
19309 * gmp-h.in, mp-h.in, gmp-impl.h (_EXTERN_INLINE): Remove, unused.
19310 * mpn/generic/add.c, mpn/generic/sub.c: New files.
19311 * mpn/generic/inlines.c: Remove file.
19312 * configure.in, mpn/Makefile.am: Update.
19314 * gmp.texi (GMP Basics): Note the need for stdio.h to get FILE
19317 2001-07-01 Kevin Ryde <kevin@swox.se>
19319 * gmp.texi (Build Options, Reentrancy): Updates for new
19320 --enable-alloca behaviour.
19321 (Debugging): Describe --enable-alloca=debug.
19322 (Miscellaneous Integer Functions): Note mpz_sizeinbase ignores signs.
19323 (Low-level Functions): Give a formula for mpn_gcdext cofactor.
19324 (Factorial Algorithm): New section.
19325 (Binomial Coefficients Algorithm): New section.
19326 Misc tweaks elsewhere.
19328 * mpf/set_prc.c: Merge the two truncation conditionals, misc cleanups,
19329 no functional changes.
19331 * mpn/*/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Add tuned values.
19332 * gmp-impl.h (DIVEXACT_1_THRESHOLD): Make the default 0 when
19333 2*UMUL_TIME < UDIV_TIME.
19335 * mpn/x86/p6/dive_1.asm: New file.
19337 * mpn/x86/dive_1.asm: New file.
19338 * mpn/x86/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Use it always.
19340 * tests/refmpn.c, tests.h (refmpn_zero): New function.
19341 * tests/devel/try.c: Use it.
19343 * tests/refmpn.c (refmpn_sb_divrem_mn): Use refmpn_cmp, not mpn_cmp.
19345 * tests/mpf/t-get_d.c (main): Use || not |.
19347 * tests/misc.c, tests/t-modlinv.c, tests/mpq/t-get_str.c,
19348 tests/mpf/reuse.c: Add string.h.
19350 2001-06-29 Kevin Ryde <kevin@swox.se>
19352 * tune/speed.h (SPEED_ROUTINE_MPN_FIB2_UI,
19353 SPEED_ROUTINE_COUNT_ZEROS_C): Corrections to TMP block handling.
19355 * gmp-impl.h (MPN_TOOM3_MUL_N_MINSIZE, MPN_TOOM3_SQR_N_MINSIZE):
19356 Corrections to these to account for adding tD into E.
19357 (MPN_INCR_U, MPN_DECR_U) [WANT_ASSERT]: Add size
19358 assertions, since mpn_add_1 and mpn_sub_1 from gmp.h don't get them.
19359 (MPN_DIVREM_OR_DIVEXACT_1): Add an assert of no remainder.
19361 * assert.c: Add stdlib.h for abort prototype.
19362 * tests/spinner.c, trace.c, t-constants.c, t-count_zeros.c,
19363 t-gmpmax.c, t-modlinv.c: Ditto.
19364 * tests/mpz/t-bin.c, t-cmp.c, t-get_si.c, t-misc.c, t-popcount.c,
19365 t-set_str.c, t-sizeinbase.c: Ditto.
19366 * tests/mpq/t-equal.c, t-get_str.c, t-set_f.c, t-set_str.c: Ditto.
19367 * tests/mpf/t-fits.c, t-get_d.c, t-get_si.c, t-int_p.c, t-misc.c,
19369 * tests/mpbsd/allfuns.c, t-misc.c: Ditto.
19371 * mpn/generic/mul_n.c, mpz/cfdiv_r_2exp.c: Use MPN_INCR_U rather than
19374 * tests/devel/try.c (TYPE_SB_DIVREM_MN): More fixes for calling method.
19376 * mpn/x86/k6/cross.pl: More insn exceptions.
19378 2001-06-23 Kevin Ryde <kevin@swox.se>
19380 * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1) [i386]: Fix some asm output
19383 * gmp-impl.h (modlimb_invert): Mask after shifting, so mask constant
19384 fits a signed byte.
19386 * tests/devel/try.c (TYPE_SB_DIVREM_MN): Fix initial fill of quotient
19389 2001-06-20 Kevin Ryde <kevin@swox.se>
19391 * config.guess (rs6000-*-aix4* | powerpc-*-aix4*): Suppress error
19392 messages if $CC_FOR_BUILD or program don't work.
19394 * mpz/sqrt.c,sqrtrem.c: Special case for op==0, to avoid TMP_ALLOC(0).
19395 * tests/refmpf.c (refmpf_add, refmpf_sub): Avoid TMP_ALLOC(0).
19397 * tests/mpn/t-aors_1.c: New file.
19398 * tests/mpn/Makefile.am: Add it.
19400 * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1): New macros, rewrite of
19401 mpn_add_1 and mpn_sub_1, better code for src==dst and/or n==1,
19402 separate versions for gcc x86, gcc generic, and non-gcc.
19403 (mpn_add_1, mpn_sub_1): Use them.
19404 (mpn_add, mpn_sub): Ditto, to get inlines on all compilers.
19405 (extern "C") [__cplusplus]: Let this encompass the extern inlines too.
19406 * mpn/generic/add_1.c,sub_1.c: New files, force code from gmp.h.
19407 * configure.in, mpn/Makefile.am: Add them.
19409 * acinclude.m4 (GMP_ASM_LSYM_PREFIX): AC_SUBST __GMP_LSYM_PREFIX
19410 rather than AC_DEFINE LSYM_PREFIX.
19411 * gmp-h.in (__GMP_LSYM_PREFIX): New substitution.
19412 (__GMP_ASM_L): New macro.
19413 * gmp-impl.h (ASM_L): Use it.
19415 * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro.
19416 * gmp-impl.h: Use it for all the malloc based TMP_ALLOCs.
19418 * stack-alloc.h: Remove file.
19419 * tal-reent.c: New file.
19420 * Makefile.am: Update.
19422 * acinclude.m4, configure.in (GMP_OPTION_ALLOCA): New macro, add
19423 malloc-reentrant method, use stack-alloc.c as malloc-notreentrant,
19424 make "reentrant" the default.
19425 * gmp-impl.h (__TMP_ALIGN): Moved from stack-alloc.c, use a union to
19426 determine the value, and demand only 4 bytes align on 32-bit systems.
19427 * gmp-impl.h (WANT_TMP_NOTREENTRANT): Move global parts of
19428 stack-alloc.h to here, allow non power-of-2 __TMP_ALIGN in TMP_ALLOC.
19429 * gmp-impl.h: Extend extern "C" to TMP_ALLOC declarations.
19430 * stack-alloc.c (tmp_stack): Move private parts of stack-alloc.h to
19431 here, use gmp-impl.h.
19433 * gmp-impl.h (TMP_ALLOC_LIMBS_2): New macro.
19434 * mpz/fib_ui.c, mpz/jacobi.c, mpq/cmp.c, mpn/generic/fib2_ui.c: Use it.
19436 * mpfr/exp2.c: Patch by Paul to match TMP_MARK and TMP_FREE in loop.
19437 * mpfr/sqrt.c: Scope nested TMP_DECL into nested { } block, patch by
19438 Paul, tweaked by me.
19439 * mpfr/agm.c: Ditto, and add a final TMP_FREE(marker2).
19441 * gmp-h.in (mpn_cmp): Add __GMP_ATTRIBUTE_PURE.
19443 * INSTALL: Clarify "make install", tweak formatting a bit.
19445 2001-06-17 Kevin Ryde <kevin@swox.se>
19447 * configure.in, Makefile.am, gmp-impl.h: Add a debugging TMP_ALLOC,
19448 selected with --enable-alloca=debug.
19449 * tal-debug.c: New file.
19450 * configure.in, Makefile.am: Compile stack-alloc.c only for
19452 * assert.c (__gmp_assert_header): New function, split from
19455 * mpz/lcm.c: Don't TMP_MARK and then just return. Remove unnecessary
19456 _mpz_realloc prototype.
19458 * mpn/generic/mul.c (mpn_sqr_n): Use __gmp_allocate_func for toom3
19459 temporary workspace.
19461 2001-06-15 Kevin Ryde <kevin@swox.se>
19463 * tests/mpz/t-set_f.c: New file.
19464 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19466 * mpz/set_f.c: Share MPN_COPY between pad and trunc cases, do exp<=0
19467 test earlier, store SIZ(w) earlier.
19469 * tests/t-count_zeros.c: New file.
19470 * tests/t-gmpmax.c: New file.
19471 * tests/Makefile.am (check_PROGRAMS): Add them.
19473 * mp_clz_tab.c: Compile the table only if longlong.h says it's needed;
19474 add an internal-use-only comment.
19475 * tune/common.c: Force a __clz_tab for convenience when testing.
19477 * mpn/x86/pentium/gmp-mparam.h, mpn/x86/pentium/mmx/gmp-mparam.h: Add
19478 COUNT_LEADING_ZEROS_NEED_CLZ_TAB, for mod_1.asm.
19480 * longlong.h (count_leading_zeros) [pentium]: Decide to go with float
19482 (count_leading_zeros) [alpha]: Add COUNT_LEADING_ZEROS_NEED_CLZ_TAB.
19483 (__clz_tab): Provide a prototype only if it's needed.
19485 * tests/trace.c (mpz_trace): Don't use = on structures.
19486 (mpn_trace): Set _mp_alloc when creating mpz.
19488 2001-06-12 Kevin Ryde <kevin@swox.se>
19490 * mpn/x86/divrem_1.asm: Amend some comments about P5 speed.
19492 * tune/README: Clarify reconfigure on gmp-mparam.h update.
19494 * mpn/x86/p6/copyd.asm: New file.
19495 * mpn/x86/p6/README: Update copyd and mod_1.
19496 * mpn/x86/copyd.asm: Amend some comments.
19498 * gmp-impl.h (__builtin_constant_p): Add dummy for non-gcc.
19499 (mpn_incr_u, mpn_decr_u): Recognise incr==1 at compile time in the
19500 generic code on gcc.
19502 * gmp-impl.h (ASSERT_ZERO_P, ASSERT_MPN_NONZERO_P): New macros.
19503 * mpn/generic/gcd_1.c, mpn/generic/mul_fft.c: Use them.
19504 * mpz/get_d.c: Add a private mpn_zero_p.
19505 * mpfr/trunc.c: Use own mpn_zero_p.
19506 * tune/speed.h (SPEED_ROUTINE_MPN_GCD_1N): Use refmpn_zero_p.
19507 * gmp-impl.h (mpn_zero_p): Remove, no longer needed.
19509 * gmp-h.in, gmp-impl.h: Move MPN_CMP to gmp.h as __GMPN_CMP, leave an
19510 MPN_CMP alias in gmp-impl.h.
19511 * gmp-h.in (mpn_cmp): Add an inline version.
19512 * mpn/generic/cmp.c: Use __GMP_FORCE_mpn_cmp to get code from gmp.h.
19514 * acinclude.m4 (GMP_C_ATTRIBUTE_MODE): New macro.
19515 * configure.in: Call it.
19516 * gmp-impl.h (SItype etc): Use it.
19518 * randraw.c (lc): Change mpn_mul_basecase->mpn_mul,
19519 mpn_incr_u->MPN_INCR_U, abort->ASSERT_ALWAYS(0).
19521 * longlong.h (count_leading_zeros) [pentiumpro]: Work around a partial
19522 register stall on gcc < 3.
19524 * gmp.texi (Introduction to GMP): Add IA-64.
19525 (Notes for Particular Systems): i386 means generic x86.
19527 * tests/t-modlinv.c: Use tests_start and tests_end.
19529 2001-06-10 Kevin Ryde <kevin@swox.se>
19531 * gmp.texi (Number Theoretic Functions): mpz_jacobi only defined for b
19532 odd. Separate the jacobi/legendre/kronecker descriptions.
19533 (Low-level Functions): Document mpn_mul_1 "incr" overlaps.
19534 (Language Bindings): New chapter.
19536 * mpz/jacobi.c: Don't retaining old behaviour of mpz_jacobi on even b
19537 (it wasn't documented in 3.1.1).
19538 * mpz/jacobi.c, gmp-h.in (mpz_kronecker, mpz_legendre): Remove
19539 separate entrypoints, just #define to mpz_jacobi.
19540 * compat.c (__gmpz_legendre): Add compatibility entrypoint.
19542 * mpn/generic/mul_1.c: Allow "incr" style overlaps.
19543 * tests/devel/try.c (param_init): Test this.
19545 * mpf/mul_ui.c: Do size==0 test earlier.
19547 2001-06-08 Kevin Ryde <kevin@swox.se>
19549 * gmp-impl.h (ULONG_HIGHBIT, UINT_HIGHBIT, USHRT_HIGHBIT): Cast
19550 ULONG_MAX etc to unsigned long etc before attempting to right shift.
19552 * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Add an AC_DEFINE of LSYM_PREFIX.
19553 * gmp-impl.h (ASM_L): New macro.
19554 (mpn_incr_u, mpn_decr_u, MPN_INCR_U, MPN_DECR_U): Add i386 optimized
19557 * mpn/hppa/*.s,S,asm: Use .label so the code works with gas on hppa
19558 GNU/Linux too, reported by LaMont Jones <lamont@smallone.fc.hp.com>.
19559 * mpn/hppa/README: Add some notes on this.
19560 * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Ditto.
19562 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add dive_1.c,
19565 * tests/mpn/t-iord_u.c: New file.
19566 * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
19568 * configure.in (mips*-*-irix[6789]*): Make ABI=n32 the default, same
19570 * gmp.texi (ABI and ISA): Update.
19572 * gmp.texi (Build Options): Misc tweaks.
19573 (Notes for Particular Systems): Describe windows DLL handling.
19574 (Known Build Problems): DJGPP needs bash 2.04.
19575 (Number Theoretic Functions): mpz_invert returns 0<=r<modulus; add
19576 mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui.
19577 (Fibonacci Numbers Algorithm): Update for new formulas used.
19578 (Lucas Numbers Algorithm): New section.
19580 * tune/speed.c,speed.h,common.c,many.pl: Add mpn_fib2_ui, mpz_fib2_ui,
19581 mpz_lucnum_ui, mpz_lucnum2_ui.
19582 * demos/expr/exprz.c,README: Add lucnum.
19583 * demos/perl/GMP.pm,GMP.xs,GMP/Mpz.pm,test.pl: Add fib2, lucnum,
19586 * tests/mpz/t-lucnum_ui.c: New file.
19587 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19588 * tests/mpz/t-fib_ui.c: Check mpz_fib2_ui too, updates for new style
19591 * tune/tuneup.c, tune/Makefile.am, gmp-impl.h, mpn/*/gmp-mparam.h:
19592 Remove FIB_THRESHOLD, no longer required.
19594 * mpz/fib2_ui.c, mpz/lucnum_ui.c mpz/lucnum2_ui.c: New files.
19595 * Makefile.am, mpz/Makefile.am: Add them.
19596 * gmp-h.in (mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui): Add
19599 * mpn/generic/fib2_ui.c: New file.
19600 * configure.in (gmp_mpn_functions): Add it.
19601 * gmp-impl.h (mpn_fib2_ui, FIB_TABLE, etc): Add these.
19602 * mpz/fib_ui.c: Rewrite.
19604 * acinclude.m4 (GMP_C_SIZES): Fix _LONG_LONG_LIMB define for mp_limb_t
19606 (GMP_FUNC_ALLOCA): Add dummy __GMP_BITS_PER_MP_LIMB for gmp-h.in work.
19608 * configure.in (CPPFLAGS): Remove -D__GMP_WITHIN_GMP, don't want it
19610 * Makefile.am, mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am,
19611 mpf/Makefile.am, mpbsd/Makefile.am (INCLUDES): Set -D__GMP_WITHIN_GMP.
19613 * configure.in (*-*-msdosdjgpp*): Forcibly disable shared libraries,
19614 to make libtests.la work.
19616 * acconfig.h (_LONG_LONG_LIMB, HAVE_MPFR): Remove dummy defines, no
19619 * mpz/set_ui.c: Store to _mp_d[0] unconditionally.
19621 2001-05-27 Kevin Ryde <kevin@swox.se>
19623 * configure.in, gmp-h.in, mp-h.in: Add support for windows DLLs.
19625 2001-05-26 Kevin Ryde <kevin@swox.se>
19627 * gmp.texi (ABI and ISA, Reentrancy): Minor tweaks
19628 (Notes for Package Builds): Note gmp.h is a generated file.
19629 (Notes for Particular Systems): -march=pentiumpro is used for gcc
19631 (Assembler Loop Unrolling): Mention non power-of-2 unrolling.
19632 (Internals): New chapter.
19633 * mpf/README: Remove file.
19635 * demos/expr/README: Miscellaneous rewordings.
19637 * demos/perl: New directory.
19638 * demos/Makefile.am: Add it.
19639 * demos/perl/INSTALL, Makefile.PL, GMP.pm, GMP.xs, typemap,
19640 GMP/Mpz.pm, GMP/Mpq.pm, GMP/mpf.pm, GMP/Rand.pm, sample.pl, test.pl:
19643 * configure, aclocal.m4: Update to autoconf 2.50.
19645 * configure, aclocal.m4, ltmain.sh: Update to libtool 1.4.
19647 * configure, aclocal.m4, missing, ansi2knr.c, */Makefile.in: Update to
19649 * Makefile.am: Conditionalize mpfr in $(SUBDIRS) to handle mpfr.info.
19650 * mpfr/Makefile.am (INFO_DEPS): Remove previous mpfr.info handling.
19651 * mpn/Makefile.am (GENERIC_SOURCES): Remove this, just put mp_bases.c
19652 in libmpn_la_SOURCES.
19653 * tests/Makefile.am (tests.h): Move from EXTRA_HEADERS to
19654 libtests_la_SOURCES.
19655 * ltconfig: Remove file, no longer needed.
19657 * Makefile.am (gmp-impl.h, longlong.h, stack-alloc.h): Move from
19658 EXTRA_DIST to libgmp_la_SOURCES, so they get included in TAGS.
19659 * tests/rand/Makefile.am (gmpstat.h): Move to libstat_la_SOURCES
19662 * config.guess (68k-*-*): Use $SHELL not "sh", tweak some comments.
19664 * mpfr/mpfr.texi (Introduction to MPFR): Tweak table formatting, note
19665 non-free programs must be able to be re-linked.
19667 2001-05-20 Kevin Ryde <kevin@swox.se>
19669 * mpn/powerpc64/addmul_1.asm, mpn/powerpc64/mul_1.asm,
19670 mpn/powerpc64/submul_1.asm: Add carry-in entrypoints.
19672 2001-05-17 Kevin Ryde <kevin@swox.se>
19674 * gmp.texi (ge): Fix definition for info.
19675 (Notes for Particular Systems): Mention 68k dragonball and cpu32.
19676 (Efficiency): Add static linking, more about in-place operations,
19677 describe mpq+/-integer using addmul.
19678 (Reporting Bugs): A couple of words about self-contained reports.
19679 (Floating-point Functions): Note exponent limitations of mpf_get_str
19681 (Initializing Floats): Clarify mpf_get_prec, mpf_set_prec and
19682 mpf_set_prec_raw a bit.
19683 (Float Comparison): Note current mpf_eq deficiencies.
19685 * gmp-h.in (__GMP_HAVE_CONST, __GMP_HAVE_PROTOTYPES,
19686 __GMP_HAVE_TOKEN_PASTE): Merge GNU ansidecl.h tests for ANSI compilers.
19687 * demos/expr/expr-impl-h.in: Ditto.
19689 * gmp-impl.h (BITS_PER_MP_LIMB): Define from __GMP_BITS_PER_MP_LIMB if
19690 not already in gmp-mparam.h.
19691 * tests/t-constants.c (BITS_PER_MP_LIMB, __GMP_BITS_PER_MP_LIMB):
19692 Check these are the same.
19694 * gmp-h.in (mpf_get_default_prec, mpf_get_prec, mpf_set_default_prec,
19695 mpf_set_prec_raw): Provide "extern inline" versions, use __GMPF on the
19697 * mpf/get_dfl_prc.c, mpf/get_prc.c, mpf/set_dfl_prc.c,
19698 mpf/set_prc_raw.c: Get code from gmp.h using __GMP_FORCE.
19700 * gmp-h.in, gmp-impl.h (__gmp_default_fp_limb_precision): Move from
19701 gmp-impl.h to gmp-h.in.
19702 (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Ditto, and use __GMPF
19703 prefix and add a couple of casts.
19704 * gmp-h.in (__GMP_MAX): New macro.
19705 * mpf/init2.c mpf/set_prc.c: Update for __GMPF prefix.
19707 * gmp-h.in (__GMP_BITS_PER_MP_LIMB): New templated define.
19708 * acinclude.m4 (GMP_C_SIZES): Add AC_SUBST __GMP_BITS_PER_MP_LIMB,
19709 remove AC_DEFINE BITS_PER_MP_LIMB.
19711 2001-05-13 Kevin Ryde <kevin@swox.se>
19713 * gmp-h.in, gmp.texi, Makefile.am, mpz/Makefile.am, tests/mpz/t-pow.c:
19714 Remove mpz_si_pow_ui, pending full si support.
19715 * mpz/si_pow_ui.c: Remove file.
19717 2001-05-11 Kevin Ryde <kevin@swox.se>
19719 * mpn/x86/pentium/dive_1.asm: New file.
19721 * mpn/powerpc32/umul.asm: Use r on registers.
19722 * mpn/powerpc64/umul.asm: New file.
19723 * configure.in (powerpc*-*-*): Enable umul in extra_functions.
19725 * tests/refmpn.c, tests/tests.h (refmpn_umul_ppmm): Use same arguments
19726 as normal mpn_umul_ppmm.
19727 (refmpn_mul_1c): Update.
19728 * tests/devel/try.c, tune/many.pl: Add some umul_ppmm testing support.
19730 * mpn/x86/k6/mmx/popham.asm, mpn/x86/k7/mmx/popham.asm: Don't support
19732 * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm: Ditto,
19733 and shave a couple of cycles from the PIC entry code.
19735 * mpz/mul.c: Use mpn_mul_1 for size==1 and mpn_mul_2 (if available)
19736 for size==2, to avoid copying; do vsize==0 test earlier.
19738 * mpf/sub.c: Test r!=u before calling mpf_set.
19739 * mpf/add.c: Ditto, and share mpf_set between usize==0 and vsize==0.
19741 * mpn/generic/tdiv_qr.c, mpq/get_d.c, mpf/div.c, mpf/set_q.c,
19742 mpf/set_str.c, mpf/ui_div.c: Test for high bit set, not for
19743 count_leading_zeros zero.
19745 * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Print a message if extra
19748 * tests/mpz/t-mul_i.c: New file.
19749 * tests/mpz/Makefile.am: Add it.
19751 * mpz/mul_siui.c (mpz_mul_si): Fix for -0x80..00 on long long limb.
19753 * gmp-h.in (mpf_set_si, mpf_set_ui): Revert last change, set exp to 0
19755 * mpf/ceilfloor.c, mpf/trunc.c: Fix exp to 0 when setting r to 0.
19756 * gmp-impl.h (MPF_CHECK_FORMAT): Check exp==0 when size==0.
19758 2001-05-07 Kevin Ryde <kevin@swox.se>
19760 * gmp-h.in (mpf_set_si, mpf_set_ui): Don't bother setting _mp_exp to 0
19761 when n==0 (use 1 unconditionally).
19762 * tests/mpf/t-misc.c (check_mpf_set_si): Don't demand anything of
19763 _mp_exp when _mp_size is zero.
19765 * mpn/x86/README: Note gas _GLOBAL_OFFSET_TABLE_ with leal problem.
19767 * gmp-h.in (mpz_fits_uint_p, mpz_fits_ulong_p, mpz_fits_ushort_p):
19768 Provide these as "extern inline"s.
19769 (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): New macros.
19770 (mpz_popcount): Use __GMP_ULONG_MAX.
19771 * gmp-impl.h (UINT_MAX, ULONG_MAX, USHRT_MAX): Use __GMP_U*_MAX, if
19772 not already defined.
19773 * mpz/fits_u.c: Use the code from gmp.h.
19775 2001-05-06 Kevin Ryde <kevin@swox.se>
19777 * mpn/x86/k7/dive_1.asm: New file.
19778 * mpn/x86/k7/gcd_1.asm: New file.
19779 * mpn/asm-defs.m4 (m4_count_trailing_zeros): New macro.
19781 * gmp-h.in (mpz_get_ui, mpz_getlimbn, mpz_set_q, mpz_perfect_square_p,
19782 mpz_popcount, mpz_size, mpf_set_ui, mpf_set_si, mpf_size): Provide
19783 these as "extern inlines".
19784 Use just one big extern "C" block.
19785 * mpz/getlimbn.c, mpz/get_ui.c, mpz/perfsqr.c, mpz/popcount.c
19786 mpz/set_q.c, mpz/size.c, mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Use
19787 __GMP_FORCE to get code from gmp.h.
19789 2001-05-03 Kevin Ryde <kevin@swox.se>
19791 * extract-dbl.c: Add ASSERT d>=0.
19793 * gmp.texi (Efficiency): Add mpz_addmul etc for mpz+=integer, add
19794 mpz_neg etc in-place.
19795 (Integer Arithmetic): Add mpz_addmul, mpz_submul, mpz_submul_ui.
19796 (Initializing Rationals): Add mpq_set_str.
19797 (Low-level Functions): mpn_set_str requires strsize >= 1.
19799 * gmp-h.in (__GMP_EXTERN_INLINE, __GMP_ABS): New macros.
19800 (mpz_abs, mpq_abs, mpf_abs, mpz_neg, mpq_neg, mpf_neg): Provide inline
19802 * mpz/abs.c, mpq/abs.c, mpf/abs.c, mpz/neg.c, mpq/neg.c, mpf/neg.c:
19803 Add suitable __GMP_FORCE to turn off inline versions.
19805 * tests/mpz/t-aorsmul.c,t-cmp_d.c,t-popcount,t-set_str.c: New files.
19806 * tests/mpz/Makefile.am: Add them.
19808 * mpz/aorsmul_i.c: New file, rewrite of addmul_ui.c. Add
19809 mpz_submul_ui entrypoint, share more code between some of the
19810 conditionals, use mpn_mul_1c if available.
19811 * mpz/addmul_ui.c: Remove file.
19812 * mpz/aorsmul.c: New file.
19813 * Makefile.am, mpz/Makefile.am: Update.
19814 * gmp-h.in (mpz_addmul, mpz_submul, mpz_submul_ui): Add prototypes.
19815 * gmp-impl.h (mpz_aorsmul_1): Add prototype.
19817 * tests/mpq/t-set_str.c: New file.
19818 * tests/mpq/Makefile.am: Add it.
19820 * mpq/set_str.c: New file.
19821 * Makefile.am, mpq/Makefile.am: Add it.
19822 * gmp-h.in (mpq_set_str): Add prototype.
19824 * mpz/set_str.c: Fix for trailing white space on zero, eg. "0 ".
19825 * mpn/generic/set_str.c: Add ASSERT str_len >= 1.
19827 * gmp-h.in, gmp-impl.h (mpn_incr_u, mpn_decr_u): Move to gmp-impl.h.
19828 * gmp-impl.h (MPN_INCR_U, MPN_DECR_U): New macros.
19830 2001-04-30 Kevin Ryde <kevin@swox.se>
19832 * tests/mpz/t-lcm.c: New file.
19833 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19835 * mpz/lcm.c: Add one limb special case.
19837 * mpz/lcm_ui.c: New file.
19838 * Makefile.am, mpz/Makefile.am: Add it.
19839 * gmp-h.in (mpz_lcm_ui): Add prototype.
19840 * gmp.texi (Number Theoretic Functions): Add mpz_lcm_ui, document lcm
19841 now always positive.
19843 * mp-h.in (mp_size_t, mp_exp_t): Fix typedefs to match gmp-h.in.
19845 * gmp-h.in (mpn_add_1, mpn_add, mpn_sub_1, mpn_sub): Remove K&R
19846 function defines (ansi2knr will handle mpn/inline.c, and just ansi is
19847 enough for gcc extern inline).
19849 * gmp-h.in (__GMP_HAVE_TOKEN_PASTE): New macro.
19851 * gmp-impl.h (CNST_LIMB): Ditto.
19853 * gmp-h.in, mp-h.in (__gmp_const, __gmp_signed, _PROTO, __MPN): Use
19854 ANSI forms on Microsoft C.
19855 (__GMP_HAVE_CONST): New define.
19856 * gmp-impl.h (const, signed): Use it.
19858 * demos/expr/expr-impl-h.in (<stdarg.h>): Use this with Microsoft C.
19859 (HAVE_STDARG): New define.
19860 * demos/expr/expr.c,exprz.c,exprq.c,exprf.c,exprfr.c: Use it.
19862 * acinclude.m4 (GMP_C_STDARG): New macro.
19863 * configure.in: Call it.
19866 * configure.in (AC_PROG_CC_STDC): New test.
19868 2001-04-25 Kevin Ryde <kevin@swox.se>
19870 * mpn/x86/k6/mmx/dive_1.asm: New file.
19871 * mpn/x86/x86-defs.m4 (Zdisp): Two more insns.
19873 * mpn/x86/pentium/mul_2.asm: New file.
19874 * mpn/asm-defs.m4: Add define_mpn(mul_2).
19875 * acconfig.h (HAVE_NATIVE_mpn_divexact_1, mul_2): Add templates.
19877 * configure.in (ABI): Use AC_ARG_VAR.
19879 * tests/devel/try.c: Run reference function when validate fails.
19881 * mpq/get_str.c: Fixes for negative bases.
19882 * tests/mpq/t-get_str.c: Check negative bases.
19883 * tests/misc.c,tests.h (__gmp_allocate_strdup, strtoupper): New
19886 2001-04-24 Torbjorn Granlund <tege@swox.com>
19888 * mpz/lcm.c (mpz_lcm): Make result always positive.
19890 * gmp-h.in (mpz_inp_binary, mpz_out_binary): Remove declarations.
19892 2001-04-22 Kevin Ryde <kevin@swox.se>
19894 * mpn/powerpc64/addsub_n.asm: Use config.m4 not asm-syntax.m4.
19896 * mpz/cmp_d.c, mpz/cmpabs_d.c: New files.
19897 * Makefile.am, mpz/Makefile.am: Add them.
19898 * mpf/cmp_d.c, mpf/get_dfl_prec.c: New files.
19899 * Makefile.am, mpf/Makefile.am: Add them.
19900 * gmp-h.in (mpz_cmp_d, mpz_cmpabs_d, mpf_cmp_d, mpf_get_default_prec):
19902 * gmp.texi: Add documentation.
19904 * mpf/set_prc.c: Avoid a realloc call if already the right precision.
19906 * gmp-impl.h (MPF_BITS_TO_PREC, MPF_PREC_TO_BITS): New macros.
19907 * mpf/get_prc.c, init2.c, set_dfl_prec.c, set_prc.c, set_prc_raw.c:
19910 2001-04-20 Kevin Ryde <kevin@swox.se>
19912 * tests/devel/try.c: Don't test size==0 on mpn_popcount and
19913 mpn_hamdist; add testing for mpn_divexact_1; print some limb values
19914 with mpn_trace not printf.
19916 * mpz/popcount.c, mpz/hamdist.c: Don't pass size==0 to mpn_popcount
19918 * mpn/generic/popham.c: Don't support size==0.
19920 * config.guess (m68k-*-*): Detect m68010, return m68360 for cpu32,
19921 cleanup the nesting a bit.
19923 * gmp.texi (Integer Division): Fix mpz_congruent_2exp_p "c" type.
19924 (Integer Division): Add mpz_divexact_ui.
19925 (Number Theoretic Functions): Fix mpz_nextprime return type.
19926 (Exact Remainder): Divisibility tests now implemented.
19927 And more index entries in a few places.
19929 * tests/mpz/dive_ui.c: New file.
19930 * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19932 * mpz/dive_ui.c: New file.
19933 * Makefile.am, mpz/Makefile.am: Add it.
19934 * gmp-h.in (mpz_divexact_ui): Add prototype.
19936 * tune/many.pl, tune/speed.h: Add special mpn_back_to_back for
19939 * gmp-impl.h (MPN_DIVREM_OR_DIVEXACT_1): New macro.
19940 * mpz/divexact.c: Use it.
19942 * gmp-impl.h (DIVEXACT_1_THRESHOLD): New threshold.
19943 * tune/tuneup.c: Tune it.
19945 * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
19946 mpn_divexact_1, mpn_copyi, mpn_copyd.
19948 * mpn/generic/dive_1.c: New file.
19949 * configure.in (gmp_mpn_functions): Add it.
19950 * gmp-impl.h (mpn_divexact_1): Add prototype.
19951 * mpn/asm-defs.m4: Add define_mpn(divexact_1).
19953 * tests/mpn: New directory.
19954 * tests/Makefile.am: Add it.
19955 * tests/mpn/Makefile.am: New file.
19956 * configure.in (AC_OUTPUT): Add it.
19957 * tests/mpn/t-asmtype.c: New file.
19959 * configure, config.in: Update to autoconf 2.49d.
19961 * configure.in, gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Revert
19962 to generating gmp.h, mp.h and expr-impl.h with AC_OUTPUT and AC_SUBST.
19964 * configure.in (m68*-*-*): Oops, m683?2 is 68000, m68360 is cpu32.
19965 * mpn/m68k/m68k-defs.m4 (scale_available_p): Ditto.
19967 * configure.in (underscore, asm_align): Remove these variables, unused.
19968 (GMP_ASM_*): Sort by AC_REQUIREs, to avoid duplication.
19969 * acinclude.m4 (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_LOG): Remove support
19970 for actions, no longer needed.
19972 2001-04-17 Kevin Ryde <kevin@swox.se>
19974 * config.guess (m68k-*-*): Look for cpu in linux kernel /proc/cpuinfo.
19976 * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): The -mpentiumpro problem is
19977 fixed in 2.95.4, so test for that.
19978 (GMP_ASM_TYPE): Amend some comments.
19980 * tune/freq.c (speed_cpu_frequency_sysctl): Avoid having unused
19981 variables on GNU/Linux.
19983 * mpn/asm-defs.m4 (m4_instruction_wrapper): Fix a quoting problem if
19984 the name of the file is a macro.
19986 2001-04-15 Kevin Ryde <kevin@swox.se>
19988 * mpn/powerpc64/*.asm: Add speeds on ppc630.
19990 * acconfig.h: Add dummy templates for _LONG_LONG_LIMB and HAVE_MPFR.
19991 * configure.in: Ensure config.in is the last AM_CONFIG_HEADER,
19992 which autoheader requires.
19994 * mpn/x86/pentium/popcount.asm: New file.
19995 * mpn/x86/pentium/hamdist.asm: New file.
19997 * mpn/asm-defs.m4: (m4_popcount): New macro.
19998 Amend a few comments elsewhere.
20000 * acinclude.m4 (GMP_ASM_RODATA): If possible, grep compiler output for
20001 the right directive.
20003 * tune/speed.c: Print clock speed in MHz, not cycle time.
20005 * configure.in (AC_CHECK_HEADERS): Check for sys/processor.h.
20006 * tune/freq.c (speed_cpu_frequency_processor_info): Require
20007 <sys/processor.h> to exist, to differentiate the different
20008 processor_info on Darwin.
20009 (speed_cpu_frequency_sysctlbyname): Remove hw.model test which is in
20010 speed_cpu_frequency_sysctl.
20011 (speed_cpu_frequency_sysctl): Add hw.cpufrequency for Darwin.
20013 * gmp-impl.h (MPN_LOGOPS_N_INLINE, mpn_and_n ... mpn_xnor_n): Use a
20014 single expression argument for the different operations, necessary for
20015 the Darwin "smart" preprocessor.
20017 * mpn/m68k/t-m68k-defs.pl: Allow white space in m4_definsn and
20020 * tune/many.pl: Change RM_TMP_S to RM_TMP to match mpn/Makeasm.am,
20021 avoid a possibly undefined array in a diagnostic, add more renaming to
20024 2001-04-13 Kevin Ryde <kevin@swox.se>
20026 * ltmain.sh, aclocal.m4, configure, config.in: Update to libtool 1.3d.
20027 * configure.in: Change ac_ to lt_ in lt_cv_archive_cmds_need_lc and
20030 * config.guess (m68*-*-*): Detect exact cpu with BSD sysctl hw.model,
20031 detect 68000/68010 with trapf, detect 68302 with bfffo.
20033 2001-04-11 Kevin Ryde <kevin@swox.se>
20035 * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_ADDRESSING,
20036 GMP_ASM_M68K_BRANCHES): New macros.
20037 * configure.in: Use them, remove old 68k configs, use mc68020 udiv and
20040 * mpn/m68k/m68k-defs.m4: New file.
20041 * mpn/m68k/t-m68k-defs.pl: New file.
20042 * mpn/m68k/*.asm: New files, converted from .S. Merge add_n and sub_n
20043 to aors_n, ditto mc68020 addmul_1 and submul_1 to aorsmul_1. No
20044 object code changes (except .type and .size now used on NetBSD 1.4).
20045 * mpn/m68k/README: New file.
20046 * mpn/m68k/*.S, */*.S, syntax.h: Remove files.
20048 * configure.in (m68*-*-netbsd1.4*): Pretend getrusage doesn't exist.
20049 * tune/README: Update.
20051 * configure.in (powerpc*-*-*): For the benefit of Darwin 1.3, add cc
20052 to cclist, make gcc_cflags -Wa,-mppc optional.
20054 2001-04-06 Kevin Ryde <kevin@swox.se>
20056 * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add | for 68k.
20057 (gmpasm-mode-syntax-table): Add to comments.
20059 * tests/mpz/reuse.c (dsi_div_func_names): Add names for cdiv_[qr]_2exp.
20061 2001-04-04 Kevin Ryde <kevin@swox.se>
20063 * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): Fix test so as to actually
20064 detect the problem, add notes on m68k netbsd 1.4.1.
20066 * gmp.texi (Compatibility with older versions): Note libmp
20069 2001-04-03 Kevin Ryde <kevin@swox.se>
20071 * tests/mpz/reuse.c: Add mpz_cdiv_q_2exp and mpz_cdiv_r_2exp.
20073 * tests/mpz/t-pow.c: Drag in refmpn.o when testing mpz_pow_ui etc with
20076 * tune/speed.c,speed.h,common.c,many.pl: Add measuring of mpn_com_n
20078 * tests/devel/try.c: Add testing of mpn_mul_2, and a
20079 DATA_MULTIPLE_DIVISOR attribute.
20081 * gmp.texi (Build Options): List more m68k's.
20082 (Build Options): Add cross reference to tex2html.
20083 (Notes for Particular Systems): Add m68k means 68020 or up.
20084 (Rational Conversions): New section, with mpq_get_d, mpq_set_d and
20085 mpq_set_f from Miscellaneous, and new mpq_set_str.
20086 (Applying Integer Functions): Move mpq_get_num, mpq_get_den,
20087 mpq_set_num and mpq_set_den from Misc.
20088 (Miscellaneous Rational Functions): Remove section.
20089 (Custom Allocation): Partial rewrite for various clarifications.
20090 (References): Improve line breaks near URLs.
20092 * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): New macro.
20093 * configure.in (m68*-*-*): Use it to run gcc 2.95.x at -O not -O2.
20094 (m680?0-*-*, m683?2-*-*, m68360-*-*): Add optional gcc -m options.
20096 * tests/mpz/t-cmp.c: New file.
20097 * tests/mpz/t-sizeinbase.c: New file.
20098 * tests/mpz/Makefile.am: Add them.
20100 * gmp-impl.h (MPN_CMP): New macro.
20101 * mpz/cmp.c,cmpabs.c: Use it, and minor cleanups too.
20103 * tests/mpq/t-equal.c: New file.
20104 * tests/mpq/t-get_str.c: New file.
20105 * tests/mpq/Makefile.am: Add them.
20107 * mpq/get_str.c: New file.
20108 * Makefile.am, mpq/Makefile.am: Add it.
20109 * gmp-h.in (mpq_get_str): Add prototype.
20111 * mpq/equal.c: Rewrite using inline compare loops.
20113 * tests/refmpn.c,tests.h (refmpn_mul_2): Fix parameter order.
20114 * mpz/n_pow_ui.c: Fix mpn_mul_2 calls parameter order.
20116 2001-03-29 Kevin Ryde <kevin@swox.se>
20118 * tests/mpf/t-trunc.c: New file.
20119 * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
20120 * gmp-impl.h (MPF_CHECK_FORMAT): New macro.
20122 * mpf/trunc.c: New file, rewrite of integer.c, preserve prec+1 in
20123 copy, don't copy if unnecessary.
20124 * mpf/ceilfloor.c: New file likewise, and use common subroutine for
20126 * mpf/integer.c: Remove file.
20127 * Makefile.am, mpf/Makefile.am, macos/Makefile.in: Update.
20129 * acinclude.m4 (GMP_GCC_VERSION_GE): New macro.
20130 (GMP_GCC_MARCH_PENTIUMPRO): Use it, remove CCBASE parameter (don't
20131 bother checking it's gcc).
20132 (GMP_GCC_ARM_UMODSI): New macro.
20133 * configure.in (GMP_GCC_MARCH_PENTIUMPRO): Update parameters.
20134 (arm*-*-*): Use GMP_GCC_ARM_UMODSI.
20135 * gmp.texi (Notes for Particular Systems): Add arm gcc requirements.
20137 2001-03-28 Kevin Ryde <kevin@swox.se>
20139 * gmp.texi (Converting Integers): Document mpz_getlimbn using absolute
20140 value and giving zero for N out of range, move to end of section.
20142 * tests/refmpn.c (refmpn_tdiv_qr): Use refmpn_divmod_1 rather than
20144 * tests/tests.h: Add some prototypes that were missing.
20146 * mpz/tdiv_q_ui.c: Remove a comment that belonged to mpz_tdiv_r_ui.
20148 2001-03-26 Torbjorn Granlund <tege@swox.com>
20150 * mpn/generic/gcdext.c: Handle carry overflow after m*n multiply code
20151 in both arms. Partially combine multiply arms.
20153 2001-03-24 Kevin Ryde <kevin@swox.se>
20155 * longlong.h: Add comments to P5 count_leading_zeros.
20157 * demos/expr/exprz.c,t-expr.c,README: Add congruent_p and divisible_p.
20159 2001-03-23 Kevin Ryde <kevin@swox.se>
20161 * gmp.texi (GMPceil, GMPfloor, ge, le): New macros.
20162 (Integer Division, mpn_cmp, mpn_sqrtrem, Algorithms): Use them.
20163 (mpn_bdivmod): Refer to mp_bits_per_limb, not BITS_PER_MP_LIMB, and
20164 improve formatting a bit.
20165 (mpn_lshift, mpn_rshift): Clarify the return values, and use {rp,n}
20166 for the destination.
20167 Miscellaneous minor rewordings in a few places.
20169 * mpn/arm/arm-defs.m4: New file.
20170 * configure.in (arm*-*-*): Use it.
20171 * mpn/arm/*.asm: Use changecom and registers from arm-defs.m4, use L()
20174 * mpn/x86/k6/mmx/com_n.asm: Relax code alignment (same speed).
20176 * gmp-h.in (__GMP_ATTRIBUTE_PURE): Use __pure__ to avoid application
20179 * gmp-impl.h (ABS): Add parens around argument.
20181 2001-03-20 Kevin Ryde <kevin@swox.se>
20183 * acinclude.m4 (GMP_PROG_M4): Use AC_ARG_VAR on $M4.
20185 * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): New macro.
20186 * configure.in: Use it.
20187 * mpn/asm-defs.m4: Ditto.
20189 2001-03-18 Kevin Ryde <kevin@swox.se>
20191 * mpn/x86/pentium/logops_n.asm: New file.
20193 * mpn/x86/k6/k62mmx/copyd.asm: Rewrite, smaller and simpler, faster on
20194 small sizes, slower on big sizes (about half the time).
20195 * mpn/x86/k6/k62mmx/copyi.asm: Remove file, in favour of generic x86.
20196 * mpn/x86/copyi.asm: Add some comments.
20197 * mpn/x86/k6/README: Update.
20199 * mpn/x86/k6/gcd_1.asm: New file.
20201 * gmp-impl.h (NEG_MOD): Fix type of __dnorm.
20203 * acinclude.m4 (GMP_C_SIZES): Fix use of __GMP_WITHIN_CONFIGURE.
20205 2001-03-15 Kevin Ryde <kevin@swox.se>
20207 * gmp.texi (GMPabs): New macro.
20208 (Float Comparison - mpf_reldiff): Use it.
20209 (Integer Comparisons - mpz_cmpabs): Ditto, puts "abs" in info.
20210 (Reentrancy): Update notes on old random functions.
20211 (Karatsuba Multiplication): Better characterize the effect of basecase
20212 speedups on the thresholds, pointed out by Torbjorn.
20214 * tune/README: Notes on the 1x1 div threshold for mpn_gcd_1.
20216 * tests/misc.c (mpz_pow2abs_p, mpz_flipbit, mpz_errandomb,
20217 mpz_errandomb_nonzero, mpz_negrandom): New functions.
20218 (mpz_erandomb, mpz_erandomb_nonzero): Use urandom().
20219 * tests/spinner.c (spinner_wanted, spinner_tick): Make global.
20220 * tests/tests.h: Update prototypes.
20222 * tests/mpz/t-cong.c, tests/mpz/t-cong_2exp.c: New files.
20223 * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
20225 * mpz/cong.c, mpz/cong_2exp.c, mpz/cong_ui.c: New files.
20226 * Makefile.am, mpz/Makefile.am: Add them.
20227 * gmp-impl.h (NEG_MOD): New macro.
20228 * gmp-h.in (mpz_congruent_p, mpz_congruent_2exp_p,
20229 mpz_congruent_ui_p): Add prototypes.
20230 * gmp.texi (Integer Division, Efficiency): Add documentation.
20232 * mpq/aors.c: No need for ABS on denominator sizes.
20234 * gmp-impl.h (mpn_divisible_p): Use __MPN.
20236 * gmp-impl.h (LOW_ZEROS_MASK): New macro.
20237 * mpz/divis_ui.c, mpn/generic/divis.c: Use it.
20239 * mpz/setbit.c: Fix normalization for case of a negative ending up
20240 with a zero high limb.
20241 * tests/mpz/bit.c (check_single): New test for this problem.
20243 * configure.in (none-*-*): Fix cclist for default ABI=long.
20245 2001-03-10 Kevin Ryde <kevin@swox.se>
20247 * mpz/cfdiv_q_2exp.c: Don't scan for non-zero limbs if they don't
20248 matter to the rounding.
20250 * mpz/get_ui.c: Fetch _mp_d[0] unconditionally, so the code can come
20253 2001-03-08 Kevin Ryde <kevin@swox.se>
20255 * tests/devel/try.c (param_init): Fix reference functions for and_n
20258 * tune/speed.c, tests/devel/try.c: Seed RANDS, not srandom etc.
20259 * configure.in (AC_CHECK_FUNCS): Remove srand48 and srandom.
20260 * macos/configure (coptions): Remove random/srandom, now unnecessary.
20262 * configure.in (gmp.h, mp.h, demos/expr/expr-impl.h): Generate using
20264 (_LONG_LONG_LIMB, HAVE_MPFR): Change to AC_DEFINEs.
20265 * gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Change to #undef's.
20266 * acinclude.m4 (GMP_FUNC_ALLOCA, GMP_C_SIZES): Use gmp-h.in, not gmp.h.
20267 * Makefile.am (EXTRA_DIST): Remove gmp-h.in and mp-h.in, now done
20269 * acinclude.m4 (GMP_FUNC_ALLOCA), gmp-impl.h: Set and use
20270 __GMP_WITHIN_CONFIGURE rather than GMP_FUNC_ALLOCA_TEST.
20272 * mpf/random2.c: Use _gmp_rand and RANDS instead of random() for the
20273 exponent, ensures full range of values too.
20275 * tests/mpz/t-div_2exp.c (check_various): Start with d based on i, but
20276 don't let it go negative.
20278 * tune/tuneup.c (KARATSUBA_MUL_THRESHOLD): Limit probing to
20279 TOOM3_MUL_THRESHOLD_LIMIT, the size of the workspace in mul_n.c.
20280 Use a -1 with this too, so size<LIMIT not <=.
20282 2001-03-07 Torbjorn Granlund <tege@swox.com>
20284 * mpn/cray/cfp/mul_1.c: Don't call mpn_add_n with size 0.
20285 * mpn/cray/cfp/addmul_1.c: Likewise.
20286 * mpn/cray/cfp/submul_1.c: Don't call mpn_sub_n with size 0.
20288 * tests/mpz/t-div_2exp.c (check_various): Start 2nd d loop from 0
20289 (avoid problems with Cray compilers).
20291 2001-03-06 Torbjorn Granlund <tege@swox.com>
20293 * mpn/cray/ieee/submul_1.c: Don't call mpn_sub_n with size 0.
20295 * mpn/cray/ieee/mul_basecase.c: New file.
20296 * mpn/cray/ieee/sqr_basecase.c: New file, derived from mul_basecase.c.
20298 2001-03-06 Kevin Ryde <kevin@swox.se>
20300 * tests/devel/try.c (pointer_setup): Allow dst_size == SIZE_SIZE2 for
20301 the benefit of mpn_tdiv_qr.
20303 * tune/tuneup.c (all): Start karatsuba probing at size==4, for the
20304 benefit of cray t90 ieee which has speed oddities at size==2.
20306 * gmp-impl.h (USE_LEADING_REGPARM): Use __GMP_GNUC_PREREQ.
20307 Use __GMP_ATTRIBUTE_PURE and ATTRIBUTE_CONST in a few places.
20309 * gmp-h.in (__GMP_GNUC_PREREQ) New macro.
20310 (__GMP_ATTRIBUTE_PURE): New macro, use it in many places.
20312 * gmp-impl.h, gmp-h.in (mpn_jacobi_base): Move prototype to
20313 gmp-impl.h, use ATTRIBUTE_CONST.
20315 * tune/speed.h (speed_cyclecounter): Inline asm version for i386.
20317 * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Only reread "up" after second
20318 realloc, first is under w!=u.
20320 2001-03-05 Torbjorn Granlund <tege@swox.com>
20322 * mpn/cray/sub_n.c: Rewrite using `majority' logic.
20324 * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Reread `up' after realloc of w.
20326 * mpn/cray/ieee/mul_1.c: Rewrite. Streamline multiplications;
20327 use `majority' logic.
20328 * mpn/cray/ieee/addmul_1.c: Likewise.
20330 * mpn/cray/add_n.c: Rewrite using `majority' logic.
20332 2001-03-04 Torbjorn Granlund <tege@swox.com>
20334 * longlong.h (CRAY udiv_qrnnd): No longer conditional on CRAYMPP.
20335 (64-bit hppa add_ssaaaa): New.
20336 (64-bit hppa sub_ddmmss): New.
20338 * mpn/cray/ieee/invert_limb.c: New file.
20340 * gmp-impl.h (RANDS): Add a `,0' to make it compile on more compilers.
20342 2001-03-03 Kevin Ryde <kevin@swox.se>
20344 * mpz/n_pow_ui.c (ULONG_PARITY): Move to gmp-impl.h.
20345 * gmp-impl.h (ULONG_PARITY): i386 part from n_pow_ui.c, new generic
20348 * tests/mpz/t-div_2exp.c: New file, rewrite of t-2exp.c.
20349 * tests/mpz/t-2exp.c: Remove file.
20350 * tests/mpz/Makefile.am (check_PROGRAMS): Update.
20352 * gmp-h.in (mpz_cdiv_q_2exp, mpz_cdiv_q_2exp): Add prototypes.
20353 * gmp.texi (Integer Division): Add mpz_cdiv_q_2exp and mpz_cdiv_q_2exp.
20355 * mpz/cfdiv_q_2exp.c: New file, partial rewrite of fdiv_q_2exp.c, add
20356 mpz_cdiv_q_2exp entrypoint.
20357 * mpz/cfdiv_r_2exp.c: New file, rewrite of fdiv_r_2exp.c, use all mpn,
20358 add mpz_cdiv_r_2exp entrypoint.
20359 * mpz/fdiv_q_2exp.c, mpz/fdiv_r_2exp.c: Remove files.
20360 * mpz/Makefile.am (libmpz_la_SOURCES): Update.
20361 * Makefile.am (MPZ_OBJECTS): Ditto.
20363 * gmp-impl.h (USE_LEADING_REGPARM): Use __i386__ same as longlong.h
20364 (REGPARM_2_1, REGPARM_3_1, REGPARM_ATTR): New macros.
20365 * mpz/jacobi.c (jac_or_kron): Use them.
20367 * configure.in (HAVE_ABI_$ABI): Re-enable this for config.m4, with
20368 dots changed to underscores (necessary for hppa).
20370 * tests/mpz/t-divis.c, tests/mpz/t-divis_2exp.c: New files.
20371 * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
20373 * gmp-h.in (mpz_divisible_p, mpz_divisible_ui_p,
20374 mpz_divisible_2exp_p): Add prototypes.
20375 * gmp.texi (Integer Division): Add mpz_divisible_p.
20376 (Efficiency): Add remarks about divisibility testing.
20378 * mpz/divis.c, mpz/divis_ui.c, mpz/divis_2exp.c: New files.
20379 * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
20380 * Makefile.am (MPZ_OBJECTS): Ditto.
20382 * mpn/generic/divis.c: New file.
20383 * configure.in (gmp_mpn_functions): Add it.
20384 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Ditto.
20385 * gmp-impl.h (mpn_divisible_p): Add prototype.
20387 * urandom.h: Remove file.
20388 * Makefile.am (EXTRA_DIST): Remove it.
20390 * tests/mpz/convert.c, dive.c, io.c, logic.c, reuse.c, t-2exp.c,
20391 t-fdiv.c, t-fdiv_ui.c, t-gcd.c, t-jac.c, t-mul.c, t-pow.c,
20392 t-powm.c, t-powm_ui.c, t-root.c, t-sqrtrem.c, t-tdiv.c,
20393 t-tdiv_ui.c: Use RANDS, initialized by tests_rand_start.
20395 * tests/mpz/t-pow.c: New file, being t-pow_ui renamed and with some
20396 further tests added.
20397 * tests/mpz/t-pow_ui.c: Remove file.
20398 * tests/mpz/Makefile.am (check_PROGRAMS): Update.
20400 * tests/t-modlinv.c: Don't use urandom.h.
20401 * tests/mpz/bit.c, tests/mpz/t-scan.c: Ditto.
20402 * tests/mpq/t-cmp.c, tests/mpq/t-cmp_ui.c, tests/mpq/t-get_d.c: Ditto.
20403 * tests/mpf/reuse.c, t-add.c, t-conv.c, t-dm2exp.c, t-muldiv.c,
20404 t-sqrt.c, t-sub.c: Ditto.
20406 * tests/misc.c (tests_rand_start, tests_rand_end): New functions.
20407 (tests_start, tests_end): Use them.
20408 (urandom): New function.
20409 * tests/tests.h: Add prototypes.
20411 * mpz/random.c: Rewrite using mpz_urandomb and RANDS.
20412 * mpn/generic/random.c: Rewrite using _gmp_rand and RANDS.
20413 * mpn/generic/random2.c: Use RANDS not random() etc.
20415 * gmp-impl.h (__gmp_rands, __gmp_rands_initialized): Add externs.
20416 (gmp_randstate_ptr): New typedef.
20417 (RANDS, RANDS_CLEAR): New macros.
20419 * rands.c: New file.
20420 * Makefile.am (libgmp_la_SOURCES): Add it.
20422 * configure.in (mpn_objs_in_libmp): New AC_SUBST.
20423 * Makefile.am (libmp_la_DEPENDENCIES): Use it.
20425 2001-03-02 Torbjorn Granlund <tege@swox.com>
20427 * mpn/pa64/udiv_qrnnd.asm: New file.
20429 2001-03-01 Kevin Ryde <kevin@swox.se>
20431 * mpbsd/rpow.c: New file.
20432 * mpbsd/Makefile.am (libmpbsd_la_SOURCES): Add it
20433 (nodist_libmpbsd_la_SOURCES): Remove pow_ui.c.
20434 * Makefile.am (MPBSD_OBJECTS): Add rpow.lo, remove pow_ui.lo.
20435 (libmp_la_DEPENDENCIES): Add mpz/n_pow_ui.lo.
20437 * mpz/ui_pow_ui.c: Rewrite using mpz_n_pow_ui.
20438 * mpz/pow_ui.c: Ditto, and no longer provide rpow for mpbsd.
20440 * mpz/n_pow_ui.c: New file, rewrite of pow_ui.c and ui_pow_ui.c. Use
20441 less temporary memory, strip factors of 2 from the base, use mpn_mul_2
20443 * mpz/si_pow_ui.c: New file.
20444 * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
20445 * Makefile.am (MPZ_OBJECTS): Ditto.
20446 * gmp-impl.h (mpz_n_pow_ui): Add prototype.
20447 * gmp-h.in (mpz_si_pow_ui): Add prototype.
20448 * gmp.texi (Integer Exponentiation): Add mpz_si_pow_ui.
20450 * acinclude.m4 (GMP_C_SIZES): Add BITS_PER_ULONG.
20451 Correction to mp_limb_t working check.
20452 * configure.in (limb_chosen): New variable.
20453 * tests/t-constants.c (BITS_PER_ULONG): Check this value.
20454 Add some reminders about tests that fail on Cray.
20456 * tests/refmpn.c (refmpn_mul_2): New function.
20457 * tests/refmpz.c (refmpz_pow_ui): Copied from tests/mpz/t-pow_ui.c
20458 * tests/tests.h: Add prototypes.
20460 * configure.in (none-*-*): Add ABI=longlong.
20461 * doc/configuration (Long long limb testing): Describe it.
20463 * gmp.texi (Low-level Functions): Move some commented out remarks ...
20464 * mpn/generic/mul_basecase.c: ... to here.
20466 * mpn/x86/README: Note "%=" as an alternative to "1:" in __asm__.
20468 * tests/trace.c (mp_trace_start): Print "bin" for binary.
20470 * mpn/generic/dump.c: Add a couple of casts to keep gcc quiet.
20472 * gmp-h.in (mpn_incr_u, mpn_decr_u): Add parens around arguments.
20474 * mpbsd/mout.c, mpbsd/mtox.c (num_to_text): Remove unused variable.
20476 * mpfr/set_d.c (mpfr_get_d2): Declare "q" for 64-bit limbs.
20478 2001-02-28 Torbjorn Granlund <tege@swox.com>
20480 * mpn/pa64w/udiv_qrnnd.asm: Tune.
20482 2001-02-27 Torbjorn Granlund <tege@swox.com>
20484 * mpn/pa64w/udiv_qrnnd.asm: New file.
20486 2001-02-26 Torbjorn Granlund <tege@swox.com>
20488 * longlong.h (arm): Optimize sub_ddmmss by testing for constant
20490 * mpn/arm/invert_limb.asm: New file.
20492 2001-02-24 Torbjorn Granlund <tege@swox.com>
20494 * mpn/generic/lshift.c: Rewrite.
20495 * mpn/generic/rshift.c: Rewrite.
20497 * longlong.h: Use UWtype for external interfaces that expect mp_limb_t.
20499 * longlong.h (arm): #define invert_limb.
20501 * mpn/arm: Make labels have local scope.
20503 * configure.in (arm*-*-*): Set extra_functions.
20504 * longlong.h (arm): #define udiv_qrnnd.
20505 * mpn/arm/udiv.asm: New file.
20507 2001-02-24 Kevin Ryde <kevin@swox.se>
20509 * tune/many.pl: Add mpn_count_leading_zeros, mpn_count_trailing_zeros
20510 and mpn_invert_limb. Add count_leading_zeros, count_trailing_zeros
20511 from a .h file. Correction to modexact_1_odd prototype. Support
20513 * tune/speed.h, tune/common.c: Consequent changes.
20515 * demos/expr/*: Make a few more functions available in expressions,
20516 create only libexpr.a, misc minor updates.
20518 * mpn/Makeasm.am: Add some comments about suffix ordering.
20520 * tests/refmpn.c (rshift_make, lshift_make): No need to compare
20523 * mpq/mul.c: Detect and optimize squaring.
20525 2001-02-23 Torbjorn Granlund <tege@swox.com>
20527 * mpn/mips3: Convert files to `.asm'.
20529 * mpn/arm: Convert files to `.asm'. Misc cleanups.
20530 * mpn/arm/submul_1.asm: New file.
20532 2001-02-21 Kevin Ryde <kevin@swox.se>
20534 * tune/tuneup.c (all): Only one compiler print should match, no need
20535 for #undef PRINTED_COMPILER.
20537 * mpfr/mpfr.h (mpfr_sgn): Use mpfr_cmp_ui (patch from Paul).
20539 * mpz/fib_ui.c: Update some remarks about alternative algorithms.
20540 * gmp.texi (Fibonacci Numbers Algorithm): Ditto.
20541 (Assigning Floats): Clarify mpf_swap swaps the precisions too.
20542 (Low-level Functions): Try to be clearer about negative cofactors.
20544 2001-02-21 Torbjorn Granlund <tege@swox.com>
20546 * mpn/sparc64/copyi.asm: Streamline for small operands.
20547 * mpn/sparc64/add_n.asm: Likewise.
20548 * mpn/sparc64/sub_n.asm: Likewise.
20550 * mpn/sparc64/copyd.asm: New file.
20552 2001-02-20 Torbjorn Granlund <tege@swox.com>
20554 * mpn/sparc64/lshift.asm: Rewrite.
20555 * mpn/sparc64/rshift.asm: Rewrite.
20557 2001-02-19 Torbjorn Granlund <tege@swox.com>
20559 * mpn/sparc64/add_n.asm: Rewrite using `majority' logic.
20560 * mpn/sparc64/sub_n.asm: Likewise.
20562 * tune/tuneup.c (all): Recognise DECC and MIPSpro compilers.
20564 * mpn/pa64/sqr_diagonal.asm: Use PROLOGUE/EPILOGUE.
20565 * mpn/pa642/sqr_diagonal.asm: Likewise.
20567 * configure.in (HAVE_ABI_$abi): Disable for now.
20569 * mpn/asm-defs.m4 (PROLOGUE): Use LABEL_SUFFIX.
20571 * acinclude.m4 (GMP_ASM_ATTR): New check, for hppa oddities.
20573 2001-02-18 Torbjorn Granlund <tege@swox.com>
20575 * mpn/hppa/hppa1_1/gmp-mparam.h: New file.
20576 * mpn/hppa/hppa2_0/gmp-mparam.h: New file.
20578 * mpn/pa64/sqr_diagonal.asm: New file.
20579 * mpn/pa64w/sqr_diagonal.asm: New file.
20580 * mpn/hppa/hppa1_1/sqr_diagonal.asm: New file.
20581 * mpn/hppa/hppa2_0/sqr_diagonal.asm: New file.
20583 * mpn/sparc32/v9/add_n.asm: Use `fitod' instead of `fxtod' for dummy
20585 * mpn/sparc32/v9/sub_n.asm: Likewise.
20587 2001-02-18 Kevin Ryde <kevin@swox.se>
20589 * gmp.texi (Known Build Problems): Notes on make, $* and K&R, misc
20591 (Low-level Functions): Use {} notation in mpn_sqrtrem.
20592 (Basecase Multiplication): Mention BASECASE_SQR_THRESHOLD.
20594 * mpfr/isnan.c (mpfr_number_p): Infinity is not a number.
20595 * mpfr/out_str.c: Pass strlen+1 for the block size to free.
20596 * mpfr/get_str.c: Correction for realloc to strlen+1.
20598 * acinclude.m4 (GMP_C_SIZES): Generate an error if mp_limb_t doesn't
20599 seem to work for some reason.
20601 2001-02-16 Torbjorn Granlund <tege@swox.com>
20603 * mpn/sparc32/v9/gmp-mparam.h: Retune.
20605 * mpn/sparc32/v9/add_n.asm: New file.
20606 * mpn/sparc32/v9/sub_n.asm: New file.
20608 * mpn/sparc32/v9/mul_1.asm: Tune function entry.
20609 * mpn/sparc32/v9/addmul_1.asm: Likewise.
20610 * mpn/sparc32/v9/submul_1.asm: Likewise.
20612 * mpn/sparc32/v9/sqr_diagonal.asm: New file.
20614 2001-02-16 Kevin Ryde <kevin@swox.se>
20616 * configure.in: Fix flags selection when $CC is a compiler known to us.
20618 * demos/expr/exprfr.c (e_mpfr_cos, e_mpfr_sin): mpfr_sin_cos now
20619 allows NULL for one parameter.
20621 * mpfr/*: Update to 20010215.
20622 * mpfr/trunc.c: Use -DOPERATION scheme, and gmp mpn_zero_p.
20623 * mpfr/sqrt.c: Use plain mpn_sqrtrem, not mpn_sqrtrem_new.
20624 * mpfr/sqrtrem.c: Remove file.
20625 * mpfr/Makefile.am (libmpfr_a_SOURCES): Add isnan.c and set_ui.c,
20626 remove sqrtrem.c and srandom.h.
20628 * configfsf.guess: Update to 2001-02-13.
20629 * configfsf.sub: Update to 2001-02-16.
20630 * config.sub (j90, t90): Remove special handing, configfsf.sub now ok.
20632 * Makefile.am (MPF_OBJECTS): Add a couple of missing $U's.
20634 * tune/tuneup.c: Identify compiler used (GCC and Sun C so far).
20636 2001-02-15 Torbjorn Granlund <tege@swox.com>
20638 * mpn/sparc32/v9/mul_1.asm: Change `ld' to `lduw' and `st' to `stw'.
20639 * mpn/sparc32/v9/addmul_1.asm: Likewise.
20640 * mpn/sparc32/v9/submul_1.asm: Likewise.
20642 2001-02-14 Torbjorn Granlund <tege@swox.com>
20644 * mpn/mips3/mips.m4: New file.
20645 * configure.in (mips*-*-irix[6789]*): Use mips3/mips.m4.
20647 * mpn/powerpc64/sqr_diagonal.asm: New file.
20649 * mpn/mips3/sqr_diagonal.asm: New file.
20651 2001-02-12 Torbjorn Granlund <tege@swox.com>
20653 * mpn/powerpc32/sqr_diagonal.asm: New file.
20655 * mpn/generic/sqr_basecase.c: Remove declaration of mpn_sqr_diagonal.
20656 Fix typo in header comment.
20658 2001-02-12 Kevin Ryde <kevin@swox.se>
20660 * mpn/generic/mul.c, mpn/generic/mul_n.c, gmp-impl.h: Use
20661 mpn_mul_basecase for squaring below new BASECASE_SQR_THRESHOLD.
20662 * tune/tuneup.c gmp-impl.h: Tune BASECASE_SQR_THRESHOLD.
20664 * Makefile.am (libgmp.la, libmp.la): Revert change to build from
20665 mpn/libmpn.la etc, go back to explicitly listed objects.
20667 * configure.in: Recognise sparc64-*-*, not just sparc64-*-linux*.
20669 2001-02-11 Torbjorn Granlund <tege@swox.com>
20671 * mpn/asm-defs.m4 (sqr_diagonal): New define_mpn.
20673 * mpn/alpha/sqr_diagonal.asm: New file.
20675 2001-02-11 Kevin Ryde <kevin@swox.se>
20677 * gmp.texi (Low-level Functions): Note mpn_get_str clobbers its input
20680 * mpfr/add.c,agm.c,exp2.c,exp3.c,generic.c,log2.c,pi.c,print_raw.c,
20681 set_d.c,sin_cos.c,sqrtrem.c,sub.c: Apply some tweaks for K&R.
20682 * tests/mpz/reuse.c, tests/mpq/t-md_2exp.c, demos/pexpr.c,
20683 demos/expr/t-expr.c: Ditto.
20685 * configure.in (HAVE_ABI_$abi): New define in config.m4.
20687 * gmp-impl.h (mpn_sqr_diagonal): Add prototype and define.
20688 * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
20691 * gmp.texi, acinclude.m4: Mention x86 solaris 2.7 has the reg->reg
20692 movq bug the same as 2.6.
20694 * mpfr/Makefile.am (EXTRA_DIST): Add mpfr-test.h and mpf2mpfr.h.
20696 * mpn/x86/README: Merge contents of README.family.
20697 * mpn/x86/README.family: Remove file.
20699 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mode1o, gcd_finda,
20700 invert_limb, sqr_diagonal; remove mod_1_rs; sort alphabetically.
20702 2001-02-10 Torbjorn Granlund <tege@swox.com>
20704 * configure.in (gmp_mpn_functions_optional): List sqr_diagonal.
20706 * mpn/powerpc32/aix.m4: Use unnamed csects.
20707 * mpn/powerpc64/aix.m4: Likewise.
20709 * acconfig.h: Add #undef of mpn_sqr_diagonal.
20710 Remove lots of spacing.
20712 * configure.in (syntax testing section): Match power* instead of
20714 * mpn/power: Convert files to `.asm'.
20715 Prefix umul_ppmm and sdiv_qrnnd.
20716 Update some comments.
20718 2001-02-09 Kevin Ryde <kevin@swox.se>
20720 * acconfig.h: Add HAVE_NATIVE_mpn_modexact_1_odd and
20721 HAVE_NATIVE_mpn_modexact_1c_odd.
20723 * configure.in (CCAS): Don't override a user selection.
20725 * mpq/cmp_ui.c: DIVIDE_BY_ZERO if den2==0.
20727 2001-02-08 Torbjorn Granlund <tege@swox.com>
20729 * mpn/generic/sqr_basecase.c: Use mpn_sqr_diagonal when appropriate.
20731 2001-02-07 Kevin Ryde <kevin@swox.se>
20733 * gmp.texi (Low-level Functions): mpn_preinv_mod_1 now undocumented.
20735 * mpn/generic/random2.c (myrandom): Use rand() on mingw.
20737 * mpn/alpha/gmp-mparam.h: Update tuned parameters.
20739 2001-02-05 Torbjorn Granlund <tege@swox.com>
20741 * mpn/alpha/ev6/gmp-mparam.h: Retune.
20743 2001-02-05 Kevin Ryde <kevin@swox.se>
20745 * Makefile.am (libgmp, libmp): Construct from mpn/libmpn.la etc rather
20746 than explicitly listed objects.
20748 * urandom.h: Use rand() on mingw.
20750 * mpn/powerpc64/lshift.asm,addsub_n.asm: Use r1 not 1.
20752 2001-02-04 Torbjorn Granlund <tege@swox.com>
20754 * mpn/ia64/copyi.asm: New file.
20755 * mpn/ia64/copyd.asm: New file.
20757 2001-02-04 Kevin Ryde <kevin@swox.se>
20759 * mpn/alpha/ev5/gmp-mparam.h, mpn/mips3/gmp-mparam.h,
20760 mpn/powerpc32/gmp-mparam.h, mpn/powerpc64/gmp-mparam.h,
20761 mpn/sparc64/gmp-mparam.h, mpn/x86/*/gmp-mparam.h:
20762 Update tuned parameters.
20764 * mpn/x86/i486: New directory.
20765 * configure.in (i486-*-*): Use it.
20766 * mpn/x86/i486/gmp-mparam.h: New file.
20768 * mpn/x86/pentium/mode1o.asm: New file.
20769 * mpn/x86/p6/mode1o.asm: New file.
20771 * tune/many.pl: Use $(ASMFLAGS_PIC) and $(CFLAGS_PIC).
20773 * gmp.texi (Integer Division): Another rewording of 2exp divisions.
20775 2001-02-03 Torbjorn Granlund <tege@swox.com>
20777 * mpn/arm/gmp-mparam.h: Tune.
20779 * mpn/ia64/popcount.asm: Put a `;;' break at end of main loop.
20781 * configure.in (arm*-*-*): Set gcc_cflags in order to pass
20782 $fomit_frame_pointer.
20784 * tests/mpz/t-mul.c (base_mul): Remove an unused variable.
20786 2001-02-02 Torbjorn Granlund <tege@swox.com>
20788 * demos/pexpr.c (TIME): New macro.
20789 (main): Use TIME--print timing more accurately.
20790 (setup_error_handler): Increase RLIMIT_DATA to 16 Mibyte.
20792 * longlong.h (arm): Add __CLOBBER_CC to add_ssaaaa and sub_ddmmss.
20794 2001-02-02 Kevin Ryde <kevin@swox.se>
20796 * configure.in: Don't remove gmp-mparam.h and mpn source links under
20797 --no-create since in that case they're not re-created.
20799 * demos/expr: New directory.
20800 * Makefile.am (SUBDIRS, allprogs): Add it.
20801 * demos/expr/README, Makefile.am, expr.c, exprv.c, exprz.c, exprza.c,
20802 exprq.c, exprqa.c, exprfa.c, exprf.c, exprfr.c, exprfra.c, expr.h,
20803 expr-impl-h.in, run-expr.c, t-expr.c: New files.
20804 * configure.in: Generate demos/expr/Makefile & demos/expr/expr-impl.h.
20806 * Makefile.am: Remove mpfr from main libgmp.
20807 * mpfr/Makefile.am: Build and install separate libmpfr.a.
20808 * mpfr/*: Update to mpfr 2001.
20810 * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 2.
20811 * Makefile.am (libtool -version-info): Bump appropriately.
20814 * tune/divrem1div.c, tune/divrem1inv.c, tune/divrem2div.c,
20815 tune/divrem2inv.c: Renamed from divrem_1_div.c, divrem_1_inv.c,
20816 divrem_2_div.c, divrem_2_inv.c, to be unique in DOS 8.3 filenames.
20817 * tune/Makefile.am (libspeed_la_SOURCES): Update.
20819 * mpn/x86/*/README, mpn/x86/README.family: Misc updates.
20820 * tune/README: Misc updates.
20821 * doc/configuration: Misc updates.
20823 * mpn/x86/pentium/mmx/gmp-mparam.h: Change UDIV_PREINV_TIME to
20824 UDIV_NORM_PREINV_TIME.
20826 * mpz/pprime_p.c: Use ASSERT_ALWAYS instead of abort.
20828 * rand.c (__gmp_rand_lc_scheme): Add "const".
20829 (struct __gmp_rand_lc_scheme_struct): Make astr "const char *".
20831 * demos/calc/calc.y, demos/calc/calclex.l: Add kron function.
20833 * tests/devel/try.c: Partial rewrite, new scheme of function types,
20834 allow result validation functions, add sqrtrem and jacobi testing.
20835 * tune/many.pl: Corresponding updates.
20836 * tests/devel/Makefile.am: Add a convenience rule for libtests.la.
20838 * tests/refmpz.c: New file.
20839 * tests/Makefile.am: Add it.
20840 * tests/misc.c (mpz_erandomb, mpz_erandomb_nonzero): New functions.
20841 * tests/tests.h: Add prototypes.
20843 * mpn/x86/k6/cross.pl: Add a couple more exceptions.
20845 * gmp.texi: Don't use @nicode{'\0'}, it doesn't come out right in tex.
20846 (Introduction to GMP): Mention Cray vector systems.
20847 (Build Options): Describe --enable-mpfr, refer to its manual. Add
20848 Crays under supported CPUs.
20849 (Debugging): Add notes on source file paths.
20850 (Autoconf): New section.
20851 (Assigning Integers): Note truncation by mpz_set_d, mpz_set_q and
20853 (Converting Integers): Note the size mpz_get_str allocates.
20854 (Floating-point Functions): Rewrite introduction, clarifying some
20855 points about precision handling.
20856 (Converting Floats): Note the size mpf_get_str allocates, and that it
20857 gives an empty string for zero. Add mpf_get_si and mpf_get_ui.
20858 (Float Comparison): Give the formula mpf_reldiff calculates.
20859 (Miscellaneous Float Functions): Add mpf_integer_p and mpf_fits_*_p.
20860 (Random Number Functions): Misc rewordings for clarity.
20861 (Random State Initialization): Ditto.
20862 (Custom Allocation): Remove note on deallocate_function called with 0,
20863 misc rewording and clarifications.
20864 (Exact Remainder): New section.
20865 (Binary GCD): A few words on initial reduction using division.
20866 (Accelerated GCD): Refer to exact remainder section.
20867 (Extended GCD): Extra remarks on single versus double selection.
20868 (Jacobi Symbol): Update for mpz/jacobi.c rewrite and modexact_1_odd.
20869 (Modular Powering Algorithm): Refer to exact remainder section.
20870 (Assembler SIMD Instructions): Update remarks on MMX.
20871 (Contributors): Amend to "Divide and Conquer" division.
20872 (References): Tweak some formatting. Add "Proof of GMP Fast Division
20873 and Square Root Implementations" by Paul Zimmermann.
20875 2001-01-31 Torbjorn Granlund <tege@swox.com>
20877 * configure.in: Don't ever pass -mips3; let ABI flags imply ISA.
20879 2001-01-31 Kevin Ryde <kevin@swox.se>
20881 * tune/time.c: Remove unnecessary longlong.h.
20882 (speed_endtime): Add some extra diagnostics.
20884 * tests/mpz/t-fdiv_ui.c, tests/mpz/t-tdiv_ui.c: Use unsigned long for
20885 the divisor, not mp_limb_t.
20886 * tests/mpz/t-jac.c (try_base): Use %llu for long long limb.
20887 * tests/trace.c: Add <string.h> for strlen.
20889 * tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
20890 frequency" of 0, allow "BogoMIPS" as well as "bogomips".
20892 * macos/Makefile.in: Add mpf/fits_s.c and mpf/fits_u.c objects.
20894 2001-01-30 Torbjorn Granlund <tege@swox.com>
20896 * longlong.h: Add add_ssaaaa and sub_ddmmss for 64-bit sparc.
20898 2001-01-29 Torbjorn Granlund <tege@swox.com>
20900 * mpn/powerpc64/addmul_1.asm: Prefix registers with an `r'.
20901 * mpn/powerpc64/submul_1.asm: Likewise.
20902 * mpn/powerpc64/mul_1.asm: Likewise.
20904 * configure.in (alpha*-*-*): Amend last change to handle pca*.
20906 2001-01-29 Kevin Ryde <kevin@swox.se>
20908 * tune/speed.h (SPEED_ROUTINE_INVERT_LIMB_CALL): Don't let the
20909 compiler optimize everything away.
20911 * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Measure
20912 operator_div, operator_mod, mpn_divrem_2_div, mpn_divrem_2_inv,
20913 mpn_sb_divrem_m3, mpn_sb_divrem_m3_div, mpn_sb_divrem_m3_inv,
20914 mpn_dc_divrem_sb_div, mpn_dc_divrem_sb_inv.
20915 * tune/divrem_2_div.c, tune/divrem_2_inv.c, tune/sb_div.c,
20916 tune/sb_inv.c: New files.
20918 * tune/tuneup.c, gmp-impl.h, tune/speed.h, tune/common.c,
20919 tune/Makefile.am: Tune SB_PREINV_THRESHOLD and DIVREM_2_THRESHOLD.
20921 * mpn/generic/divrem_2.c: Use new DIVREM_2_THRESHOLD.
20922 * mpn/generic/sb_divrem_mn.c: Use new SB_PREINV_THRESHOLD.
20924 * mpn/x86/p6/mmx/lshift.asm, mpn/x86/p6/mmx/rshift.asm: New files,
20925 just m4 include()ing the P55 code.
20926 * configure.in (pentium[23]-*-*): Remove x86/pentium/mmx from path.
20928 2001-01-27 Kevin Ryde <kevin@swox.se>
20930 * configure.in (AC_CHECK_FUNCS): Add srand48.
20931 * tune/speed.c: Use this test.
20933 * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): Allow "egcs-" prefix on gcc
20934 --version, warn if the format is unrecognised.
20935 (GMP_COMPARE_GE): Guard against empty $1 not only on last arg.
20936 (GMP_INIT, GMP_FINISH, GMP_PROG_M4): Obscure or eliminate literal
20937 "dnl"s since autoconf thinks they indicate faulty macros.
20939 * mpz/get_str.c, mpf/get_str.c: Make allocated string block exactly
20940 strlen(str)+1 bytes.
20941 * mpz/dump.c, mpf/dump.c, tests/mpz/convert.c: Use this size when
20943 * tests/mpf/t-conv.c: Ditto, and ensure x==0 is exercised.
20945 * tests/mpz/t-fits.c: New file.
20946 * tests/mpz/Makefile.am: Add it.
20948 * tests/mpf/t-fits.c: New file.
20949 * tests/mpf/t-get_si.c: New file.
20950 * tests/mpf/t-int.c: New file.
20951 * tests/mpf/Makefile.am: Add them.
20953 * mpf/fits_s.c: New file.
20954 * mpf/fits_u.c: New file.
20955 * mpf/get_si.c: New file.
20956 * mpf/get_ui.c: New file.
20957 * mpf/int_p.c: New file.
20958 * Makefile.am, mpf/Makefile.am: Add them.
20959 * gmp-h.in (mpf_fits_*_p, mpf_get_si, mpf_get_ui, mpf_integer_p): Add
20962 * tests/memory.c (tests_allocate, tests_reallocate): Guard against
20965 * tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
20968 * gmp-impl.h (USE_LEADING_REGPARM): Fix conditionals.
20970 2001-01-23 Kevin Ryde <kevin@swox.se>
20972 * configure.in, mpn/Makeasm.am (ASMFLAGS_PIC): New substitution,
20973 allowing -DPIC to be suppressed on cygwin.
20974 (CFLAGS_PIC): New substitution, use it and $(CCAS) directly, rather
20975 than $(LIBTOOL), avoiding a problem with FreeBSD 2.2.8.
20977 * mpn/x86/k6/mode1o.asm, mpn/x86/k7/mode1o.asm: Remove an unnecessary
20978 +[.-L(here)] from _GLOBAL_OFFSET_TABLE_, avoids a segv from gas 1.92.3.
20979 * mpn/x86/README.family: Add notes on the problem.
20981 2001-01-20 Torbjorn Granlund <tege@swox.com>
20983 * configure.in (alpha*-*-*): Default `flavour' to ev4.
20985 2001-01-19 Kevin Ryde <kevin@swox.se>
20987 * assert.c, gmp-impl.h (__gmp_assert_fail): Change return type to
20988 void, since it's no longer used in expressions.
20990 * mpn/x86/addsub_n.S: Remove file, since it doesn't work and it upsets
20993 * mpz/jacobi.c: Rewrite, but still binary algorithm; accept zero and
20994 negative denominators; merge mpz_jacobi and mpz_legendre, add
20995 mpz_kronecker; use mpn directly, add special cases for size==1.
20996 * gmp.texi (Number Theoretic Functions): Update.
20997 * gmp-h.in (mpz_kronecker): Add prototype.
20998 * gmp-impl.h (USE_LEADING_REGPARM): New macro.
20999 * tests/mpz/t-jac.c: Test mpz_kronecker.
21000 * mpz/legendre.c: Remove file.
21001 * Makefile.am, mpz/Makefile.am: Update.
21003 * longlong.h (alpha count_leading_zeros): Use __attribute__ ((const))
21004 when possible, add parameter to prototype.
21005 (ia64 udiv_qrnnd): Use for all compilers, not just gcc.
21006 (pentium count_trailing_zeros): Use count_leading_zeros.
21008 * acinclude.m4 (GMP_C_ATTRIBUTE_CONST, GMP_C_ATTRIBUTE_NORETURN): New
21010 * configure.in: Use them.
21011 * gmp-impl.h (ATTRIBUTE_CONST, ATTRIBUTE_NORETURN): New macros.
21012 (mpn_invert_limb): Add ATTRIBUTE_CONST.
21013 (__gmp_assert_fail): Add ATTRIBUTE_NORETURN.
21015 2001-01-18 Kevin Ryde <kevin@swox.se>
21017 * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
21018 __gmp_free_func): Move prototypes from gmp-impl.h to gmp-h.in, for the
21019 benefit of gmp++.h.
21021 * gmp-impl.h, tests/misc.c, tests/tests.h: Move MPZ_SET_STR_OR_ABORT
21022 and MPF_SET_STR_OR_ABORT to mpz_set_str_or_abort and
21023 mpf_set_str_or_abort in libtests.
21024 * tests/mpz/convert.c, tests/mpz/t-bin.c, tests/mpz/t-get_si.c,
21025 tests/mpz/t-jac.c, tests/mpz/t-misc.c, tests/mpq/t-md_2exp.c,
21026 tests/mpq/t-set_f.c, tests/mpf/t-conv.c, tests/mpf/t-misc.c: Update.
21028 * mpn/generic/sqrtrem.c: Use MPN_COPY_INCR (for when rp==NULL).
21030 * tests/mpz/reuse.c: Only run mpz_divexact_gcd on positive divisors.
21032 2001-01-18 Torbjorn Granlund <tege@swox.com>
21034 * demos/pexpr.c (main): Accept -vml option.
21035 (fns): List `hamdist', `pow', `nextprime'.
21036 (mpz_eval_expr): Return -1 for `popc' of negative.
21037 (mpz_eval_expr): Handle `hamdist', `pow', `nextprime'.
21039 2001-01-15 Kevin Ryde <kevin@swox.se>
21041 * mpn/alpha/ev5/mode1o.c: New file.
21043 * tune/freq.c (speed_cpu_frequency_measure): Check cycles_works_p
21044 before running speed_cyclecounter.
21045 * tune/speed.h (cycles_works_p): Add prototype.
21047 2001-01-13 Torbjorn Granlund <tege@swox.com>
21049 * tests/rand/t-rand.c (farr): Fix typo.
21052 2001-01-12 Kevin Ryde <kevin@swox.se>
21054 * mpz/kronsz.c: Don't depend on right shifting a negative.
21056 * mpn/x86/gmp-mparam.h: New file.
21058 * mpn/x86/pentium/mmx/mul_1.asm: New file.
21060 2001-01-11 Torbjorn Granlund <tege@swox.com>
21062 * mpz/kronsz.c: Temporary workaround for Cray right shift oddities.
21063 Explicitly compare against zero in tests.
21065 2001-01-10 Kevin Ryde <kevin@swox.se>
21067 * mpz/kronzs.c: Don't depend on right shifting a negative.
21069 2001-01-09 Torbjorn Granlund <tege@swox.com>
21071 * tests/t-constants.c: Disable some undefined tests.
21072 (CHECK_MAX_S): Remove workaround for gcc 2.95.2 bug recently added.
21074 2001-01-09 Kevin Ryde <kevin@swox.se>
21076 * tests/t-constants.c: Add more diagnostics.
21077 (CHECK_MAX_S): Fix for gcc 2.95.2 -mpowerpc64 -maix64.
21079 * mpn/x86/k6/mode1o.asm: New file.
21080 * mpn/x86/k7/mode1o.asm: New file.
21082 * mpn/asm-defs.m4 (modexact_1_odd, modexact_1c_odd): New define_mpn's.
21083 (__clz_tab, modlimb_invert_table, PROLOGUE, EPILOGUE): Add asserts for
21085 * mpn/x86/x86-defs.m4 (Zdisp): Add a movzbl.
21087 * tests/mpz/t-jac.c (check_a_zero): New test.
21088 (check_squares_zi): Fix to use (a^2/b), not (a*b/b); revert last
21089 change avoiding a,b=0, both are fine.
21090 (try_2den): Don't use mpz_kronecker_ui for the expected answer.
21091 (try_*): Call abort rather than exit.
21093 * mpz/kronzu.c, mpz/kronzs.c: Fix for a=0.
21095 * tune/tuneup.c (USE_PREINV_MOD_1): Fix to use new DATA_HIGH_LT_R.
21097 2001-01-08 Torbjorn Granlund <tege@swox.com>
21099 * urandom.h: Amend 2000-11-21 change to also handle cygwin.
21101 2001-01-08 Kevin Ryde <kevin@swox.se>
21103 * tune/many.pl: Updates for move to tests/devel, add modexact_1_odd,
21104 don't assume C files can't have carry-in entrypoints, remove
21105 $(TRY_TESTS_OBJS) now in libtests.
21107 * tests/devel/try.c, tests/refmpn.c, tests/tests.h: Remove
21108 mpn_mod_1_rshift testing.
21110 * tune/tuneup.c (fft_step_size): Test for overflow using the actual
21111 mp_size_t, don't use BITS_PER_INT.
21113 * tune/speed.c (r_string): "r" is a limb, use BITS_PER_MP_LIMB and
21114 change LONG_ONES to LIMB_ONES.
21115 * tune/time.c (M_2POWU): Use INT_MAX rather than BITS_PER_INT.
21117 * extract-dbl.c (BITS_PER_PART): Use BITS_PER_MP_LIMB not
21120 * mpz/inp_raw.c, mpz/out_raw.c: Add private defines of BITS_PER_CHAR.
21121 * mpz/fac_ui.c, tests/mpz/t-fac_ui.c: Don't use BITS_PER_LONGINT.
21122 * tests/mpz/t-get_si.c: Don't use BITS_PER_LONGINT, do the LONG_MAX
21123 tests with some explicit code.
21125 * mpn/*/gmp-mparam.h, acinclude.m4, tests/t-constants.c
21126 (BITS_PER_LONGINT, BITS_PER_INT, BITS_PER_SHORTINT, BITS_PER_CHAR):
21127 Remove defines, remove probings, remove tests.
21129 * tune/tuneup.c (MODEXACT_1_ODD_THRESHOLD): Add tuning.
21131 * tune/speed.c,speed.h,common.c: Add measuring of mpn_modexact_1_odd,
21132 mpn_gcd_finda, and an "N" form for mpn_gcd_1.
21134 * tests/mpz/t-jac.c (check_squares_zi): Ensure random a,b != 0.
21136 2001-01-07 Kevin Ryde <kevin@swox.se>
21138 * configure.in (gmp_mpn_functions): Add mode1o, remove mod_1_rs.
21140 * mpn/generic/mod_1_rs.c: Remove file, no longer needed.
21141 * gmp-h.in (mpn_mod_1_rshift): Remove prototype and define.
21143 * mpq/set_f.c: Use MPN_STRIP_LOW_ZEROS_NOT_ZERO.
21145 * mpz/kronzu.c, mpz/kronzs.c, mpz/kronuz.c, mpz/kronsz.c: Use
21146 mpn_modexact_1_odd, new style MPN_STRIP_LOW_ZEROS_NOT_ZERO, and new
21147 JACOBI macros. Various rearrangements supporting all this.
21149 * mpn/generic/gcd_1.c: Use mpn_modexact_1_odd, reduce u%v if u much
21150 bigger than v when size==1, some rearrangements supporting this.
21152 * gmp-impl.h (JACOBI_*): More macros, add some casts to "int".
21153 (MPN_STRIP_LOW_ZEROS_NOT_ZERO): Add a "low" parameter.
21154 (mpn_modexact_1_odd, mpn_modexact_1c_odd): Add prototype and defines.
21155 (MODEXACT_1_ODD_THRESHOLD): New threshold.
21156 (MPN_MOD_OR_MODEXACT_1_ODD, JACOBI_MOD_OR_MODEXACT_1_ODD): New macros.
21158 * mpn/generic/mode1o.c: New file.
21160 * tests/mpz/reuse.c: Add testing of mpz_divexact_gcd.
21161 * tests/mpz/t-fac_ui.c: Use libtests for memory leak checking.
21162 * tests/mpz/t-fib_ui.c: Add a usage comment.
21164 * tests/mpz/bit.c: Use libtests.
21165 * tests/mpz/t-scan.c: Remove unused subroutines.
21166 * tests/devel/try.c: Use libtests, define PROT_NONE if the system
21169 * tests/spinner.c, tests/x86check.c: Use tests.h.
21170 * tests/trace.c: Use tests.h, add mpf_trace.
21171 * tests/refmpn.c: Use tests.h, add refmpn_malloc_limbs_aligned,
21172 refmpn_tstbit, refmpn_neg.
21174 * tune/common.c, tune/speed.h: Update for functions moved to
21177 * tune/Makefile.am, tests/mpz/Makefile.am, tests/mpq/Makefile.am,
21178 tests/mpf/Makefile.am: Use tests/libtests.la.
21180 * configure.in (AC_OUTPUT): Update for new directories.
21181 (x86 CALLING_CONVENTIONS_OBJS): Use .lo for libtests.la, allow
21182 ansi2knr on x86check.c.
21184 * tests/Makefile.am: Establish new libtests.la convenience library,
21185 add mpz, mpq, mpf, mpbsd subdirectories.
21186 * tests/tests.h: New file.
21187 * mpn/tests/ref.h,try.h: Remove files, now in tests.h.
21189 * tests/mpf/ref.c: Move to tests/refmpf.c, rename functions to refmpf.
21190 * tests/mpf/t-add.c, tests/mpf/t-sub.c: Use libtests.
21191 * tests/mpf/Makefile.am: Update.
21193 * tests/memory.c: New file.
21194 * tests/misc.c: New file, a few subroutines from the test programs.
21196 * mpz/tests, mpq/tests, mpf/tests, mpbsd/tests: Move directories to
21198 * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpbsd/Makefile.am
21201 * tests/devel: New directory.
21202 * mpn/tests/*.c: Move programs to tests/devel.
21203 * mpn/tests/Makefile.am, mpn/tests/README: Move to tests/devel, update.
21205 * mpn/tests/ref.c: Move to tests/refmpn.c.
21206 * mpn/tests/spinner.c,trace.c,x86call.asm,x86check.c: Move to tests
21209 * tests/t-constants.c: Add checks of HIGHBIT, MAX and MIN constants,
21210 simplify ANSI vs K&R stringizing, use correct printf format types, do
21211 all tests before aborting.
21213 2001-01-05 Torbjorn Granlund <tege@swox.com>
21215 * mpn/cray/ieee/gmp-mparam.h: Retune.
21217 2001-01-05 Kevin Ryde <kevin@swox.se>
21219 * configure.in (mp.h): Only create this under --enable-mpbsd.
21221 * demos/calc: New subdirectory, move demos/calc* to it.
21222 * demos/calc/Makefile.am: New file, split from demos/Makefile.am.
21223 * demos/Makefile.am: Update.
21224 * configure.in (AC_OUTPUT): Add demos/calc/Makefile.
21226 * tests/t-constants.c (CALC_BITS_PER_TYPE etc): Use a run-time test
21227 for how many bits work in a give type, don't assume bits==8*sizeof.
21229 2001-01-04 Kevin Ryde <kevin@swox.se>
21231 * mpz/fits_s.c, mpz/fits_u.c: New files, split from fits.c, use plain
21232 UINT_MAX etc, not MPZ_FITS_UTYPE_SDT etc.
21233 * mpz/fits.c: Remove file.
21234 * mpz/Makefile.am, macos/Makefile.in: Update.
21236 * gmp-impl.h (UNSIGNED_TYPE_MAX etc): Remove these generic forms.
21237 (MPZ_FITS_[SU]TYPE_SDT): Remove these.
21238 (UINT_MAX etc): Provide a full set of defaults.
21239 * gmp-h.in (__GMP_MP_SIZE_T_INT): New define.
21241 * mpz/tests/t-scan.c: New file.
21242 * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
21244 * mpz/scan0.c, mpz/scan1.c: Rewrite, don't read beyond allocated
21245 memory, support negatives, return ULONG_MAX for no bit found.
21246 * gmp.texi (Integer Logic and Bit Fiddling): Update.
21248 2001-01-03 Torbjorn Granlund <tege@swox.com>
21250 * mpz/tests/dive.c: Generate test operands using new random functions.
21251 * mpz/tests/io.c: Likewise.
21252 * mpz/tests/logic.c: Likewise.
21253 * mpz/tests/t-2exp.c: Likewise.
21255 * stack-alloc.c (__gmp_tmp_alloc): Round `now' to required alignment.
21257 * stack-alloc.h (__TMP_ALIGN): Append `L'.
21259 * gmp-impl.h: For Cray, #include limits.h.
21260 (LONG_MIN): New #define.
21261 (ULONG_HIGHBIT): #define in terms of ULONG_MAX.
21262 (LONG_HIGHBIT): #define as LONG_MIN.
21263 (USHRT_MAX): New name for USHORT_MAX.
21264 (SHRT_MAX): New name for SHORT_MAX.
21265 (SHRT_MIN): New #define.
21266 (USHORT_HIGHBIT,SHORT_HIGHBIT): Removed.
21268 * mpbsd/tests/t-misc.c (check_itom [data]): *SHORT* => *SHRT*;
21269 remove code disabling a test for Cray.
21271 * tests/t-constants.c (CHECK_CONSTANT): Cast parameters to long.
21273 * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove unused variable `t'.
21274 (mpn_kara_mul_n): Likewise.
21276 * mpz/fac_ui.c (MPZ_SET_1_NZ): Actually use `__z'.
21278 * mpz/tests/t-jac.c
21279 (main, check_squares_zi): Generate test operands using new random
21282 All changes below on this date for enabling `make; make check'
21283 with C++ compilers:
21285 * mpz/tests/t-pow_ui.c (debug_mp, ref_mpz_pow_ui): Provide prototypes.
21287 * mpz/tests/t-mul.c (debug_mp, base_mul, ref_mpz_mul):
21288 Provide prototypes.
21289 (dump_abort): Provide prototype and declare properly for C++.
21291 * mpz/tests/t-jac.c: #include stdlib.h and sys/time.h.
21293 * mpz/tests/t-fdiv.c
21294 (dump_abort): Provide prototype and declare properly for C++.
21295 (debug_mp): Provide prototype.
21296 * mpz/tests/t-fdiv_ui.c: Likewise.
21297 * mpz/tests/t-gcd.c: Likewise.
21298 * mpz/tests/t-powm.c: Likewise.
21299 * mpz/tests/t-powm_ui.c: Likewise.
21300 * mpz/tests/t-sqrtrem.c: Likewise.
21301 * mpz/tests/t-tdiv_ui.c: Likewise.
21302 * mpz/tests/t-tdiv.c: Likewise.
21304 * mpz/tests/t-2exp.c: #include stdlib.h and sys/time.h.
21305 Remove #include of longlong.h.
21307 * mpz/tests/io.c: #include config.h, stdlib.h, sys/time.h, and
21308 conditionally unistd.h.
21310 * mpz/tests/dive.c: #include stdlib.h and sys/time.h.
21311 (dump_abort): Provide prototype and declare properly for C++.
21312 (debug_mp): Provide prototype.
21313 * mpz/tests/logic.c: Likewise.
21315 * mpz/tests/convert.c (debug_mp): Provide prototype.
21316 * mpz/tests/t-root.c (debug_mp): Likewise.
21318 * mpz/tests/bit.c: #include stdlib.h and sys/time.h.
21320 * mpq/tests/t-get_d.c: #include stdlib.h and sys/time.h.
21321 (dump): Provide prototype and declare properly for C++.
21323 * mpq/tests/t-cmp_ui.c: #include stdio.h, stdlib.h and sys/time.h.
21324 (ref_mpq_cmp_ui): Declare properly for C++.
21326 * mpq/tests/t-cmp.c: #include stdlib.h and sys/time.h.
21327 (ref_mpq_cmp): Declare properly for C++.
21328 (dump): Delete unused function.
21330 * mpf/random2.c (myrandom): New function.
21331 (mpf_random2): Use it.
21333 * mpn/generic/random2.c: #include stdlib.h (for random/mrand48).
21334 (myrandom): New function.
21335 (mpn_random2): Use it.
21337 * mpf/tests/t-add.c: #include stdlib.h and sys/time.h.
21338 (oo): Remove unused function.
21339 * mpf/tests/t-conv.c: Likewise.
21340 * mpf/tests/t-sub.c: Likewise.
21341 * mpf/tests/t-dm2exp.c: Likewise.
21342 * mpf/tests/t-muldiv.c: Likewise.
21343 * mpf/tests/t-sqrt.c: Likewise.
21345 * mpf/tests/reuse.c: #include stdlib.h and sys/time.h.
21346 Use PROTO on some typedefs.
21347 (oo): Remove function.
21348 (dump_abort): Call mpf_dump instead of oo.
21350 * mpf/set_str.c: #include stdlib.h (for strtol).
21352 * mpf/random2.c: #include stdlib.h (for random/mrand48).
21353 * mpn/alpha/udiv_arnnd: File deleted.
21355 * Remove K&R function headers.
21357 2001-01-02 Torbjorn Granlund <tege@swox.com>
21359 * mpn/generic/mul.c: Clean up spacing and indentation.
21361 * mpn/generic/mul_fft.c (mpn_fft_add_modF): Use mpn_decr_u.
21362 Clean up spacing and indentation.
21364 * extract-dbl.c: Generalize to handle smaller limb sizes.
21366 2001-01-01 Torbjorn Granlund <tege@swox.com>
21368 * mpbsd/mout.c: Output newline after "0".
21370 2000-12-31 Torbjorn Granlund <tege@swox.com>
21372 * ltmain.sh: Remove space between `#!' and `$SHELL' when generating
21375 * mpbsd/tests/t-misc.c (check_itom): Exclude test for all Cray
21376 vector systems. Correct comment.
21378 2000-12-31 Kevin Ryde <kevin@swox.se>
21380 * gmp.texi (ABI and ISA): New enough gcc needed for mips n32 etc, gcc
21381 2.95 needed for sparc 64-bit ABI, gcc 2.8 needed for -mv8plus.
21383 * configure.in ([cjt]90,sv1-cray-unicos*): Preserve user specified
21384 MPN_PATH, amend test program indenting.
21385 (none-*-*): Add -DNO_ASM to gcc to disable longlong.h asm macros in
21388 * config.sub (j90, t90): Preserve these, don't let configfsf.sub turn
21391 * config.guess (m68k-*-nextstep*,m68k-*-openstep*): Don't transform
21392 m68k to m68020, since m68k is already interpreted as 68020.
21394 2000-12-30 Kevin Ryde <kevin@swox.se>
21396 * mpq/neg.c: Rewrite, use mpn, avoid denominator copy if unnecessary.
21398 * mpz/tstbit.c: Rewrite, slightly simplified.
21399 * mpz/tests/bit.c (check_tstbit): New test, and add a couple more
21400 diagnostics elsewhere.
21402 * configure.in (x86 gcc_cflags_cpu): Add -m486 for gcc 2.7.2.
21403 (ccbase): Only use a known compiler in eval statements (avoids
21404 problems with non-symbol characters).
21405 (ccbase): Use GMP_PROG_CC_IS_GNU to identify gcc installed under a
21407 (cclist): Use same style $abi as other variables.
21409 * acinclude.m4 (GMP_PROG_CC_IS_GNU): New macro.
21410 (GMP_GCC_MARCH_PENTIUMPRO): Use $ccbase to identify gcc.
21411 (GMP_ASM_TYPE): Define TYPE to empty, not "dnl", when no .type needed.
21412 (GMP_ASM_SIZE): Ditto for SIZE, which ensures EPILOGUE on the last
21413 line of a file doesn't leave a tab and no newline.
21414 (GMP_ASM_UNDERSCORE): Add a prototype for C++.
21416 * configure.in (sys/mman.h, mprotect): New tests.
21417 * mpn/tests/try.c: Use them, and HAVE_UNISTD_H too.
21419 * configure.in (getopt.h): Remove test.
21420 * tune/speed.c, mpn/tests/try.c (getopt.h): Remove include, since
21421 plain getopt() is in <unistd.h>.
21423 * configure.in, gmp-h.in (mips*-*-irix6*): Set limb_n32=longlong
21424 rather than using _ABIN32.
21426 2000-12-29 Torbjorn Granlund <tege@swox.com>
21428 * mpz/tests/reuse.c: Rename dump_abort => dump.
21429 * mpz/tests/reuse.c: Generate operands using gmp_rand*.
21430 * mpz/tests/convert.c: Likewise.
21432 * configure.in: Detect T90-ieee systems; move Cray path
21433 selection to after AC_PROG_CC. Invoke AC_PROG_CPP.
21434 * mpn/cray/cfp: New directory. Move cfp specific files here.
21435 * mpn/cray/cfp/mulwwc90.s: New file.
21436 * mpn/cray/cfp/mulwwj90.s: New file.
21437 * mpn/cray/mulww.s: Delete.
21439 2000-12-27 Torbjorn Granlund <tege@swox.com>
21441 * mpn/cray/ieee/mul_1.c: New file.
21442 * mpn/cray/ieee/addmul_1.c: New file.
21443 * mpn/cray/ieee/submul_1.c: New file.
21444 * mpn/cray/ieee/gmp-mparam.h: New file.
21446 * mpn/cray/gmp-mparam.h: Disable UMUL_TIME and UDIV_TIME.
21448 * mpn/cray/hamdist.c: New file.
21449 * mpn/cray/popcount.c: New file.
21450 * mpn/cray/rshift.c: New file.
21451 * mpn/cray/lshift.c: New file.
21453 * longlong.h: Add count_leading_zeros for _CRAY.
21454 Reorganize _CRAY stuff.
21456 2000-12-24 Kevin Ryde <kevin@swox.se>
21458 * configure.in (alpha*-cray-unicos*): Disable SPEED_CYCLECOUNTER_OBJ,
21459 as tune/alpha.asm doesn't suit.
21461 * mpn/generic/sqrtrem.c, mpz/pow_ui.c, mpz/powm_ui.c, mpf/get_str.c,
21462 mpf/set_str.c: Use mpn_sqr_n when applicable, not mpn_mul_n.
21464 2000-12-23 Torbjorn Granlund <tege@swox.com>
21466 * mpn/generic/mul_fft.c: Reformat.
21467 (mpn_fft_neg_modF): Remove.
21468 (mpn_fft_mul_2exp_modF): Inline mpn_fft_neg_modF.
21470 * mpn/cray/gmp-mparam.h: Retune.
21472 * configure.in (*-cray-unicos*): Pass `-O3 -htask0'.
21473 (vax*-*-*): Fix typo.
21475 * mpn/cray/mul_1.c: Use dynamic arrays, get rid of TMP_*.
21476 * mpn/cray/addmul_1.c: Likewise.
21477 * mpn/cray/submul_1.c: Likewise.
21478 * mpn/cray/add_n.c: Likewise.
21479 * mpn/cray/sub_n.c: Likewise.
21481 * configure.in (default cc_cflags,cc_64_cflags): Remove -g/add -O.
21482 (mips*-*-irix[6789]*]): Remove -g from cc_*_cflags.
21484 2000-12-22 Torbjorn Granlund <tege@swox.com>
21486 * mpn/generic/mul_n.c: Delete K&R function headers.
21488 * mpn/generic/mul_n.c (mpn_kara_mul_n): Clean up type confusion
21489 between mp_limb_t and mp_size_t.
21490 (mpn_kara_sqr_n): Likewise.
21492 * mpn/generic/mul_n.c (mpn_kara_mul_n): Use mpn_incr_u.
21493 (mpn_kara_sqr_n): Likewise.
21495 * mpn/generic/mul_n.c (mpn_kara_mul_n): Change handling of `sign'
21496 to work around GCC 2.8.1 MIPS bug.
21498 * configure.in (implied alpha*-cray-unicos*): Remove -g from cc_cflags.
21500 2000-12-21 Torbjorn Granlund <tege@swox.com>
21502 * mpn/alpha/invert_limb.asm: Simplify a bit.
21503 Add handling of bigend systems.
21504 * mpn/alpha/unicos.m4: Define `bigend'.
21505 * mpn/alpha/default.m4: Define `bigend' (to expand to nothing).
21507 * tests/t-constants.c (CHECK_CONSTANT): Print using %lx.
21509 * mpn/alpha/gmp-mparam.h: Remove sizes for plain C types.
21510 * mpn/alpha/ev5/gmp-mparam.h: Likewise.
21511 * mpn/alpha/ev6/gmp-mparam.h: Likewise.
21513 * mpn/alpha/unicos.m4: Define LEA.
21514 * mpn/alpha/default.m4: Likewise.
21515 * mpn/alpha/invert_limb.asm: Use LEA for loading symbolic addresses.
21516 * mpn/alpha/cntlz.asm: Likewise.
21518 * mpn/alpha/cntlz.asm: Don't use `ldbu', use slightly slower
21519 `ldq_u' + `extbl' instead.
21521 * mpn/alpha/unicos.m4: Define EXTERN.
21522 * mpn/alpha/default.m4: Define EXTERN (to expand to nothing).
21523 * mpn/alpha/cntlz.asm: Declare __clz_tab usign `EXTERN' (for the
21524 benefit of Unicos).
21526 2000-12-21 Kevin Ryde <kevin@swox.se>
21528 * mpn/alpha/unicos.m4 (GSYM_PREFIX): Define for the benefit of
21531 2000-12-20 Torbjorn Granlund <tege@swox.com>
21533 * longlong.h: Add udiv_qrnnd and count_leading_zeros for _CRAYMPP
21536 2000-12-19 Torbjorn Granlund <tege@swox.com>
21538 * configure.in (*sparc*-*-*): Remove -g from cc_cflags and acc_cflags.
21540 * mpn/generic/sqrtrem.c (mpn_sqrtrem): Separate `limb' values from
21543 * configure.in (*-cray-unicos*): Add `-Wa,-B' to cc_cflags.
21545 * demos/pexpr.c (rstate): New variable.
21546 (main): Initialize rstate.
21547 (enum op_t): Add RANDOM.
21548 (fns): Add field for RANDOM.
21549 (mpz_eval_expr): Handle RANDOM.
21551 2000-12-19 Kevin Ryde <kevin@swox.se>
21553 * mpn/generic/sqrtrem.c: Rewrite by Paul Zimmermann, based on his
21554 Karatsuba Square Root algorithm.
21555 * gmp.texi (Square Root Algorithm): Update.
21557 * tune/many.pl: New file.
21559 * mpn/tests/try.c,ref.[ch] (mpn_preinv_mod_1, mpn_sb_divrem_mn,
21560 mpn_tdiv_qr, mpn_gcd_finda, mpn_kara_mul_n, mpn_kara_sqr_n,
21561 mpn_toom3_mul_n, mpn_toom3_sqr_n): Add testing.
21562 * mpn/tests/ref.c: Cast some "0"s in function calls.
21564 * mpn/x86/k7/mmx/mod_1.asm: Add preinv_mod_1 entrypoint, remove extra
21565 variable for loop termination.
21567 * mpn/x86/p6/mmx/mod_1.asm: Remove file, in favour of the following.
21568 * mpn/x86/p6/mod_1.asm: New file.
21570 * mpn/x86/pentium/mod_1.asm: New file.
21572 2000-12-18 Torbjorn Granlund <tege@swox.com>
21574 * configure.in (mips*-*-irix[6789]*): Pass options to compiler using
21577 2000-12-18 Kevin Ryde <kevin@swox.se>
21579 * mpn/x86/k6/pre_mod_1.asm: New file.
21581 * tune/tuneup.c (USE_PREINV_MOD_1): Tune this, rearrange mpn_divrem_1
21582 and mpn_mod_1 handling in support of it.
21583 * tune/Makefile.am: Consequent changes to divrem_1.c and mod_1.c.
21585 * gmp-impl.h (USE_PREINV_MOD_1, MPN_MOD_OR_PREINV_MOD_1): New macros.
21586 * mpn/generic/perfsqr.c, mpz/pprime_p.c: Use MPN_MOD_OR_PREINV_MOD_1.
21588 * configure.in: Let an asm mod_1 provide a preinv_mod_1 entrypoint.
21590 * mpn/alpha/default.m4: Remove some newlines, add some asserts.
21591 (r0 etc, f0 etc): Use defreg and deflit.
21592 (PROLOGUE, PROLOGUE_GP, EPILOGUE): Use GSYM_PREFIX.
21593 * mpn/alpha/unicos.m4: Remove some newlines, add some asserts.
21594 * mpn/alpha/invert_limb.asm: Remove unused second DATASTART parameter.
21595 * mpn/alpha/cntlz.asm: Use mpn_count_leading_zeros and __clz_tab.
21597 * mpn/asm-defs.m4 (changecom): Comments on portability.
21598 (__clz_tab, modlimb_invert_table): New macros, matching gmp-impl.h.
21599 (count_leading_zeros, count_trailing_zeros): New define_mpn's.
21600 (PROLOGUE etc): Comments on usage, add some asserts.
21601 (OPERATION_[lr]shift): Use m4_not_for_expansion, for the benefit of
21602 lorrshift multifunc.
21604 * mpn/Makeasm.am (RM_TMP): New variable controlling tmp-*.s
21605 removal, for development purposes.
21607 * mpz/fac_ui.c: Fix for long long limb by using mpn_mul_1 not
21608 mpz_mul_ui, and note some possible enhancements.
21610 * mpz/tests/t-fac_ui.c: New test.
21611 * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
21612 * macos/Makefile.in: Ditto, and add t-fib_ui too.
21614 * mpn/generic/[lr]shift.c: Remove some DEBUG code adequately covered
21615 by new parameter ASSERTs.
21617 * longlong.h (count_trailing_zeros): Assert x!=0.
21619 * doc/configuration: Updates for new configure things, add some notes
21622 2000-12-16 Torbjorn Granlund <tege@swox.com>
21624 * configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc also for 64-bit
21626 * configure.in: Disable shared libs for *-*-ultrix*.
21628 2000-12-15 Torbjorn Granlund <tege@swox.com>
21630 * configure.in (powerpc*-*-*): Pass -Wa,-mppc when using gcc.
21632 * gmp-impl.h (_EXTERN_INLINE): #define different for GCC and other
21635 * gmp-h.in (__gmp_inline): Remove.
21636 * mp-h.in: Likewise.
21637 * mpn/generic/gcd.c: Use `inline' instead of `__gmp_inline'.
21639 * configure.in (mips*-*-irix[6789]*): Define *_ldflags.
21641 2000-12-14 Torbjorn Granlund <tege@swox.com>
21643 * mpn/generic/pre_mod_1.c: Use proper type for udiv_qrnnd
21646 * mpn/generic/divrem_1.c: Use explicit `!= 0' in if statement.
21647 * mpn/generic/mod_1.c: Likewise.
21649 2000-12-14 Kevin Ryde <kevin@swox.se>
21651 * config.guess (mips-*-irix[6789]*): Transform to mips64.
21652 (m68k-*-nextstep* | m68k-*-openstep*): Transform to m68020.
21654 2000-12-13 Torbjorn Granlund <tege@swox.com>
21656 * tests/t-constants.c (main): Conditionalize use of PP_INVERTED.
21658 * mpn/mp_bases.c: Handle 4-bit limbs.
21659 (main): Add code for generating tables.
21661 * mpn/generic/popham.c: Handle limb bitsizes of 4, 8, 16.
21662 Suffix all 32-bit constant with `L'.
21663 Use CNST_LIMB for 64-bit constants.
21665 2000-12-13 Kevin Ryde <kevin@swox.se>
21667 * gmp-impl.h (FIB_THRESHOLD): Defaults for 4,8,16 bits per limb, and
21668 an arbitrary fallback default.
21669 (modlimb_invert): Add efficient code for 8,16 (or 4) bits per limb.
21671 * configure.in (mips3, mips64): Don't bother with o32 (mips2 32-bit
21674 * Makefile.am (SUBDIRS): Put "tests" first so tests/t-constants.c is
21675 run first, to pick up any limb size mismatch.
21677 * tune/tuneup.c (DIVREM_1, MOD_1): Fix result values, were off by 1.
21679 * mpz/fib_ui.c (table1, table2): Add data for 4,8,16 bits per limb.
21681 2000-12-12 Torbjorn Granlund <tege@swox.com>
21683 * gmp-impl.h (LIMBS_PER_DOUBLE): Define for any limb bitsize.
21685 2000-12-11 Torbjorn Granlund <tege@swox.com>
21687 * mpn/mp_bases.c: Add tables for 8-bit and 16-bit limbs.
21688 Round existing `double' values properly.
21690 * gmp-h.in (__gmp_randstate_struct): Prefix field names with _mp_
21691 to keep out of user name space.
21692 (__gmp_randata_lc): Likewise.
21693 * randclr.c, randlc.c, randlc2x.c, randraw.c, randsd.c, randsdui.c:
21694 Corresponding changes.
21696 * gmp-impl.h (PP): #define for machines with BITS_PER_MP_LIMB
21697 of 2, 4, 8, and 16.
21698 (PP_FIRST_OMITTED): New, define for various BITS_PER_MP_LIMB.
21700 (PP_MAXPRIME): Remove.
21702 * mpn/generic/perfsqr.c: Generalize PP handling for machines with
21703 limbs of < 32 bits. Allow PP_INVERTED to be undefined.
21704 * mpz/pprime_p.c: Likewise.
21706 2000-12-10 Torbjorn Granlund <tege@swox.com>
21708 * mpn/generic/mul_1.c: Declare parameters in C89 style.
21710 2000-12-10 Kevin Ryde <kevin@swox.se>
21712 * tune/Makefile.am (speed_LDFLAGS, speed_ext_LDFLAGS, tune_LDFLAGS):
21713 Don't use -all-static, as gcc 2.95.2 on i386 solaris 8 doesn't like
21716 * configure.in (mips3,mips64): Add ABI=64, name the others ABI=n32 and
21718 * mpn/mips3/gmp-mparam.h (BITS_PER_LONGINT): Remove #define and let
21719 configure determine it, since it varies with ABI=64 or ABI=n32.
21720 * gmp.texi (ABI and ISA): Update.
21721 (mpz_mod_ui): Remark that it's identical to mpz_fdiv_r_ui.
21722 (mpn_divexact_by3): Qualify a statement needing mp_bits_per_limb even.
21724 * mul_fft.c (mpn_fft_mul_modF_K etc): Patch by Paul Zimmermann to fix
21725 results in certain cases of recursing into a further FFT.
21727 2000-12-09 Torbjorn Granlund <tege@swox.com>
21729 * mpz/cmpabs.c: Remove unused variable.
21730 * mpz/rrandomb.c: Likewise.
21731 * mpz/xor.c: Likewise.
21733 2000-12-07 Torbjorn Granlund <tege@swox.com>
21735 * mpn/generic/gcdext.c: Handle double carry when computing s1.
21736 Merge two code blocks for computing s0 and s1.
21738 2000-12-07 Kevin Ryde <kevin@swox.se>
21740 * configure.in (hppa*-*-*): Remove -Aa -D_HPUX_SOURCE from
21741 cc_cflags/cppflags, and instead let AM_C_PROTOTYPES add it, or -Ae,
21744 * configure.in (*-*-aix[34]*): Disable shared by default, but let
21745 the user override that, if desired.
21746 * gmp.texi (Notes for Particular Systems): Update.
21748 2000-12-06 Torbjorn Granlund <tege@swox.com>
21750 * mpq/cmp_ui.c: Streamline.
21752 2000-12-06 Kevin Ryde <kevin@swox.se>
21754 * tune/divrem_1_div.c,divrem_1_inv.c,mod_1_div.c,mod_1_inv.c,
21755 gcdext_double.c: New files for measuring.
21756 * tune/Makefile.am (libspeed_la_SOURCES): Add them.
21757 * tune/speed.c,speed.h,common.c: Add measuring of them.
21758 (mpn_preinv_mod_1, mpz_jacobi, mpz_powm_ui): Add measuring.
21760 * speed.c (getopt_long): Don't use this, just plain getopt.
21761 * configure.in (getopt_long): Remove test.
21763 * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_MUL_N_MINSIZE,
21764 MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_MUL_N_MINSIZE): New macros, and
21765 assume toom3 square tsize was meant to be the same as the mul (both
21766 are overestimates).
21767 * tune/tuneup.c, mpn/generic/mul.c, mpn/generic/mul_n.c: Use them.
21768 * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Fix an ASSERT to use
21769 TOOM3_SQR_THRESHOLD not TOOM3_MUL_THRESHOLD, add a few that might
21770 be more realistic size checks.
21771 * tune/speed.h (SPEED_ROUTINE_MPN_MUL_N_TSPACE etc): Use minsize.
21773 * mpn/generic/divrem_1.c: Partial rewrite, merge fractional part
21774 calculation, skip a divide step in more cases, introduce
21775 DIVREM_1_NORM_THRESHOLD and DIVREM_1_UNNORM_THRESHOLD.
21776 * mpn/generic/mod_1.c: Partial rewrite, skip a divide step in more
21777 cases, introduce MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD.
21778 * longlong.h (UDIV_PREINV_ALWAYS): New define, set for alpha and ia64.
21779 * tune/tuneup.c (DIVREM_1_NORM_THRESHOLD, DIVREM_1_UNNORM_THRESHOLD,
21780 MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD): Tune these.
21781 * gmp-impl.h [TUNE_PROGRAM_BUILD]: Support for this.
21782 * tune/Makefile.am (TUNE_MPN_SRCS): Add divrem_1.c and mod_1.c.
21784 * gmp-impl.h (UDIV_NORM_PREINV_TIME): Renamed from UDIV_PREINV_TIME.
21785 * mpn/generic/perfsqr.c, mpn/generic/sb_divrem_mn.c,
21786 mpn/x86/*/gmp-mparam.h: Ditto.
21787 * gmp-impl.h (UDIV_UNNORM_PREINV_TIME): New define.
21789 * configure.in (AC_C_INLINE, HAVE_INLINE): New test and define.
21790 * gmp-impl.h (inline): Remove, use config.h.
21791 (_EXTERN_INLINE): Redefine based on HAVE_INLINE.
21792 (mpn_zero_p): Use HAVE_INLINE.
21794 * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Don't add flags to a user
21795 selected $AR or $NM.
21797 * tune/tuneup.c (all): Print how long the tuning took.
21799 * configure.in (AM_C_PROTOTYPES): Use this, not GMP_ANSI2KNR.
21800 * acinclude.m4 (GMP_ANSI2KNR): Remove.
21802 * Makefile.am (gmp.h, mp.h): In DISTCLEANFILES not CLEANFILES.
21804 * gmp-h.in (mpn_divmod, mpn_divmod_1, mpn_divexact_by3): Cast some
21805 zeros, for the benefit of K&R if long!=int.
21807 * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add "*" for
21808 the benefit of cray.
21810 * compat.c (mpn_divexact_by3, mpn_divmod_1): Return types should be
21811 mp_limb_t, not int, and need an actual "return".
21813 2000-12-05 Torbjorn Granlund <tege@swox.com>
21815 * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
21816 * mpn/alpha/gmp-mparam.h: Tune for 21064.
21818 * longlong.h: Reformat to avoid newlines within strings.
21820 * gmp-impl.h (inline): Disable if GCC has defined __STRICT_ANSI__.
21822 * configure.in: Do a `mkdir tune' before creating tune/sqr_basecase.c.
21824 * Makefile.am: Treat mp.h analogously to gmp.h.
21826 configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc.
21828 * mp-h.in: Renamed from mp.h.
21829 Add #define for _LONG_LONG_LIMB.
21830 Move some other fixes from gmp-h.in.
21832 * configure.in: Generate mp.h from mp-h.in like we handle
21835 2000-12-04 Torbjorn Granlund <tege@swox.com>
21837 * acinclude.m4: Fix typo testing for bad HP compiler.
21839 2000-12-03 Torbjorn Granlund <tege@swox.com>
21841 * mpbsd/tests/t-misc.c (check_itom): Exclude some tests for Cray
21844 * longlong.h (CRAYIEEE umul_ppmm): New.
21846 * mpn/cray/gmp-mparam.h (BITS_PER_SHORTINT): 32 => 64.
21847 (*_THRESHOLD): Tune.
21849 * configure.in: Disable shared libs for *-*-unicos*.
21851 2000-12-03 Kevin Ryde <kevin@swox.se>
21853 * configure.in, tune/Makefile.am: Create tune/sqr_basecase.c during
21854 configure, and use it unconditionally in $(nodist_tuneup_SOURCES).
21855 Fixes a problem with sqr_basecase.lo under --disable-static.
21857 2000-12-01 Torbjorn Granlund <tege@swox.com>
21859 * mpf/tests/t-get_d.c (LOW_BOUND,HIGH_BOUND): #define for non-IEEE
21862 * gmp-impl.h (union ieee_double_extract): Test for _CRAYIEEE.
21864 2000-11-30 Torbjorn Granlund <tege@swox.com>
21866 * mpz/tests/t-mul.c (base_mul): Fix re-evaluation problems in macro
21868 (ref_mpz_mul): New name from mpz_refmul. Make static.
21869 (base_mul): New name for _mpn_mul_classic.
21871 2000-11-30 Kevin Ryde <kevin@swox.se>
21873 * configure.in: Rewrite of CC/CFLAGS selection scheme, introduce a
21874 notion of ABI, merge compiler and mpn path selection, add flags
21875 selection for AR and NM, let CC without CFLAGS work.
21876 (AC_PROG_CC): Use this, not GMP_SELECT_CC.
21877 * acinclude.m4 (GMP_PROG_CC_WORKS): Don't use AC_TRY_COMPILE, combine
21878 cc/cflags parameter.
21879 (GMP_PROG_CC_FIND, GMP_CHECK_CC_64BIT, GMP_PROG_CC_SELECT): Remove.
21880 * gmp.texi (Installing GMP): Updates for new scheme.
21882 * configure.in (AC_CANONICAL_HOST): Use this and $host, not $target.
21883 * acinclude.m4, acconfig.h, longlong.h, mpn/x86/x86-defs.m4,
21884 mpn/x86/k7/mmx/popham.asm: Ditto, renaming HAVE_TARGET_CPU to
21886 * gmp.texi (Build Options, and elsewhere): Update.
21888 * acinclude.m4 (GMP_COMPARE_GE): New macro.
21889 (GMP_GCC_MARCH_PENTIUMPRO): Use it, add CC parameter, check for GCC.
21890 (GMP_HPC_HPPA_2_0): New macro, adapted from GMP_CHECK_CC_64BIT.
21892 * acinclude.m4 (GMP_PROG_AR): New macro, using AC_CHECK_TOOL, adding
21894 * configure.in: Use it
21896 * gmp-h.in: Renamed from gmp.h.
21897 (@define_LONG_LONG_LIMB@): Placeholder for instantiation.
21898 (__GNU_MP__): Bump to 3.
21899 * acinclude.m4 (GMP_VERSION): Get version from gmp-h.in.
21900 * configure.in: Create gmp.h from gmp-h.in to set _LONG_LONG_LIMB.
21901 * gmp.texi.h (ABI and ISA): Mention this.
21902 * acconfig.h (_LONG_LONG_LIMB): Remove undef.
21903 * Makefile.am: Distribute gmp-h.in, not gmp.h.
21905 * configure.in (AC_PROG_CPP, AC_PROG_INSTALL, AC_PROG_LN_S): Remove,
21906 dragged in by other macros.
21907 (gmp_asm_syntax_testing): Renamed from gmp_no_asm_syntax_testing.
21908 (AC_EXEEXT, AC_OBJEXT): Remove, done automatically by libtool.
21909 * configure.in, acinclude.m4: Remove "" from "`foo`", being
21910 unnecessary and not portable.
21912 * configure.in (GMP_LDFLAGS): New AC_SUBST flags for libtool link.
21913 (powerpc64*-*-aix*): Use for -Wc,-maix to fix shared library creation,
21914 but can't build shared and static at the same time.
21915 * Makefile.am (libgmp_la_LDFLAGS, libmp_la_LDFLAGS): Use
21917 * gmp.texi (Notes for Particular Systems): Update AIX problem
21919 * configure.in (AC_CONFIG_LINKS): Use where needed, not via gmp_links.
21920 (gmp_srclinks): Build up as needed, not via gmp_links.
21922 * acinclude.m4 (GMP_INIT): Do CONFIG_TOP_SRCDIR and asm-defs.m4 here.
21923 * configure.in (asm-defs.m4): Consequent changes.
21925 * acinclude.m4 (GMP_INCLUDE_MPN): Using include_mpn(), replacing
21926 GMP_INCLUDE and GMP_SINCLUDE.
21927 * configure.in (gmp_m4postinc): Remove this scheme, use
21928 GMP_INCLUDE_MPN instead.
21930 * configure.in (*-*-sco3.2v5*): Force ac_cv_archive_cmds_need_lc=no,
21931 until libtool does this itself.
21932 * gmp.texi (Known Build Problems): Remove SCO -lc problem.
21934 * configure, INSTALL.autoconf, etc: Update to autoconf 2000-11-29.
21935 * acinclude.m4 (GMP_C_SIZES): Use AC_CHECK_SIZEOF.
21936 * gmp.texi (Known Build Problems): Remove version.c sed/config.h
21939 * ltmain.sh, aclocal.m4: Update to libtool 2000-11-25.
21940 * ltconfig: No longer required, but leave an empty dummy for automake.
21941 * gmp.texi (Known Build Problems): Remove SunOS native ar ranlib
21944 * */Makefile.in, aclocal.m4: Update to automake 2000-11-25.
21945 * mpbsd/tests/Makefile.am, mpfr/tests/Makefile.am (check_PROGRAMS):
21946 Remove dummy, no longer required.
21947 * mpbsd/tests/dummy.c, mpfr/tests/dummy.c: Remove files.
21948 * depcomp: Remove file, no longer required (with no-dependencies).
21950 * texinfo.tex: Update to 2000-11-09.
21951 * gmp.texi (Build Options): Mention PDF from gmp.texi.
21952 * Makefile.am (MOSTLYCLEANFILES): Add gmp.tmp, from new texinfo.tex.
21954 * gmp.texi (Build Options): List alphaev56, alphapca56, alphaev67,
21955 hppa2.0n and power among supported CPUs.
21957 2000-11-30 Torbjorn Granlund <tege@swox.com>
21959 * mpz/tests/t-mul.c: Increase max operand size from 2^17 bits
21960 to 2^19 bits. Misc cleanups.
21962 2000-11-26 Kevin Ryde <kevin@swox.se>
21964 * tune/tuneup.c (FIB_THRESHOLD): Cope better with different speeds of
21965 odd and even sizes.
21967 * longlong.h (alpha): Use udiv_qrnnd and count_leading_zeros on all
21968 compilers, not just gcc.
21970 * pre_mod_1.c: Use conditional subtract to always skip a division.
21971 (UMUL_TIME, UDIV_TIME): Remove defaults, now in longlong.h.
21973 2000-11-22 Torbjorn Granlund <tege@swox.com>
21975 * mpn/pa64w/gmp-mparam.h: Retune.
21976 * mpn/pa64/gmp-mparam.h: Retune.
21977 * mpn/sparc64/gmp-mparam.h: Retune.
21979 2000-11-22 Kevin Ryde <kevin@swox.se>
21981 * gmp-impl.h (ABOVE_THRESHOLD, BELOW_THRESHOLD): New macros.
21982 * mpn/generic/gcdext.c: Use them.
21984 * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Force only one step.
21985 * tune/gcdextos.c, tune/gcdextod.c: New files, one step gcdext, single
21987 * tune/Makefile.am (libspeed_la_SOURCES): Add them.
21988 (TUNE_MPN_SRCS): Remove gcdext.c.
21989 * tune/speed.h, tune/common.c, tune/speed.c: Add measuring.
21990 * tune/tuneup.c: Use for GCDEXT_THRESHOLD, plus check if double limb
21991 is ever better. Should be more accurate, and hopefully faster.
21993 * tune/gcdext_single.c: New file, gcdext forced to single limbs.
21994 * tune/Makefile.am: Add it.
21995 * tune/speed.h, tune/common.c, tune/speed.c: Add measuring, and of
21998 * tune/speed.h (speed_params r): Use mp_limb_t, not long.
21999 * tune/speed.h, tune/common.c: Don't "switch" on "r".
22000 * tune/speed.c (r_string): Accept limb sized constants.
22001 (choice scale): Add a scale factor (eg. "2.33*mpn_add_n").
22002 * tune/common.c (SPEED_ROUTINE_UDIV_QRNND_A): Default r to
22003 __mp_bases[10].big_base, being a full limb value.
22005 * configure.in (alphapca56*-*-*): Use ev5 mpn path.
22006 (am29000*-*-*): Remove this, leave the canonical a29k.
22007 (z8k*-*-*, z8kx*-*-*): Changed from z8000, since z8k is canonical.
22008 (gmp_mpn_functions_optional): Add invert_limb, use for alpha and ia64.
22010 * configure.in (alloca): Accept yes/no/detect, generate an error if
22011 "yes" but not available.
22012 * gmp.texi (Build Options): Update.
22014 * acinclude.m4 (GMP_TRY_ASSEMBLE): Make conftest.out available.
22015 (GMP_ASM_ALIGN_FILL_0x90): Use it.
22017 * acinclude.m4 (GMP_ASM_X86_MMX) [*-*-solaris*]: Check for solaris
22019 * gmp.texi (Notes for Particular Systems): Update x86 MMX note.
22021 2000-11-21 Torbjorn Granlund <tege@swox.com>
22023 * tune/Makefile.am (EXTRA_DIST): List hppa2w.asm.
22025 * tune/hppa2.asm: Change level directive to "2.0n".
22026 * tune/hppa2w.asm: New file.
22027 * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Separate out hppa2.0w.
22029 * mpn/pa64/gmp-mparam.h (BITS_PER_LONGINT): 64 => 32.
22031 2000-11-21 Kevin Ryde <kevin@swox.se>
22033 * urandom.h (random): No prototype if glibc stdlib.h has already
22034 provided it (avoids an int32_t/long conflict).
22036 * tune/Makefile.am (LDFLAGS): Use -all-static.
22037 (speed-dynamic): Dynamic linked version of speed.c.
22038 * tune/README: Update.
22040 * mpn/generic/gcd.c (find_a): Use native version if available.
22041 * acconfig.h (HAVE_NATIVE_mpn_gcd_finda): Add #undef.
22042 * gmp-impl.h (mpn_gcd_finda): Add prototype and define.
22043 * mpn/asm-defs.m4 (mpn_gcd_finda): New define_mpn.
22044 * tune/gcd_finda_gen.c: #undef any HAVE_NATIVE_mpn_gcd_finda.
22045 * configure.in (gmp_mpn_functions_optional): Add gcd_finda.
22046 * mpn/x86/k6/gcd_finda.asm: New file.
22048 * tune/tuneup.c (POWM_THRESHOLD): Slightly bigger size steps.
22050 * gmp-impl.h (__GMP_IMPL_H__): Protect against multiple inclusion.
22051 * tune/gcd_bin.c, tune/powm_mod.c, tune/powm_redc.c: Use #undef after
22052 gmp-impl.h to force thresholds.
22053 * tune/tuneup.c (print_define, fft): No need for #ifndefs on
22054 thresholds any more.
22056 2000-11-20 Torbjorn Granlund <tege@swox.com>
22058 * mpz/tests/t-powm.c: Analogous changes as made 2000-11-12 to t-mul.c.
22059 * mpz/tests/t-powm_ui.c: Likewise.
22060 * mpz/tests/t-pow_ui.c: Likewise.
22061 * mpz/tests/t-root.c: Likewise.
22063 * configure.in [compiler switch]: Pass "-Aa -D_HPUX_SOURCE" to cc for
22066 * mpn/hppa/hppa1_1/udiv_qrnnd.S: Reference data using PC relative
22067 addressing (was r19 relative addressing).
22069 2000-11-18 Torbjorn Granlund <tege@swox.com>
22071 * rand.c: (__gmp_rand_lc_scheme): Convert strings to hexadecimal.
22072 (gmp_randinit): Expect strings in hexadecimal.
22074 2000-11-18 Kevin Ryde <kevin@swox.se>
22076 * configfsf.guess, configfsf.sub: Update to 2000-11-16.
22077 * config.guess (alpha*-*-openbsd*): Do exact cpu detection.
22079 2000-11-14 Torbjorn Granlund <tege@swox.com>
22081 * mpz/tests/t-fdiv.c: Analogous changes as made 2000-11-12 to t-mul.c.
22082 * mpz/tests/t-tdiv_ui.c: Likewise.
22083 * mpz/tests/t-fdiv_ui.c: Likewise.
22084 * mpz/tests/t-sqrtrem.c: Likewise.
22085 * mpz/tests/t-gcd.c: Likewise.
22087 2000-11-13 Kevin Ryde <kevin@swox.se>
22089 * mpn/Makeasm.am: New file, splitting out assembler rules.
22090 * mpn/Makefile.am, tune/Makefile.am: Use it.
22092 * mpn/Makefile.am (@CPP@): Remove this, automake already gives it.
22094 * configure.in (AC_CHECK_LIBM): New test, and AC_SUBST it.
22095 * Makefile.am (MPFR_LIBADD_OPTION): Use it.
22096 * demos/Makefile.am (qcn_LDADD): Ditto.
22097 * tune/Makefile.am (libspeed_la_LIBADD): Ditto.
22098 * tests/rand/Makefile.am (libstat_la_LIBADD): Ditto.
22100 * tune/time.c (timeval_diff_secs): Better calculation.
22101 (read_real_time): New measuring method for AIX power/powerpc.
22102 (speed_endtime): Protect against negative times.
22103 * tune/common.c (speed_measure): Protect against big reps.
22104 * tune/freq.c (speed_cpu_frequency_measure_one): Better timeval diff.
22105 * tune/speed.h (TIMEVAL_DIFF_SEC,USEC): Remove macros.
22106 * configure.in: (sys/systemcfg.h, read_real_time): New tests.
22108 2000-11-13 Torbjorn Granlund <tege@swox.com>
22110 * mpz/tests/t-mul.c: Remove #include urandom.h.
22111 * mpz/tests/t-tdiv.c: Likewise.
22113 * configure.in [SPEED_CYCLECOUNTER_OBJS switch]:
22114 Declare hppa.asm as just 32 bits (cyclecounter_size=1).
22116 2000-11-12 Torbjorn Granlund <tege@swox.com>
22118 * mpz/tests/t-mul.c
22119 (main): Generate random numbers using gmp_rand* functions.
22120 (main): Distribute random numbers non-uniformly.
22121 (main): Seed by current time if GMP_CHECK_RANDOMIZE is set.
22122 (_mpn_mul_classic): Streamline.
22123 * mpz/tests/t-tdiv.c: Analogous changes.
22125 * demos/pexpr.c (HAVE_sigaltstack): Fix typo in testing for _UNICOS.
22126 Also test for __hpux.
22128 2000-11-11 Torbjorn Granlund <tege@swox.com>
22130 * mpn/alpha/ev5/gmp-mparam.h: Retune.
22132 * mpn/alpha/ev6/gmp-mparam.h: Retune.
22134 * mpn/alpha/ev6/add_n.asm: Misc cleanups.
22136 * mpn/alpha/ev6/sub_n.asm: New file.
22138 2000-11-10 Torbjorn Granlund <tege@swox.com>
22140 * configure.in [path switch] (alphaev6*-*-*): Add alpha/ev5 to path.
22142 * mpn/alpha/ev6/add_n.asm: New file.
22144 2000-11-10 Kevin Ryde <kevin@swox.se>
22146 * mpz/powm.c (redc): Make global under WANT_REDC_GLOBAL.
22147 * tune/powm_mod.c, tune/powm_redc.c: New files.
22148 * tune/Makefile.am (libspeed_la_SOURCES): Add them.
22149 * tune/*: Add measuring of redc, mpz_mod, mpz_powm_mod, mpz_powm_redc.
22151 * tune/tuneup.c (POWM_THRESHOLD): Determine from redc and mpz_mod.
22152 * tune/Makefile.am (TUNE_MPZ_SRCS): Remove powm.
22154 2000-11-10 Torbjorn Granlund <tege@swox.com>
22156 * mpn/mips3/gmp-mparam.h: Retune.
22158 * configure.in (os_64bit): Rename to check_64bit_compiler.
22160 2000-11-09 Torbjorn Granlund <tege@swox.com>
22162 * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Choose hppa/hppa2 code
22163 depending on $CC64.
22165 2000-11-09 Kevin Ryde <kevin@swox.se>
22167 * mpn/x86/pentium/mul_1.asm: Unroll 2x, saving 1 c/l when in L1.
22169 * mpn/x86/pentium/aorsmul_1.asm: Add 1c entrypoints, shave a couple
22170 of cycles at entry and exit.
22172 * configure.in (power1,2,2sc): Support these as synonyms for plain
22175 * acinclude.m4 (GMP_ASM_X86_SHLDL_CL): GMP_DEFINE WANT_SHLDL_CL here.
22176 (GMP_ASM_X86_MMX, GMP_ASM_X86_SHLDL_CL): Add X86 into the names.
22177 * configure.in: Consequent changes.
22179 * gmp.texi (Notes for Particular Systems): Remarks about power/powerpc.
22180 (Reentrancy): Remarks about simultaneous writing.
22181 (Reporting Bugs): Ask for configfsf.guess.
22183 2000-11-08 Kevin Ryde <kevin@swox.se>
22185 * acinclude.m4 (GMP_FUNC_ALLOCA): New macro.
22186 * configure.in: Use it.
22187 * gmp-impl.h (alloca): Conditionals and setups as per autoconf
22188 (should make alloca available on more non-gcc compilers).
22190 * acinclude.m4: Misc reformatting, simplify some quoting.
22191 (GMP_ASM_UNDERSCORE, GMP_ASM_X86_MCOUNT): Use $CC $CFLAGS $CPPFLAGS.
22192 (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_FILL_0x90, GMP_ASM_RODATA): Put
22193 AC_REQUIREs outside AC_CACHE_CHECK.
22194 (GMP_C_SIZES): Use $srcdir/gmp.h, not -I; use $CPPFLAGS.
22195 (GMP_ASM_UNDERSCORE): Use "gmp_compile" variable, and only rm
22196 conftes1* conftes2*.
22197 (GMP_PROG_NM): New macro, require it in appropriate GMP_ASM_*.
22198 (GMP_TRY_ASSEMBLE): New macro, use it in various GMP_ASM_*.
22199 * configure.in: Use GMP_PROG_NM.
22201 * mpn/tests/spinner.c (spinner_signal): Use RETSIGTYPE.
22202 (spinner_init): Force output to unbuffered.
22204 * mpn/x86/README.family: Notes about GOT table and imul, misc updates.
22205 * mpn/x86/k7/diveby3.asm: Change to 3 operands for immediate imul.
22206 * mpn/x86/k6/diveby3.asm: Ditto.
22208 2000-11-06 Torbjorn Granlund <tege@swox.com>
22210 * urandom.h: Simplify and make it work properly for 64-bit
22211 machines also in environments without `random'.
22213 2000-11-04 Torbjorn Granlund <tege@swox.com>
22215 * configure.in [path switch]: Don't match rs6000-*-*, in
22216 particular don't assume POWER.
22218 * tune/tuneup.c (fft): Remove usleep calls.
22220 * config.guess: Don't pass "$@" when it is known to be empty.
22222 * Makefile.am (EXTRA_DIST): List configfsf.guess and configfsf.sub.
22224 2000-11-04 Kevin Ryde <kevin@swox.se>
22226 * configfsf.guess, configfsf.sub: Moved from config.guess and
22228 * config.guess, config.sub: New files, wrappers around around
22229 configfsf versions.
22230 * configfsf.guess: Update to FSF 2000-10-23.
22231 * configfsf.sub: Update to FSF 2000-10-25.
22233 * acinclude.m4 (GMP_ASM_POWERPC_R_REGISTERS): New macro.
22234 * mpn/powerpc32/powerpc-defs.m4: New file, regmap.m4 r0 etc macros
22235 conditionalized by GMP_ASM_POWERPC_R_REGISTERS.
22236 * mpn/powerpc32/regmap.m4: Remove file.
22237 * configure.in (powerpc*-*-*): Use all this.
22239 * mpz/divegcd.c: New file, providing mpz_divexact_gcd.
22240 * Makefile.am, mpz/Makefile.am: Add it.
22241 * gmp-impl.h (mpz_divexact_gcd): Add prototype.
22242 * mpq/aors.c,canonicalize.c,div.c,mul.c: Use it.
22244 * longlong.h [pentium] (count_leading_zeros): New macro.
22245 (__clz_tab): Always provide prototype.
22246 * acconfig.h (HAVE_TARGET_CPU_): Add x86s.
22248 * tune/speed.[ch],common.c (count_leading_zeros,
22249 count_trailing_zeros, __udiv_qrnnd_c): Add measuring.
22251 * configure.in (X86_PATTERN): Move from here ...
22252 * acinclude.m4 (X86_PATTERN): ... to here.
22253 (GMP_ASM_RODATA): Use it.
22255 * configure.in (srandom): New test.
22256 * mpn/tests/try.c: Use it.
22257 * tune/speed.c: Ditto, and conditionalize getrusage and headers.
22259 2000-11-02 Kevin Ryde <kevin@swox.se>
22261 * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add udiv_qrnnd.c
22264 * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove a duplicate
22265 subtract at the evaluate stage.
22267 2000-11-01 Torbjorn Granlund <tege@swox.com>
22269 * configure.in [compiler switch] (sparc64-*-linux*): Spell
22270 gmp_xoptcflags_gcc properly, and pass same options as for other
22273 * tune/speed.h (SPEED_ROUTINE_MPN_GET_STR): Fix type of wsize.
22275 2000-10-31 Torbjorn Granlund <tege@swox.com>
22277 * configure.in [compiler switch] (sparc64-*-linux*): Remove -mvis
22278 from gmp_xoptflags_gcc, this might not be an ultrasparc.
22279 Remove -m32 from gmp_cflags_gcc; add -Wa,-xarch=v8plus.
22281 2000-10-29 Torbjorn Granlund <tege@swox.com>
22283 * mpn/ia64/lorrshift.asm: New file.
22285 * configure.in: New mulfunc `lorrshift' for lshift and rshift.
22287 2000-10-29 Kevin Ryde <kevin@swox.se>
22289 * mpn/generic/mul_n.c (mpn_kara_sqr_n): Delete code performing
22290 superfluous mpn_sub_n calls.
22292 * configure.in (found_asm, M4): Account for SPEED_CYCLECOUNTER_OBJ,
22293 for the benefit of targets whose only .asm is a cycle counter.
22295 * tune/tuneup.c (fft): Remove bogus usleep calls.
22297 2000-10-28 Torbjorn Granlund <tege@swox.com>
22299 * mpn/ia64/invert_limb.asm: Get return value for 0x800...00 right.
22301 * tune/Makefile.am (EXTRA_DIST): Add ia64.asm.
22303 * tune/ia64.asm: Fix typo.
22305 * add_n.asm addmul_1.asm mul_1.asm popcount.asm sub_n.asm:
22306 Preserve ar.lc as required by ABI.
22307 * longlong.h (ia64 udiv_qrnnd): New.
22309 * configure.in [path switch] (ia64*-*-*): Set extra_functions.
22310 * mpn/ia64/invert_limb.asm: New file.
22312 2000-10-27 Torbjorn Granlund <tege@swox.com>
22314 * configure.in [compiler switch]:
22315 Get rid of c89 for all hppa flavours--it is an evil compiler!
22317 * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix type of xp.
22318 (SPEED_ROUTINE_MPN_GET_STR): Fix type of wp.
22320 2000-10-27 Kevin Ryde <kevin@swox.se>
22322 * gmp.texi (Fibonacci Number Algorithm): New section.
22324 * mpz/tests/t-fib_ui.c: New file.
22325 * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
22327 * mpz/fib_ui.c: Rewrite, same formulas but using mpn functions and
22328 some lookup tables, much faster at small to moderate sizes.
22329 * gmp-impl.h (MPZ_FIB_SIZE): New macro.
22330 (FIB_THRESHOLD): Establish default here.
22331 * tune/tuneup.c (FIB_THRESHOLD): Start search after the new table
22334 * mpn/x86/x86-defs.m4 (mcount_movl_GOT_ebx): Rename from movl_GOT_ebx,
22335 and don't use GSYM_PREFIX with _GLOBAL_OFFSET_TABLE_.
22337 * tune/freq.c (speed_cpu_frequency_measure): New test comparing
22338 gettimeofday and speed_cyclecounter, should cover many systems.
22340 2000-10-27 Torbjorn Granlund <tege@swox.com>
22342 * mpn/ia64/gmp-mparam.h: Retune.
22344 2000-10-26 Torbjorn Granlund <tege@swox.com>
22346 * longlong.h (ia64): Set UMUL_TIME and UDIV_TIME.
22348 * mpn/ia64/submul_1.c: Fix typo.
22350 2000-10-25 Kevin Ryde <kevin@swox.se>
22352 * tune/freq.c (speed_cpu_frequency_sysctl): New test, supporting
22353 hw.model for BSD flavours.
22354 * configure.in (sysctl, sys/param.h): New tests.
22356 2000-10-24 Torbjorn Granlund <tege@swox.com>
22358 * tune/freq.c: Explicitly #include config.h before other include files.
22360 * mpz/tests/reuse.c (FAIL2): New #define.
22361 (main): Use FAIL2. Now this test properly returns non-zero exit
22362 status when it fails.
22364 * mpn/powerpc32/gmp-mparam.h: Retune.
22365 * mpn/powerpc64/gmp-mparam.h: Retune.
22367 2000-10-24 Kevin Ryde <kevin@swox.se>
22369 * mpn/x86/k6/cross.pl: Support 8 and 16 byte code alignment.
22371 * mpq/aors.c, mpq/canonicalize.c: Skip two mpz_divexact calls if
22372 gcd gives 1, which should be 60% of the time.
22373 * gmp-impl.h (MPZ_EQUAL_1_P): New macro.
22374 * mpq/mul.c, mpq/div.c: Use it, and a new DIV_OR_SET.
22376 * tune/tuneup.c (xp_block, yp_block): Initialize these with random
22377 data. Fixes GCD_ACCEL and GCDEXT thresholds, and latest POWM.
22379 2000-10-23 Torbjorn Granlund <tege@swox.com>
22381 * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Add ia64 case.
22383 * mpn/ia64/gmp-mparam.h: Fill in some parameters.
22385 * mpn/ia64/submul_1.c: New file.
22387 * tune/ia64.asm: New file.
22389 * gmp-impl.h (union ieee_double_extract): Handle ia64.
22391 * mpn/mp_bases.c: Decrease chars_per_bit_exactly for entry 1 to
22392 work around buggy ia64-linux.
22394 * longlong.h (ia64 umul_ppmm): Update register flags to match new GCC.
22396 2000-10-22 Torbjorn Granlund <tege@swox.com>
22398 * mpn/alpha/ev6/gmp-mparam.h (DC_THRESHOLD): Update.
22399 * mpn/alpha/ev6/submul_1.asm: New file.
22401 2000-10-22 Kevin Ryde <kevin@swox.se>
22403 * tune/gcd_bin.c: New file.
22404 * tune/gcd_finda_gen.c: New file.
22405 * tune/Makefile.am (libspeed_la_SOURCES): Add them.
22406 * tune/speed.[ch],common.c (mpn_gcd_binary, find_a): Add measuring.
22408 * * (__gmp_allocate_func etc): Rename from _mp_allocate_func etc.
22409 (__gmp_default_allocate etc): Rename from _mp_default_allocate etc.
22410 * gmp-impl.h (__GMP_REALLOCATE_FUNC_TYPE,
22411 __GMP_REALLOCATE_FUNC_LIMBS): New macros.
22413 * gmp-impl.h (DC_THRESHOLD): Establish default here, set to 3*KARA
22414 since that's the measured average.
22415 * mpn/generic/dc_divrem_n.c, mpn/generic/tdiv_qr.c (DC_THRESHOLD):
22418 2000-10-21 Torbjorn Granlund <tege@swox.com>
22420 * mpn/Makefile.am (TARG_DIST): Add ia64.
22422 2000-10-21 Kevin Ryde <kevin@swox.se>
22424 * *: Change BZ -> DC.
22425 * mpn/generic/dc_divrem_n.c: Renamed from bz_divrem_n.c.
22427 * doc/multiplication: Remove file, now in the manual.
22428 * doc/assembly_code: Ditto.
22429 * tune/README: Remove some parts now in the manual.
22431 * gmp.texi (@m etc): Add and use some new macros.
22432 (Integer Division - mpz_[cft]div_*): Merge descriptions, for brevity
22433 and to emphasise similarities.
22434 (Low-Level Functions - mpn_[lr]shift): Specify count as 1 to
22435 mp_bits_per_limb-1.
22436 (Algorithms): New chapter.
22437 (References): Add some papers.
22439 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove some
22441 * mpn/generic/mul_fft.c (mpn_fft_best_k): Ditto.
22443 * tune/freq.c: New file, split from time.c.
22444 * tune/time.c: Rewrite, now more automated.
22445 * configure.in, tune/*: Consequent changes.
22447 2000-10-20 Torbjorn Granlund <tege@swox.com>
22449 * mpn/ia64/default.m4: New file.
22450 * configure.in [config.m4 switch] (ia64*-*-*): Use ia64/default.m4.
22452 * mpn/ia64/mul_1.asm: New file.
22453 * mpn/ia64/addmul_1.asm: New file.
22454 * mpn/ia64/add_n.asm: New file.
22455 * mpn/ia64/sub_n.asm: New file.
22456 * mpn/ia64/popcount.asm: New file.
22457 * mpn/ia64/README: New file.
22459 * mpn/alpha/cntlz.asm: Override `.set noat' from ASM_START.
22461 * configure.in (HAVE_TARGET_CPU_*): Support hppa1.0, hppa1.1, hppa2.0
22462 by sed'ing the period into `_'.
22464 * acconfig.h: Add #undefs for hppa targets.
22466 * longlong.h (udiv_qrnnd): Fix typo in last change.
22468 * mpz/tstbit.c: Rewrite (partly to work around GCC 2.95.2 HPPA bug).
22470 * configure.in [path switch]:
22471 (hppa2.0*-*-*): For non-CC64 case, update path.
22473 * configure.in [compiler switch]:
22474 (hppa2.0w-*-*): Match with same regexp in both places.
22475 (hppa*-*-*): New case.
22476 (all hppa alternatives): Don't inherit default gmp_cflags_cc,
22479 2000-10-18 Torbjorn Granlund <tege@swox.com>
22481 * configure.in (alpha*-*-*): Define gmp_xoptcflags_gcc like for
22484 * longlong.h (x86 udiv_qrnnd): Change `d' => `dx' to avoid K&R C
22487 2000-10-15 Kevin Ryde <kevin@swox.se>
22489 * doc/configuration: Updates.
22491 * demos/calc.y: Remove some comments.
22493 2000-10-14 Kevin Ryde <kevin@swox.se>
22495 * gmp.texi (Parameter Conventions, Memory Management): New sections
22496 split from "Variable Conventions".
22497 (Efficiency, Debugging, Profiling): New sections in "GMP Basics".
22498 (Reentrancy): Some rewording, add note on standard I/O.
22499 (Build options): Add --enable-assert and --enable-profiling.
22501 * configure.in (--enable-profiling): New option.
22502 * acinclude.m4 (GMP_ASM_X86_MCOUNT): New macro, finding how to profile.
22503 * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_mcount): Profiling support.
22505 * acinclude.m4, configure.in (GMP_ASM_*): Rename from GMP_CHECK_ASM_*,
22506 to follow autoconf conventions.
22508 * configure.in: Run GMP_CHECK_ASM tests only if needed.
22509 * acinclude.m4 (GMP_CHECK_ASM_MMX): Don't use GMP_CHECK_ASM_TEXT.
22511 * mpn/x86/x86-defs.m4 (ASSERT): Allow no condition, to just emit code.
22513 2000-10-13 Kevin Ryde <kevin@swox.se>
22515 * mpq/md_2exp.c: New file.
22516 * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
22517 * Makefile.am (MPQ_OBJECTS): Ditto.
22518 * gmp.h (mpq_mul_2exp, mpq_div_2exp): Add prototypes.
22519 * gmp.texi (Rational Arithmetic): Add documentation.
22521 * mpq/tests/t-md_2exp.c: New file.
22522 * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
22524 * mpn/generic/perfsqr.c: Add/amend some comments.
22526 * gmp.texi (Known Build Problems): Note VERSION problem with old
22527 sed, do some minor rewording.
22528 (Build Options): Add cygwin and djgpp URLs, mention INSTALL.autoconf,
22530 (Getting the Latest Version of GMP): Move this ...
22531 (Introduction to GMP): ... to here.
22532 (Compatibility with older versions): Just refer to 2.x and 3.x, not
22533 every minor version.
22534 (Initializing Integers): Note restrictions on mpz_array_init'ed
22536 (Integer Logic and Bit Fiddling): Note bits are numbered from 0.
22538 * INSTALL.autoconf: New file.
22539 * Makefile.am (EXTRA_DIST): Add it.
22541 * tune/Makefile.am, tune/tuneup.c, configure.in, gmp-impl.h: New
22542 scheme for recompiled objects used by tune program. Don't use
22543 libgmptune.a, make better use of libtool, work with ansi2knr.
22545 * tune/speed.h,common.c (SPEED_ROUTINE_MPZ_POWM): Use s->yp and
22546 s->xp_block, make exponent a fixed size.
22548 2000-10-07 Torbjorn Granlund <tege@swox.com>
22550 * mpn/mips3/gmp-mparam.h: Retune.
22552 * mpn/generic/mul_n.c (USE_MORE_MPN): Revert last change.
22554 2000-10-06 Torbjorn Granlund <tege@swox.com>
22556 * mpn/mips3/add_n.s: Decrease carry recurrence from 4 to 3 cycles.
22557 * mpn/mips3/sub_n.s: Likewise.
22559 2000-10-04 Torbjorn Granlund <tege@swox.com>
22561 * configure.in (sparc64-*-linux*): Set path according to CC64.
22563 2000-10-04 Kevin Ryde <kevin@swox.se>
22565 * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Use LABEL_SUFFIX, not a
22568 * config.sub: Don't demand "86" in CPU name for SCO.
22570 * configure.in (supersparc-*-*): Remove -DSUPERSPARC.
22571 * longlong.h: Use HAVE_TARGET_CPU_supersparc.
22573 * configure.in (HAVE_TARGET_CPU_*): AC_DEFINE from $target_cpu.
22574 * acconfig.h: Add #undefs, but only for targets of interest.
22576 2000-10-03 Torbjorn Granlund <tege@swox.com>
22578 * mpn/alpha/cntlz.asm: Rewrite.
22580 * mp_clz_tab.c (__clz_tab): Half table size to 128 entires.
22581 * longlong.h (count_leading_zeros): Demand just 128 entries from
22584 * configure.in (mips-sgi-irix6.*): Pass -mips3 in addition to options
22587 * longlong.h: Move NO_ASM test around all assembly code.
22589 * longlong.h (count_leading_zeros): Sparclite scan instruction was
22590 being invoked incorrectly.
22591 Replace __mc68332__ with __mcpu32__.
22594 2000-10-02 Torbjorn Granlund <tege@swox.com>
22596 * mpn/mips3/gmp-mparam.h: Retune for both gcc and cc.
22598 * mpn/generic/mul_n.c (USE_MORE_MPN): Remove exception for __mips.
22599 (interpolate3): Cast mp_limb_t variables to mp_limb_signed_t
22600 when testing sign bit.
22602 * mpn/alpha/ev6/gmp-mparam.h: Retune.
22603 * mpn/powerpc32/gmp-mparam.h: Retune.
22604 * mpn/powerpc64/gmp-mparam.h: Retune.
22605 * mpn/x86/pentium/gmp-mparam.h: Retune.
22606 * mpn/x86/pentium/mmx/gmp-mparam.h: Retune.
22607 * mpn/sparc32/v9/gmp-mparam.h: Retune.
22608 * mpn/x86/k6/gmp-mparam.h: Retune.
22609 * mpn/x86/p6/gmp-mparam.h: Retune.
22610 * mpn/x86/k7/gmp-mparam.h: Retune.
22611 * mpn/sparc64/gmp-mparam.h: Retune.
22613 * mpn/m68k/gmp-mparam.h: New file.
22614 * mpn/alpha/ev5/gmp-mparam.h: New file.
22616 * gmp-impl.h (default MPN_COPY): Remove final `;'.
22618 * tune/time.c (speed_endtime): Rewrite.
22620 * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Set base to a large value,
22623 * demos/pexpr.c (setup_error_handler): Fix typo.
22625 * mpz/powm.c (redc): New function, based on old mpz_redc. Don't
22627 (mpz_redc): Remove.
22628 (mpz_powm): Major changes, partially reverting to mpn calls.
22629 Multiply before calling redc.
22630 (mpz_powm): Use TMP_ allocation.
22631 (mpz_powm): Refine calculation of k (width of exponent window).
22632 (mpz_powm): Cast constants to mp_limb_t before left shifting.
22634 * longlong.h: Use ia64 count_leading_zeros just when __GNUC__.
22636 2000-09-29 Kevin Ryde <kevin@swox.se>
22638 * acinclude.m4 (GMP_C_SIZES): New macro.
22639 * configure.in: Use it.
22640 * acconfig.in (BYTES_PER_MP_LIMB etc): Add #undefs.
22641 * mpn/generic/gmp-mparam.h (BYTES_PER_MP_LIMB etc): Remove #defines.
22642 * gmp.texi (Known Build Problems): Remove 64-bit generic C
22643 gmp-mparam.h problem, now fixed.
22645 * configure.in: Only run GMP_PROG_M4 if it's actually needed.
22647 2000-09-27 Torbjorn Granlund <tege@swox.com>
22649 * demos/pexpr.c: Clean up code for systems not supporting
22650 sigaltstack. Handle old Linux without sigaltstack. Properly
22651 disable all stuff related to sigaltstack under Unicos.
22653 * mpn/alpha/ev6/addmul_1.asm: Use explicit offset for all load and
22654 store insns. Helps old gas.
22656 * longlong.h (count_leading_zeros): Define for ia64.
22658 2000-09-27 Paul Zimmermann <Paul.Zimmermann@loria.fr>
22660 * mpn/generic/bz_divrem_n.c: Fix qhl handling, simplify.
22662 2000-09-27 Kevin Ryde <kevin@swox.se>
22664 * mpn/Makefile.in (.SUFFIXES): Regenerate with patched automake to
22665 get .s before .c, which is needed to override ansi2knr .c rules.
22667 * gmp.texi (mpn_sqrtrem): Fix r2p==NULL return value description
22668 to match the code (change by Torbjorn).
22669 (mpn_gcd, mpn_gcdext, mpn_sqrtrem, mpn_tdiv_qr): Note most
22670 significant limbs must be non-zero.
22671 (mpn_gcd, mpn_gcdext, mpn_sqrtrem): Clarify destination size
22673 (mpn_gcd_1): Clarify value must be non-zero, not just size.
22675 * gmp-impl.h (mpn_zero_p): New inline function.
22676 * mpn/generic/inlines.c: Add gmp-impl.h.
22677 * mpf/integer.c, mpz/get_d.c, mpn/generic/mul_fft.c: Use it.
22679 * mpn/generic/gcd.c: Use MPN_COPY_INCR not MPN_COPY.
22680 * mpf/add_ui.c: Ditto.
22681 * mpf/add.c: Ditto, and fix test to skip copy.
22683 2000-09-26 Kevin Ryde <kevin@swox.se>
22685 * gmp-impl.h, longlong.h, mpn/generic/*.c: Add ASSERTs for various
22686 parameter restrictions.
22688 * gmp-impl.h (UDIV_PREINV_TIME): New macro.
22689 * mpn/generic/sb_divrem_mn.c: Use it.
22690 * mpn/generic/perfsqr.c: Ditto.
22691 * mpn/x86/*/gmp-mparam.h (UDIV_PREINV_TIME): Add values.
22693 * macos/Makefile.in: Add mpz/tests/t-get_si.c, mpf/tests/t-set_f.c,
22694 and new multi-function mpz and mpq files.
22696 2000-09-25 Kevin Ryde <kevin@swox.se>
22698 * randlc.c, randlc2x.c, randsd.c, mpz/urandomb.c, mpz/urandomm.c:
22699 Use mpz_ptr and mpz_srcptr for parameters.
22700 * gmp.h (gmp_randinit_lc, gmp_randinit_lc_2exp, gmp_randseed,
22701 mpz_urandomb, mpz_urandomm): Corresponding change to prototypes.
22702 * randsdui.c: Remove wrong K&R parameters part.
22704 2000-09-12 Kevin Ryde <kevin@swox.se>
22706 * gmp-impl.h (mpn_tdiv_qr): Move prototype from here ...
22707 * gmp.h (mpn_tdiv_qr): ... to here.
22709 * gmp.texi (Miscellaneous Rational Functions): Comment-out and
22710 move version 1 compatibility note to "Compatibility" section.
22711 (Rational Number Functions): Ditto for canonicalization note.
22713 2000-09-10 Kevin Ryde <kevin@swox.se>
22715 * mpn/x86/pentium/com_n.asm: New file.
22717 * gmp.texi (Rational Arithmetic): Add mpq_abs.
22718 (Miscellaneous Rational Functions): Merge and simplify descriptions of
22719 mpq_get_num, mpq_get_den, mpq_set_num, mpq_set_den.
22721 * mpq/abs.c: New file.
22722 * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
22723 * Makefile.am (MPQ_OBJECTS): Add it.
22724 * gmp.h (mpq_abs): Add prototype.
22726 * mpq/set_den.c: Don't discard sign when copying, this makes the
22727 code match the manual.
22729 2000-09-07 Torbjorn Granlund <tege@swox.com>
22731 * tune/alpha.asm: Rewrite to actually work right.
22733 2000-09-07 Kevin Ryde <kevin@swox.se>
22735 * tune/common.c,speed.[ch]: Add measuring of mpn_sqrtrem,
22736 mpn_get_str, mpn_set_str.
22737 * tune/README: Various updates.
22739 2000-09-06 Torbjorn Granlund <tege@swox.com>
22741 * mpz/fits.c: Correct type of `data'.
22743 2000-09-06 Kevin Ryde <kevin@swox.se>
22745 * gmp.texi (Build Options): Clarify where to find CFLAGS.
22746 (Known Build Problems): Note SCO -lc problem.
22748 * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Fix for sizes > 512 limbs.
22750 * doc/multiplication: Corrections and additions suggested by Paul.
22752 * tune/modlinv.c: New file with alternate modlimb_inverts.
22753 * tune/Makefile.am, tune/speed.[ch]: Add measuring of them.
22754 * tune/speed.c (FLAG_NODATA): New attribute, use for mpz_bin_uiui,
22755 mpz_fib_ui, mpz_fac_ui.
22757 * mpn/x86/t-zdisp.sh: New file.
22759 * tests/t-modlinv.c: New file.
22760 * tests/Makefile.am (check_PROGRAMS): Add it.
22762 * mpq/tests/t-set_f.c: New file.
22763 * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
22765 * gmp-impl.h (MPQ_CHECK_FORMAT): New macro.
22766 * mpq/tests/t-get_d.c: Use it.
22768 * mpq/set_f.c: New file.
22769 * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
22770 * Makefile.am (MPQ_OBJECTS): Ditto.
22771 * gmp.h: Add prototype.
22772 * gmp.texi (Miscellaneous Rational Functions): Document mpq_set_f,
22773 correct return type of mpq_set_d.
22775 2000-09-03 Kevin Ryde <kevin@swox.se>
22777 * mpz/aors_ui.c: New file merging add_ui.c and sub_ui.c, no object
22779 * mpz/add_ui.c, mpz/sub_ui.c: Remove files.
22780 * mpz/Makefile.am: Update.
22782 * gmp-impl.h (MPZ_FITS_STYPE_SDT, MPZ_FITS_UTYPE_SDT): New macros.
22783 * mpz/fits.c: New file merging six separate fits*.c.
22784 * mpz/fits_sshort_p.c, fits_sint_p.c, fits_slong_p.c, fits_ushort_p.c,
22785 fits_uint_p.c, fits_ulong_p.c: Remove files
22786 * mpz/Makefile.am: Use new fits.c, change object names from
22787 fits_*_p.lo to fits_*.lo to avoid SunOS 4 native "ar" warnings.
22788 * Makefile.am (MPZ_OBJECTS): Change from fits_*_p.lo to fits_*.lo.
22790 * acinclude.m4 (GMP_CHECK_ASM_RODATA): New macro, defining RODATA.
22791 * configure.in: Use it.
22792 * mpn/x86/k[67]/mmx/popham.asm: Use it.
22794 * mpn/x86/*/*.asm: Use "TEXT" not ".text".
22796 2000-09-02 Kevin Ryde <kevin@swox.se>
22798 * mpq/aors.c: New file merging add.c and sub.c, no object code changes.
22799 * mpq/add.c, mpq/sub.c: Remove files.
22800 * mpq/Makefile.am: Update.
22802 * mpz/aors.c: New file merging add.c and sub.c, no object code changes.
22803 * mpz/add.c, mpz/sub.c: Remove files.
22804 * mpz/Makefile.am, mpbsd/Makefile.am: Update.
22806 * configure.in: Re-apply "PROLOGUE.*" regexp change for the
22807 benefit of alpha PROLOGUE_GP, lost in path search reorganisation.
22809 * mpn/x86/x86-defs.m4 (jadcl0, cmov_simulate, ASSERT,
22810 movl_text_address): Don't use "1:" style labels.
22811 (Zdisp): Rearrange a bit, switch to all hex.
22812 * mpn/x86/README.family: Note SCO "as" doesn't support "1:" style
22813 local labels, misc rewordings.
22815 2000-08-29 Torbjorn Granlund <tege@swox.com>
22817 * demos/primes.c: Include string.h.
22819 * config.guess (x86 variant recog code): Remove dummy*.o files
22820 generated by some compilers.
22822 2000-08-28 Kevin Ryde <kevin@swox.se>
22824 * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix Solaris 2.8
22825 warning message suppression, add notes about SCO.
22827 * Makefile.am (MPZ_OBJECTS etc): Move some comments.
22829 2000-08-25 Kevin Ryde <kevin@swox.se>
22831 * mpz/pprime_p.c (mpz_millerrabin): Fix a TMP_FREE.
22833 * gmp.texi (Copying): Refer to Lesser not Library GPL.
22834 (GMP and Reentrancy): Note stack-alloc.c is not reentrant, and
22835 that SCO <ctype.h> is potentially not reentrant.
22837 * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Test by attempting to
22838 link with or without an underscore.
22839 * gmp.texi (Known Build Problems): Remove SunOS 4 native grep
22840 GSYM_PREFIX problem, now fixed.
22842 * gmp-impl.h (MODLIMB_INVERSE_3): New constant.
22843 * mpn/generic/diveby3.c: Use it instead of own INVERSE_3.
22844 * mpn/generic/mul_n.c: Ditto.
22845 * tests/t-constants.c: Check it, and PP_INVERTED too.
22847 * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): New macro.
22848 * configure.in [p6 and athlon] (gmp_optcflags_gcc): Use it to
22849 possibly add -march=pentiumpro.
22851 * gmp-impl.h (MPZ_SET_STR_OR_ABORT, MPF_SET_STR_OR_ABORT): New macros.
22852 * mpz/tests/t-bin.c, mpz/tests/t-get_si.c, mpz/tests/t-jac.c,
22853 mpz/tests/t-misc.c: Use them.
22854 * mpf/tests/t-conv.c, mpf/tests/t-misc.c: Ditto.
22855 * mpz/tests/convert.c: Ditto and amend diagnostics slightly.
22856 * mpz/tests/t-misc.c (check_mpz_set_si): Remove a superfluous init.
22857 * mpz/tests/io.c: Differentiate between I/O and data conversion errors.
22859 * mpn/generic/aors_n.c: New file merging add_n and sub_n, no
22860 object code changes.
22861 * mpn/generic/add_n.c: Remove file.
22862 * mpn/generic/sub_n.c: Remove file.
22864 * mpn/generic/aorsmul_1.c: New file merging addmul_1 and submul_1,
22865 no object code changes.
22866 * mpn/generic/addmul_1.c: Remove file.
22867 * mpn/generic/submul_1.c: Remove file.
22869 * mpn/generic/popham.c: New file merging popcount and hamdist, no
22870 object code changes.
22871 * mpn/generic/popcount.c: Remove file.
22872 * mpn/generic/hamdist.c: Remove file.
22874 2000-08-24 Torbjorn Granlund <tege@swox.com>
22876 * gmp-impl.h (mpn_com_n): Fix typo.
22878 2000-08-23 Torbjorn Granlund <tege@swox.com>
22880 * demos/primes.c (main): Don't call mpz_probab_prime_p for numbers
22881 that are known to be prime after sieving.
22882 (main): Declare and initialize max_s_prime_squared.
22883 (MAX_S_PRIME): Increase.
22884 (ST_SIZE): Increase.
22886 2000-08-23 Kevin Ryde <kevin@swox.se>
22888 * gmp-impl.h (ASSERT_ALWAYS): Change to statement style.
22889 (JACOBI_TWO_U_BIT1): Remove ASSERT.
22890 (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS as a statement.
22892 2000-08-21 Torbjorn Granlund <tege@swox.com>
22894 * gmp-impl.h (ASSERT): Use do..while for dummy version.
22896 * mpf/get_str.c: Don't set n_digits from digits_computed_so_far
22897 when the converted operand becomes zero. Misc cleanups.
22899 2000-08-21 Kevin Ryde <kevin@swox.se>
22901 * mpz/fdiv_r_2exp.c, mpz/lcm.c, mpz/urandomm.c: Add missing
22902 TMP_MARK/FREE, avoiding memory leak when using stack-alloc.c.
22904 2000-08-20 Kevin Ryde <kevin@swox.se>
22906 * mpz/set.c [BERKELEY_MP] (move): Add conditionals to build as
22908 * mpbsd/Makefile.am: Use mpz/set.c, not move.c.
22909 * Makefile.am (MPBSD_OBJECTS): Corresponding change.
22910 * mpbsd/move.c: Remove file.
22912 * mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am,
22913 mpbsd/Makefile.am (-DOPERATION_foo): Use "foo" even for ansi2knr
22914 "foo_" objects. Do this with the makefiles to keep the sources
22916 * mpz/mul_siui.c, mpf/integer.c: Revert to plain OPERATION_* forms.
22918 * mpn/lisp/gmpasm-mode.el (gmpasm-remove-from-list): Renamed from
22919 gmpasm-delete-from-list, because it's non-destructive.
22920 (gmpasm-font-lock-keywords): Add some more keywords.
22922 2000-08-16 Kevin Ryde <kevin@swox.se>
22924 * tune/mul_n_mpn.c, tune/mul_n_open.c: New files, being forced
22925 open-coded and mpn #includes of mpn/generic/mul_n.c.
22926 * tune/*: Add measuring of them.
22927 * tune/speed.c: Print command line into *.gnuplot file.
22929 * mpn/generic/mul_n.c (USE_MORE_MPN): Change to #if not #ifdef for
22930 using the value, add #ifndef for providing the default.
22931 * mpn/sparc64/gmp-mparam.h (USE_MORE_MPN): Add #ifndef.
22933 * tests/t-constants.c: New file.
22934 * tests/Makefile.am (check_PROGRAMS): Add it.
22936 * mpz/get_si.c: Use LONG_MAX, not BITS_PER_MP_LIMB, so the result
22937 doesn't depend on limb size when outside the range of a long
22938 (though such results are not actually documented).
22939 * mpz/tests/t-get_si.c: New file.
22940 * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
22942 * mpn/tests/try.c (call): Cast popcount and hamdist calls,
22943 for the benefit of long long limb.
22945 2000-08-15 Kevin Ryde <kevin@swox.se>
22947 * mp.h (mp_set_memory_functions): Add missing #define.
22948 * mpbsd/tests/allfuns.c (mp_set_memory_functions): Verify its
22951 * mpf/tests/t-misc.c (check_mpf_getset_prec): New test, verifying
22952 reverted behaviour of mpf_get_prec.
22954 * mpn/tests/ref.c (refmpn_strip_twos): Use refmpn_copyi, not
22957 * mpz/mul_siui.c, mpf/integer.c: Recognise OPERATION_*_ forms
22958 produced under ansi2knr.
22960 * configure.in (mpn_objects, mpn_objs_in_libgmp): Add $U to .c
22961 objects when ansi2knr in use.
22963 * mpn/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
22964 (libdummy.la): Add this, not built, to create ansi2knr style rules
22965 for all potential .c files.
22966 * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpfr/Makefile.am,
22967 mpbsd/Makefile.am, mpq/tests/Makefile.am, tests/Makefile.am
22968 (AUTOMAKE_OPTIONS): Enable ansi2knr (now everywhere).
22969 * Makefile.am (MPZ_OBJECTS, MPQ_OBJECTS, MPF_OBJECTS, MPFR_OBJECTS,
22970 MPBSD_OBJECTS, libmp_la_DEPENDENCIES): Add $U to all .lo filenames.
22972 2000-08-03 Torbjorn Granlund <tege@swox.com>
22974 * mpn/alpha/ev6/addmul_1.asm: Correct number of cycles to 3.5/28.
22976 2000-08-02 Torbjorn Granlund <tege@swox.com>
22978 * Version 3.1 released.
22980 * gmp.texi: Rephrase mpf_urandomb documentation.
22982 * mpn/alpha/ev6: New directory with ev6/21264 optimized code.
22983 * mpn/alpha/ev6/addmul_1.asm: New file.
22984 * mpn/alpha/ev6/gmp-mparam.h: New file.
22986 2000-08-02 Kevin Ryde <kevin@swox.se>
22988 * demos/factorize.c (random): Don't use "inline".
22990 * mpfr/log.c, mpfr/mul_ui.c, mpfr/round.c, mpfr/set.c, mpfr/set_d.c:
22991 Corrections to K&R parts.
22993 * Makefile.am (EXTRA_HEADERS): Omit $(MPFR_HEADERS_OPTION).
22994 * mpfr/Makefile.am (EXTRA_DIST): Add mpfr.h.
22996 * gmp.texi (Known Build Problems): Note problem stripping libgmp.a.
22998 2000-08-02 Kent Boortz <kent@swox.com>
23000 * mpfr: Integrated experimental version of mpfr-0.4.
23001 * configure.in: Changes for option --enable-mpfr.
23002 * Makefile.am: Changes for option --enable-mpfr.
23004 2000-08-01 Torbjorn Granlund <tege@swox.com>
23006 * mpn/generic/popcount.c: Disable SPARC v9 popc_limb pattern.
23007 * mpn/generic/hamdist.c: Likewise.
23009 2000-08-01 Kevin Ryde <kevin@swox.se>
23011 * mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
23012 source and dest regions.
23014 2000-07-31 Torbjorn Granlund <tege@swox.com>
23016 * mpf/get_str.c: Develop three extra digits, not just one.
23018 2000-07-31 Kevin Ryde <kevin@swox.se>
23020 * gmp.texi (References): Add URL for invariant division.
23022 2000-07-30 Kevin Ryde <kevin@swox.se>
23024 * tune/time.c (speed_cpu_frequency_proc_cpuinfo): Add support for
23025 alpha linux "cycle frequency".
23027 * mpn/sparc64/gmp-mparam.h: Re-run tune program for FFT thresholds.
23029 2000-07-29 Kevin Ryde <kevin@swox.se>
23031 * gmp.texi (ABI and ISA): Add sparc64-*-linux*.
23032 * configure.in [sparc64-*-linux*] (gmp_cflags64_gcc): Same flags
23035 * configure.in (--enable-fft): New option, default "no".
23036 * gmp.texi (Build Options): Describe it.
23037 * mpn/generic/mul.c, mpn/generic/mul_n.c [WANT_FFT]: Use it.
23038 * tune/tuneup.c [WANT_FFT]: By default don't probe FFTs if not enabled.
23039 * NEWS: Multiplication optionally using FFT.
23041 * tune/README: Notes on FFT and GCD thresholds, other minor updates.
23043 * Makefile.am: Expunge the macos generated files update stuff.
23045 2000-07-28 Kevin Ryde <kevin@swox.se>
23047 * mpn/x86/*/gmp-mparam.h: Add some FFT thresholds.
23049 2000-07-28 Kent Boortz <kent@swox.se>
23051 * macos/Asm*, macos/CmnObj, macos/Mp*: Delete directories.
23052 * macos/Makefile: Delete file.
23053 * macos/Makefile.cw: Delete file.
23054 * macos/config.h: Delete file.
23055 * macos/Asm/*.s: Delete files.
23056 * macos/configure: Create target directories. Don't transform
23057 '(C)' to '(;)' in a 'dnl' line comment in .asm file.
23058 * Makefile.am: Delete macos targets.
23059 * macos/README: Reflect that we reverted back to a build
23060 process that require ""macos/configure" to run on MacOS.
23061 This imply that MacPerl is needed for a build in MacOS.
23063 2000-07-27 Kevin Ryde <kevin@swox.se>
23065 * mpn/generic/mul_fft.c: New file, by Paul Zimmermann, minor mods
23067 * configure.in (gmp_mpn_functions): Add it.
23068 * mpn/generic/mul.c, mpn/generic/mul_n.c: Use it.
23069 * doc/multiplication: Describe it (briefly).
23071 * gmp-impl.h (FFT_MUL_THRESHOLD etc): New thresholds.
23072 (mpn_fft_best_k, mpn_fft_next_size, mpn_mul_fft, mpn_mul_fft_full):
23074 (numberof, TMP_ALLOC_TYPE etc, _MP_ALLOCATE_FUNC_TYPE etc,
23075 UNSIGNED_TYPE_MAX etc): New macros.
23077 * tune/*: Add FFT threshold tuning and speed measuring.
23078 * tune/common.c: Avoid huge macro expansions for umul and udiv.
23080 * mpz/tests/t-bin.c, mpz/tests/t-jac.c, mpz/tests/t-misc.c,
23081 mpbsd/tests/t-misc.c, mpf/tests/t-misc.c, mpn/tests/try.c,
23082 mpn/tests/spinner.c: Use new gmp-impl.h macros.
23084 * demos/Makefile.am (BUILT_SOURCES): Don't need calc.c etc under this.
23086 2000-07-27 Torbjorn Granlund <tege@swox.com>
23088 * mpn/ia64/gmp-mparam.h: New file.
23090 2000-07-26 Torbjorn Granlund <tege@swox.com>
23092 * demos/isprime.c: Handle any number of arguments and print
23093 classification for each. Add `-q' option for old behaviour.
23095 2000-07-26 Kevin Ryde <kevin@swox.se>
23097 * gmp.texi (Build Options): Mention djgpp stack size.
23098 (Notes for Package Builds): New section.
23099 (Compatibility with older versions): Update for 3.1, add mpf_get_prec.
23101 * demos/factorize.c [__GLIBC__]: Don't declare random() under glibc.
23103 * gmp.h (gmp_version): Add prototype and define.
23105 * Makefile.am: Keep macos directory generated files up-to-date
23106 during development and on a "make dist".
23108 2000-07-25 Torbjorn Granlund <tege@swox.com>
23110 * mpn/hppa/gmp-mparam.h: Update threshold values from new `tune' run.
23112 * mpn/pa64/gmp-mparam.h: Fill in values from `make tune' run.
23113 * mpn/pa64w/gmp-mparam.h: Likewise.
23114 * mpn/mips3/gmp-mparam.h: Likewise.
23116 * tune/hppa2.asm: Fix typo in .level directive.
23118 * configure.in: Add sparc64-*-linux* support (from Jakub Jelinek).
23119 * configure: Regenerate.
23121 * mpn/sparc64/rshift.asm: Use %g5 instead of volatile stack frame area
23122 for return value (from Jakub Jelinek).
23123 * mpn/sparc64/lshift.asm: Likewise.
23125 * mpf/get_prc.c: Revert Aug 8, 1996 change.
23127 * version.c: No longer static.
23129 * mpn/pa64/gmp-mparam.h: Only #define *_THRESHOLD if not already
23131 * mpn/pa64w/gmp-mparam.h: Likewise.
23132 * mpn/arm/gmp-mparam.h: Likewise.
23133 * mpn/mips3/gmp-mparam.h: Likewise.
23135 2000-07-25 Kevin Ryde <kevin@swox.se>
23137 * INSTALL: It's "info -f ./gmp.info" to be sure of hitting the
23138 gmp.info in the current directory.
23140 * Makefile.am (libmp_la_DEPENDENCIES): Add mpz/cmp.lo, for last
23143 * mpn/sparc64/addmul1h.asm, mpn/sparc64/submul1h.asm: Renamed from
23144 addmul_1h.asm, submul_1h.asm to avoid name conflicts on an 8.3
23146 * mpn/sparc64/addmul_1.asm, mpn/sparc64/submul_1.asm,
23147 mpn/sparc64/mul_1.asm: Update include_mpn()s.
23149 2000-07-24 Torbjorn Granlund <tege@swox.com>
23151 * Update header of all files previously under the Library GPL
23152 to instead be under the Lesser GPL.
23154 * COPYING.LIB: Now Lesser GPL.
23155 * demos/primes.c: Change license to GPL (was Library GPL).
23156 * demos/isprime.c: Change license to GPL (was Library GPL).
23158 * gmp.h (error code enum): Add GMP_ERROR_BAD_STRING (currently unused).
23160 * mpz/tests/t-mul.c: Default SIZE to a function of TOOM3_MUL_THRESHOLD.
23161 Improve error messages. Decrease reps.
23163 2000-07-22 Kevin Ryde <kevin@swox.se>
23165 * tune/speed.h: Decrease the amount of data used for gcd and powm
23166 measuring, to make the tune go a bit faster.
23168 2000-07-21 Kent Boortz <kent@swox.se>
23170 * macos/Asm*, macos/CmnObj, macos/Mp*: Directories no longer created
23171 from configure script, now part of dist.
23173 * macos/Makefile.cw
23176 New files and directories that is the output from configure. This way
23177 no Perl installation is required to build on MacOS, just MPW.
23178 * macos/configure: Added prefix '__g' to exported assembler labels.
23179 Changed to handle new m4 syntax instead of the old cpp syntax in asm.
23180 * macos/Makefile.in: Corrected 'clean' target, added 'distclean'
23181 and 'maintainer_clean'. Added "mpn/mp_bases.c" to build.
23182 * macos/README: Reflect the new build process without configure.
23183 Corrected the file structure for Apple MPW installation.
23185 2000-07-21 Torbjorn Granlund <tege@swox.com>
23187 * mpf/tests/t-muldiv.c: Relax error limit. Make precision depend
23188 on SIZE. Misc changes.
23190 * configure: Regenerate.
23192 2000-07-20 Kent Boortz <kent@swox.com>
23194 * macos/Makefile.in: Removed hard coded targets, added special
23195 targets found in Makefile.am files.
23196 * macos/configure: Generate targets from top configure script and
23197 Makefile.am files. Made script runnable from Unix for testing.
23198 * macos/README: Notes about search paths for includes, contributed
23200 * configure.in: Added comment about lines that the "macos/configure"
23203 2000-07-20 Torbjorn Granlund <tege@swox.com>
23205 * mpz/powm.c (mpz_powm): After final mpz_redc call, subtract `mod'
23206 from result if it is greater than `mod'.
23208 2000-07-19 Torbjorn Granlund <tege@swox.com>
23210 * mpn/hppa/gmp-mparam.h: Fill in values from `make tune' run.
23211 * mpn/alpha/gmp-mparam.h: Likewise.
23212 * mpn/powerpc32/gmp-mparam.h: Likewise.
23214 * tune/hppa.asm: New file.
23215 * tune/hppa2.asm: New file.
23216 * configure.in (SPEED_CYCLECOUNTER_OBJS): Set for hppa2*-*-* and
23218 * tune/Makefile.am (EXTRA_DIST): Add hppa.asm and hppa2.asm.
23220 * tune/speed.h (SPEED_ROUTINE_MPN_BZ_DIVREM_CALL): Declare `marker';
23223 * mpn/hppa/hppa1_1/udiv_qrnnd.S: Use "%" instead of "'" for
23224 reloc/symbol delimiter.
23226 2000-07-16 Torbjorn Granlund <tege@swox.com>
23228 * mpn/powerpc64/gmp-mparam.h: Update with output from tune utility.
23229 * mpn/powerpc64/copyi.asm: New file.
23230 * mpn/powerpc64/copyd.asm: New file.
23232 2000-07-16 Kevin Ryde <kevin@swox.se>
23234 * tune/*: Add measuring for umul_ppmm and udiv_qrnnd.
23236 2000-07-14 Kevin Ryde <kevin@swox.se>
23238 * mpn/x86/k6/k62mmx: New directory.
23239 * configure.in (k6[23]*-*-*): Use it.
23240 * mpn/x86/k6/k62mmx/copyi.asm, mpn/x86/k6/k62mmx/copyd.asm: Move from
23241 mmx directory, improve code alignment a bit.
23242 * mpn/x86/k6/k62mmx/lshift.asm, mpn/x86/k6/k62mmx/rshift.asm: Ditto,
23243 and improve addressing modes for pre-CXT cores.
23244 * mpn/x86/x86-defs.m4 (Zdisp): Add an instruction.
23245 * mpn/x86/k6/mmx/lshift.asm, mpn/x86/k6/mmx/rshift.asm: New files,
23247 * mpn/x86/README, mpn/x86/k6/README: Updates.
23248 * mpn/x86/k6/mmx/*.asm: Update some comments.
23250 * mpn/tests/Makefile.am: Use $(MAKE) in .asm rules, not "m".
23251 * tune/Makefile.am: Use $(EXEEXT) and libtool --config objdir, for
23252 the benefit of djgpp.
23254 * */Makefile.in: Regenerate with patched automake that adds
23255 $(EXEEXT) to EXTRA_PROGRAMS.
23257 * mpn/tests/try.c: Add #ifdef to SIGBUS, for the benefit of djgpp.
23258 * config.guess: Recognise pc:*:*:* as an x86, for djgpp.
23260 * configure: Regenerate with patched autoconf to fix temp file
23261 ".hdr" which is invalid on a DOS 8.3 filesystem, and to fix two
23262 sed substitutes that clobbered a ":" in $srcdir (eg. a DOS drive
23265 * mpz/tests/io.c: Use one fp opened "w+", since separately opened
23266 input and output doesn't work on MS-DOS 6.21.
23268 * tests/rand/Makefile.am (allprogs): Pseudo-target to build everything.
23269 (CLEANFILES): Add EXTRA_PROGRAMS and EXTRA_LTLIBRARIES.
23270 (manual-test, manual-bigtest): Add $(EXEEXT) to dependencies.
23272 * tests/rand/*/Makefile.in: Regenerate with patched automake that adds
23273 $(EXEEXT) to EXTRA_PROGRAMS.
23275 2000-07-13 Torbjorn Granlund <tege@swox.com>
23277 * mpz/tests/t-root.c: Also test mpz_perfect_power_p.
23278 Generate `nth' so that there will be fewer trivial values.
23280 * mpz/root.c: Reverse return value in tests for detecting root of +1
23283 * mpz/perfpow.c: Use TMP_ALLOC interface.
23285 2000-07-12 Torbjorn Granlund <tege@swox.com>
23287 * mpz/perfpow.c (primes): Make it const.
23289 2000-07-06 Kevin Ryde <kevin@swox.se>
23291 * mpn/x86/k6/cross.pl: New file.
23293 * mpn/x86/*/gmp-mparam.h: Updates to thresholds, conditionalize
23295 * mpn/x86/pentium/mmx/gmp-mparam.h: New file.
23296 * mpn/sparc64/gmp-mparam.h: Update thresholds.
23297 * mpn/sparc32/v9/gmp-mparam.h: Ditto.
23299 2000-07-04 Kevin Ryde <kevin@swox.se>
23302 * mpn/x86/*/README: Miscellaneous updates.
23304 * tune/speed-ext.c: New file.
23305 * tune/Makefile.am: Add it.
23306 * tune/README: Updates.
23307 * tune/speed.h (SPEED_ROUTINE_MPN_DIVREM_2): Bug fixes.
23309 * demos/calc.y,calclex.l: New files.
23310 * demos/calc.c,calc.h,calclex.c: New files, generated from .y and .l.
23311 * demos/Makefile.am: Add them.
23313 * gmp.h (mpq_swap, mpf_swap): Add prototypes and defines.
23315 2000-07-01 Kevin Ryde <kevin@swox.se>
23317 * gmp.texi (ABI and ISA): New section, bringing together ABI notes.
23318 (Build Options): Add MPN_PATH, various updates.
23319 (Build Options): Add note on setting CFLAGS when setting CC.
23320 (Notes for Particular Systems): Add -march=pentiumpro problem.
23321 (Known Build Problems): Note on gmp-mparam.h for 64-bit generic C.
23322 (GMP Variable Conventions): Add some info on user defined functions.
23323 (Reporting Bugs): Minor rewording.
23325 * configure.in (MPN_PATH): Renamed from mpn_path.
23327 * gmp-impl.h (ULONG_MAX,ULONG_HIGHBIT,...,SHORT_MAX): New defines.
23328 * mp[zf]/tests/t-misc.c: Use them.
23330 * mpbsd/tests/t-misc.c: New file.
23331 * mpbsd/tests/Makefile.am: Add it.
23333 * Makefile.am (LIBGMP_LT_*, LIBMP_LT_*): Bump version info.
23334 * gmp.h (__GNU_MP_VERSION_*): Bump to 3.1.
23336 * mpf/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
23338 * Makefile.am (libmp_la_SOURCES): Add mp_set_fns.c, accidentally
23339 omitted in gmp 3.0.x.
23340 * gmp.texi (Custom Allocation): Note this is available in mpbsd,
23341 and some minor rewording.
23343 2000-06-30 Torbjorn Granlund <tege@swox.com>
23345 * demos/factorize.c (random): New function, defined conditionally.
23346 (factor_using_pollard_rho): Use it, not mrand48.
23348 * mpn/cray/README: New file.
23350 2000-06-30 Kevin Ryde <kevin@swox.se>
23352 * mpn/x86/pentium/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
23354 * mpz/tests/t-jac.c: Test limbs on mpn_jacobi_base, not just ulongs.
23356 * gmp-impl.h, mpn/tests/try.c, mpn/tests/spinner.c, tune/speed.c:
23357 Use config.h unconditionally, not under HAVE_CONFIG_H.
23359 * demos/pexpr.c [__DJGPP__]: Patch by Richard Dawe to not use
23360 setup_error_handler on djgpp.
23362 * tune/*: Locate data to help direct-mapped caches, add measuring
23363 of mpz_init/clear, mpz_add and mpz_bin_uiui, various cleanups.
23364 * configure.in (AC_CHECK_FUNCS): Add popen.
23366 2000-06-29 Torbjorn Granlund <tege@swox.com>
23368 * mpf/mul_2exp.c: Streamline criterion for whether to use mpn_lshift or
23369 mpn_rshift. Increase precision when exp is a multiple of
23370 BITS_PER_MP_LIMB primarily to make exp==0 be a noop.
23371 * mpf/div_2exp.c: Analogous changes.
23373 * mpf/tests/t-dm2exp.c: Set u randomly in loop. Perform more
23374 mpf_mul_2exp testing.
23376 * configure.in: Recognize cray vector processors with a broad `*';
23377 move after alpha* not to match that.
23379 2000-06-28 Kevin Ryde <kevin@swox.se>
23381 * mpz/tests/io.c: Use a disk file, not a pipe, switch to ansi2knr
23382 style, switch from MP_INT to mpz_t, add a couple of error checks.
23383 * mpz/tests/Makefile.am (CLEANFILES): Add io.tmp, in case io.c fails.
23385 2000-06-27 Torbjorn Granlund <tege@swox.com>
23387 * mpf/tests/t-get_d.c: Be more lax about relative error, to handle Cray
23388 floating point format.
23390 * mpq/tests/t-get_d.c: Decrease default reps to 1000.
23392 * mpf/tests/t-conv.c: Correct type of `bexp'.
23394 * configure.in (cray vector machines): Don't inherit gmp_cflags_cc.
23396 * tune/Makefile.am (EXTRA_DIST): Delete sparc64.asm.
23398 * configure.in (cray vector machines): Set extra_functions.
23400 * mpn/cray/mulww.f: New file with vectorizing cray code.
23401 * mpn/cray/mulww.s: Generated from mulww.f.
23402 * mpn/cray/mul_1.c: New file.
23403 * mpn/cray/addmul_1.c: New file.
23404 * mpn/cray/submul_1.c: New file.
23405 * mpn/cray/add_n.c: New file.
23406 * mpn/cray/sub_n.c: New file.
23408 2000-06-26 Kevin Ryde <kevin@swox.se>
23410 * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix so it actually
23411 detects solaris 2.6, and also suppress warning on solaris 2.8.
23412 * configure.in (SPEED_CYCLECOUNTER): Remove spurious "athlon" from
23415 * mpn/lisp/gmpasm-mode.el: Move keymap to the top of the docstring.
23417 2000-06-21 Kevin Ryde <kevin@swox.se>
23419 * mpn/generic/mul_n.c (mpn_kara_mul_n, mpn_kara_sqr_n): Use
23421 (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use mp_size_t for size
23422 parameters and "l" variables.
23423 * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Update prototypes.
23425 * mpbsd/itom.c, mpbsd/sdiv.c: Add casts for correct handling of
23426 -0x80...00 on systems with sizeof(short)==sizeof(int).
23428 * mpz/tests/t-misc.c: Move "bin" test from here ...
23429 * mpz/tests/t-bin.c: ... to here, and add a new (2k,k) test too.
23430 * mpz/tests/Makefile.am (check_PROGRAMS): Add t-bin.
23432 * mpz/bin_ui.c [_LONG_LONG_LIMB]: Use mpn_divrem_1, since kacc is
23433 a limb not a ulong.
23434 * mpz/bin_uiui.c [_LONG_LONG_LIMB]: Ditto, and use mpn_mul_1 too,
23435 since nacc is a limb.
23437 * mpf/tests/t-misc.c (check_mpf_set_si, check_mpf_cmp_si):
23438 New file, testing mpf_set_si, mpf_init_set_si, and mpf_cmp_si.
23439 * mpf/tests/Makefile.am (check_PROGRAMS): Add it.
23441 * mpz/tests/t-misc.c (check_mpz_set_si, check_mpz_cmp_si):
23442 New tests, for mpz_set_si, mpz_init_set_si, and mpz_cmp_si.
23444 * mpz/set_si.c, mpz/iset_si.c, mpz/cmp_si.c [_LONG_LONG_LIMB]: Fix
23445 handling of -0x80..00.
23446 * mpf/set_si.c, mpf/iset_si.c, mpf/cmp_si.c [_LONG_LONG_LIMB]: Ditto.
23448 2000-06-19 Torbjorn Granlund <tege@swox.com>
23450 * demos/primes.c: Properly handle arguments `m +n'.
23452 2000-06-17 Torbjorn Granlund <tege@swox.com>
23454 * config.sub: Recognize k5 and k6 with common pattern.
23456 * mpq/tests/t-get_d.c: Also test mpq_set_d. Misc improvements.
23458 * mpq/set_d.c: Special case 0.0. Don't call mpn_rshift with 0 count.
23459 Allocate correct amount of memory for numerator. Delete spurious
23462 2000-06-17 Kevin Ryde <kevin@swox.se>
23464 * mpz/perfsqr.c: Fix so that zero is considered a perfect square.
23465 (Was wrongly calling mpn_perfect_square_p with size==0.)
23467 2000-06-16 Kevin Ryde <kevin@swox.se>
23469 * configure.in: Set k5*-*-* to use basic i386 code until there's
23470 something specific. Add path=x86 as a default for x86s.
23472 * acinclude.m4 (GMP_CHECK_ASM_ALIGN_LOG): Generate
23473 ALIGN_LOGARITHMIC setting, not a full ALIGN definition.
23474 (GMP_CHECK_ASM_ALIGN_FILL_0x90): New test.
23475 * configure.in [x86-*-*]: Use GMP_CHECK_ASM_ALIGN_FILL_0x90.
23476 * mpn/asm-defs.m4 (ALIGN): New macro.
23477 * mpn/x86/x86-defs.m4 (ALIGN): Remove supplementary definition.
23479 * tune/*: Plain "unsigned" for speed_cyclecounter.
23480 * configure.in: Use tune/sparcv9.asm for 32 and 64 bit modes.
23481 * tune/sparc64.asm: Remove file.
23483 2000-06-15 Torbjorn Granlund <tege@swox.com>
23485 * mpn/x86/k7/mmx/copyi.asm: Use `testb' instead of `test'.
23486 * mpn/x86/k7/mmx/copyd.asm: Likewise.
23488 * mpn/x86/k7/mmx/lshift.asm: Avoid using `~' (Solaris as problems).
23489 * mpn/x86/k7/mmx/rshift.asm: Likewise.
23490 * mpn/x86/k6/aors_n.asm: Likewise.
23491 * mpn/x86/k7/aors_n.asm: Likewise.
23492 * mpn/x86/k7/mul_basecase.asm: Likewise.
23494 2000-06-13 Torbjorn Granlund <tege@swox.com>
23496 * tune/sparcv9.asm: Tune, deleting two instructions.
23498 * tune/alpha.asm: Update to unified speed_cyclecounter.
23500 2000-06-11 Kevin Ryde <kevin@swox.se>
23502 * mpz/tests/reuse.c (FAIL): Add a K&R version.
23503 Use _PROTO on some typedefs.
23504 * mpz/tests/t-misc.c: Add gmp-impl.h for "const".
23506 * configure.in: Rework mpn multi-function and optional files.
23507 Names standardized, no need for explicit declarations, all picked
23508 up in one $path traversal.
23509 * doc/configuration: Updates.
23511 * tests/rand/t-rand.c (main): Change "usage" to work with K&R.
23513 2000-06-10 Kevin Ryde <kevin@swox.se>
23515 * mpn/x86/pentium/mmx/popham.asm, mpn/x86/p6/mmx/popham.asm,
23516 mpn/x86/p6/p3mmx/popham.asm, mpn/x86/p6/diveby3.asm: Add
23517 MULFUNC_PROLOGUE for correct HAVE_NATIVE_* matching.
23519 * mpn/x86/x86-defs.m4 (cmov_bytes_tttn): Use eval() on expressions.
23520 (cmov_available_p): Switch to list CPUs which do have cmov.
23521 * mpn/x86/p6/sqr_basecase.asm, mpn/x86/k6/sqr_basecase.asm,
23522 mpn/x86/k7/sqr_basecase.asm: Use eval() for multiplication.
23523 * mpn/x86/README.family: Various updates.
23525 2000-06-09 Kevin Ryde <kevin@swox.se>
23527 * mpbsd/tests/allfuns.c (main): Call exit() instead of doing return.
23529 * doc/tasks.html, doc/projects.html: Moved from projects directory.
23530 * doc/multiplication: New file.
23531 * Makefile.am (EXTRA_DIST): Remove projects, add doc.
23533 * Makefile.am (libgmp_la_LIBADD, libmp_la_LIBADD): Remove
23535 * INSTALL: Remove -lm from instructions.
23536 * demos/Makefile.am (qcn_LDADD): Add -lm.
23538 * tune/*: Add measuring for mpn_divrem_2 and modlimb_invert,
23539 improve addsub_n. Switch to unified speed_cyclecounter.
23540 * configure.in: Update configs for speed_cyclecounter.
23542 * gmp-impl.h (MP_LIMB_T_MAX, MP_LIMB_T_HIGHBIT): New macros.
23543 * mpn/generic/diveby3.c, mpn/generic/mul_n.c, mpn/generic/gcd.c,
23544 tune/speed.c, mpn/tests/ref.c: Use them.
23546 * mpn/tests/spinner.c: Remove setitimer, just alarm is enough.
23547 * configure.in (AC_CHECK_FUNCS): Remove setitimer.
23548 * mpn/tests/x86call.asm: Start with junk in %eax, %ecx, %edx.
23549 * mpn/tests/ref.[ch] (refmpn_addsub_nc): New function.
23550 * mpn/tests/try.c: Add some support for mpn_addsub_nc.
23551 * mpn/tests/Makefile.am (EXTRA_PROGRAMS): Remove addsub_n and
23552 addsub_n_2 which don't currently build.
23553 * mpn/tests/copy.c: Test MPN_COPY_INCR, not __gmpn_copy.
23555 * tests/rand/Makefile.am (libstat_la_LIBADD): Add -lm, no longer on
23557 (findlc_LDADD): Use libstat.la.
23558 (AUTOMAKE_OPTIONS): Use ansi2knr.
23560 2000-06-08 Torbjorn Granlund <tege@swox.com>
23562 * configure.in (alpha*-*-osf*): Default `flavour' to ev6 for ev6 and
23564 (alpha*-*-*): Likewise.
23565 (alpha*-*-osf*: gmp_optcflags_cc): Move -arch/-tune flags from
23566 gmp_xoptcflags_gcc.
23568 * mpn/Makefile.am (TARG_DIST): Add pa64w.
23570 * longlong.h: Wrap 64-bit hppa code in #ifndef LONGLONG_STANDALONE.
23572 2000-06-07 Torbjorn Granlund <tege@swox.com>
23574 * mpz/remove.c: Fail for `src' being zero.
23576 * mpz/tests/reuse.c: Test more functions.
23577 (FAIL): New define.
23579 * mpz/tests/t-powm.c: Loop during operand generation while they
23580 are mathematically ill-defined (used to just skip such tests).
23582 * mpz/powm.c (mpz_redc): Clean up argument declarations.
23584 * configure.in (gmp_cflags64_gcc): Don't add bogus -mWHAT option.
23585 (sparcv9-*-solaris2.[7-9]], gmp_cflags64_gcc):
23586 Inherit from previous gmp_cflags64_gcc; pass `-m64 -mptr64'.
23589 * mpn/generic/dump.c: Make it work when an mp_limb_t is not `long'.
23591 * mpf/set_prc.c: MPN_COPY => MPN_COPY_INCR.
23593 2000-06-06 Torbjorn Granlund <tege@swox.com>
23595 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n):
23596 Use mpn_incr_u for final carry propagation.
23598 * mpz/tests/t-gcd.c: Add calls to mpz_gcdext with argument t == NULL.
23600 * mpz/tests/reuse.c: Major rewrite; test many more functions.
23602 * mpz/powm_ui.c: When exp is 0, change res assign order in order
23603 to handle argument overlap.
23604 * mpz/powm.c: When exp is 0, change res assign order in order
23605 to handle argument overlap. Handle negative exp and mod arguments.
23607 * mpz/gcdext.c: Rework code after mpn_gcdext call to handle
23610 * mpz/fdiv_qr.c: Read dividend->_mp_size before calling mpz_tdiv_qr
23611 in order to handle argument overlap.
23612 * mpz/cdiv_qr.c: Likewise.
23614 * mpf/tests/reuse.c: Fix typo that effectively disabled `dis_funcs'
23615 tests. Clean up test for mpf_ui_div.
23617 2000-06-06 Kevin Ryde <kevin@swox.se>
23619 * mpn/x86/p6/sqr_basecase.asm: New file.
23620 * mpn/x86/mod_1.asm: Avoid one conditional jump.
23621 * mpn/x86/p6/gmp-mparam.h: Update thresholds, #ifndef UMUL_TIME
23622 and UDIV_TIME, add COUNT_TRAILING_ZEROS_TIME.
23624 * mp_minv_tab.c: New file.
23625 * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
23626 * gmp-impl.h (modlimb_invert): New macro.
23627 * mpz/powm.c: Remove mpz_dmprepare, use modlimb_invert instead.
23628 * mpn/generic/bdivmod.c: Use modlimb_invert instead of a loop.
23629 * mpn/generic/gcd.c: Inline two small mpn_bdivmod calls, use
23630 MPN_COPY_INCR not MPN_COPY in one place.
23632 2000-06-05 Torbjorn Granlund <tege@swox.com>
23634 * mpf/tests/reuse.c (dsi_funcs): Add mpf_mul_2exp and mpf_div_2exp.
23635 (main): Clean up test for mpf_div_ui.
23637 * mpf/mul_2exp.c: Correct criterion for whether to use mpn_lshift or
23638 mpn_rshift. MPN_COPY => MPN_COPY_INCR. Coerce the two assignments to
23641 * mpf/div_2exp.c: Use mpn_rshift instead of mpn_lshift when overlap
23642 so requires. MPN_COPY => MPN_COPY_INCR.
23644 * mpf/tests/t-dm2exp.c: Correct type of res_prec.
23646 2000-06-04 Kevin Ryde <kevin@swox.se>
23648 * mpz/bin_uiui.c: Fix result for n==0 and n==k.
23649 * mpz/bin_ui.c: Fix result for k>n, add support for n<0.
23650 * gmp.texi (Number Theoretic Functions): Update mpz_bin_ui to
23651 note n<0 is supported.
23653 * mpz/tests/t-misc.c: New file.
23654 * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
23656 2000-05-31 Kevin Ryde <kevin@swox.se>
23658 * tune/speed.* (FLAG_R_OPTIONAL): New option for routines, use on
23659 mpn_gcd_1 and mpn_mul_basecase.
23660 * tune/README: Update.
23662 * tune/alpha.asm: New file, by Torbjorn.
23663 * tune/Makefile.am (EXTRA_DIST): Add it.
23664 * configure.in (alpha*-*-*): Use it.
23666 2000-05-31 Linus Nordberg <linus@swox.se>
23668 * doc/configuration: New file.
23670 2000-05-30 Torbjorn Granlund <tege@swox.com>
23672 * mpn/generic/mul_basecase.c: Call mpn_mul_2 and mpn_addmul_2
23673 if available. Don't include longlong.h.
23675 * doc/isa_abi_headache: New file.
23677 2000-05-30 Linus Nordberg <linus@swox.se>
23679 * configure.in (NM): Use AC_PROG_NM rather than AC_CHECK_TOOL to
23680 find `nm'. (AC_PROG_NM comes with Libtool and is needed to get
23681 the `-B' option (BSD compatible output) included in $NM.)
23682 (AR): Use AC_CHECK_PROG rather than AC_CHECK_TOOL to find `ar'.
23683 (Now that NM isn't a cross compilation tool, don't give the
23684 impression that we know how to cross compile.)
23685 (CCAS): Remove spurious comment.
23687 * gmp.texi (Notes for Particular Systems): Remove comment about
23688 using GNU `nm' on AIX since system nm now works.
23690 2000-05-29 Torbjorn Granlund <tege@swox.com>
23692 * mpn/power/mul_1.s: Remove [PR] from first word in function
23694 * mpn/power/addmul_1.s: Likewise.
23695 * mpn/power/submul_1.s: Likewise.
23697 2000-05-28 Kevin Ryde <kevin@swox.se>
23699 * configure.in, tune/*: Change pentium rdtsc cycle scheme to
23700 HAVE_SPEED_CYCLECOUNTER and SPEED_CYCLECOUNTER_OBJS.
23701 * tune/pentium.asm: Renamed and converted from rdtsc.asm.
23702 * tune/sparcv9.asm: New file, by Torbjorn.
23703 * tune/sparc64.asm: New file.
23704 * tune/tuneup.c: Put a limit on gcdext search.
23706 * gmp.h (mp_set_memory_functions): Add extern "C".
23707 * mp.h (__GNU_MP__): Bump to "3".
23708 * mpz/add.c,mul.c,powm.c,sub.c,sqrtrem.c,tdiv_qr.c [BERKELEY_MP]:
23709 Include mp.h for mpbsd compile.
23710 * mpz/gcd.c: Ditto, and remove _mpz_realloc declaration.
23712 * gmp.texi (Integer Functions): Flatten @subsections into @sections.
23713 (Floating-point Functions): Ditto.
23714 (Integer Random Numbers): Split from miscellaneous as a sep section.
23715 (Installing GMP): Make nodes for the sections.
23716 Add more "@cindex"s.
23717 (Known Build Problems): Remove SunOS get_d problem, believed fixed.
23718 (Notes for Particular Systems): Remove HPPA note since now PIC.
23719 (References): URL for Jebelean.
23721 2000-05-27 Torbjorn Granlund <tege@swox.com>
23723 * mpn/pa64w: New directory, contents based on corresponding mpn/pa64
23725 * configure.in (hppa2.0w-*-*): New.
23726 * mpz/tests/io.c (_INCLUDE_POSIX_SOURCE): Define when __hpux before
23728 * gmp-impl.h: Always define DItype and UDItype.
23730 2000-05-27 Kevin Ryde <kevin@swox.se>
23732 * tune/common.c (speed_measure): Correction to array sorting,
23733 better diagnostic when measuring fails.
23734 * tune/time.c: Add microsecond accurate getrusage method.
23736 * tune/time.c (speed_cpu_frequency_processor_info): New function.
23737 * configure.in (AC_CHECK_FUNCS): Add processor_info.
23739 2000-05-26 Linus Nordberg <linus@swox.se>
23741 * gmp.texi (Installing GMP): Shared libraries work for AIX < 4.3
23744 2000-05-26 Torbjorn Granlund <tege@swox.com>
23746 * tune/tuneup.c (SIGNED_TYPE_MAX): Shift `-1' instead of `1' to
23747 avoid signed overflow.
23749 * demos/pexpr.c (setup_error_handler): Don't call sigaltstack on
23752 2000-05-25 Torbjorn Granlund <tege@swox.com>
23754 * insert-dbl.c: Work around GCC 2.8 bug.
23755 * extract-dbl.c: Likewise.
23757 * config.sub: Allow i586, i686, i786 again.
23759 * config.guess: Use X86CPU for lots more systems.
23761 2000-05-25 Linus Nordberg <linus@swox.se>
23763 * mpbsd/tests/dummy.c (main): Call exit() instead of doing return
23764 (some old SysV machines don't get this correct, I've heard.)
23766 2000-05-25 Kevin Ryde <kevin@swox.se>
23768 * mpf/iset_str.c: Initialize _mp_size and _mp_exp to 0, in case no
23769 digits in string, so it's the same as a separate init and set_str.
23771 2000-05-24 Torbjorn Granlund <tege@swox.com>
23773 * mpz/tests/reuse.c: Use mpz_random2 instead of mpz_random.
23775 * mpz/divexact.c: Read pointers after reallocation.
23776 Compare `quot' and `den' instead of `qp' and `dp' in overlap check.
23777 Use MPN_COPY_INCR for copying from `np'.
23779 (*-*-aix4.[3-9]*): Disable shared libs just for problematic AIX
23781 * configure.in (*-cray-unicos*): Disable asm syntax checking; set
23782 compiler explicitly.
23783 * configure.in (hppa*-*-*): Remove code disabling shared libs.
23785 2000-05-24 Linus Nordberg <linus@swox.se>
23787 * acinclude.m4 (GMP_PROG_CC_WORKS): Don't report progress to user
23788 when doing the AIX specific test to avoid "nested output".
23790 2000-05-22 Kevin Ryde <kevin@swox.se>
23792 * mp.h (_PROTO): Copy from gmp.h, use on prototypes.
23793 Add extern "C" too.
23794 * mpbsd/tests/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
23795 * mpbsd/tests/allfuns.c: Don't execute mout, just link to it.
23796 (main): ANSI style definition.
23798 * gmp-impl.h (MP_BASE_AS_DOUBLE): Change the expression to
23799 something that works on SunOS native cc. Seems to fix the
23800 mp*_get_d problems.
23802 * mpn/tests/ref.c (refmpn_strip_twos): Use MPN_COPY_INCR.
23803 * mpn/tests/Makefile.am: Let .asm.o rules work with absolute $srcdir.
23805 2000-05-21 Kevin Ryde <kevin@swox.se>
23807 * mpn/x86/k7/sqr_basecase.asm: Replace file with K7 specific code.
23808 * mpn/x86/k7/README: Update.
23809 * mpn/x86/k7/gmp-mparam.h: Tune thresholds.
23810 (COUNT_TRAILING_ZEROS_TIME): New define.
23811 * mpn/x86/k6/gmp-mparam.h: Ditto.
23813 * mpn/x86/pentium/mmx/popham.asm: New file (include_mpn of K6 version).
23814 * mpn/x86/p6/diveby3.asm: New file (include_mpn of P5 version).
23815 * mpn/x86/p6/mmx/popham.asm: New file (include_mpn of K6 version).
23816 * mpn/x86/p6/p3mmx/popham.asm: New file (include_mpn of K7 version).
23817 * configure.in (pentium3-*-*): Add p3mmx to $path.
23819 * gmp.texi (Integer Arithmetic): Clarify mpz_jacobi op2; add
23821 (Miscellaneous Integer Functions): Add mpz_odd_p and mpz_even_p.
23822 (Low-level Functions): Put mpn_divmod_1 with mpn_divrem_1 and note
23824 (References): Add Henri Cohen.
23826 * gmp.h (mpn_addmul_1c, mpn_divrem_1c, mpn_mod_1c, mpn_mul_1c,
23827 mpn_submul_1c): Add prototypes.
23828 (mpz_odd_p, mpz_even_p): New macros.
23830 * mpn/asm-defs.m4 (m4wrap_prepend): New macro.
23831 (m4_error): Use it.
23832 (m4_not_for_expansion): Corrections to OPERATION symbols.
23833 More comments about variations between m4 versions.
23834 * mpn/x86/x86-defs.m4 (PROLOGUE): Use m4wrap_prepend (fixes error
23835 exit under BSD m4, previously m4_error printed the message but the
23838 * gmp.h (mpn_divmod_1): Change to a macro calling mpn_divrem_1.
23839 * mpn/generic/divrem_1.c: Move divmod_1.c code to here, make it
23840 static and call it __gmpn_divmod_1_internal.
23841 * mpn/generic/divmod_1.c: Remove file.
23842 * configure.in (gmp_mpn_functions): Remove divmod_1.
23843 * mpn/asm-defs.m4 (define_mpn): Remove divmod_1 and divmod_1c.
23844 * compat.c (mpn_divmod_1): Add compatibility function.
23845 * tune/*: Remove mpn_divmod_1 measuring (leave just divrem_1).
23847 * acconfig.h (HAVE_NATIVE_mpn_*): Add some missing carry-in
23848 variants, remove divmod_1.
23850 * mpn/x86/diveby3.asm: Use imul, update comments.
23852 * demos/qcn.c: New file.
23853 * demos/Makefile.am (EXTRA_PROGRAMS): Add it.
23855 * mpz/tests/t-jac.c: New file.
23856 * mpz/tests/Makefile.am (check_PROGRAMS): Add it. Enable ansi2knr.
23858 * mpz/kronsz.c: New file.
23859 * mpz/kronuz.c: New file.
23860 * mpz/kronzs.c: New file.
23861 * mpz/kronzu.c: New file.
23862 * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
23863 * Makefile.am (MPZ_OBJECTS): Add them.
23864 * gmp-impl.h (JACOBI_*, MPN_STRIP_LOW_ZEROS_NOT_ZERO): New macros.
23865 * gmp.h (mpz_*_kronecker_*): New defines and prototypes.
23867 * mpn/generic/jacbase.c: New file.
23868 * mpn/generic/mod_1_rs.c: New file.
23869 * configure.in (gmp_mpn_functions): Add them.
23870 * gmp.h (mpn_jacobi_base, mpn_mod_1_rshift): New defines and
23872 * longlong.h (COUNT_TRAILING_ZEROS_TIME): New define.
23873 * mpn/tests/ref.c (refmpn_mod_1_rshift): New function.
23874 * mpn/tests/try.c: Add mpn_mod_1_rshift.
23875 * tune/*: Add measuring for mpn_jacobi_base.
23877 * acinclude.m4 (GMP_FINISH): Add ifdefs to allow multiple
23878 inclusion of config.m4.
23879 (GMP_PROG_M4): Put "good" message through to config.log.
23881 * mpz/powm.c: Use a POWM_THRESHOLD for where redc stops.
23882 * tune/*: Add mpz_powm measuring, and tune POWM_THRESHOLD.
23883 * gmp-impl.h [TUNE_PROGRAM_BUILD] (POWM_THRESHOLD): Conditional
23884 redefinition for use when tuning.
23886 * mpz/powm_ui.c: Use DIVIDE_BY_ZERO.
23888 * mpz/iset_str.c: Initialize _mp_size to 0, in case no digits in
23889 string; this makes it the same as a separate init and set_str.
23891 2000-05-20 Kevin Ryde <kevin@swox.se>
23893 * mpn/asm-defs.m4: Note &,|,^ aren't bitwise in BSD m4 eval().
23894 * mpn/x86/k6/sqr_basecase.asm: Use "%" not "&" in m4 eval()s.
23896 * mpn/x86/x86-defs.m4 (Zdisp): Yet more instruction forms.
23898 2000-05-19 Linus Nordberg <linus@swox.se>
23900 * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't use shell variable
23901 `ac_compile' for our own compile command string since other
23902 Autoconf macros may depend on it.
23904 2000-05-19 Kevin Ryde <kevin@swox.se>
23906 * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Fix
23907 carry propagation in final coefficient additions.
23909 2000-05-18 Linus Nordberg <linus@swox.se>
23911 * configure.in: Set NM before looking for compiler since
23912 GMP_CHECK_CC_64BIT needs it.
23914 * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't execute on target.
23915 (GMP_PROG_CC_FIND): Before checking if the compiler knows how to
23916 produce 64-bit code, verify that it works at all. The background
23917 is that /usr/ucb/cc on Solaris 7 successfully compiles in 64-bit
23918 mode but fails when doing final link.
23919 (GMP_PROG_CC_WORKS): Report to user what's happening.
23921 2000-05-17 Linus Nordberg <linus@swox.se>
23923 * config.guess: Use X86CPU for x86 Cygwin.
23925 2000-05-16 Kevin Ryde <kevin@swox.se>
23927 * mpn/x86/p6/mmx/divrem_1.asm: New file.
23928 * mpn/x86/p6/mmx/mod_1.asm: New file.
23929 * mpn/x86/p6/README: Update.
23930 * mpn/x86/divrem_1.asm: Update comments.
23931 * mpn/x86/mod_1.asm: Ditto.
23933 2000-05-14 Kevin Ryde <kevin@swox.se>
23935 * tune/speed.h: Run gcd functions on a set of data.
23937 * mpn/tests/try.c: New file.
23938 * mpn/tests/try.h: New file.
23939 * mpn/tests/spinner.c: New file.
23940 * mpn/tests/trace.c: New file.
23941 * mpn/tests/x86call.asm: New file.
23942 * mpn/tests/x86check.c: New file.
23943 * mpn/tests/ref.c (refmpn_hamdist): Allow size==0.
23944 (refmpn_gcd): New function, and other additions supporting it.
23945 * mpn/tests/ref.h: More prototypes.
23946 * mpn/tests/Makefile.am: Add try program, use ansi2knr.
23948 * mpn/x86/k7/mmx/popham.asm: New file.
23949 * mpn/x86/k6/mmx/popham.asm: New file.
23950 * mpn/x86/k6/sqr_basecase.asm: Unroll the addmul, for approx 1.3x
23951 speedup above 15 limbs.
23952 * mpn/x86/k7/README: Update.
23953 * mpn/x86/k6/README: Update, and add notes on plain K6 and pre-CXT
23955 * configure.in (k6*-*-*, athlon-*-*): Add popham.
23957 * mpn/x86/pentium/diveby3.asm: New file.
23958 * mpn/x86/pentium/README: Update.
23960 * gmp.texi (Installing GMP): Add note on bad OpenBSD 2.6 m4.
23961 (Reporting Bugs): Ask for config.m4 if asm file related.
23962 (I/O of Rationals): New section, add mpq_out_str.
23963 (References): Add url for on-line gcc manuals.
23964 A few node and menu updates.
23966 * INSTALL: Better command line argument checking for test progs.
23969 * configure.in (WANT_ASSERT, USE_STACK_ALLOC, HAVE_PENTIUM_RDTSC):
23970 Put descriptions here, not in acconfig.h.
23971 (CALLING_CONVENTIONS_OBJS): New AC_SUBST (for mpn/tests/try).
23972 (HAVE_CALLING_CONVENTIONS): New AC_DEFINE.
23973 (AC_CHECK_HEADERS): Add sys/time.h.
23974 (AC_CHECK_FUNCS): Add getpagesize, setitimer.
23975 (KARATSUBA_SQR_THRESHOLD): Strip trailing comments from the
23976 #define when passing through to config.m4.
23977 * acconfig.h (PACKAGE, VERSION, WANT_ASSERT, USE_STACK_ALLOC,
23978 HAVE_PENTIUM_RDTSC): No need for #undefs, autoheader gets them
23981 * acinclude.m4 (GMP_PROG_M4): Check for broken OpenBSD 2.6 m4
23982 eval(), put messages into config.log.
23983 * mpn/asm-defs.m4: Add notes and test for OpenBSD 2.6 m4.
23985 * mpq/out_str.c: New file.
23986 * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
23987 * Makefile.am (MPQ_OBJECTS): Ditto.
23988 * gmp.h (mpq_out_str): New define and prototype.
23990 2000-05-12 Kevin Ryde <kevin@swox.se>
23992 * configure.in (CONFIG_TOP_SRCDIR): Fix to use $srcdir not
23993 $top_srcdir (which doesn't exist).
23994 * acinclude.m4 (GMP_C_ANSI2KNR): Fix setting U=_.
23995 * gmp-impl.h (mpn_com_n, MPN_LOGOPS_N_INLINE): Fix missing "do"
23996 (not currently used, probably no ill effect anyway).
23998 2000-05-11 Torbjorn Granlund <tege@swox.com>
24000 * randraw.c (lc): Major overhaul (pending rewrite).
24001 (_gmp_rand): Rewrite.
24003 2000-05-08 Torbjorn Granlund <tege@swox.com>
24005 * mpz/tests/convert.c: Call free via _mp_free_func.
24006 * mpf/tests/t-conv.c: Likewise.
24008 * memory.c: Add code enabled for DEBUG that adds special patterns
24009 around allocated blocks.
24011 2000-05-05 Linus Nordberg <linus@swox.se>
24013 * gmp.texi (Miscellaneous Float Functions): Correct parameter list
24014 for mpf_urandomb().
24016 * configure.in: Invoke AC_REVISION.
24018 2000-05-05 Kevin Ryde <kevin@swox.se>
24020 * gmp.texi: Use @dircategory and @direntry.
24021 (Installing GMP): Clarification for --target, updates on SunOS
24023 (Integer Arithmetic): Add mpz_mul_si.
24024 (Initializing Rationals): Add mpq_swap.
24025 (Assigning Floats): Add mpf_swap.
24026 (Low-level Functions): Add mpn_divexact_by3c, and details of what
24027 the calculation actually gives.
24028 (Low-level Functions): Note extra space needed by mpn_gcdext,
24029 clarify the details a bit.
24031 * compat.c: New file, entry points for upward binary compatibility.
24032 (mpn_divexact_by3): Compatibility function.
24033 * Makefile.am (libgmp_la_SOURCES): Add compat.c.
24035 * mpn/tests/ref.c: Rearrange macros for ansi2knr.
24036 (div1): Renamed from div to avoid library function.
24037 (refmpn_divexact_by3c, refmpn_gcd_1, refmpn_popcount,
24038 refmpn_hamdist): New functions.
24039 * mpn/tests/ref.h: Add extern "C", add new prototypes.
24041 * gmp.h (gmp_randinit, etc): Add extern "C".
24042 (_mpq_cmp_ui): Fix prototype name from mpq_cmp_ui.
24043 (mpn_divexact_by3): Now a macro calling mpn_divexact_by3c.
24044 (mpn_divexact_by3c): New prototype and define.
24046 * mpn/x86/diveby3.asm: Change to mpn_divexact_by3c.
24047 * mpn/x86/k6/diveby3.asm: Ditto.
24048 * mpn/generic/diveby3.c: Ditto.
24049 * mpn/asm-defs.m4: Ditto on the define_mpn.
24050 * acconfig.h (HAVE_NATIVE_mpn_divexact_by3c): New define.
24052 * mpq/swap.c: New file, derived from mpz/swap.c.
24053 * mpf/swap.c: Ditto.
24054 * mpq/Makefile.am: Add swap.c.
24055 * mpf/Makefile.am: Ditto.
24056 * Makefile.am: Add two new "swap.lo"s.
24058 * mpn/x86/k6/mmx/com_n.asm: Fix an addressing bug (fortunately
24059 this code hasn't been used anywhere yet).
24061 * mpn/x86/k7/mmx/divrem_1.asm: New file.
24062 * mpn/x86/k7/mmx/mod_1.asm: New file.
24063 * mpn/x86/k7/diveby3.asm: New file.
24064 * mpn/x86/k7/README: Update.
24066 * mpn/x86/k7/aorsmul_1.asm: Use new cmovCC, no object code change.
24067 * mpn/x86/k7/mul_basecase.asm: Ditto.
24068 * mpn/x86/p6/aorsmul_1.asm: Ditto.
24070 * mpn/x86/x86-defs.m4 (defframe_empty_if_zero): Eval the argument.
24071 (cmovCC): New macros, replacing individual cmovCC_reg_reg forms.
24072 (Zdisp): Recognise more instructions.
24073 (shldl,etc): Use m4_instruction_wrapper().
24074 (ASSERT, movl_text_address): New macros.
24076 * mpn/asm-defs.m4: Add remarks on SunOS /usr/bin/m4 and new
24078 (m4_assert_numargs_internal_check): Remove a spurious parameter.
24079 (m4_empty_if_zero): Eval the argument.
24080 (m4_assert, m4_assert_numargs_range, m4_config_gmp_mparam,
24081 m4_instruction_wrapper): New macros.
24083 2000-05-04 Linus Nordberg <linus@swox.se>
24085 * gmp.texi (Reporting Bugs): Be explicit about output from running
24088 2000-05-02 Torbjorn Granlund <tege@swox.com>
24090 * mpn/generic/bz_divrem_n.c (mpn_bz_divrem_n): Handle non-zero return
24091 from first mpn_bz_div_3_halves_by_2 call.
24092 (mpn_bz_divrem_aux): Likewise.
24094 2000-04-30 Kevin Ryde <kevin@swox.se>
24096 * tune/* (GCD_ACCEL_THRESHOLD, GCDEXT_THRESHOLD): Tune these.
24098 * mpn/generic/gcdext.c (GCDEXT_THRESHOLD): Rename from THRESHOLD,
24099 use with >=, adjust default to 17 accordingly.
24100 Use new *_SWAP macros.
24102 * mpn/generic/gcd.c (GCD_ACCEL_THRESHOLD): Rename from
24103 ACCEL_THRESHOLD, use with >=, adjust default to 5 accordingly.
24104 Use new *_SWAP macros.
24106 * mpf/get_str.c, mpf/set_str.c, mpf/sub.c, mpz/add.c, mpz/ior.c,
24107 mpz/and.c, mpz/sub.c, mpz/xor.c, mpz/ui_pow_ui.c,
24108 mpn/generic/mul.c: Use new *_SWAP macros.
24110 * stack-alloc.h: Add extern "C" around prototypes.
24112 * gmp-impl.h: (MP_PTR_SWAP, etc): New macros.
24113 (_mp_allocate_func, etc): Use _PROTO.
24114 [TUNE_PROGRAM_BUILD]: More changes in tune program build part.
24116 2000-04-28 Torbjorn Granlund <tege@swox.com>
24118 * mpn/pa64/add_n.s: Add `,entry' to export directive.
24119 * mpn/pa64/addmul_1.S, mpn/pa64/lshift.s, mpn/pa64/mul_1.S,
24120 mpn/pa64/rshift.s, mpn/pa64/sub_n.s, mpn/pa64/submul_1.S,
24121 mpn/pa64/umul_ppmm.S: Likewise.
24122 * mpn/hppa/hppa1_1/udiv_qrnnd.S: New name for udiv_qrnnd.s.
24125 2000-04-29 Kevin Ryde <kevin@swox.se>
24127 * gmp-impl.h [TUNE_PROGRAM_BUILD] (TOOM3_MUL_THRESHOLD_LIMIT): New
24129 * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Use
24130 TOOM3_MUL_THRESHOLD_LIMIT, not a hard coded 500.
24132 * memory.c: Use <stdlib.h> for malloc etc, and use _PROTO.
24133 * stack-alloc.c: Don't use C++ reserved word "this".
24134 * urandom.h: Put extern "C" around prototypes.
24135 * mpz/powm.c: Switch a couple of parameters to "const", which they
24136 are, to satisfy g++.
24138 * randraw.c, stack-alloc.c, mpbsd/mout.c, mpbsd/mtox.c: Add casts to
24141 * stack-alloc.c: Provide dual ANSI/K&R function definitions.
24142 * mpz/addmul_ui.c,get_d.c,inp_str.c,perfpow.c,powm.c,pprime_p.c,
24143 rrandomb.c,set_str.c,ui_pow_ui.c: Ditto.
24144 * mpf/integer.c,set_str.c: Ditto.
24145 * mpbsd/min.c,xtom.c: Ditto.
24146 * mpn/generic/bz_divrem_n.c,dump.c,gcd_1.c,get_str.c,hamdist.c,
24147 popcount.c,random.c,random2.c,set_str.c: Ditto.
24149 * rand.c: Use <stdio.h> for NULL.
24150 * mpz/gcd_ui.c,gcdext.c,mul.c,perfpow.c,powm_ui.c,root.c,sqrt.c,
24152 * mpf/sqrt.c,sqrt_ui.c: Ditto.
24153 * mpn/generic/perfsqr.c,sqrtrem.c: Ditto.
24155 * gmp-impl.h (NULL, malloc, realloc, free): Don't define/declare.
24156 (extern "C"): Add around function prototypes.
24157 (mpn_kara_mul_n, mpn_kara_sqr_n, mpn_toom3_mul_n, mpn_toom3_sqr_n):
24159 [TUNE_PROGRAM_BUILD] (FIB_THRESHOLD): Add necessary redefinitions for
24160 use by tune program.
24161 * mpn/generic/mul_n.c: Remove mpn_toom3_mul_n prototype.
24163 * acinclude.m4 (GMP_C_ANSI2KNR): New macro.
24164 (GMP_CHECK_ASM_MMX, GMP_CHECK_ASM_SHLDL_CL): Fix to use
24165 $gmp_cv_check_asm_text which is what GMP_CHECK_ASM_TEXT sets.
24166 * configure.in (GMP_C_ANSI2KNR): Use this instead of AM_C_PROTOTYPES,
24167 for reasons described with its definition.
24169 * demos/Makefile.am (ansi2knr): Use $(top_builddir) nor $(top_srcdir).
24171 * mpz/fib_ui.c (FIB_THRESHOLD): Rename from FIB_THRES, for consistency.
24172 (FIB_THRESHOLD): Conditionalize so gmp-mparam.h can define a value.
24173 (mpz_fib_bigcase): Use >= FIB_THRESHOLD, same as main mpz_fib_ui.
24174 * tune/tuneup.c,Makefile.am (FIB_THRESHOLD): Tune this.
24176 * configure.in (*-*-aix* gmp_m4postinc): Fix setting (don't overwrite
24177 a value just stored).
24179 2000-04-26 Kevin Ryde <kevin@swox.se>
24181 * mpn/sparc32/udiv_fp.asm: Use mpn_udiv_qrnnd macro.
24182 * mpn/sparc32/udiv_nfp.asm: Ditto.
24183 * mpn/sparc32/v8/supersparc/udiv.asm: Ditto.
24184 * mpn/sparc32/umul.asm: Name the function mpn_umul_ppmm.
24185 * mpn/sparc32/v8/umul.asm: Ditto.
24186 * mpn/powerpc32/umul.asm: Ditto.
24188 * mpn/x86/syntax.h: Remove file, since now unused.
24190 * configure.in (x86): Remove -DBROKEN_ALIGN and -DOLD_GAS
24191 previously used by .S files.
24192 (x86 extra_functions): Add udiv and umul.
24193 (GMP_PROG_M4): Use this instead of AC_CHECK_PROG(M4,m4,...)
24194 (HAVE_NATIVE_*): Loosen up the regexp to "PROLOGUE.*" so as to
24195 accept PROLOGUE_GP on alpha.
24197 * acconfig.h (HAVE_NATIVE_mpn_umul_ppmm, udiv_qrnnd, invert_limb):
24198 New template defines.
24199 * mpn/asm-defs.m4 (mpn_umul_ppmm, mpn_udiv_qrnnd): New define_mpn()s.
24200 * longlong.h (umul_ppmm, udiv_qrnnd): Use a library version if
24201 it's available and an asm macro isn't.
24202 * gmp-impl.h (invert_limb): Ditto.
24204 * gmp-impl.h (ASSERT_NOREALLOC): Not a good idea, remove it.
24206 * acinclude.m4 (GMP_PROG_M4): New macro.
24208 2000-04-25 Linus Nordberg <linus@swox.se>
24210 * gmp.texi (Random State Initialization): Correct arguments to
24213 * acinclude.m4 (GMP_VERSION): Change `eval' --> `m4_eval'. Fix
24215 * aclocal.m4: Regenerate.
24217 2000-04-25 Kevin Ryde <kevin@swox.se>
24219 * mpn/x86/aors_n.asm: Remove parentheses around an immediate that
24220 Solaris "as" doesn't like, change by Torbjorn.
24222 2000-04-24 Kevin Ryde <kevin@swox.se>
24224 * configure.in (AC_CHECK_FUNCS): Add strtoul.
24226 * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Bigger
24227 array for karatsuba temporary space for tune program build.
24228 (mpn_toom3_sqr_n) Remove an unused variable.
24230 * demos/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
24231 Add "allprogs:" pseudo-target.
24232 * demos/factorize.c, demos/isprime.c: Switch to ANSI functions,
24235 * gmp.texi (Getting the Latest Version of GMP): Add reference to
24236 ftp.gnu.org mirrors list.
24237 * INSTALL: Add arg count check to example programs.
24239 * mpn/x86/*/*.asm: Convert to FORTRAN ... or rather to
24240 FORTRAN-style "C" commenting to support Solaris "as".
24241 * mpn/x86/x86-defs.m4: Ditto, and add another Zdisp insn.
24242 * mpn/asm-defs.m4 (C): Update comments.
24243 * mpn/x86/README.family: Add a note on commenting, remove
24244 description of .S files.
24246 * mpn/sparc64/addmul_1.asm, mul_1.asm, submul_1.asm: Use
24249 2000-04-23 Torbjorn Granlund <tege@swox.com>
24251 * config.sub: Merge with FSF version of April 23.
24253 * mpn/powerpc32: Use dnl/C instead of `#' for comments.
24255 * config.guess: Get "model" limit between pentium 2 and pentium3 right.
24256 Get rid of code determining `_' prefix; use double labels instead.
24257 * config.guess: Partially merge with FSF version of April 22.
24258 (Don't bring over NetBSD changes for now.)
24260 2000-04-23 Kevin Ryde <kevin@swox.se>
24262 * tune/Makefile.am, tune/README, tune/common.c, tune/rdtsc.asm,
24263 tune/speed.c, tune/speed.h, tune/time.c, tune/tuneup.c: New files.
24264 * tune/Makefile.in: New file, generated from Makefile.am.
24266 * gmp-impl.h (ASSERT_NOREALLOC,TMP_ALLOC_LIMBS): New macros.
24267 [TUNE_PROGRAM_BUILD] Further mods for tune program builds.
24269 * mpz/Makefile.am: Add -DOPERATION_$* for new mul_siui.c.
24270 Add rules to build mul_si and mul_ui from a common mul_siui.c.
24271 * mpz/mul_siui.c: New file, derived from and replacing mul_ui.c.
24272 * gmp.h (mpz_mul_si): New prototype and define.
24274 * mpn/tests/*.c [__i386__] (CLOCK): Don't use floating point in
24275 CLOCK because cpp can't handle floats in #if's (TIMES is derived
24276 from CLOCK by default).
24278 * mpn/asm-defs.m4 (include_mpn): New macro.
24279 (m4_assert_numargs) Changes to implementation.
24281 * mpf/Makefile.am: Add -DOPERATION_$* for new integer.c.
24282 Remove explicit rules for floor.o etc.
24283 * mpf/integer.c: Use OPERATION_$* for floor/ceil/trunc.
24285 * mpn/Makefile.am: Put "tests" in SUBDIRS.
24286 * mpn/tests/Makefile.am: New file providing rules to build test
24287 programs, nothing done in a "make all" or "make check" though.
24288 * mpn/tests/README: New file.
24290 * acconfig.h (HAVE_PENTIUM_RDTSC): New define.
24292 * configure.in (x86): Rearrange target cases.
24293 Add mulfunc aors_n and aorsmul_1 for x86 and pentium (now all x86s).
24294 Remove asm-syntax.h generation not needed.
24295 Remove now unused family=x86.
24296 (sparc) Remove unused family=sparc.
24297 (HAVE_PENTIUM_RDTSC) New AC_DEFINE and AM_CONDITIONAL.
24298 (AM_C_PROTOTYPES) New test, supporting ansi2knr.
24299 (AC_CHECK_HEADERS) Add getopt.h, unistd.h and sys/sysctl.h for
24301 (AC_CHECK_FUNCS) Add getopt_long, sysconf and sysctlbyname for
24303 (config.m4 CONFIG_TOP_SRCDIR) Renamed from CONFIG_SRCDIR.
24304 (config.m4 asm-defs.m4) Use CONFIG_TOP_SRCDIR and include().
24305 (gmp_m4postinc) Use include_mpn().
24306 (gmp_links) Omit asm-defs.m4/asm.m4 and gmp_m4postinc's.
24307 (MULFUNC_PROLOGUE) Fix regexps so all functions get AC_DEFINE'd.
24308 (PROLOGUE) Ditto (native copyi and copyd were unused in gmp 3).
24309 (KARATSUBA_SQR_THRESHOLD) Copy from gmp-mparam.h into config.m4.
24310 (AC_OUTPUT) Add tune/Makefile, mpn/tests/Makefile.
24312 * Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
24313 (SUBDIRS): Add tune, reorder directories.
24314 (MPZ_OBJECTS): Add mpz/mul_si.lo.
24315 (libmp_la_SOURCES): Use this for top-level objects, not .lo's.
24316 * ansi2knr.c, ansi2knr.1: New files, provided by automake.
24318 * mpn/x86/aors_n.asm: Convert add_n.S and sub_n.S to a
24319 multi-function aors_n.asm, no object code change.
24320 * mpn/x86/pentium/aors_n.asm: Ditto.
24321 * mpn/x86/aorsmul_1.asm: Ditto for addmul/submul.
24322 * mpn/x86/pentium/aorsmul_1.asm: Ditto.
24324 * mpn/x86/lshift.asm, mpn/x86/mul_1.asm, mpn/x86/mul_basecase.asm,
24325 mpn/x86/rshift.asm: Convert from .S, no object code change.
24326 * mpn/x86/pentium/lshift.asm, mpn/x86/pentium/mul_1.asm,
24327 mpn/x86/pentium/mul_basecase.asm, mpn/x86/pentium/rshift.asm: Ditto.
24329 * gmp.texi (Reporting Bugs): Itemize the list of things to include.
24330 (Miscellaneous Float Functions): Correct typo in mpf_ceil etc
24332 Change @ifinfo -> @ifnottex for benefit of makeinfo --html.
24333 Remove unnecessary @iftex's around @tex.
24335 2000-04-22 Torbjorn Granlund <tege@swox.com>
24337 * config.guess: Generalize x86 cpu determination code.
24338 Now works on Solaris.
24340 * mpz/nextprime.c: Rewrite still disabled code.
24342 * configure.in: Specifically match freebsd[3-9].
24344 2000-04-21 Torbjorn Granlund <tege@swox.com>
24346 * rand.c: Call mpz_clear for otherwise leaking mpz_t.
24348 * mpz/pprime_p.c (mpz_probab_prime_p): Merge handling of negative
24349 n into code for handling small positive n. Merge variables m and n.
24350 After dividing, simply call mpz_millerrabin.
24351 (isprime): Local variables now use attribute `long'.
24352 (mpz_millerrabin): New static function, based on code from
24353 mpz_probab_prime_p.
24354 (millerrabin): Now simple workhorse for mpz_millerrabin.
24356 2000-04-19 Torbjorn Granlund <tege@swox.com>
24358 * gmp-impl.h: Fix parenthesis error in test for __APPLE_CC__.
24360 2000-04-18 Linus Nordberg <linus@swox.se>
24362 * NEWS: Add info about shared libraries. Remove reference to
24365 2000-04-17 Torbjorn Granlund <tege@swox.com>
24367 * Version 3.0 released.
24369 * mpn/arm/add_n.S: New version from Robert Harley.
24370 * mpn/arm/addmul_1.S: Likewise.
24371 * mpn/arm/mul_1.S: Likewise.
24372 * mpn/arm/sub_n.S: Likewise.
24374 * gmp.h (__GNU_MP_VERSION_PATCHLEVEL): Now 0.
24376 2000-04-17 Linus Nordberg <linus@swox.se>
24378 * configure.in (hppa2.0*-*-*): Pass `+O3' to cc/c89 in 64-bit mode
24379 to avoid compiler bug.
24380 (ns32k*-*-*): Fix typo in path. Change by Kevin.
24381 (alpha*-*-osf*): New case. Pass assembly flags for architecture
24383 (alpha*-*-*): Don't bother searching for cc.
24384 * configure: Regenerate.
24386 * Makefile.am (EXTRA_DIST): Add `macos', `.gdbinit'.
24387 * Makefile.in: Regenerate.
24388 * mpn/Makefile.am (EXTRA_DIST): Add `m88k', `lisp'.
24389 * mpn/Makefile.in: Regenerate.
24391 2000-04-16 Kevin Ryde <kevin@swox.se>
24393 * README: Updates, and don't duplicate the example in INSTALL.
24394 * INSTALL: Minor updates.
24395 * gmp.texi (Installing MP): Minor edits, restore CC/CFLAGS description.
24397 2000-04-16 Linus Nordberg <linus@swox.se>
24399 * configure.in (*-*-cygwin*): Select BSD_SYNTAX to avoid
24400 .type/.size in PROLOGUE for ELF_SYNTAX. Override ALIGN definition
24402 (gmp_xoptcflags_${CC}): New set of variables, indicating
24403 ``exclusive optional cflags''.
24404 (most sparcs): Use gmp_xoptcflags instead of gmp_optcflags to
24405 ensure that we pass CPU type to older gcc.
24406 (CFLAGS): CFLAGS on the command line was spoiled.
24407 * configure: Regenerate.
24409 2000-04-16 Linus Nordberg <linus@swox.se>
24411 * configure.in: Invoke AC_PROG_LIBTOOL directly.
24413 * acinclude.m4 (GMP_PROG_CC_FIND): Quote source variable when
24414 setting CC64 and CFLAGS64.
24415 (GMP_PROG_CC_SELECT): Cache result.
24416 (GMP_PROG_LIBTOOL): Remove.
24418 * aclocal.m4: Regenerate.
24419 * configure: Regenerate.
24421 2000-04-16 Linus Nordberg <linus@swox.se>
24423 * tests/rand/t-rand.c (main): Add non-ANSI function declaration.
24426 2000-04-16 Torbjorn Granlund <tege@swox.com>
24428 * mpn/generic/dump.c: Suppress output of leadign zeros.
24430 * mpz/inp_str.c: Fix memory leakage.
24432 * mpz/tests/reuse.c (dss_func_division): Add a final 1.
24434 * longlong.h (alpha count_leading_zeros): Wrap in __MPN.
24435 * mpn/alpha/cntlz.asm: Use __gmpn prefix (by means of __MPN).
24437 * longlong.h (__umul_ppmm, __udiv_qrnnd): Wrap in __MPN.
24438 * mpn/alpha/udiv_qrnnd.S: Use __gmpn prefix.
24439 * mpn/hppa/udiv_qrnnd.s: Likewise.
24440 * mpn/hppa/hppa1_1/udiv_qrnnd.s: Likewise.
24441 * mpn/pa64/udiv_qrnnd.c: Likewise (by means of __MPN).
24442 * mpn/pa64/umul_ppmm.S: Likewise.
24443 * mpn/sparc32/udiv_fp.asm: Likewise (by means of MPN).
24444 * mpn/sparc32/udiv_nfp.asm: Likewise (by means of MPN).
24445 * mpn/sparc32/v8/supersparc/udiv.asm: Likewise (by means of MPN).
24447 * mpn/generic/tdiv_qr.c: Work around gcc 2.7.2.3 i386 register handling
24450 * mpn/generic/tdiv_qr.c: Use udiv_qrnnd instead of mpn_divrem_1
24451 when computing appropriate quotient; mpn_divrem_1 writes too
24452 many quotient limbs.
24454 * mpn/asm-defs.m4: invert_normalized_limb => invert_limb.
24455 * mpn/alpha/invert_limb.asm: mpn_invert_normalized_limb =>
24458 * gmp-impl.h (alpha specific): invert_normalized_limb => invert_limb;
24460 * longlong.h (alpha udiv_qrnnd): Likewise.
24462 2000-04-16 Kevin Ryde <kevin@swox.se>
24464 * gmp.h (mp_set_memory_functions,mp_bits_per_limb,gmp_errno): Add
24465 #defines so the library symbols are __gmp_*.
24466 * errno.c: Include gmp.h.
24467 * gmp-impl.h (_mp_allocate_func,etc): Add #defines to __gmp_*.
24468 (__clz_tab): New #define to __MPN(clz_tab).
24469 * stack-alloc.c (__gmp_allocate_func,etc): Change from _mp_*.
24471 * Makefile.am (libmp_la_DEPENDENCIES): Add some mpz files needed
24472 for new mpz_powm (pow in libmp).
24473 (EXTRA_DIST): Add projects directory.
24475 * mpn/*: Change __mpn to __gmpn.
24476 * gmp.h (__MPN): Ditto.
24477 * stack_alloc.c,stack-alloc.h: Change __tmp to __gmp_tmp.
24479 * mpn/generic/sb_divrem_mn.c (mpn_sb_divrem_mn): Avoid gcc 2.7.2.3
24480 i386 register handling bug (same as previously in mpn_divrem_classic).
24482 * mpn/generic/divrem.c: Now contains mpn_divrem, which is not an
24483 internal function, so remove warning comment.
24485 * gmp.texi (Compatibility with Version 2.0.x): Source level only.
24487 2000-04-16 Linus Nordberg <linus@swox.se>
24489 * configure.in (hppa1.0*): Prefer c89 to cc.
24490 * configure: Regenerate.
24492 2000-04-15 Linus Nordberg <linus@swox.se>
24494 * configure.in: If `mpn_path' is set by user on configure command
24495 line, use that as path.
24496 * configure: Regenerate.
24498 2000-04-15 Linus Nordberg <linus@swox.se>
24500 * configure.in (hppa2.0*): Use path "hppa/hppa1_1 hppa" if no
24501 64-bit compiler was found.
24502 * configure: Regenerate.
24504 2000-04-15 Linus Nordberg <linus@swox.se>
24506 * configure.in: Honor `CC' and `CFLAGS' set by user on configure
24508 * acinclude.m4: (GMP_PROG_CC_SELECT): Set CFLAGS if not set already.
24509 * aclocal.m4: Regenerate.
24510 * configure: Regenerate.
24512 2000-04-15 Linus Nordberg <linus@swox.se>
24514 * acinclude.m4 (GMP_PROG_CC_FIND): Remove debug output. Remove
24515 commented out code.
24516 * aclocal.m4: Regenerate.
24517 * configure: Regenerate.
24519 * configure.in: Make all `-mcpu' options to gcc optional.
24520 * configure: Regenerate.
24522 * tests/rand/Makefile.am: Don't do anything for target 'all'.
24523 * tests/rand/Makefile.in: Regenerate.
24525 2000-04-15 Kevin Ryde <kevin@swox.se>
24527 * README: Small updates.
24528 * NEWS: Add some things about 3.0.
24530 * mpz/Makefile.am (EXTRA_DIST): Remove dmincl.c.
24532 * Makefile.am: Use -version-info on libraries, not -release.
24534 * mpz/tdiv_qr.c: Add mdiv function header #ifdef BERKELEY_MP.
24535 * mpbsd/Makefile.am: Use mpz/tdiv_qr.c, not mdiv.c.
24536 * Makefile.am (MPBSD_OBJECTS): Change mdiv.lo to tdiv_qr.lo.
24537 (libmp_la_DEPENDENCIES): Add mp_clz_tab.lo.
24538 * mpbsd/mdiv.c: Remove file.
24540 * config/mt-linux,mt-m68k,mt-m88110,mt-ppc,mt-ppc64-aix,mt-pwr,
24541 mt-sprc8-gcc,mt-sprc9-gcc,mt-supspc-gcc,mt-vax,mt-x86,
24542 mpn/config/mt-pa2hpux,mt-sprc9,t-oldgas,t-ppc-aix,t-pwr-aix:
24543 Remove configure fragments not used since change to autoconf.
24545 * mpn/generic/bz_divrem_n.c,sb_divrem_mn.c: Add comment that
24546 internal functions are changeable and shouldn't be used directly.
24548 2000-04-15 Linus Nordberg <linus@swox.se>
24550 * configure.in: Remove debug output.
24551 * configure: Regenerate.
24553 2000-04-15 Torbjorn Granlund <tege@swox.com>
24555 * mpn/generic/tdiv_qr.c: Don't use alloca directly.
24557 * mpz/tdiv_qr.c: Fix typo.
24558 * mpz/tdiv_r.c: Fix typo.
24559 * mpz/tdiv_q.c: Fix typo.
24561 * configure.in: Disable -march=pentiumpro due to apparent compiler
24564 * mpz/powm.c: Replace with new code from Paul Zimmermann.
24566 * mpz/tdiv_q.c: Remove debug code.
24568 * mpn/generic/divrem.c: Remove C++ style `//' commented-out code.
24569 * mpn/generic/sb_divrem_mn.c: Likewise.
24571 2000-04-14 Torbjorn Granlund <tege@swox.com>
24573 * mpz/cdiv_q.c: Change temp allocation for new requirements of
24575 * mpz/fdiv_q.c: Likewise.
24577 * mpn/sparc64/gmp-mparam.h: Set up parameters for TOOM3.
24579 * mpz/dmincl.c: Delete file.
24580 * mpz/tdiv_qr.c: Rewrite using mpn_tdiv_qr.
24581 * mpz/tdiv_r.c: Likewise.
24582 * mpz/tdiv_q.c: Likewise.
24584 * mpn/generic/tdiv_qr.c: New file.
24585 * mpn/generic/bz_divrem_n.c: New file.
24586 * mpn/generic/sb_divrem_mn.c: New file.
24588 * gmp-impl.h (MPZ_REALLOC): New macro.
24589 (mpn_sb_divrem_mn): Declare.
24590 (mpn_bz_divrem_n): Declare.
24591 (mpn_tdiv_qr): Declare.
24593 * configure.in (gmp_mpn_functions): Delete divrem_newt and divrem_1n;
24594 add tdiv_qr, bz_divrem_n, and sb_divrem_mn.
24595 * mpn/generic/divrem_newt.c: Delete file.
24596 * mpn/generic/divrem_1n.c: Delete file.
24598 * gmp.h (mpn_divrem_newton): Remove declaration.
24599 (mpn_divrem_classic): Remove declaration.
24601 * gmp.h (mpn_divrem): Remove function definition.
24602 * mpn/generic/divrem.c: Replace mpn_divrem_classic with a
24603 mpn_divrem wrapper.
24605 2000-04-14 Kevin Ryde <kevin@swox.se>
24607 * mpf/dump.c, mpz/dump.c, mpn/generic/dump.c,
24608 mpn/generic/divrem.c, mpn/generic/divrem_1n.c,
24609 mpn/generic/divrem_2.c, mpn/generic/divrem_newt.c,
24610 mpn/generic/mul.c, mpn/generic/mul_basecase.c,
24611 mpn/generic/mul_n.c, mpn/generic/sqr_basecase.c,
24612 mpn/generic/udiv_w_sdiv.c: Add comment that internal functions are
24613 changeable and shouldn't be used directly.
24615 * mpq/div.c: Use DIVIDE_BY_ZERO (previously didn't get an
24616 exception on zero divisor).
24618 * mpf/tests/t-get_d.c, mpz/tests/reuse.c: Add K&R function
24620 * mpz/tests/t-2exp.c: Don't use ANSI-ism 2ul.
24622 * gmp.texi (Installing MP): Build problem notes for GSYM_PREFIX
24623 and ranlib on native SunOS.
24624 Particular systems notes about AIX and HPPA shared libraries
24626 (MP Basics): Add that undocumented things shouldn't be used.
24627 (Introduction to MP): Add to CPUs listed.
24629 * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Don't depend on C
24632 2000-04-13 Linus Nordberg <linus@swox.se>
24634 * mpn/pa64/udiv_qrnnd.c (__udiv_qrnnd64): Add K&R function
24637 * configure.in: Disable shared libraries for hppa*.
24638 (mips-sgi-irix6.*): Fix flags for 64-bit gcc.
24639 (hppa2.0*-*-*): Prefer c89 to cc.
24640 * configure: Regenerate.
24642 * gmp.h (gmp_randalg_t): Remove comma after last element.
24644 * tests/rand/t-rand.c: Add copyright notice.
24646 2000-04-13 Kevin Ryde <kevin@swox.se>
24648 * mpn/generic/mul_n.c, mpn/generic/gcdext.c, mpz/nextprime.c,
24649 mpz/remove.c, mpz/root.c: Add K&R function definitions.
24650 * mpz/rrandomb.c: Fix typo in K&R part.
24651 * stack-alloc.c: Add K&R style function pointer declarations.
24653 * mpz/root.c: Use SQRT_OF_NEGATIVE on even roots of negatives.
24654 Use DIVIDE_BY_ZERO on a "zero'th" root.
24656 * configure: Regenerate with autoconf backpatched to fix --srcdir
24657 absolute path wildcards that bash doesn't like, change by Linus.
24659 * gmp.texi (Integer Arithmetic): Document mpz_nextprime.
24660 (Miscellaneous Integer Functions): Fix mpz_fits_* formatting.
24661 (Installing MP): Comment-out CC and CFLAGS description.
24663 2000-04-13 Linus Nordberg <linus@swox.se>
24665 * rand.c (gmp_randinit): Don't combine va_alist with ordinary
24666 arguments for non STDC.
24668 2000-04-13 Torbjorn Granlund <tege@swox.com>
24670 * mpz/nextprime.c: Use proper names of new random types and functions.
24672 * mpz/rrandomb.c: New file.
24673 * mpz/Makefile.am: List it.
24674 * mpz/Makefile.in: Regenerate.
24675 * Makefile.am: Here too.
24676 * Makefile.in: Regenerate.
24677 * gmp.h: Declare mpz_rrandomb.
24679 2000-04-12 Linus Nordberg <linus@swox.se>
24681 * Makefile.am, demos/Makefile.am, mpbsd/Makefile.am,
24682 mpbsd/tests/Makefile.am, mpf/Makefile.am, mpf/tests/Makefile.am,
24683 mpn/Makefile.am, mpq/Makefile.am, mpq/tests/Makefile.am,
24684 mpz/Makefile.am, mpz/tests/Makefile.am, tests/Makefile.am,
24685 tests/rand/Makefile.am (AUTOMAKE_OPTIONS): Add 'no-dependencies'.
24687 * Makefile.in, demos/Makefile.in, mpbsd/Makefile.in,
24688 mpbsd/tests/Makefile.in, mpf/Makefile.in, mpf/tests/Makefile.in,
24689 mpn/Makefile.in, mpq/Makefile.in, mpq/tests/Makefile.in,
24690 mpz/Makefile.in, mpz/tests/Makefile.in, tests/Makefile.in,
24691 tests/rand/Makefile.in: Regenerate.
24693 2000-04-12 Linus Nordberg <linus@swox.se>
24695 * randlc.c (gmp_randinit_lc): Disable function.
24696 * gmp.texi (Random State Initialization): Remove gmp_randinit_lc.
24698 * acinclude.m4 (GMP_CHECK_CC_64BIT): Compiling an empty main
24699 successfully with `-n32' will have to suffice on irix6.
24700 * aclocal.m4: Regenerate.
24702 * configure.in (sparc): Don't pass -D_LONG_LONG_LIMB to compiler.
24703 (mips-sgi-irix6.*): Use compiler option `-n32' rather than `-64'
24704 for 64-bit `cc'. Add options for gcc.
24705 * configure: Regenerate.
24707 * mpf/urandomb.c (mpf_urandomb): Add third parameter 'nbits'. If
24708 'nbits' doesn't make even limbs, shift up result before
24711 * gmp.h (mpf_urandomb): Add parameter to prototype.
24713 * mpf/urandom.c: Rename file to ...
24714 * mpf/urandomb.c: ... this.
24715 * Makefile.am (MPF_OBJECTS): Change urandom.lo --> urandomb.lo.
24716 * Makefile.in: Regenerate.
24717 * mpf/Makefile.am (libmpf_la_SOURCES): Change urandom.c --> urandomb.c.
24718 * mpf/Makefile.in: Regenerate.
24720 * config.in: Regenerate for HAVE_DECL_OPTARG.
24722 * randraw.c (_gmp_rand): Fix bug with _LONG_LONG_LIMB.
24723 (lc): Change return type.
24724 Use one temporary storage instead of two.
24725 Handle seed of size 0.
24726 Avoid modulus operation in some cases.
24727 Abort if M is not a power of 2.
24728 Fix bug with 64-bit limbs.
24729 Fix bug with small seed, small A and large M.
24731 * tests/rand/gen.c (main): Include gmp.h. Remove macros MIN, MAX. Add
24732 option '-q'. Don't demand argument N. Change parameters in call
24735 * tests/rand/t-rand.c: New file for testing random number generation.
24737 * tests/rand/Makefile.am: Run t-rand for 'make check'.
24738 (test, bigtest): Rename to manual-test, manual-bigtest.
24739 * tests/rand/Makefile.in: Regenerate.
24741 2000-04-12 Kevin Ryde <kevin@swox.se>
24743 * gmp-impl.h: Include config.h before TMP_ALLOC, so
24744 --disable-alloca works.
24746 * mpbsd/Makefile.am: Don't recompile top-level sources here.
24747 * Makefile.am (libmp_la_DEPENDENCIES): Put objects here instead,
24748 add errno.lo and stack-alloc.lo.
24750 * mpn/asm-defs.m4: Add a test and message for the unsuitable SunOS m4.
24751 * gmp.texi (Installing MP): Update note on SunOS m4 failure.
24753 * acconfig.h: Add copyright notice using @TOP@.
24755 * stack-alloc.c: Use _mp_allocate_func, not malloc.
24756 * gmp.texi (Installing MP): Note this under --disable-alloca.
24758 * gmp.texi (Comparison Functions): mpz_cmp_abs => mpz_cmpabs.
24759 (Integer Arithmetic): mpz_prime_p not yet implemented, comment out.
24760 (Float Arithmetic): mpf_pow_ui now implemented, uncomment-out.
24761 (Miscellaneous Float Functions): Add mpf_ceil, mpf_floor, mpf_trunc.
24762 (Low-level Functions): Add mpn_random2, with mpn_random.
24764 * mpn/m68k/mc68020/udiv.S: Rename from udiv.s.
24765 * mpn/m68k/mc68020/umul.S: Ditto.
24767 * mpn/alpha/umul.asm: Rename from umul.s, remove .file and
24768 compiler identifiers.
24770 * mpn/powerpc32/syntax.h: Removed, no longer used.
24772 * mpn/a29k/udiv.s: Remove .file and compiler identifiers.
24773 * mpn/a29k/umul.s: Ditto.
24775 * mpn/tests/ref.c: Use WANT_ASSERT.
24776 * mpn/tests/ref.h: Use _PROTO.
24778 * mpbsd/configure.in: Removed, no longer required.
24780 * mpf/div.c: Use DIVIDE_BY_ZERO.
24781 * mpf/div_ui.c: Ditto.
24782 * mpf/ui_div.c: Ditto.
24783 * mpq/inv.c: Ditto.
24784 * mpf/sqrt.c: Use SQRT_OF_NEGATIVE.
24785 * mpz/sqrt.c: Ditto.
24786 * mpz/sqrtrem.c: Ditto.
24788 * gmp-impl.h (GMP_ERROR,SQRT_OF_NEGATIVE): New macros.
24789 (DIVIDE_BY_ZERO): Use GMP_ERROR.
24790 (__mp_bases): #define to __MPN(mp_bases).
24792 2000-04-11 Linus Nordberg <linus@swox.se>
24794 * tests/rand/stat.c (main): Initialize `l1runs' at declaration.
24796 2000-04-11 Kevin Ryde <kevin@swox.se>
24798 * mpz/fib_ui.c: Add K&R function definitions.
24800 * mpbsd/tests/Makefile.am (TESTS): Add a dummy test to avoid a
24801 shell problem with an empty "for tst in $(TESTS) ; ...".
24802 * mpbsd/tests/dummy.c: New file.
24804 2000-04-10 Torbjorn Granlund <tege@swox.com>
24806 * mpz/bin_uiui.c: Delete several unused variables.
24807 Add copyright notice.
24808 * mpz/bin_ui.c: Add copyright notice.
24810 * longlong.h: Declare __count_leading_zeros for alpha.
24812 2000-04-10 Linus Nordberg <linus@swox.se>
24814 * rand.c (gmp_randinit): Change parameter list to (rstate, alg, ...).
24815 * gmp.h: Change prototype accordingly.
24816 * mpz/pprime_p.c (millerrabin): Change call accordingly.
24818 * configure.in: Check for `optarg'.
24819 * configure: Regenerate.
24821 * mpn/Makefile.am: Remove incorrect comment.
24822 * mpn/Makefile.in: Regenerate.
24824 * gmp.h: Rename most of the random number functions, structs and some
24825 of the struct members.
24826 * rand.c (gmp_randinit): Likewise.
24827 * randclr.c (gmp_randclear): Likewise.
24828 * randlc.c (gmp_randinit_lc): Likewise.
24829 * randlc2x.c (gmp_randinit_lc_2exp): Likewise.
24830 * randraw.c (lc): Likewise.
24831 (_gmp_rand_getraw): Likewise.
24832 * randsd.c (gmp_randseed): Likewise.
24833 * randsdui.c (gmp_randseed_ui): Likewise.
24834 * gmp.texi: Likewise.
24836 * gmp.texi: Use three hyphens for a dash.
24837 (Low-level Functions): Remove documentation for gmp_rand_getraw.
24838 (Random Number Functions): Add info on where to find documentation
24839 on the random number functions.
24841 * tests/rand/Makefile.am (test, bigtest): Quote argument to grep.
24842 * tests/rand/Makefile.in: Regenerate.
24844 * tests/rand/gen.c: Declare optarg, optind, opterr if not already
24846 (main): Use new names for the random stuff.
24847 (main): Don't use strtoul() if we don't have it. Use strtol()
24848 instead, if we have it. Otherwise, use atoi().
24849 (main): Use srandom/srandomdev for __FreeBSD__ only.
24850 (main): Use new parameter order to gmp_randinit().
24852 * tests/rand/stat.c: Declare optarg, optind, opterr if not already
24855 2000-04-10 Torbjorn Granlund <tege@swox.com>
24857 * mpz/pprime_p.c: Pass 0L for mpz_scan1. mpz_mmod => mpz_mod.
24858 (millerrabin): Use new random interface.
24859 (millerrabin): ... and don't forget to call gmp_randclear.
24861 * mpz/nextprime.c: New file.
24862 * gmp.h: Declare mpz_nextprime.
24863 * mpz/Makefile.am: List nextprime.c.
24864 * mpz/Makefile.in: Regenerate.
24865 * Makefile.am: List mpz/nextprime.lo.
24866 * Makefile.in: Regenerate.
24868 2000-04-10 Kevin Ryde <kevin@swox.se>
24870 * move-if-change, mpz/tests/move-if-change, mpq/tests/move-if-change,
24871 mpf/tests/move-if-change: Remove, no longer used.
24873 * Makefile.am (SUBDIRS): Add tests, demos, mpbsd.
24874 (libmp.la): New target, conditional on WANT_MPBSD.
24875 (libgmp_la_LIBADD): Add -lm.
24876 (AUTOMAKE_OPTIONS): Add check-news.
24877 (include_HEADERS): Setup to install gmp.h and possibly mp.h.
24878 (DISTCLEANFILES): Add generated files.
24879 (check): Remove explicit target (now uses check-recursive).
24881 * configure.in: Use AM_CONFIG_HEADER.
24882 Add --enable-mpbsd setting automake conditional WANT_MPBSD.
24883 Output demos/Makefile, mpbsd/Makefile and mpbsd/tests/Makefile.
24885 * mpz/Makefile.am: Add SUBDIRS=tests, shorten INCLUDES since now
24886 using AM_CONFIG_HEADER.
24887 * mpq/Makefile.am: Ditto.
24888 * mpf/Makefile.am: Ditto, and add DISTCLEANFILES.
24889 * mpn/Makefile.am: Shorten INCLUDES, amend some comments.
24890 * mpz/tests/Makefile.am: Use TESTS and $(top_builddir).
24891 * mpf/tests/Makefile.am: Ditto.
24892 * mpq/tests/Makefile.am: Ditto.
24893 * demos/Makefile.am: New file.
24895 * mpbsd/Makefile.am: New file, derived from old mpbsd/Makefile.in.
24896 * mpbsd/Makefile.in: Now generated from Makefile.am.
24897 * mpbsd/realloc.c: Removed, use mpz/realloc.c instead.
24898 * mpbsd/tests/Makefile.am: New file.
24899 * mpbsd/tests/Makefile.in: New file, generated from Makefile.am.
24900 * mpbsd/tests/allfuns.c: New file.
24902 * gmp.texi (Top): Use @ifnottex, to help makeinfo --html.
24903 (Installing MP): Describe --enable-mpbsd and demo programs.
24905 * tests/rand/statlib.c: mpz_cmp_abs => mpz_cmpabs.
24907 * tests/rand/Makefile.am (LDADD): Don't need -lm (now in libgmp.la).
24908 (EXTRA_PROGRAMS): Not noinst_PROGRAMS.
24909 (INCLUDES): Shorten to -I$(top_srcdir) now using AM_CONFIG_HEADER.
24911 2000-04-09 Torbjorn Granlund <tege@swox.com>
24913 * mpz/urandomm.c: Get type of count right.
24914 Simplify computation of nbits.
24916 2000-04-08 Torbjorn Granlund <tege@swox.com>
24918 * mpz/urandomb.c: Fix reallocation condition.
24919 Simplify size computation.
24921 2000-04-08 Linus Nordberg <linus@swox.se>
24923 * acinclude.m4 (GMP_CHECK_CC_64BIT): Add special handling for
24925 (GMP_CHECK_ASM_W32): Ditto.
24926 * aclocal.m4: Regenerate.
24928 * mpn/Makefile.am: Use $(CCAS) for assembling.
24929 (.asm.obj): Add rule.
24930 * mpn/Makefile.in: Regenerate.
24932 * gmp.texi (Miscellaneous Integer Functions): Fix typos.
24934 * configure.in: Never pass `-h' to grep.
24935 (mips-sgi-irix6.[2-9]*): Try to find 64-bit compiler.
24936 (hppa1.0*-*-*): New flag for cc.
24937 (hppa2.0*-*-*): Try to find 64-bit compiler. Chose path, set
24939 * configure: Regenerate.
24941 2000-04-08 Torbjorn Granlund <tege@swox.com>
24943 * mpz/bin_ui.c: Don't depend on ANSI C features.
24944 * mpz/bin_uiui.c: Likewise.
24946 * Makefile.am (MPZ_OBJECTS): mpz/cmp_abs* => mpz/cmpabs*.
24947 (MPQ_OBJECTS): Add mpq/set_d.lo.
24948 (MPZ_OBJECTS): Add mpz/fits*.lo.
24949 * Makefile.in: Regenerate.
24951 * mpz/cmpabs.c: New name for mpz/cmp_abs.c.
24952 * mpz/cmpabs_ui.c: New name for mpz/cmp_abs_ui.c.
24953 * mpz/Makefile.am: Corresponding changes.
24954 * mpz/Makefile.in: Regenerate.
24955 * gmp.h: mpz_cmp_abs* => mpz_cmpabs*.
24957 * mpz/addmul_ui.c (mpn_neg1): Don't depend on ANSI C features.
24959 * mpz/invert.c: Use TMP_MARK since we invoke MPZ_TMP_INIT.
24961 * gmp.h (mpq_set_d): Declare correctly.
24962 (mpz_root): Use _PROTO.
24963 (mpz_remove): Use _PROTO.
24964 (mpf_pow_iu): Use _PROTO.
24966 * mpn/asm-defs.m4 (MPN_PREFIX): Revert previous change.
24967 * gmp.h (__MPN): Revert previous change.
24969 * mpz/perfpow.c: De-ANSI-fy. Add copyright notice.
24971 * mpz/set_d.c: Misc cleanups.
24973 * mpq/set_d: New file.
24974 * gmp.h: Declare mpq_set_d.
24975 * mpq/Makefile.am: List set_d.c.
24976 * mpq/Makefile.in: Regenerate.
24978 2000-04-07 Torbjorn Granlund <tege@swox.com>
24980 * mpz/fits_sint_p.c: New file.
24981 * mpz/fits_slong_p.c: New file.
24982 * mpz/fits_sshort_p.c: New file.
24983 * mpz/fits_uint_p.c: New file.
24984 * mpz/fits_ulong_p.c: New file.
24985 * mpz/fits_ushort_p.c: New file.
24986 * gmp.h: Declare mpz_fits_*.
24987 * mpz/Makefile.am: List fits_* files.
24988 * mpz/Makefile.in: Regenerate.
24990 2000-04-06 Kevin Ryde <kevin@swox.se>
24992 * gmp.texi (Installing MP): Add known build problem SunOS 4.1.4 m4
24995 * mpn/x86/pentium/gmp-mparam.h: Tune thresholds.
24996 * mpn/x86/p6/gmp-mparam.h: Ditto.
24997 * mpn/x86/k6/gmp-mparam.h: Tune thresholds, add UMUL_TIME, UDIV_TIME.
24998 * mpn/x86/k7/gmp-mparam.h: Tune thresholds, amend UMUL_TIME.
25000 * mpn/generic/mul_n.c (mpn_kara_mul_n): Add an ASSERT.
25001 (mpn_kara_sqr_n): Add an ASSERT, use KARATSUBA_SQR_THRESHOLD.
25002 (mpn_toom3_sqr_n): Eliminate second evaluate3.
25004 * gmp-impl.h (mpn_com_n,MPN_LOGOPS_N_INLINE): Don't allow size==0.
25005 (tune_mul_threshold,tune_sqr_threshold): Conditionalize
25006 declarations on TUNE_PROGRAM_BUILD.
25008 * mpn/generic/sqr_basecase.c: Add an assert.
25010 2000-04-05 Torbjorn Granlund <tege@swox.com>
25012 * gmp.h, mpn/asm-defs.m4: List the same functions for __MPN, but
25013 leave some commented out.
25015 * gmp-impl.h (MPN_LOGOPS_N_INLINE): Optimize.
25016 (mpn_com_n): Optimize.
25018 * gmp.h (__MPN): Make it use __gmpn instead of __mpn for consistency.
25019 * mpn/asm-defs.m4 (MPN_PREFIX): Likewise.
25021 * gmp.h (GMP_ERROR_ALLOCATE): New errcode.
25023 * gmp-impl.h (MPN_MUL_N_RECURSE): Delete.
25024 (MPN_SQR_RECURSE): Delete.
25026 * gmp-impl.h (TARGET_REGISTER_STARVED): New define.
25028 * gmp-impl.h (mpn_kara_sqr_n): Remap with __MPN.
25029 (mpn_toom3_sqr_n): Likewise.
25030 (mpn_kara_mul_n): Likewise.
25031 (mpn_toom3_mul_n): Likewise.
25032 (mpn_reciprocal): Likewise.
25034 * gmp-impl.h (__gmpn_mul_n): Remove declaration.
25035 (__gmpn_sqr): Likewise.
25036 * gmp.h (mpn_sqr_n): Declare/remap.
25037 * mpn/generic/mul.c (mpn_sqr_n): New name for mpn_sqr.
25039 * gmp.h (mpn_udiv_w_sdiv): Move __MPN remap from here...
25040 * gmp-impl.h: ...to here.
25042 2000-04-05 Linus Nordberg <linus@swox.se>
25044 * gmp.texi (Top): Add `Random Number Functions' to menu.
25045 (Introduction to MP): Fix typo.
25046 (MP Basics): Create menu for all sections. Move `Random Number
25047 Functions' to its own chapter. Add nodes for all sections.
25048 (Function Classes): Mention random generation functions under
25050 (Miscellaneous Integer Functions): Update mpz_urandomb,
25052 (Low-level Functions): Remove mpn_rawrandom.
25053 (Random State Initialization): Update.
25055 * mpf/urandom.c (mpf_urandomb): Remove SIZE parameter. Normalize
25058 * gmp.h (mpf_urandomb): Remove SIZE parameter.
25060 * randraw.c (gmp_rand_getraw): Handle the case where (1) the LC
25061 scheme doesn't generate even limbs and (2) more than one LC
25062 invocation is necessary to produce the requested number of bits.
25064 2000-04-05 Torbjorn Granlund <tege@swox.com>
25066 * mpn/generic/mul_n.c (INVERSE_3): New name for THIRD, define for
25067 any BITS_PER_MP_LIMB.
25068 (MP_LIMB_T_MAX): New.
25069 (mpn_divexact3_n): Remove.
25070 (interpolate3): Use mpn_divexact_by3 instead of mpn_divexact3_n.
25072 2000-04-05 Kevin Ryde <kevin@swox.se>
25074 * gmp-impl.h (KARATSUBA_MUL_THRESHOLD<2): Remove cpp test.
25075 (tune_mul_threshold,tune_sqr_threshold): Add declarations, used in
25078 * mpn/x86/k7/sqr_basecase.asm: New file, only a copy of k6 for now.
25080 2000-04-04 Torbjorn Granlund <tege@swox.com>
25082 * gmp-impl.h (TOOM3_MUL_THRESHOLD): Provide default.
25083 (TOOM3_SQR_THRESHOLD): Provide default.
25085 * mpn/generic/mul_n.c: Rewrite (mostly by Robert Harley).
25086 * mpn/generic/mul.c: Rewrite (mostly by Robert Harley).
25088 * configure.in (sparcv9 64-bit OS): Set extra_functions.
25090 2000-04-04 Linus Nordberg <linus@swox.se>
25092 * mpn/generic/rawrandom.c: Remove file and replace with randraw.c
25094 (mpn_rawrandom): Rename to gmp_rand_getraw.
25096 * randraw.c: New file; essentially a copy of
25097 mpn/generic/rawrandom.c.
25098 (gmp_rand_getraw): New function (formerly known as mpn_rawrandom).
25100 * mpz/urandomb.c (mpz_urandomb): Change mpn_rawrandom -->
25102 * mpz/urandomm.c (mpz_urandomb): Ditto.
25103 * mpf/urandom.c (mpf_urandomb): Ditto.
25105 * gmp.h (gmp_rand_getraw): Add function prototype.
25106 (mpn_rawrandom): Remove function prototype.
25108 * Makefile.am (libgmp_la_SOURCES): Add randraw.c.
25109 * Makefile.in: Regenerate.
25111 * configure.in (gmp_mpn_functions): Remove rawrandom.
25112 * configure: Regenerate.
25114 2000-04-04 Linus Nordberg <linus@swox.se>
25116 * gmp.h (GMP_ERROR enum): Remove comma after last enumeration
25117 since the AIX compiler (xlc) doesn't like that.
25119 * randlc.c (gmp_rand_init_lc): Allocate enough space for seed to
25120 hold any upcoming seed.
25121 * randlc2x.c (gmp_rand_init_lc_2exp): Likewise.
25123 * mpn/generic/rawrandom.c: Remove debugging code.
25124 (mpn_lc): Don't reallocate seed.
25126 * mpz/urandomm.c (mpz_urandomm): Implement function.
25128 * mpz/urandomb.c (mpz_urandomb): Fix typo in function definition.
25130 2000-04-04 Kevin Ryde <kevin@swox.se>
25132 * make.bat: Removed (no longer works, no longer supported).
25133 * mpn/msdos/asm-syntax.h: Removed (was used only by make.bat).
25135 2000-04-03 Torbjorn Granlund <tege@swox.com>
25137 * mpn/generic/brandom.c: New file, replacing random2.
25139 2000-04-02 Torbjorn Granlund <tege@swox.com>
25141 * mpn/sparc32/v9/submul_1.asm: Change some carry-form instructions
25142 into their plain counterparts.
25144 * mpn/sparc64/copyi.asm: Avoid executing ALIGN.
25146 * mpn/sparc64/mul_1.asm: Handle overlap of rp/sp.
25147 * mpn/sparc64/addmul_1.asm: Likewise.
25148 * mpn/sparc64/submul_1.asm: Likewise.
25150 2000-04-01 Linus Nordberg <linus@swox.se>
25152 * gmp.h: Fix function prototypes for randomization functions.
25153 (__gmp_rand_lc_scheme_struct): Replace `m' with `m2exp'. Remove
25155 (__gmp_rand_data_lc): Add `m2exp' as another way of representing
25157 (__gmp_rand_state_struct): Remove unused `size'.
25159 * rand.c (__gmp_rand_scheme): Use better multipliers. Remove test
25160 schemes. Replace `m' with `m2exp'.
25161 (gmp_rand_init): Change parameters and return type. Use `m2exp'
25162 instead of `m'. Set `gmp_errno' on error. Disable BBS algorithm.
25164 * randlc.c (gmp_rand_init_lc): Don't use malloc(). Change
25167 * randclr.c (gmp_rand_clear): Don't use free(). Disable BBS
25168 algorithm. Set `gmp_errno' on error.
25170 * randlc2x.c (gmp_rand_init_lc_2exp): New function.
25171 * randsd.c (gmp_rand_seed): New function.
25172 * randsdui.c (gmp_rand_seed_ui): New function.
25173 * randlcui.c: Remove unused file.
25175 * mpn/generic/rawrandom.c (mpn_rawrandom): Rewrite.
25176 (mpn_lc): New static function.
25178 * mpz/urandomb.c (mpz_urandomb): Use ABSIZ() instead of SIZ() for
25179 determining size of ROP.
25181 * mpf/urandom.c (mpf_urandomb): Add third parameter, nbits. (Not
25183 Change parameter order to mpn_rawrandom().
25185 * Makefile.am (libgmp_la_SOURCES): Add errno.c, randlc2x.c,
25186 randsd.c, randsdui.c. Remove randui.c.
25187 (MPZ_OBJECTS): Rename urandom.lo --> urandomb.lo. Add urandomm.lo.
25188 * Makefile.in: Regenerate.
25190 * mpz/Makefile.am (libmpz_la_SOURCES): Change urandom.c -->
25191 urandomb.c. Add urandomm.c.
25192 * mpz/Makefile.in: Regenerate.
25194 * tests/rand/Makefile.am (noinst_PROGRAMS): Change findcl --> findlc.
25196 * tests/rand/Makefile.in: Regenerate.
25198 * tests/rand/gen.c (main): Add mpz_urandomm. Add command line options
25199 `-C', `-m', extend `-a'. Use *mp*_*rand*() with new parameters. Call
25202 2000-04-01 Kevin Ryde <kevin@swox.se>
25204 * acinclude.m4 (GMP_CHECK_ASM_DATA): Plain .data for hpux.
25205 * configure.in (CCAS): No CFLAGS, they're added when it's used.
25206 (CONFIG_SRCDIR): New define for config.m4.
25207 * mpn/sparc64/addmul_1.asm: Use it for an include().
25208 * mpn/sparc64/submul_1.asm: Ditto.
25209 * mpn/sparc64/mul_1.asm: Ditto.
25211 2000-03-31 Linus Nordberg <linus@swox.se>
25213 * mpz/urandom.c: Rename to...
25214 * mpz/urandomb.c: ...this.
25216 * mpz/urandomb.c (mpz_urandomb): Change operand order in call to
25217 mpn_rawrandom(). Use ABSIZ() instead of SIZ() when checking size
25220 * mpz/urandomm.c: New file.
25222 2000-03-31 Kevin Ryde <kevin@swox.se>
25224 * acinclude.m4 (GMP_CHECK_ASM_MMX): Give a warning when mmx code
25227 2000-03-30 Torbjorn Granlund <tege@swox.com>
25229 * mpn/sparc64/mul_1h.asm: New file.
25230 * mpn/sparc64/addmul_1h.asm: New file.
25231 * mpn/sparc64/submul_1h.asm: New file.
25232 * mpn/sparc64/mul_1.asm: Rewrite.
25233 * mpn/sparc64/addmul_1.asm: Rewrite.
25234 * mpn/sparc64/submul_1.asm: Rewrite.
25236 2000-03-28 Torbjorn Granlund <tege@swox.com>
25238 * mpn/sparc32/v9/mul_1.asm: Fix typo in branch prediction.
25239 * mpn/sparc32/v9/addmul_1.asm: Likewise.
25240 * mpn/sparc32/v9/submul_1.asm: Likewise.
25242 2000-03-25 Kevin Ryde <kevin@swox.se>
25244 * mpn/lisp/gmpasm-mode.el: Fix some comment detection, use custom,
25245 fontify more keywords, turn into a standalone mode.
25247 * stamp-vti: New file, generated together with version.texi.
25249 * acinclude.m4 (GMP_VERSION,GMP_HEADER_GETVAL): New macros.
25250 * configure.in (AM_INIT_AUTOMAKE): Use GMP_VERSION.
25252 2000-03-24 Kevin Ryde <kevin@swox.se>
25254 * INSTALL: Updates for new configure system.
25256 * configure.in: Add gmp_optcflags_gcc for the x86s, setting -mcpu
25259 2000-03-23 Torbjorn Granlund <tege@swox.com>
25261 * demos/pexpr.c (mpz_eval_expr): Properly initialize rhs/lhs
25264 2000-03-23 Kevin Ryde <kevin@swox.se>
25266 * config.guess (i?86:*:*:*): Use uname -m if detection program fails.
25268 * mpn/x86/README: Remove remarks on the now implemented MMX shifts.
25269 * mpn/x86/k6/README: Add speed of mpn_divexact_by3, update mpn_mul_1.
25271 * gmp.texi (Installing MP): Corrections to target CPUs.
25273 * version.c: Use VERSION from config.h, add copyright comment,
25274 restore "const" somehow lost.
25276 * configure.in (a29k*-*-*): Fix directory name.
25278 2000-03-22 Torbjorn Granlund <tege@swox.com>
25280 * demos/pexpr.c (op_t): Add ROOT.
25282 (mpz_eval_expr): Add ROOT.
25284 * mpz/root.c: Handle roots of negative numbers.
25285 Fix other border cases.
25286 Fix rare memory leakage.
25288 * errno.c: New file.
25290 2000-03-21 Torbjorn Granlund <tege@swox.com>
25292 * gmp.h (error number enum): New anonymous enum.
25295 * gmp.h (__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR): Bump for GMP 3.0.
25297 2000-03-20 Torbjorn Granlund <tege@swox.com>
25299 * mpn/alpha/unicos.m4 (FLOAT64): New define.
25300 * mpn/alpha/default.m4 (FLOAT64): New define.
25301 * mpn/alpha/invert_limb.asm (C36): Use FLOAT64.
25303 2000-03-21 Kevin Ryde <kevin@swox.se>
25305 * mpn/x86/k6/diveby3.asm: Tiny speedup.
25307 * acinclude.m4 (GMP_CHECK_ASM_SHLDL_CL): New macro.
25308 * configure.in: Use it, set WANT_SHLDL_CL in config.m4.
25309 * mpn/x86/x86-defs.m4 (shldl,shrdl,shldw,shrdw): New macros, using
25311 * mpn/x86/k6/mmx/lshift.asm: Use shldl macro.
25312 * mpn/x86/k7/mmx/lshift.asm: Ditto.
25313 * mpn/x86/pentium/mmx/lshift.asm: Ditto.
25314 * mpn/x86/k6/mmx/rshift.asm: Use shrdl macro.
25315 * mpn/x86/k7/mmx/rshift.asm: Ditto.
25316 * mpn/x86/pentium/mmx/rshift.asm: Ditto.
25317 * mpn/x86/README.family: Add a note about this.
25319 2000-03-20 Linus Nordberg <linus@swox.se>
25321 * mpn/generic/rawrandom.c (mpn_rawrandom): Handle seed value of 0
25324 * configure.in: Fix detection of alpha flavour.
25325 Set compiler options for `sparcv8'.
25326 * configure: Regenerate.
25328 * rand.c (__gmp_rand_scheme): Clean up some. Use slightly better
25331 * configure.in (AC_OUTPUT): Add tests/Makefile and
25332 tests/rand/Makefile.
25334 * acinclude.m4 (AC_CANONICAL_BUILD): Define to
25335 `_AC_CANONICAL_BUILD' to deal with incompabilities between
25336 Autoconf and Libtool.
25337 (AC_CHECK_TOOL_PREFIX): Likewise.
25339 * Makefile.am (EXTRA_DIST): Add directory `tests'.
25341 * mkinstalldirs: Update (Automake 2000-03-17).
25342 * ltconfig: Update (Libtool 2000-03-17).
25343 * ltmain.sh: Ditto.
25345 * configure: Regenerate with new autoconf/-make/libtool suite.
25346 * aclocal.m4: Ditto.
25347 * config.in: Ditto.
25348 * all Makefile.in's: Ditto.
25350 2000-03-20 Torbjorn Granlund <tege@swox.com>
25352 * demos/pexpr.c (main): Don't allow `-N' for base, require `-bN'.
25354 * mpn/alpha/unicos.m4 (cvttqc): New define.
25355 * mpn/alpha/invert_limb.asm: Use new define for cvttqc.
25357 2000-03-19 Kevin Ryde <kevin@swox.se>
25359 * mpn/x86/k6/sqr_basecase.asm: Tiny amendments for 3x3 case.
25361 * gmp.texi: Use @include version.texi.
25362 Use @email and @uref.
25363 (Installing MP): Rewrite for new configure.
25364 (Low-level Functions): Add mpn_divexact_by3.
25366 * configure.in (--enable-alloca): New option.
25367 * acconfig.h (USE_STACK_ALLOC): For --disable-alloca.
25369 2000-03-18 Kent Boortz <kent@swox.com>
25371 * macos: New directory with macos port files.
25373 2000-03-17 Torbjorn Granlund <tege@swox.com>
25375 * gmp-impl.h (union ieee_double_extract): Check _CRAYMPP.
25377 * mpn/asm-defs.m4 (invert_normalized_limb): Define.
25379 * mpn/alpha: Translate `.s' files to `.asm'.
25381 * configure: Regenerate.
25383 * mpn/alpha/invert_limb.asm: Replace dash in file name with underscore.
25384 * configure.in: Corresponding change.
25386 * configure.in: Assign special "path" for alphaev6.
25388 * mpn/alpha/unicos.m4: New file.
25389 * configure.in (alpha*-cray-unicos*): [This part of the change
25390 commited 2000-03-13 by linus]
25391 * mpn/alpha/default.m4: New file.
25392 * configure.in (alpha*-*-*): Use it.
25394 2000-03-17 Kevin Ryde <kevin@swox.se>
25396 * mpn/x86/pentium/rshift.S: Use plain rcrl (not rcrl $1) for
25397 shift-by-1 case, significant speedup.
25398 * mpn/x86/pentium/README: Add shift-by-1 speed.
25400 2000-03-16 Torbjorn Granlund <tege@swox.com>
25402 * config.guess: Handle Cray T3D/E.
25404 2000-03-15 Kevin Ryde <kevin@swox.se>
25406 * mpn/generic/diveby3.c: New file.
25407 * mpn/x86/diveby3.asm: New file.
25408 * mpn/x86/k6/diveby3.asm: New file.
25409 * gmp.h (mpn_divexact_by3): Prototype and define.
25410 * mpn/asm-defs.m4: define_mpn(divexact_by3).
25411 * configure.in (gmp_mpn_functions): Add diveby3.
25413 * mpn/x86/pentium/sqr_basecase.asm: A few better addressing modes.
25415 * configure.in: Add AC_C_STRINGIZE and AC_CHECK_TYPES((void)).
25416 * gmp-impl.h (ASSERT): Use them.
25418 * mpn/x86/k7/mmx/lshift.asm: New file.
25419 * mpn/x86/k7/mmx/rshift.asm: Rewrite simple loop and return value
25420 handling, add some pictures.
25422 2000-03-14 Torbjorn Granlund <tege@swox.com>
25424 * mpn/sparc32/v8/mul_1.asm: Make PIC actually work.
25425 * mpn/sparc32/v8/addmul_1.asm: Likewise.
25427 * mpn/sparc32/v8/mul_1.asm: Use m4 ifdef, not cpp #if.
25428 * mpn/sparc32/v8/addmul_1.asm: Likewise.
25430 * mpn/asm-defs.m4 (C): New define for comments.
25431 * mpn/sparc32: Start comments with `C'.
25433 * config.guess: Remove `SunOS 6' handling.
25434 Recognize sun4m and sun4d architectures under old SunOS.
25436 2000-03-14 Linus Nordberg <linus@swox.se>
25438 * configure.in (gmp_srclinks): Set to list of links created by
25440 * configure: Regenerate.
25442 * Makefile.am (libgmp_la_LDFLAGS): Set version info.
25443 (DISTCLEANFILES): Include @gmp_srclinks@.
25444 * Makefile.in: Regenerate.
25446 2000-03-13 Linus Nordberg <linus@swox.se>
25448 * configure.in: Remove some changequote's by quoting the strings
25450 Add support for `alpha*-cray-unicos*'.
25451 AC_DEFINE `_LONG_LONG_LIMB' instead of passing it in CFLAGS.
25452 Conditionalize the assembler syntax checks.
25453 * configure: Regenerate.
25454 * config.in: Regenerate.
25456 * acinclude.m4 (GMP_PROG_CCAS): Remove macro.
25457 * aclocal.m4: Regenerate.
25459 2000-03-13 Kevin Ryde <kevin@swox.se>
25461 * mpn/x86/p6/README: New file.
25463 * mpn/x86/k6/mul_1.asm: Rewrite, smaller and slightly faster.
25465 * mpn/lisp/gmpasm-mode.el: Rewrite assembler comment detection and
25468 * configure.in: Separate mmx directories for each x86 flavour.
25469 * configure: Regenerate.
25471 2000-03-12 Kevin Ryde <kevin@swox.se>
25473 * mpn/x86/x86-defs.m4 (ALIGN): Supplement definition from
25474 config.m4 so as to pad with nops not zeros on old gas.
25476 * mpn/x86/k7/mmx/copyd.asm: Use plain emms (femms is just an alias
25478 * mpn/x86/k7/mmx/copyi.asm: Ditto.
25479 * mpn/x86/k7/mmx/rshift.asm: Ditto.
25480 * mpn/x86/x86-defs.m4: Amend comments.
25482 * mpn/x86/mod_1.asm: Add comments on speeds.
25484 * mpn/x86/pentium/mmx/lshift.asm: New file.
25485 * mpn/x86/pentium/mmx/rshift.asm: New file.
25486 * mpn/x86/pentium/README: Add speeds of various routines.
25488 2000-03-10 Linus Nordberg <linus@swox.se>
25490 * configure.in: Reorganize.
25491 Use AC_CHECK_TOOL to find `ar'.
25492 Add post-includes `regmap.m4' and `aix.m4' for AIX targets.
25493 asm-syntax.h is not needed for PPC or sparc anymore.
25494 (powerpc64-*-aix*): Compiler is always 64-bit. Use `-q64
25495 -qtune=pwr3' to xlc and `-maix64 -mpowerpc64' to gcc. Pass `-X
25496 64' to `ar' and `nm'.
25497 (pentiummmx): Use GMP_CHECK_ASM_MMX and avoid MMX assembly path if
25498 assembler is not MMX capable.
25499 (pentium[23]): Likewise.
25500 (athlon): Likewise.
25502 * configure: Regenerate.
25504 * acinclude.m4 (GMP_PROG_CC_WORKS): New macro.
25505 (GMP_PROG_CC_FIND): Use GMP_PROG_CC_WORKS instead of
25506 AC_TRY_COMPILER. Make sure that the *first* working 32-bit
25507 compiler is used if no 64-bit compiler is found.
25508 (GMP_CHECK_ASM_MMX): New macro.
25509 * aclocal.m4: Regenerate.
25511 * Makefile.in: Regenerate. (CC_TEST removed.)
25512 * mpf/Makefile.in: Likewise.
25513 * mpn/Makefile.in: Likewise.
25514 * mpq/Makefile.in: Likewise.
25515 * mpz/Makefile.in: Likewise.
25516 * mpf/tests/Makefile.in: Likewise.
25517 * mpq/tests/Makefile.in: Likewise.
25518 * mpz/tests/Makefile.in: Likewise.
25520 * acconfig.h (_LONG_LONG_LIMB): Add.
25522 * gmp-impl.h: Include config.h only if HAVE_CONFIG_H is defined.
25524 2000-03-09 Kevin Ryde <kevin@swox.se>
25526 * mpn/x86/pentium/mul_basecase.S: Small speedup by avoiding an AGI.
25528 * mpn/x86/k7/mmx/copyd.asm: Tiny speedup by avoiding popl.
25529 * mpn/x86/k7/mmx/copyi.asm: Ditto.
25530 * mpn/x86/k7/mul_basecase.asm: Ditto.
25532 2000-03-07 Torbjorn Granlund <tege@swox.com>
25534 * config.guess: Better recognize POWER/PowerPC processor type.
25536 2000-03-07 Kevin Ryde <kevin@swox.se>
25538 * mpn/generic/addsub_n.c: Use HAVE_NATIVE_* now in config.h.
25540 * mpn/asm-defs.m4: Add comments about SysV m4.
25541 (m4_log2): Don't use <<.
25542 (m4_lshift,m4_rshift): New macros.
25544 2000-03-06 Torbjorn Granlund <tege@swox.com>
25546 * mpn/powerpc32/regmap.m4: Map cr0 => `0', etc.
25548 2000-03-06 Kevin Ryde <kevin@swox.se>
25550 * mpn/tests/ref.c (refmpn_divexact_by3): New function.
25551 * mpn/tests/ref.h: Prototype.
25553 * acconfig.h (WANT_ASSERT): New define.
25554 * configure.in (--enable-assert): Turn on WANT_ASSERT.
25555 * assert.c: New file.
25556 * Makefile.am: Add to build.
25557 * gmp-impl.h (ASSERT): New macro.
25558 (ASSERT_NOCARRY) Renamed from assert_nocarry.
25559 (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS.
25560 * mpn/tests/ref.c: Use ASSERT.
25561 * mpf/get_str.c: Use ASSERT_ALWAYS.
25562 * mpf/set_str.c: Remove old assert macro.
25564 * mpn/x86/x86-defs.m4 (cmovnz_ebx_ecx): New macro.
25565 * mpn/x86/p6/aorsmul_1.asm: Use cmov.
25567 * mpn/x86/lshift.S: Use %dl with testb, not %edx. No object code
25568 change, testb was still getting generated.
25569 * mpn/x86/rshift.S: Ditto.
25571 2000-03-03 Torbjorn Granlund <tege@swox.com>
25573 * longlong.h: Add IA-64 support.
25575 * mpn/powerpc32: Misc cleanups.
25576 * mpn/powerpc32/aix.m4: New file (mainly by Linus).
25577 * mpn/powerpc64/aix.m4: New file (mainly by Linus).
25578 * mpn/powerpc64: Translate `.S' files to `.asm'.
25580 * configure.in: Fix tyops.
25581 * configure: Regenerate.
25583 2000-03-02 Torbjorn Granlund <tege@swox.com>
25585 * mpn/powerpc32/regmap.m4: New file.
25586 * mpn/powerpc32: Translate `.S' files to `.asm'.
25587 * configure.in: Use mpn/powerpc32/regmap.m4 for powerpc targets
25588 except some weird ones.
25590 2000-03-03 Kevin Ryde <kevin@swox.se>
25592 * mpn/lisp/gmpasm-mode.el: Suppress postscript comment prefixes in
25595 * mpn/x86/pentium/sqr_basecase.asm: New file.
25596 * mpn/x86/pentium/gmp-mparam.h (KARATSUBA_SQR_THRESHOLD): Update.
25598 * configure.in: Add --enable-assert, enable k6 logops functions.
25600 * mpn/x86/k6/mmx/copyi.asm: Use m4 for divide, not as.
25601 * mpn/x86/k6/mmx/copyd.asm: Ditto.
25602 * mpn/x86/README.family: Add a note on this.
25604 2000-03-02 Kevin Ryde <kevin@swox.se>
25606 * mpn/x86/k6/aors_n.asm: Don't use stosl.
25607 * mpn/x86/copyi.asm: Use cld to clear direction flag.
25608 * mpn/x86/divrem_1.asm: Ditto.
25609 * mpn/x86/README.family: Add a note on this.
25611 * mpn/x86/k6/mmx/copyi.asm: Rewrite.
25612 * mpn/x86/k6/mmx/copyd.asm: New file.
25613 * mpn/x86/k6/README: Update, and small amendments.
25615 * mpn/x86/x86-defs.m4 (Zdisp): New macro.
25616 * mpn/asm-defs.m4 (m4_stringequal_p): New macro.
25618 * mpn/x86/p6/aorsmul_1.asm: Use Zdisp to force zero displacements.
25619 * mpn/x86/k6/aorsmul_1.asm: Ditto.
25620 * mpn/x86/k6/mul_1.asm: Ditto.
25621 * mpn/x86/k6/mul_basecase.asm: Ditto.
25622 * mpn/x86/k7/aors_n.asm: Ditto.
25623 * mpn/x86/k7/aorsmul_1.asm: Ditto.
25624 * mpn/x86/k7/mul_1.asm: Ditto.
25625 * mpn/x86/k7/mul_basecase.asm: Ditto.
25626 * mpn/x86/README.family: Add a note on this.
25628 2000-02-27 Kevin Ryde <kevin@swox.se>
25630 * mpn/generic/divrem.c (mpn_divrem_classic): Patch to avoid gcc
25631 2.7.2.3 i386 register handling bug.
25633 * mpn/x86/k6/aors_n.asm: Rewrite.
25634 * mpn/x86/k6/mmx/lshift.asm: Rewrite.
25635 * mpn/x86/k6/mmx/rshift.asm: Rewrite.
25636 * mpn/x86/k6/README: Update.
25638 * mpn/x86/k7/mmx/copyd.asm: Support size==0.
25639 * mpn/x86/k7/mmx/copyi.asm: Ditto.
25640 * mpn/x86/k6/mmx/copyi.asm: Ditto.
25641 * gmp-impl.h: Comment size==0 allowed in MPN_COPY_INCR and
25643 * configure.in: Enable x86 copyi, copyd; add k6 com_n.
25645 2000-02-25 Torbjorn Granlund <tege@swox.com>
25647 * demos/pexpr.c (power): Move factorial handing code from `factor'
25650 * demos/factorize.c (factor_using_pollard_rho): Move resetting of `c'
25651 to before checking for a non-zero gcd.
25653 2000-02-25 Kevin Ryde <kevin@swox.se>
25655 * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro by Linus.
25656 * mpn/x86/k6/aors_n.asm: Use MULFUNC_PROLOGUE.
25657 * mpn/x86/k6/aorsmul_1.asm: Ditto.
25658 * mpn/x86/k7/aors_n.asm: Ditto.
25659 * mpn/x86/k7/aorsmul_1.asm: Ditto.
25660 * mpn/x86/p6/aorsmul_1.asm: Ditto.
25662 * mpn/tests/ref.c (refmpn_copyi,refmpn_copyd): Allow size==0.
25664 * gmp-impl.h: Move mpn_and_n, mpn_andn_n, mpn_com_n, mpn_ior_n,
25665 mpn_iorn_n, mpn_nand_n, mpn_nior_n, mpn_xor_n and mpn_xorn_n here
25666 from gmp.h. Use HAVE_NATIVE_mpn_* to make these functions or
25669 * gmp-impl.h: Move mpn_copyd, mpn_copyi here from gmp.h.
25670 * gmp-impl.h (MPN_COPY_INCR): Use mpn_copyi if available.
25671 * gmp-impl.h (MPN_COPY_DECR): Use mpn_copyd if available.
25673 * mpn/x86/k6/mmx/com_n.asm: Moved into mmx subdirectory.
25674 * mpn/x86/k6/mmx/copyi.asm: Ditto.
25675 * mpn/x86/k6/mmx/lshift.asm: Ditto.
25676 * mpn/x86/k6/mmx/rshift.asm: Ditto.
25677 * mpn/x86/k7/mmx/rshift.asm: Ditto.
25678 * mpn/x86/k6/mmx/logops_n.asm: New file.
25679 * configure.in (k6*-*-*): Add logops_n.asm.
25680 * mpn/x86/k6/README: Update.
25682 * mpn/x86/k7/mmx/copyi.asm: New file.
25683 * mpn/x86/k7/mmx/copyd.asm: New file.
25684 * mpn/x86/k7/README: Update.
25686 2000-02-24 Kevin Ryde <kevin@swox.se>
25688 * mpn/x86/x86-defs.m4 (femms): Generate emms if 3dnow not available.
25689 * mpn/x86/x86-defs.m4 (FRAME_popl): New macro.
25691 * Makefile.am: Add info_TEXINFOS = gmp.texi
25693 * mpn/x86/divrem_1.asm: Moved from mpn/x86/k6, allow size==0,
25694 conditionalize loop versus decl/jnz.
25695 * mpn/x86/mod_1.asm: Ditto.
25696 * mpn/x86/divmod_1.asm: Removed.
25697 * gmp.texi (mpn_divrem_1,mpn_mod_1): Add that size==0 is allowed.
25698 * mpn/tests/ref.c (refmpn_divrem_1c,etc): Allow size==0.
25700 * mpn/x86/k6/aors_n.asm: Avoid gas 1.92.3 leal displacement
25701 expression problem.
25702 * mpn/x86/k6/aorsmul_1.asm: Ditto.
25703 * mpn/x86/k6/mul_1.asm: Ditto.
25704 * mpn/x86/k6/mul_basecase.asm: Ditto
25705 * mpn/x86/k7/aors_n.asm: Ditto.
25706 * mpn/x86/k7/aorsmul_1.asm: Ditto.
25707 * mpn/x86/k7/mul_1.asm: Ditto.
25708 * mpn/x86/k7/mul_basecase.asm: Ditto.
25709 * mpn/x86/k7/rshift.asm: Ditto.
25710 * mpn/x86/p6/aorsmul_1.asm: Ditto.
25711 * mpn/x86/README.family: Describe problem.
25713 2000-02-24 Linus Nordberg <linus@swox.se>
25715 * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Add dummy symbol to
25716 testcase to avoid nm failure. Try nm before piping to grep.
25718 * acconfig.h: Undef HAVE_NATIVE_func for every mpn function found
25721 * configure.in: Invoke AC_CONFIG_HEADERS.
25722 Don't invoke AM_CONFIG_HEADER; it makes autoconf confused.
25723 Dig out entry points declared in assembly code and AC_DEFINE proper
25726 * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro.
25728 * mpn/x86/p6/aorsmul_1.asm: Use MULFUNC_PROLOGUE.
25729 * mpn/x86/k6/aors_n.asm: Likewise.
25731 * Makefile.am (EXTRA_DIST): Add config.in; needed when we don't
25732 use AM_CONFIG_HEADER in configure.in.
25734 * mpn/Makefile.am (INCLUDES): Add `-I..' for config.h and
25736 * mpf/Makefile.am: Likewise.
25737 * mpq/Makefile.am: Likewise.
25738 * mpz/Makefile.am: Likewise.
25740 * mpf/tests/Makefile.am (INCLUDES): Add `-I../..' for config.h and
25742 * mpq/tests/Makefile.am: Likewise.
25743 * mpz/tests/Makefile.am: Likewise.
25745 * configure: Regenerate.
25746 * aclocal.m4: Regenerate.
25747 * config.in: Regenerate.
25748 * Makefile.in: Regenerate.
25749 * mpf/Makefile.in: Regenerate.
25750 * mpn/Makefile.in: Regenerate.
25751 * mpq/Makefile.in: Regenerate.
25752 * mpz/Makefile.in: Regenerate.
25753 * mpf/tests/Makefile.in: Regenerate.
25754 * mpq/tests/Makefile.in: Regenerate.
25755 * mpz/tests/Makefile.in: Regenerate.
25757 2000-02-23 Kevin Ryde <kevin@swox.se>
25759 * mpn/x86/addmul_1.S: Amend comments, this code no longer used by
25761 * mpn/x86/submul_1.S: Ditto.
25763 * mpn/x86/k6/com_n.asm: Rewrite, smaller but same speed.
25765 * mpn/x86/addmul_1.S: Add PROLOGUE and EPILOGUE to get .type and
25766 .size for ELF. Rename #define size to n to avoid .size.
25767 * mpn/x86/lshift.S: Ditto.
25768 * mpn/x86/mul_1.S: Ditto.
25769 * mpn/x86/mul_basecase.S: Ditto.
25770 * mpn/x86/rshift.S: Ditto.
25771 * mpn/x86/submul_1.S: Ditto.
25772 * mpn/x86/udiv.S: Ditto.
25773 * mpn/x86/umul.S: Ditto.
25774 * mpn/x86/pentium/add_n.S: Ditto.
25775 * mpn/x86/pentium/addmul_1.S: Ditto.
25776 * mpn/x86/pentium/lshift.S: Ditto.
25777 * mpn/x86/pentium/mul_1.S: Ditto.
25778 * mpn/x86/pentium/mul_basecase.S: Ditto.
25779 * mpn/x86/pentium/rshift.S: Ditto.
25780 * mpn/x86/pentium/sub_n.S: Ditto.
25781 * mpn/x86/pentium/submul_1.S: Ditto.
25783 2000-02-22 Linus Nordberg <linus@swox.se>
25785 * acinclude.m4 (GMP_INIT): Use temporary file cnfm4p.tmp for
25787 (GMP_FINISH): Ditto.
25788 (GMP_DEFINE): Add third optional argument specifying location in
25790 (GMP_DEFINE_RAW): New macro.
25791 * aclocal.m4: Regenerate.
25793 * configure.in: Add `HAVE_TARGET_CPU_$target_cpu' using
25795 * configure: Regenerate.
25797 * mpz/tests/Makefile.am: New test t-root.
25798 * mpz/tests/Makefile.in: Regenerate.
25800 2000-02-22 Torbjorn Granlund <tege@swox.com>
25802 * mpz/root.c: Complete rewrite; still primitive, but at least correct.
25803 * mpz/tests/t-root.c: New test.
25805 2000-02-22 Kevin Ryde <kevin@swox.se>
25807 * mpn/x86/k7/mul_basecase.asm: New file.
25808 * mpn/x86/k7/README: Add mpn_mul_basecase speed.
25809 * mpn/x86/k7/gmp-mparam.h: New file.
25811 * mpn/x86/x86-defs.m4 (loop_or_decljnz,cmov_bytes): New macros.
25812 * mpn/asm-defs.m4 (m4_ifdef_anyof_p): New macro.
25814 * mpn/x86/k6/aorsmul_1.asm: New file.
25815 * mpn/x86/k6/addmul_1.S: Removed (was a copy of pentium version).
25816 * mpn/x86/k6/submul_1.S: Removed (was a copy of pentium version).
25818 * mpn/x86/p6/aorsmul_1.asm: Use OPERATION_addmul_1 and
25819 OPERATION_submul_1.
25820 * mpn/x86/k6/aors_n.asm: Use OPERATION_add_n and OPERATION_sub_n.
25821 * configure.in: Declare multi-function files for k6 and p6.
25823 * configure.in: Add HAVE_TARGET_CPU_$target_cpu for config.m4.
25824 * mpn/asm-defs.m4 (define_not_for_expansion): New macro.
25826 * mpn/generic/divrem_1n.c (__gmpn_divrem_1n): New file, split from
25827 mpn/generic/divrem_1.c.
25828 * mpn/generic/divrem_1.c: Ditto.
25829 * configure.in (gmp_mpn_functions): Ditto.
25831 2000-02-21 Torbjorn Granlund <tege@swox.com>
25833 * gmp.h: Undo 1996-10-06 NeXT change, it was clearly improperly
25836 2000-02-21 Linus Nordberg <linus@swox.se>
25838 * configure.in: Link <src>/mpn/asm-defs.m4 to <build>mpn/asm.m4.
25839 * configure: Regenerate.
25841 2000-02-21 Linus Nordberg <linus@swox.se>
25843 * mpn/x86/k7/aorsmul_1.asm: Change OPERATION_ADDMUL -->
25844 OPERATION_addmul_1. Change OPERATION_SUBMUL -->
25845 OPERATION_submul_1.
25847 * mpn/x86/k7/aors_n.asm: Change OPERATION_ADD --> OPERATION_add_n.
25848 Change OPERATION_SUB --> OPERATION_sub_n.
25850 * mpn/Makefile.am: Pass -DOPERATION_$* to preprocessors.
25851 * mpn/Makefile.in: Regenerate.
25853 * configure.in: Symlink mpn/asm-defs.m4 to build-dir/mpn. Link
25854 multi-function files to mpn/<function>.asm and remove function
25855 name from `gmp_mpn_functions'.
25856 * configure: Regenerate.
25858 * acinclude.m4 (GMP_FINISH): Tell user what we're doing.
25859 * aclocal.m4: Regenerate.
25861 2000-02-21 Kevin Ryde <kevin@swox.se>
25863 * gmp-impl.h: Rename __gmpn_mul_basecase to mpn_mul_basecase and
25864 __gmpn_sqr_basecase to mpn_sqr_basecase, remove __gmpn prototypes.
25865 * mpn/x86/mul_basecase.S: Ditto.
25866 * mpn/x86/pentium/mul_basecase.S: Ditto.
25868 * configure.in (gmp_m4postinc): Use x86-defs.m4 on athlon-*-* too.
25870 2000-02-20 Kevin Ryde <kevin@swox.se>
25872 * acinclude.m4 (GSYM_PREFIX): Drop $1, change by Linus.
25873 * mpn/asm-defs.m4 (PROLOGUE,EPILOGUE): Use GSYM_PREFIX as a
25874 string, change by Linus.
25875 * mpn/x86/x86-defs.m4: Use GSYM_PREFIX as a string.
25877 * mpn/x86/k6/gmp-mparam.h: New file.
25878 * mpn/asm-defs.m4 (m4_warning): New macro.
25880 * mpn/x86/README: Amendments per new code and directories.
25881 * mpn/x86/README.family: New file.
25882 * mpn/x86/k6/README: New file.
25883 * mpn/x86/k7/README: New file.
25885 * mpn/generic/mul_n.c: Rename __gmpn_mul_basecase to
25886 mpn_mul_basecase and __gmpn_sqr_basecase to mpn_sqr_basecase.
25887 * mpn/generic/mul_basecase.c: Ditto.
25888 * mpn/generic/sqr_basecase.c: Ditto.
25889 * mpn/generic/mul.c: Ditto.
25891 2000-02-19 Linus Nordberg <linus@swox.se>
25893 * configure.in: Don't try to symlink more than one multi-func
25895 * configure: Regenerate.
25897 2000-02-18 Linus Nordberg <linus@swox.se>
25899 * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): GMP_DEFINE
25900 `GSYM_PREFIX'. Run ACTIONs even when value is found in cache.
25901 (GMP_CHECK_ASM_ALIGN_LOG): GMP_DEFINE `ALIGN'. Run ACTIONs even
25902 when value is found in cache.
25903 * aclocal.m4: Regenerate.
25905 * configure.in: Don't define GSYM_PREFIX or ALIGN.
25906 Add mechanism for multi-function files.
25907 * configure: Regenerate.
25909 2000-02-18 Kevin Ryde <kevin@swox.se>
25911 * configure.in (gmp_m4postinc): Enable x86-defs.m4.
25912 * mpn/x86/k7/mul_1.asm: Fix include.
25913 * mpn/x86/k6/mul_basecase.S: Removed (copy of the pentium version).
25914 * mpn/x86/k6/mul_basecase.asm: New file.
25915 * mpn/x86/k6/sqr_basecase.asm: New file.
25916 * mpn/x86/k6/com_n.asm: New file.
25917 * mpn/x86/k6/copyi.asm: New file.
25918 * gmp.texi (Low-level Functions): Clarify mpn overlaps permitted.
25919 * gmp-impl.h (MPN_OVERLAP_P): New macro.
25920 * gmp-impl.h (assert_nocarry): New macro.
25921 * mpn/tests/ref.c: New file, based in part on other mpn/tests/*.c.
25922 * mpn/tests/ref.h: New file.
25924 2000-02-17 Linus Nordberg <linus@swox.se>
25926 * Makefile.am (dist-hook): Don't include any emacs backup files
25928 * Makefile.in: Regenerate.
25930 2000-02-17 Torbjorn Granlund <tege@swox.com>
25932 * mpn/sparc32/v9/mul_1.asm: Use `rd' to get current PC; get rid of
25934 * mpn/sparc32/v9/addmul_1.asm: Likewise.
25935 * mpn/sparc32/v9/submul_1.asm: Likewise.
25937 2000-02-17 Kevin Ryde <kevin@swox.se>
25939 * gmp.h: Add prototypes and defines for mpn_and_n, mpn_andn_n,
25940 mpn_com_n, mpn_copyd, mpn_copyi, mpn_ior_n, mpn_iorn_n,
25941 mpn_mul_basecase, mpn_nand_n, mpn_nior_n, mpn_sqr_basecase,
25942 mpn_xor_n, mpn_xorn_n.
25944 * mpn/asm-defs.m4: Many additions making up initial version.
25945 * mpn/asm-defs.m4 (L): Use defn(`LSYM_PREFIX').
25946 * mpn/x86/x86-defs.m4: New file.
25947 * mpn/x86/k6/aors_n.asm: New file.
25948 * mpn/x86/k6/divmod_1.asm: New file.
25949 * mpn/x86/k6/divrem_1.asm: New file.
25950 * mpn/x86/k6/lshift.S: Removed (was a copy of the pentium version).
25951 * mpn/x86/k6/lshift.asm: New file.
25952 * mpn/x86/k6/mod_1.asm: New file.
25953 * mpn/x86/k6/mul_1.S: Removed (was a copy of the pentium version).
25954 * mpn/x86/k6/mul_1.asm: New file.
25955 * mpn/x86/k6/rshift.S: Removed (was a copy of the pentium version).
25956 * mpn/x86/k6/rshift.asm: New file.
25957 * mpn/x86/k7/aors_n.asm: New file.
25958 * mpn/x86/k7/aorsmul_1.asm: New file.
25959 * mpn/x86/k7/mul_1.asm: New file.
25960 * mpn/x86/k7/rshift.asm: New file.
25961 * mpn/x86/p6/aorsmul_1.asm: New file.
25962 * mpn/x86/copyi.asm: New file.
25963 * mpn/x86/copyd.asm: New file.
25964 * mpn/lisp/gmpasm-mode.el: New file.
25966 2000-02-16 Torbjorn Granlund <tege@swox.com>
25968 * mpn/sparc32/v9/mul_1.asm: Conditionalize for PIC.
25969 * mpn/sparc32/v9/addmul_1.asm: Likewise.
25970 * mpn/sparc32/v9/submul_1.asm: Likewise.
25971 * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
25972 * mpn/sparc32/udiv_fp.asm: Likewise.
25974 2000-02-16 Linus Nordberg <linus@swox.se>
25976 * configure.in: Add mechanism for including target specific
25977 m4-files in config.m4.
25978 * configure: Regenerate.
25980 * acinclude.m4 (GMP_PROG_CCAS): Begin assembly lines (except
25981 labels) with a tab character. HP-UX demands it.
25982 (GMP_CHECK_ASM_SIZE): Ditto.
25983 (GMP_CHECK_ASM_LSYM_PREFIX): Ditto.
25984 (GMP_CHECK_ASM_LABEL_SUFFIX): Set to empty string for HP-UX.
25985 (GMP_CHECK_ASM_GLOBL): Change `.xport' --> `.export'.
25986 * aclocal.m4: Regenerate.
25988 2000-02-16 Linus Nordberg <linus@swox.se>
25990 * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Define LSYM_PREFIX as
25991 the prefix only, no argument.
25992 * aclocal.m4: Regenerate.
25993 * configure: Regenerate.
25995 * mpn/asm-defs.m4 (L): No argument to LSYM_PREFIX.
25997 2000-02-15 Linus Nordberg <linus@swox.se>
25999 * acinclude.m4: Prefix all temporary shell variables with
26001 (GMP_PROG_CC_FIND): Use defaults if no arguments are passed.
26002 Quote use of arguments.
26003 (GMP_PROG_CCAS): New macro.
26004 (GMP_INIT): New macro.
26005 (GMP_FINISH): New macro.
26006 (GMP_INCLUDE): New macro.
26007 (GMP_SINCLUDE): New macro.
26008 (GMP_DEFINE): New macro.
26009 (GMP_CHECK_ASM_LABEL_SUFFIX): New macro.
26010 (GMP_CHECK_ASM_TEXT): New macro.
26011 (GMP_CHECK_ASM_DATA): New macro.
26012 (GMP_CHECK_ASM_GLOBL): New macro.
26013 (GMP_CHECK_ASM_TYPE): New macro.
26014 (GMP_CHECK_ASM_SIZE): New macro.
26015 (GMP_CHECK_ASM_LSYM_PREFIX): New macro.
26016 (GMP_CHECK_ASM_W32): New macro.
26017 * aclocal.m4: Regenerate.
26019 * configure.in: Find m4 and nm for target.
26020 Use new macros to create config.m4.
26021 Prefix all temporary shell variables with `tmp_'.
26022 Pass `-X 64' to nm for 64-bit PPC target with 64-bit compiler.
26023 * configure: Regenerate.
26025 * Makefile.am (dist-hook): *Really* remove all CVS dirs in
26027 * Makefile.in: Regenerate.
26029 * mpn/Makefile.am: Add target for building .lo and .o from
26031 Pass -DPIC to preprocessor (CPP/m4) when building .lo.
26032 Build .o a second time for target .lo, without -DPIC to
26034 (SUFFIX): Add `.asm'.
26035 (EXTRA_DIST): Add asm-defs.m4.
26036 * mpn/Makefile.in: Regenerate.
26038 * mpf/Makefile.in: Regenerate.
26039 * mpf/tests/Makefile.in: Regenerate.
26040 * mpq/Makefile.in: Regenerate.
26041 * mpq/tests/Makefile.in: Regenerate.
26042 * mpz/Makefile.in: Regenerate.
26043 * mpz/tests/Makefile.in: Regenerate.
26045 2000-02-15 Torbjorn Granlund <tege@swox.com>
26047 * mpn/sparc32/udiv_fp.asm: Change `RODATA' to `DATA'.
26048 * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
26049 * mpn/sparc32/v9/addmul_1.asm: Likewise.
26050 * mpn/sparc32/v9/submul_1.asm: Likewise.
26051 * mpn/sparc32/v9/mul_1.asm: Likewise.
26053 * mpn/sparc32/add_n.asm: Rename `size' -> `n'.
26054 * mpn/sparc32/sub_n.asm: Likewise.
26056 * sparc32: Rename `.s' and `.S' files to `.asm'.
26057 * sparc64: Rename `.s' and `.S' files to `.asm'.
26059 2000-02-11 Torbjorn Granlund <tege@swox.com>
26061 * config.sub: Adopt to new config.guess sparc naming conventions.
26063 * config.guess (sun4u:SunOS:5.*:*): Change `sparc9' to `sparcv9'.
26064 * config.guess (sun4m:SunOS:5.*:*): Change to sun4[md]:SunOS:5.*:* and
26065 change `sparc8' to `sparcv8'.
26067 * mpn/x86/add_n.S: Use PROLOGUE/EPILOGUE.
26068 * mpn/x86/sub_n.S: Likewise.
26070 * mpn/x86/syntax.h (PROLOGUE): New name for PROLOG.
26071 * mpn/x86/syntax.h (EPILOGUE): New name for EPILOG.
26073 2000-02-11 Linus Nordberg <linus@swox.se>
26075 * configure.in: Better path for 64-bit sparc without 64-bit cc.
26076 Change sparc8 --> sparcv8.
26077 Change sparc9 --> sparcv9.
26078 * configure: Regenerate.
26080 2000-02-10 Linus Nordberg <linus@swox.se>
26082 * configure.in: Use Autoconf.
26083 * Makefile.am: New file.
26085 * AUTHORS: New file.
26086 * COPYING: New file.
26087 * acinclude.m4: New file.
26088 * acconfig.h: New file.
26090 * configure: Generate.
26091 * Makefile.in: Generate.
26092 * aclocal.m4: Generate.
26093 * config.in: Generate.
26095 * install.sh: Remove.
26096 * install-sh: New file from Automake.
26097 * missing: New file from Automake.
26098 * ltconfig: New file from Libtool.
26099 * ltmain.sh: New file from Libtool.
26101 * mpf/Makefile.am: New file.
26102 * mpf/Makefile.in: Generate.
26103 * mpf/configure.in: Remove.
26104 * mpf/tests/Makefile.am: New file.
26105 * mpf/tests/Makefile.in: Generate.
26106 * mpf/tests/configure.in: Remove.
26108 * mpn/Makefile.am: New file.
26109 * mpn/Makefile.in: Generate.
26110 * mpn/configure.in: Remove.
26112 * mpq/Makefile.am: New file.
26113 * mpq/Makefile.in: Generate.
26114 * mpq/configure.in: Remove.
26115 * mpq/tests/Makefile.am: New file.
26116 * mpq/tests/Makefile.in: Generate.
26117 * mpq/tests/configure.in: Remove.
26119 * mpz/Makefile.am: New file.
26120 * mpz/Makefile.in: Generate.
26121 * mpz/configure.in: Remove.
26122 * mpz/tests/Makefile.am: New file.
26123 * mpz/tests/Makefile.in: Generate.
26124 * mpz/tests/configure.in: Remove.
26126 2000-02-10 Torbjorn Granlund <tege@swox.com>
26128 * mpn/x86/add_n.S: Don't use label L0 twice.
26129 * mpn/x86/sub_n.S: Likewise.
26131 2000-01-20 Linus Nordberg <linus@swox.se>
26133 * demos/pexpr.c: Don't use setup_error_handler() in windoze.
26135 2000-01-19 Torbjorn Granlund <tege@swox.com>
26137 * demos/pexpr.c (sigaltstack): #define to sigstack for AIX.
26138 (setup_error_handler): Don't write to ss_size and ss_flags
26141 2000-01-11 Torbjorn Granlund <tege@swox.com>
26143 * mpn/configure.in (hppa2.0*-*-*): Move assignment of
26144 target_makefile_frag to where it belongs.
26146 1999-12-21 Torbjorn Granlund <tege@swox.com>
26148 * longlong.h (v9 umul_ppmm): New #define.
26149 (v9 udiv_qrnnd): New #define.
26151 1999-12-14 Torbjorn Granlund <tege@swox.com>
26153 * mpn/generic/divmod_1.c: Use invert_limb.
26154 * mpn/generic/mod_1.c: Use invert_limb.
26156 * gmp-impl.h (invert_limb): Put definition here.
26157 * mpn/generic/divrem.c (invert_limb): Delete definition.
26158 * mpn/generic/divrem_2.c (invert_limb): Delete definition.
26160 * gmp.h (mpn_divrem): Inhibit for non-gcc.
26161 But declare (undo 1999-11-22 change).
26163 * gmp-impl.h (DItype,UDItype): Do these also if _LONG_LONG_LIMB.
26165 * longlong.h: Move 64-bit hppa code out of __GNUC__ conditional.
26167 * stack-alloc.c (HSIZ): New #define.
26168 (__tmp_alloc): Use HSIZ instead of sizeof(tmp_stack).
26170 1999-12-10 Torbjorn Granlund <tege@swox.com>
26172 * config.sub: Clean up handling of x86 CPUs: Properly recognize
26173 Amd CPUs as unique entities. Use manufacturer's names of
26174 processors ("pentium", etc); still match ambiguous names like
26175 "i586", "i686", "p6" but be conservative in interpreting them.
26177 * configure.in: Recognize x86 CPU types known by config.guess.
26178 * mpn/configure.in: Likewise. Add x86/mmx path component as
26180 (athlon-*-*): Fix typo.
26182 * config.guess: Update x86 recog code to intiallly match
26183 more than just i386.
26184 Call K6-2 and K6-III for "k62" and "k63" respectively.
26186 * config.guess: Recognize x86 CPU types.
26187 Update code for FreeBSD, NetBSD, OpenBSD, Linux.
26189 1999-12-08 Torbjorn Granlund <tege@swox.com>
26191 * mpf/pow_ui.c: Avoid final squaring in loop.
26193 1999-12-07 Torbjorn Granlund <tege@swox.com>
26195 * gmp-impl.h (udiv_qrnnd_preinv2gen): Prefix local variables with `_'.
26196 (udiv_qrnnd_preinv2norm): Likewise.
26198 (HAVE_ALLOCA): #define also if defined (alloca).
26200 1999-12-04 Torbjorn Granlund <tege@swox.com>
26202 * mpn/tests/add_n.c: Set OPS from CLOCK.
26203 * mpn/tests/sub_n.c: Likewise.
26204 * mpn/tests/mul_1.c: Likewise.
26205 * mpn/tests/addmul_1.c: Likewise.
26206 * mpn/tests/submul_1.c: Likewise.
26208 * mpn/tests/lshift.c: Update from add_n.c.
26209 * mpn/tests/rshift.c: Likewise.
26211 1999-12-03 Torbjorn Granlund <tege@swox.com>
26213 * mpn/powerpc64/copy.S: New file.
26215 1999-12-02 Torbjorn Granlund <tege@swox.com>
26217 * mpn/sparc64/copy.s: New file.
26219 * mpn/tests/copy.c: New file.
26221 * mpn/configure.in: Recognize more Amd CPUs; Set special paths for
26224 * configure.in: Recognize Amd x86 CPUs.
26226 * mpz/fdiv_r_2exp.c: In rounding code, read in->_mp_size before
26227 writing to res->_mp_size.
26229 * mpn/powerpc64/*.S: Clean up assembly syntax, add function headers.
26230 * mpn/powerpc64/gmp-mparam.h: (KARATSUBA_MUL_THRESHOLD): #define.
26231 (KARATSUBA_SQR_THRESHOLD): #define.
26233 * mpn/tests/add_n.c (main): Only print test number if TIMES==1
26235 (main): Don't run reference code if NOCHECK.
26236 * mpn/tests/sub_n.c: Likewise.
26237 * mpn/tests/mul_1.c: Likewise.
26238 * mpn/tests/addmul_1.c: Likewise.
26239 * mpn/tests/submul_1.c: Likewise.
26241 * mpn/tests/lshift.c: (main): Only print test number if TIMES==1
26243 * mpn/tests/rshift.c: Likewise.
26245 1999-11-22 Torbjorn Granlund <tege@swox.com>
26247 * gmp.h (mpz_init_set_str): Declare using __gmp_const.
26248 (mpz_set_str): Likewise.
26249 (mpf_init_set_str): Likewise.
26250 (mpf_set_str): Likewise.
26251 (mpn_set_str): Likewise.
26252 (__gmp_0): Likewise.
26253 (mpn_divrem): Remove separate declaration; it's defined later in
26256 * gmp.h: Replace "defined (__STD__)' by (__STDC__-0) in
26257 expressions involving more than one term, to handle Sun's compiler
26258 that most helpfully sets __STDC__ to 0.
26259 * gmp-impl.h: Likewise.
26260 * longlong.h: Likewise.
26262 1999-11-21 Torbjorn Granlund <tege@swox.com>
26264 * mpn/sparc64/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
26265 (KARATSUBA_SQR_THRESHOLD): #define.
26267 * mpn/sparc64/lshift.s: Compensate stack references for odd stack ptr.
26268 * mpn/sparc64/rshift.s: Likewise.
26270 * mpn/sparc64/addmul_1.s: Propagate carry properly.
26271 * mpn/sparc64/submul_1.s: Likewise.
26273 * mpn/sparc64/sub_n.s: Rewrite.
26275 * mpn/sparc64/sub_n.s: Get operand order for main subcc right
26276 (before scrapping this code for new code).
26278 1999-11-20 Torbjorn Granlund <tege@swox.com>
26280 * mpn/sparc64/add_n.s: Rewrite.
26282 1999-11-17 Torbjorn Granlund <tege@swox.com>
26284 * mpn/x86/syntax.h (PROLOG): New #define.
26285 (EPILOG): New #define.
26287 * gmp.h (mpn_addsub_n): Declare.
26288 * gmp.h (mpn_add_nc): Declare.
26289 * gmp.h (mpn_sub_nc): Declare.
26290 * mpn/powerpc64/addsub_n.S: New file.
26292 1999-11-17 Torbjorn Granlund <tege@swox.com>
26294 * mpn/alpha/gmp-mparam.h
26295 (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
26296 (KARATSUBA_SQR_THRESHOLD): Likewise.
26298 1999-11-14 Torbjorn Granlund <tege@swox.com>
26300 * mpn/x86/mul_1.S: Unroll and optimize for P6 and K7.
26302 1999-11-09 Torbjorn Granlund <tege@swox.com>
26304 * mpn/x86/p6/gmp-mparam.h
26305 (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
26306 (KARATSUBA_SQR_THRESHOLD): Likewise.
26308 1999-11-05 Torbjorn Granlund <tege@swox.com>
26310 * mpn/generic/addsub_n.c: New file.
26312 1999-11-02 Torbjorn Granlund <tege@swox.com>
26314 * config.guess: Handle alpha:FreeBSD with alpha:NetBSD.
26316 * configure.in (vax*-*-*): New case.
26317 * config/mt-vax: New file.
26318 * mpn/vax/add_n.s: Rewrite.
26319 * mpn/vax/sub_n.s: Rewrite.
26321 1999-10-31 Torbjorn Granlund <tege@swox.com>
26323 * mpn/vax/rshift.s: New file.
26324 * mpn/vax/lshift.s: New file.
26326 1999-10-29 Torbjorn Granlund <tege@swox.com>
26328 * config.sub: Handle k5 and k6.
26329 * mpn/configure.in: Recognize k6.
26331 * mpf/tests/t-get_d.c (LOW_BOUND, HIGH_BOUND): New #defines.
26332 (main): Tighten error bounds to 14 digits.
26334 * longlong.h (default umul_ppmm, when smul_ppmm exists):
26335 Rename __m0 => __xm0, __m1 => __xm1.
26336 (default smul_ppmm): Likewise.
26338 1999-10-11 Torbjorn Granlund <tege@swox.com>
26340 * config.guess: Reverse the test for POWER vs PowerPC.
26341 * config.guess (sun4m:SunOS:5.*:*): New case.
26342 * config.guess (sun4u:SunOS:5.*:*): New case.
26344 1999-09-29 Torbjorn Granlund <tege@swox.com>
26346 * mpn/generic/divrem_2.c: Clean up comments.
26348 1999-09-23 Torbjorn Granlund <tege@swox.com>
26350 * mpz/tests/Makefile.in: Use move-if-change when generating binaries.
26351 * mpf/tests/Makefile.in: Likewise.
26352 * mpq/tests/Makefile.in: Likewise.
26353 * mpz/tests/move-if-change: New file.
26354 * mpf/tests/move-if-change: New file.
26355 * mpq/tests/move-if-change: New file.
26357 * gmp.h (mpn_incr_u): New macro (from mpn/generic/mul_n.c).
26358 (mpn_decr_u): New macro.
26360 * mpn/generic/mul_n.c (mpn_incr): Delete.
26361 * mpn/generic/mul_n.c: Update usages mpn_incr => mpn_incr_u.
26362 * mpn/generic/divrem_newt.c: Use mpn_incr_u and mpn_decr_u instead of
26363 mpn_add_1 and mpn_sub_1.
26364 * mpn/generic/sqrtrem.c: Likewise.
26365 * mpz/cdiv_q_ui.c: Likewise.
26366 * mpz/cdiv_qr_ui.c: Likewise.
26367 * mpz/fdiv_q_ui.c: Likewise.
26368 * mpz/fdiv_qr_ui.c: Likewise.
26370 * mpn/generic/sqrtrem.c: Start single-limb Newton iteration from 18
26373 1999-07-27 Torbjorn Granlund <tege@swox.com>
26375 * mpn/generic/divrem_1.c (__gmpn_divrem_1n): New function.
26377 * mpn/generic/divrem_2.c: New file, code from divrem.c, `case 2:'.
26378 * mpn/Makefile.in: Compile divrem_2.c.
26379 * make.bat: Compile divrem_2.c.
26380 * mpn/configure.in (functions): Add divrem_2.
26381 * gmp.h: Declare mpn_divrem_2.
26383 * mpn/generic/divrem.c: Delete special cases, handle just divisors
26384 of more than 2 limbs.
26385 * gmp.h (mpn_divrem): Call mpn_divrem_1, mpn_divrem_2, as appropriate.
26387 * mpn/generic/divrem.c: Rework variable usage for better register
26390 1999-07-26 Torbjorn Granlund <tege@swox.com>
26392 * mpn/alpha/ev5/add_n.s: Rewrite for better ev6 speed.
26393 * mpn/alpha/ev5/sub_n.s: Likewise.
26395 1999-07-21 Torbjorn Granlund <tege@swox.com>
26397 * longlong.h (alpha): Define umul_ppmm for cc.
26399 * gmp-impl.h (DItype, UDItype): Define for non-gcc if _LONGLONG is
26402 1999-07-15 Torbjorn Granlund <tege@swox.com>
26404 * longlong.h (powerpc64 count_leading_zeros): Fix typo.
26405 (powerpc64 add_ssaaaa): Fix typos.
26406 (powerpc64 sub_ddmmss): Fix typos.
26408 1999-07-14 Torbjorn Granlund <tege@swox.com>
26410 * mpz/tests/Makefile.in: Pass XCFLAGS when linking.
26411 * mpf/tests/Makefile.in: Likewise.
26412 * mpq/tests/Makefile.in: Likewise.
26413 * mpn/Makefile.in (.S.o): Pass XCFLAGS.
26415 * longlong.h: Add support for 64-bit PowerPC.
26416 * config.sub: Handle "powerpc64".
26417 * configure.in: Likewise.
26418 * mpn/configure.in: Suppress use of config/t-ppc-aix for now,
26419 it seems compiler passes proper options.
26420 * mpn/powerpc64/*.S: New files.
26422 * Makefile.in (FLAGS_TO_PASS): Pass "AR=$(AR)".
26424 1999-07-07 Torbjorn Granlund <tege@swox.com>
26426 * demos/pexpr.c (factor): Change alloca call to a malloc/free pair.
26428 * mpn/powerpc32/syntax.h: Add #define's for crN.
26430 * gmp.h (gmp_rand_algorithm): Remove spurious `,'.
26432 1999-07-05 Torbjorn Granlund <tege@swox.com>
26434 * mpn/generic/divrem_1.c: Normalize divisor when needed.
26436 1999-07-02 Torbjorn Granlund <tege@swox.com>
26438 * mpn/configure.in (powerpc*-apple-mach): New configuration.
26439 * mpn/powerpc32/*: Add support for apple-macho syntax.
26440 * mpn/powerpc32/syntax.h: New file.
26441 * gmp-impl.h: Don't use `__attribute__' syntax for Apple's perversion
26444 1999-05-26 Linus Nordberg <linus@swox.se>
26446 * rand.c (gmp_rand_init): Fix typo.
26448 * mpn/generic/rawrandom.c (mpn_rawrandom): Count bits, not limbs,
26449 to keep track of how many rounds to do in loop. Clean up
26450 temporary allocation. Update `seedsize' inside loop. Mask off
26451 the correct number of bits from final result. Init `mcopyp' even
26452 when not normalizing `m'.
26454 * randlc.c (gmp_rand_init_lc): Fix typo (don't call
26455 mpz_init_set_ui()).
26457 * mpn/generic/rawrandom.c (mpn_rawrandom): Set SIZ(s->seed) when
26460 * tests/rand/Makefile (test, bigtest): Add 33-bit tests.
26462 * tests/rand/gen.c (main): Set precision of variable passed to
26463 mpf_urandomb(). Add option `-p'.
26465 1999-05-25 Linus Nordberg <linus@swox.se>
26467 * randcm.c: Remove.
26468 * randcmui.c: Remove.
26469 * Makefile.in: Remove randcm and randcmui.
26471 * gmp-impl.h: Remove prototypes for __gmp_rand_init_common() and
26472 __gmp_rand_init_common_ui().
26473 * randlc.c (gmp_rand_init_lc): Don't call
26474 __gmp_rand_init_common().
26476 * randlcui.c (gmp_rand_init_lc_ui): Don't call
26477 __gmp_rand_init_common_ui().
26479 * gmp.h (__gmp_rand_state_struct): Remove unused member `maxval'.
26480 * randclr.c (gmp_rand_clear): Remove reference to s->maxval.
26481 * randcm.c (__gmp_rand_init_common): Ditto
26483 * mpn/generic/rawrandom.c (mpn_rawrandom): Don't calculate nlimbs
26486 * gmp.h (__gmp_rand_dist): Remove.
26488 1999-05-24 Linus Nordberg <linus@swox.se>
26490 * mpn/generic/rawrandom.c: Clean up comments.
26492 * gmp.texi: Add documentation for random number generation.
26494 1999-05-21 Linus Nordberg <linus@swox.se>
26496 * gmp.h: Typedef `gmp_rand_state' as an array with one element.
26497 Change prototypes accordingly.
26498 * gmp-impl.h: Change prototypes using `gmp_rand_state'.
26499 * rand.c (gmp_rand_init): Take `gmp_rand_state' as argument
26500 instead of a pointer to a `gmp_rand_state'.
26501 * mpf/urandom.c (mpf_urandomb): Ditto.
26502 * mpz/urandom.c (mpz_urandomb): Ditto.
26503 * mpn/generic/rawrandom.c (mpn_rawrandom): Ditto.
26504 * randcmui.c (__gmp_rand_init_common_ui): Ditto.
26505 * randlc.c (gmp_rand_init_lc): Ditto.
26506 * randlcui.c (gmp_rand_init_lc_ui): Ditto.
26507 * randui.c (gmp_rand_init_ui): Ditto.
26508 * randcm.c (__gmp_rand_init_common): Ditto.
26509 * randclr.c (gmp_rand_clear): Ditto.
26511 * tests/rand/gen.c (main): Pass `s' to rand-funcs instead of address
26514 1999-05-20 Linus Nordberg <linus@swox.se>
26516 * Makefile.in: Rename randi.c --> rand.c, randi_lc.c --> randlc.c,
26517 randicom.c --> randcm.c. Add randui.c, randcmui.c, randlcui.c.
26520 * gmp.h: Add prototypes for gmp_rand_init_ui() and
26521 gmp_rand_init_lc_ui().
26522 * gmp-impl.h: Add prototypes for __gmp_rand_init_common() and
26523 __gmp_rand_init_common_ui().
26525 * randlc.c, randcm.c, randclr.c, rand.c: Change #include of
26526 <gmp.h> to "gmp.h".
26527 * randclr.c: Include stdlib.h for free().
26528 * rand.c: Include gmp-impl.h.
26530 1999-05-12 Torbjorn Granlund <tege@swox.com>
26532 * mpn/configure.in: Put generic m68k alternative last.
26534 1999-05-04 Torbjorn Granlund <tege@swox.com>
26536 * demos/pexpr.c (setup_error_handler): Use sigemptyset to create
26537 empty set (for portability).
26538 (fns): Fix typo '#if #if'.
26539 (mpz_eval_expr): Implement FERMAT and MERSENNE.
26541 * demos/pexpr.c: Cast longjmp argument via long to silent warnings on
26544 1999-05-03 Torbjorn Granlund <tege@swox.com>
26546 * demos/pexpr.c: Add #defines for GMP 1.x and 2.0 compatibility.
26548 * demos/pexpr.c (setup_error_handler): New function; take signal
26549 handler setup code from main(), with major modifications to use modern
26551 (main): Remove signal handler setup code; call setup_error_handler.
26553 1999-04-29 Linus Nordberg <linus@swox.se>
26555 * tests/rand/findcl.c (main): Add option '-i' for interval factor.
26556 Separate v and merit lose figures. Add '-v' for version.
26558 1999-04-28 Linus Nordberg <linus@swox.se>
26560 * tests/rand/statlib.c: Change debugging stuff.
26562 * tests/rand/gmpstat.h: Add debug values definitions.
26564 * tests/rand/findcl.c (main): Print low and high merit on startup.
26565 Print version string on startup. Catch SEGV and HUP. Add option -d
26566 for debug. Fix bug making test for v too hard.
26567 (sh_status): New function.
26568 (sh_status): Flush stdout. Add RCSID.
26570 1999-04-27 Linus Nordberg <linus@swox.se>
26572 * tests/rand/Makefile (clean): Add target.
26574 1999-04-27 Linus Nordberg <linus.nordberg@canit.se>
26576 * tests/rand/stat.c: Include gmpstat.h.
26577 Add global int g_debug.
26579 * tests/rand/spect.c: Include <unistd.h>.
26581 * tests/rand/findcl.c (main): Input is `m', not all factors of `m'.
26582 Print only the very first matching multiplier. Include <unistd.h>.
26583 Flush stdout. Print "done." when done.
26585 * tests/rand/spect.c: Move everything but main() to statlib.c.
26587 * tests/rand/findcl.c: New file.
26589 * tests/rand/gmpstat.h: New file.
26591 * tests/rand/statlib.c (merit, merit_u, f_floor, vz_dot,
26592 spectral_test): New functions.
26594 1999-04-27 Torbjorn Granlund <tege@swox.com>
26596 * mpn/configure.in: Fix typo, "sparc-*)" was "sparc)".
26598 1999-04-21 Torbjorn Granlund <tege@swox.com>
26600 * config.sub: Recognize ev6.
26602 1999-04-12 Linus Nordberg <linus.nordberg@canit.se>
26604 * urandom.c: Split up into randclr.c, randi.c, randi_lc.c,
26606 * randclr.c, randi.c, randi_lc.c, randicom.c: New files.
26607 * Makefile.in: Remove urandom. Add randclr, randi, randi_lc,
26611 1999-03-31 Torbjorn Granlund <tege@matematik.su.se>
26613 * configure.in (sparc9-*-solaris2.[789]*, etc): New alternative.
26614 * mpn/configure.in: Use mt-sprc9 also for ultrasparc*-*-solaris2*.
26616 1999-03-30 Linus Nordberg <linus.nordberg@canit.se>
26618 * urandom.c (__gmp_rand_scheme): Change NULL->0.
26619 Include "gmp.h" instead of <gmp.h>.
26621 1999-03-29 Linus Nordberg <linus.nordberg@canit.se>
26623 * gmp.h (__gmp_rand_data_lc): Now holds a, c, m instead of scheme
26625 (__gmp_rand_lc_scheme_struct): Remove mpz_t's `a' and `m'.
26627 * tests/rand/stat.c (f_freq): Don't print 2nd level results if doing
26630 * tests/rand/gen.c (main): Set default algorithm to mpz_urandomb.
26631 (main): Add option -c.
26633 1999-03-24 Linus Nordberg <linus.nordberg@canit.se>
26635 * tests/rand/Makefile (GMPINC): Rename to GMPH.
26636 (GMPH): Add gmp-mparam.h.
26637 (CFLAGS): Add -I$(GMPLIBDIR)/mpn
26639 1999-03-23 Linus Nordberg <linus.nordberg@canit.se>
26641 * Makefile.in: Compile top-dir/urandom.c.
26644 * mpn/Makefile.in: Compile rawrandom.c.
26647 * mpn/configure.in (functions): Add rawrandom.
26649 * gmp.h (__gmp_rand_scheme_struct): Rename to
26650 __gmp_rand_lc_scheme_struct.
26651 (__gmp_rand_data_lc): Remove member 'n'. Allocate a
26652 __gmp_rand_lc_scheme_struct instead of a pointer to one.
26653 Add prototype for gmp_rand_init_lc(), mpn_rawrandom().
26654 New prototype for mpz_urandomb().
26656 * urandom.c: New file.
26657 (__gmp_rand_init_common): New function.
26658 (gmp_rand_init_lc): New function.
26659 (gmp_rand_init): Don't init data_lc->n. Call gmp_rand_init_lc()
26660 and __gmp_rand_init_common().
26661 (gmp_rand_clear): Remove reference to data_lc->n.
26663 * mpz/urandom.c (gmp_rand_init, gmp_rand_clear): Move to new file
26664 urandom.c in top-dir.
26665 (mpz_urandomb): Add function parameter nbits. Call mpn_rawrandom().
26667 * mpf/urandom.c (mpf_urandomb): Call mpn_rawrandom().
26669 * mpn/generic/rawrandom.c: New file.
26670 (mpn_rawrandom): New function.
26672 1999-03-17 Torbjorn Granlund <tege@matematik.su.se>
26674 * extract-dbl.c: When packing result, adjust exp when sc == 0.
26676 * mpf/tests/t-get_d.c: New file.
26677 * mpf/tests/Makefile.in: Compile t-get_d.c.
26679 1999-03-16 Linus Nordberg <linus.nordberg@canit.se>
26681 * mpz/urandom.c (__gmp_rand_scheme): Add extra braces around the
26684 * make.bat: Compile mpz/urandom.c and mpf/urandom.c
26686 * tests/rand/statlib.c (ks_table): Use mpf_pow_ui() and exp().
26688 * tests/rand/gen.c: Include unistd.h for getopt.
26690 1999-03-15 Linus Nordberg <linus.nordberg@canit.se>
26692 * mpz/urandom.c (gmp_rand_init): New function.
26693 (gmp_rand_clear): New function.
26694 (mpz_urandomb): New function.
26696 * mpz/Makefile.in: Compile urandom.c
26698 * mpf/urandom.c (mpf_urandomb): New function.
26700 * mpf/Makefile.in: Compile urandom.c.
26702 * gmp.h (__gmp_rand_state_struct, __gmp_rand_scheme_struct): New
26703 structs for randomization functions.
26704 (gmp_rand_dist, gmp_rand_alogrithm): New enums for randomization
26706 (mpz_urandomb, mpf_urandomb): Add prototype.
26707 (gmp_rand_init, gmp_rand_clear): Add prototype.
26709 * tests/rand/gen.c, stat.c, statlib.c, statlib.h: New files.
26710 * tests/rand/Makefile, tests/rand/ChangeLog: New files.
26712 1999-03-15 Torbjorn Granlund <tege@matematik.su.se>
26714 * .gdbinit: New file.
26716 * mpz/dump.c: New file.
26717 * mpz/Makefile.in: Compile dump.c.
26718 * make.bat: Likewise.
26719 * gmp.h (mpz_dump): Declare.
26721 1999-03-14 Torbjorn Granlund <tege@matematik.su.se>
26723 * mpz/tests/reuse.c: Also test mpz_invert and mpz_divexact.
26725 * mpz/tests/convert.c: Update to GMP 2 variable syntax.
26727 1999-03-13 Torbjorn Granlund <tege@matematik.su.se>
26729 * mpf/README: New file.
26730 * mpz/README: New file.
26732 * mpf/pow_ui.c: New file.
26733 * mpf/Makefile.in: Compile pow_ui.c.
26734 * make.bat: Likewise.
26735 * gmp.h (mpf_pow_ui): Declare.
26737 1999-03-12 Torbjorn Granlund <tege@matematik.su.se>
26739 * mpn/configure.in: Stage 1 of rewrite.
26740 * mpn/underscore.h: New name for bsd.h.
26741 * mpn/sysv.h: Deleted.
26743 * mpn/m68k/*: Don't include sysdep.h.
26745 * mpn/pa64/README: New file.
26747 1999-03-11 Torbjorn Granlund <tege@matematik.su.se>
26749 * mpn/powerpc32/add_n.S: Add support for both AIX and ELF syntax.
26751 * mpn/powerpc32/sub_n.S: Likewise.
26752 * mpn/powerpc32/lshift.S: Likewise.
26753 * mpn/powerpc32/rshift.S: Likewise.
26754 * mpn/powerpc32/mul_1.S: Likewise.
26755 * mpn/powerpc32/addmul_1.S: Likewise.
26756 * mpn/powerpc32/submul_1.S: Likewise.
26758 * mpn/powerpc32/umul.S: New file.
26759 * mpn/sparc32/v8/umul.S: New file.
26760 * mpn/sparc32/umul.S: New file.
26761 * mpn/x86/umul.S: New file.
26762 * mpn/x86/udiv.S: New file.
26764 * mpn/Makefile.in (mul_basecase.o): Delete rule.
26766 1999-02-22 Torbjorn Granlund <tege@matematik.su.se>
26768 * configure.in (hppa2.0*-*-*): Force use of GCC.
26770 * extract-dbl.c: Handle IEEE denormalized numbrs. Clean up.
26772 1998-12-02 Torbjorn Granlund <tege@matematik.su.se>
26774 * mpn/Makefile.in (CCAS): New macro.
26778 * mpn/Makefile.in (mul_basecase.o): Add dependency.
26779 (sqr_basecase.o): Likewise.
26780 (mod_1.o): Likewise.
26782 * demos/pexpr.c (cputime): Test also __hpux.
26783 (cleanup_and_exit): Check SIGXCPU only #ifdef LIMIT_RESOURCE_USAGE.
26785 * mpz/tests/t-2exp.c: Use urandom, not random.
26787 * mpn/configure.in (arm*-*-*): New alternative.
26789 1998-11-30 Torbjorn Granlund <tege@matematik.su.se>
26791 * gmp-impl.h (union ieee_double_extract): Special case for
26793 (LIMBS): Alias for PTR.
26795 1998-11-26 Torbjorn Granlund <tege@matematik.su.se>
26797 * longlong.h (m68000 umul_ppmm): Use `muluw', not `mulu'.
26798 (m68k stuff): Clean up; add coldfire support.
26800 1998-11-23 Torbjorn Granlund <tege@matematik.su.se>
26802 * mpn/mips3/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
26803 (KARATSUBA_SQR_THRESHOLD): #define.
26805 * mpn/sparc32/v9/README: New file.
26807 1998-11-20 Torbjorn Granlund <tege@matematik.su.se>
26809 * mpn/x86/README: New file.
26811 * mpn/arm/gmp-mparam.h: New file.
26812 * mpn/pa64/gmp-mparam.h: New file.
26813 * mpn/hppa/gmp-mparam.h: New file.
26814 * mpn/x86/pentium/gmp-mparam.h: New file.
26815 * mpn/sparc32/v9/gmp-mparam.h: New file.
26816 * mpn/powerpc32/gmp-mparam.h: New file.
26817 * mpn/x86/p6/gmp-mparam.h: New file.
26819 * mpn/alpha/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
26820 (KARATSUBA_SQR_THRESHOLD): #define.
26822 * mpn/configure.in: Point to x86/p6 when appropriate.
26824 * mpn/power/umul.s: New file.
26825 * mpn/power/sdiv.s: New file.
26826 * mpn/pa64/addmul_1.S: New file.
26827 * mpn/pa64/submul_1.S: New file.
26828 * mpn/pa64/mul_1.S: New file.
26829 * mpn/pa64/udiv_qrnnd.c: New file.
26830 * mpn/pa64/umul_ppmm.S: New file.
26831 * mpn/mips2/umul.s: New file.
26832 * mpn/m68k/mc68020/umul.s: New file.
26833 * mpn/m68k/mc68020/udiv.s: New file.
26834 * mpn/hppa/hppa1_1/umul.s: New file.
26835 * mpn/alpha/umul.s: New file.
26836 * mpn/a29k/udiv.s: New file.
26837 * mpn/a29k/umul.s: New file.
26839 1998-11-17 Torbjorn Granlund <tege@matematik.su.se>
26841 * mpn/x86/mul_basecase.S: New file for non-pentiums.
26842 * mpn/x86/mul_basecase.S: Move to mpn/x86/pentium.
26844 1998-11-16 Torbjorn Granlund <tege@matematik.su.se>
26846 * make.bat: Compile mul_basecase.c and sqr_basecase.c.
26848 1998-11-10 Torbjorn Granlund <tege@matematik.su.se>
26850 * mpz/invert.c: Defer writing to parameter `invert' until
26853 1998-11-03 Torbjorn Granlund <tege@matematik.su.se>
26855 * mpn/pa64/udiv_qrnnd.c: Handle more border cases.
26857 1998-10-29 Torbjorn Granlund <tege@matematik.su.se>
26859 * insert-dbl.c: Special case biased exponents < 1; Get boundary for
26862 * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB): New #define.
26864 1998-10-28 Torbjorn Granlund <tege@matematik.su.se>
26866 * mpn/powerpc32/submul_1.s: Rewrite, optimizing for PPC604.
26867 * mpn/powerpc32/addmul_1.s: Likewise.
26868 * mpn/powerpc32/lshift.s: Likewise.
26870 1998-10-23 Torbjorn Granlund <tege@matematik.su.se>
26872 * config/mt-sprc9-gcc (XCFLAGS): Add -Wa,-xarch=v8plus.
26874 * mpn/sparc32/v9/submul_1.s: New file.
26876 1998-10-21 Torbjorn Granlund <tege@matematik.su.se>
26878 * mpn/config/mt-pa2hpux: New file.
26879 * mpn/configure.in (hppa2.0*-*-*): Use new 64-bit code.
26881 * config.sub: Recognize hppa2.0 as CPU type.
26883 * longlong.h (64-bit hppa): Add umul_ppmm and udiv_qrnnd.
26884 * mpn/pa64/mul_1.S: New file.
26885 * mpn/pa64/addmul_1.S: New file.
26886 * mpn/pa64/submul_1.S: New file.
26887 * mpn/pa64/umul_ppmm.S: New file.
26888 * mpn/pa64/udiv_qrnnd.c: New file.
26890 1998-10-20 Torbjorn Granlund <tege@matematik.su.se>
26892 * mpz/pprime_p.c: Pass 1L, not 1, to mpz_cmp_ui.
26894 * mpz/fdiv_q_2exp.c: Cast `long' argument to `mp_limb_t' for mpn calls.
26895 * mpz/gcd_ui.c: Likewise.
26896 * mpz/add_ui.c: Likewise.
26897 * mpz/sub_ui.c: Likewise.
26899 1998-10-19 Torbjorn Granlund <tege@matematik.su.se>
26901 * mpn/generic/bdivmod.c: Avoid using switch statement with mp_limb_t
26904 1998-10-17 Torbjorn Granlund <tege@matematik.su.se>
26906 * mpn/sparc32/v9/mul_1.s: Misc cleanups.
26907 * mpn/sparc32/v9/addmul_1.s: Misc cleanups.
26909 1998-10-16 Torbjorn Granlund <tege@matematik.su.se>
26911 * mpn/tests/{add,sub,}mul_1.c: Print xlimb using mpn_print.
26913 * mpz/tests/t-powm.c (SIZE): Increase to 50.
26914 (EXP_SIZE): New parameter; use it for computing exp_size.
26916 1998-10-15 Torbjorn Granlund <tege@matematik.su.se>
26918 * mpn/generic/divrem_newt.c: Use TMP_ALLOC interface.
26920 * mpn/generic/sqrtrem.c: Check BITS_PER_MP_LIMB before defining
26921 assembly variants of SQRT.
26923 1998-10-14 Torbjorn Granlund <tege@matematik.su.se>
26925 * mpn/tests: Clean up timing routines. Don't include longlong.h
26926 where it is not needed.
26927 (mpn_print): Handle printing when _LONG_LONG_LIMB.
26928 * mpn/tests/{add,sub,}mul_1.c: Generate xlimb with mpn_random2
26929 and do it whether TIMES != 1 or not.
26931 * mpn/generic/mul_n.c: Delay assignment of `sign' for lower
26934 * mpn/sparc32/v9/mul_1.s: New file.
26936 * config/mt-sprc9-gcc: New file.
26937 * configure.in: Use it.
26939 * mpn/configure.in: Use sparc64 for Solaris 2.7 and later with a
26941 * mpn/configure.in: Use sparc32/v9 for Solaris 2.6 or earlier with
26944 * mpf/sub.c: In initial code for ediff == 0, limit precision
26945 before jumping to `normalize'.
26947 1998-10-13 Torbjorn Granlund <tege@matematik.su.se>
26949 * mpn/hppa/hppa2_0/add_n.s: New file.
26950 * mpn/hppa/hppa2_0/sub_n.s: New file.
26951 * mpn/configure.in: Handle hppa2.0 (32-bit code for now).
26953 * config.guess: Update from egcs 1.1.
26954 (9000/[3478]??:HP-UX:*:*): Properly return 2.0 for all known 2.0
26957 1998-10-07 Torbjorn Granlund <tege@matematik.su.se>
26959 * mpz/root.c (mpz_root): New file.
26960 * mpz/Makefile.in: Compile it.
26961 * make.bat: Likewise.
26962 * gmp.h (mpz_root): Declare.
26964 * mpz/perfpow.c: New file.
26965 * mpz/Makefile.in: Compile it.
26966 * make.bat: Likewise.
26967 * gmp.h (mpz_perfect_power_p): Declare.
26969 * mpz/remove.c: New file.
26970 * mpz/Makefile.in: Compile it.
26971 * make.bat: Likewise.
26972 * gmp.h (mpz_remove): Declare.
26974 * mpz/bin_ui.c: New file.
26975 * mpz/Makefile.in: Compile it.
26976 * make.bat: Likewise.
26977 * gmp.h (mpz_bin_ui): Declare.
26979 * mpz/bin_uiui.c: New file.
26980 * mpz/Makefile.in: Compile it.
26981 * make.bat: Likewise.
26982 * gmp.h (mpz_bin_uiui): Declare.
26984 1998-09-16 Torbjorn Granlund <tege@matematik.su.se>
26986 * longlong.h: Test for __powerpc__ in addition to _ARCH_PPC.
26988 Sat Sep 5 17:22:28 1998 Torbjorn Granlund <tege@matematik.su.se>
26990 * mpf/cmp_si.c: Compare most significant mantissa limb before
26991 trying to deduce anything from the limb count.
26992 * mpf/cmp_ui.c: Likewise.
26994 Tue Aug 18 10:24:39 1998 Torbjorn Granlund <tege@matematik.su.se>
26996 * mpz/pprime_p.c (mpz_probab_prime_p): Add new code block
26997 for doing more dividing.
26999 Sat Aug 15 18:43:17 1998 Torbjorn Granlund <tege@matematik.su.se>
27001 * mpn/generic/divrem_newt.c: New name for divrem_newton.c.
27002 * mpn/Makefile.in: Corresponding changes.
27003 * mpn/configure.in: Likewise.
27005 Wed Aug 12 23:07:09 1998 Torbjorn Granlund <tege@matematik.su.se>
27007 * config.guess: Handle powerpc for NetBSD.
27009 Tue Jul 28 23:10:55 1998 Torbjorn Granlund <tege@matematik.su.se>
27011 * mpz/fib_ui.c: New file.
27012 * mpz/Makefile.in: Compile it.
27013 * make.bat: Likewise.
27014 * gmp.h (mpz_fib_ui): Declare.
27016 Wed Jun 17 22:52:58 1998 Torbjorn Granlund <tege@matematik.su.se>
27018 * make.bat: Fix typo, `asm-synt.h' => `asm-syntax.h'.
27020 Wed Jun 3 11:27:32 1998 Torbjorn Granlund <tege@matematik.su.se>
27022 * config/mt-pwr: New file.
27023 * config/mt-ppc: New file.
27024 * configure.in: Use the new files.
27026 Tue Jun 2 13:04:17 1998 Torbjorn Granlund <tege@matematik.su.se>
27028 * mpn/sparc32/v9/addmul_1.s: New file.
27029 * mpn/config/mt-sprc9: New file.
27030 * mpn/configure.in: Use mt-sprc9.
27032 Tue May 26 11:24:18 1998 Torbjorn Granlund <tege@matematik.su.se>
27034 * demos/factorize.c (factor_using_pollard_rho): Pass correct
27035 parameters in recursive calls; join the two recursion arms.
27037 * mpf/set_q.c: Set result sign.
27038 When normalizing the numerator, don't allow it to increase in size
27041 Tue May 19 17:28:14 1998 Torbjorn Granlund <tege@matematik.su.se>
27043 * demos/factorize.c (factor_using_division): Call fflush
27044 also for the factor 2.
27046 Mon May 18 15:51:01 1998 Torbjorn Granlund <tege@matematik.su.se>
27048 * make.bat: Pass -fomit-frame-pointer. Do not pass -g.
27050 Tue May 5 01:42:50 1998 Torbjorn Granlund <tege@matematik.su.se>
27052 * mpz/Makefile.in (LOCAL_CC): Remove definition.
27054 * gmp.h: Get rid of GMP_SMALL stuff.
27055 * mpz/Makefile.in: Likewise.
27056 * mpq/Makefile.in: Likewise.
27057 * mpf/Makefile.in: Likewise.
27059 * mpz/invert.c: Fix typo in comment.
27061 Mon May 4 23:05:32 1998 Torbjorn Granlund <tege@matematik.su.se>
27063 * mpn/generic/sqrtrem.c: Check that __arch64__ is not defined
27064 before defining sparc SQRT.
27066 Mon Apr 20 19:16:17 1998 Torbjorn Granlund <tege@matematik.su.se>
27068 * mpn/generic/gcdext.c: Allow gp to be NULL.
27070 1998-04-03 Torbjorn Granlund <tege@matematik.su.se>
27072 * mpn/configure.in: Recognize `alphaev5*', not `alphaev5'.
27074 * config.guess: Handle CPU variants for NetBSD.
27076 Mon Mar 16 13:07:54 1998 Torbjorn Granlund <tege@matematik.su.se>
27078 * mpz/pprime_p.c: Use mpn_mod_1/mpn_preinv_mod_1 for computing mod PP,
27079 not mpz_tdiv_r_ui (which expects an `unsigned long').
27080 (mpz_probab_prime_p): Change type of `r' to mp_limb_t.
27082 Thu Mar 12 17:19:04 1998 Torbjorn Granlund <tege@matematik.su.se>
27084 * gmp.h (mpf_ceil, mpf_floor, mpf_trunc): Add declarations.
27086 * config.guess: Update from FSF version.
27087 * config.sub: Likewise.
27089 * config.guess: Add special handling of alpha-*-NetBSD.
27091 Wed Mar 11 00:55:34 1998 Torbjorn Granlund <tege@matematik.su.se>
27093 * mpz/inp_str.c: Update from set_str.c.
27094 Properly increment `nread' when skipping minus sign.
27096 * mpz/set_str.c: Check for empty string after having skipped
27099 Mon Mar 9 19:28:00 1998 Torbjorn Granlund <tege@matematik.su.se>
27101 * mpz/set_str.c: Skip leading zeros.
27103 Wed Mar 4 19:29:16 1998 Torbjorn Granlund <tege@matematik.su.se>
27105 * gmp.h (mpz_cmp_si): Cast argument before calling mpz_cmp_ui.
27107 * demos/factorize.c: Rewrite.
27109 1998-02-04 Torbjorn Granlund <tege@matematik.su.se>
27111 * configure.in (i[3456]86* etc): Check if using gcc before
27114 * configure.in (m68*-*-*): New alternative.
27115 * config/mt-m68k: New file.
27117 * mpn/alpha/invert-limb.s: Put tables in text segment,
27118 since not all systems support "rdata".
27120 Wed Feb 4 02:20:57 1998 Torbjorn Granlund <tege@matematik.su.se>
27122 * gmp.h (__GNU_MP_VERSION_SNAP): New #define.
27123 (__GNU_MP_VERSION_MINOR): Now 1.
27125 Wed Jan 28 22:29:36 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
27127 * longlong.h (alpha udiv_qrnnd): #define UDIV_NEEDS_NORMALIZATION.
27129 Wed Jan 28 20:28:19 1998 Torbjorn Granlund <tege@sophie.matematik.su.se>
27131 * mpz/pprime_p.c (mpz_probab_prime_p): Delete 59 from tried divisors.
27133 Mon Jan 26 01:39:02 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
27135 * mpz/pprime_p.c (mpz_probab_prime_p): Major overhaul: Check small
27136 numers specifically; check small factors, then perform a fermat test.
27138 Tue Jan 13 14:58:28 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
27140 * longlong.h (alpha udiv_qrnnd): Call __mpn_invert_normalized_limb
27141 and udiv_qrnnd_preinv.
27143 Wed Jan 7 01:52:54 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
27145 * mpn/configure.in (alpha*, extra_functions): Add invert-limb and
27148 * mpn/tests/divrem.c: Get allocations right.
27150 * mpn/generic/divrem.c: Conditionally pre-invert most significant
27153 Tue Jan 6 23:08:54 1998 Torbjorn Granlund <tege@tunnis.tmg.se>
27155 * mpn/generic/divrem_1.c: Rename variables to comply to conventions.
27156 Make `i' have type `mp_size_t'.
27158 Tue Dec 30 22:21:42 1997 Torbjorn Granlund <tege@matematik.su.se>
27160 * mpz/tdiv_qr_ui.c: Return the remainder.
27161 * mpz/tdiv_r_ui.c: Likewise.
27162 * mpz/tdiv_q_ui.c: Likewise.
27163 * gmp.h: Change return type of mpz_tdiv_qr_ui, mpz_tdiv_r_ui,
27166 * mpz/tdiv_ui.c: New file.
27167 * mpz/Makefile.in: Compile it.
27168 * make.bat: Likewise.
27169 * gmp.h (mpz_tdiv_ui): Declare.
27171 Fri Nov 7 04:21:15 1997 Torbjorn Granlund <tege@matematik.su.se>
27173 * mpf/integer.c (FUNC_NAME): Fix bogus test for mpf_trunc.
27175 * demos/isprime.c: New file.
27177 Sat Nov 1 19:32:25 1997 Torbjorn Granlund <tege@matematik.su.se>
27179 * mpz/cmp_abs.c: New file.
27180 * mpz/Makefile.in: Compile it.
27181 * make.bat: Likewise.
27182 * gmp.h (mpz_cmp_abs): Declare.
27184 * mpz/cmp_abs_ui.c: New file.
27185 * mpz/Makefile.in: Compile it.
27186 * make.bat: Likewise.
27187 * gmp.h (mpz_cmp_abs_ui): Declare.
27189 Sat Sep 27 04:49:52 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
27191 * mpz/fdiv_r_2exp.c: Get allocation for `tmp' right.
27193 * mpz/fdiv_q_2exp.c: In final result adjustment code, handle
27194 that intermediate result is zero.
27196 * mpz/tests/t-2exp.c: New file.
27197 * mpz/tests/Makefile.in: Handle t-2exp.c.
27199 Fri Sep 26 16:29:21 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
27201 * mpz/divexact.c: Fix typo in test for whether to copy numerator to
27202 quotient and move that statement to after handling quotient and
27203 denominator overlap. Misc cleanups.
27205 * mpn/generic/gcd.c: Change count argument of mpn_lshift/mpn_rshift
27206 calls to `unsigned int'.
27207 * mpz/divexact.c: Likewise.
27209 Mon Sep 22 02:19:52 1997 Torbjorn Granlund <tege@pro.tmg.se>
27211 * mpz/tests/t-powm.c: Decrease `reps' to 2500.
27213 * mpz/tests/t-pow_ui.c: New file.
27214 * mpz/tests/Makefile.in: Handle t-pow_ui.c.
27216 * mpz/ui_pow_ui.c: Get special cases for exponent and base right.
27218 * mpz/pow_ui.c: Increase temp space allocation by 1 limb.
27219 Split `rsize' into two variables; compute space allocation into
27222 Sun Sep 7 04:15:12 1997 Torbjorn Granlund <tege@pro.tmg.se>
27224 * mpn/pa64/lshift.s: New file.
27225 * mpn/pa64/rshift.s: New file.
27226 * mpn/pa64/sub_n.s: New file.
27228 Sat Sep 6 19:14:13 1997 Torbjorn Granlund <tege@gmp.tmg.se>
27230 * mpn/pa64/add_n.s: New file.
27231 * mpn/pa64: New directory.
27233 Tue Aug 19 16:17:09 1997 Torbjorn Granlund <tege@pro.tmg.se>
27235 * mpz/swap.c: New file.
27236 * mpz/Makefile.in: Compile it.
27237 * make.bat: Likewise.
27238 * gmp.h (mpz_swap): Declare.
27240 * mpn/generic/mul_n.c: Push assignment of x and y pointers into the
27241 if/else clauses in several places. (Decreases register pressure.)
27243 Mon Aug 18 03:29:50 1997 Torbjorn Granlund <tege@pro.tmg.se>
27245 * mpn/thumb/add_n.s: New file.
27246 * mpn/thumb/sub_n.s: New file.
27247 * mpn/arm/add_n.s: New file.
27248 * mpn/arm/sub_n.s: New file.
27250 * mpz/powm.c: After mpn_mul_n and mpn_mul calls, adjust product size
27251 if most significant limb is zero.
27252 * mpz/powm_ui.c: Likewise.
27254 Fri Aug 15 02:13:57 1997 Torbjorn Granlund <tege@pro.tmg.se>
27256 * mpn/arm/m/mul_1.s: New file.
27257 * mpn/arm/m/addmul_1.s: New file.
27259 * mpn/powerpc32/mul_1.s: Rewrite.
27261 * mpn/alpha/mul_1.s: Prefix labels with `.'.
27263 Mon Aug 11 02:37:16 1997 Torbjorn Granlund <tege@pro.tmg.se>
27265 * mpn/powerpc32/add_n.s: Rewrite.
27266 * mpn/powerpc32/sub_n.s: Rewrite.
27268 Sun Aug 10 17:07:15 1997 Torbjorn Granlund <tege@pro.tmg.se>
27270 * mpn/powerpc32/addmul_1.s: Delete obsolete comments.
27271 * mpn/powerpc32/submul_1.s: Likewise.
27273 Fri Jul 25 20:07:54 1997 Torbjorn Granlund <tege@pro.tmg.se>
27275 * mpz/addmul_ui.c: New file.
27276 * mpz/Makefile.in: Compile it.
27277 * make.bat: Likewise.
27278 * gmp.h (mpz_addmul_ui): Declare.
27280 * mpz/setbit.c: Add missing code after final `else'.
27282 Tue Jul 22 17:45:01 1997 Torbjorn Granlund <tege@tunnis.tmg.se>
27284 * mpn/sh/add_n.s: Fix typo.
27285 * mpn/sh/sub_n.s: Likewise.
27287 * longlong.h (ns32k count_trailing_zeros): Fix typo.
27289 * insert-dbl.c: Check for exponent overflow and return Inf.
27291 * mpz/get_d.c: Rewrite to avoid rounding errors.
27293 Thu May 29 11:51:07 1997 Torbjorn Granlund <tege@pro.tmg.se>
27295 * mpq/add.c: Swap some usages of tmp1 and tmp2 to make sure
27296 their allocation suffices.
27297 * mpq/sub.c: Likewise.
27299 Wed Apr 16 02:24:25 1997 Torbjorn Granlund <tege@pro.tmg.se>
27301 * demos/pexpr.c: New file.
27303 * mpn/generic/mul_n.c: Misc optimizations from Robert Harley.
27305 * gmp-impl.h (MPZ_PROVOKE_REALLOC): New #define.
27307 Sat Apr 12 17:54:04 1997 Torbjorn Granlund <tege@pro.tmg.se>
27309 * mpz/tstbit.c: New file.
27310 * mpz/Makefile.in: Compile it.
27311 * make.bat: Likewise.
27312 * gmp.h (mpz_tstbit): Declare.
27314 * mpz/tests/logic.c: Use MPZ_CHECK_FORMAT.
27315 * mpz/tests/bit.c: New test.
27316 * mpz/tests/Makefile.in: Handle bit.c.
27318 * mpz/ior.c: In -OP2,+OP1 case, normalize OP2 after call to mpn_sub_1.
27320 * gmp-impl.h (MPZ_CHECK_FORMAT): New #define.
27322 Thu Apr 10 00:30:14 1997 Torbjorn Granlund <tege@tmg.se>
27324 * longlong.h (POWER/PowerPC): Test _ARCH_PWR instead of _IBMR2.
27326 Wed Apr 9 18:23:31 1997 Torbjorn Granlund <tege@pro.tmg.se>
27328 * gmp-impl.h: Move defaulting of UMUL_TIME and UDIV_TIME from here...
27329 * longlong.h: ...to here.
27331 Sun Mar 30 12:16:23 1997 Torbjorn Granlund <tege@matematik.su.se>
27333 * mpn/generic/next_prime.c: New file.
27335 * mpn/generic/perfsqr.c: Remove definitions of PP and PP_INVERTED.
27336 * gmp-impl.h: Put them here.
27338 Fri Mar 28 08:18:05 1997 Torbjorn Granlund <tege@matematik.su.se>
27340 * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Define as inline asm for
27341 for x86, but leave disabled for now.
27343 Fri Feb 28 02:39:47 1997 Torbjorn Granlund <tege@matematik.su.se>
27345 * mpn/Makefile.in (.S.o): Pass SFLAGS and CFLAGS also to compiler
27346 for assembly phase.
27347 (.s.o): Pass SFLAGS.
27349 Wed Feb 26 06:46:08 1997 Torbjorn Granlund <tege@matematik.su.se>
27351 * mpn/configure.in: For Pentium Pro, use default code, not Pentium
27354 * mpn/x86/addmul_1.S: Unroll and optimize for Pentium Pro.
27355 * mpn/x86/submul_1.S: Likewise.
27357 Thu Feb 13 08:26:09 1997 Torbjorn Granlund <tege@matematik.su.se>
27359 * mpf/Makefile.in: Compile floor.o, ceil.o and trunc.o (from
27361 * make.bat: Likewise.
27363 Wed Feb 5 05:58:44 1997 Torbjorn Granlund <tege@matematik.su.se>
27365 * mpn/configure.in (alpha*): Add cntlz to extra_functions.
27367 Wed Feb 4 03:30:45 1997 Torbjorn Granlund <tege@matematik.su.se>
27369 * mpf/integer.c: New file (supporting mpf_floor, mpf_ceil, mpf_trunc).
27371 Mon Feb 3 14:21:36 1997 Torbjorn Granlund <tege@matematik.su.se>
27373 * make.bat: Fix typo, set_dfl_prc => set_dfl_prec.
27375 Sun Feb 2 02:34:33 1997 Torbjorn Granlund <tege@matematik.su.se>
27377 * mpf/out_str.c: After outputting `-', decrement n_digits.
27379 Wed Jan 8 02:50:20 1997 Torbjorn Granlund <tege@quiet.matematik.su.se>
27381 * mpn/generic/divrem.c: qextra_limbs => qxn.
27383 Wed Dec 18 07:50:46 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27385 * mpz/tests/t-tdiv.c (SIZE): Increase to 200.
27387 Tue Dec 17 19:32:48 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27389 * mpn/generic/divrem.c (mpn_divrem_classic): New name for mpn_divrem.
27390 * gmp.h (mpn_divrem): New function.
27391 * mpn/generic/divrem_newton.c: New file.
27392 * mpn/configure.in (functions): Add divrem_newton.
27393 * make.bat: Likewise.
27395 Thu Dec 12 17:55:13 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27397 * gmp.h (_GMP_H_HAVE_FILE): Test also __dj_include_stdio_h_.
27399 Sat Dec 7 09:40:06 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27401 * mpn/alpha/invert-limb.s: New file.
27403 Thu Dec 5 01:25:31 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27405 * mpz/ui_pow_ui.c (mpz_pow2): New (static) function.
27406 (mpz_ui_pow_ui): Rewrite.
27408 * make.bat: `pre_mod_1.c' => `pre_mod_.c'. Fix typo in path to
27411 Fri Nov 15 00:49:55 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27413 * mpz/ui_pow_ui.c: Rewrite for better speed.
27415 Fri Nov 1 16:36:56 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27417 * Makefile.in (recursive make rules): Use `&&' instead of `;' as
27420 Fri Oct 25 17:12:36 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27422 * gmp-impl.h (Cray/uxp MPN_COPY): Really declare as inline.
27424 Thu Oct 24 15:08:19 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27426 * mpn/fujitsu/rshift.c: Fix typo in loop boundaries.
27428 Fri Oct 18 03:13:54 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27430 * mpn/configure.in: Recognize `nextstep' for m68k variants; likewise
27433 * mpn/x86/syntax.h (INSND): New macro.
27434 * mpn/x86/[lr]shift.S: Use INSND.
27435 * mpn/x86/pentium/[lr]shift.S: Likewise.
27436 * mpn/config/t-oldgas (SFLAGS): Pass -DOLD_GAS.
27438 * gmp-impl.h: In code for determining endianness, test also
27439 __BIG_ENDIAN__ and __hppa__. Remove test of __NeXT__.
27441 Wed Oct 16 03:50:34 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27443 * mpf/set_str.c: Let `prec' determine precision used in
27444 exponentiation code; decrease allocation accordingly.
27446 * mpn/vax: Change `jsob*' to `sob*' in all files.
27448 Tue Oct 15 03:54:06 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27450 * longlong.h (m88110 udiv_qrnnd): Change type of intermediate quotient
27451 to DImode (divu.d generates a 64-bit quotient).
27453 * configure.in (m88110*): Fix typo.
27455 * mpf/get_str.c: Compute exp_in_base using `double' to avoid overflow.
27457 * gmp-impl.h (struct bases): Change type of chars_per_bit_exactly from
27459 * mpn/mp_bases.c (__mp_bases): Give 17 digits for chars_per_bit_exactly
27462 * mpf/get_str.c: Let `prec' determine precision used in
27463 exponentiation code; decrease allocation accordingly.
27465 Sun Oct 13 03:31:53 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27467 * longlong.h: Major cleanup.
27468 (__udiv_qrnnd_c): Compute remainders using multiply and subtract,
27469 not explicit `%' operator.
27470 (C umul_ppmm): Get rid of a redundant __ll_lowpart.
27472 * mpz/invert.c: Properly detect all operands that would yield an
27473 undefined inverse; make sure the inverse is always positive.
27475 * mpz/xor.c: New file.
27476 * mpz/Makefile.in: Compile it.
27477 * make.bat: Likewise.
27478 * gmp.h (mpz_xor): Declare.
27480 * mpz/tests/logic.c: Also test mpz_xor.
27482 * mpz/lcm.c: Special case for when either operand equals 0.
27484 Sat Oct 12 01:57:09 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27486 * mpn/generic/gcd.c (find_a): Don't inline on x86.
27488 * Makefile.in (CFLAGS): Default to just `-g'.
27490 * configure.in: Recognize 386 and 486 wherever other x86 cpus are
27492 * configure.in: Use mt-x86 for all x86 cpus.
27493 * config/mt-x86: New file.
27495 * mpn/alpha/cntlz.s: New file.
27497 Tue Oct 8 00:16:18 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27499 * longlong.h: Define smul_ppmm for Fujitsu vpp/uxp.
27500 Rewrite umul_ppmm to actually work on the hardware.
27502 * mpn/x86/sub_n.S: Avoid parens around displacement of `leal'.
27503 * mpn/x86/add_n.S: Likewise.
27505 * mpn/x86/syntax.h (R): Define differently depending on __STDC__.
27507 Mon Oct 7 16:48:08 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27509 * longlong.h: Don't test for __NeXT__ in outer 68k conditional;
27510 add test for __m68k__.
27512 Sun Oct 6 00:59:09 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27514 * gmp.h: Declare mpn_random.
27515 * make.bat: Compile mpn/generic/random.c.
27517 * longlong.h: Define umul_ppmm for Fujitsu vpp/uxp.
27519 * gmp-impl.h: Protect definitions using `__attribute__ ((mode (...)))'
27520 with test also for __GNUC_MINOR__.
27522 * gmp.h: Don't define macros using __builtin_constant_p when using
27525 Fri Oct 4 16:53:50 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27527 * mpz/lcm.c: New file.
27528 * mpz/Makefile.in: Compile it.
27529 * make.bat: Likewise.
27530 * gmp.h (mpz_lcm): Declare.
27532 Wed Sep 25 00:06:21 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27534 * mpq/tests/t-cmp_ui.c: Make sure numerator and denominator of `b' is
27535 within limits of an `unsigned long int'.
27537 * mpz/tests/t-powm_ui.c: Change type of exp2 to `unsigned long int'.
27539 Tue Sep 24 18:58:20 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27541 * mpz/powm_ui.c: Make result always positive.
27543 * urandom.h (urandom): Make it return mp_limb_t.
27545 * gmp-impl.h (CNST_LIMB): New macro.
27546 * mpn/mp_bases.c: Use CNST_LIMB.
27547 * mpn/generic/hamdist.c (popc_limb): Likewise.
27548 * mpn/generic/popcount.c (popc_limb): Likewise.
27549 * mpn/generic/perfsqr.c: Likewise.
27551 Fri Sep 20 03:08:10 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27553 * mpz/pprime_p.c: When n <= 3, don't clear out n before using it.
27555 Wed Sep 18 11:22:45 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27557 * mpn/fujitsu/mul_1.c: New file.
27558 * mpn/fujitsu/addmul_1.c: New file.
27559 * mpn/fujitsu/sub_n.c: New file.
27560 * mpn/fujitsu/add_n.c: Mew file.
27562 Sun Sep 15 03:13:02 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27564 * mpn/generic/random.c: New file.
27565 * mpn/configure.in (functions): Add `random'.
27567 * gmp-impl.h (MPN_COPY): Define as annotated inline function for
27568 Crays and Fujitsu VPPs.
27570 * gmp.h (mp_size_t): Define as `int' for non-MPP Cray.
27571 (mp_exp_t): Likewise.
27573 * configure.in: Add support for Fujitsu VPP machines.
27574 * mpn/configure.in: Likewise.
27575 * config.guess: Likewise.
27576 * config.sub: Likewise.
27578 * mpn/fujitsu/rshift.c: New file.
27579 * mpn/fujitsu/lshift.c: New file.
27580 * mpn/fujitsu: New directory, for Fujitsu VPP machines.
27582 Wed Sep 11 11:34:38 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27584 * mpn/generic/mul_n.c (__gmpn_mul_n): New name for impn_mul_n.
27585 Call __gmpn_mul_basecase, not impn_mul_n_basecase; update parameter
27586 list to work with __gmpn_mul_basecase.
27587 (__gmpn_sqr): New name for impn_sqr_n.
27588 Call __gmpn_sqr_basecase, not impn_sqr_n_basecase; update parameter
27589 list to work with __gmpn_sqr_basecase.
27590 (mpn_mul_n): Update calls to match new names and parameter conventions.
27591 * gmp-impl.h (MPN_MUL_N_RECURSE): Likewise.
27592 (MPN_SQR_RECURSE): New name for MPN_SQR_N_RECURSE.
27593 Update calls to match new names and parameter conventions.
27594 * mpn/generic/mul.c: Never perform multiply explicitly here, call
27595 __gmpn_mul_basecase instead.
27596 Update calls to match new names and parameter conventions.
27598 * mpn/x86/mul_basecase.S: New file.
27599 * mpn/generic/mul_basecase.c: New file.
27600 * mpn/generic/sqr_basecase.c: New file.
27602 Wed Sep 4 02:59:21 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27604 * mpz/set_str.c: Let `0b' and `0B' mean base 2.
27606 Fri Aug 30 00:44:00 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27608 * longlong.h (x86 umul_ppmm): Work around GCC bug that was
27609 triggered by Aug 28 change.
27611 * mpbsd/min.c (digit_value_in_base): New function.
27613 * mpz/set_str.c: Refine allocation size computation, use
27614 chars_per_bit_exactly instead of chars_per_limb.
27616 * mpbsd/Makefile.in (.c.o): Add -D_mpz_realloc=_mp_realloc.
27618 Wed Aug 28 02:52:14 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27620 * longlong.h (x86 umul_ppmm): Don't cast result operands.
27621 (x86 udiv_qrnnd): Likewise.
27622 (default smul_ppmm): Fix typo, umul_ppmm => smul_ppmm.
27623 (default umul_ppmm): New #define using smul_ppmm.
27624 (vax smul_ppmm): New #define.
27625 (vax umul_ppmm): Delete.
27626 (POWER umul_ppmm): Delete.
27627 (IBM 370 smul_ppmm): New #define.
27628 (IBM 370 umul_ppmm): Delete.
27629 (IBM RT/ROMP smul_ppmm): New #define.
27630 (IBM RT/ROMP umul_ppmm): Delete.
27632 Tue Aug 27 01:03:25 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27634 * gmp-impl.h (__gmp_0): Make it `const'.
27636 * mpn/Makefile.in (clean mostlyclean): Comment out recursive clean
27639 * mpn/generic/mul.c: Identify when we do squaring, and call
27640 impn_sqr_n_basecase/impn_sqr_n as appropriate. Use
27641 KARATSUBA_MUL_THRESHOLD and KARATSUBA_SQR_THRESHOLD.
27642 Don't #define KARATSUBA_THRESHOLD.
27644 * mpn/generic/mul_n.c: Don't #define KARATSUBA_THRESHOLD.
27645 (impn_mul_n, impn_sqr_n): Rewrite, based on code contributed by
27647 (impn_sqr_n_basecase): Rewrite.
27649 * gmp-impl.h (KARATSUBA_MUL_THRESHOLD): New #define.
27650 (KARATSUBA_SQR_THRESHOLD): Likewise.
27651 (MPN_SQR_N_RECURSE): Use KARATSUBA_SQR_THRESHOLD.
27652 (MPN_MUL_N_RECURSE): Use KARATSUBA_MUL_THRESHOLD.
27654 * configure.in: Fix typo in last change.
27656 Mon Aug 26 22:25:18 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27658 * mpn/generic/random2.c: Fix typo, `alpha__' => `__alpha'.
27659 * mpf/random2.c: Likewise.
27661 Sun Aug 25 00:07:09 1996 Torbjorn Granlund <tege@quiet.matematik.su.se>
27663 * mpz/tests/t-mul.c: Also test squaring.
27665 Fri Aug 16 05:12:08 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27667 * mp_clz_tab.c (__clz_tab): Declare as `const'.
27668 * version.c (gmp_version): Likewise.
27669 * mpn/generic/sqrtrem.c (even_approx_tab, odd_approx_tab): Likewise.
27671 Thu Aug 15 02:34:47 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27673 * gmp.h: Fix typo, `mips__' => `__mips'.
27675 * mpf/set_str.c: Allow a number to start with a period, if next
27676 position contains a digit.
27678 Tue Aug 13 18:41:25 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27680 * mpz/gcdext.c: Get cofactor sign right for negative input operands.
27681 Clean up code for computing tt.
27683 * mpz/invert.c: Get rid of variable `rv'.
27685 * mpz/divexact.c: Test for zero divisor in special case for zero
27688 Mon Aug 12 18:04:07 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27690 * mpz/?div_*_ui.c: Special case for division by 0.
27691 * mpz/tdiv_q.c: Likewise.
27693 Sat Aug 10 14:45:26 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27695 * mpz/dmincl.c: Special case for division by 0.
27697 * mpz/tdiv_*_ui.c: Delete special case for dividend being 0; handle
27698 it when computing size after mpn_divmod_1 call.
27700 * mp_bpl.c: (__gmp_junk): New variable.
27701 (__gmp_0): New constant.
27703 * gmp-impl.h (DIVIDE_BY_ZERO): New #define.
27705 Fri Aug 9 20:03:27 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27707 * mpz/divexact.c: Test for dividend being zero before testing
27708 for small divisors.
27710 Thu Aug 8 13:20:23 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27712 * configure.in: Require operating system specification for cpus
27713 where assembly syntax differs between system.
27715 * Makefile.in (many targets): Change `-' action prefix to `@'.
27717 * mpn/Makefile.in: (distclean): Fix typo.
27719 * mpq/cmp_ui.c: Rename function to _mpq_cmp_ui.
27720 (mpq_cmp_ui): #undef deleted.
27721 * mpz/cmp_si.c: Rename function to _mpz_cmp_si.
27722 (mpz_cmp_si): #undef deleted.
27723 * mpz/cmp_ui.c: Rename function to _mpz_cmp_ui.
27724 (mpz_cmp_ui): #undef deleted.
27725 * Makefile.in: Corresponding changes.
27727 * mpf/get_prc.c: Return the *highest* precision achievable.
27729 * mpf/get_str.c: Complete rewrite.
27731 * mpf/set_str.c (swapptr): New #define.
27732 (assert): New #define.
27733 * mpf/set_str.c: Set prec to one more than the saved _mp_prec.
27736 * mpz/set_str.c: #include string.h.
27737 * mpf/out_str.c: #include string.h.
27738 * mpbsd/xtom.c: #include string.h and ctype.h.
27739 * mpbsd/mout.c: #include string.h.
27741 Wed Aug 7 11:46:04 EDT 1996 Ken Weber <kweber@mcs.kent.edu>
27743 * mpn/generic/gcd.c: Reorder mpn_gcd argument list.
27744 * mpz/gcd.c: Change call to mpn_gcd.
27745 * gmp.texi: Update manual entry on mpn_gcd.
27746 * mpn/generic/bdivmod.c: Delete limb cache to make mpn_bdivmod
27749 Wed Aug 7 02:15:38 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27751 * mpf/get_str.c: Rewrite code for converting integral part of a
27752 number with both an integral and fractional part.
27754 * mpf/set_str.c: Get rid of variable xxx. New variables madj and radj.
27755 In exp_in_base==0 case, add madj to msize for EXP field.
27757 * mpz/tests/t-gcd.c: Test deleted. Rename t-gcd2.c to t-gcd.c.
27758 Increase reps to 2000.
27759 * mpz/tests/t-gcd2.c: Get rid of mpz_refgcd.
27761 * mpf/set_str.c: Ignore excess limbs in MP,MSIZE.
27763 Thu Jul 25 04:39:10 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27765 * mpn/configure.in: Fix typo in setting path, "sparc" => "sparc32".
27767 Wed Jul 24 02:27:02 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27769 * mpn/generic/gcdext.c: Reorganize and clean up. Get rid of all
27770 signed limb arithmetic.
27772 Mon Jul 22 02:39:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27774 * mpn/generic/gcdext.c (mpn_gcdext): For large enough operands,
27775 work with most significant *two* limbs.
27776 (div2): New function (two variants).
27777 (THRESHOLD): New #define.
27779 * mpz/gcdext.c: Fix typo in MPZ_TMP_INIT call.
27781 * longlong.h (alpha UMUL_TIME): Now 30.
27782 (alpha UDIV_TIME): Now 350.
27783 (x86 UMUL_TIME): Now 10 (let Pentium decide).
27784 (SuperSPARC UDIV_TIME): Override default.
27786 * extract-dbl.c (MP_BASE_AS_DOUBLE): Don't redefine here.
27788 * extract-dbl.c: New name for extract-double.c.
27789 * insert-dbl.c: New name for insert-double.c.
27790 * Makefile.in: Corresponding changes.
27791 * make.bat: Likewise.
27793 * mpz/Makefile.in (.c.o): Don't pass non-portable `-f' to cp.
27794 * mpq/Makefile.in: Likewise.
27795 * mpf/Makefile.in: Likewise.
27797 Sat Jul 20 01:35:18 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27799 * mpz/getlimbn.c: Take ABS of integer->_mp_size.
27801 * mpz/divexact.c: Use mpn_divmod_1 if divisor is a single limb.
27803 Thu Jul 18 00:31:15 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27805 * mpn/generic/popcount.c (popc_limb): Use different masking trick
27806 for first step (due to David Seal).
27807 * mpn/generic/hamdist.c (popc_limb): Likewise.
27809 Wed Jul 17 23:21:48 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27811 * mpn/generic/divrem.c: In MPN_COPY_DECR call, copy dsize - 1 limbs.
27813 Sun Jul 14 17:47:46 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27815 * configure.in: Handle sparc9, sparc64, and ultrasparc like sparc8.
27817 Thu Jul 11 14:05:54 1996 J.T. Conklin <jtc@rtl.cygnus.com>
27819 * longlong.h (mc680x0): Define umul_ppmm, udiv_qrnnd, sdiv_qrnnd
27820 for the '020, '030, '040, and '332. Define count_leading_zeros
27821 for the '020, '030, '040, and '060.
27823 Sun Jul 14 15:24:53 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27826 * mpq/equal.c: Take ABS of num1_size before passing it to mpn_cmp.
27828 Fri Jul 12 17:11:17 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27830 * mpn/generic/sqrtrem.c (SQRT): New asm for x86, but leave it
27833 * mpn/generic/sqrtrem.c: Use MP_BASE_AS_DOUBLE.
27835 Wed Jul 10 03:17:45 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27837 * cre-mparam.c: Delete obsolete file.
27839 * gmp.h: #define _LONG_LONG_LIMB if __mips && _ABIN32.
27840 * longlong.h: Test __mips instead of __mips__.
27842 Sun Jul 7 23:19:13 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27844 * longlong.h (_PROTO): Define, unless already defined.
27845 (alpha __udiv_qrnnd): Declare using _PROTO.
27846 (hppa __udiv_qrnnd): Likewise.
27847 (sparc __udiv_qrnnd): Likewise.
27849 Mon Jul 1 01:44:30 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27851 * config.guess: Update from master version; add Cray x90 handling.
27853 Wed Jun 26 05:35:02 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27855 * mpn/power/add_n.s (__mpn_add_n): Work around GAS bug.
27856 * mpn/power/sub_n.s (__mpn_sub_n): Likewise.
27858 * insert-double.c: Rework loop to avoid potential overflow.
27860 * mpq/get_d.c: For vax, if qsize > N_QLIMBS, ignore excess limbs.
27862 * mpq/tests/t-get_d.c (SIZE): Special case for vax.
27864 * gmp.h (mpX_cmp_ui): #define also when ! __GNUC__.
27866 Mon Jun 24 17:13:21 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27868 * longlong.h (vax sdiv_qrnnd): Fix typo.
27870 Sat Jun 15 01:33:33 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27872 * gmp.h: Support `small' and `large' type and function variants,
27873 controlled by GMP_SMALL.
27875 * mpz/Makefile.in (.c.o): Compile each function twice, for small and
27877 (MPZS_OBJS): New variable.
27878 (libmpz.a): Include MPZS_OBJS in archive.
27879 * mpf/Makefile.in: Analogous changes.
27880 * mpq/Makefile.in: Analogous changes.
27882 * gmp.h: Prefix all functions with __gmp, to allow namespace-clean
27885 * mp.h: Rip out __MP_SMALL__ stuff.
27886 (__mpz_struct): mp_size_t => int.
27888 * mpz/invert.c: #include "gmp-impl.h".
27889 Use MPZ_TMP_INIT, not mpz_init.
27891 * mpz/gcdext.c: Rewrite to call mpn_gcdext.
27893 Fri Jun 14 18:05:29 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27895 * mpn/generic/gcdext.c (s0size): New parameter.
27896 * gmp.h (mpn_gcdext): Update prototype.
27898 * mpn/generic/gcdext.c: Major rewrite.
27900 Mon Jun 10 00:14:27 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27902 * mpn/generic/dump.c: Add missing `else'.
27904 Fri Jun 7 03:35:12 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27906 * Makefile.in (gmp_toc.html): Pass -expandinfo to texi2html.
27908 Thu Jun 6 19:00:53 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27910 * Version 2.0.2 released.
27912 * install.sh: New file.
27913 * Makefile.in (INSTALL): Use install.sh.
27914 (install-normal): New name for target `install'.
27915 (install): New dummy target.
27917 * mpz/pow_ui.c: Swap tests for (e == 0) and (bsize == 0).
27918 * mpz/ui_pow_ui.c: Swap tests for (e == 0) and (blimb == 0).
27920 * config/mt-linux (AR_FLAGS): New file.
27921 * configure.in: Use config/mt-linux for all linux systems.
27923 Tue Jun 4 03:42:18 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27925 * Version 2.0.1 released.
27927 * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
27929 * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
27931 * insert-double.c: Don't #include stdlib.h.
27933 * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
27934 Do not test __sparc__.
27936 * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
27937 * mpq/equal.c: Likewise.
27939 * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
27941 * mpn/generic/gcdext.c: Add K&R declaration syntax.
27942 * stack-alloc.h: Likewise.
27943 * insert-double.c: Likewise.
27944 * extract-double.c: Likewise.
27945 * mpf/tests/reuse.c: Likewise.
27946 * mpz/tests/reuse.c: Likewise.
27947 * mpf/tests/t-sub.c: Likewise.
27948 * mpf/tests/t-add.c: Likewise.
27949 * mpf/tests/t-muldiv.c: Likewise.
27950 * mpf/tests/t-conv.c: Likewise.
27951 * mpf/tests/ref.c: Likewise.
27953 * mpn/config/t-oldgas: Renamed from t-freebsd.
27954 * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
27957 * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
27958 * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
27960 * mpn/config/t-ppc-aix: New file.
27961 * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
27963 Wed May 29 02:07:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27965 * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
27968 * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
27969 * mpf/iset_str.c: Likewise.
27971 Mon May 27 00:15:58 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27973 * gmp-impl.h: Declare __gmp_extract_double.
27975 * mpz/set_q.c: Delete unused variables.
27977 * gmp.h (mpq_equal): Declare.
27979 * mpf/eq.c: mpf_cmp2 -> mpf_eq.
27981 Fri May 24 03:20:44 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
27983 * mpz/iset_d.c: Don't include <math.h>.
27985 * insert-double.c (__gmp_scale2): New name for scal2.
27986 * mpz/get_d.c: Corresponding change.
27987 * mpf/get_d.c: Likewise.
27988 * mpq/get_d.c: Likewise.
27989 * gmp-impl.h: Declare __gmp_scale2.
27991 * mpn/generic/scan0.c: Clarify comment.
27993 * mpz/set_q.c: New file.
27994 * Makefile.in: Compile it.
27995 * make.bat: Likewise.
27996 * gmp.h: Declare mpz_set_q.
27998 * insert-double.c: New file.
27999 * Makefile.in: Compile it.
28000 * make.bat: Likewise.
28002 * mpz/get_d.c: New file.
28003 * mpz/Makefile.in: Compile it.
28004 * make.bat: Likewise.
28005 * gmp.h: Declare mpz_get_d.
28007 * mpf/get_d.c: New file.
28008 * mpf/Makefile.in: Compile it.
28009 * make.bat: Likewise.
28010 * gmp.h: Declare mpf_get_d.
28012 * make.bat: Compile things in alphabetical order.
28014 * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
28015 (LIMBS_PER_DOUBLE): New #define.
28017 * extract-double.c: New file.
28018 * Makefile.in: Compile it.
28019 * make.bat: Likewise.
28020 * mpz/set_d.c: Rewrite to use __gmp_extract_double.
28021 * mpf/set_d.c: Likewise.
28023 * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
28025 Wed May 22 02:48:35 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28027 * gmp-impl.h: Rework code for defining ieee_double_extract.
28028 (IEEE_DOUBLE_BIG_ENDIAN): Macro removed.
28029 (_GMP_IEEE_FLOATS): New macro.
28030 * mpn/vax/gmp-mparam.h: Delete.
28032 * mpn/config/t-pwr-aix: New file.
28033 * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
28035 Mon May 20 16:30:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28037 * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
28039 * mpf/tests/t-add.c (oo): Add some `l' printf modifiers.
28040 * mpf/tests/t-sub.c (oo): Likewise.
28041 * mpf/tests/t-conv.c (oo): Likewise.
28042 * mpf/tests/t-sqrt.c (oo): Likewise.
28044 * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
28046 * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
28048 Fri May 17 02:24:43 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28050 * mpz/set_d.c: Call _mpz_realloc.
28052 * mpq/set_z.c: New file.
28053 * mpq/Makefile.in: Compile it.
28054 * make.bat: Likewise.
28055 * gmp.h: Declare mpq_set_z.
28057 * mp?/Makefile.in (libmp?.a): Depend on Makefile, not Makefile.in.
28058 * mpf/Makefile.in (test): Delete spurious target.
28059 * mpq/Makefile.in (test): Likewise.
28061 * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
28063 * mpn/configure.in: Treat ultrasparc just like sparc v8,
28064 until 64-bit compilers are ready.
28066 * mpf/set_d.c: Make it work for 64-bit machines.
28068 Thu May 16 20:53:57 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28070 * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
28072 * mpn/x86/gmp-mparam.h: Delete file.
28074 * configure.in: Treat microsparc like sparc8.
28076 * urandom.h: Test __alpha instead of __alpha__, since the former
28077 is the standard symbol.
28078 * mpn/generic/random2.c: Likewise.
28079 * mpf/random2.c: Likewise.
28081 Tue May 14 13:42:39 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
28083 * mpz/set_f.c: New file.
28084 * mpz/Makefile.in: Compile it.
28085 * gmp.h: Declare mpz_set_f.
28087 * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
28089 Tue May 14 13:03:07 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
28091 * make.bat: Add all new files.
28093 Sun May 12 22:24:36 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28095 * mpf/set_z.c: New file.
28096 * mpf/Makefile.in: Compile it.
28097 * gmp.h: Declare mpf_set_z.
28099 Sat May 11 19:26:25 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28101 * gmp.h: Declare mpf_set_q.
28103 * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
28105 Fri May 10 17:37:38 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28107 * mpf/set_q.c: New file.
28108 * mpf/Makefile.in: Compile it.
28110 * config.sub: Recognize sparc8.
28112 Wed May 8 09:19:11 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28114 * mpf/tests/t-dm2exp.c: New file.
28116 * mpf/tests/t-add.c: Correct header comment.
28117 * mpf/tests/t-sub.c: Likewise.
28118 * mpf/tests/t-sqrt.c: Likewise.
28120 * mpf/div.c: Misc variable name cleanups.
28121 * mpf/div_ui.c: Base more closely on mpf/div.c.
28122 * mpf/ui_div.c: Likewise.
28124 * mpz/tests/Makefile.in (check): Depend on Makefile.
28125 * mpq/tests/Makefile.in (check): Likewise.
28126 * mpf/tests/Makefile.in (check): Likewise.
28128 * mpf/tests/t-muldiv.c: New file.
28129 * mpf/tests/Makefile.in: Compile and run `t-muldiv'.
28130 (t-ref.o): Delete spurious rule.
28132 * mpf/sqrt.c: Properly detect negative input operand.
28134 * mpf/sqrt_ui.c: Delete spurious header comment.
28135 * mpf/sqrt.c: Likewise.
28136 * mpz/sqrt.c: Likewise.
28138 * mpz/tests/reuse.c (main): Read `reps' from command line.
28140 * mpf/tests/reuse.c: New file.
28141 * mpf/tests/Makefile.in: Compile and run `reuse'.
28143 * mpf/mul_ui.c: Disable code for removing low zero limbs.
28145 * mpf/div.c: Fix condition for when vp and qp overlaps.
28147 * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
28149 * mpf/out_str.c: Don't output '\n' after exponent.
28151 * mpf/add_ui.c: New special case for when U is completely cancelled.
28153 Wed Apr 24 05:33:28 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28155 * Version 2.0 released.
28157 * All files: Update FSF's address.
28159 * Makefile.in (gmp_toc.html): New name for gmp.html.
28160 (TAGS): Depend on force.
28162 * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
28164 Sat Apr 20 03:54:06 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28166 * Makefile.in (ps): New target, depend on gmp.ps.
28168 Fri Apr 19 14:03:15 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28170 * mpf/out_str.c: Print `@' before exponent, not `e'.
28172 * make.bat: Update from Makefiles.
28174 Thu Apr 18 01:22:05 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28176 * mpf/set_str.c: If parameter `base' is negative, expect exponent
28177 to be decimal, otherwise in the same base as the mantissa.
28179 Wed Apr 17 17:28:36 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28181 * mpf/set_dfl_prec.c: Don't return anything.
28182 * gmp.h: Corresponding changes.
28184 * mpf/set_dfl_prec.c: Use `unsigned long int' for bit counts.
28185 * mpf/init2.c: Likewise.
28186 * mpf/get_prc.c: Likewise.
28187 * mpf/set_prc.c: Likewise.
28188 * mpf/set_prc_raw.c: Likewise.
28189 * mpz/popcount.c: Likewise.
28190 * mpz/hamdist.c: Likewise.
28191 * mpz/scan1.c: Likewise.
28192 * mpz/scan0.c: Likewise.
28193 * mpn/generic/popcount.c: Likewise.
28194 * mpn/generic/hamdist.c: Likewise.
28195 * mpn/generic/scan1.c: Likewise.
28196 * mpn/generic/scan0.c: Likewise.
28199 * mpf/eq.c: New file, based on mpf/diff.c.
28200 * mpf/diff.c: Delete.
28201 * mpf/Makefile.in: Corresponding changes.
28204 * mpf/reldiff.c: New file.
28205 * mpf/Makefile.in: Compile it.
28206 * gmp.h: Declare mpf_reldiff.
28208 * mpz/iset_d.c: New file.
28209 * mpz/Makefile.in: Compile it.
28210 * gmp.h: Declare mpz_init_set_d.
28212 Tue Apr 16 16:28:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28214 * Makefile.in (gmp.html): Pass -acc to texi2html.
28216 Mon Apr 15 16:20:24 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28218 * mpf/set_str.c: Switch off code for defaulting the base from the
28219 leading characters.
28221 * gmp.h (mp?_sign): Delete.
28222 (mp?_sgn): New macros.
28224 Fri Apr 12 17:23:33 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28226 * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
28228 Wed Apr 10 22:52:02 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
28230 * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
28231 * gmp.h: Corresponding change.
28233 * gmp.h (mp_bits_per_limb): Make it const.
28235 Sat Mar 30 01:20:23 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28237 * configure.in: Re-enable recognition of with_gcc.
28239 * mpf/Makefile.in (.c.o): Pass XCFLAGS.
28240 * mpn/Makefile.in (.c.o): Likewise.
28241 * mpz/Makefile.in (.c.o): Likewise.
28242 * mpq/Makefile.in (.c.o): Likewise.
28243 * mpbsd/Makefile.in (.c.o): Likewise.
28244 * mpf/tests/Makefile.in (.c.o): Likewise.
28245 * mpz/tests/Makefile.in (.c.o): Likewise.
28246 * mpq/tests/Makefile.in (.c.o): Likewise.
28248 * Makefile.in (XCFLAGS): Default to empty.
28249 (FLAGS_TO_PASS): Pass on XCFLAGS.
28250 (.c.o): Pass XCFLAGS.
28252 * config/mt-m88110 (XCFLAGS): Define instead of CC.
28253 * config/mt-sprc8-gcc (XCFLAGS): Likewise.
28254 * config/mt-supspc-gcc (XCFLAGS): Likewise.
28256 * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
28259 Mon Mar 25 01:07:54 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28261 * urandom.h: Test for __SVR4 in addition to __svr4__.
28263 * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
28265 * Makefile.in (CFLAGS): `-O2' => `-O'.
28266 * mpn/Makefile.in (CFLAGS): Likewise.
28268 * gmp-impl.h: Get rid of obsolete field access macros.
28270 * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
28273 * gmp.h (__MPN): Make it work also for non-ANSI compilers.
28275 Thu Mar 21 01:07:54 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28277 * mpf/sub.c: New special case for ediff <= 1 before generic code.
28278 Simplify generic code for ediff == 0.
28279 Rename uexp => exp.
28281 Mon Mar 11 18:24:57 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28283 * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
28284 * mpf/tests/Makefile.in: Link ref.o to all executables.
28286 * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
28288 Sun Mar 10 21:03:17 1996 Torbjorn Granlund (tege@tiny.matematik.su.se)
28290 * mpf/get_str.c: In digit development loop for fractions, change
28291 loop condition from `<' to `<='.
28293 Thu Mar 7 04:58:11 1996 Torbjorn Granlund <tege@tiny.matematik.su.se>
28295 * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
28297 Wed Mar 6 01:10:42 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28299 * mpf/tests/t-sqrt.c: New file.
28300 * mpf/tests/Makefile.in: Corresponding changes.
28302 * mpf/sqrt.c: Special case for square root of zero.
28304 * mpq/add.c: Clean up variable names.
28305 * mpq/sub.c: Update from mpq/add.c.
28307 * mpz/divexact.c: abs => ABS.
28308 * mpz/gcd.c: Likewise. Rewrite final fixup code, to decrease
28309 allocation. Misc cleanups.
28311 Tue Mar 5 22:24:56 1996 Torbjorn Granlund <tege@matematik.su.se>
28313 * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
28315 * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
28317 * mpn/configure.in: Use t-freebsd also for netbsd.
28319 Mon Mar 4 15:13:28 1996 Torbjorn Granlund <tege@matematik.su.se>
28321 * mpq/Makefile.in (cmp.o): Depend on longlong.h.
28323 * mpq/equal.c: New file.
28324 * mpq/Makefile.in: Corresponding changes.
28326 * mpf/tests/t-add.c: New file.
28327 * mpf/tests/t-sub.c: Renamed from t-addsub.c.
28328 * mpf/tests/ref.c: New file.
28329 * mpf/tests/Makefile.in: Corresponding changes.
28331 * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
28333 Sun Mar 3 07:45:46 1996 Torbjorn Granlund <tege@matematik.su.se>
28335 * mpf/set_str.c: In exponentiation code, allocate 3 extra
28338 * mpf/get_str.c: Allocate sufficient space for tstr.
28339 When calculating exp_in_base, round result down.
28341 * mpf/tests/t-conv.c: New file.
28342 * mpf/tests/Makefile.in: Corresponding changes.
28344 * mp_bpl.c: New file.
28345 * gmp.h: Declare it.
28346 * Makefile.in: Corresponding changes.
28348 Sat Mar 2 06:27:56 1996 Torbjorn Granlund <tege@matematik.su.se>
28350 * mpf/set_prc_raw.c: New file.
28351 * mpf/set_prc.c: Renamed from set_prec.c.
28352 * mpf/get_prc.c: New file.
28353 * mpf/Makefile.in: Corresponding changes.
28354 * gmp.h: Declare new functions.
28356 * mpn/generic/gcdext.c: Add copyright header.
28358 Fri Mar 1 01:22:24 1996 Torbjorn Granlund <tege@matematik.su.se>
28360 * mpn/configure.in: For ppc601, search "power" before "powerpc32".
28362 * mp?/Makefile.in (AR_FLAGS): New variable.
28363 (libmp?.a): Use it.
28365 * make.bat: New file.
28366 * mpn/msdos: New directory.
28367 * mpn/msdos/asm-syntax.h: New file.
28369 * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
28371 * config.sub: Recognize [ctj]90-cray.
28373 * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
28375 * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
28377 * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
28378 undefined behaviour.
28380 Thu Feb 29 04:11:24 1996 Torbjorn Granlund <tege@matematik.su.se>
28382 * Makefile.in (install-info-files): Update for new install-info
28385 * mpn/power/add_n.s: Rewrite.
28386 * mpn/power/sub_n.s: Rewrite.
28388 Wed Feb 28 01:34:30 1996 Torbjorn Granlund <tege@matematik.su.se>
28390 * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
28391 * mpz/ui_pow_ui.c: Likewise.
28393 * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
28395 * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
28396 * mpn/generic/gcd.c: Likewise.
28397 (SIGN_BIT): Compute differently.
28399 Mon Feb 26 00:07:36 1996 Torbjorn Granlund <tege@matematik.su.se>
28401 * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
28403 * Makefile.in (install, install-bsdmp, install-info-files): Depend
28404 on installdirs. chmod all installed files.
28406 Sun Feb 25 01:47:41 1996 Torbjorn Granlund <tege@matematik.su.se>
28408 * mpbsd/configure.in: Delete debugging code.
28410 * All Makefile.in: Update clean targets.
28412 * Makefile.in (AR_FLAGS): New variable.
28413 (libgmp.a): Use it.
28414 (libmp.a): Likewise.
28416 * VERSION: Delete file.
28418 * Makefile.in (installdirs): New target.
28419 * mkinstalldirs: New file (from the texinfo package).
28421 * Makefile.in (INSTALL, INSTALL_DATA, INSTALL_PROGRAM): New variables.
28422 (MAKEINFO, MAKEINFOFLAGS, TEXI2DVI): New variables.
28423 (install-info): New target.
28424 (install, install-bsdmp): Depend on install-info.
28425 ($(srcdir)/gmp.info): Changed from plain gmp.info; put info files
28426 into source directory.
28427 (distclean, mostlyclean): New targets.
28428 (maintainer-clean): New name for realclean.
28429 (uninstall): New target.
28430 (TAGS): New target.
28431 (info, dvi): New targets.
28434 * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
28436 * mp{n,z,f,bsd}/move-if-change: Delete.
28438 * mpbsd/Makefile.in (stamp-stddefh): Delete target.
28440 * Makefile.in (.c.o): Pass CFLAGS last.
28441 * mpbsd/Makefile.in (.c.o): Likewise.
28442 * mpf/Makefile.in (.c.o): Likewise.
28443 * mpq/Makefile.in (.c.o): Likewise.
28444 * mpz/Makefile.in (.c.o): Likewise.
28445 * mpn/Makefile.in (.c.o): Likewise.
28448 * memory.c: Change allocation error message.
28450 * Makefile.in (install): Prefix gmp.h with $(srcdir).
28451 (install-bsdmp): Prefix mp.h with $(srcdir).
28453 * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
28455 * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
28456 (install targets): Install gmp.info-N.
28458 Sat Feb 24 03:36:52 1996 Torbjorn Granlund <tege@matematik.su.se>
28460 * mpf/get_str.c: Fix typo.
28462 * mpz/legendre.c: Clarify expression with extra parens.
28464 * version.c (gmp_version): Not static.
28466 * mpf/iset_str.c: Properly return error code.
28468 * mpf/add.c: Delete unused variables.
28469 * mpf/inp_str.c: Likewise.
28470 * mpq/get_d.c: Likewise.
28472 * mpn/generic/dump.c: #include <stdio.h>.
28473 * mpf/dump.c: Likewise.
28474 * mpf/set_str.c: #include <ctype.h>.
28477 * gmp.h: mpn_sqrt => mpn_sqrtrem.
28479 * Makefile.in (clean, realclean): Clean in mpbsd.
28480 (check): Test in mpf.
28482 * mpf/Makefile.in (clean): Clean in tests.
28483 * mpq/Makefile.in (clean): Clean in tests.
28485 * mpf/tests/Makefile.in: New file.
28486 * mpf/tests/configure.in: New file.
28487 * mpf/tests/t-addsub.c: New file.
28489 * mpf/sub_ui.c: Simply call mpf_sub for now.
28491 * mpf/sub.c: Increase prec by 1.
28492 * mpf/ui_sub.c: Likewise.
28494 Fri Feb 23 00:59:54 1996 Torbjorn Granlund <tege@matematik.su.se>
28496 * mpf/ui_sub.c: Fix typos.
28498 * mpf/get_str.c: When allocating space for tmp, allow for an extra
28499 limb. In code for fraction conversion, add special case for bases
28500 that are a power of 2.
28502 * mpf/out_str.c: Output leading "0.".
28503 Default base to 10, before computing string allocation.
28505 * mpf/get_str.c: Make variables for string size have type size_t.
28506 * gmp.h: Corresponding change.
28508 * mpf/random2.c: Allow creation of prec+1 large mantissas.
28510 * mpf/add_ui.c: Don't abort if u < 0; special case for u <= 0.
28511 Fix typo in MPN_COPY offset.
28512 * mpf/sub_ui.c: Analogous changes.
28514 * mpf/set_prec.c: Rewrite.
28516 * mpf/init2.c: Compute precision as in set_prec.c.
28518 * mpf/div_2exp.c: Special case for u == 0.
28519 * mpf/mul_2exp.c: Likewise. Write r->_mp_size always.
28521 * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
28522 * mpf/sqrt.c: Likewise. When computing new exponent, round quotient
28525 * mpf/add.c: Fix typos.
28526 * mpf/sub.c: Fix typos.
28528 Thu Feb 22 00:24:48 1996 Torbjorn Granlund <tege@matematik.su.se>
28530 * mpz/Makefile.in (stamp-stddefh): Delete target.
28531 (test): Delete target.
28532 * Makefile.in (stamp-stddefh): Delete target.
28533 (cre-stddefh.o): Delete target.
28534 (gmp.dvi): Set TEXINPUTS before invoking tex.
28536 * cre-stddefh.c: Delete.
28538 * mpz/sqrt.c: Fix typo.
28540 * mpz/powm.c: Special case for mod == 0.
28541 * mpz/powm_ui.c: Likewise.
28543 * mpz/get_si.c: Handle -0x80000000 correctly.
28545 * mpz/inp_str.c: Now returns size_t.
28546 Make it return number of bytes read or error indication.
28547 * mpf/inp_str.c: Likewise.
28549 * mpz/out_raw.c: Replace by mpz/out_binary.c, with modifications.
28550 * mpz/inp_raw.c: Rewrite, using mpz/inp_binary as a base.
28551 * mpz/inp_binary.c: Delete.
28553 * mpn/Makefile.in (XCFLAGS): Remove variable.
28554 (.c.o): Don't pass XCFLAGS.
28555 (SFLAGS): Set to nothing.
28556 (.S.o): Pass SFLAGS, not XCFLAGS.
28558 * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
28560 * mpf/out_str.c: Make return number of bytes written or error
28562 * mpz/out_str.c: Likewise.
28563 * gmp.h: Corresponding changes.
28565 * gmp.h (__mpz_struct): mp_size_t => int.
28566 (__mpq_struct): Likewise.
28567 (__mpf_struct): Likewise.
28568 (mp_size_t): int => long int.
28570 * mpn/cray: New directory.
28571 * mpn/cray/gmp-mparam.h: New file.
28572 * mpn/configure.in: Recognize cray variants.
28574 * Makefile.in: Set defaults for prefix, libdir, etc.
28575 (install): New target.
28576 (install-bsdmp): New target.
28577 (gmp.html): New target.
28579 * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
28581 Wed Feb 21 04:35:02 1996 Torbjorn Granlund <tege@matematik.su.se>
28583 * gmp.h: Sort mpn declarations.
28584 (mpn_gcdext): Add declaration.
28586 * mpn/generic/divrem_1.c: New file.
28587 * mpn/Makefile.in (divrem_1.o): New rule.
28588 * configure.in (functions): Add divrem_1.
28590 * mpn/generic/divmod.c: Delete file.
28591 * mpn/configure.in (functions): Delete divmod.
28592 * Makefile.in (divmod.o): Delete rule.
28593 * gmp.h (mpn_divmod): New #define.
28595 * gmp.h (mpn_next_bit_set): Delete spurious declaration.
28597 * mpn/generic/divrem.c (default case): In code assigning
28598 most_significant_q_limb, move reassignment of n0 into if statement.
28600 * gmp.h (mpf_inp_str): Fix typo.
28601 (mpf_out_str): Make prototype match reality.
28602 * mpf/inp_str.c: New file.
28603 * mpf/out_str.c: New file.
28604 * mpf/Makefile.in: Compile new files.
28606 * mpn/Makefile.in (dump.o): Fix dependency path.
28607 (inlines.o): Likewise.
28609 * mpn/configure.in: Make m68060 be the same as m68000. Clean up
28612 Tue Feb 20 01:35:11 1996 Torbjorn Granlund <tege@matematik.su.se>
28614 * mpn/generic/sqrtrem.c: Renamed from sqrt.
28615 * mpn/configure.in (functions): Corresponding change.
28616 * mpn/Makefile.in: Likewise.
28617 * mpz/sqrtrem.c: Likewise.
28618 * mpz/sqrt.c: Likewise.
28619 * mpn/generic/perfsqr.c: Likewise.
28621 * Makefile.in (clean): Also remove libmp.a.
28622 Don't compile cre-conv-tab.c or mp_bases.c.
28623 cre-conv-tab.c: Delete file.
28624 (gmp.ps): New rule.
28626 * mpn/mp_bases.c: New file.
28627 * mpn/Makefile.in: Compile mp_bases.c.
28629 * mpz/set_str.c: Skip initial whitespace.
28630 * mpf/set_str.c: Likewise.
28631 * mpbsd/xtom.c: Likewise.
28633 * gmp.h: Add missing mpz declarations.
28634 Delete all formal parameter names from declarations.
28636 * mpn/Makefile.in: Add dependencies for .c files.
28638 * Makefile.in (check): Write recursive make calls separately, not as
28640 (FLAGS_TO_PASS): New variable. Use it for most recursive makes.
28642 Mon Feb 19 01:02:20 1996 Torbjorn Granlund <tege@matematik.su.se>
28644 * mpn/Makefile.in (.S.o): Pipe cpp output to grep in order to delete
28645 lines starting with #.
28646 (CPP): Set to $(CC) -E to avoid gcc dependency.
28648 * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
28650 * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
28652 * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
28654 * gmp.h: Fix typos in #defines of recently added mpn functions.
28656 * mpz/inp_str.c: Skip all whitespace, not just plain space.
28657 * mpbsd/min.c: Likewise.
28659 * mpn/configure.in (functions): Add gcdext.
28660 * mpn/generic/gcdext.c: New file.
28662 * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
28664 * gmp.h: Surround mpn declarations with extern "C" { ... }.
28666 * Makefile.in (check): New target.
28668 * mpq/get_d.c: Update comments. Use rsize instead of dsize + N_QLIMBS
28669 when possible. Add special case for nsize == 0.
28671 * gmp.h (mpq_get_d): Add declaration.
28672 (mpq_canonicalize): Likewise.
28673 (mpq_cmp_ui): Likewise.
28674 (mpf_diff): Likewise.
28675 (mpf_ui_sub): Likewise.
28676 (mpf_set_prec): Likewise.
28677 (mpf_random2): Likewise.
28679 * gmp.h (mpz_cmp_ui): New #define.
28680 (mpz_cmp_si): New #define.
28681 (mpq_cmp_ui): New #define.
28682 (mpz_sign): New #define.
28683 (mpq_sign): New #define.
28684 (mpf_sign): New #define.
28685 (mpq_numref): New #define.
28686 (mpq_denref): New #define.
28688 * mpq/set_z.c: File deleted.
28689 * mpq/Makefile.in: Corresponding changes.
28691 Sun Feb 18 01:34:47 1996 Torbjorn Granlund <tege@matematik.su.se>
28693 * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
28695 * mpz/inp_binary.c: Default stream to stdin.
28696 * mpz/inp_str.c: Likewise.
28697 * mpz/inp_raw.c: Likewise.
28698 * mpz/out_binary.c: Default stream to stdout.
28699 * mpz/out_raw.c: Likewise.
28700 * mpz/out_str.c: Likewise.
28702 * mpbsd/realloc.c: New file.
28703 * mpbsd/Makefile.in: Corresponding changes.
28705 * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
28706 * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
28708 * mpbsd/mout.c: Rewrite (base on mpz/out_str) but make it output
28709 spaces in each 10th position.
28710 * mpbsd/xtom.c: Rewrite (base on mpz/set_str).
28712 * mpq/tests/Makefile.in (st-cmp): New file.
28713 * mpq/tests/configure.in (srcname): New file.
28715 * mpz/tests/configure.in (srcname): Fix typo.
28717 * mpq/cmp.c: Add check using number of significant bits, to avoid
28718 general multiplication.
28720 Sat Feb 17 11:58:30 1996 Torbjorn Granlund <tege@matematik.su.se>
28722 * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
28724 * mpq/tests: New directory.
28725 * mpq/tests/t-cmp.c: New file.
28726 * mpq/tests/t-cmp_ui.c: New file.
28728 * mpz/tests/dive.c (main): Generate zero numerator.
28729 (get_random_size) : Delete.
28731 * mpz/divexact.c: Add special case for 0/x.
28733 * gmp.h (mpz_mod): Add declaration.
28735 Fri Feb 16 18:18:39 1996 Andreas Schwab <schwab@informatik.uni-dortmund.de>
28737 * mpn/m68k/*: Rewrite code not to use the INSN macros.
28738 (L): New macro to properly prefix local labels for ELF.
28740 Fri Feb 16 00:20:56 1996 Torbjorn Granlund <tege@matematik.su.se>
28742 * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
28744 * mpn/generic/inlines.c (_FORCE_INLINES): New #define. Delete
28745 conditional __GNUC__.
28746 * gmp.h (mpn_add, mpn_sub, mpn_add_1, mpn_sub_1):
28747 Only define these if __GNUC__ || _FORCE_INLINES.
28748 * mpf/random2.c: Add missing parameter in non-ANSI header.
28749 * mpn/generic/gcd.c (SIGN_BIT): Do as #define to work around bug
28751 * mpq/get_d.c: #define N_QLIMBS.
28752 * mpz/divexact.c: Obscure division by 0 to silent compiler warnings.
28753 * stack-alloc.c: Cast void* pointer to char* before doing arithmetic
28756 * Makefile.in (mpbsd/libmpbsd.a): New rule.
28757 * configure.in (configdirs): Add mpbsd.
28759 * gmp.h: Add declarations for a few missing mpn functions.
28761 * Makefile.in (libmp.a): New rule.
28763 * mpbsd/mdiv.c: #include "dmincl.c", not "mpz_dmincl.c"
28764 * gmp.h: Move #define of __GNU_MP__ into the `#if __GNU_MP__' block.
28765 * mp.h: Likewise. Update typedefs from gmp.h.
28766 * mpbsd/configure.in: New file.
28767 * mpbsd/Makefile.in: New file.
28768 * mpbsd/configure: Link to master configure.
28769 * mpbsd/config.sub: Link to master config.sub.
28771 * Makefile.in: Set RANLIB_TEST.
28772 * (libgmp.a): Use it.
28773 * (libgmp.a): Do ranlib before moving the libgmp.a to the build
28775 * mp?/Makefile.in: Don't use or set RANLIB.
28777 Thu Feb 15 16:38:41 1996 Torbjorn Granlund <tege@matematik.su.se>
28779 * mpz/add_ui.c: MP_INT => mpz_t.
28780 * mpz/cmp_ui.c: Likewise.
28781 * mpz/fac_ui.c: Likewise.
28782 * mpz/inp_binary.c: Likewise.
28783 * mpz/inp_raw.c: Likewise.
28784 * mpz/legendre.c: Likewise.
28785 * mpz/jacobi.c: Likewise.
28786 * mpz/out_binary.c: Likewise.
28787 * mpz/out_raw.c: Likewise.
28788 * mpz/random2.c: Likewise.
28789 * mpz/random.c: Likewise.
28790 * mpz/realloc.c: Likewise.
28792 * mpz/legendre.c: __mpz_2factor(X) => mpz_scan1(X,0),
28793 __mpz_odd_less1_2factor => mpz_scan1(X,1).
28794 * mpz/ntsup.c: File deleted.
28795 * mpz/Makefile.in: Corresponding changes.
28797 * mpz/pprime_p: Use mpz_scan1 to avoid looping.
28799 * mpz/fac_ui.c: Type of `k' and `p' is `unsigned long'.
28800 * mpz/pprime_p.c: Pass long to *_ui functions.
28801 * mpz/gcdext.c: Likewise.
28802 * mpz/fdiv_r_2exp.c: Likewise.
28803 * mpz/fac_ui.c: Likewise.
28805 * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
28807 * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
28809 * mpz/cmp_ui.c: #undef mpz_cmp_ui.
28810 * mpz/cmp_si.c: #undef mpz_cmp_si.
28811 * gmp.h (mpz_cmp_ui): New #define.
28812 (mpz_cmp_si): New #define.
28814 Wed Feb 14 22:11:24 1996 Torbjorn Granlund <tege@matematik.su.se>
28816 * gmp.h: Test __cplusplus in addition to __STDC__.
28817 * gmp-impl.h: Likewise.
28819 * gmp.h: Surround declarations with extern "C" { ... }.
28821 Tue Feb 13 15:20:45 1996 Torbjorn Granlund <tege@matematik.su.se>
28823 * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
28824 * mpz/tdiv_r_2exp.c: Likewise.
28826 * mpz/fdiv_r_2exp.c: New file.
28827 * mpz/fdiv_q_2exp.c: New file.
28828 * mpz/tdiv_r_2exp.c: Renamed from mpz/mod_2exp.c.
28829 * mpz/tdiv_q_2exp.c: Renamed from mpz/div_2exp.c
28830 * mpz/Makefile.in: Corresponding changes.
28832 * mpz/scan0.c,scan1.c: New files.
28833 * mpz/Makefile.in: Compile them.
28835 * gmp.h (mpn_normal_size): Delete.
28837 * config.guess: Update from Cygnus version.
28839 * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
28840 * mpn/m68k/lshift.S: Likewise.
28842 * mpn/configure.in: Fix configuration for plain 68000.
28844 Mon Feb 12 01:06:06 1996 Torbjorn Granlund <tege@matematik.su.se>
28846 * mpz/tests/t-powm.c: Generate negative BASE operand.
28848 * mpz/powm.c: Make result always positive.
28850 Sun Feb 11 01:44:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28852 * mpz/tests/*.c: Add t- prefix.
28853 * mpz/tests/Makefile.in: Corresponding changes.
28854 * mpz/tests/configure.in: Update srctrigger.
28856 * mpz/tests/gcd.c: Generate negative operands.
28857 * mpz/tests/gcd2.c: Likewise.
28859 * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
28861 Thu Feb 8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
28863 * mp{z,n}/gcd.c: Change mpn_gcd interface.
28865 * gmp.texi: update documentation.
28867 Mon Feb 7 23:58:43 1996 Andreas Schwab <schwab@informatik.uni-dortmund.de>
28869 * mpn/m68k/{lshift,rshift}.S: New files.
28870 * mpn/m68k/syntax.h: New ELF_SYNTAX macros.
28871 (MEM_INDX, R, PROLOG, EPILOG): New macros.
28872 * mpn/m68k/*.S: Use R macro with register name. Use PROLOG and EPILOG
28873 macros. Rename `size' to `s_size' or s1_size to avoid clash with ELF
28875 * mpn/configure.in: New target m68k-*-linux*.
28877 Wed Feb 7 07:41:31 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28879 * Makefile.in (cre-conv-tab): Workaround for SunOS make.
28881 * mpz/tests/reuse.c: New file.
28882 * mpz/tests/Makefile.in: Handle reuse.c.
28884 Tue Feb 6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
28886 * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
28888 Tue Feb 6 01:36:39 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28890 * gmp.h (mpz_divexact): Delete parameter names.
28891 (mpz_lcm): Delete spurious declaration.
28893 * mpz/dmincl.c: Fix typo.
28895 Mon Feb 5 01:11:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28897 * mpn/generic/gcd.c (gcd_2): Declare consistently.
28899 * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
28900 * mpz/dmincl.c: Likewise.
28902 * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
28903 * mpz/sub.c: Likewise.
28904 * mpn/generic/sqrt.c: Likewise.
28906 * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
28907 destination arrays.
28909 Fri Feb 2 02:21:27 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28911 * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
28912 * mpz/Makefile.in: Compile them.
28914 * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
28916 Thu Feb 1 02:15:11 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28918 Change from Ken Weber:
28919 * mpz/divexact.c: Make it work when quot is identical to either input.
28921 * mpf/ui_sub.c: New file.
28922 * mpf/Makefile.in: Compile it.
28924 * gmp-impl.h (MPZ_TMP_INIT): alloca -> TMP_ALLOC.
28925 * mpz/{c,f}div_{q,qr,r}.c: Use TMP_DECL/TMP_MARK/TMP_FREE since
28926 these use MPZ_TMP_INIT.
28927 * mpz/mod.c: Likewise.
28928 * mpq/{add,sub}.c: Likewise.
28929 * mpq/canonicalize: Likewise.
28931 * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
28932 * mpq/canonicalize.c: Likewise.
28934 Wed Jan 31 01:45:00 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28936 * mpn/generic/gcd.c: Misc changes from Ken.
28938 * mpz/tests/gcd2.c: New file.
28939 * mpz/tests/Makefile.in: Handle gcd2.c.
28941 * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
28942 not orig_vsize. Fix parameter declaration.
28944 * mpz/mod_ui.c: Delete file.
28945 * mpz/Makefile.in: Don't try to compile mod_ui.
28947 * mpz/cdiv_*_ui.c): Make them work right.
28948 * gmp.h: Declare cdiv*.
28950 Tue Jan 30 02:22:56 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28952 * mpz/{cdiv_q.c,cdiv_q_ui.c,cdiv_qr.c,cdiv_qr_ui.c,cdiv_r.c,
28953 cdiv_r_ui.c,cdiv_ui.c}: New files.
28954 * mpz/Makefile.in: Compile them.
28956 * All files: Make file permissions right.
28958 Changes from Ken Weber:
28959 * mpn/generic/accelgcd.c: Delete.
28960 * mpn/generic/bingcd.c: Delete.
28961 * mpn/generic/numbits.c: Delete.
28962 * mpn/generic/gcd.c: New file.
28963 * mpn/configure.in (functions): Update accordingly.
28964 * mpz/divexact.c: New file.
28965 * mpz/Makefile.in: Compile divexact.c.
28966 * mpz/gcd.c: Rewrite to accommodate for gcd changes in mpn.
28967 * gmp.h: declare new functions, delete obsolete declarations.
28968 * mpz/tests/dive.c: New file.
28969 * mpz/tests/Makefile.in: Handle dive.c.
28971 Mon Jan 29 03:53:24 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28973 * mpz/random.c: Handle negative SIZE parameter.
28975 * mpz/tests/tdiv(_ui).c: New name for tst-dm(_ui).c.
28976 * mpz/tests/tst-mdm(_ui).c: Delete.
28977 * mpz/tests/fdiv(_ui).c: New test based in tst-mdm(_ui).
28978 * mpz/tests/*.c: Get rid of tst- prefix for DOS 8+3 naming.
28979 * mpz/tests/Makefile.in: Corresponding changes.
28980 * mpz/tests/configure.in: Update srctrigger.
28982 * mpn/generic/divmod.c: Update from divrem.
28983 * mpn/generic/divrem.c: Misc cleanups.
28985 Sun Jan 28 03:25:08 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
28987 * All files: Use new TMP_ALLOC interface.
28989 * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
28991 * mpz/tests/powm_ui.c: New file.
28992 * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
28994 * Makefile.in: Update dependency list.
28995 * mpf/Makefile.in: Likewise.
28996 * mpz/Makefile.in: Likewise.
28997 * mpq/Makefile.in: Likewise.
28998 * Makefile.in: Set RANLIB simply to ranlib, and allow configure
29001 * mpz/Makefile.in (conf): Delete spurious target.
29002 (mp_bases.c): Delete.
29003 (cre-conv-tab rules): Delete.
29005 * Makefile.in (cre-conv-tab): Greatly simplify.
29007 Sat Jan 27 13:38:15 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29009 * stack-alloc.c: New file.
29010 * stack-alloc.h: New file.
29012 * gmp.h (__gmp_inline): Define using __inline__.
29014 Thu Jan 25 00:28:37 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29016 * mpn/generic/scan0.c: New file.
29017 * mpn/generic/scan1.c: Renamed from next_bit.c.
29018 * mpn/configure.in (functions): Include scan0 and scan1.
29020 * mpn/m68k/*: #include sysdep.h. Use C_GLOBAL_NAME.
29022 * configure: Update from Cygnus version.
29023 * config.guess: Likewise.
29024 * config.sub: Likewise.
29025 * configure: Pass --nfp to recursive configures.
29027 * mpz/tests/tst-*.c: Adjust SIZE and reps.
29029 * mpz/powm.c: Move esize==0 test earlier.
29030 In final reduction of rp,rsize, don't call mpn_divmod unless
29031 reduction is really needed.
29033 * mpz/tests/tst-powm.c: Fix thinko in checking code.
29035 * All files: Get rid of `__' prefix from mpn_* calls and declarations.
29036 * gmp.h: #define __MPN.
29037 * gmp.h: Use __MPN in #defines for mpn calls.
29039 * mpn/generic/mul_n.c: Prepend `i' to internal routines.
29040 * gmp-impl.h: Add #defines using __MPN for those internal routines.
29042 * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
29044 Wed Jan 24 13:28:19 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29046 * mpn/sparc32/udiv_fp.S: New name for udiv_qrnnd.S.
29047 * mpn/sparc32/udiv_nfp.S: New name for v8/udiv_qrnnd.S.
29048 * mpn/sparc32/v8/supersparc: New directory.
29049 * mpn/sparc32/v8/supersparc/udiv.S: New file.
29051 Tue Jan 23 01:10:11 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29053 This major contribution is from Ken Weber:
29054 * mpn/generic/accelgcd.c: New file.
29055 * mpn/generic/bdivmod.c: New file.
29056 * mpn/generic/bingcd.c: New file.
29057 * mpn/generic/gcd_1.c: Rewrite.
29058 * mpn/generic/numbits.c: New file (to go away soon).
29059 * mpz/gcd.c: Rewrite.
29060 * mpz/tests/tst-gcd.c (SIZE): Now 128.
29061 * gmp.h: Declare new functions.
29062 * mpn/configure.in (functions): List new files.
29063 * gmp-impl.h (MPN_SWAP): Delete.
29064 (MPN_LESS_BITS_LIMB, MPN_LESS_BITS, MPN_MORE_BITS): Delete.
29065 (MPN_COMPL_INCR, MPN_COMPL): Delete.
29067 Mon Jan 22 02:04:59 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29069 * gmp.h (mpn_name): New #define.
29071 * mpn/m88k/mc88110/addmul_1.s: New file.
29072 * mpn/m88k/mc88110/add_n.S: New file.
29073 * mpn/m88k/mc88110/sub_n.S: New file.
29075 * mpn/m88k/sub_n.s: Correctly initialize carry.
29077 * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
29079 Sun Jan 21 00:04:35 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29081 * mpn/sparc64/addmul_1.s: New file.
29082 * mpn/sparc64/submul_1.s: New file.
29083 * mpn/sparc64/rshift.s: New file.
29085 Sat Jan 20 00:32:54 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29087 * mpz/iset.c: Fix typo introduced Dec 25.
29089 Wed Jan 17 13:16:44 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29091 * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
29092 * config/mt-sparcv8-gcc: Delete.
29093 * configure.in: Corresponding changes.
29095 Tue Jan 16 16:31:01 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29097 * gmp-impl.h: #include alloca.h when necessary.
29099 * longlong.h: Test __alpha instead of __alpha__, since the former
29100 is the standard symbol.
29102 Mon Jan 15 18:06:57 1996 Torbjorn Granlund <tege@noisy.matematik.su.se>
29104 * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
29105 * mpn/sparc64/lshift.s: New file.
29107 Fri Dec 29 17:34:03 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29109 * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
29110 * mpn/x86/pentium/sub_n.S: Likewise.
29112 Thu Dec 28 03:16:57 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29114 * mpn/x86/pentium/mul_1.S: Rework loop to avoid AGI between update
29115 of loop induction variable and load insn at beginning of loop.
29116 * mpn/x86/pentium/addmul_1.S: Likewise.
29117 * mpn/x86/pentium/submul_1.S: Likewise.
29119 Mon Dec 25 23:22:55 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29121 * All files: Prefix user-visible structure fields with _mp_.
29123 Fri Dec 22 20:42:17 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29125 * mpn/configure.in (m68k configs): Terminate path variable with
29128 Fri Dec 22 03:29:33 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29130 * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
29133 * mpn/configure.in (m68k configs): Update #include path for new
29134 mpn directory organization.
29136 Tue Dec 12 02:53:02 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29138 * gmp.h: Prefix all structure field with _mp_.
29139 * gmp-impl.h: Define access macros for these fields.
29141 Sun Dec 10 00:47:17 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29143 * mpn/alpha/addmul_1.s: Prefix labels with `.'.
29144 * mpn/alpha/submul_1.s: Likewise.
29145 * mpn/alpha/[lr]shift.s: Likewise.
29146 * mpn/alpha/udiv_qrnnd.S: Likewise.
29147 * mpn/alpha/ev5/[lr]shift.s: Likewise.
29149 * mpn/alpha/ev5/lshift.s: Fix typos.
29151 Fri Dec 1 14:28:20 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29153 * mpn/Makefile.in (.SUFFIXES): Define.
29155 Wed Nov 29 23:11:57 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29157 * mpn/sparc64/{add_n.s, sub_n.s}: New files.
29159 Tue Nov 28 06:03:13 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29161 * mpn/x86/syntax.h: Handle ELF_SYNTAX.
29162 Rename GAS_SYNTAX => BSD_SYNTAX.
29164 * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
29166 Mon Nov 27 01:32:12 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29168 * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
29170 Sun Nov 26 04:30:47 1995 Torbjorn Granlund <tege@noisy.matematik.su.se>
29172 * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
29174 * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
29175 * mpn/sparc32/sub_n.S: Likewise.
29177 Fri Nov 17 00:18:46 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29179 * mpn/configure.in: Handle m68k on NextStep.
29181 Thu Nov 16 02:30:26 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29183 * mpn: Reorganize machine-specific directories.
29184 * mpn/configure.in: Corresponding changes.
29185 (sh, sh2): Handle these.
29186 (m68k targets): Create asm-syntax.h.
29188 Thu Nov 9 02:20:50 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29190 * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
29191 (____mpn_mul_n): Likewise.
29193 Tue Nov 7 03:25:12 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29195 * mpf/get_str.c: In exponentiation code (two places), don't swap
29196 input and output areas when calling mpn_mul_1.
29197 * mpf/set_str.c: Likewise.
29199 Fri Nov 3 02:35:58 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29201 * mpf/Makefile.in: Make sure all objects are listed in dependency list;
29202 delete spurious entries.
29204 * mpf/mul.c: Handle U or V being 0. Allow prec+1 for result precision.
29206 * mpf/set_prec.c: New computation of limb precision.
29207 * mpf/set_dfl_prec.c: Likewise.
29209 * mpf/random2.c: Fix typo computing exp.
29210 * mpf/get_str.c: In (uexp > usize) case, set n_limbs as a function of
29211 the user-requested number of digits, n_digits.
29213 Thu Nov 2 16:25:07 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29215 * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
29217 (default case): Put most significant limb from np in new variable n2;
29218 decrease size argument for MPN_COPY_DECR; use n2 instead of np[dsize].
29220 Wed Nov 1 02:59:53 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29222 * mpn/sparc/[lr]shift.S: New files.
29224 Tue Oct 31 00:08:12 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29226 * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
29228 * gmp-impl.h (assert): Delete definition.
29230 * mpf/sub.c: Delete all assert calls. Delete variable `cy'.
29232 * mpf/neg.c: Use prec+1 as precision. Optimize for when arguments
29234 * mpf/abs.c: Likewise.
29235 * mpf/{set,neg,abs}.c: Make structure and variable names similar.
29237 Mon Oct 30 12:45:26 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29239 * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
29240 * mpn/generic/random2.c (random): Likewise.
29242 Sun Oct 29 01:54:28 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29244 * mpf/div.c: Special handle U or V being 0.
29246 * mpf/random2.c: New file.
29248 * longlong.h (i860 rshift_rhlc): Define.
29249 (i960 udiv_qrnnd): Define.
29250 (i960 count_leading_zeros): Define.
29251 (i960 add_ssaaaa): Define.
29252 (i960 sub_ddmmss): Define.
29253 (i960 rshift_rhlc): Define.
29255 Sat Oct 28 19:09:15 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29257 * mpn/pentium/rshift.S: Fix and generalize condition for when to use
29258 special code for shift by 1.
29259 * mpn/pentium/lshift.S: Likewise.
29261 Thu Oct 26 00:02:56 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29263 * gmp.h: #undef __need_size_t.
29264 * mp.h: Update from gmp.h.
29266 Wed Oct 25 00:17:27 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29268 * mpf/Makefile.in: Compile set_prec.c.
29269 * mpf/realloc.c: Delete this file.
29270 * mpf/Makefile.in: Delete mentions of realloc.c.
29272 * gmp.h (__mpf_struct): Get rid of `alloc' field.
29273 * mpf/clear.c: Likewise.
29274 * mpf/init*.c: Likewise.
29275 * mpf/set_prec.c: Likewise.
29276 * mpf/iset*.c: Likewise.
29278 * mpf/iset_str.c: New file.
29280 * mpn/configure.in: Handle pyramid.
29282 * mpf/set.c: Use prec+1 as precision.
29284 * mpf/set_prec.c: New file.
29286 Tue Oct 24 00:56:41 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29288 * mpn/generic/divrem.c: New file. Will replace mpn/generic/divmod.c
29289 when rest of source is converted.
29290 * mpn/configure.in (functions): Add `divrem'
29291 * mpn/generic/set_str.c: Never call __mpn_mul_1 with zero size.
29293 * mpf/get_str.c: Completely rewritten.
29294 * mpf/add.c: Fix several problems.
29295 * mpf/sub.c: Compare operands from most significant end until
29296 first difference, exclude skipped limbs from computation.
29297 Accordingly simplify normalization code.
29298 * mpf/set_str.c: Fix several problems.
29299 * mpf/dump.c: New file.
29300 * mpf/Makefile.in: Compile dump.c.
29301 * mpf/init2.c: Set prec field correctly.
29303 Sun Oct 22 03:02:09 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29305 * cre-conv-tab.c: #include math.h; don't declare log and floor.
29307 Sat Oct 21 23:04:10 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29309 * mpf/mul_ui.c: Handle U being 0.
29311 Wed Oct 18 19:39:27 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29313 * mpn/generic/set_str.c: Correctly handle input like "000000000000".
29316 Tue Oct 17 15:14:13 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29318 * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
29321 Mon Oct 16 19:14:43 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29323 * mpf/add.c: Rewrite.
29324 * mpf/set_str.c: New file. Needs more work.
29326 Sat Oct 14 00:14:04 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29328 * mpf/div_2exp.c: Vastly simplify.
29329 * mpf/mul_2exp.c: Likewise.
29331 * mpf/sub.c: Rewrite.
29333 * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
29335 * mpf/dump.c: Free allocated memory.
29337 * gmp-impl.h (assert): Define.
29339 Wed Oct 11 13:31:00 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29341 * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
29343 Tue Oct 10 00:37:21 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29345 * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
29347 * mpn/powerpc32/{lshift.s,rshift.s}: New files.
29349 * configure.in: Fix typo.
29351 Sat Oct 7 08:17:09 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29353 * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
29355 Wed Oct 4 16:31:28 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29357 * mpn/configure.in: Handle alphaev5.
29358 * mpn/ev4: New name for alpha subdir.
29359 * mpn/ev5: New subdir.
29360 * mpn/ev5/lshift.s: New file.
29362 Tue Oct 3 15:06:45 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29364 * mpn/alpha/mul_1.s: Avoid static increments of pointers; use
29365 corresponding offsets in ldq and stq instructions instead.
29366 (Loop): Swap cmpult and stq to save one cycle on EV5.
29368 * mpn/tests/{add_n.s,sub_n.s,lshift.s,rshift.s,mul_1.s,addmul_1.s,
29369 submul_1.s}: Don't check results if NOCHECK is defined.
29371 Mon Oct 2 11:40:18 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29373 * longlong.h (mips umul_ppmm [32 and 64 bit versions]):
29374 Make new variants, based on GCC version number, that use `l' and `h'
29375 constraints instead of explicit mflo and mfhi instructions
29377 Sun Oct 1 00:17:47 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29379 * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
29380 * mpn/mc88100/sub_n.s: Likewise.
29382 * config/mt-m88110: New file.
29383 * configure.in: Use it.
29385 * mpn/mc88110/mul_1.s: Fix thinko.
29387 Sat Sep 30 21:28:19 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29389 * mpz/set_d.c: Declare `size' at function start.
29391 * experimental: New directory for mpx and mpz2.
29393 * mpz/tdiv_q.c: Clarify comments.
29394 * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
29396 * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
29398 * mpn/sh/{add_n.s,sub_n.s}: New files.
29400 * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
29402 * mpn/i960/{add_n.s,sub_n.s}: New files.
29404 * mpn/alpha/addmul_1.s (Loop): Move decrement of r18 to before umulh,
29405 to save cycles on EV5.
29406 * mpn/alpha/submul_1.s: Ditto.
29407 * mpn/alpha/mul_1.s: Ditto.
29409 Thu Sep 28 02:48:59 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29411 * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
29412 _LONG_LONG_LIMB is defined.
29414 * longlong.h (m88110): Test __m88110__, not __mc88110__
29416 * mpn/mc88110/mul_1.s: Rewrite.
29418 Tue Sep 26 23:29:05 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29420 * config.sub: Update from current Cygnus version.
29422 * mpn/configure.in: Recognize canonical m88*, not mc88*.
29424 Fri Sep 22 14:58:05 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29426 * mpz/set_d.c: New file.
29427 * mpz/Makefile.in: Build new files.
29429 * mpq/get_d.c: Replace usage of scalbn with ldexp.
29431 * mpn/{vax,i386}/gmp-mparam.h: New files.
29432 * gmp-impl.h (ieee_double_extract): Define here.
29433 * mpf/set_d.c (ieee_double_extract): Not here.
29435 Thu Sep 21 00:56:36 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29437 * longlong.h (C umul_ppmm): Use UWtype, not USItype for temps.
29438 (udiv_qrnnd): For cases implemented with call to __udiv_qrnnd,
29439 protect with new symbol LONGLONG_STANDALONE.
29440 (68000 umul_ppmm): Use %# prefix for immediate constants.
29442 Wed Sep 20 15:36:23 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29444 * mpn/generic/divmod_1.c: Handle
29445 divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
29446 specifically also when normalization_steps != 0.
29448 Mon Sep 18 15:42:30 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29450 * mpq/get_d.c: New file.
29452 Sun Sep 17 02:04:36 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29454 * longlong.h (pyr): Botch up for now.
29456 Sat Sep 16 00:11:50 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29458 * mpn/clipper/mul_1.s: New file.
29459 * mpn/clipper/add_n.s: New file.
29460 * mpn/clipper/sub_n.s: New file.
29461 * mpn/configure.in: Handle clipper*-*-*.
29463 * mpn/configure.in: Recognize rs6000-*-*.
29465 Fri Sep 15 00:41:34 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29467 * mpn/alpha/add_n.s: New file.
29468 * mpn/alpha/sub_n.s: New file.
29470 * mpn/mips3: New name for mpn/r4000.
29471 * mpn/mips2: New name for mpn/r3000.
29472 * mpn/configure.in: Corresponding changes.
29474 * mpn/generic/perfsqr.c (primes): Delete.
29475 (residue_map): Delete.
29477 Thu Sep 14 00:07:58 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29479 * mpn/r3000/sub_n.s: Fix typo.
29481 * dm_trunc.c: Delete spurious file.
29483 * mpz/out_binary.c: Fix typo.
29485 * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
29487 * gmp-impl.h: For sparc and sgi, include alloca.h.
29489 * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'. Replace
29490 `ldk r,#0' with `xor r,r'.
29492 Wed Sep 6 00:58:38 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29494 * mpz/inp_binary.c: New file.
29495 * mpz/out_binary.c: New file.
29496 * mpz/Makefile.in: Build new files.
29498 Tue Sep 5 22:53:51 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29500 * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
29503 Sat Sep 2 17:47:59 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29505 * mpn/r4000/{add_n.s,sub_n.s}: Optimize away some pointer arithmetic.
29506 * mpn/r3000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files,
29507 derived from r4000 code.
29509 Fri Sep 1 05:35:52 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29511 * mpn/r3000/mul_1.s: Fix typo.
29513 * mpn/powerpc32: Fix some old vs new mnemonic issues.
29515 * mpn/powerpc32/{add_n.s,sub_n.s}: New files.
29516 * mpn/r4000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files.
29518 Wed Aug 30 10:43:47 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29520 * mpn/r3000/mul_1.s ($LC1): Use addiu for immediate add.
29521 * mpn/r4000/{mul_1.s,addmul_1.s,submul_1.s}: New files.
29523 * config.guess: Update to latest FSF revision.
29525 Mon Aug 28 02:18:13 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29527 * mpz/out_str.c: Cast str to char * in fputs call.
29529 * gmp-impl.h: Define UQItype, SItype, and USItype also
29532 Fri Aug 25 01:45:04 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29534 * mpn/i386/syntax.h: Renamed from asm-syntax.h.
29535 * mpn/mc68020/syntax.h: Renamed from asm-syntax.h.
29536 * mpn/configure.in: Corresponding changes.
29538 Sun Aug 13 19:20:04 1995 Torbjorn Granlund <tege@bozo.matematik.su.se>
29540 * mpn/generic/random2.c: Test __hpux, not hpux.
29542 Sat Apr 15 20:50:33 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29544 * mpn/sparc/add_n.S: Make it work for PIC.
29545 * mpn/sparc/sub_n.s: Likewise.
29546 * mpn/sparc8/addmul_1.S: Likewise.
29547 * mpn/sparc8/mul_1.S: Likewise.
29548 * mpn/i386/add_n.S: Likewise.
29549 * mpn/i386/sub_n.S: Likewise.
29551 Thu Apr 13 23:15:03 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29553 * mpn/configure.in: Don't search power subdir for generic ppc configs.
29554 Add some ppc cpu-specific configs. Misc clean up.
29556 Mon Apr 10 00:16:35 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29558 * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
29560 Sun Apr 9 12:38:11 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29562 * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
29565 * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
29567 Tue Mar 28 00:19:52 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29569 * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
29571 Fri Mar 17 23:29:22 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29573 * longlong.h (SH umul_ppmm): Define.
29575 Thu Mar 16 16:40:44 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29577 * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
29580 Fri Mar 10 20:03:49 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29582 * mpn/powerpc32/mul_1.s: Clear cy before entering loop.
29583 Rearrange loop to save a cycle.
29584 * mpn/powerpc32/addmul_1.s: New file.
29585 * mpn/powerpc32/submul_1.s: New file.
29587 Fri Feb 17 22:44:45 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29589 * mpn/configure.in: Set target_makefile_frag for freebsd
29591 * mpn/config/t-freebsd: New file.
29592 * mpn/Makefile.in: Add #### for frag insertion.
29593 (XCFLAGS): Clear by default.
29594 (.c.o, .S.o rules): Pass XCFLAGS.
29596 Tue Feb 7 16:27:50 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29598 * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
29600 Tue Jan 24 04:23:20 1995 Torbjorn Granlund (tege@tiny.cygnus.com)
29602 * longlong.h (default umul_ppmm): Store input parameters in temporaries
29603 to avoid reading them twice.
29604 (default smul_ppmm): New definition.
29606 Thu Dec 29 04:20:07 1994 Jim Meyering (meyering@comco.com)
29608 * generic/perfsqr.c (__mpn_perfect_square_p): Remove declaration
29609 of unused variable.
29610 * generic/pre_mod_1.c (__mpn_preinv_mod_1): Likewise.
29611 * mpz/powm.c (pow): Likewise.
29613 * mpz/and.c (mpz_and): Use {} instead of `;' for empty else clause
29614 to placate `gcc -Wall'.
29615 * mpz/ior.c (mpz_ior): Likewise.
29617 Wed Dec 28 13:31:40 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29619 * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
29621 Mon Dec 26 17:15:36 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29623 * longlong.h: Test for more symbols, in __mc68000__ case.
29625 * mpn/mpn/config.sub: Recognize m68060.
29626 * mpn/configure.in: Change mc* to m* for 68k targets.
29627 * mpn/Makefile.in (.S.o): Delete spurious creation of temp .c file.
29629 Mon Dec 19 01:56:30 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29631 * config.sub: Recognize pentium as a valid CPU.
29632 * mpn/configure.in: Handle pentium specifically, to use new assembly
29635 Mon Dec 19 00:13:01 1994 Jim Meyering (meyering@comco.com)
29637 * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
29639 * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
29641 Mon Dec 19 00:04:54 1994 Kent Boortz (boortz@sics.se)
29643 * Makefile.in (recursive makes): Pass CFLAGS.
29645 Sun Dec 18 22:34:49 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29647 * mpn/pentium: New directory.
29649 * mpz/pprime.c: Make sure to mpz_clear all temporaries.
29651 * longlong.h: Don't use udiv instruction when SUPERSPARC is defined.
29652 * configure.in: Handle supersparc*-.
29653 * config/mt-supspc-gcc: New file.
29654 * config/mt-sparc8-gcc: New name for mt-sparcv8-gcc.
29656 Mon Dec 12 22:22:10 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29658 * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
29659 #include sysdep.h before asm-syntax.h.
29661 * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
29662 * mpn/i386/asm-syntax.h: Likewise.
29664 * mpn/mc68020/asm-syntax.h: New name for asm.h.
29665 * mpn/i386/asm-syntax.h: New name for asm.h.
29667 Tue Dec 6 21:55:25 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29669 * mpz/array_init.c: Fix typo in declaration.
29671 Fri Nov 18 19:50:52 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29673 * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
29675 Mon Nov 14 00:34:12 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29677 * mpn/generic/random2.c (random): Test for __svr4__.
29679 Wed Oct 12 23:28:16 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29681 * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
29683 Tue Aug 23 17:16:35 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29685 * mpz/perfsqr.c: Use mpn_perfect_square_p.
29686 * mpn/generic/perfsqr.c: New file.
29688 Wed Jul 6 13:46:51 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29690 * mpz/array_init.c: New file.
29691 * mpz/Makefile.in: Compile array_init.
29692 * gmp.h: Declare mpz_array_init.
29694 Mon Jul 4 01:10:03 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29696 * mpz/add.c: Fix bogus comment.
29697 * mpz/sub.c: Likewise.
29699 Sat Jul 2 02:14:56 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29701 * mpn/generic/pre_mod_1.c: New file.
29702 * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
29704 Fri Jul 01 22:10:19 1994 Richard Earnshaw (rwe11@cl.cam.ac.uk)
29706 * longlong.h (arm umul_ppmm): Fix typos in last change. Mark
29707 hard-coded registers with "%|"
29709 Thu Jun 30 03:59:33 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29711 * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
29713 * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
29715 Wed Jun 29 18:45:41 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29717 * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
29719 * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
29721 * gmp.h: Use "defined (__STDC__)" consistently.
29723 Tue Jun 28 18:44:58 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29725 * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
29727 * mpz/tests/Makefile.in: Use CFLAGS for linking.
29729 * Makefile.in (CFLAGS): Use -O2 here.
29730 * mpn/Makefile (CFLAGS): Not here.
29732 * mpq/cmp_ui.c: Fix typo.
29733 * mpq/canonicalize.c: Fix typo.
29734 * mpz/gcd_ui.c: Handle gcd(0,v) and gcd(u,0) correctly.
29735 * mpn/generic/gcd_1.c: Fix braino in last change.
29737 Mon Jun 27 16:10:27 1994 Torbjorn Granlund (tege@rtl.cygnus.com)
29739 * mpz/gcd_ui.c: Change return type and return result.
29740 Allow destination param to be NULL.
29741 * gmp.h: Corresponding change.
29742 * mpn/generic/gcd_1.c: Handle zero return from mpn_mod_1.
29744 Tue Jun 14 02:17:43 1994 Torbjorn Granlund (tege@tiny.cygnus.com)
29746 * mpn/i386/asm.h (ALIGN): Make it take a parameter.
29747 * mpn/i386/*.S: Use ALIGN to align all loops.
29749 * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
29750 (Makes old versions of GAS happy.)
29752 Sat May 28 01:43:54 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29754 * Many files: Delete unused variables and labels.
29755 * mpn/generic/dump.c: cast printf width argument to int.
29757 Wed May 25 00:42:37 1994 Torbjorn Granlund (tege@thepub.cygnus.com)
29759 * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
29760 (xmod): Ignore return value of __mpn_divmod.
29761 (xmod): Improve normalization code.
29763 Sat May 21 01:30:09 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29765 * mpz/gcdext.c: Cosmetic changes.
29767 * mpz/fdiv_ui.c: New file.
29769 Fri May 20 00:24:53 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29771 * mpz/tests/Makefile.in: Use explicit rules for running tests,
29773 (clean): Delete stmp-*.
29775 * mpz/Makefile.in: Update.
29777 * mpz/div_ui.c: Don't include longlong.h.
29778 * mpz/dm_ui.c: Likewise.
29780 * mpz/fdiv_q.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr.c, mpz/fdiv_qr_ui.c,
29781 mpz/fdiv_r.c, mpz/fdiv_r_ui.c: New files. Code partly from deleted
29782 mdm.c, mdm_ui.c, etc, partly rewritten.
29783 * mpz/dm_floor_ui.c, mpz/dm_floor.c: Delete.
29784 * mpz/mdm.c, mpz/mdm_ui.c, mpz/mdiv.c, mpz/mdiv_ui.c, mpz/mmod.c,
29785 mpz/mmod_ui.c: Delete.
29787 * mpz/tdiv_q.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr.c, mpz/tdiv_qr_ui.c,
29788 mpz/tdiv_r.c, mpz/tdiv_r_ui.c:
29789 New names for files implementing truncating division.
29790 * mpz/div_ui.c, mpz/dm_ui.c, mpz/mod_ui.c: Simplify.
29792 * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
29794 (clean): Delete tmp-*.
29796 Thu May 19 01:37:44 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29798 * mpz/cmp.c: Call __mpn_cmp.
29800 * mpz/popcount.c: Fix typo.
29802 * mpz/powm_ui.c: Simplify main loop. Keep principal operand size
29803 smaller than MSIZE when possible.
29804 * mpz/powm.c: Likewise.
29806 * mpn/generic/sqrt.c: Move alloca calls into where the memory is
29809 * gmp.h: (_PROTO): New macro.
29810 Add many function declarations; use _PROTO macro in all declarations.
29812 * mpf/*.c: Prepend mpn calls with __.
29814 Wed May 18 20:57:06 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29816 * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
29819 * mpf/div_ui.c: Simplify.
29821 Tue May 17 01:05:14 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29823 * mpz/*.c: Prepend mpn calls with __.
29825 * mpz/mul_ui.c: Use mpn_mul_1.
29827 Mon May 16 17:19:41 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29829 * mpn/i386/mul_1.S: Use C_GLOBAL_NAME.
29830 * mpn/i386/mul_1.S, mpn/i386/addmul_1.S, mpn/i386/submul_1.S:
29833 Sat May 14 14:21:02 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29835 * gmp-impl.h: Don't define abort here.
29837 * mpz/pow_ui.c: Increase temporary allocation.
29838 * mpz/ui_pow_ui.c: Likewise.
29840 * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
29842 * All Makefile.in: Delete spurious -I arguments.
29843 Update dependencies.
29845 * mpz/popcount.c: New file.
29846 * mpz/hamdist.c: New file.
29848 * All configure: Latest version from Cygnus.
29850 * mpq/Makefile.in: New file.
29851 * mpq/configure.in: New file.
29852 * Makefile.in, configure.in: Enable compilation of mpq.
29854 * mpq/set_z.c: Fix typos.
29855 * mpq/canonicalize.c: Fix typos.
29856 * mpq/cmp_ui.c: Fix typos.
29858 * mpf/add_ui.c: Read U->D into UP always. Delete spurious MPN_COPY.
29859 * mpf/sub_ui.c: Likewise.
29861 * gmp-impl.h: Don't redefine alloca.
29863 * COPYING.LIB: Renamed from COPYING.
29865 Wed May 11 01:45:44 1994 Torbjorn Granlund (tege@adder.cygnus.com)
29867 * mpz/powm_ui.c: When shifting E left by C+1, handle out-of-range
29868 shift counts. Fix typo when testing negative_result.
29869 * mpz/powm.c: Likewise.
29871 * mpz/ui_pow_ui.c: New file.
29872 * mpz/Makefile.in: Update.
29874 * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
29876 * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
29877 * mpz/gcd.c: Declare mpn_xmod.
29879 * mpz/powm.c: Major changes to accommodate changed mpn semantics.
29880 * mpz/powm_ui.c: Update from mpz/powm.c.
29882 * mpz/tests/tst-io.c: New file.
29883 * mpz/tests/tst-logic: New file.
29884 * mpz/tests/Makefile.in: Update.
29886 * mpz/inp_str.c: Get base right when checking for first digit.
29887 * mpz/inp_str.c: Allocate more space for DEST when needed.
29889 * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
29890 * mpz/and.c, mpz/ior.c: Likewise. Simplify somewhat.
29892 * mpz/add_ui.c: Use mpn_add_1 and mpn_sub_1.
29893 Rename parameters to be consistent with mpz/sub_ui.
29894 General simplifications.
29895 * mpz/sub_ui.x: Likewise.
29897 Tue Aug 10 19:41:16 1993 Torbjorn Granlund (tege@prudens.matematik.su.se)
29899 * mpf: New directory.
29900 * mpf/*.c: Merge basic set of mpf functions.
29902 * Many logs missing...
29904 Sun Apr 25 18:40:26 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
29906 * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
29907 * bsd/xtom.c: Likewise.
29909 * mpz/div.c: Remove free_me and free_me_size and their usage.
29910 Use mpn_divmod for division; corresponding changes in return value
29912 * mpz/powm.c: `carry_digit' => `carry_limb'.
29913 * bsd/sdiv.c: Clearify comment.
29915 Sun Apr 25 00:31:28 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
29917 * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
29919 Sat Apr 24 16:23:33 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
29921 * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
29923 * gmp-impl.h: #define ABS.
29924 * (Many files): Use ABS instead of abs.
29926 * mpn/generic/sqrt.c, mpz/clrbit.c, mpz/get_si.c, mpz/mod_2exp.c,
29927 mpz/pow_ui.c: Cast 1 to mp_limb before shifting.
29929 * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
29930 non-32-bit machines.
29932 Tue Apr 20 13:13:58 1993 Torbjorn Granlund (tege@du.nada.kth.se)
29934 * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
29935 rounding them down to fit.
29937 * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
29939 * mpz/inp_str.c (char_ok_for_base): New function.
29940 (mpz_inp_str): Use it.
29942 Sun Mar 28 21:54:06 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
29944 * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
29946 Mon Mar 15 11:44:06 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
29948 * mpz/pprime.c: Declare param `const'.
29949 * gmp.h: Add declarations for mpz_com.
29951 Thu Feb 18 14:10:34 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
29953 * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
29955 Fri Feb 12 20:27:34 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
29957 * mpz/inp_str.c: Recog minus sign as first character.
29959 Wed Feb 3 01:36:02 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
29961 * mpz/iset.c: Handle 0 size.
29963 Tue Feb 2 13:03:33 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
29965 * mpz/mod_ui.c: Initialize dividend_size before it's used.
29967 Mon Jan 4 09:11:15 1993 Torbjorn Granlund (tege@sics.se)
29969 * bsd/itom.c: Declare param explicitly 'signed'.
29970 * bsd/sdiv.c: Likewise.
29972 * mpq/cmp.c: Remove unused variable tmp_size.
29973 * mpz/powm_ui.c: Fix typo in esize==0 if stmt.
29974 * mpz/powm.c: Likewise.
29976 Sun Nov 29 01:16:11 1992 Torbjorn Granlund (tege@sics.se)
29978 * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
29979 divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
29982 * Reorganize sources. New directories mpn, mpn/MACH, mpn/generic,
29983 mpz, mpq, bsd. Use full file name for change logs hereafter.
29985 Wed Oct 28 17:40:04 1992 Torbjorn Granlund (tege@jupiter.sics.se)
29987 * longlong.h (__hppa umul_ppmm): Fix typos.
29988 (__hppa sub_ddmmss): Swap input arguments.
29990 * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
29993 Sun Oct 25 20:30:06 1992 Torbjorn Granlund (tege@jupiter.sics.se)
29995 * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
29996 specifically (used to consider all negative numbers prime).
29998 * mpz_powm_ui: `carry_digit' => `carry_limb'.
30000 * sdiv: Handle zero dividend specifically. Replace most code in
30001 this function with a call to mpn_divmod_1.
30003 Fri Sep 11 22:15:55 1992 Torbjorn Granlund (tege@tarrega.sics.se)
30005 * mpq_clear: Don't free the MP_RAT!
30007 * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
30009 Thu Sep 3 01:47:07 1992 Torbjorn Granlund (tege@jupiter.sics.se)
30011 * All files: Remove leading _ from mpn function names.
30013 Wed Sep 2 22:21:16 1992 Torbjorn Granlund (tege@jupiter.sics.se)
30015 Fix from Jan-Hein Buhrman:
30016 * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
30018 * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
30021 Sun Aug 30 18:37:15 1992 Torbjorn Granlund (tege@jupiter.sics.se)
30023 * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
30024 * _mpz_get_str: Don't remove leading zeros. Abort if there are some.
30026 Wed Mar 4 17:56:56 1992 Torbjorn Granlund (tege@zevs.sics.se)
30028 * gmp.h: Change definition of MP_INT to make the & before params
30029 optional. Use typedef to define it.
30030 * mp.h: Use typedef to define MINT.
30032 Tue Feb 18 14:38:39 1992 Torbjorn Granlund (tege@zevs.sics.se)
30034 longlong.h (hppa umul_ppmm): Add missing semicolon. Declare type
30037 Fri Feb 14 21:33:21 1992 Torbjorn Granlund (tege@zevs.sics.se)
30039 * longlong.h: Make default count_leading_zeros work for machines >
30040 32 bits. Prepend `__' before local variables to avoid conflicts
30041 with users' variables.
30043 * mpn_dm_1.c: Remove udiv_qrnnd_preinv ...
30044 * gmp-impl.h: ... and put it here.
30045 * mpn_mod_1: Use udiv_qrnnd_preinv if it is faster than udiv_qrnnd.
30047 Tue Feb 11 17:20:12 1992 Torbjorn Granlund (tege@zevs.sics.se)
30049 * mpn_mul: Enhance base case by handling small multiplicands.
30050 * mpn_dm_1.c: Revert last change.
30052 Mon Feb 10 11:55:15 1992 Torbjorn Granlund (tege@zevs.sics.se)
30054 * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
30056 Fri Feb 7 16:26:16 1992 Torbjorn Granlund (tege@zevs.sics.se)
30058 * mpn_mul: Replace code for base case.
30060 Thu Feb 6 15:10:42 1992 Torbjorn Granlund (tege@zevs.sics.se)
30062 * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
30063 pre-inverting divisor.
30065 Sun Feb 2 11:10:25 1992 Torbjorn Granlund (tege@zevs.sics.se)
30067 * longlong.h: Make __LLDEBUG__ work differently.
30068 (_IBMR2): Reinsert old code.
30070 Sat Feb 1 16:43:00 1992 Torbjorn Granlund (tege@zevs.sics.se)
30072 * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
30073 using floating point operations. Don't define
30074 UDIV_NEEDS_NORMALIZATION any longer.
30076 Fri Jan 31 15:09:13 1992 Torbjorn Granlund (tege@zevs.sics.se)
30078 * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
30079 * longlong.h (#ifdef __hppa): Define umul_ppmm.
30081 Wed Jan 29 16:41:36 1992 Torbjorn Granlund (tege@zevs.sics.se)
30083 * mpn_cmp: Only one length parameter, assume operand lengths are
30084 the same. Don't require normalization.
30085 * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
30086 new mpn_cmp definition.
30088 Tue Jan 28 11:18:55 1992 Torbjorn Granlund (tege@zevs.sics.se)
30090 * _mpz_get_str: Fix typo in comment.
30092 Mon Jan 27 09:44:16 1992 Torbjorn Granlund (tege@zevs.sics.se)
30094 * Makefile.in: Add new files.
30096 * mpn_dm_1.c: New file with function _mpn_divmod_1.
30097 * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
30098 * mpz_div_ui: Likewise.
30100 * mpn_mod_1.c: New file with function _mpn_mod_1.
30101 * mpz_mod_ui: Use _mpn_mod_1.
30103 Thu Jan 23 18:54:09 1992 Torbjorn Granlund (tege@zevs.sics.se)
30105 Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
30106 * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
30107 Handle dividend == 0.
30109 Wed Jan 22 12:02:26 1992 Torbjorn Granlund (tege@zevs.sics.se)
30111 * mpz_pprime.c: Use "" for #include.
30113 Sun Jan 19 13:36:55 1992 Torbjorn Granlund (tege@zevs.sics.se)
30115 * mpn_rshiftci.c (header): Correct comment.
30117 Wed Jan 15 18:56:04 1992 Torbjorn Granlund (tege@zevs.sics.se)
30119 * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
30120 to make space for ignored quotient at the end. (The quotient might
30121 always be an extra limb.)
30123 Tue Jan 14 21:28:48 1992 Torbjorn Granlund (tege@zevs.sics.se)
30125 * mpz_powm_ui: Fix comment.
30126 * mpz_powm: Likewise.
30128 Mon Jan 13 18:16:25 1992 Torbjorn Granlund (tege@zevs.sics.se)
30130 * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
30132 Sun Jan 12 13:54:28 1992 Torbjorn Granlund (tege@zevs.sics.se)
30134 Fixes from Kazumaro Aoki:
30135 * mpz_out_raw: Take abs of size to handle negative values.
30136 * mpz_inp_raw: Reallocate before reading ptr from X.
30137 * mpz_inp_raw: Store, don't read, size to x->size.
30139 Tue Jan 7 17:50:25 1992 Torbjorn Granlund (tege@zevs.sics.se)
30141 * gmp.h, mp.h: Remove parameter names from prototypes.
30143 Sun Dec 15 00:09:36 1991 Torbjorn Granlund (tege@zevs.sics.se)
30145 * tests/Makefile.in: Prepend "./" to file names when executing
30148 * Makefile.in: Fix many problems.
30150 Sat Dec 14 01:00:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
30152 * mpn_sqrt.c: New file with _mpn_sqrt.
30153 * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
30154 * msqrt.c: Delete. Create from mpz_sqrtrem.c in Makefile.in.
30155 * mpz_do_sqrt.c: Delete.
30156 * Makefile.in: Update to reflect these changes.
30158 * Makefile.in, configure, configure.subr: New files
30159 (from bothner@cygnus.com).
30160 * dist-Makefile: Delete.
30162 * mpz_fac_ui: Fix comment.
30164 * mpz_random2: Rewrite a bit to make it possible for the most
30165 significant limb to be == 1.
30167 * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
30169 Fri Dec 13 23:10:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
30171 * mpz_do_sqrt: Simplify special case for U == 0.
30172 * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
30173 Rename _mpz_impl_sqrt to _mpz_do_sqrt.
30175 Fri Dec 13 12:52:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
30177 * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
30179 Thu Dec 12 22:17:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
30181 * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
30182 variables to mp_size.
30184 Wed Dec 11 22:00:34 1991 Torbjorn Granlund (tege@zevs.sics.se)
30186 * mpn_rshift.c: Fix header comments.
30188 Mon Dec 9 17:46:10 1991 Torbjorn Granlund (tege@zevs.sics.se)
30192 * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
30194 * dist-Makefile: Add missing dependency for cre-mparam.
30196 * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
30197 mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
30199 * dist-Makefile (clean): clean in tests subdir too.
30200 * tests/Makefile: Define default values for ROOT and SUB.
30202 * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
30205 Mon Nov 11 00:06:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
30207 * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
30209 Sat Nov 9 23:47:38 1991 Torbjorn Granlund (tege@zevs.sics.se)
30213 * dist-Makefile, Makefile, tests/Makefile: Merge tests into
30216 Fri Nov 8 22:57:19 1991 Torbjorn Granlund (tege@zevs.sics.se)
30218 * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
30220 Thu Nov 7 22:06:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
30222 * longlong.h: Cosmetic changes to keep it identical to gcc2 version
30224 * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
30227 Mon Nov 4 00:36:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
30229 * mpn_mul: Fix indentation.
30231 * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
30233 * mpz_do_sqrt: Handle overflow in conversion from double returned
30234 by SQRT to mp_limb.
30236 * gmp.h: Add missing function definitions.
30238 Sun Nov 3 18:25:25 1991 Torbjorn Granlund (tege@zevs.sics.se)
30240 * mpz_pow_ui: Change type of `i' to int.
30242 * ChangeLog: Add change log entry.
30243 * ChangeLog: Add change log entry.
30244 * ChangeLog: Add change log entry.
30245 * ChangeLog: Add change log entry.
30246 * ChangeLog: Add change log entry.
30247 * ChangeLog: Add change log entry.
30248 * ChangeLog: Add change log entry.
30249 * ChangeLog: Add change log entry.
30252 * mpz_pow_ui.c: Fix typo in comment.
30254 * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
30255 * mpz_powm_ui.c: Add code for rpow.
30256 * rpow.c: Delete this file. The rpow function is now implemented
30259 * mpz_fac_ui.c: New file.
30260 * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
30262 Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
30263 * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
30264 the first argument not smaller than the second.
30266 Tue Oct 29 13:56:55 1991 Torbjorn Granlund (tege@zevs.sics.se)
30268 * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
30271 Mon Oct 28 00:35:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
30273 * mpz_random2: Handle size == 0.
30275 * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
30276 chars_per_bit_exactly, and change its definition.
30277 * cre-conv-tab.c (main): Output field according to its new
30279 * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
30280 Use chars_per_bit_exactly.
30282 * mpz_random2: Change the loop termination condition in order to
30283 get a large most significant limb with higher probability.
30285 * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
30286 * mpz_get_si.c: New file.
30287 * dist-Makefile: Add mpz_random2 and mpz_get_si.
30289 * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
30290 power of 2, giving exact result.
30292 * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
30293 * mpn_mul: New macro KARATSUBA_THRESHOLD.
30294 * mpn_mul (karatsuba's algorithm): Don't write intermediate results
30295 to prodp, use temporary pp instead. (Intermediate results can be
30296 larger than the final result, possibly writing into hyperspace.)
30297 * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
30298 shortcut algorithm.
30299 * mpn_mul: Fix typo, cy instead of xcy. Unify carry handling code.
30301 Sun Oct 27 19:57:32 1991 Torbjorn Granlund (tege@zevs.sics.se)
30303 * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
30304 when usize > 1.5 vsize.
30306 * mpn_mul: Break between classical and Karatsuba's algorithm at
30307 KARATSUBA_THRESHOLD, if defined. Default to 8.
30309 * mpn_div: Kludge to fix stray memory read.
30311 Sat Oct 26 20:06:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
30313 * mpz_gcdext: Handle a = b = 0. Remove memory leakage by calling
30314 mpz_clear for all temporary variables.
30316 * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
30317 function's argument constraints. Compute wsize correctly.
30319 * mpz_gcd: Fix typo in comment.
30321 * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
30322 abort if allocation fails, don't just exit.
30324 Fri Oct 25 22:17:20 1991 Torbjorn Granlund (tege@zevs.sics.se)
30326 * mpz_random2.c: New file.
30328 Thu Oct 17 18:06:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
30330 Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
30331 * mpq_cmp: Take sign into account, don't just compare the
30333 * mpq_cmp: Call _mpn_mul in the right way, with the first argument
30334 not smaller than the second.
30336 Wed Oct 16 19:27:32 1991 Torbjorn Granlund (tege@zevs.sics.se)
30338 * mpz_random: Ensure the result is normalized.
30340 Tue Oct 15 14:55:13 1991 Torbjorn Granlund (tege@zevs.sics.se)
30342 * mpz_clrbit: Support non-ANSI compilers.
30344 Wed Oct 9 18:03:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
30346 * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
30348 Tue Oct 8 17:42:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
30350 * mpz_mdm_ui: Add comments.
30352 * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
30353 * mpz_init_ui: Change spacing and header comment.
30355 Thu Oct 3 18:36:13 1991 Torbjorn Granlund (tege@zevs.sics.se)
30357 * dist-Makefile: Prepend `./' before some filenames.
30359 Sun Sep 29 14:02:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
30361 Released 1.1 (public).
30363 * mpz_com: New name of mpz_not.
30364 * dist-Makefile: Change mpz_not to mpz_com.
30366 Tue Sep 24 12:44:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
30368 * longlong.h: Fix header comment.
30370 Mon Sep 9 15:16:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
30374 * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
30377 * longlong.h (m68000 umul_ppmm): Clobber one register less by
30378 slightly rearranging the code.
30380 Sun Sep 1 18:53:25 1991 Torbjorn Granlund (tege@zevs.sics.se)
30382 * dist-Makefile (stamp-stddefh): Fix typo.
30384 Sat Aug 31 20:41:31 1991 Torbjorn Granlund (tege@zevs.sics.se)
30388 * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
30389 mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
30390 * gmp.h, gmp.texi: Define the new functions.
30392 Fri Aug 30 08:32:56 1991 Torbjorn Granlund (tege@zevs.sics.se)
30394 * mpz_gcdext: Compute t argument from the other quantities at the
30395 end, of the function, not in the loop. New feature: Allow t to be
30398 * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
30399 include "mp.h". Use type name `MP_INT' always.
30401 * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
30403 Wed Aug 28 00:45:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
30405 * dist-Makefile (documentation): Go via tmp.texi to avoid the
30406 creation of gmp.dvi if any errors occur. Make tex read input
30409 Fri Aug 23 15:58:52 1991 Torbjorn Granlund (tege@zevs.sics.se)
30411 * longlong.h (68020, i386): Don't define machine-dependent
30412 __umulsidi3 (so the default definition is used).
30413 * longlong.h (all machines): Cast all operands, sources and
30414 destinations, to `unsigned long int'.
30415 * longlong.h: Add gmicro support.
30417 Thu Aug 22 00:28:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
30419 * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
30420 * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
30421 * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
30422 * _mpz_get_str.c: Add code to do division by big_base using only
30423 umul_qrnnd, if that is faster. Use UMUL_TIME and UDIV_TIME to
30424 decide which variant to use.
30426 Wed Aug 21 15:45:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
30428 * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
30429 nops. (Saves two insn.)
30431 * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
30432 branch, and to permit input/output register overlap.
30434 * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
30435 * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
30436 asm statements (gives better code if either the upper or lower
30437 part of the product is unused.
30439 Tue Aug 20 17:57:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
30441 * _mpz_get_str.c (outside of functions): Remove
30442 num_to_ascii_lower_case and num_to_ascii_upper_case. Use string
30443 constants in the function instead.
30445 Mon Aug 19 00:37:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
30447 * cre-conv-tab.c (main): Output table in hex. Output 4 fields, not
30448 3, for components 0 and 1.
30450 * gmp.h: Add declaration of mpq_neg.
30452 Released 1.0beta.13.
30454 * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
30455 comparing to enum literals SPC and EOF. This makes the code work
30456 for compilers where `char' is unsigned. (Bug found by Brian
30459 Released 1.0beta.12.
30461 * mpz_mod_ui: Remove references to quot. Remove quot_ptr, quot_size
30462 declarations and assignment code.
30464 Sun Aug 18 14:44:26 1991 Torbjorn Granlund (tege@zevs.sics.se)
30466 * mpz_mod_ui: Handle dividend < 0.
30468 Released 1.0beta.11.
30470 * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
30471 general structure, variable names, etc.
30473 * sdiv: Un-normalize the remainder in n1 before it is negated.
30475 * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
30478 * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
30479 the quotient size if the dividend size is incremented. (Bug found
30482 * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
30483 (Bug found by Brian Beuning.)
30485 * mpz_mod_ui: Replace "digit" by "limb".
30487 * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
30488 for non-32-bit machines (PP is hardwired for such machines).
30489 * mpz_perfsqr.c (outside of functions): Define PP value with an L.
30491 * mpn_mul.c (_mpn_mul): Add verification code that is activated if
30492 DEBUG is defined. Replace "digit" by "limb".
30493 * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
30494 after the addition.
30495 * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
30496 and v0_size, and according to the result, swap arguments in
30497 recursive call. (Don't violate mpn_mul's own argument
30500 Fri Aug 16 13:47:12 1991 Torbjorn Granlund (tege@zevs.sics.se)
30502 Released 1.0beta.10.
30504 * longlong.h (IBMR2): Add udiv_qrnnd.
30506 * mpz_perfsqr: Remove unused variables.
30508 * mpz_and (case for different signs): Initialize loop variable i!
30510 * dist-Makefile: Update automatically generated dependencies.
30511 * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
30512 etc to dependency file lists.
30514 * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
30515 `unsigned long int'.
30516 * longlong.h: Add `int' after `unsigned' and `long' everywhere.
30518 Wed Aug 14 18:06:48 1991 Torbjorn Granlund (tege@zevs.sics.se)
30520 * longlong.h: Add ARM, i860 support.
30522 * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
30524 Tue Aug 13 21:57:43 1991 Torbjorn Granlund (tege@zevs.sics.se)
30526 * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
30527 mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
30528 * gmp-impl.h: Put it here, and make it `const'.
30529 * cre-conv-tab.c (main): Make struct __mp_bases `const'.
30531 Mon Aug 12 17:11:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
30533 * cre-conv-tab.c (main): Use %lu in printf for long ints.
30535 * dist-Makefile: Fix cre-* dependencies.
30537 * cre-conv-tab.c (main): Output field big_base_inverted.
30539 * gmp-impl.h (struct bases): New field big_base_inverted.
30540 * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
30541 to float (in order to keep the structure smaller).
30543 * mp.h, gmp.h: Change names of macros for avoiding multiple
30546 Fri Aug 9 18:01:36 1991 Torbjorn Granlund (tege@zevs.sics.se)
30548 * _mpz_get_str: Only shift limb array if normalization_steps != 0
30551 * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
30552 * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
30553 and m1 (overlap between output and input operands did not work).
30554 * longlong.h: Add VAX, ROMP and HP-PA support.
30555 * longlong.h: Sort the machine dependent code in alphabetical order
30557 * longlong.h: Hack comments.
30559 Thu Aug 8 14:13:36 1991 Torbjorn Granlund (tege@zevs.sics.se)
30561 Released 1.0beta.9.
30563 * longlong.h: Define BITS_PER_LONG to 32 if it's not already
30565 * Define __BITS4 to BITS_PER_LONG / 4.
30566 * Don't assume 32 bit word size in "count_leading_zeros" C macro.
30567 Use __BITS4 and BITS_PER_LONG instead.
30569 * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
30571 * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
30572 even for plain mc68000.
30574 * mpq_div: Flip the sign of the numerator *and* denominator of the
30575 result if the intermediate denominator is negative.
30577 * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
30579 * mpz_and.c: Compute the result size more conservatively.
30580 * mpz_ior.c: Likewise.
30582 * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
30584 * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
30587 * dist-Makefile: Create mult.c from mpz_mul.c.
30588 * mult.c: Delete this file.
30590 * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
30591 not done properly if the input string had many leading zeros).
30593 Sun Aug 4 16:54:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
30595 * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
30596 work with VPATH and GNU MP.
30598 * mpz_gcd: Don't call mpz_set; inline its functionality.
30600 * mpq_mul, mpq_div: Fix several serious typos.
30602 * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
30605 * mpq_neg.c: New file.
30607 * dist-Makefile: Remove obsolete dependencies.
30609 * mpz_sub: Fix typo.
30611 Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
30612 * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
30614 * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
30616 Sat Aug 3 23:45:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
30618 * longlong.h: Clean up comments.
30619 * longlong.h: #undef internal macros.
30621 Fri Aug 2 18:29:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
30623 * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
30624 * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
30626 * mpz_dmincl.c: Normalize the remainder before shifting it back.
30628 * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
30630 * mpn_div.c: Fix comment.
30632 * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
30633 type, in order to work for both GNU and Berkeley functions.
30635 * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
30636 madd.c from mpz_add.c, msub.c from mpz_sub.c.
30638 * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
30639 * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
30640 Berkeley function name variants.
30641 * dist-Makefile: Add created files to "clean" target.
30643 Tue Jul 16 15:19:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
30645 * mpq_get_den: No need for absolute value of the size, the
30646 denominator is always positive.
30648 * mpz_get_ui: If the operand is zero, return zero. Don't read the
30651 * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
30652 is the size of the remainder.
30654 Mon Jul 15 11:08:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
30656 * Several files: Remove unused variables and functions.
30658 * gmp-impl.h: Declare _mpz_impl_sqrt.
30660 * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
30661 UDIV_NEEDS_NORMALIZATION. (Fix from Brian Beuning.)
30663 * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
30665 * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
30666 * mpz_ior: Add missing else statement in OP1 | -OP2 case.
30667 * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
30668 * mpz_ior: Duplicate _mpz_realloc code.
30670 * mpz_and: Add missing else statement in -OP1 & -OP2 case.
30671 * mpz_and: Rewrite OP1 & -OP2 case.
30672 * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
30674 * mpz_gcdext: Loop in d1.size (not b->size). (Fix from Brian
30677 * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call. (Fix from
30680 Fri Jul 12 17:10:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
30682 * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
30683 mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
30686 * mpz_dmincl.c: Remove second re-allocation of rem->d. It
30687 was never executed.
30689 * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
30690 some unixes' test doesn't have the -r option).
30692 * *.*: Cast allocated pointers to the appropriate type (makes old C
30693 compilers happier).
30695 * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
30696 after conversion to double. (Kludge for broken C compilers.)
30698 * dist-Makefile (stamp-stddefh): New target. Test if "stddef.h"
30699 exists in the system and creates a minimal one if it does not
30701 * cre-stddefh.c: New file.
30702 * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
30703 * dist-Makefile (clean): Add some more.
30704 * gmp.h, mp.h: Unconditionally include "stddef.h".
30706 Thu Jul 11 10:08:21 1991 Torbjorn Granlund (tege@zevs.sics.se)
30708 * min: Do ungetc of last read character.
30709 * min.c: include stdio.h.
30711 * dist-Makefile: Go via tmp- files for cre* redirection.
30712 * dist-Makefile: Add tmp* to "clean" target.
30714 * dist-Makefile: Use LOCAL_CC for cre*, to simplify cross
30717 * gmp.h, mp.h: Don't define NULL here.
30718 * gmp-impl.h: Define it here.
30720 Wed Jul 10 14:13:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
30722 * mpz_mod_2exp: Don't copy too much, overwriting most significant
30725 * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
30726 reallocating res, if op[12]_ptr got their value from alloca.
30728 * mpz_and, mpz_ior: Clear up comments.
30730 * cre-mparam.c: Output parameters for `short int' and `int'.
30732 * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
30734 Tue Jul 9 18:40:30 1991 Torbjorn Granlund (tege@zevs.sics.se)
30736 * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
30737 (Fix for Sun lossage.)
30739 * gmp.h: Add declaration of mpq_clear.
30741 * dist-Makefile: Chack if "ranlib" exists, before using it.
30742 * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
30743 * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
30745 Fri Jul 5 19:08:09 1991 Torbjorn Granlund (tege@zevs.sics.se)
30747 * move: Remove incorrect comment.
30749 * mpz_free, mpq_free: Rename to *_clear.
30750 * dist-Makefile: Likewise.
30751 * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
30753 * mpz_dmincl.c: Don't call "move", inline its functionality.
30755 Thu Jul 4 00:06:39 1991 Torbjorn Granlund (tege@zevs.sics.se)
30757 * Makefile: Include dist-Makefile. Fix dist target to include
30758 dist-Makefile (with the name "Makefile" in the archive).
30760 * dist-Makefile: New file made from Makefile. Add new mpz_...
30763 * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
30764 functionality. Avoids code duplication.
30765 * pow.c, mpz_powm.c: Include mpz_powincl.c
30767 * mpz_dmincl.c: New file containing general division code. Avoids
30769 * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
30772 * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
30773 Instead, write the overlapping memory copying inline.
30775 * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
30777 * longlong.h: Don't use #elif.
30778 * mpz_do_sqrt.c: Likewise.
30780 * longlong.h: Use __asm__ instead of asm.
30781 * longlong.h (sparc udiv_qrnnd): Make it to one string over several
30784 * longlong.h: Preend __ll_ to B, highpart, and lowpart.
30786 * longlong.h: Move array t in count_leading_zeros to the new file
30787 mp_clz_tab.c. Rename the array __clz_tab.
30788 * All files: #ifdef for traditional C compatibility.
30790 Wed Jul 3 11:42:14 1991 Torbjorn Granlund (tege@zevs.sics.se)
30792 * mpz_and: Initialize res_ptr always (used to be initialized only
30793 when reallocating).
30795 * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
30796 `unsigned int', and cast the multiplications. This way
30797 compilers more easily can choose cheaper multiplication
30800 * mpz_mod_2exp: Handle input argument < modulo argument.
30801 * mpz_many: Make sure mp_size is the type for sizes, not int.
30803 * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
30804 mpq_div: Change mpz_init* interface. Structure pointer as first
30805 arg to initialization function, no longer *return* struct.
30807 Sun Jun 30 19:21:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
30809 * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
30810 character file name length limit.
30812 * Most files: Rename MINT to MP_INT. Rename MRAT to MP_RAT.
30813 * mpz_sizeinb.c: New file with function mpz_sizeinbase.
30814 * mp_bases.c: New file, with array __mp_bases.
30815 * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
30816 __mp_bases instead.
30817 * mout, mpz_out_str: Use array __mp_bases instead of function
30819 * mpz_get_cvtlen.c: Remove.
30820 * Makefile: Update.
30822 Sat Jun 29 21:57:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
30824 * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
30825 * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
30826 * longlong.h (__sparc__): Don't call .umul; expand asm instead.
30827 Don't define __umulsidi3 (i.e. use default definition).
30829 Mon Jun 24 17:37:23 1991 Torbjorn Granlund (tege@amon.sics.se)
30831 * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
30834 Sat Jun 22 13:54:01 1991 Torbjorn Granlund (tege@zevs.sics.se)
30836 * mpz_gcdext.c: New file.
30838 * mpn_mul: Handle carry and unexpected operand sizes in last
30839 additions/subtractions. (Bug trigged when v1_size == 1.)
30841 * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
30842 * mpq_*: Call mpz_init*.
30844 * mpz_pow_ui, rpow: Use _mpn_mul instead of mult. Restructure.
30846 Wed May 29 20:32:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
30848 * mpz_get_cvtlen: multiply by size.
30850 Sun May 26 15:01:15 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
30852 Alpha-release 0.95.
30854 Fixes from Doug Lea (dl@g.oswego.edu):
30855 * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE). Adjust PROD_SIZE
30857 * mpz_div: Prepend _ to mpz_realloc.
30858 * mpz_set_xs, mpz_set_ds: Fix typos in function name.
30860 Sat May 25 22:51:16 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
30862 * mpz_divmod_ui: New function.
30864 * sdiv: Make the sign of the remainder correct.
30866 Thu May 23 15:28:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
30868 * Alpha-release 0.94.
30870 * mpz_mul_ui: Include longlong.h.
30872 * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
30875 * mpz_impl_sqrt: Don't call "move", inline its functionality.
30877 * mdiv: Use MPN_COPY instead of memcpy.
30878 * rpow, mpz_mul, mpz_mod_2exp: Likewise.
30879 * pow.c: Likewise, and fix bug in the size arg.
30881 * xtom: Don't use mpz_alloc, inline needed code instead. Call
30882 _mpz_set_str instead of mpz_set_str.
30884 * Makefile: Make two libraries, libmp.a and libgmp.a.
30886 Thu May 22 20:25:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
30888 * Add manual to distribution.
30889 * Fold in many missing routines descibed in the manual.
30892 Wed May 22 13:48:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
30894 * mpz_set_str: Make it handle 0x prefix OK.
30896 Sat May 18 18:31:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
30898 * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
30900 * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
30903 Thu May 16 20:43:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
30905 * memory.c: Make the default allocations functions global.
30906 * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
30907 default memory function.
30909 Wed May 8 20:02:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
30911 * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
30912 even if no normalization is needed.
30913 * mpz_div: Rework reallocation scheme, to avoid excess copying.
30915 * mpz_sub_ui.c, mpz_add_ui.c: New files.
30917 * mpz_cmp.c, mpz_cmp_ui.c: New files.
30919 * mpz_mul_2exp: Handle zero input MINT correctly.
30921 * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
30923 * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
30925 Tue May 7 15:44:58 1991 Torbjorn Granlund (tege@zevs.sics.se)
30927 * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
30928 * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
30929 * gcd, mpz_gcd: Likewise.
30931 * gcd, mpz_gcd: Handle common 2 factors correctly.
30933 Mon May 6 20:22:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
30935 * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
30937 * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
30939 Sun May 5 15:16:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
30941 * mpz_div: Remove test for QUOT == 0.
30943 Sun Apr 28 20:21:04 1991 Torbjorn Granlund (tege@zevs.sics.se)
30945 * pow: Don't make MOD normalization in place, as it's a bad idea to
30946 write on an input parameter.
30947 * pow: Reduce BASE if it's > MOD.
30948 * pow, mult, mpz_mul: Simplify realloc code.
30950 Sat Apr 27 21:03:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
30952 * Install multiplication using Karatsuba's algorithm as default.
30954 Fri Apr 26 01:03:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
30956 * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
30958 * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
30959 left, respectively.
30960 * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
30962 * mlshift.c, mrshift.c: Remove.
30964 Wed Apr 24 21:39:22 1991 Torbjorn Granlund (tege@zevs.sics.se)
30966 * mpn_mul: Check only for m2_size == 0 in function header.
30968 Mon Apr 22 01:31:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
30970 * karatsuba.c: New file for Karatsuba's multiplication algorithm.
30972 * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
30974 * mpn_cmp: Fix header comment.
30976 Sun Apr 21 00:10:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
30978 * pow: Switch off initial base reduction.
30980 Sat Apr 20 22:06:05 1991 Torbjorn Granlund (tege@echnaton.sics.se)
30982 * mpz_get_str: Don't generate initial zeros for initial word.
30983 Used to write outside of allocated storage.
30985 Mon Apr 15 15:48:08 1991 Torbjorn Granlund (tege@zevs.sics.se)
30987 * _mpz_realloc: Make it accept size in number of mp_digits.
30988 * Most functions: Use new _mpz_realloc definition.
30990 * mpz_set_str: Remove calls _mp_free_func.
30992 * Most functions: Rename mpn_* to _mpn_*. Rename mpz_realloc to
30994 * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
30995 * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
30996 * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
30998 Sat Apr 6 14:05:16 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
31000 * mpn_mul: Multiply by the first digit in M2 in a special
31001 loop instead of zeroing the product area.
31003 * mpz_abs.c: New file.
31005 * sdiv: Implement as mpz_div_si for speed.
31007 * mpn_add: Make it work for second source operand == 0.
31009 * msub: Negate the correct operand, i.e. V before swapping, not
31010 the smaller of U and V!
31011 * madd, msub: Update abs_* when swapping operands, and not after
31014 Fri Apr 5 00:19:36 1991 Torbjorn Granlund (tege@black.nada.kth.se)
31016 * mpn_sub: Make it work for subtrahend == 0.
31018 * madd, msub: Rewrite to minimize mpn_cmp calls. Ensure
31019 mpn_cmp is called with positive sizes (used to be called
31020 incorrectly with negative sizes sometimes).
31022 * msqrt: Make it divide by zero if fed with a negative number.
31023 * Remove if statement at end of precision calculation that was
31026 * itom, mp.h: The argument is of type short, not int.
31028 * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
31030 * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
31032 * Add COPYING to distribution.
31034 * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
31036 Fri Mar 15 00:26:29 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
31038 * Add Copyleft headers to all files.
31040 * mpn_mul.c, mpn_div.c: Add header comments.
31041 * mult.c, mdiv.c: Update header comments.
31043 * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
31044 mpq_free.c: New files for rational arithmetics.
31046 * mpn_lshift.c: Avoid writing the most significant word if it is 0.
31048 * mdiv.c: Call mpn_lshift for the normalization.
31049 * mdiv.c: Remove #ifdefs.
31051 * Makefile: Add ChangeLog to DISTFILES.
31053 * mpn_div.c: Make the add_back code work (by removing abort()).
31054 * mpn_div.c: Make it return if the quotient is size as compared
31055 with the difference NSIZE - DSIZE. If the stored quotient is
31056 larger than that, return 1, otherwise 0.
31057 * gmp.h: Fix mpn_div declaration.
31058 * mdiv.c: Adopt call to mpn_div.
31059 * mpz_div.c: New file (developed from mdiv.c).
31061 * README: Update routine names.
31063 Thu Mar 14 18:45:28 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
31065 * mpq_mul.c: New file for rational multiplication.
31067 * gmp.h: Add definitions for rational arithmetics.
31069 * mpn_div: Kludge the case where the high numerator digit > the
31070 high denominator digit. (This code is going to be optimized later.)
31072 * New files: gmp.h for GNU specific functions, gmp-common.h for
31073 definitions common for mp.h and gmp.h.
31075 * Ensure mp.h just defines what BSD mp.h defines.
31077 * pow.c: Fix typo for bp allocation.
31079 * Rename natural number functions to mpn_*, integer functions to
31082 Tue Mar 5 18:47:04 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
31084 * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
31085 "n0 >= r" to "n0 > r".
31087 * msqrt: Tune the increasing precision scheme, to do fewer steps.
31089 Tue Mar 3 18:50:10 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
31091 * msqrt: Use the low level routines. Use low precision in the
31092 beginning, and increase the precision as the result converges.
31093 (This optimization gave a 6-fold speedup.)