resetting manifest requested domain to floor
[platform/upstream/gmp.git] / ChangeLog
1 2013-09-29  Torbjorn Granlund  <tege@gmplib.org>
2
3         * Version 5.1.3 released.
4
5         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
6         * gmp-h.in: Bump version.
7
8 2013-09-27  Niels Möller  <nisse@lysator.liu.se>
9
10         * NEWS: Mention the ia64 mpn_divrem_2 bugfix.
11
12 2013-07-16  Torbjorn Granlund  <tege@gmplib.org>
13
14         * doc/gmp.texi: Declare countless of function arguments as 'const'.
15
16 2013-07-15  Torbjorn Granlund  <tege@gmplib.org>
17
18         * mpn/generic/sb_div_sec.c: Compute inverse as floor(B^2/(dh+1)), per
19         Niels' suggestion.
20         * mpn/generic/sbpi1_div_sec.c: Remove inverse rounding-up code.
21
22 2013-07-12  Torbjorn Granlund  <tege@gmplib.org>
23
24         * mpn/generic/sbpi1_div_sec.c: Partial rewrite.
25
26 2013-06-19  Torbjorn Granlund  <tege@gmplib.org>
27
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.
31
32 2013-06-17  Torbjorn Granlund  <tege@gmplib.org>
33
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.
38
39 2013-06-09  Marc Glisse  <marc.glisse@inria.fr>
40
41         * mpn/generic/get_d.c (mpn_get_d): Avoid signed overflow.
42         * mpz/kronzs.c (mpz_kronecker_si): Use ABS_CAST.
43
44 2013-05-22  Torbjorn Granlund  <tege@gmplib.org>
45
46         * doc/gmp.texi (Reporting Bugs): Ask for configure's output.
47
48         * mpn/ia64/divrem_2.asm: Don't clobber f16-f18.
49
50 2013-05-20  Torbjorn Granlund  <tege@gmplib.org>
51
52         * Version 5.1.2 released.
53
54         * mpn/arm/udiv.asm: Change spacing to work around binutils bug.
55
56 2013-05-16  Torbjorn Granlund  <tege@gmplib.org>
57
58         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
59         * gmp-h.in: Bump version.
60
61         * tests/misc.c (tests_hardware_getround, tests_hardware_setround):
62         Avoid assembly dependency unless WANT_ASSEMBLY.
63
64         * configure.ac (WANT_ASSEMBLY): Conditionally define.
65
66 2013-05-14  Torbjorn Granlund  <tege@gmplib.org>
67
68         * configure.ac (arm1156): Don't fall back to plain v6 compiler option.
69
70 2013-05-10  Torbjorn Granlund  <tege@gmplib.org>
71
72         * mpn/x86/p6/mmx/gmp-mparam.h: Set down SQR_TOOM2_THRESHOLD to parent
73         directory value.
74
75 2013-05-09  Torbjorn Granlund  <tege@gmplib.org>
76
77         * mpn/x86_64/bd1/mul_1.asm: Fix typo.
78
79 2013-04-29  Torbjorn Granlund  <tege@gmplib.org>
80
81         * configure.ac (sparc-*-*): Recognise t5 along with t3 and t4.
82         Remove sparc64/ultrasparct1 from path_64 for T3, T3, and T5.
83
84 2013-04-27  Mike Frysinger  <vapier@gentoo.org>
85
86         * configure.ac (arm*-*-*): Set up path also for plainest CPU variants.
87
88 2013-03-19  Torbjorn Granlund  <tege@gmplib.org>
89
90         * tests/arm32check.c: Get printing of clobbered register right.
91
92         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add arm32call.asm and
93         arm32check.c.
94
95 2013-03-18  Torbjorn Granlund  <tege@gmplib.org>
96
97         * configure.ac (arm*-*-*): Define CALLING_CONVENTIONS_OBJS.
98
99         * tests/arm32call.asm: New file.
100         * tests/arm32check.c: New file.
101
102         * mpn/arm/arm-defs.m4 (LEA): Rewrite to properly handle repeated use.
103         (EPILOGUE_cpu): Define.
104
105         * mpn/x86/darwin.m4 (m4append): Move definition from here...
106         * mpn/asm-defs.m4: ...to here.
107
108 2012-03-17  Marc Glisse  <marc.glisse@inria.fr>
109
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.
112
113 2013-03-11  Torbjorn Granlund  <tege@gmplib.org>
114
115         * tests/mpz/t-powm_ui.c: Test larger arguments.
116
117         * mpz/powm_ui.c (mod): Adhere to mpn_mu_div_qr's overlap requirements.
118
119 2013-02-25  Niels Möller  <nisse@lysator.liu.se>
120
121         * mini-gmp/tests/t-double.c (testmain): Declare double variables
122         as volatile, to drop extended precision.
123
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.
128
129 2013-02-20  Niels Möller  <nisse@lysator.liu.se>
130
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.
134
135 2013-02-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
136
137         * mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
138
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)
141
142 2013-02-17  Marc Glisse  <marc.glisse@inria.fr>
143
144         * cxx/osdoprnti.cc: Use <stdarg.h> and <string.h> rather than <cstdarg>
145         and <cstring> (revert 2002-12-21).
146
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>.
150
151 2013-02-16  Marc Glisse  <marc.glisse@inria.fr>
152
153         * gmpxx.h: Include <algorithm>.
154
155 2013-02-16  Torbjorn Granlund  <tege@gmplib.org>
156
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.
159
160 2013-02-10  Torbjorn Granlund  <tege@gmplib.org>
161
162         * Version 5.1.1 released.
163
164 2013-02-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
165
166         * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
167         * tune/README: Document new parameter syntax mpn_mul.<#> .
168
169 2013-02-06  Niels Möller  <nisse@lysator.liu.se>
170
171         * tests/mpz/t-jac.c (check_large_quotients): Rewrote. Now uses a
172         more efficient method for generating the test inputs.
173
174 2013-02-05  Torbjorn Granlund  <tege@gmplib.org>
175
176         * tests/mpn/t-div.c: Limit random dbits to avoid an infinite loop.
177
178 2013-02-03  Torbjorn Granlund  <tege@gmplib.org>
179
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.
183
184 2013-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
185
186         * mpz/remove.c: Correct the sign in case of reuse.
187
188 2013-02-01  Torbjorn Granlund  <tege@gmplib.org>
189
190         * gmp-impl.h (DIGITS_IN_BASE_PER_LIMB): Add a cast.
191         (LIMBS_PER_DIGIT_IN_BASE): Likewise.
192
193         * tests/refmpn.c (refmpn_mul): Use toom6h instead of toom44 for the
194         largest operands.
195
196 2013-01-31  Torbjorn Granlund  <tege@gmplib.org>
197
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.
201
202 2013-01-30  Torbjorn Granlund  <tege@gmplib.org>
203
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.
207
208 2013-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
209
210         * mpz/remove.c: init+set=init_set, cast before shifting.
211
212         * mpz/cmp_si.c: Use ABS_CAST.
213
214 2013-01-26  Torbjorn Granlund  <tege@gmplib.org>
215
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.
218
219         * tests/mpn/t-mod_1.c: Test also mpn_mod_1s_3p.
220
221         * mpn/generic/mod_1_3.c: Swap some lines to make it similar to mod_4.c.
222
223         * tests/mpz/reuse.c: Fix typo in last change.
224
225 2013-01-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
226
227         * mini-gmp/mini-gmp.c (mpz_cmpabs_d, mpz_cmp_d): Simplify.
228         (mpz_set_str): Behaviour more adherent to the real GMP.
229
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.
235
236 2013-01-22  Torbjorn Granlund  <tege@gmplib.org>
237
238         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
239         * gmp-h.in: Bump version.
240
241         * tests/mpz/reuse.c: Delete always zero 'failures' and code depending
242         on it.  Replace rotating progress with real measure.
243
244         * Makefile.am (check-mini-gmp): Fix typo in last change.
245
246 2013-01-22  Niels Möller  <nisse@lysator.liu.se>
247
248         * mini-gmp/mini-gmp.c (mpz_cmp_d): Simplified, just sort out
249         signs, then call mpz_cmpabs_d.
250
251         * mini-gmp/tests/testutils.h: Include stdio.h and stdlib.h.
252         (numberof): New define.
253
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,
257
258         * mini-gmp/mini-gmp.c (mpz_cmpabs_d): New function.
259         * mini-gmp/mini-gmp.h: Declare it.
260
261 2013-01-21  Niels Möller  <nisse@lysator.liu.se>
262
263         * mini-gmp/tests/t-str.c (testmain): Test mpz_out_str, using
264         the tmpfile function for i/o.
265
266 2013-01-20  Torbjorn Granlund  <tege@gmplib.org>
267
268         * Makefile.am (check-mini-gmp): Set also DYLD_LIBRARY_PATH for the
269         benefit of Darwin.
270
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.
277
278         * tests/mpz/t-remove.c: Back out last change which left `divisor_size'
279         uninitialised; achieve change's aim with a parameter tweak.
280
281 2013-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
282
283         * mini-gmp/tests/testutils.c (testhalves): New function, test default
284         memory functions.
285         * mini-gmp/tests/testutils.h (testhalves): Declare it
286         * mini-gmp/tests/t-logops.c: Use testhalves.
287
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.
291
292 2013-01-20  Torbjorn Granlund  <tege@gmplib.org>
293
294         * tests/memory.c (PTRLIMB): New macro, used for conformant casting.
295
296 2013-01-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
297
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.
301
302         * mini-gmp/tests/testutils.h (tu_free): Remove declaration.
303
304         * mini-gmp/tests/testutils.c (block_check, tu_free): Mark static.
305
306         * tests/mpz/t-set_str.c: Check also failing conditions.
307
308         * tests/mpz/t-remove.c: Test removal of 1.
309
310 2013-01-18  Niels Möller  <nisse@lysator.liu.se>
311
312         * mini-gmp/tests/t-str.c (test_small): New function, exercising
313         parsing of whitespace and base prefixes.
314         (testmain): Call it.
315
316         * mini-gmp/tests/t-gcd.c (gcdext_valid_p): Fixed memory leak.
317
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.
321
322         * mini-gmp/tests/testutils.c (block_init, block_check): New
323         functions.
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.
327
328         * mini-gmp/tests/testutils.h: New file, declarations for test
329         programs.
330
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.
335
336 2013-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
337
338         * mini-gmp/tests/t-signed.c: Slightly larger coverage.
339         * mini-gmp/tests/t-double.c: Test also mpz_init_set_d.
340
341 2013-01-18  Torbjorn Granlund  <tege@gmplib.org>
342
343         * mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
344         variable.
345
346         * mini-gmp/tests/t-div.c: Test mpz_divisible_p and mpz_divisible_ui_p.
347
348         * tests/tests.h (TESTS_REPS): Fix printf argument type clashes.
349
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.
352
353         * mini-gmp/mini-gmp.c: Prefix some names with GMP_.
354
355 2013-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
356
357         * mini-gmp/tests/t-double.c: Test mpz_cmp_d.
358         * mini-gmp/mini-gmp.c (mpz_cmp_d): Correct multiword comparison.
359
360         * mini-gmp/mini-gmp.c (mpz_set_str): Handle the empty string.
361         * mini-gmp/tests/t-str.c: Test base <= 0.
362
363 2013-01-15  Niels Möller  <nisse@lysator.liu.se>
364
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.
367
368         * mini-gmp/tests/t-mul.c (main): Test mpn_mul_n and mpn_sqr.
369
370         * mini-gmp/tests/hex-random.h (enum hex_random_op): New value
371         OP_SQR.
372
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.
376
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.
380
381 2013-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
382
383         * mini-gmp/tests/t-logops.c: Improve popcount/hamdist testing.
384         * mini-gmp/tests/t-signed.c: Test more cases.
385
386 2013-01-15  Torbjorn Granlund  <tege@gmplib.org>
387
388         From Mike Frysinger:
389         * configure.ac: Add x32 ABI for x86_64.
390
391 2013-01-14  Niels Möller  <nisse@lysator.liu.se>
392
393         * mini-gmp/tests/t-str.c (main): Added tests for mpn_get_str and
394         mpn_set_str.
395
396 2013-01-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
397
398         * doc/gmp.texi (gmp_version): Remove "was used" repetition.
399         (Upward compatibility): Mention mpn_bdivmod, GMP 4 -> GMP 5.
400
401 2013-01-13  Marc Glisse  <marc.glisse@inria.fr>
402
403         * doc/gmp.texi: Let mpn_sqrtrem reference mpn_perfect_square_p instead
404         of mpz_perfect_square_p.
405
406 2013-01-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
407
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.
411
412         * mini-gmp/mini-gmp.c (mpz_mul_si): Simplify.
413         (mpz_mul_ui, mpz_mul, mpz_div_qr): Replace init+REALLOC with init2.
414
415         * mini-gmp/mini-gmp.c (NEG_CAST): New macro.
416         (mpz_mul_si, mpz_set_si, mpz_cmp_si): Use NEG_CAST.
417
418         * mini-gmp/mini-gmp.c (mpz_set_si, mpz_cmp_si): Simplify by using
419         the _ui variant.
420
421         * mini-gmp/tests/t-root.c: Use mpz_ui_pow_ui, when base fits an ui.
422
423         * mini-gmp/tests/t-mul.c: Test also mpz_mul_si.
424         * mini-gmp/tests/t-sub.c: Test also mpz_ui_sub.
425
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.
429
430         * mini-gmp/mini-gmp.c (mpz_hamdist): Handle different sizes.
431         * mini-gmp/tests/t-logops.c: Test also popcount and hamdist.
432
433 2013-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
434
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.
438
439 2013-01-10  Torbjorn Granlund  <tege@gmplib.org>
440
441         * mini-gmp/tests/t-import.c (main): Don't drop off functon end.
442
443         * Makefile.am (check-mini-gmp): Set LD_LIBRARY_PATH to allow testing
444         with dynamic main GMP build.
445
446 2013-01-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
447
448         * mini-gmp/mini-gmp.c (mpz_export): Support op=0 countp=NULL.
449
450 2013-01-08  Niels Möller  <nisse@lysator.liu.se>
451
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.
455
456         * mini-gmp/tests/mini-random.c (mini_rrandomb_export): New
457         function.
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.
461
462         * mini-gmp/mini-gmp.c (mpz_export): Compute accurate word count up
463         front, to avoid generating any high zero words.
464
465 2013-01-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
466
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.
470
471 2013-01-05  Torbjorn Granlund  <tege@gmplib.org>
472
473         * longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.
474
475 2013-01-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
476
477         From shuax:
478         * mini-gmp/mini-gmp.c (mpz_import): Reset limb after storing it.
479
480 2013-01-04  Torbjorn Granlund  <tege@gmplib.org>
481
482         From Marko Lindqvist:
483         * configure.ac: Use AC_CONFIG_HEADERS instead of the obsolete
484         AM_CONFIG_HEADER.
485
486 2013-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
487
488         * tests/mpz/bit.c: Wider testing for mpz_combit.
489         * tests/mpz/logic.c: Check the -2^n case.
490
491         * mpz/ior.c: Fixed an allocation bug in the -2^n case.
492
493 2012-12-31  Torbjorn Granlund  <tege@gmplib.org>
494
495         * mpn/generic/get_d.c: Minor reorg, add vax D code.
496
497         * gmp-impl.h (double_extract): New union type for vax D floats.
498
499         * tests/mpq/t-get_d.c (check_random): Limit exponents on vax.
500
501 2012-12-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
502
503         * tests/mpz/bit.c (check_clr_extend): Check _set shrink.
504
505 2012-12-29  Torbjorn Granlund  <tege@gmplib.org>
506
507         * demos/calc/calc.c: Remove generated file from repo.
508         * demos/calc/calc.h: Likewise.
509         * demos/calc/calclex.c: Likewise.
510
511 2012-12-27  Torbjorn Granlund  <tege@gmplib.org>
512
513         * mpn/generic/get_d.c: Complete rewrite of non-IEEE code.
514
515         * tests/mpq/t-get_d.c (main): Suppress check_random for vax.
516
517 2012-12-25  Torbjorn Granlund  <tege@gmplib.org>
518
519         * mpn/x86_64/bdiv_q_1.asm: Use LEA for binvert_limb_table.
520
521 2012-12-23  Torbjorn Granlund  <tege@gmplib.org>
522
523         * tests/mpz/t-get_d.c (check_onebit): Decrease vax limit to avoid
524         overflow in last, unused 'want' value.
525
526         * config.guess: Recognise AMD family 22 as a future bobcat.
527
528 2012-12-21  Torbjorn Granlund  <tege@gmplib.org>
529
530         * configure.ac: Rename configure.in.
531
532 2012-12-17  Torbjorn Granlund  <tege@gmplib.org>
533
534         * Version 5.1.0 released.
535
536         * configure.in (none-*-*): Allow this again, but print a warning.
537
538 2012-12-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
539
540         * mpz/n_pow_ui.c: Fix typos in an ASSERT.
541
542 2012-12-16  Torbjorn Granlund  <tege@gmplib.org>
543
544         * mpn/generic/mu_div_qr.c (mpn_preinv_mu_div_qr): Explicitly use
545         MPN_COPY_INCR for slightly overlapping copy.
546
547 2012-12-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
548
549         * tests/mpn/toom-sqr-shared.h: Skip ALLOCs if the test is skipped.
550
551 2012-12-13  Torbjorn Granlund  <tege@gmplib.org>
552
553         * mpn/x86_64/dos64.m4 (PIC): Move definition early.
554         (JMPENT): Remove PIC variant.
555
556         * mpn/x86_64/darwin.m4 (JUMPTABSECT): Define to .text, instead of
557         something sensible.
558
559 2012-12-12  Torbjorn Granlund  <tege@gmplib.org>
560
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.
567
568 2012-12-11  Torbjorn Granlund  <tege@gmplib.org>
569
570         * mpn/x86_64/mod_34lsub1.asm: Try different jump table for the benefit
571         of broken Apple linkers.
572
573 2012-12-09  Torbjorn Granlund  <tege@gmplib.org>
574
575         * configure.in: Make GMP_NONSTD_ABI ABI specific.
576
577 2012-12-08  Torbjorn Granlund  <tege@gmplib.org>
578
579         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
580         * gmp-h.in: Bump version.
581
582 2012-12-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
583
584         * tests/mpq/reuse.c: New test (adapted from mpf/reuse.c).
585         * tests/mpq/Makefile.am (check_PROGRAMS): Add reuse.
586
587         * mpz/abs.c: Use NEWALLOC.
588         * mpz/neg.c: Likewise.
589         * mpz/com.c: Reduce branches.
590
591 2012-12-05  Niels Möller  <nisse@lysator.liu.se>
592
593         * mpn/generic/brootinv.c (mpn_brootinv): Make valgrind happier, at
594         the cost of a redundant MPN_ZERO.
595
596         * mpz/jacobi.c (mpz_jacobi): Check for asize == 0 or bsize == 0
597         before using the low limbs.
598
599 2012-12-05  Torbjorn Granlund  <tege@gmplib.org>
600
601         * mpn/generic/set_str.c (mpn_dc_set_str): Work around a valgrind issue.
602
603         * mpz/powm_ui.c: Don't assume >= 2 limbs in mod argument.
604
605         * tests/tests.h (TESTS_REPS): Handle float GMP_CHECK_REPFACTOR.
606
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.
614
615 2012-11-30  Torbjorn Granlund  <tege@gmplib.org>
616
617         * gen-fac.c (gen_consts): Correct printf types.
618
619         * mpn/arm/v7a/cora15/gmp-mparam.h: New file.
620
621         * configure.in (arm*-*-*): New compiler optional "tune".  Pass value for
622         selected processors.  Add more specific path components.
623
624 2012-11-29  Torbjorn Granlund  <tege@gmplib.org>
625
626         From Andoni Morales Alastruey:
627         * longlong.h: Conditionalise ARM asm on !__thumb__.
628
629 2012-11-28  Torbjorn Granlund  <tege@gmplib.org>
630
631         * config.guess (arm*-*-*): Support specific ARM processors.
632         * config.sub: Match arm CPUs.
633         * configure.in (arm*-*-*): Likewise.
634
635         * mpz/powm.c: Move new_b out since it lives on through b.
636
637         * configure.in (arm*-*-*): Pass -marm to deal with compilers defaulting
638         to thumb code.
639
640 2012-11-26  Torbjorn Granlund  <tege@gmplib.org>
641
642         * tests/cxx/t-ops2.cc (checkz): Reduce huge numbers to avoid vax
643         overflow.
644
645 2012-11-25  Torbjorn Granlund  <tege@gmplib.org>
646
647         * mpn/generic/get_d.c: Reinsert non-IEEE code.
648
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.
663
664         * mpn/vax/elf.m4: New file.
665         * configure.in (vax*-*-*elf*): New case, grabbing vax/elf.m4.
666
667         * tests/mpn/t-get_d.c (check_onebit): Get vax bounds right.
668         (main): Switch off check_rand for vax.
669
670 2012-11-22  Niels Möller  <nisse@lysator.liu.se>
671
672         * mini-gmp/tests/run-tests: Copied latest version from GNU Nettle.
673         Minor fix to the use of $EMULATOR, and proper copyright notice.
674
675 2012-11-16  Torbjorn Granlund  <tege@gmplib.org>
676
677         * mpn/generic/powm_sec.c (redcify): Use mpn_sb_div_r_sec.
678
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.
683
684 2012-11-12  Torbjorn Granlund  <tege@gmplib.org>
685
686         * longlong.h: Add ARM64 support.
687         * longlong.h: Add AVR support.
688
689         * mpn/powerpc64/mode64/divrem_1.asm: Tune, simplify.
690
691         * mpq/md_2exp.c: Use MPN_COPY_INCR, not MPN_COPY_DECR.
692         * tests/mpq/t-md_2exp.c (check_random): New function.
693
694 2012-11-10  Torbjorn Granlund  <tege@gmplib.org>
695
696         * mpn/generic/remove.c (mpn_bdiv_qr_wrap): Make static.
697
698 2012-11-04  Torbjorn Granlund  <tege@gmplib.org>
699
700         * mpz/powm_ui.c: Rewrite.
701
702 2012-11-01  Niels Möller  <nisse@lysator.liu.se>
703
704         * mpn/generic/brootinv.c (mpn_brootinv): Input size in limbs
705         rather than bits. Use single-precision iterations for the first
706         limb.
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.
711
712         * mpn/generic/hgcd2.c (mpn_hgcd2): Removed redundant loop exit
713         tests in the single-precision loop.
714
715         * mpz/combit.c (mpz_combit): Rewrite, optimizing for the common
716         case.
717
718 2012-10-31  Niels Möller  <nisse@lysator.liu.se>
719
720         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-brootinv.
721         * tests/mpn/t-brootinv.c: New file
722
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.
725
726         * tune/speed.c (routine): Added mpn_broot, mpn_broot_invm1,
727         mpn_brootinv.
728
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.
733
734         * mpn/generic/broot.c (mpn_broot_invm1): Made non-static (mainly
735         for benchmarking).
736         * gmp-impl.h (mpn_broot_invm1): Declare it.
737
738 2012-10-28  Torbjorn Granlund  <tege@gmplib.org>
739
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.
747
748         * tests/mpn/t-broot.c: Add a forgotten TMP_MARK.
749
750 2012-10-28  Niels Möller  <nisse@lysator.liu.se>
751
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.
757
758 2012-10-27  Torbjorn Granlund  <tege@gmplib.org>
759
760         * mpn/generic/remove.c: Get remainder allocation right.
761
762 2012-10-25  Torbjorn Granlund  <tege@gmplib.org>
763
764         * longlong.h: De-support old POWER asm syntax.
765
766         * tests/mpz/t-remove.c: Run more tests, but use a tad smaller operands.
767
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.
771
772 2012-10-17  Torbjorn Granlund  <tege@gmplib.org>
773
774         * mpz/powm_ui.c (mpz_powm_ui): Deflect to mpz_powm for large exponent.
775
776 2012-09-10  Torbjorn Granlund  <tege@gmplib.org>
777
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.
781
782 2012-08-24  Torbjorn Granlund  <tege@gmplib.org>
783
784         * demos/factorize.c: Overhaul.
785
786 2012-08-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
787
788         * doc/gmp.texi (mpn_neg): Correctly document returned type.
789
790         * gmp-impl.h (_mpz_newalloc, log_n_max): mark with inline (spotted by Niels).
791
792 2012-07-28  Marc Glisse  <marc.glisse@inria.fr>
793
794         * gmpxx.h (std::common_type): New partial specializations with builtin
795         types.
796         * tests/cxx/t-cxx11.cc: Test it.
797
798 2012-07-21  Torbjorn Granlund  <tege@gmplib.org>
799
800         * mpn/powerpc32/vmx/mod_34lsub1.asm: Fix r0 clobbering issue with
801         "large" code affecting elf+darwin PIC.
802
803 2012-07-21  Marc Glisse  <marc.glisse@inria.fr>
804
805         * gmpxx.h (__GMPXX_CONSTANT): Disable for g++-3.4.
806
807 2012-06-26  Torbjorn Granlund  <tege@gmplib.org>
808
809         * Makefile.am (LIBMP_LT_*): Remove these.
810
811 2012-06-26  Marc Glisse  <marc.glisse@inria.fr>
812
813         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Update comment for 5.1.0.
814
815 2012-06-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
816
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).
821
822         * gmp-impl.h (MPN_SIZEINBASE_16): Replace with MPN_SIZEINBASE_2EXP
823         from mpz/export.c .
824         * mpz/export.c (MPN_SIZEINBASE_2EXP): Removed.
825         * mpn/generic/sizeinbase.c: Use MPN_SIZEINBASE.
826
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.
834
835         * mini-gmp/mini-gmp.c (mpz_div_r_2exp, mpz_div_q_2exp): Improve
836         adjustment condition.
837
838 2012-06-23  Marc Glisse  <marc.glisse@inria.fr>
839
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.
845
846 2012-06-09  Marc Glisse  <marc.glisse@inria.fr>
847
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().
854
855 2012-06-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
856
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.
864
865         * mini-gmp/mini-gmp.c (mpz_realloc): remove a branch.
866
867 2012-06-04  Torbjorn Granlund  <tege@gmplib.org>
868
869         * mpn/powerpc64/aix.m4 (ASM_START): Claim machine type "any".
870
871 2012-06-03  Niels Möller  <nisse@lysator.liu.se>
872
873         * mpn/generic/gcdext.c (mpn_gcdext): Deleted code for handling
874         impossible case u1 == 0, Simplified test for unlikely case u0 == 0.
875
876 2012-06-02  Torbjorn Granlund  <tege@gmplib.org>
877
878         * mpn/arm/lshiftc.asm: New file.
879
880 2012-06-01  Torbjorn Granlund  <tege@gmplib.org>
881
882         * mpn/arm/aorslsh1_n.asm: Use cmp/cmn instead of subs/adds in more
883         places.
884
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.
888
889         * tests/mpz/io.c: Use a wider range of bases.
890
891         * tests/mpz/t-cong.c (check_random): Rewrite random generation for
892         exponentially distributed operand sizes.
893
894 2012-06-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
895
896         * mpq: Use more macros and MPZ_REALLOC return value when possible.
897
898         * gmp-impl.h (LIMBS): Removed, was an alias for PTR.
899         * mpz/combit.c: Use PTR and CNST_LIMB.
900
901         * tests/mpn/t-bdiv.c: Test also mpn_bdiv_qr.
902         * mpn/generic/bdiv_qr.c: Add an ASSERT.
903
904         * mpn/generic/remove.c: Add a zero limb to use bdiv_qr...
905
906 2012-05-31  Marc Glisse  <marc.glisse@inria.fr>
907
908         * gmpxx.h (mpq_class::mpq_class): Handle mpq_class(0,1).
909         * tests/cxx/t-constr.cc: Test it.
910
911 2012-05-30  Torbjorn Granlund  <tege@gmplib.org>
912
913         * mpn/x86_64 (FUNC_ENTRY): New name for DOS64_ENTRY.
914         * mpn/x86_64 (FUNC_EXIT): New name for DOS64_EXIT.
915
916 2012-05-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
917
918         * mpz/remove.c: Optimise branches.
919
920         * mpn/generic/toom6h_mul.c: less branches in the LIKELY balanced path.
921         * mpn/generic/toom8h_mul.c: Likewise.
922
923 2012-05-29  Torbjorn Granlund  <tege@gmplib.org>
924
925         * mpn/arm/v5/mod_1_1.asm: New file.
926
927 2012-05-28  Niels Möller  <nisse@lysator.liu.se>
928
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
931         ASSERT improvements.
932
933 2012-05-27  Torbjorn Granlund  <tege@gmplib.org>
934
935         * config.guess: Add new x86 CPUs.
936         * mpn/x86/fat/fat.c: Likewise.
937         * mpn/x86_64/fat/fat.c: Likewise.
938
939 2012-05-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
940
941         * mpn/x86_64/fat/fat.c: abort iff longmode-capable-bit is turned off.
942
943         * mpn/generic/toom8h_mul.c: mark UNLIKELY branches.
944
945 2012-05-26  Torbjorn Granlund  <tege@gmplib.org>
946
947         * mpz: Use MPZ_REALLOC return value when possible.
948
949 2012-05-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
950
951         * mini-gmp/tests/t-div.c: Test all _qr, _q, _r variants.
952         * mini-gmp/tests/t-lcm.c: Test the _ui variant.
953
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.
956
957         * mpz/scan1.c: Simplify, and add a shortcut for scan1(z, 0).
958
959 2012-05-24  Torbjorn Granlund  <tege@gmplib.org>
960
961         * mpz/n_pow_ui.c: Cast non-limb count_leading_zeros argument.
962
963 2012-05-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
964
965         * mpz/remove.c: Support negative divisor.
966         * tests/mpz/t-remove.c: Test negative divisor.
967
968 2012-05-23  Torbjorn Granlund  <tege@gmplib.org>
969
970         * tests/mpz/reuse.c: Major rewrite.
971
972 2012-05-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
973
974         * mpz/sqrt.c: Further simplify.
975         * mpz/sqrtrem.c: Likewise.
976
977         * Mark failing branches with UNLIKELY. Many files affected.
978
979 2012-05-22  Torbjorn Granlund  <tege@gmplib.org>
980
981         * mpz/sqrt.c: Allocate less for overlapping operands, simplify.
982         * mpz/sqrtrem.c: Likewise.
983
984 2012-05-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
985
986         * mpn/generic/toom8_sqr.c: Reduce branches for recursion.
987         * mpn/generic/toom8h_mul.c: Likewise.
988
989         * tests/mpn/t-toom8h.c: Don't use GMP_NUMB_BITS when not yet defined.
990
991 2012-05-20  Torbjorn Granlund  <tege@gmplib.org>
992
993         * tests/mpz/t-gcd.c: Rewrite.
994
995 2012-05-19  Torbjorn Granlund  <tege@gmplib.org>
996
997         * tests/mpz/t-gcd.c: Generate larger operands for better gcd code
998         coverage; distribute size exponentially.
999
1000 2012-05-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
1001
1002         * mpf/pow_ui.c: Simplify.
1003         * tests/mpf/reuse.c (dsi_func): Exercise pow_ui.
1004
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.
1007
1008         * tests/cxx/t-ops.cc (check_mpq): Check squaring.
1009         * tests/mpq/t-equal.c (check_various): Check different den-size.
1010
1011         * mpn/generic/mullo_n.c: Disable MAYBE_ if WANT_FAT_BINARY.
1012         * mpz/cmpabs_d.c: Remove an unused branch.
1013
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.
1017
1018         * mpz/rootrem.c: Correctly handle odd roots of negatives.
1019         * tests/mpz/t-root.c: Test it.
1020
1021 2012-05-16  Torbjorn Granlund  <tege@gmplib.org>
1022
1023         * tests/mpf/t-eq.c (check_random): New function, meat from old main().
1024         (check_data): New function.
1025
1026 2012-05-13  Torbjorn Granlund  <tege@gmplib.org>
1027
1028         * mpn/arm/rsh1aors_n.asm: New file.
1029         * mpn/arm/v5/mod_1_2.asm: New file.
1030
1031 2012-05-11  Marc Glisse  <marc.glisse@inria.fr>
1032
1033         * gmpxx.h (explicit operator bool): New functions.
1034         * tests/cxx/t-cxx11.cc: Test the above.
1035
1036 2012-05-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
1037
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.
1042
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.
1047
1048 2012-05-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
1049
1050         * mini-gmp/mini-gmp.c: merge mpz_rootrem and mpz_sqrtrem.
1051
1052         * mpn/generic/sqrtrem.c (invsqrttab): Reduce size removing common byte.
1053
1054         * mpz/bin_uiui.c (mul3, mul4, mul8): Remove unneeded shifts.
1055         (MAXFACS): Redefine, using the shared (safer) log_n_max.
1056
1057 2012-05-08  Torbjorn Granlund  <tege@gmplib.org>
1058
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.
1061
1062 2012-05-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
1063
1064         * mpn/minithres/gmp-mparam.h: Updated TOOM6 and FAC_DSC.
1065         * tests/mpn/toom-sqr-shared.h: Don't test if no range.
1066
1067         * mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.
1068         * tune/tuneup.c: Update minimal threshold for FAC_DSC.
1069
1070 2012-05-06  Torbjorn Granlund  <tege@gmplib.org>
1071
1072         * mpn/arm/v6/sqr_basecase.asm: Simplify n=4 code.
1073
1074 2012-05-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
1075
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.
1080
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.
1085
1086 2012-05-04  Torbjorn Granlund  <tege@gmplib.org>
1087
1088         * tune/tuneup.c: Measure POWM_SEC_TABLE after the REDC thresholds.
1089
1090 2012-05-03  Torbjorn Granlund  <tege@gmplib.org>
1091
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.
1095
1096 2012-05-02  Torbjorn Granlund  <tege@gmplib.org>
1097
1098         * mpz/bin_uiui.c: Make use of CNST_LIMB.
1099
1100 2012-05-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
1101
1102         * mpz/mfac_uiui.c: Support limb != ui.
1103
1104 2012-05-02  Torbjorn Granlund  <tege@gmplib.org>
1105
1106         * mpn/arm/logops_n.asm: Work around register clobbering issue.
1107
1108         * mpn/arm/aorscnd_n.asm: New file.
1109
1110 2012-05-01  Torbjorn Granlund  <tege@gmplib.org>
1111
1112         * configure.in: Put arm dirs in path in proper prio order.
1113
1114         * mpn/arm/logops_n.asm: New file.
1115
1116         * mpz/2fac_ui.c: Fix assumed typo.
1117
1118         * mpn/arm/v6/gmp-mparam.h: New file.
1119
1120         * mpn/arm/v5/gcd_1.asm: Hack for undefined BMOD_1_TO_MOD_1_THRESHOLD.
1121         * mpn/arm/v6t2/gcd_1.asm: Likewise.
1122
1123 2012-04-30  Torbjorn Granlund  <tege@gmplib.org>
1124
1125         * mpn/arm/v6/sqr_basecase.asm: New file.
1126
1127 2012-04-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
1128
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.
1138
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.
1143
1144         * tests/mpz/t-mfac_uiui.c: New file.
1145         * tests/mpz/Makefile.am: Run it.
1146
1147         * doc/gmp.texi: Document mpz_mfac_uiui, collapsing with other factorial functions.
1148
1149         * tests/mpz/t-lcm.c: Test zero too.
1150
1151         * mpz/prodlimbs.c: Simplify threshold (should be tuned, not guessed).
1152
1153 2012-04-29  Torbjorn Granlund  <tege@gmplib.org>
1154
1155         * mpn/arm/aors_n.asm: Tune for more stable performance.
1156
1157         * mpn/arm/aorslsh1_n.asm: New file.
1158
1159         * mpn/arm/mod_34lsub1.asm: New file.
1160
1161         * mpn/arm/v6t2/divrem_1.asm: New file.
1162
1163 2012-04-28  Torbjorn Granlund  <tege@gmplib.org>
1164
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.
1169
1170         * mpn/arm/v6/addmul_1.asm: Rewrite for stable speed, smaller size.
1171         * mpn/arm/v6/mul_1.asm: Likewise.
1172
1173 2012-04-27  Torbjorn Granlund  <tege@gmplib.org>
1174
1175         * configure.in: Search arm/v6t2 for arm7.
1176
1177         * mpn/arm/v5/gcd_1.asm: New file.
1178         * mpn/arm/v6t2/gcd_1.asm: New file.
1179
1180         * mpn/arm/mode1o.asm: New file.
1181         * mpn/arm/v6t2/mode1o.asm: New file.
1182
1183         * mpn/arm/arm-defs.m4 (LEA): New define.
1184         * mpn/arm/invert_limb.asm: Use LEA.
1185
1186 2012-04-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1187
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.
1192
1193 2012-04-24  Torbjorn Granlund  <tege@gmplib.org>
1194
1195         * mpn/arm/v6/addmul_2.asm: New file.
1196         * mpn/arm/v6/mul_2.asm: New file.
1197
1198 2012-04-23  Torbjorn Granlund  <tege@gmplib.org>
1199
1200         * mpn/arm/aorsmul_1.asm: Tweak loop control for a 6% speed increase.
1201
1202 2012-04-22  Torbjorn Granlund  <tege@gmplib.org>
1203
1204         * configure.in: Recognise ARM sub-architectures.
1205
1206         * configfsf.guess: Update to current FSF version.
1207         * configfsf.sub: Likewise.
1208
1209         * mpn/arm/bdiv_dbm1c.asm: New file.
1210
1211         * mpn/arm/v6/mul_1.asm: New file.
1212         * mpn/arm/v6/addmul_1.asm: New file.
1213
1214 2012-04-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
1215
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.
1221
1222         * tune/common.c (speed_mpz_bin_ui): New function.
1223         * tune/speed.h: Declare it.
1224         * tune/speed.c: Use it.
1225
1226 2012-04-21  Torbjorn Granlund  <tege@gmplib.org>
1227
1228         * mpn/arm/mul_1.asm: Cleanup.
1229         * mpn/arm/copyi.asm: Cleanup, assume allocate-on-write cache.
1230         * mpn/arm/copyd.asm: Likewise.
1231
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.
1235
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.
1239
1240         * mpn/arm/com.asm: New file.
1241         * mpn/arm/lshift.asm: New file.
1242         * mpn/arm/rshift.asm: New file.
1243
1244 2012-04-20  Torbjorn Granlund  <tege@gmplib.org>
1245
1246         * tests/mpq/io.c: New file.
1247         * tests/mpq/Makefile.am: Run it.
1248
1249         * mpz/clrbit.c: Simplify along the lines of setbit.c.
1250
1251 2012-04-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
1252
1253         * mpz/setbit.c: Simplify.
1254
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.
1261
1262         * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): Move declarations,
1263         and assume that n and k are not small.
1264
1265 2012-04-19  Torbjorn Granlund  <tege@gmplib.org>
1266
1267         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-remove.
1268
1269         * tests/mpz/t-remove.c: Clear out mpz variables.
1270
1271         * tests/mpz/t-cong.c (check_random): Use much larger numbers.
1272         (check_data): Check congruences mod 0.
1273
1274         * tests/mpz/t-divis.c: Test divisibility by zero.
1275
1276         * tests/mpz/reuse.c: Test mpz_mod.
1277
1278         * mpz/setbit.c: Remove dead code.  Use CNST_LIMB.
1279         * mpz/clrbit.c: Use CNST_LIMB.
1280
1281 2012-04-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
1282
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.
1287
1288         * mpz/bin_uiui.c (mpz_goetgheluck_bin_uiui): New, factor-based
1289         implementation.
1290         * tests/mpz/t-bin.c: Extend tests, to cover _goetgheluck.
1291
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.
1299
1300 2012-04-17  Torbjorn Granlund  <tege@gmplib.org>
1301
1302         * mpn/x86_64/coreisbr/aorsmul_1.asm: Fix some DOS64 issues.
1303         * mpn/x86_64/coreisbr/mul_1.asm: Likewise.
1304
1305         * mpn/x86_64/fastsse/lshiftc-movdqu2.asm: Adhere to DOS64 register
1306         partitioning rules.
1307
1308         * mpn/x86_64/fastsse/copyi-palignr.asm: Implement temporary workaround
1309         to overlap issue.
1310
1311 2012-04-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
1312
1313         * mpz/bin_uiui.c: Support small limbs (fallback on bin_ui).
1314
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.
1322
1323         * mpn/generic/sbpi1_bdiv_q.c: Move ASSERTs, to support qp = np.
1324
1325 2012-04-17  Torbjorn Granlund  <tege@gmplib.org>
1326
1327         * mpn/x86_64/copyd.asm: Rewrite.
1328         * mpn/x86_64/copyi.asm: Rewrite.
1329
1330 2012-04-16  Torbjorn Granlund  <tege@gmplib.org>
1331
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.
1335
1336         * mpn/x86_64/x86_64-defs.m4 (palignr): New macro.
1337         (x86_opcode_regxmm, x86_opcode_regxmm_list): New, made from x86 mmx
1338         counterparts.
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.
1342
1343 2012-04-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
1344
1345         * tests/mpz/t-bin.c: Add more tests on small values.
1346         * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): Smaller temporary areas.
1347
1348 2012-04-15  Torbjorn Granlund  <tege@gmplib.org>
1349
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.
1358
1359 2012-04-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
1360
1361         * mpz/bin_uiui.c: Rewrite (some parts are Torbjorn's).
1362         * gen-fac_ui.c: Generate new constants for bin_uiui.
1363
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
1366         implementation.
1367
1368         * tests/mpz/t-fac_ui.c: Check Wilson's theorem on a big value.
1369
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.
1373
1374         * mpz/mul_i.h: Small clean-up.
1375
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 .
1383
1384         * mpn/generic/toom62_mul.c: Use add_n, sub_n, when possible.
1385
1386 2012-04-12  Torbjorn Granlund  <tege@gmplib.org>
1387
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.
1397
1398         * mpn/x86_64/fastsse/lshift.asm: Simplify to very basic form.
1399
1400 2012-04-11  Niels Möller  <nisse@lysator.liu.se>
1401
1402         * Makefile.am (check-mini-gmp): Pass -I../.. in EXTRA_CFLAGS, to
1403         locate gmp.h.
1404
1405 2012-04-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
1406
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.
1411
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.
1415
1416 2012-04-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
1417
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.
1423
1424 2012-04-07  Torbjorn Granlund  <tege@gmplib.org>
1425
1426         * mpn/ia64/gcd_1.asm: Rewrite inner loop to use ctz table.
1427
1428 2012-04-05  Torbjorn Granlund  <tege@gmplib.org>
1429
1430         * mpn/powerpc64/p7/popcount.asm: Properly extend arg n for mode32.
1431         * mpn/powerpc64/p7/hamdist.asm: Likewise.
1432
1433 2012-04-04  Torbjorn Granlund  <tege@gmplib.org>
1434
1435         * mpn/powerpc64/p7/popcount.asm: New file.
1436         * mpn/powerpc64/p7/hamdist.asm: New file.
1437
1438         * longlong.h (ARM count_leading_zeros): Enable for more arch versions.
1439
1440         * mpn/x86_64/gcd_1.asm: Make room for DOS64 regparm shadow area.
1441         * mpn/x86_64/core2/gcd_1.asm: Likewise.
1442
1443 2012-04-03  Torbjorn Granlund  <tege@gmplib.org>
1444
1445         * mpn/x86_64/coreisbr/aorrlsh_n.asm: Make it actually work for DOS64.
1446
1447 2012-04-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
1448
1449         * mpz/oddfac_1.c: Initalize size for ASSERT.
1450
1451 2012-04-02  Torbjorn Granlund  <tege@gmplib.org>
1452
1453         * gmp-h.in (_GMP_H_HAVE_FILE): Test also __STDIO_LOADED (for VMS).
1454
1455         * gmp-impl.h (doprnt_format_t, etc): Remove bogus __GMP_DECLSPECs.
1456
1457 2012-03-30 Marco Bodrato <bodrato@mail.dm.unipi.it>
1458
1459         * mpn/x86_64/sqr_basecase.asm: Speed-up for small cases.
1460
1461 2012-03-29  Torbjorn Granlund  <tege@gmplib.org>
1462
1463         * mpn/sparc64/gcd_1.asm: New file.
1464
1465 2012-03-27  Torbjorn Granlund  <tege@gmplib.org>
1466
1467         * config.guess: Fix typo in coreisbr recognition.
1468
1469 2012-03-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1470
1471         * mpn/x86_64/gcd_1.asm: Reduce latency.
1472         * mpn/x86_64/mul_basecase.asm: Save one jump.
1473
1474         * mpz/iset_ui.c: Don't realloc.
1475
1476 2012-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
1477
1478         * mp_clz_tab.c: Add __clz_tab[128].
1479         * longlong.h (count_trailing_zeros): Use it in pure C variant.
1480
1481 2012-03-20  Torbjorn Granlund  <tege@gmplib.org>
1482
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.
1486
1487         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Minor spacing cleanup.
1488
1489 2012-03-19  Torbjorn Granlund  <tege@gmplib.org>
1490
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.
1495
1496 2012-03-19 Marco Bodrato <bodrato@mail.dm.unipi.it>
1497
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.
1501
1502         * longlong.h (_PROTO): Remove.
1503
1504 2012-03-18  Torbjorn Granlund  <tege@gmplib.org>
1505
1506         * longlong.h (count_trailing_zeros): Write better pure C default
1507         variant.
1508
1509         * mpn/x86/p6/gcd_1.asm: Remove forgotten x86_64 reference.
1510
1511         * mpn/x86/p6/gmp-mparam.h: Update, to get BMOD_1_TO_MOD_1_THRESHOLD
1512         defined for fat binaries.
1513
1514 2012-03-17  Torbjorn Granlund  <tege@gmplib.org>
1515
1516         * mpn/x86/k7/gcd_1.asm: Rewrite.
1517         * mpn/x86/p6/gcd_1.asm: New file.
1518
1519         * mpn/x86_64/core2/gcd_1.asm: Conditionally suppress reduction calls.
1520         * mpn/x86_64/gcd_1.asm: Rewrite.
1521
1522 2012-03-15  Torbjorn Granlund  <tege@gmplib.org>
1523
1524         * mpn/generic/gcd_1.c: Parameterise zerotab code.
1525
1526         * mpn/x86_64/nano/gcd_1.asm: New file, grabbing core2 asm file.
1527
1528         * mpn/x86_64/core2/gcd_1.asm: Speed up loop code, simplify non-loop
1529         code.
1530
1531 2012-03-13  Torbjorn Granlund  <tege@gmplib.org>
1532
1533         * mpn/x86_64/core2/gcd_1.asm: Add hack to support fat builds.
1534
1535         * mpn/x86_64/core2/gcd_1.asm: Shorten critical path.
1536
1537 2012-03-12  Torbjorn Granlund  <tege@gmplib.org>
1538
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.
1542
1543         * mpn/x86_64/bobcat/sqr_basecase.asm: New file.
1544         * mpn/x86_64/bobcat/mul_basecase.asm: Minor tuning.
1545
1546 2012-03-10  Torbjorn Granlund  <tege@gmplib.org>
1547
1548         * configure.in (fat_functions): Add addlsh1_n, addlsh2_n, addmul_2,
1549         mullo_basecase, redc_1, redc_2, sublsh1_n.
1550
1551         * gmp-impl.h (struct cpuvec_t): Add fields for new fat functions.
1552         * gmp-impl.h: Adjust corresponding declarations.
1553
1554         * mpn/generic/redc_2.c (mpn_addmul_2): Make static.
1555
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
1558         out of 8-bit range.
1559
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
1562         value.
1563
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.
1568
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.
1573
1574         * tests/mpn/t-fat.c: Test mullo_basecase.
1575
1576 2012-03-08  Torbjorn Granlund  <tege@gmplib.org>
1577
1578         * mpn/x86_64/coreisbr/addmul_2.asm: Port to DOS64.
1579
1580 2012-02-29  Marc Glisse  <marc.glisse@inria.fr>
1581
1582         * gmpxx.h: Ignore partial C++11 support in g++-4.6.
1583         * tests/cxx/t-cxx11.cc: Likewise.
1584
1585         * gmpxx.h (operator""): New functions.
1586         * tests/cxx/t-cxx11.cc: Test the above.
1587         * doc/gmp.texi: Document the above.
1588
1589 2012-03-08 Marco Bodrato <bodrato@mail.dm.unipi.it>
1590
1591         * acinclude.m4 (GMP_H_ANSI): Remove.
1592         * configure.in: Don't use GMP_H_ANSI.
1593         * gmp-h.in (__GMP_HAVE_PROTOTYPES): Remove.
1594
1595 2012-03-08  Torbjorn Granlund  <tege@gmplib.org>
1596
1597         * mpn/x86_64/fat/fat.c (fake_cpuid_table): Recognise "bulldozer".
1598         (__gmpn_cpuvec_init): Overhaul to match configure.in.
1599
1600         * configure.in: Adjust bulldozer path_64.
1601
1602 2012-03-07  Torbjorn Granlund  <tege@gmplib.org>
1603
1604         * configure.in (x86_64 fat_path): List recently added AMD directories.
1605
1606         * mpn/x86_64/bobcat/copyi.asm: New file.
1607         * mpn/x86_64/bobcat/copyd.asm: New file.
1608
1609         * config.guess: Handle AMD 11h correctly.
1610
1611         * tune/tuneup.c (tune_redc): Better handle situation where redc_2 is
1612         never faster.
1613
1614 2012-03-06  Torbjorn Granlund  <tege@gmplib.org>
1615
1616         * mpn/x86_64/bobcat/mul_basecase.asm: New file.
1617
1618 2012-03-04  Torbjorn Granlund  <tege@gmplib.org>
1619
1620         * mpn/x86_64/bobcat/mul_1.asm: New file.
1621         * mpn/x86_64/bobcat/aorsmul_1.asm: New file.
1622
1623 2012-03-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
1624
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.
1628
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.
1633
1634         * tests/mpz/t-powm.c (allsizes_seen): Require unsigned*.
1635
1636 2012-03-03  Torbjorn Granlund  <tege@gmplib.org>
1637
1638         * mpn/x86_64/k8/gmp-mparam.h: New file.
1639         * mpn/x86_64/k10/gmp-mparam.h: New file.
1640
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.
1647
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.
1654
1655         * gmp-h.in (__GMP_PROTO): Remove.
1656         * Strip __GMP_PROTO usage from all files.
1657         * Strip prototype parameter names from all files.
1658
1659 2012-03-01 Marco Bodrato <bodrato@mail.dm.unipi.it>
1660
1661         * doc/gmp.texi (mpz_invert): Correctly document result range.
1662         * tests/mpz/t-invert.c: Small range correction.
1663
1664 2012-03-01  Torbjorn Granlund  <tege@gmplib.org>
1665
1666         * mpn/x86_64/mullo_basecase.asm: New file.
1667
1668 2012-02-29  Marc Glisse  <marc.glisse@inria.fr>
1669
1670         * gmpxx.h (std::numeric_limits): New partial specialization.
1671
1672 2012-02-29  Niels Möller  <nisse@lysator.liu.se>
1673
1674         * mini-gmp/tests/t-reuse.c: New test case, based on
1675         tests/mpz/reuse.c.
1676
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
1684         input being zero.
1685         (mpz_sqrtrem): Fix for the case r NULL, U zero.
1686
1687         * Makefile.am (check-mini-gmp): Use $(MAKE).
1688         (clean-mini-gmp): New target.
1689         (clean-local, distclean-local): New automake targets. Depend on
1690         clean-mini-gmp.
1691
1692 2012-02-28  Niels Möller  <nisse@lysator.liu.se>
1693
1694         * Makefile.am (check-mini-gmp): New target, for running the
1695         mini-gmp testsuite.
1696
1697         * mini-gmp/tests/Makefile (srcdir, MINI_GMP_DIR): New make
1698         variables. These can be overridden when using a separate build
1699         directory.
1700         (EXTRA_CFLAGS): Renamed, was OPTFLAGS.
1701
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.
1707
1708 2012-02-27  Torbjorn Granlund  <tege@gmplib.org>
1709
1710         * mpn/x86_64/fastsse/lshiftc.asm: New file.
1711         * mpn/x86_64/fastsse/com.asm: New file.
1712
1713         * mpn/x86_64/bd1/popcount.asm: New file.
1714         * mpn/x86_64/bd1/hamdist.asm: New file.
1715
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.
1719
1720 2012-02-26  Torbjorn Granlund  <tege@gmplib.org>
1721
1722         * mpn/x86_64/coreisbr/addmul_2.asm: New file.
1723
1724         * tests/devel/try.c (param_init): Don't require addmul_N to handle
1725         overlap.
1726
1727         * mpn/x86_64/bd1/mul_1.asm: New file.
1728         * mpn/x86_64/bd1/aorsmul_1.asm: New file.
1729
1730 2012-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
1731
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.
1738
1739         * mpz/oddfac_1.c (mpz_oddfac_1): Use umul_ppmm when size = 2.
1740
1741 2012-02-26  Niels Möller  <nisse@lysator.liu.se>
1742
1743         * mini-gmp: New subdirectory. For use by GMP bootstrap, and as a
1744         fallback for applications needing bignums but not high
1745         performance.
1746
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.
1751
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.
1759
1760         * Makefile.am: Replaced all uses of dumbmp.c by bootstrap.c.
1761         (EXTRA_DIST, dist-hook): Arrange for distribution of the mini-gmp
1762         files.
1763
1764 2012-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
1765
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.
1771
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.
1775
1776 2012-02-24  Torbjorn Granlund  <tege@gmplib.org>
1777
1778         * tests/mpn/logic.c: New file.
1779         * tests/mpn/Makefile.am (check_PROGRAMS): Add logic.
1780
1781         * tests/mpz/t-invert.c: New file.
1782         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-invert.
1783
1784 2012-02-24  Marc Glisse  <marc.glisse@inria.fr>
1785
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.
1789
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.
1819
1820         * tests/mpq/t-inv.c: New test file.
1821         * tests/mpq/Makefile.am: Add the above.
1822
1823         * gmpxx.h (__gmp_set_expr): Use mpq_set_z.
1824
1825         * mpq/md_2exp.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
1826         * mpq/set_d.c: Likewise.
1827         * mpq/set_f.c: Likewise.
1828
1829 2012-02-24  Niels Möller  <nisse@lysator.liu.se>
1830
1831         * mpn/x86_64/core2/aorsmul_1.asm: Added mpn_addmul_1c and
1832         mpn_submul_1c entry points.
1833
1834 2012-02-23  Marc Glisse  <marc.glisse@inria.fr>
1835
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.
1869
1870         * tests/cxx/t-ops.cc: Test mpz_abs reallocation.
1871
1872 2012-02-23  Torbjorn Granlund  <tege@gmplib.org>
1873
1874         * mpn/x86_64/core2/rsh1aors_n.asm: Complete rewrite.
1875         * mpn/x86_64/coreisbr/rsh1aors_n.asm: Move old core2 code here.
1876
1877         * mpn/x86_64/redc_1.asm: Make it work for DOS64 (broken in last edit).
1878
1879 2012-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
1880
1881         * mpn/generic/toom_interpolate_8pts.c: Compute carry iif non-trivial.
1882
1883         * mpz/gcdext.c: Adapt to relaxed mpn_gcdext's input requirements.
1884
1885         * mpz/and.c: Use mpn_ logic everywhere. Reduce branches.
1886         * mpz/ior.c: Likewise.
1887         * mpz/xor.c: Likewise.
1888
1889 2012-02-20  Torbjorn Granlund  <tege@gmplib.org>
1890
1891         * mpn/x86_64/coreisbr/mul_1.asm: New file.
1892
1893         * mpn/x86_64/coreisbr/aorsmul_1.asm: New file.
1894
1895         * mpn/x86_64/mod_34lsub1.asm: Avoid ",pt" branch hint since many
1896         assemblers don't support it.
1897
1898 2012-02-19  Torbjorn Granlund  <tege@gmplib.org>
1899
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.
1903
1904         * mpn/generic/redc_2.c:  Remove mpn_sub_n call, return carry from
1905         mpn_add_n call.
1906
1907         * gmp-impl.h (mpn_redc_1, mpn_redc_2): Now return an mp_limb_t.
1908
1909         * tune/speed.h (SPEED_ROUTINE_REDC_1): Adopt to pass RP argument.
1910
1911         * tests/refmpn.c (refmpn_redc_1): Adopt to new redc_1 interface.
1912
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.
1916
1917 2012-02-18  Marc Glisse  <marc.glisse@inria.fr>
1918
1919         * gmpxx.h (std::common_type): New partial specialization in C++11.
1920         * tests/cxx/t-cxx11.cc: Test it.
1921
1922         * gmpxx.h: Don't declare long double functions that are never defined.
1923
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.
1927
1928 2012-02-17  Marc Glisse  <marc.glisse@inria.fr>
1929
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.
1933
1934 2012-02-16  Marc Glisse  <marc.glisse@inria.fr>
1935
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.
1939
1940 2012-02-15  Niels Möller  <nisse@lysator.liu.se>
1941
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.
1949
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
1955         tuning setup.
1956
1957 2012-02-14  Niels Möller  <nisse@lysator.liu.se>
1958
1959         * mpn/generic/toom54_mul.c: New file, originally contributed by
1960         Marco.
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.
1965
1966 2012-02-13  Niels Möller  <nisse@lysator.liu.se>
1967
1968         * configure.in: Display summary of options.
1969
1970 2012-02-11  Torbjorn Granlund  <tege@gmplib.org>
1971
1972         * tests/tests.h (TESTS_REPS): Print any non-standard repetitions.
1973
1974 2012-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
1975
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.
1979
1980 2012-02-10  Niels Möller  <nisse@lysator.liu.se>
1981
1982         * tests/mpz/t-gcd.c (gcdext_valid_p): Enforce sligthly stricter
1983         bound for cofactors.
1984
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.
1988
1989 2012-02-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
1990
1991         * gmp-impl.h (mpn_toom3*_itch): Support any recursion depth.
1992         * tests/refmpn.c (refmpn_mul): Restore tight allocations.
1993
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.
1997
1998 2012-02-09  Marc Glisse  <marc.glisse@inria.fr>
1999
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.
2011
2012 2012-02-08  Torbjorn Granlund  <tege@gmplib.org>
2013
2014         * mpn/powerpc32/divrem_2.asm: Fix off-by-one condition in invert_limb
2015         code.
2016
2017 2012-02-08  Niels Möller  <nisse@lysator.liu.se>
2018
2019         * doc/gmp.texi (mpz_gcdext): Clarified corner cases in cofactor
2020         canonicalization.
2021
2022 2012-02-07  Niels Möller  <nisse@lysator.liu.se>
2023
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.
2026
2027 2012-02-06  Niels Möller  <nisse@lysator.liu.se>
2028
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
2031         found in hgcd.c.
2032
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.
2036
2037 2012-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
2038
2039         * tests/refmpn.c (refmpn_mul): More conservative allocations.
2040
2041 2012-02-03  Torbjorn Granlund  <tege@gmplib.org>
2042
2043         * mpn/x86_64/bd1/gmp-mparam.h: New file.
2044
2045         * longlong.h (udiv_qrnnd from sdiv_qrnnd): Declare udiv_w_sdiv.
2046
2047         * mpn/generic/udiv_w_sdiv.c: Use c89 function header.
2048
2049 2012-02-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
2050
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 .
2057
2058 2012-02-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
2059
2060         * mpn/generic/toom_interpolate_16pts.c: Correct an unlikely 32-bit bug.
2061
2062 2012-02-02  Torbjorn Granlund  <tege@gmplib.org>
2063
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.
2066
2067         * tests/mpn/t-toom6h.c (MIN_BN): Make more consistent with ASSERT in
2068         tested function.
2069
2070 2012-02-01  Torbjorn Granlund  <tege@gmplib.org>
2071
2072         * tests/mpn/t-mul.c: New file.
2073         * tests/mpn/Makefile.am: Compile it.
2074
2075 2012-02-01  Marc Glisse  <marc.glisse@inria.fr>
2076
2077         * gmpxx.h: Remove check for g++ older than 2.91.
2078
2079 2012-02-01  Niels Möller  <nisse@lysator.liu.se>
2080
2081         * mpn/generic/mul.c: Added diagram on where toom functions can be
2082         called.
2083
2084 2012-02-01  Marc Glisse  <marc.glisse@inria.fr>
2085
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.
2094
2095 2012-01-31  Torbjorn Granlund  <tege@gmplib.org>
2096
2097         * mpn/generic/powm_sec.c (SQR_BASECASE_LIM): New name for
2098         SQR_BASECASE_MAX.
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.
2103
2104 2012-01-30  Torbjorn Granlund  <tege@gmplib.org>
2105
2106         * tests/mpz/t-powm.c: Ensure all sizes are seen.
2107
2108 2012-01-30  Marc Glisse  <marc.glisse@inria.fr>
2109
2110         * gmpxx.h (__gmp_binary_expr): Let things happen in place: d=a+b+c
2111         when d != c.
2112         * tests/cxx/t-binary.cc: Test variable reuse: c=a+b+c.
2113
2114 2012-01-28  Marc Glisse  <marc.glisse@inria.fr>
2115
2116         * gmpxx.h: Don't compute -LONG_MIN.
2117
2118         * doc/gmp.texi (gmp_randclass::get_z_bits): Use mp_bitcnt_t.
2119         * gmpxx.h: Replace unsigned long with mp_bitcnt_t.
2120
2121 2012-01-27  Torbjorn Granlund  <tege@gmplib.org>
2122
2123         * Upgrade to libtool 2.4.2.
2124
2125 2012-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
2126
2127         * tests/mpz/t-fac_ui.c: Increase default test cases.
2128
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.
2135
2136 2012-01-25  Torbjorn Granlund  <tege@gmplib.org>
2137
2138         * tune/tuneup.c: Remove unused tuneup variables.
2139
2140 2012-01-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
2141
2142         * mpz/fac_ui.c: Reduce branches in basecases.
2143
2144 2012-01-18  Marc Glisse  <marc.glisse@inria.fr>
2145
2146         * doc/gmp.texi (mpf_class::mpf_class): Use mp_bitcnt_t.
2147
2148 2012-01-17  Torbjorn Granlund  <tege@gmplib.org>
2149
2150         * configure.in: Add ultrasparc T4 support.
2151
2152         * demos/isprime.c (main): Run 25 millerrabin tests.
2153
2154 2012-01-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
2155
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.
2161
2162 2012-01-15  Niels Möller  <nisse@lysator.liu.se>
2163
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.
2167
2168 2012-01-12  Torbjorn Granlund  <tege@gmplib.org>
2169
2170         * tests/t-popc.c: Test longer bit strings.
2171
2172 2012-01-12 Marco Bodrato <bodrato@mail.dm.unipi.it>
2173
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).
2177
2178 2012-01-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
2179
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_.
2182
2183 2012-01-07  Torbjorn Granlund  <tege@gmplib.org>
2184
2185         * mpz/mul_2exp.c: Rewrite.
2186         * mpz/tdiv_q_2exp.c: Rewrite.
2187
2188 2012-01-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
2189
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.
2195
2196         * tune/tuneup.c (tune_fac_ui): min_is_always for FAC_ODD_.
2197
2198 2012-01-02 Marco Bodrato <bodrato@mail.dm.unipi.it>
2199
2200         * tune/tuneup.c (tune_fac_ui): Compute FAC_DSC before FAC_ODD.
2201
2202 2011-12-31  Torbjorn Granlund  <tege@gmplib.org>
2203
2204         * Makefile.am (fac_ui.h): Put file in top-level dir, not in mpz.
2205
2206 2011-12-31 Marco Bodrato <bodrato@mail.dm.unipi.it>
2207
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.
2219
2220 2011-12-30  Torbjorn Granlund  <tege@gmplib.org>
2221
2222         * mpz/hamdist.c: Fix typo in a return statement.
2223
2224         * mpn/generic/powm_sec.c (SQR_BASECASE_MAX): Set safely from
2225         SQR_TOOM2_THRESHOLD.
2226
2227 2011-12-17  Torbjorn Granlund  <tege@gmplib.org>
2228
2229         * tests/mpz/t-perfpow.c: Decrease default # of tests.
2230
2231 2011-12-16  Torbjorn Granlund  <tege@gmplib.org>
2232
2233         * tests/refmpn.c (AORS_1): Fix typo in variable type.
2234
2235 2011-12-10  Torbjorn Granlund  <tege@gmplib.org>
2236
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.
2240
2241 2011-12-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
2242
2243         * mpz/fac_ui.c: fac_bc_ui inlined in fac_ui.
2244
2245 2011-12-08  Torbjorn Granlund  <tege@gmplib.org>
2246
2247         * mpn/generic/powm_sec.c: Handle fat binaries better.
2248
2249         * mpz/fac_ui.c (mpz_bc_fac_1): Fix typo in allocation size.
2250
2251         * mpn/x86/fat/com.c: New file.
2252
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.
2256
2257         * mpn/x86_64/gcd_1.asm: Support DOS64.
2258
2259 2011-12-07  Torbjorn Granlund  <tege@gmplib.org>
2260
2261         * configure.in: Fix typo making HAVE_NATIVE_mpn_X fail for fat
2262         functions.
2263
2264         * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Add a missing break.
2265
2266 2011-12-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
2267
2268         * gen-fac_ui.c: Generate two more tables: odd factorial, swing.
2269
2270         * mpz/fac_ui.c: Rewrite.
2271
2272 2011-12-06  Niels Möller  <nisse@lysator.liu.se>
2273
2274         * mpn/generic/hgcd.c (mpn_hgcd): Use hgcd_reduce for first
2275         recursive call.
2276
2277 2011-12-06  Torbjorn Granlund  <tege@gmplib.org>
2278
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.
2282
2283 2011-12-05  Torbjorn Granlund  <tege@gmplib.org>
2284
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.
2289
2290         * mpn/x86/fat/diveby3.c: Remove no longer fat function.
2291         * mpn/x86_64/fat/diveby3.c: Likewise.
2292
2293         * mpn/x86_64/fat/gcd_1.c: Remove since always provided as asm.
2294         * mpn/x86_64/fat/mode1o.c: Likewise.
2295
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.
2304
2305         * mpn/x86_64: Port most remaining x86_64 files to DOS64.
2306
2307         * mpn/x86_64/coreisbr/aors_n.asm: Add forgotten DOS64_EXIT.
2308
2309         * mpn/x86_64/x86_64-defs.m4 (LEA): Handle non-PIC code.
2310         * mpn/x86_64/darwin.m4 (LEA): Likewise.
2311
2312 2011-12-04  Torbjorn Granlund  <tege@gmplib.org>
2313
2314         * mpn/x86_64/fat/fat.c (MAKE_FMS): Rewrite to handle modern CPUs.
2315         * mpn/x86/fat/fat.c (MAKE_FMS): Likewise.
2316
2317         * mpn/x86_64/darwin.m4 (PROTECT): Define to potentially useful value.
2318
2319 2011-12-02  Torbjorn Granlund  <tege@gmplib.org>
2320
2321         * mpn/x86_64/invert_limb_table.asm: Use PROTECT.
2322         * mpn/x86_64/invert_limb.asm: Likewise.
2323
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.
2327
2328 2011-12-01  Torbjorn Granlund  <tege@gmplib.org>
2329
2330         * mpn/x86_64/fat/fat.c: Copy fake cpuid code from x86/fat/fat.c.
2331
2332         * mpn/x86_64 (STD64, IFSTD): New names for ELF64, IFELF (since these
2333         denote all standard calling conventions).
2334
2335         * mpn/x86_64: Add DOS64 ABI support to more files.
2336
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.
2340
2341         * configure.in: Add GMP_NONSTD_ABI also for fat builds.
2342
2343         * mpn/x86_64/fat/fat_entry.asm: Rewrite to support DOS64.
2344
2345         * mpn/x86_64/dos64.m4 (IFDOS, IFSTD): New defines.
2346         * mpn/x86_64/x86_64-defs (IFDOS, IFSTD): New defines.
2347
2348         * mpn/x86_64/dive_1.asm: Add DOS64 ABI support.
2349         * mpn/x86_64/mode1o.asm: Likewise.
2350
2351         * mpn/x86_64/mod_34lsub1.asm: Enable for DOS64.
2352
2353         * mpn/x86_64/invert_limb.asm: Wrap .protected decl.
2354
2355         * gmp-impl.h (DECL_divexact_1): Fix typo in return type.
2356
2357         * mpn/x86_64/dos64.m4 (LEA): New define.
2358         (PIC): Define.
2359
2360 2011-11-29  Torbjorn Granlund  <tege@gmplib.org>
2361
2362         * mpn/x86_64: Add DOS64 ABI support to most files.
2363
2364 2011-11-28  Torbjorn Granlund  <tege@gmplib.org>
2365
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.
2370
2371         * mpn/x86_64/x86_64-defs.m4 (DOS64_ENTRY, DOS64_EXIT): New, empty defs.
2372
2373         * mpn/x86_64/dos64.m4: New file.
2374
2375         * mpn/asm-defs.m4 (ABI_SUPPORT): New dummy macro.
2376
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.
2380
2381         * mpn/generic/udiv_w_sdiv.c: Use CNST_LIMB for some constants.
2382
2383 2011-11-25  Torbjorn Granlund  <tege@gmplib.org>
2384
2385         * x86/*: Many new gmp-mparam.h file for 64-bit CPUs in 32-bit mode.
2386
2387         * configure.in: Overhaul x86/x86_64 support, merging three case
2388         statements into one.
2389
2390 2011-11-24  Torbjorn Granlund  <tege@gmplib.org>
2391
2392         * doc/gmp.texi (Formatted Output Strings): Clarify rules for mpf_t
2393         precision.
2394
2395         * mpn/powerpc32/p7/gmp-mparam.h: New file.
2396
2397         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Up min_size to karatsuba's
2398         threshold.
2399
2400 2011-11-22  Torbjorn Granlund  <tege@gmplib.org>
2401
2402         * mpn/powerpc64/mode64/p6/aorsmul_1.asm: New file.
2403
2404         * configure.in: Don't fail fat builds under 64-bit DOS.
2405
2406         * mpn/powerpc64/mode64/aors_n.asm: Align loop for slightly better
2407         power5 performance.
2408
2409 2011-11-21  Torbjorn Granlund  <tege@gmplib.org>
2410
2411         * gmp-h.in (__GNU_MP_RELEASE): Renamed from typo name.
2412
2413 2011-11-20  Torbjorn Granlund  <tege@gmplib.org>
2414
2415         * configure.in: Split x86 CPUs into more subtypes for more accurate
2416         passing of gcc flags.
2417
2418         * mpn/powerpc32/p3-p7/aors_n.asm: New file.
2419
2420         * configure.in: Pass -m32 for powerpc64 with abi=32, using via _maybe
2421         mechanism.
2422
2423         * configure.in: Support powerpc32/p3-p7 directory for affected CPUs.
2424
2425 2011-11-17  Torbjorn Granlund  <tege@gmplib.org>
2426
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.
2433
2434 2011-11-17  Niels Möller  <nisse@lysator.liu.se>
2435
2436         * tune/tuneup.c (tune_hgcd_appr): Increase stop_since_change.
2437
2438 2011-11-16  Torbjorn Granlund  <tege@gmplib.org>
2439
2440         * mpn/powerpc32/tabselect.asm: New file.
2441
2442         * mpn/powerpc64/mode64/aorscnd_n.asm: New file.
2443
2444 2011-11-15  Niels Möller  <nisse@lysator.liu.se>
2445
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.
2451
2452         * tune/speed.c (routine): Added mpn_hgcd_appr_lehmer.
2453
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.
2457
2458         * tune/Makefile.am (libspeed_la_SOURCES): Added
2459         hgcd_appr_lehmer.c.
2460
2461         * tune/hgcd_appr_lehmer.c: New file.
2462
2463         * tune/tuneup.c (tune_hgcd_appr): Increased min_size to 50; some
2464         machines got small thresholds which appear to be bogus.
2465
2466 2011-11-15  Torbjorn Granlund  <tege@gmplib.org>
2467
2468         * mpn/generic/powm_sec.c (mpn_local_sqr): Remove forgotten TMP_* calls.
2469         (redcify): Likewise.
2470         (mpn_powm_sec): Likewise.
2471
2472         * mpn/generic/powm_sec.c (mpn_powm_sec): Rework scratch usage
2473         (mpn_powm_sec_itch): Rewrite.
2474
2475         * mpn/generic/powm_sec.c (mpn_powm_sec): Use mpn_tabselect also in
2476         initialisation.
2477
2478         * configure.in: Amend 2011-11-03 gcc_cflags change.
2479
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.
2484
2485         * mpn/asm-defs.m4 (define_mpn): Add tabselect.
2486
2487         * configure.in (gmp_mpn_functions): Add tabselect.
2488         (HAVE_NATIVE): Add entries for addncd_n, subcnd_n, tabselect.
2489
2490         * mpn/generic/powm_sec.c: Remove mpn_tabselect implementation.
2491         * mpn/generic/tabselect.c: New file with removed code.
2492
2493 2011-11-13  Torbjorn Granlund  <tege@gmplib.org>
2494
2495         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add powm_sec.c.
2496
2497         * mpn/generic/powm_sec.c (win_size): Use POWM_SEC_TABLE
2498         (POWM_SEC_TABLE): Define default.
2499
2500         * tune/tuneup.c (tune_powm_sec): New function computing POWM_SEC_TABLE.
2501         (all): Call new function.
2502
2503         * mpn/generic/powm_sec.c (win_size): Define only when
2504         TUNE_PROGRAM_BUILD is not set.
2505
2506 2011-11-13  Niels Möller  <nisse@lysator.liu.se>
2507
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.
2511
2512 2011-11-11  Torbjorn Granlund  <tege@gmplib.org>
2513
2514         * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: Remove.
2515
2516 2011-11-11  Niels Möller  <nisse@lysator.liu.se>
2517
2518         * tune/hgcd_reduce_2.c: New file.
2519         * tune/hgcd_reduce_1.c: New file.
2520
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.
2526
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.
2531
2532         * tune/speed.c (routine): Added mpn_hgcd_reduce,
2533         mpn_hgcd_reduce_1, and mpn_hgcd_reduce_2.
2534
2535         * tune/common.c (speed_mpn_hgcd_reduce): New function.
2536         (speed_mpn_hgcd_reduce_[12]): Likewise.
2537
2538         * tune/Makefile.am (libspeed_la_SOURCES): Added hgcd_reduce_1.c
2539         hgcd_reduce_2.c.
2540         (TUNE_MPN_SRCS_BASIC): Added hgcd_appr.c and hgcd_reduce.c.
2541
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.
2545
2546 2011-11-09  Torbjorn Granlund  <tege@gmplib.org>
2547
2548         * mpn/powerpc64/mode64/sqr_basecase.asm: New file.
2549
2550         * mpn/x86_64/aorscnd_n.asm: New file.
2551
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.
2555
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.
2559
2560         * configure.in (gmp_mpn_functions): Add addcnd_n and subcnd_n.
2561
2562 2011-11-07  Torbjorn Granlund  <tege@gmplib.org>
2563
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.
2567
2568         * mpn/generic/redc_1_sec.c: Remove.
2569
2570         * gmp-impl.h (mpn_redc_1): Update declaration.
2571         (mpn_redc_1_sec): Remove declaration.
2572
2573         * configure.in (gmp_mpn_functions): Remove redc_1.
2574
2575         * mpn/x86_64/redc_1.asm: Adopt to new defined functionality/interface.
2576         * tune/speed.h (SPEED_ROUTINE_REDC_1): Likewise.
2577
2578         * tests/refmpn.c (refmpn_redc_1): Likewise; also call refmpn_addmul_1
2579         instead of mpn_addmul_1.
2580
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
2583         mpn_redc_1_sec.
2584
2585 2011-11-03  Torbjorn Granlund  <tege@gmplib.org>
2586
2587         * dumbmp.c (mpz_sub): Abort for non-handled case.
2588
2589         * mpn/powerpc64/mode64/lshiftc.asm: Move file from here...
2590         * mpn/powerpc64/lshiftc.asm: ...to here, with trivial modifications.
2591
2592         * configure.in: Pass -m32 in more cases, using _maybe mechanism.
2593         Inherit default gcc_cflags in more places.
2594
2595         * mpn/powerpc64/mode64/p7/gmp-mparam.h: New file.
2596
2597 2011-11-02  Torbjorn Granlund  <tege@gmplib.org>
2598
2599         * mpn/s390_64/invert_limb.asm: Slight optimisation.
2600
2601         * configure.in (s390): Set gcc_32_cflags_maybe.
2602
2603         * mpn/s390_32/gmp-mparam.h: Put in proper data.
2604         * mpn/s390_32/esame/gmp-mparam.h: New file.
2605
2606         * mpn/x86_64/bobcat/gmp-mparam.h: New file.
2607
2608         * mpn/s390_32/lshift.asm: New file.
2609         * mpn/s390_32/rshift.asm: New file.
2610         * mpn/s390_32/lshiftc.asm: New file.
2611
2612 2011-10-31  Torbjorn Granlund  <tege@gmplib.org>
2613
2614         * mpn/powerpc64/sqr_diagonal.asm: Move from here...
2615         * mpn/powerpc64/mode32/sqr_diagonal.asm: ...to here.
2616
2617         * mpn/powerpc64/mode64/sqr_diag_addlsh1.asm: New file.
2618
2619         * mpn/s390_64/sqr_basecase.asm: Rewrite sqr_diag_addlsh1 code.
2620         * mpn/s390_32/esame/sqr_basecase.asm: Likewise.
2621
2622 2011-10-29  Torbjorn Granlund  <tege@gmplib.org>
2623
2624         * mpn/s390_64/lshift.asm: Complete rewrite.
2625         * mpn/s390_64/rshift.asm: Likewise.
2626
2627         * mpn/s390_64/lshiftc.asm: New file.
2628
2629 2011-10-28  Torbjorn Granlund  <tege@gmplib.org>
2630
2631         * mpn/s390_32/esame/aors_n.asm: New file, with rewritten add/sub code.
2632
2633 2011-10-27  Torbjorn Granlund  <tege@gmplib.org>
2634
2635         From Per Olofsson:
2636         * gmp-impl.h (BSWAP_LIMB): Rename variable to avoid BSWAP_LIMB_FETCH
2637         clash.
2638
2639         * mpn/s390_32/esame/mul_basecase.asm: New file.
2640
2641         * mpn/s390_32/esame/sqr_basecase.asm: New file.
2642
2643         * mpn/s390_32/logops_n.asm: New file.
2644
2645         * mpn/s390_64/logops_n.asm: Fix rp=up code.  Remove a leftover insn.
2646
2647 2011-10-26  Niels Möller  <nisse@lysator.liu.se>
2648
2649         * gmp-impl.h (mpn_hgcd_reduce, mpn_hgcd_reduce_itch): Added
2650         prototypes.
2651         (HGCD_APPR_THRESHOLD): Set up threshold for tuning.
2652         (HGCD_REDUCE_THRESHOLD): Likewise.
2653
2654         * configure.in (gmp_mpn_functions): Added hgcd_reduce.
2655
2656         * mpn/generic/hgcd_reduce.c: New file.
2657
2658 2011-10-24  Torbjorn Granlund  <tege@gmplib.org>
2659
2660         * mpn/x86_64/sqr_basecase.asm: Put intermediate result into R, don't
2661         allocate any stack space.
2662
2663 2011-10-23  Torbjorn Granlund  <tege@gmplib.org>
2664
2665         * mpn/s390_64/logops_n.asm: Use nc, oc, xc when possible.
2666
2667         * tune/common.c (speed_mpn_and_n, speed_mpn_andn_n, etc):
2668         Pass correct input args.
2669
2670         * mpn/s390_64/mod_34lsub1.asm: Use llgfr for zero extensions.
2671
2672         * mpn/s390_64/mul_basecase.asm: New file.
2673
2674         * mpn/s390_64/sqr_basecase.asm: New file.
2675         * mpn/s390_64/sqr_diag_addlsh1.asm: Removed, lives on in sqr_basecase.
2676
2677         * mpn/s390_64/bdiv_dbm1c.asm: Shave off 1 c/l.
2678
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.
2682
2683 2011-10-22  Torbjorn Granlund  <tege@gmplib.org>
2684
2685         * mpn/s390_64/logops_n.asm: New file.
2686
2687         * mpn/s390_64/aors_n.asm: New file, with rewritten add/sub code.
2688
2689 2011-10-20  Torbjorn Granlund  <tege@gmplib.org>
2690
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.
2694
2695         * mpn/s390_64/sqr_diag_addlsh1.asm: Rewrite like s390_32/esame code.
2696
2697         * mpn/s390_32/esame/sqr_diag_addlsh1.asm: Save just needed registers.
2698
2699 2011-10-19  Torbjorn Granlund  <tege@gmplib.org>
2700
2701         * mpn/s390_32/esame/add_n.asm: Rewrite, similar to s390_64 code.
2702         * mpn/s390_32/esame/add_n.asm: Likewise.
2703
2704 2011-10-17  Torbjorn Granlund  <tege@gmplib.org>
2705
2706         * mpn/s390_32/esame/aorslsh1_n.asm: New file.
2707
2708 2011-10-16  Torbjorn Granlund  <tege@gmplib.org>
2709
2710         * mpn/s390_32/esame/sqr_diag_addlsh1.asm: New file.
2711
2712         * mpn/s390_32/copyi.asm: New file.
2713         * mpn/s390_32/copyd.asm: New file.
2714
2715         * mpn/s390_64/copyd.asm: Optimise.
2716
2717         * mpn/s390_64/copyi.asm: Rewrite along the lines of glibc memcpy.
2718
2719         * mpn/s390_64/aorslsh1_n.asm: New file.
2720
2721         * mpn/s390_64/mod_34lsub1.asm: New file.
2722
2723         * mpn/s390_64/sqr_diag_addlsh1.asm: New file.
2724
2725 2011-10-15  Torbjorn Granlund  <tege@gmplib.org>
2726
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.
2731
2732 2011-10-14  Torbjorn Granlund  <tege@gmplib.org>
2733
2734         From Per Olofsson:
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
2737         benefit of C++.
2738
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.
2742
2743 2011-10-13  Torbjorn Granlund  <tege@gmplib.org>
2744
2745         * longlong.h (s390): Put back an accidentally deleted #else.
2746
2747         * configure.in (s390): Unset extra_functions for s390x.
2748
2749 2011-10-12  Torbjorn Granlund  <tege@gmplib.org>
2750
2751         * mpn/s390_64/lshift.asm: Reduce register usage.
2752         * mpn/s390_64/rshift.asm: Likewise.
2753
2754         * longlong.h (s390 umul_ppmm): With new-enough gcc, avoid asm.
2755
2756         From Andreas Krebbel:
2757         * longlong.h (s390 umul_ppmm): Support 32-bit limbs with gcc using
2758         64-bit registers.
2759         (s390 udiv_qrnnd): Likewise.
2760
2761 2011-10-11  Torbjorn Granlund  <tege@gmplib.org>
2762
2763         * configure.in (s390x): Pass -mzarch to gcc in 32-bit mode.
2764
2765         * longlong.h (s390x): Add __CLOBBER_CC for relevant asm patterns.
2766         * mpn/generic/mod_1_1.c (s390x add_mssaaaa): Likewise.
2767
2768         * mpn/s390_64/copyd.asm: New file.
2769
2770 2011-10-10  Niels Möller  <nisse@lysator.liu.se>
2771
2772         * mpn/generic/hgcd_appr.c: Deleted debugging code.
2773
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
2777         -v is used.
2778
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.
2783
2784 2011-10-10  Torbjorn Granlund  <tege@gmplib.org>
2785
2786         * mpn/generic/mod_1_1.c (add_mssaaaa): Add s390x variant.  Put arm code
2787         inside __GNUC__.
2788
2789         * tune/time.c (STCK): Use proper memory constraint.
2790
2791         From Marco Trudel:
2792         * tests/mpz/t-scan.c (check_ref): Fix loop end bound.
2793
2794 2011-10-10  Niels Möller  <nisse@lysator.liu.se>
2795
2796         * gmp-impl.h: (HGCD_APPR_THRESHOLD): New threshold.
2797
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
2803         hgcd_appr.
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.
2806
2807 2011-10-09  Torbjorn Granlund  <tege@gmplib.org>
2808
2809         * mpn/s390_64/copyi.asm: New file.
2810         * mpn/s390_64/lshift.asm: New file.
2811         * mpn/s390_64/rshift.asm: New file.
2812
2813         * mpn/s390_64/add_n.asm: Rewrite using lmg/stmg.
2814         * mpn/s390_64/sub_n.asm: Likewise.
2815
2816         * mpn/s390_64/invert_limb.asm: Save a callee-saves register less.
2817
2818         * tune/time.c (getrusage_backwards_p): Properly cast printed values.
2819
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.
2824
2825 2011-10-09  Niels Möller  <nisse@lysator.liu.se>
2826
2827         * mpn/generic/hgcd_matrix.c (mpn_hgcd_matrix_adjust): Declare
2828         matrix argument const.
2829
2830 2011-10-08  Niels Möller  <nisse@lysator.liu.se>
2831
2832         * tests/mpn/t-hgcd_appr.c (hgcd_appr_valid_p): Adjusted the
2833         allowed margin of non-minimality for hgcd_appr.
2834
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.
2840
2841 2011-10-07  Torbjorn Granlund  <tege@gmplib.org>
2842
2843         * longlong.h (s390): Add 32-bit zarch umul_ppmm and udiv_qrnnd.
2844         (s390): Overhaul 32-bit and 64-bit code.
2845
2846 2011-10-07  Niels Möller  <nisse@lysator.liu.se>
2847
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.
2852
2853         * tests/mpn/t-hgcd_appr.c: New file.
2854         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-hgcd_appr.
2855
2856         * configure.in (gmp_mpn_functions): Added hgcd_step and hgcd_appr.
2857
2858         * gmp-impl.h: Added prototypes for mpn_hgcd_step,
2859         mpn_hgcd_appr_itch and mpn_hgcd_appr.
2860
2861         * mpn/generic/hgcd_appr.c: New file.
2862
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
2866         to hgcd_step.c.
2867         (hgcd_hook): Also moved to hgcd_step.c.
2868         (mpn_hgcd): Updated for hgcd_step renaming.
2869
2870 2011-10-06  Torbjorn Granlund  <tege@gmplib.org>
2871
2872         * mpn/s390_64/invert_limb.asm: New file.
2873
2874 2011-10-04  Torbjorn Granlund  <tege@gmplib.org>
2875
2876         * mpn/s390_64/submul_1.asm: New file.
2877         * mpn/s390_32/esame/submul_1.asm: New file.
2878
2879         * mpn/generic/mulmid.c (mpn_mulmid): Move a TMP_DECL to block start.
2880
2881         * mpn/Makefile.am (TARG_DIST): Add s390_32 and s390_64, remove s390 and
2882         z8000x.
2883
2884         * doc/gmp.texi (Custom Allocation): Rephrase a paragraph.
2885
2886         * demos/factorize.c: Run 25 Miller-Rabin tests.
2887
2888         * mpz/nextprime.c: Run 25 mpz_millerrabin tests (was 10).
2889
2890 2011-10-03  Torbjorn Granlund  <tege@gmplib.org>
2891
2892         * configure.in: Support s390x.
2893
2894         * longlong.h: Add support for 64-bit s390x.
2895
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.
2903
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.
2911
2912 2011-10-03  Niels Möller  <nisse@lysator.liu.se>
2913
2914         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mulmid.
2915         * tests/mpn/t-mulmid.c: New file.
2916
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.
2928
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
2948         mpn_mulmid.
2949         * tune/tuneup.c (mulmid_toom42_threshold): New threshold variable.
2950         (tune_mulmid): New function.
2951         (all): Call tune_mulmid.
2952
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.
2980
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
2992         functions.
2993         (GMP_MULFUNC_CHOICES): Handle aors_err1_n, aors_err2_n, and
2994         aors_err3_n.
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.
2999
3000 2011-10-03  Niels Möller  <nisse@lysator.liu.se>
3001
3002         * tune/tune-gcd-p.c (main): Fixed broken loop conditions.
3003
3004 2011-09-26  Torbjorn Granlund  <tege@gmplib.org>
3005
3006         * mpn/sh/sh2/submul_1.asm: Make this old submul_1 implementation
3007         actually compute intended function.
3008
3009         * longlong.h (SH): Recognise predefs for all SH processors as defined
3010         by current gcc versions.
3011
3012 2011-09-25  Torbjorn Granlund  <tege@gmplib.org>
3013
3014         * mpn/sh: Migrate files to '.asm'.
3015         * configure.in: Recognise sh3 and sh4.
3016
3017 2011-09-21  Marc Glisse  <marc.glisse@inria.fr>
3018
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.
3025
3026 2011-08-21  Marc Glisse  <marc.glisse@inria.fr>
3027
3028         * tests/cxx/t-ops2.cc: check mul-div by 2.
3029
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.
3039
3040 2011-08-18  Torbjorn Granlund  <tege@gmplib.org>
3041
3042         * printf/doprntf.c (__gmp_doprnt_mpf): For DOPRNT_CONV_FIXED, ask for
3043         one more digit.
3044
3045 2011-08-17  Torbjorn Granlund  <tege@gmplib.org>
3046
3047         * mpf/sub.c: Fix typo in copy condition.  Delay an allocation.
3048
3049 2011-08-12  Torbjorn Granlund  <tege@gmplib.org>
3050
3051         * gmp-impl.h (LIMBS_PER_DIGIT_IN_BASE): Fix typo.
3052
3053 2011-08-10  Torbjorn Granlund  <tege@gmplib.org>
3054
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.
3058
3059         * tests/rand/t-lc2exp.c (check_bigc): Call abort after reporting error.
3060
3061 2011-08-09  Torbjorn Granlund  <tege@gmplib.org>
3062
3063         * mpz/out_str.c (mpz_out_str): Reinsert accidentally deleted str_size
3064         adjustment.
3065
3066         * gmp-impl.h (DIGITS_IN_BASE_FROM_BITS): Simplify, also avoiding
3067         overflow for base 2.
3068
3069 2011-08-07  Torbjorn Granlund  <tege@gmplib.org>
3070
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:
3081         Use new macros.
3082
3083 2011-08-04  Torbjorn Granlund  <tege@gmplib.org>
3084
3085         * dumbmp.c (mpz_root): Reinsert accidentally removed line.
3086
3087 2011-08-03  Torbjorn Granlund  <tege@gmplib.org>
3088
3089         * dumbmp.c (mpz_tdiv_qr): Correctly handle dividend value being equal
3090         to divisor value.
3091         (mpz_root): Create reasonable starting approximation.
3092         (mpz_sqrt): New function.
3093         (mpz_mul_2exp): Add faster block shifting code, disabled for now.
3094
3095 2011-07-15  Torbjorn Granlund  <tege@gmplib.org>
3096
3097         * mpn/arm/invert_limb.asm: Swap around some registers to silence 'as'
3098         warnings.
3099
3100 2011-07-14  Torbjorn Granlund  <tege@gmplib.org>
3101
3102         * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q): Get mpn_sub_1 size
3103         argument right.
3104
3105 2011-07-04  Torbjorn Granlund  <tege@gmplib.org>
3106
3107         * tests/misc/t-locale.c: Disable test for mingw.
3108
3109         * configure.in (x86_64 *-*-mingw*): Handle also cygwin here; clear out
3110         extra_functions_64.
3111
3112 2011-07-02  Torbjorn Granlund  <tege@gmplib.org>
3113
3114         * config.guess: Don't print newline in x86 cpuid function.
3115         Rewrite x86-64 cpu recognition asm code to work under Windoze.
3116
3117 2011-06-16  Torbjorn Granlund  <tege@gmplib.org>
3118
3119         * acinclude.m4 (GMP_ASM_RODATA): Fix typo in 2011-04-20 change.
3120
3121         * configure.in: Surround tr ranges with [] for portability.
3122
3123 2011-05-25  Niels Möller  <nisse@lysator.liu.se>
3124
3125         * tune/tune-gcd-p.c (search): New function to search for minimum.
3126         (main): Replaced slow linear search.
3127
3128 2011-05-24  Niels Möller  <nisse@lysator.liu.se>
3129
3130         * tune/Makefile.am (EXTRA_PROGRAMS): Added tune-gcd-p. Also added
3131         related automake variables.
3132
3133         * mpn/Makefile.am (tune-gcd-p): Deleted target.
3134
3135         * tune/tune-gcd-p.c: New file, extracted from mpn/generic/gcd.c
3136         and updated.
3137         * mpn/generic/gcd.c: Deleted the corresponding code, including
3138         main function.
3139
3140 2011-05-23  Niels Möller  <nisse@lysator.liu.se>
3141
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.
3145
3146 2011-05-22  Niels Möller  <nisse@lysator.liu.se>
3147
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.
3150
3151 2011-05-21  Niels Möller  <nisse@lysator.liu.se>
3152
3153         * mpz/jacobi.c (mpz_jacobi): The handling of asize == 1 was
3154         broken. Rewrote it.
3155
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
3159         in mpz_jacobi.
3160
3161 2011-05-20  Niels Möller  <nisse@lysator.liu.se>
3162
3163         * gmp-impl.h: Jacobi-related prototypes.
3164
3165         * configure.in (gmp_mpn_functions): Added jacobi_2, jacobi,
3166         hgcd2_jacobi, hgcd_jacobi, and removed jacobi_lehmer.
3167
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.
3171
3172         * mpn/generic/jacobi_lehmer.c: Deleted file.
3173
3174         * mpn/generic/jacobi.c (mpn_jacobi_n): New subquadratic jacobi
3175         implementation. Supersedes jacobi_lehmer.c.
3176
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.
3180
3181         * mpn/generic/jacobi_2.c (mpn_jacobi_2): New file. Extracted from
3182         jacobi_lehmer.c.
3183         * mpn/generic/hgcd2_jacobi.c (mpn_hgcd2_jacobi): Likewise.
3184
3185         * mpn/generic/hgcd.c (hgcd_hook): Avoid using NULL.
3186
3187 2011-05-19  Niels Möller  <nisse@lysator.liu.se>
3188
3189         * tune/hgcd_lehmer.c (__gmpn_hgcd_itch): Don't rename symbols for
3190         the functions moved to hgcd_matrix.c.
3191
3192         * configure.in (gmp_mpn_functions): Added hgcd_matrix.
3193
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.
3198
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.
3205
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.
3209
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.
3215
3216 2011-05-17  Niels Möller  <nisse@lysator.liu.se>
3217
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
3221         normalization.
3222         * mpn/generic/gcd.c (mpn_gcd): Added ASSERTs for input
3223         requirements.
3224
3225 2011-05-15  Marc Glisse  <marc.glisse@inria.fr>
3226
3227         * gmpxx.h (operator<<): Dedup.
3228         * tests/cxx/t-iostream.cc: Test on compound types.
3229
3230         * gmpxx.h (__gmp_binary_expr): Let things happen in place: c=(a+b)/2.
3231
3232 2011-05-10  Marc Glisse  <marc.glisse@inria.fr>
3233
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.
3238
3239 2011-05-10  Niels Möller  <nisse@lysator.liu.se>
3240
3241         * doc/gmp.texi (mpz_gcd): Document that gcd(0,0) = 0.
3242         (mpz_gcdext): Document range for cofactors.
3243
3244 2011-05-09  Niels Möller  <nisse@lysator.liu.se>
3245
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.
3249
3250 2011-05-09  Torbjorn Granlund  <tege@gmplib.org>
3251
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.
3254
3255 2011-05-08  Marc Glisse  <marc.glisse@inria.fr>
3256
3257         * gmpxx.h: Replace unsigned long with mp_bitcnt_t in many places.
3258         * doc/gmp.texi: Likewise.
3259
3260 2011-05-06  Marc Glisse  <marc.glisse@inria.fr>
3261
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.
3268
3269         * tests/cxx/t-assign.cc: Minor tweak.
3270         * tests/cxx/t-misc.cc: Likewise.
3271
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
3275         mpq_init + mpq_set.
3276         (mpz_class): Dedup the string constructors.
3277         (mpq_class): Likewise.
3278
3279         * tests/cxx/t-ops3.cc: New file.
3280         * tests/cxx/Makefile.am: Added t-ops3.
3281
3282 2011-05-05  Torbjorn Granlund  <tege@gmplib.org>
3283
3284         * mpz/gcdext.c: Correct sgn computation.
3285         Use MPZ_REALLOC.
3286
3287 2011-05-05  Marc Glisse  <marc.glisse@inria.fr>
3288
3289         * mpn/x86_64/fat/fat.c: Update for Sandy Bridge.
3290         * config.guess: warning to keep it in sync with fat.c.
3291
3292 2011-05-05  Torbjorn Granlund  <tege@gmplib.org>
3293
3294         * mpn/x86_64/fat/fat_entry.asm (PIC_OR_DARWIN): New symbol.  Use it to
3295         work around Darwin problems.
3296
3297 2011-05-04  Niels Möller  <nisse@lysator.liu.se>
3298
3299         * mpz/gcdext.c (mpz_gcdext): Reduced temporary allocations. Use
3300         mpz_divexact when computing the second cofactor.
3301
3302 2011-05-03  David Harvey  <dmharvey@cims.nyu.edu>
3303
3304         * configure.in: make invert_limb_table work correctly with
3305         --disable-assembly (from Niels Moller)
3306
3307 2011-05-02  Marc Glisse  <marc.glisse@inria.fr>
3308
3309         * .bootstrap: libtoolize doesn't need -c.
3310
3311         * configfsf.guess: Update to version of 2011-02-02.
3312         * configfsf.sub: Update to version of 2011-03-23.
3313
3314 2011-05-02  Niels Möller  <nisse@lysator.liu.se>
3315
3316         * mpz/gcdext.c (mpz_gcdext): Don't allocate extra limbs at the end
3317         of mpn_gcdext parameters.
3318
3319         * doc/gmp.texi (mpn_gcdext): Updated doc.
3320
3321 2011-05-01  Niels Möller  <nisse@lysator.liu.se>
3322
3323         * mpn/generic/div_qr_2u_pi1.c (mpn_div_qr_2u_pi1): Fixed ASSERT.
3324
3325 2011-04-30  Marc Glisse  <marc.glisse@inria.fr>
3326
3327         * gmp-h.in (mpz_cdiv_q_2exp): Use mp_bitcnt_t to match the definition
3328         and the documentation.
3329         (mpz_remove): Likewise.
3330         (mpf_eq): Likewise.
3331
3332         * ltmain.sh: Remove.
3333         * .bootstrap: Let libtoolize generate ltmain.sh.
3334
3335         * tests/cxx/t-ops2.cc: Add a couple tests.
3336         * tests/cxx/t-rand.cc: Likewise.
3337
3338         * doc/gmp.texi (mpf_urandomb): Explicit the fact that it does not
3339         change the precision.
3340
3341         * gmp-h.in (__GMP_EXTERN_INLINE): Recent g++ uses gnu_inline.
3342
3343 2011-04-28  Torbjorn Granlund  <tege@gmplib.org>
3344
3345         * configure.in (x86_64): Support bobcat specifically.
3346         (x86): Match bobcat and bulldozer, handle like k10.
3347
3348 2011-04-28  David Harvey  <dmharvey@cims.nyu.edu>
3349
3350         * README.HG: update autotools version numbers.
3351
3352 2011-04-27  Torbjorn Granlund  <tege@gmplib.org>
3353
3354         * tune/speed.h (speed_cyclecounter): Always use PIC variant when
3355         compiled with Apple's GCC.
3356
3357         * mpn/x86/darwin.m4 (LEA): Complete rewrite.
3358         (m4append): New macro.
3359
3360 2011-04-26  Torbjorn Granlund  <tege@gmplib.org>
3361
3362         * mpn/sparc32/sparc-defs.m4 (changecom): Don't redefine '!' as it
3363         interferes with expressions.
3364
3365 2011-04-20  Torbjorn Granlund  <tege@gmplib.org>
3366
3367         * acinclude.m4 (GMP_ASM_RODATA): Make 'foo' larger to avoid clang
3368         problems.
3369
3370 2011-04-12  Niels Möller  <nisse@lysator.liu.se>
3371
3372         * mpn/x86_64/invert_limb.asm [PIC]: Declare mpn_invert_limb_table
3373         as .protected.
3374
3375 2011-04-11  Torbjorn Granlund  <tege@gmplib.org>
3376
3377         * mpn/x86/k7/invert_limb.asm: Use deflit for Darwin bug workaround.
3378         Undo 2011-03-28 change.
3379
3380         * mpn/asm-defs.m4 (define_mpn): Use deflit.
3381
3382 2011-04-10  Niels Möller  <nisse@lysator.liu.se>
3383
3384         * mpn/asm-defs.m4 (define_mpn): Added invert_limb_table.
3385
3386         * configure.in: Add invert_limb_table to extra_functions_64 on
3387         x86_64.
3388
3389         * mpn/x86_64/invert_limb.asm: Changed references from approx_tab
3390         mpn_invert_limb_table.
3391
3392         * mpn/x86_64/invert_limb_table.asm (mpn_invert_limb_table): New
3393         file. Extracted approximation table from invert_limb.asm, renamed
3394         and made global.
3395
3396 2011-03-30  Niels Möller  <nisse@lysator.liu.se>
3397
3398         * mpn/x86_64/div_qr_2u_pi1.asm: New file.
3399
3400         * configure.in (gmp_mpn_functions): Add div_qr_2u_pi1.
3401
3402         * gmp-impl.h (mpn_div_qr_2u_pi1): Declare.
3403
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.
3407
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.
3412
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.
3416
3417         * tune/tuneup.c (tune_div_qr_2): Use new name speed_mpn_div_qr_2n.
3418
3419         * tune/speed.c (routine): Use new names mpn_div_qr_2n and
3420         mpn_div_qr_2u, also on the command line.
3421
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.
3426
3427         * mpn/generic/div_qr_2_pi1_norm.c (mpn_div_qr_2n_pi1): Renamed,
3428         from...
3429         (mpn_div_qr_2_pi1_norm): ...old name.
3430         * mpn/x86_64/div_qr_2_pi1_norm.asm: Likewise.
3431
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.
3437
3438         * mpn/asm-defs.m4: Renamed div_qr_2-functions to new names.
3439
3440 2011-03-29  Niels Möller  <nisse@lysator.liu.se>
3441
3442         * mpn/x86_64/div_qr_2_pi1_norm.asm: Updated to use a separate rp
3443         argument.
3444
3445         * gmp-impl.h (mpn_div_qr_2_pi1_norm): Updated declaration.
3446         * gmp-h.in (mpn_div_qr_2): Likewise.
3447
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.
3450
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.
3456
3457 2011-03-29  Niels Möller  <nisse@lysator.liu.se>
3458
3459         * mpn/x86/k7/invert_limb.asm: Use mov rather than push and pop.
3460         Earlier load of divisor from stack.
3461
3462 2011-03-28  Torbjorn Granlund  <tege@gmplib.org>
3463
3464         * mpn/x86/k7/invert_limb.asm: Protect movzwl register parameters from
3465         being interpreted as m4 macro parameters.
3466
3467 2011-03-22  Niels Möller  <nisse@lysator.liu.se>
3468
3469         * mpn/x86_64/div_qr_2_pi1_norm.asm: Copied optimized inner loop
3470         from divrem_2.asm.
3471
3472         * mpn/x86_64/div_qr_2_pi1_norm.asm: First working, but poorly
3473         optimized, implementation.
3474
3475         * mpn/asm-defs.m4 (define_mpn): Added div_qr_2_pi[12]_*norm.
3476
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.
3480
3481         * gmp-impl.h (mpn_div_qr_2_pi1_norm): Declare.
3482
3483         * configure.in (gmp_mpn_functions): Added div_qr_2_pi1_norm.
3484
3485 2011-03-22  Torbjorn Granlund  <tege@gmplib.org>
3486
3487         * configure.in (powerpc): Reinsert lost AIX cpu_path 32-bit handling.
3488         Reinsert lost linux/bsd cpu_path handling.
3489
3490         * mpn/generic/mod_1_1.c: Disable powerpc asm for _LONG_LONG_LIMB.
3491         * mpn/generic/div_qr_2.c: Likewise.
3492
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
3495         constraints.
3496
3497 2011-03-21  Niels Möller  <nisse@lysator.liu.se>
3498
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.
3502
3503         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added div_qr_2.c.
3504
3505         * gmp-impl.h (DIV_QR_2_PI2_THRESHOLD): Setup for tuning.
3506
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.
3519
3520         * gmp-impl.h (udiv_qr_3by2): Avoid a copy.
3521
3522 2011-03-21  Torbjorn Granlund  <tege@gmplib.org>
3523
3524         * configure.in (hppa): Under linux, treat 64-bit processors as if they
3525         were 32-bit processors.
3526
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.
3531
3532         * mpn/generic/subcnd_n.c: Combine nails and non-nails functions.
3533
3534         * gmp-impl.h (invert_pi1): Prepend _ to local variables, protect
3535         parameters within () where necessary.
3536
3537         * mpn/asm-defs.m4 (define_mpn): Add div_qr_2.
3538         * configure.in (gmp_mpn_functions): Reinsert mercurial-bug-removed
3539         line.
3540
3541 2011-03-20  Torbjorn Granlund  <tege@gmplib.org>
3542
3543         * configure.in (powerpc): Add cpu_path for all three ABIs.
3544         Rename "aix64" to "mode64" for consistency.
3545
3546 2011-03-16  Marc Glisse  <marc.glisse@inria.fr>
3547
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.
3552
3553 2011-03-20  Niels Möller  <nisse@lysator.liu.se>
3554
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.
3560
3561         * tests/mpn/t-div.c (main): Added tests for mpn_divrem_2 and
3562         mpn_div_qr_2.
3563
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.
3567
3568 2011-03-16  Marc Glisse  <marc.glisse@inria.fr>
3569
3570         * gmpxx.h (__gmp_set_expr): Remove broken declarations.
3571
3572 2011-03-19  Torbjorn Granlund  <tege@gmplib.org>
3573
3574         * mpz/fac_ui.c (mpz_fac_ui): Use MPZ_REALLOC for standard, conditional
3575         reallocation.
3576
3577 2011-03-19  Niels Möller  <nisse@lysator.liu.se>
3578
3579         * mpn/generic/divrem_2.c (mpn_divrem_2): Fixed comment and assert
3580         regarding q and n overlap.
3581
3582 2011-03-16  Marc Glisse  <marc.glisse@inria.fr>
3583
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.
3591
3592 2011-03-15  Marc Glisse  <marc.glisse@inria.fr>
3593
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.
3598
3599         * gmpxx.h (__GMPZ_ULI_LIMBS): Rewrite.
3600         * tests/cxx/t-ops2.cc: test converting ULONG_MIN to stack mpq_t.
3601
3602 2011-03-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
3603
3604         * mpn/generic/toom_interpolate_16pts.c: Remove ambiguity.
3605
3606 2011-03-14  Torbjorn Granlund  <tege@gmplib.org>
3607
3608         * tune/tuneup.c (tune_mul): Set tuning min size considering print skew.
3609
3610         * doc/gmp.texi: Make reference to "Formatted I/O" chapters from type
3611         specific I/O sections.
3612
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.
3619
3620 2011-03-13  Marc Glisse  <marc.glisse@inria.fr>
3621
3622         * tests/cxx/t-ops2.cc: New file.
3623         * tests/cxx/Makefile.am: Added t-ops2.
3624
3625 2011-03-13  Torbjorn Granlund  <tege@gmplib.org>
3626
3627         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Make 'hi' be limb-sized
3628         for better code.
3629
3630         * gmp-impl.h (MPN_IORD_U): Handle x86_64 as well as x86_32.  Generate
3631         no code for incrementing by constant 0.
3632
3633 2011-03-12  Marc Glisse  <marc.glisse@inria.fr>
3634
3635         * gmpxx.h: Rename __GMPXX_TMP_* to __GMPXX_TMPZ_*. Use in more places.
3636
3637 2011-03-12  Torbjorn Granlund  <tege@gmplib.org>
3638
3639         * mpn/powerpc64/rshift.asm: Accept/return values correctly also for
3640         32-bit ABI.
3641         * mpn/powerpc64/lshift.asm: Likewise.
3642
3643         * tune/powerpc.asm: Use powerpc syntax, not power syntax.
3644
3645         * tune/common.c (speed_udiv_qrnnd_preinv1, etc): Remove.
3646         * tune/speed.c (routine): Remove udiv_qrnnd_preinv1, etc.
3647
3648 2011-03-12  Marc Glisse  <marc.glisse@inria.fr>
3649
3650         * tests/cxx/t-istream.cc: Restrict mpq test in t-istream -s.
3651
3652         * gmpxx.h: Remove leftover #undefs.
3653
3654 2011-03-11  Torbjorn Granlund  <tege@gmplib.org>
3655
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.
3659
3660 2011-03-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
3661
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.
3664
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.
3668
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].
3672
3673         * mpn/x86/k7/sublsh1_n.asm: Replaced generic sublsh1 code with faster _ip1.
3674         * mpn/x86/atom/sublsh1_n.asm: Changed PROLOGUE accordingly.
3675
3676         * configure.in: Define HAVE_NATIVE_mpn_addlsh*_n*_ip[12].
3677         * mpn/asm-defs.m4: Declare mpn_addlsh*_n*_ip[12].
3678
3679 2011-03-10  Marc Glisse  <marc.glisse@inria.fr>
3680
3681         * tests/cxx/t-istream.cc: Explicit conversion to streampos.
3682
3683 2011-03-10  Torbjorn Granlund  <tege@gmplib.org>
3684
3685         * mpn/x86/atom/sse2/mul_basecase.asm: Suppress wind-down rp updates.
3686
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.
3690
3691 2011-03-10 Marco Bodrato <bodrato@mail.dm.unipi.it>
3692
3693         * mpn/x86/pentium4/sse2/bdiv_dbm1c.asm: New file, was in atom.
3694         * mpn/x86/atom/sse2/bdiv_dbm1c.asm: Grab file above.
3695
3696 2011-03-09  Torbjorn Granlund  <tege@gmplib.org>
3697
3698         * mpn/x86_64/aorrlsh_n.asm: Complete rewrite.
3699
3700         * mpn/x86_64/core2/aorrlsh_n.asm: New file, grabbing another asm file.
3701
3702 2011-03-09  Marc Glisse  <marc.glisse@inria.fr>
3703
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.
3707
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.
3712
3713 2011-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
3714
3715         * mpn/x86/atom/sse2/bdiv_dbm1c.asm: New file.
3716
3717 2011-03-09  Marc Glisse  <marc.glisse@inria.fr>
3718
3719         * doc/gmp.texi: Remove void return type from constructors. Document
3720         explicit constructors. Document mpf_class::mpf_class(mpf_t).
3721
3722 2011-03-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
3723
3724         * mpn/x86/atom/sse2/sqr_basecase.asm: Postponed pushes. Cleaned
3725         outer loop exit.
3726
3727 2011-03-07  Torbjorn Granlund  <tege@gmplib.org>
3728
3729         * mpn/x86_64/gcd_1.asm: Workaround Oracle assembler bug.
3730
3731         * mpn/x86/atom/sse2/mul_basecase.asm: Replace addmul_1 loops.
3732         Tweak outer loop rp updates.
3733
3734 2011-03-06  Torbjorn Granlund  <tege@gmplib.org>
3735
3736         * mpn/x86/atom/sse2/sqr_basecase.asm: New file.
3737
3738 2011-03-05  Torbjorn Granlund  <tege@gmplib.org>
3739
3740         * mpn/x86_64/bdiv_dbm1c.asm: Write proper feed-in code.
3741
3742 2011-03-04  Torbjorn Granlund  <tege@gmplib.org>
3743
3744         * mpn/x86_64/addmul_2.asm: Rewrite for linear performance.
3745
3746 2011-03-03  Torbjorn Granlund  <tege@gmplib.org>
3747
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
3750         and 64-bit).
3751
3752         * mpn/generic/sqrtrem.c (mpn_dc_sqrtrem): Use mpn_addlsh1_n.
3753
3754         * gmp-impl.h (mpn_addlsh_nc, mpn_rsblsh_nc): Declare.
3755         * mpn/asm-defs.m4: Likewise.
3756
3757         * mpn/x86_64/coreisbr/aorrlsh_n.asm: Disable mpn_rsblsh_n due to
3758         carry-in issues.
3759         * mpn/x86_64/coreinhm/aorrlsh_n.asm: Likewise.
3760         * mpn/x86_64/coreisbr/aorrlsh2_n.asm: Likewise.
3761
3762 2011-03-03  Niels Möller  <nisse@lysator.liu.se>
3763
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.
3767
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.
3771
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.
3775
3776         * gmp-impl.h (MOD_1_1P_METHOD) [TUNE_PROGRAM_BUILD]: Define macro.
3777         (mod_1_1p_method) [TUNE_PROGRAM_BUILD]: Declare variable.
3778
3779 2011-03-02  Torbjorn Granlund  <tege@gmplib.org>
3780
3781         * mpn/x86_64/coreinhm/aorrlsh_n.asm: New file.
3782         * mpn/x86_64/coreisbr/aorrlsh_n.asm: New file.
3783
3784 2011-03-01  Niels Möller  <nisse@lysator.liu.se>
3785
3786         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p_cps): Eliminated a neg and
3787         two mov instructions.
3788
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.
3792
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.
3796
3797 2011-03-01  Torbjorn Granlund  <tege@gmplib.org>
3798
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.
3802
3803         * mpz/divegcd.c: Rewrite, as per Marc Glisse's suggestion.  Also fix
3804         problem with passing a longlong limb to a _ui function.
3805
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.
3809
3810 2011-02-28  Niels Möller  <nisse@lysator.liu.se>
3811
3812         * mpn/generic/mod_1_1.c (add_mssaaaa): Typo fix, define
3813         add_mssaaaa, not add_sssaaaa.
3814
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.
3817
3818         * tune/speed.c (routine): Added mpn_mod_1_1_1 and mpn_mod_1_1_2.
3819
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
3822         mpn_mod_1_1p_cps_2.
3823
3824         * tune/common.c (speed_mpn_mod_1_1_1): New function.
3825         (speed_mpn_mod_1_1_2): New function.
3826
3827         * tune/Makefile.am (libspeed_la_SOURCES): Added mod_1_1-1.c
3828         mod_1_1-2.c.
3829
3830         * tune/mod_1_1-1.c: New file.
3831         * tune/mod_1_1-2.c: New file.
3832
3833         * mpn/generic/mod_1_1.c: Implemented an algorithm with fewer
3834         multiplications, configured via MOD_1_1P_METHOD.
3835
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.
3839
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.
3848
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
3854         instead.
3855
3856         * tests/mpn/t-divrem_1.c (check_data): Added testcase to exercise
3857         the nl == constant 0 special case in udiv_qrnnd_preinv3.
3858
3859 2011-02-28  Torbjorn Granlund  <tege@gmplib.org>
3860
3861         * mpn/generic/rootrem.c (mpn_rootrem): Combine two similar scalar
3862         divisions.  Misc minor cleanup.
3863
3864         * mpn/x86/atom/sse2/aorsmul_1.asm: Shorten software pipeline.
3865
3866         * mpn/x86/atom/mul_basecase.asm: Remove file no longer used.
3867
3868         * mpn/generic/rootrem.c (mpn_rootrem_internal): Delay O(log(U))
3869         allocations until they are known to be needed.
3870
3871 2011-02-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
3872
3873         * mpn/x86/atom/sse2/mul_1.asm: New code.
3874
3875 2011-02-27  Niels Möller  <nisse@lysator.liu.se>
3876
3877         * gmp-impl.h (udiv_rnnd_preinv): New macro.
3878
3879 2011-02-27  Torbjorn Granlund  <tege@gmplib.org>
3880
3881         * mpn/x86/atom/sse2/mul_basecase.asm: New file.
3882
3883 2011-02-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
3884
3885         * mpn/x86/atom/sse2/aorsmul_1.asm: Optimise non-loop code.
3886
3887 2011-02-26  Torbjorn Granlund  <tege@gmplib.org>
3888
3889         * mpn/powerpc64/mode64/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
3890         * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
3891
3892         * mpn/powerpc64/mode64/aorsmul_1.asm: Add missing MULFUNC_PROLOGUE.
3893         * mpn/m68k/mc68020/aorsmul_1.asm: Likewise.
3894
3895 2011-02-25  Torbjorn Granlund  <tege@gmplib.org>
3896
3897         * mpn/x86/atom/sse2/aorsmul_1.asm: New file.
3898         * mpn/x86/atom/aorsmul_1.asm: File removed.
3899
3900 2011-02-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
3901
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.
3908
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.
3916
3917 2011-02-24  Torbjorn Granlund  <tege@gmplib.org>
3918
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.
3922
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.
3925
3926 2011-02-24  Niels Möller  <nisse@lysator.liu.se>
3927
3928         * mpn/x86/k7/mod_1_1.asm (mpn_mod_1_1p): Rewrite using the same
3929         algorithm as the x86_64 version.
3930
3931 2011-02-23 Marco Bodrato <bodrato@mail.dm.unipi.it>
3932
3933         * mpn/x86/atom/logops_n.asm: New file (same loop as aors_n).
3934
3935 2011-02-23  Niels Möller  <nisse@lysator.liu.se>
3936
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
3940         %r12.
3941
3942 2011-02-22  Torbjorn Granlund  <tege@gmplib.org>
3943
3944         * configure.in: Export SHLD_SLOW and SHRD_SLOW to config.m4, also
3945         fixing typo in exporting code.
3946
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.
3949
3950 2011-02-22  Niels Möller  <nisse@lysator.liu.se>
3951
3952         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Rewrite.
3953
3954 2011-02-22 Marco Bodrato <bodrato@mail.dm.unipi.it>
3955
3956         * mpn/x86/atom/lshiftc.asm: New file (a copy of lshift.asm with a handful of neg added).
3957
3958 2011-02-21  Torbjorn Granlund  <tege@gmplib.org>
3959
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.
3962
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.
3967
3968 2011-02-20  Marc Glisse  <marc.glisse@inria.fr>
3969
3970         * mpq/aors.c: Rewrite to remove redundant division.
3971
3972 2011-02-20  Torbjorn Granlund  <tege@gmplib.org>
3973
3974         * mpn/x86/atom/lshift.asm: New file.
3975         * mpn/x86/atom/rshift.asm: Normalise mnemonic usage.
3976
3977         * gmp-impl.h (mpn_divexact_by7): Relax inclusion condition.
3978
3979         * mpz/divegcd.c (mpz_divexact_by5): New conditionally enabled function.
3980         (mpz_divexact_by3): Wrap inside appropriate conditions.
3981         (mpz_divexact_gcd): Rewrite.
3982
3983         * mpn/x86/bdiv_dbm1c.asm: Save a jump.
3984
3985 2011-02-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
3986
3987         * mpn/x86/atom/aorslshC_n.asm: New file.
3988         * mpn/x86/atom/sublsh2_n.asm: New file.
3989
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.
3993
3994 2011-02-19  Torbjorn Granlund  <tege@gmplib.org>
3995
3996         * mpn/x86_64/atom/rsh1aors_n.asm: New file.
3997
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.
4001
4002 2011-02-17 Marco Bodrato <bodrato@mail.dm.unipi.it>
4003
4004         * mpn/x86/atom/aorsmul_1.asm: Small improvements for small sizes.
4005         * mpn/x86/atom/aorrlshC_n.asm: Tiny size improvements.
4006
4007 2011-02-16  Torbjorn Granlund  <tege@gmplib.org>
4008
4009         * configure.in: Fix k8/k10 32-bit path setup problem.
4010
4011 2011-02-16 Marco Bodrato <bodrato@mail.dm.unipi.it>
4012
4013         * mpn/x86/atom/aorsmul_1.asm: Revive an old k7/aorsmul.
4014
4015 2011-02-14 Marco Bodrato <bodrato@mail.dm.unipi.it>
4016
4017         * gmp-impl.h (mpn_sublsh_n): Declare.
4018         * mpn/asm-defs.m4: Likewise.
4019
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.
4024
4025 2011-02-13  Torbjorn Granlund  <tege@gmplib.org>
4026
4027         * mpn/x86_64/atom/aorrlsh2_n.asm: New file.
4028
4029 2011-02-12  Torbjorn Granlund  <tege@gmplib.org>
4030
4031         * mpn/x86_64/aorrlsh_n.asm: Minor tweaks, update c/l numbers.
4032
4033         * mpn/x86_64/atom/sublsh1_n.asm: New file.
4034
4035         * mpn/x86_64/atom/aorrlsh1_n.asm: New file.
4036
4037 2011-02-11  Torbjorn Granlund  <tege@gmplib.org>
4038
4039         * mpn/powerpc64/mode64/mod_1_1.asm: Fix Darwin syntax issues.
4040
4041 2011-02-10  Torbjorn Granlund  <tege@gmplib.org>
4042
4043         * mpn/powerpc64/mode64/mod_1_4.asm: Tune away a cycle for 970.
4044
4045 2011-02-11 Marco Bodrato <bodrato@mail.dm.unipi.it>
4046
4047         * mpn/x86/k7/addlsh1_n.asm: Faster core loop (Torbjorn's).
4048
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.
4053
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.
4057
4058 2011-02-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
4059
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.
4064
4065 2011-02-05  Torbjorn Granlund  <tege@gmplib.org>
4066
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.
4070
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.
4074
4075         * mpn/x86_64/coreisbr/aors_n.asm: New file, based on old
4076         atom/aors_n.asm.
4077         * mpn/x86_64/atom/aors_n.asm: Grab coreisbr/aors_n.asm.
4078
4079 2011-02-05 Marco Bodrato <bodrato@mail.dm.unipi.it>
4080
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.
4086
4087         * mpz/lucnum_ui.c: Use mpn_addlsh2_n.
4088
4089 2011-02-04  Torbjorn Granlund  <tege@gmplib.org>
4090
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.
4099
4100 2011-02-04 Marco Bodrato <bodrato@mail.dm.unipi.it>
4101
4102         * mpn/x86/atom/mode1o.asm: New file, grabbing another asm file.
4103         * mpn/x86/atom/mul_1.asm: Claim mul_1c.
4104
4105 2011-02-02  Niels Möller  <nisse@lysator.liu.se>
4106
4107         * tune/speed.h (SPEED_ROUTINE_MPN_HGCD_CALL): Fixed one
4108         speed_operand_dst call.
4109
4110 2011-02-01  Torbjorn Granlund  <tege@gmplib.org>
4111
4112         * tune/speed.h (struct speed_params): Allow for 4 dst operands.
4113         * tune/common.c (TOLERANCE): Increase from 0.5% to 1%.
4114
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
4117         by Niels).
4118         * tune/common.c (speed_mpn_hgcd): Invoke SPEED_ROUTINE_MPN_HGCD_CALL.
4119         (speed_mpn_hgcd_lehmer): Likewise.
4120
4121         * configure.in: Set up 32-bit x86 paths for new corei* CPU strings.
4122
4123 2011-01-31  Torbjorn Granlund  <tege@gmplib.org>
4124
4125         * config.guess: Recognise new Intel processors.
4126
4127         * config.guess: Support 'coreinhm' and 'coreisbr'.
4128         * config.sub: Likewise.
4129         * configure.in: Likewise.
4130
4131 2011-01-30  Torbjorn Granlund  <tege@gmplib.org>
4132
4133         * configure.in: Support x86/geode.
4134         * mpn/x86/geode/gmp-mparam.h: New file.
4135
4136 2011-01-29 Marco Bodrato <bodrato@mail.dm.unipi.it>
4137
4138         * mpn/x86/atom/addlsh1_n.asm: Removed.
4139         * mpn/x86/atom/rsh1add_n.asm: Likewise.
4140
4141 2011-01-28  Torbjorn Granlund  <tege@gmplib.org>
4142
4143         * mpn/alpha/ev6/slot.pl: Add some missing insns.
4144
4145 2011-01-28 Marco Bodrato <bodrato@mail.dm.unipi.it>
4146
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.
4165
4166 2011-01-27  Torbjorn Granlund  <tege@gmplib.org>
4167
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.
4172
4173 2011-01-26  Torbjorn Granlund  <tege@gmplib.org>
4174
4175         * mpn/alpha/invert_limb.asm: Complete rewrite.
4176
4177 2011-01-25  Torbjorn Granlund  <tege@gmplib.org>
4178
4179         * mpn/powerpc32/invert_limb.asm: New file.
4180
4181 2011-01-25 Marco Bodrato <bodrato@mail.dm.unipi.it>
4182
4183         * mpn/x86/pentium4/sse2/bdiv_q_1.asm: New file.
4184         * mpn/x86/k7/bdiv_q_1.asm: New file.
4185
4186 2011-01-24  Torbjorn Granlund  <tege@gmplib.org>
4187
4188         * tune/tuneup.c (tune_mul_n, tune_sqr): Loop, re-measuring thresholds
4189         until no tiny ranges remain.
4190
4191 2011-01-23  Torbjorn Granlund  <tege@gmplib.org>
4192
4193         * mpn/ia64/mul_2.asm: Tweak to 1.5 c/l, less overhead.
4194
4195         * mpn/ia64/addmul_2.asm: Rewrite, adding mpn_addmul_2s entry point.
4196
4197 2011-01-22  Torbjorn Granlund  <tege@gmplib.org>
4198
4199         * mpn/ia64/aors_n.asm: Fix some incorrect bundle types.
4200
4201         * mpn/ia64/sqr_diagonal.asm: Remove.
4202
4203         * mpn/ia64/sqr_diag_addlsh1.asm: New file.
4204
4205         * mpn/ia64/ia64-defs.m4: Define some shorter convenience mnemonics.
4206
4207         * mpn/generic/sqr_basecase.c (MPN_SQR_DIAG_ADDLSH1): New macro, using
4208         new function mpn_sqr_diag_addlsh1 or defining its equivalent.
4209
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.
4213
4214         * configure.in: Add HAVE_NATIVEs for mpn_sqr_diag_addlsh1 and
4215         mpn_addmul_2s.
4216         (gmp_mpn_functions_optional): Add sqr_diag_addlsh1.
4217
4218 2011-01-21 Marco Bodrato <bodrato@mail.dm.unipi.it>
4219
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.
4223
4224 2011-01-20  Torbjorn Granlund  <tege@gmplib.org>
4225
4226         * tune/speed.c (run_gnuplot): Update to current gnuplot syntax.
4227
4228         * mpn/powerpc64/mode64/aorsmul_1.asm: Trim away 0.5 c/l for submul_1
4229         for POWER5.
4230
4231 2011-01-19  Torbjorn Granlund  <tege@gmplib.org>
4232
4233         * mpn/x86_64/core2/rsh1aors_n.asm: New file.
4234
4235 2011-01-18 Marco Bodrato <bodrato@mail.dm.unipi.it>
4236
4237         * mpn/x86/bdiv_q_1.asm: New file (same core alg. as dive_1).
4238
4239 2011-01-15 Marco Bodrato <bodrato@mail.dm.unipi.it>
4240
4241         * mpn/generic/divexact.c: Avoid COPY if not needed.
4242
4243 2011-01-14  Torbjorn Granlund  <tege@gmplib.org>
4244
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.
4247
4248 2011-01-13 Marco Bodrato <bodrato@mail.dm.unipi.it>
4249
4250         * mpz/mul.c: Remove redundant size computation.
4251
4252 2011-01-08  Torbjorn Granlund  <tege@gmplib.org>
4253
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.
4258
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.
4262
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.
4266
4267         * configure.in (gmp_mpn_functions_optional): Add mul_5 and mul_6.
4268
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.
4272
4273 2011-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
4274
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.
4283
4284 2010-12-28  Torbjorn Granlund  <tege@gmplib.org>
4285
4286         * mpn/minithres/gmp-mparam.h: Update with several recent thresholds.
4287
4288 2010-12-19  Torbjorn Granlund  <tege@gmplib.org>
4289
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.
4299
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.
4302         Misc cleanups.
4303
4304 2010-12-18  Torbjorn Granlund  <tege@gmplib.org>
4305
4306         * mpn/x86_64/gcd_1.asm: Call mpn_mod_1 for operands with mode than
4307         BMOD_1_TO_MOD_1_THRESHOLD limbs.
4308
4309         * configure.in: Generalise code for putting THRESHOLDs in config.m4.
4310         Add BMOD_1_TO_MOD_1_THRESHOLD to list.
4311
4312         * mpn/x86_64/core2/divrem_1.asm: Tweak slightly, correct cycle counts.
4313
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.
4319
4320 2010-12-16  Torbjorn Granlund  <tege@gmplib.org>
4321
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.
4325
4326 2010-12-15  Torbjorn Granlund  <tege@gmplib.org>
4327
4328         * mpn/powerpc64/vmx/popcount.asm: Rewrite to use vperm count table.
4329
4330 2010-12-14  Torbjorn Granlund  <tege@gmplib.org>
4331
4332         * mp-h.in: Remove.
4333         * configure.in: Remove mp-h.in from AC_OUTPUT invocation.
4334
4335 2010-12-13  Torbjorn Granlund  <tege@gmplib.org>
4336
4337         * mpz/mod.c: Rewrite.
4338
4339         * mpn/x86_64/corei/popcount.asm: New file.
4340         * mpn/x86_64/corei/hamdist.asm: New file.
4341
4342         * mpn/x86_64/k10/hamdist.asm: New file.
4343
4344         * configure.in: Amend last change for lame /bin/sh.
4345
4346 2010-12-12  Torbjorn Granlund  <tege@gmplib.org>
4347
4348         * configure.in: Comment out M4=m4-not-needed.
4349
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.
4353
4354 2010-12-11  Torbjorn Granlund  <tege@gmplib.org>
4355
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.
4363
4364         * config.guess: Support Ultrasparc T2 and T3.
4365         * config.sub: Likewise.
4366         * configure.in: Likewise.
4367
4368         * config.guess: Generalise BSD Sparc recognition by allowing any
4369         caps (needed for OpenBSD which spells things innovatively).
4370
4371 2010-12-01  Torbjorn Granlund  <tege@gmplib.org>
4372
4373         * config.guess: Match new AMD processors, allow finer distinctions
4374         among old ones.
4375         * acinclude.m4 (X86_64_PATTERN): Likewise.
4376         * config.sub: Likewise.
4377         * configure.in: Rudimentarily support new AMD processors.
4378
4379         * configure.in (--enable_assembly): New option.
4380         (target none-*-*): Disable, give error.
4381
4382 2010-11-29  Torbjorn Granlund  <tege@gmplib.org>
4383
4384         * mpn/x86/x86-defs.m4 (LEA): Support non-PIC code.
4385         * mpn/x86/darwin.m4 (LEA): Likewise.
4386
4387         * tests/amd64call.asm: Rewrite for code size, and to match calls and
4388         returns.
4389
4390         * tests/x86call.asm: Rewrite for code size, to support PIC, and to
4391         match calls and returns.
4392         * tests/x86check.c: Rewrite.
4393
4394 2010-11-22  Torbjorn Granlund  <tege@gmplib.org>
4395
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.
4400
4401 2010-11-14  Torbjorn Granlund  <tege@gmplib.org>
4402
4403         * tests/misc/t-printf.c: Add explicit casts for type conversions.
4404         * mpn/generic/toom62_mul.c: Likewise.
4405
4406 2010-11-13  Torbjorn Granlund  <tege@gmplib.org>
4407
4408         * mpn/generic/get_d.c: Misc cleanup.  Fail with a syntax error for
4409         non-IEEE fp formats.
4410
4411         * tests/devel/try.c (malloc_region): Add explicit casts for type
4412         conversions.
4413
4414         * acinclude.m4 (GMP_ASM_RODATA): Make test code snippet C++ compatible.
4415         (GMP_C_DOUBLE_FORMAT): Likewise.
4416         (GMP_FUNC_VSNPRINTF): Likewise.
4417
4418         * config.guess (x86): Make test C snippet C++ compatible.
4419
4420 2010-11-12  Torbjorn Granlund  <tege@gmplib.org>
4421
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.
4430
4431 2010-11-11  Torbjorn Granlund  <tege@gmplib.org>
4432
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.
4435
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.
4443
4444         * ansi2knr.1: File removed.
4445         * ansi2knr.c: File removed.
4446
4447 2010-11-10  Torbjorn Granlund  <tege@gmplib.org>
4448
4449         Make it possible to compile GMP with g++:
4450
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.
4457
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.
4464
4465         * mpz/clrbit.c: Clean up typing using MPZ_REALLOC.
4466         * mpz/setbit.c: Likewise.
4467
4468         * mpz/powm.c: Avoid variable name 'new'.
4469
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.
4476
4477         * tests/tests.h: Unconditionally use <sstream> for now.
4478
4479         * tests/memory.c: Include "tests.h.
4480
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.
4515
4516 2010-11-09  Torbjorn Granlund  <tege@gmplib.org>
4517
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.
4523
4524         * configure.in (AC_INIT): Amend bug reporting address with manual
4525         reference.
4526
4527 2010-11-06  Torbjorn Granlund  <tege@gmplib.org>
4528
4529         * config.guess: If cpuid says we have 32bit-only x86 but
4530         configfsf.guess return x86_64, return the latter.
4531
4532         * mpn/x86_64/aors_n.asm: Rewrite not to rely on ZF after 'bt' insn.
4533
4534 2010-10-09  Torbjorn Granlund  <tege@gmplib.org>
4535
4536         * mpn/generic/trialdiv.c: Update documentation.
4537
4538 2010-10-04  Torbjorn Granlund  <tege@gmplib.org>
4539
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.
4544
4545 2010-08-20  Niels Möller  <nisse@lysator.liu.se>
4546
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.
4551
4552 2010-08-08  Torbjorn Granlund  <tege@gmplib.org>
4553
4554         * mpn/x86_64/fat/fat.c: Recognise many more processors.
4555
4556 2010-06-30  Torbjorn Granlund  <tege@gmplib.org>
4557
4558         * mpn/x86_64/divrem_2.asm: Tune.
4559
4560 2010-06-19  Niels Möller  <nisse@lysator.liu.se>
4561
4562         * tune/speed.h (SPEED_ROUTINE_MPN_MOD_1_1): Pass normalized
4563         divisor to the benchmarked function.
4564
4565 2010-06-15  Torbjorn Granlund  <tege@gmplib.org>
4566
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.
4570
4571         * gmp-impl.h (udiv_rnd_preinv): Simplify.
4572
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.
4577
4578         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Store results as they are
4579         computed.
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.
4582
4583         * mpn/x86/k7/invert_limb.asm: Moved from mpn/x86/invert_limb.asm.
4584
4585 2010-06-15  Niels Möller  <nisse@lysator.liu.se>
4586
4587         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-mod_1.
4588         * tests/mpn/t-mod_1.c: New file.
4589
4590 2010-05-25  Torbjorn Granlund  <tege@gmplib.org>
4591
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.
4594
4595 2010-05-24  Torbjorn Granlund  <tege@gmplib.org>
4596
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.
4602
4603         * mpn/powerpc32/lshiftc.asm: New file.
4604
4605 2010-05-22  Torbjorn Granlund  <tege@gmplib.org>
4606
4607         * tune/tuneup.c (tune_mod_1): Revert to version of 2010-05-06.
4608
4609 2010-05-17  Torbjorn Granlund  <tege@gmplib.org>
4610
4611         * configure.in (ia64): Get 32-bit sizeof test right.
4612
4613         * tune/tuneup.c (tune_mod_1): Undo unintensional change to tuning of
4614         PREINV_MOD_1_TO_MOD_1_THRESHOLD.
4615
4616 2010-05-16  Torbjorn Granlund  <tege@gmplib.org>
4617
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.
4621
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.
4628
4629         * configure.in (ia64-hpux): Do sizeof tests for 32-bit and 64-bit ABI.
4630
4631         * tune/tuneup.c (tune_mod_1): Completely finish MOD_1_N tuning before
4632         tuning MOD_1U_TO_MOD_1_1_THRESHOLD.
4633
4634 2010-05-14  Torbjorn Granlund  <tege@gmplib.org>
4635
4636         * mpn/generic/redc_2.c: Use asm code just for GNU C.
4637
4638 2010-05-13  Torbjorn Granlund  <tege@gmplib.org>
4639
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.
4643
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.
4662
4663         * configure.in: Give ultrasparct1 and ultrasparct2 special code path.
4664
4665         * mpn/x86_64/pentium4/gmp-mparam.h: Disable mpn_addlsh_n, mpn_rsblsh_n.
4666
4667 2010-05-12  Niels Möller  <nisse@lysator.liu.se>
4668
4669         * mpz/jacobi.c (mpz_jacobi): Fixed off-by-one error in use of
4670         scratch space.
4671
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.
4675
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.
4680
4681 2010-05-12  Torbjorn Granlund  <tege@gmplib.org>
4682
4683         * mpn/x86_64/mod_1_4.asm: Tune for more processors.
4684
4685         * mpn/x86_64/pentium4/lshiftc.asm: New file.
4686
4687 2010-05-11  Niels Möller  <nisse@lysator.liu.se>
4688
4689         * mpz/jacobi.c (mpz_jacobi): Deleted old implementation.
4690         Reorganized new implementation, to handle small inputs efficiently.
4691
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.
4695
4696 2010-05-10  Torbjorn Granlund  <tege@gmplib.org>
4697
4698         * mpn/x86_64/aorrlsh2_n.asm: Fix typo.
4699
4700 2010-05-09  Torbjorn Granlund  <tege@gmplib.org>
4701
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.
4706
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.
4711
4712 2010-05-08  Torbjorn Granlund  <tege@gmplib.org>
4713
4714         * mpn/x86_64/atom/gmp-mparam.h: Disable mpn_rsh1add_n, mpn_rsh1sub_n.
4715
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.
4719
4720 2010-05-07  Torbjorn Granlund  <tege@gmplib.org>
4721
4722         * mpn/sparc64: Support operands of >= 2^32 limbs.
4723
4724         * mpn/sparc64/lshiftc.asm: New file.
4725
4726         * mpn/ia64/divrem_2.asm: Complete rewrite.
4727
4728 2010-05-06  Torbjorn Granlund  <tege@gmplib.org>
4729
4730         * tune/tuneup.c (all): Don't call tune_divrem_2.
4731
4732         * mpn/generic/divrem_2.c: Complete rewrite.
4733
4734         * tune/tuneup.c (tune_mod_1): Fix typo.
4735
4736 2010-05-05  Torbjorn Granlund  <tege@gmplib.org>
4737
4738         * mpn/x86_64/mod_1_1.asm (mpn_mod_1_1p): Use macro register names.
4739         (mpn_mod_1_1p_cps): Rewrite.
4740
4741         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Micro-optimise.
4742
4743         * longlong.h: Undo 2009-03-01 change for powerpc64, it gives poor code.
4744
4745         * mpn/x86/pentium4/sse2/mod_1_1.asm: New file.
4746
4747         * mpn/powerpc64/mode64/mod_1_1.asm: New file.
4748
4749         * tune/tuneup.c (tune_mod_1): Use more typical divisor, for the benefit
4750         of machines with early-out multipliers.
4751
4752 2010-05-04  Torbjorn Granlund  <tege@gmplib.org>
4753
4754         * tune/tuneup.c (tune_mod_1): Fix typo.
4755
4756         * mpn/generic/mod_1_1.c: Undo last change.
4757         * mpn/x86_64/mod_1_1.asm: Likewise.
4758
4759 2010-05-03  Niels Möller  <nisse@lysator.liu.se>
4760
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.
4764
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
4768         interface.
4769         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_hook): New unified hook
4770         function.
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
4774         type, not a struct.
4775         (mpn_gcdext_hook): Declare.
4776
4777 2010-05-03  Torbjorn Granlund  <tege@gmplib.org>
4778
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.
4789
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
4792         correctness.
4793
4794         * mpn/powerpc64/sqr_diagonal.asm: Complete rewrite.
4795
4796         * mpn/powerpc64/mode64/mod_1_4.asm: New file.
4797
4798 2010-05-02  Torbjorn Granlund  <tege@gmplib.org>
4799
4800         * config.guess: Recognise power7.
4801
4802         * configure.in: Major overhaul of powerpc support.
4803
4804         * mpn/powerpc64/p6/lshift.asm: New file.
4805         * mpn/powerpc64/p6/lshiftc.asm: Likewise.
4806         * mpn/powerpc64/p6/rshift.asm: Likewise.
4807
4808 2010-04-30  Torbjorn Granlund  <tege@gmplib.org>
4809
4810         * configure.in (powerpc64): Support CPU specific mode-less subdirs.
4811
4812         * mpn/powerpc64/aix.m4 (PROLOGUE_cpu): Use "named csect" making
4813         requested aignment actually honoured.
4814
4815 2010-04-30  Niels Möller  <nisse@lysator.liu.se>
4816
4817         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Fixed handling of
4818         the case bl == 1. Fixed missing application of reciprocity.
4819
4820 2010-04-29  Niels Möller  <nisse@lysator.liu.se>
4821
4822         * configure.in (gmp_mpn_functions): Deleted gcdext_subdiv_step.
4823
4824         * mpn/generic/gcdext.c (mpn_gcdext): Use new generalized
4825         mpn_gcd_subdiv_step.
4826
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.
4831
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.
4835
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.
4839
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.
4845
4846         * mpn/generic/gcdext_subdiv_step.c: Deleted file.
4847
4848 2010-04-28  Torbjorn Granlund  <tege@gmplib.org>
4849
4850         * mpn/powerpc64/lshift.asm: Rewrite.
4851         * mpn/powerpc64/rshift.asm: Likewise.
4852         * mpn/powerpc64/mode64/lshiftc.asm: New file.
4853
4854         * mpn/powerpc64/aix.m4: Align functions to 32-byte boundary.
4855         * mpn/powerpc64/darwin.m4: Likewise.
4856         * mpn/powerpc64/elf.m4: Likewise.
4857
4858 2010-04-28  Niels Möller  <nisse@lysator.liu.se>
4859
4860         * tests/mpz/t-jac.c (check_data): Added some more test cases.
4861
4862         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_2): Bugfix, count
4863         trailing zeros, not leading.
4864
4865 2010-04-27  Torbjorn Granlund  <tege@gmplib.org>
4866
4867         * mpn/powerpc64/mode64/p6/mul_basecase.asm: New file.
4868
4869 2010-04-23  Niels Möller  <nisse@lysator.liu.se>
4870
4871         * gmp-impl.h (MPN_GCD_LEHMER_N_ITCH): Deleted.
4872         (mpn_gcd_lehmer_n): Deleted declaration.
4873
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.
4877
4878 2010-04-22  Torbjorn Granlund  <tege@gmplib.org>
4879
4880         * mpn/powerpc64/mode64/bdiv_dbm1c.asm: Swap multiply insns to make them
4881         consecutive, for the benefit of POWER6.
4882
4883         * mpn/powerpc64/mode64/p6/gmp-mparam.h: New file.
4884
4885 2010-04-21  Torbjorn Granlund  <tege@gmplib.org>
4886
4887         * mpn/generic/gcd_lehmer.c: Deleted file.
4888
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.
4895
4896         * mpn/powerpc64/mode64/aorslshC_n.asm: Swap ldx operands as a temporary
4897         workaround for POWER6 pipeline glitch.
4898
4899 2010-04-19  Niels Möller  <nisse@lysator.liu.se>
4900
4901         * mpz/jacobi.c (mpz_jacobi): New implementation using
4902         mpn_jacobi_lehmer. Currently #if:ed out.
4903
4904         * mpn/generic/jacbase.c (mpn_jacobi_base)
4905         [JACOBI_BASE_METHOD < 4]: Support inputs with a >= b.
4906
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.
4912
4913         * mpn/generic/jacobi_lehmer.c (mpn_jacobi_lehmer): New file, new
4914         function.
4915
4916         * configure.in (gmp_mpn_functions): Added jacobi_lehmer.
4917
4918 2010-04-14  Niels Möller  <nisse@lysator.liu.se>
4919
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.
4924
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.
4930
4931         * mpn/generic/matrix22_mul1_inverse_vector.c
4932         (mpn_matrix22_mul1_inverse_vector): New file, function moved and
4933         renamed...
4934         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_inverse_vector):
4935         ...from here.
4936
4937 2010-04-12  Torbjorn Granlund  <tege@gmplib.org>
4938
4939         * tests/mpn/t-toom6h.c (SIZE_LOG): Define.
4940         * tests/mpn/t-toom8h.c (SIZE_LOG): Likewise.
4941
4942 2010-04-10  Torbjorn Granlund  <tege@gmplib.org>
4943
4944         * mpn/ia64/lorrshift.asm: Rewrite feed-in and wind-down code.
4945
4946         * mpn/ia64/aorslsh1_n.asm: Adapt to new aorslsh1_n.
4947         * mpn/ia64/aorslsh1_n.asm: Likewise.
4948
4949         * mpn/ia64/aors_n.asm: Complete rewrite.
4950         * mpn/ia64/aorslsh1_n.asm: Likewise.
4951
4952         * mpn/ia64/add_n_sub_n.asm: Misc cleanups.  Add slotting comments.
4953
4954         * mpn/ia64/lshiftc.asm: New file.
4955
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.
4958
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.
4962
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.
4966
4967         * mpn/x86_64/pentium4/aors_n.asm: Let non-nc code fall into nc code.
4968
4969         * mpn/x86_64/pentium4/rsh1aors_n.asm: New file.
4970
4971 2010-03-25  Torbjorn Granlund  <tege@gmplib.org>
4972
4973         * mpn/ia64/add_n_sub_n.asm: New file.
4974
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.
4978
4979         * mpn/generic/add_n_sub_n.c: Renamed from addsub_n.c.
4980
4981 2010-03-23  Torbjorn Granlund  <tege@gmplib.org>
4982
4983         * mpn/x86_64/divrem_2.asm: Use mpn_invert_limb instead of div insn.
4984
4985         * mpn/ia64/aorslshC_n.asm: New file, generalised from last iteration of
4986         aorslsh1_n.asm.
4987         * mpn/ia64/aorslsh1_n.asm: Use aorslshC_n.asm.
4988         * mpn/ia64/aorslsh1_n.asm: New file, use aorslshC_n.asm.
4989
4990 2010-03-20  Torbjorn Granlund  <tege@gmplib.org>
4991
4992         * mpn/powerpc64/mode64/invert_limb.asm: Rewrite to exploit cancellation
4993         in the Newton iteration.
4994
4995 2010-03-20 Marco Bodrato <bodrato@mail.dm.unipi.it>
4996
4997         * mpn/generic/toom_interpolate_8pts.c: Use mpn_sublsh2_n.
4998
4999 2010-03-20  Torbjorn Granlund  <tege@gmplib.org>
5000
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.
5005
5006 2010-03-19  Torbjorn Granlund  <tege@gmplib.org>
5007
5008         * mpn/x86_64/nano/dive_1.asm: New file.
5009
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.
5013
5014         * mpn/x86_64/core2/divrem_1.asm: Remove special code for normalised
5015         divisors.  Cleanup labels.
5016
5017         * mpn/generic/toom_interpolate_6pts.c: Call mpn_sublsh2_n and
5018         mpn_sublsh_n with correct args.
5019
5020         * tests/devel/try.c: Use enum for TYPE_*.
5021
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.
5025
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.
5030
5031 2010-03-18  Torbjorn Granlund  <tege@gmplib.org>
5032
5033         * configure.in (*-*-aix): Define gcc_32_cflags_maybe, ar_32_flags and
5034         nm_32_flags.
5035
5036         * mpn/x86/pentium4/sse2/addlsh1_n.asm: Tune for slightly better speed.
5037         Misc cleanups.  Add cycle table.
5038
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.
5043
5044         * mpn/x86/pentium4/sse2/add_n.asm: Misc cleanups.  Add cycle table.
5045         * mpn/x86/pentium4/sse2/sub_n.asm: Likewise.
5046
5047 2010-03-16  Torbjorn Granlund  <tege@gmplib.org>
5048
5049         * mpn/x86_64/divrem_1.asm: Use mpn_invert_limb instead of div insn.
5050         * mpn/x86_64/core2/divrem_1.asm: Likewise.
5051
5052         * tune/speed.c (routine): Add FLAG_R_OPTIONAL for many binops.
5053
5054 2010-03-15  Torbjorn Granlund  <tege@gmplib.org>
5055
5056         * mpn/alpha/ev6/mod_1_4.asm (mpn_mod_1s_4p_cps): Rewrite.
5057
5058         * mpn/ia64/aors_n.asm: Insert explicitly typed nops to trigger intended
5059         bundling.
5060         * mpn/ia64/aorslsh1_n.asm: Likewise.
5061         * mpn/ia64/dive_1.asm: Likewise.
5062
5063 2010-03-13  Torbjorn Granlund  <tege@gmplib.org>
5064
5065         * mpn/x86/pentium4/sse2/submul_1.asm: Rewrite.
5066
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.
5071
5072 2010-03-11  Niels Möller  <nisse@lysator.liu.se>
5073
5074         * mpn/generic/gcd_lehmer.c (gcd_2): Use sub_ddmmss.
5075
5076         * mpn/generic/jacbase.c (mpn_jacobi_base): Reorganized the
5077         JACOBI_BASE_METHOD 4 slightly. Now requires that b > 1.
5078
5079 2010-03-10  Torbjorn Granlund  <tege@gmplib.org>
5080
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.
5084
5085         * mpn/alpha/ev6/mod_1_4.asm: New file.
5086
5087         * mpn/ia64/mod_34lsub1.asm: New file.
5088
5089         * doc/gmp.texi (Language Bindings): Update Python site, add Ruby.
5090
5091 2010-03-10  Niels Möller  <nisse@lysator.liu.se>
5092
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.
5099
5100         * mpn/generic/jacbase.c (mpn_jacobi_base): New function, for
5101         JACOBI_BASE_METHOD 4.
5102
5103 2010-03-09  Niels Möller  <nisse@lysator.liu.se>
5104
5105         * tests/mpz/t-jac.c (check_large_quotients): Also generate inputs
5106         with large quotients and a large gcd.
5107
5108 2010-03-09 Marco Bodrato <bodrato@mail.dm.unipi.it>
5109
5110         * tests/mpz/t-bin.c (randomwalk): New test-generator function.
5111
5112 2010-03-07  Torbjorn Granlund  <tege@gmplib.org>
5113
5114         * tune/speed.c (routine): Force r argument for several mod_1 calls.
5115
5116 2010-03-06  Torbjorn Granlund  <tege@gmplib.org>
5117
5118         * mpn/x86_64/divrem_1.asm: Disable SPECIAL_CODE_FOR_NORMALIZED_DIVISOR.
5119         Misc clean up.
5120
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.
5124
5125         * tests/tests.h (TESTS_REPS): Fix typo.
5126
5127 2010-03-03  Torbjorn Granlund  <tege@gmplib.org>
5128
5129         * mpn/x86_64/core2/divrem_1.asm: New file.
5130
5131 2010-02-26  Niels Möller  <nisse@lysator.liu.se>
5132
5133         * tune/speed.c (routine): Added udiv_qrnnd_preinv3.
5134
5135         * tune/common.c (speed_udiv_qrnnd_preinv3): New function.
5136         * tune/speed.h: Added prototype for it.
5137
5138 2010-02-26  Niels Möller  <nisse@lysator.liu.se>
5139
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.
5143
5144 2010-02-26  Torbjorn Granlund  <tege@gmplib.org>
5145
5146         * mpn/pa64/aors_n.asm: Fix typo in last change.
5147
5148 2010-02-25  Niels Möller  <nisse@lysator.liu.se>
5149
5150         * tests/mpz/t-jac.c (ref_jacobi): New reference implementation,
5151         using factorization and legendre symbols computed by powm.
5152
5153         * tests/devel/try.c (param_init, call): Don't pass negative values
5154         for the second argument to mpz_jacobi and refmpz_jacobi.
5155
5156         * tests/refmpz.c (refmpz_jacobi): Require that b is odd and positive.
5157
5158         * tests/devel/try.c (param_init): Support mpz_legendre.
5159         (choice_array): Added mpz_kronecker (apparently forgotten) and
5160         mpz_legendre.
5161         (call): Added TYPE_MPZ_LEGENDRE.
5162         (try_one): Added support for DATA_SRC1_ODD_PRIME.
5163
5164         * tests/refmpz.c (refmpz_legendre): Rewrote using powm.
5165
5166 2010-02-25  Torbjorn Granlund  <tege@gmplib.org>
5167
5168         * config.guess: Make "corei" default for unrecognised Intel P6 CPUs.
5169
5170         * tests/mpz/t-perfpow.c (check_random): Use mp_limb_t type for limb
5171         variables.
5172
5173         * tests/mpn/t-toom6h.c (COUNT): Define.
5174         * tests/mpn/t-toom8h.c (COUNT): Define.
5175
5176         * tests/mpn/t-div.c: Cast a switch index to placate HP's cc.
5177         * tests/mpn/t-bdiv.c: Likewise.
5178
5179         * mpn/pa64/aors_n.asm: Fix support of the 2.0n ABI.
5180
5181 2010-02-24 Marco Bodrato <bodrato@mail.dm.unipi.it>
5182
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.
5185
5186 2010-02-23  Torbjorn Granlund  <tege@gmplib.org>
5187
5188         * mpn/generic/mod_1_3.c: Cast a switch index to placate HP's cc.
5189
5190         * mpn/generic/sqrtrem.c: Use CNST_LIMB.
5191
5192 2010-02-20  Niels Möller  <nisse@lysator.liu.se>
5193
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).
5197
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.
5201
5202         * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): Deleted macro.
5203
5204         * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Deleted function,
5205         (mpn_hgcd): Don't call mpn_hgcd_lehmer, instead use inlined loop
5206         around hgcd_step.
5207         (mpn_hgcd_itch): Substitute n for MPN_HGCD_LEHMER_ITCH (n).
5208
5209 2010-02-19  Niels Möller  <nisse@lysator.liu.se>
5210
5211         * Makefile.am (mpn/jacobitab.h): Added the rules needed to
5212         generate this file.
5213
5214         * gen-jacobitab.c: New file.
5215
5216 2010-02-19  Torbjorn Granlund  <tege@gmplib.org>
5217
5218         * mpn/generic/powm.c: Honour SQR_BASECASE_THRESHOLD in innerloop
5219         expansions.
5220
5221 2010-02-16  Niels Möller  <nisse@lysator.liu.se>
5222
5223         * tune/time.c (cgt_works_p): Added rudimentary sanity check for
5224         clock_gettime working.
5225
5226 2010-02-15  Niels Möller  <nisse@lysator.liu.se>
5227
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".
5232
5233         * tune/time.c (cycles_works_p): Deleted hack to disable cycle
5234         counter on linux. Needs to be replaced by something more
5235         selective.
5236
5237 2010-02-11  Niels Möller  <nisse@lysator.liu.se>
5238
5239         * tune/time.c (speed_time_init): Fix speed_time_string when using
5240         clock_gettime.
5241         (cycles_works_p): On linux, don't use the cycle counter.
5242
5243         * tune/Makefile.am: Add $(TUNE_LIBS) when linking programs.
5244
5245         * configure.in: Check if -lrt is needed for clock_gettime, and if
5246         so, add that flag to TUNE_LIBS.
5247
5248 2010-02-07  Torbjorn Granlund  <tege@gmplib.org>
5249
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.
5253
5254         * mpn/x86_64/aorrlsh_n.asm (cnt): Fix a typo.
5255         * mpn/x86_64/lshsub_n.asm: Likewise.
5256
5257 2010-02-05  Torbjorn Granlund  <tege@gmplib.org>
5258
5259         * Version 5.0.1 released.
5260
5261         * mpn/generic/powm.c: Use rp target area for power table computation in
5262         order to use less scratch.
5263
5264         * mpn/generic/binvert.c (mpn_binvert_itch): Enable more economical
5265         mpn_mulmod_bnm1_itch call.
5266
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.
5271
5272 2010-02-01  Torbjorn Granlund  <tege@gmplib.org>
5273
5274         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
5275         Bump version info.
5276
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.
5281
5282 2010-01-29  Torbjorn Granlund  <tege@gmplib.org>
5283
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.
5292
5293 2010-01-27  Torbjorn Granlund  <tege@gmplib.org>
5294
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.
5301
5302 2010-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
5303
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.
5309
5310 2010-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
5311
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.
5316
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.
5321
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.
5331
5332         * tests/mpn/t-sqrmod_bnm1.c, tests/mpn/t-mulmod_bnm1.c: Test
5333         reduced memory usage.
5334
5335 2010-01-25  Torbjorn Granlund  <tege@gmplib.org>
5336
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.
5341
5342 2010-01-23  Torbjorn Granlund  <tege@gmplib.org>
5343
5344         * gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
5345         (__GMP_MP_RELEASE): New macro.
5346
5347         * mpf/div.c: Rewrite to use mpn_div_q.
5348
5349 2010-01-21  Torbjorn Granlund  <tege@gmplib.org>
5350
5351         * Add FFT_TABLE3 tables for a basic set of machines.
5352
5353         * configure.in: Use -mtune=nocona for 64-bit pentium4.
5354
5355         * config.guess: Recognise many more Intel processors.
5356
5357         * tune/common.c: Whitespace cleanup.
5358         (speed_mpn_matrix22_mul): Rewrite.
5359
5360 2010-01-21  Niels Möller  <nisse@lysator.liu.se>
5361
5362         * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Take
5363         advantage of new mpn_mulmod_bnm1 interface, to reduce allocation.
5364
5365         * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1, main): Adapted to
5366         mpn_mulmod_bnm1 interface change.
5367
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
5372         changes.
5373
5374 2010-01-19  Torbjorn Granlund  <tege@gmplib.org>
5375
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.
5379
5380 2010-01-18  Torbjorn Granlund  <tege@gmplib.org>
5381
5382         * tune/tuneup.c (fftmes): New function
5383         (fft): Rewrite.
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.
5387
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
5390         builds.
5391         (FFT_TABLE3_SIZE): Increase value for tuneup builds.
5392
5393         * mpn/generic/mul_fft.c: Handle a new FFT threshold table type ("3").
5394         Misc cleanups to old table type code.
5395
5396 2010-01-16  Torbjorn Granlund  <tege@gmplib.org>
5397
5398         * mpn/x86_64/darwin.m4: Fix typo in last change.
5399
5400 2010-01-15  Torbjorn Granlund  <tege@gmplib.org>
5401
5402         * gmp-h.in (__GMP_EXTERN_INLINE): Remove "extern" for newer Sun C.
5403
5404         * gmp-impl.h (GMP_LIMB_BYTES): New define.
5405
5406         * mpn/x86_64/darwin.m4 (LEA): New define.
5407
5408         * mpn/x86/invert_limb.asm (approx_tab): Use DEF_OBJECT.
5409         Rename and globalise it to work around Mac OS bug.
5410
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.
5415
5416 2010-01-12  Torbjorn Granlund  <tege@gmplib.org>
5417
5418         * tune/speed.c (routine): Remove obsolete mpn_dc_tdiv_qr and
5419         mpn_dc_div_qr_n.
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
5424         now unused macros.
5425
5426         * mpn/x86_64/fat/fat_entry.asm (mpn_cpuid_available): Remove function.
5427
5428         * ltmain.sh: Upgrade from 1.5.24 to 2.2.6b.
5429         * ylwrap: New file.
5430         * .bootstrap: Remove explicit versions.
5431
5432         * doc/gmp.texi (Block-wise Barrett Division): New node.
5433
5434         * mpn/generic/powm.c: Change some #if to plain 'if' to avoid fat build
5435         problems.
5436
5437 2010-01-11  Torbjorn Granlund  <tege@gmplib.org>
5438
5439         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): Accept arguments for size
5440         restrictions.
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.
5444
5445         * tune/speed.c (routine): Allow .r argument for mpn_sbpi1_divappr_q and
5446         mpn_dcpi1_divappr_q.
5447
5448 2010-01-08  Torbjorn Granlund  <tege@gmplib.org>
5449
5450         * Version 5.0.0 released.
5451
5452         * mpn/generic/div_q.c: Handle mpn_*_divappr_q returning high limb
5453         everywhere.
5454
5455 2010-01-07  Torbjorn Granlund  <tege@gmplib.org>
5456
5457         * Update MUL_FFT_TABLE2 and SQR_FFT_TABLE2 for many machines.
5458
5459         * mpn/generic/mu_div_q.c: Account for divisor truncation error as well
5460         as mpn_mu_divappr_q's error.
5461
5462         * mpn/generic/mu_div_q.c: Handle mpn_preinv_mu_divappr_q returning a
5463         high limb.
5464
5465         * tests/mpn/t-bdiv.c: Move a random call for debugability.
5466         * tests/mpn/t-div.c: Likewise.
5467
5468         * mpn/generic/mu_divappr_q.c: Rewrite quotient round-up code.
5469
5470         * mpn/generic/mu_div_qr.c: Handle carry-out from a carry propagation
5471         subtract.
5472         * mpn/generic/mu_divappr_q.c: Likewise.
5473
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.
5477
5478         * perfpow.c (mpn_perfect_power_p): Call mpn_divexact instead of
5479         mpn_bdiv_q (with too little scratch space!).
5480
5481         From Niels Möller:
5482         * tests/mpn/t-div.c (check_one): Get rid of the poorly managed variable
5483         tn.
5484
5485         * mpn/minithres/gmp-mparam.h: Add all lately defined thresholds.
5486
5487         * mpn/generic/div_q.c: Use SB division for small quotients as well as
5488         small divisors.  Fix typo in itch call.
5489
5490 2010-01-06  Niels Möller  <nisse@lysator.liu.se>
5491
5492         * tests/mpn/t-div.c (check_one): Checking based on multiplication,
5493         refmpn_mul, rather than refmpn_tdiv_qr.
5494
5495 2010-01-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
5496
5497         * mpn/generic/toom8h_mul.c: Avoid overflows of mp_size_t.
5498
5499 2010-01-06  Torbjorn Granlund  <tege@gmplib.org>
5500
5501         * gmp-h.in (__GNU_MP__): Bump.
5502         (__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
5503         Bump version info.
5504         * mp-h.in (__GNU_MP__): Bump.
5505         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
5506         Bump version info.
5507
5508         * doc/gmp.texi: Rewrite mpn_gcdext text.  Remove some out-of-date
5509         text in Algorithms chapter.
5510
5511         * mpn/generic/div_q.c: Properly handle np=scratch.  Fix critical typo
5512         in final adjustment code.  Misc cleanups.
5513
5514         * mpn/generic/rootrem.c: Use mpn_div_q.
5515         * mpz/tdiv_q.c: Likewise.
5516
5517         * tests/mpn/t-div.c: Test mpn_div_q.
5518         (SIZE_LOG): Up to 17.
5519
5520         * mpn/generic/div_q.c: New file.
5521         * configure.in (gmp_mpn_functions): Add div_q.
5522
5523         * mpn/generic/mu_div_q.c: Actually declare dividend constant.
5524
5525 2010-01-04  Torbjorn Granlund  <tege@gmplib.org>
5526
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.
5532
5533         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Clean up.
5534
5535         * mpn/generic/mul.c: Simplify rational expression.
5536
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.
5541
5542 2010-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
5543
5544         * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
5545         mpn_toom43_mul.
5546
5547         * mpn/generic/toom_interpolate_6pts.c: Small reorganisation.
5548
5549 2010-01-03  Torbjorn Granlund  <tege@gmplib.org>
5550
5551         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
5552         INV_MULMOD_BNM1_THRESHOLD/2 instead.
5553
5554         * gmp-impl.h (INV_APPR_THRESHOLD, INV_MULMOD_BNM1_THRESHOLD): Default
5555         here...
5556         * mpn/generic/invert.c, mpn/generic/invertappr.c: ...not here.
5557
5558         * tests/mpn/t-div.c: Rewrite operand generation code.
5559
5560 2010-01-02  Torbjorn Granlund  <tege@gmplib.org>
5561
5562         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
5563         INV_MULMOD_BNM1_THRESHOLD.
5564
5565 2010-01-02  Marco Bodrato <bodrato@mail.dm.unipi.it>
5566
5567         * mpn/generic/dcpi1_div_q.c: Handle divappr approximation problem more
5568         efficiently.
5569         * mpn/generic/mu_div_q.c: Likewise.
5570
5571         * mpn/generic/invert.c: Remove duplicated code.
5572
5573 2010-01-01  Torbjorn Granlund  <tege@gmplib.org>
5574
5575         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to 0.
5576
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.
5582
5583         * mpn/generic/dcpi1_bdiv_qr.c: Add parameter ASSERTs.
5584         * mpn/generic/dcpi1_bdiv_q.c: Likewise.
5585
5586         * tests/mpn/t-bdiv.c: Replace with unit testing code, based on t-div.c.
5587         Increase COUNT to 500.
5588
5589         * tests/mpn/t-div.c: Avoid generating too small test operands.
5590         Move SB suppression limit downwards.  Increase COUNT to 200.
5591
5592 2009-12-31  Torbjorn Granlund  <tege@gmplib.org>
5593
5594         * mpn/generic/tdiv_qr.c: Handle numerator/remainder overlap in MU case.
5595
5596         * tests/tests.h (TESTS_REPS): New macro.
5597         * tests/mpz/dive.c: Use larger operands, decrease default reps, use
5598         TESTS_REPS.
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.
5606
5607 2009-12-31  Marco Bodrato <bodrato@mail.dm.unipi.it>
5608
5609         * mpn/generic/toom8_sqr.c (SQR_TOOM8_MAX): Avoid overflow.
5610         * mpn/generic/toom6_sqr.c (SQR_TOOM6_MAX): Likewise.
5611
5612         * mpn/generic/mulmod_bnm1.c: Don't mention MISUSE any more,
5613         simply consider UNLIKELY any unexpected size.
5614
5615 2009-12-31  Torbjorn Granlund  <tege@gmplib.org>
5616
5617         * tune/tuneup.c (speed_mpn_sbordcpi1_div_qr): New function.
5618         (tune_mu_div): Use it.
5619
5620 2009-12-30  Torbjorn Granlund  <tege@gmplib.org>
5621
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.
5624
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,
5627         mpn_dcpi1_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.
5630
5631         * tests/mpz/t-tdiv.c: Increase operands size again.
5632
5633         * mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
5634
5635         * mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
5636         alloc.
5637
5638 2009-12-29  Torbjorn Granlund  <tege@gmplib.org>
5639
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.
5644
5645         * mpn/generic/tdiv_qr.c: Call mpn_mu_div_qr.
5646
5647         * tests/mpz/t-tdiv.c: Use larger test operands.
5648
5649         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr2): Remove code for dn==1.
5650
5651         * mpz/mul.c: Call mpn_sqr directly.  Use PTR,SIZ,ALLOC.
5652
5653         * tune/tuneup.c (tune_mu_div): Set min_size to 6, DC functions require
5654         this.
5655
5656         * tests/mpn/t-div.c: Call mu_div functions with operands that generate
5657         a high quotient limb.
5658
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.
5664
5665         * mpn/generic/invertappr.c (mpn_invertappr): Allocate scratch space
5666         when caller passed NULL.
5667
5668 2009-12-28  Torbjorn Granlund  <tege@gmplib.org>
5669
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.
5677
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.
5683
5684         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Set step_factor.
5685
5686         * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
5687         mpn_lshiftc.
5688
5689         * tests/devel/try.c: Test mpn_lshiftc.
5690         * tests/refmpn.c (refmpn_com): New function.
5691         (refmpn_lshiftc): Likewise.
5692
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.
5699
5700         * mpn/x86_64/core2/lshift.asm: Tweak for better Core iN performance.
5701         * mpn/x86_64/core2/rshift.asm: Likewise.
5702
5703 2009-12-27  Marco Bodrato <bodrato@mail.dm.unipi.it>
5704
5705         * mpn/generic/mul.c: Use toom6h and toom8h for almost balanced.
5706
5707         * mpn/generic/mullo_n.c (mpn_dc_mullo_n): New ratio, to be used in
5708         Toom-8 range.
5709
5710 2009-12-27  Torbjorn Granlund  <tege@gmplib.org>
5711
5712         * (mpn_sqr): New name for mpn_sqr_n.  Many files affected.
5713
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.
5716
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.
5728
5729         * mpn/*/gmp-mparam.h: Fix incorrect MOD_1U_TO_MOD_1_1_THRESHOLD 0
5730         values.
5731
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.
5743
5744         * mpn/generic/toom22_mul.c (TOOM22_MUL_REC): New name for
5745         TOOM22_MUL_MN_REC.
5746
5747 2009-12-26  Niels Möller  <nisse@lysator.liu.se>
5748
5749         * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Relax
5750         requirements a bit.
5751
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.
5755
5756         * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Remove
5757         unused variables.
5758
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.
5761
5762 2009-12-26  Marco Bodrato <bodrato@mail.dm.unipi.it>
5763
5764         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add new toom files (spotted by Torbjorn).
5765
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.
5769
5770 2009-12-25  Niels Möller  <nisse@lysator.liu.se>
5771
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.
5779
5780 2009-12-25  Torbjorn Granlund  <tege@gmplib.org>
5781
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
5785
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.
5788
5789         * tune/tuneup.c (tune_mod_1): Add a check_size for
5790         PREINV_MOD_1_TO_MOD_1_THRESHOLD.
5791
5792 2009-12-24  Torbjorn Granlund  <tege@gmplib.org>
5793
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.
5798
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.
5804
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.
5811
5812 2009-12-24  Marco Bodrato <bodrato@mail.dm.unipi.it>
5813
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.
5818
5819 2009-12-24  Torbjorn Granlund  <tege@gmplib.org>
5820
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.
5824
5825         * mpn/generic/powm_sec.c: Use SQR_TOOM2_THRESHOLD as limit for a native
5826         mpn_sqr_basecase, not TUNE_SQR_TOOM2_MAX.
5827
5828 2009-12-23  Marco Bodrato <bodrato@mail.dm.unipi.it>
5829
5830         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
5831         mpn_toom8h_mul and mpn_toom8_sqr speed.
5832
5833         * mpn/generic/toom_eval_pm2exp.c: Fix ASSERTs.
5834
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.
5842
5843         * mpn/generic/toom6_sqr.c: New file, was part of toom6h_mul.
5844         * mpn/generic/toom6h_mul.c: Removed _sqr.
5845
5846         * mpn/generic/mulmod_bnm1.c: Nailify CRT.
5847         * mpn/generic/sqrmod_bnm1.c: Likewise.
5848
5849         * mpn/generic/mullo_n.c: Split dc_mullo_n function;
5850         ALLOC memory at once.
5851
5852         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Update.
5853
5854         * mpn/generic/toom6h_mul.c: Add prefix to toom_interpolate_12pts.
5855         * mpn/generic/toom_interpolate_12pts.c: Likewise.
5856
5857         * mpn/generic/invertappr.c (mpn_bc_invertappr): Use mpn_divrem_2.
5858         * mpn/generic/invert.c: Faster basecase, use mpn_sbpi1_div_q.
5859
5860         * mpn/generic/toom_eval_pm2exp.c: Assert support for degree 3.
5861         * mpn/generic/toom6h_mul.c: Avoid obsolete _itch function.
5862
5863 2009-12-23  Torbjorn Granlund  <tege@gmplib.org>
5864
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.
5867
5868         * tests/mpz/t-powm.c: Test mpz_powm_sec.
5869
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.
5874
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.
5879
5880         * mpn/generic/powm.c (win_size): Start loop from 1.
5881
5882 2009-12-22  Torbjorn Granlund  <tege@gmplib.org>
5883
5884         * tests/mpn/t-div.c: New file.
5885         * tests/mpn/Makefile.am: Compile it.
5886
5887         * mpn/generic/mu_divappr_q.c: Handle quotient overflow.
5888
5889         * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): New function.
5890
5891 2009-12-22  Niels Möller  <nisse@lysator.liu.se>
5892
5893         * mpn/generic/sbpi1_div_q.c: Use udiv_qr_3by2.  Intended to change
5894         nothing after preprocessing.
5895
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.
5899
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.
5904
5905 2009-12-22  Torbjorn Granlund  <tege@gmplib.org>
5906
5907         * tests/mpn/t-toom6h.c (MIN_AN): Set to MUL_TOOM6H_THRESHOLD to avoid
5908         invalid recursive sizes.
5909
5910         * tests/mpn/t-bdiv.c: Get itch function calls right.
5911
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.
5914
5915         * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Simplify, don't allocate.
5916         (mpn_bdiv_qr_itch): Conditionalise on MU_BDIV_QR_THRESHOLD.
5917
5918 2009-12-18  Niels Möller  <nisse@lysator.liu.se>
5919
5920         * tests/mpn/t-bdiv.c: Add red-zones.
5921
5922 2009-12-21  Torbjorn Granlund  <tege@gmplib.org>
5923
5924         * mpn/generic/sbpi1_div_q.c: Fix fixup code to work for qn = 0.
5925
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).
5928
5929         * mpn/generic/dcpi1_div_qr.c: Rewrite singular case giving q limb of
5930         GMP_NUMB_MAX.  Remove an impossible qn = 0 case.
5931
5932         * mpn/generic/dcpi1_bdiv_q.c: Remove a spurious mpn_sub_1.
5933
5934         * mpn/generic/mul.c: Put back call to mpn_mul_n.
5935
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.
5938
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.
5942
5943         * mpn/generic/bdiv_q_1.c (mpn_pi1_bdiv_q_1): Renamed from
5944         mpn_bdiv_q_1_pi1.
5945         * All references changed.
5946
5947         * configure.in: Add --enable-old-fft-full.
5948         * tune/speed.c (routine): Conditionalise mpn_mul_fft_full references on
5949         WANT_OLD_FFT_FULL.
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
5953         WANT_OLD_FFT_FULL.
5954
5955 2009-12-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
5956
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.
5963
5964         * mpn/generic/toom63_mul.c: Remove unused TMP_*.
5965
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.
5970
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.
5977
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,
5982         toom6h_mul.
5983         * tests/mpn/t-toom6h.c: New test program.
5984
5985         * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1): Use ref_mul.
5986         * tests/mpn/t-sqrmod_bnm1.c (ref_sqrmod_bnm1): Likewise.
5987
5988 2009-12-20  Marco Bodrato <bodrato@mail.dm.unipi.it>
5989
5990         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): New CRT.
5991         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
5992
5993 2009-12-20  Torbjorn Granlund  <tege@gmplib.org>
5994
5995         * Change all bit counts for bignums to use mp_bitcnt_t.
5996
5997         * mpn/generic/bdivmod.c: File removed.  All references purged.
5998
5999         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Disable.
6000
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.
6006
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.
6009
6010 2009-12-19  Marco Bodrato <bodrato@mail.dm.unipi.it>
6011
6012         * mpn/generic/toom_interpolate_8pts.c: Nailify.
6013
6014 2009-12-19  Torbjorn Granlund  <tege@gmplib.org>
6015
6016         * mpn/generic/mul.c: Major rewrite.  Use toom43, toom53, toom63.
6017         Call mpn_nussbaumer_mul for largest operands.
6018
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.
6036
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.
6041
6042 2009-12-18  Niels Möller  <nisse@lysator.liu.se>
6043
6044         * mpz/divexact.c: Rewrite to use mpn_divexact.
6045
6046         * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Deleted some unused
6047         variables.
6048
6049         * mpn/generic/toom52_mul.c (mpn_toom52_mul)
6050         [HAVE_NATIVE_mpn_add_n_sub_n]: Moved declaration of cy to avoid a
6051         compiler warning.
6052
6053         * gmp-impl.h (gmp_pi1_t): Eliminated inv21 member.
6054         (invert_pi1): ...and don't store it here.
6055
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.
6059
6060         * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
6061         output asserts.
6062
6063 2009-12-18  Torbjorn Granlund  <tege@gmplib.org>
6064
6065         * tests/mpn/t-toom63.c: New test program.
6066
6067 2009-12-18  Marco Bodrato <bodrato@mail.dm.unipi.it>
6068
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.
6073
6074         * tests/mpn/t-invert.c: New test program.
6075
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
6080         toom63_mul.
6081
6082 2009-12-17  Torbjorn Granlund  <tege@gmplib.org>
6083
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
6088         mpn_toom32_mul.
6089
6090         * doc/gmp.texi: Update References section.  Update Contributors
6091         section.  Misc updates.
6092
6093         * gmp-impl.h: Renew default values for all THRESHOLDs.
6094
6095 2009-12-17  Niels Möller  <nisse@lysator.liu.se>
6096
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.
6101
6102         * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): Added some input
6103         asserts.
6104
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.
6108
6109 2009-12-17  Marco Bodrato <bodrato@mail.dm.unipi.it>
6110
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.
6114
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.
6122
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.
6134
6135         * tune/tuneup.c: Tune SQRMOD_BNM1_THRESHOLD.
6136
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.
6142
6143 2009-12-17  Torbjorn Granlund  <tege@gmplib.org>
6144
6145         * mpn/generic/bdiv_q.c (mpn_bdiv_q_itch): Rewrite.
6146
6147 2009-12-16  Torbjorn Granlund  <tege@gmplib.org>
6148
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.
6153
6154         * minithres/gmp-mparam.h: Add new thresholds, trim old values.
6155
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.
6160
6161 2009-12-16  Niels Möller  <nisse@lysator.liu.se>
6162
6163         * tests/mpz/t-gcd.c (main): Added test case to exercise the
6164         unlikely u0 == u1 case in mpn_gcdext_lehmer_n.
6165
6166         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Get ASSERT
6167         right.
6168
6169 2009-12-16  Torbjorn Granlund  <tege@gmplib.org>
6170
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
6175         ref_mpn_mul.
6176         (refmpn_mullo_n): Add a missing free.
6177
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.
6181
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.
6187
6188 2009-12-15  Torbjorn Granlund  <tege@gmplib.org>
6189
6190         * mpn/generic/gcdext_subdiv_step.c: Get an ASSERT right.
6191
6192 2009-12-15  Niels Möller  <nisse@lysator.liu.se>
6193
6194         * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): A very small step
6195         towards nail support.
6196
6197 2009-12-15  Marco Bodrato <bodrato@mail.dm.unipi.it>
6198
6199         * gmp-impl.h (mpn_ni_invertappr): Added prototype and name-mangling.
6200         * mpn/generic/mulmod_bnm1.c: Comment representation of class [0].
6201
6202 2009-12-14  Niels Möller  <nisse@lysator.liu.se>
6203
6204         * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Use
6205         udiv_qr_3by2.
6206
6207 2009-12-14  Torbjorn Granlund  <tege@gmplib.org>
6208
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.
6213
6214 2009-12-14  Marco Bodrato <bodrato@mail.dm.unipi.it>
6215
6216         * mpn/generic/invert.c: Improved comments.
6217         (mpn_bc_invertappr): Conditionally re-enable mpn_dcpi1_divappr_q.
6218
6219 2009-12-14  Niels Möller  <nisse@lysator.liu.se>
6220
6221         * gmp-impl.h (udiv_qr_3by2): Fix typo in argument list.
6222
6223 2009-12-13  Niels Möller  <nisse@lysator.liu.se>
6224
6225         * gmp-impl.h (udiv_qr_3by2): New macro.
6226         * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): Use udiv_qr_3by2.
6227
6228 2009-12-13  Torbjorn Granlund  <tege@gmplib.org>
6229
6230         * mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q): Avoid a buffer
6231         overrun.
6232
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.
6236
6237         * mpn/generic/gcdext.c (compute_v): Normalise tp[] after mpn_mul.
6238
6239         * mpz/powm.c: Rework buffer handling.
6240
6241 2009-12-13  Niels Möller  <nisse@lysator.liu.se>
6242
6243         * tests/mpn/toom-shared.h (main): Use refmpn_mul_basecase to check
6244         results (slow!). Iteration counts of all toom tests reduced
6245         considerably.
6246
6247 2009-12-13  Marco Bodrato <bodrato@mail.dm.unipi.it>
6248
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.
6255
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.
6260
6261         * tune/tuneup.c (tune_invertappr): Use speed_mpn_ni_invertappr to
6262         tune INV_MULMOD_BNM1_THRESHOLD.
6263
6264 2009-12-12  Torbjorn Granlund  <tege@gmplib.org>
6265
6266         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Rewrite.
6267
6268 2009-12-12  Marco Bodrato <bodrato@mail.dm.unipi.it>
6269
6270         * tests/mpn/t-mulmod_bnm1.c (main): Disable B^n+1 stressing test
6271         for odd sizes.
6272
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.
6284
6285 2009-12-11  Torbjorn Granlund  <tege@gmplib.org>
6286
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.
6291
6292         * tests/mpn/t-bdiv.c (COUNT): Decrease to keep run time reasonable.
6293
6294         * tune/tuneup.c (tune_invert): Tune INV_MULMOD_BNM1_THRESHOLD.
6295         * gmp-impl.h: Provide declarations for corresponding threshold var.
6296
6297         * tests/mpn/t-mulmod_bnm1.c: Avoid a division by zero.
6298
6299         * configure.in: Set up different paths for different 64-bit sparc
6300         processors.
6301         * mpn/sparc64/ultrasparc34/gmp-mparam.h: New file.
6302
6303 2009-12-10  Torbjorn Granlund  <tege@gmplib.org>
6304
6305         * mpn/*/gmp-mparam.h: Regenerate many of these files.
6306
6307 2009-12-10  Niels Möller  <nisse@lysator.liu.se>
6308
6309         * gmp-impl.h (mpn_divexact): Removed scratch pointer from
6310         prototype.
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
6315         argument.
6316
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.
6319
6320         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Small interface
6321         change, require an >= bn.
6322
6323         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Fixed non-recursive
6324         case to not write beyond end of result area.
6325
6326 2009-12-09  Torbjorn Granlund  <tege@gmplib.org>
6327
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.
6333
6334         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
6335
6336         * tune/tuneup.c (tune_mulmod_bnm1): Rewrite.
6337
6338 2009-12-08  Marco Bodrato <bodrato@mail.dm.unipi.it>
6339
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.
6344
6345 2009-12-08  Niels Möller  <nisse@lysator.liu.se>
6346
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.
6350
6351         * mpn/generic/gcdext.c (divexact): Local definition of divexact,
6352         using mpn_bdiv_q.
6353         (compute_v): Use it.
6354
6355         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-bdiv.
6356
6357         * tests/mpn/t-bdiv.c: New file.
6358
6359         * mpn/generic/bdiv_q.c (mpn_bdiv_q): Fixed bad quotient length,
6360         should have qn == nn.
6361
6362         * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Pass correct nn length to
6363         the lower-level functions.
6364
6365 2009-12-08  Torbjorn Granlund  <tege@gmplib.org>
6366
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.
6371
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.
6374
6375         * tune/speed.c (routine): Add mpn_invert.
6376
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.
6382
6383 2009-12-08  Marco Bodrato <bodrato@mail.dm.unipi.it>
6384
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.
6392
6393 2009-12-06  Torbjorn Granlund  <tege@gmplib.org>
6394
6395         * tune/tuneup.c (tune_mulmod_bnm1): Up min_size to 12.
6396
6397         * Globally: Rename *mullow* to *mullo*, *MULLOW* to *MULLO*.
6398
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.
6407
6408         * mpn/powerpc64/mode64/diveby3.asm: Remove, it is slower than
6409         mpn_bdiv_dbm1c on all hardware.
6410
6411         * mpn/generic/powm_sec.c: Rework logic for mpn_sqr_basecase size limit.
6412
6413         * gmp-impl.h (mpn_redc_1_sec): Declare.
6414         * configure.in (gmp_mpn_functions): Add redc_1_sec.
6415
6416 2009-12-06  Marco Bodrato <bodrato@mail.dm.unipi.it>
6417
6418         * tests/devel/try.c (try_one): DATA_SRC0_HIGHBIT sets the high bit.
6419
6420 2009-12-05  Marco Bodrato <bodrato@mail.dm.unipi.it>
6421
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.
6427
6428         * mpn/generic/toom_interpolate_5pts.c: Param sa is a flag, not a sign.
6429
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.
6437
6438         * mpn/generic/toom52_mul.c: Use toom_eval_ functions.
6439
6440         * mpn/generic/toom4_sqr.c: Avoid C99 construct.
6441         * mpn/generic/toom_interpolate_7pts.c: Likewise.
6442
6443 2009-12-05  Torbjorn Granlund  <tege@gmplib.org>
6444
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.
6450
6451         * configure.in (HAVE_NATIVE): Add missing functions, then sort.
6452
6453 2009-12-04  Torbjorn Granlund  <tege@gmplib.org>
6454
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.
6457
6458         * tune/speed.h: Negate "binvert"-type inverses, as required.
6459
6460         * mpn/generic/redc_1.c: Add ASSERTs.
6461         * mpn/generic/redc_2.c: Likewise.
6462
6463         * mpn/generic/sbpi1_bdiv_q.c: Simplify loops, indexing.
6464
6465 2009-12-03  Yann Droneaud  <yann@droneaud.fr>
6466
6467         * acinclude.m4 ([long long reliability test 1]): Add a "static" for C99
6468         inline semantics compatibility.
6469
6470 2009-12-03  Torbjorn Granlund  <tege@gmplib.org>
6471
6472         * configure.in: Move intptr_t test into common AC_CHECK_TYPES.
6473
6474         * mpn/generic/gcdext.c: Add a TMP_FREE.
6475
6476 2009-12-03  Niels Möller  <nisse@lysator.liu.se>
6477
6478         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
6479         Added various masking tricks.
6480
6481         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
6482         Reimplemented binary gcdext, with proper canonicalization.
6483
6484         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Handle v == 0
6485         from mpn_gcdext_1.
6486         * mpn/generic/gcdext_1.c (mpn_gcdext_1): Allow inputs with a < b,
6487         assertions fixed accordingly.
6488
6489 2009-12-03  Torbjorn Granlund  <tege@gmplib.org>
6490
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.
6499
6500         * tune/tuneup.c (tune_binvert): Up max_size.
6501
6502 2009-12-02  Marco Bodrato <bodrato@mail.dm.unipi.it>
6503
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.
6508
6509 2009-12-03  Niels Möller  <nisse@lysator.liu.se>
6510
6511         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step):
6512         Select the right cofactor in the cases A == B or A == 2B.
6513
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.
6518
6519 2009-12-02  Niels Möller  <nisse@lysator.liu.se>
6520
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.
6526
6527 2009-12-02  Torbjorn Granlund  <tege@gmplib.org>
6528
6529         * doc/gmp.texi (Low-level Functions): Document mpn_sqr_n.
6530
6531         * tune/speed.c (routine): Add mpn_binvert.
6532
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.
6539
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
6549         dcpi1_bdiv_q.c.
6550
6551 2009-12-01  Marco Bodrato <bodrato@mail.dm.unipi.it>
6552
6553         * mpn/generic/toom53_mul.c: Removed double computation of vinf.
6554
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.
6558
6559         * mpn/generic/fib2_ui.c: Reduce the amount of temporary storage.
6560         Use mpn_rsblsh_n.
6561
6562 2009-12-01  Torbjorn Granlund  <tege@gmplib.org>
6563
6564         * mpn/generic/redc_n.c: Rework temp allocation.
6565
6566         * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n_itch): Add pi1 also
6567         to this function.
6568
6569         * mpn/generic/dcpi1_bdiv_q.c: Get the mpn_sbpi1_bdiv_q call right.
6570         Misc cleanups.
6571
6572         * tune/speed.c (routine): Fix typo in last change.
6573         Add mpn_redc_2.
6574
6575         * tune/speed.h (SPEED_ROUTINE_REDC_N): Set min size properly.
6576
6577 2009-12-01  Niels Möller  <nisse@lysator.liu.se>
6578
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.
6584
6585 2009-11-30  Marco Bodrato <bodrato@mail.dm.unipi.it>
6586
6587         * mpn/generic/fib2_ui.c: Use mpn_rsblsh2_n.
6588
6589 2009-11-29  Torbjorn Granlund  <tege@gmplib.org>
6590
6591         * mpn/x86_64/pentium4/gmp-mparam.h
6592         (HAVE_NATIVE_mpn_addlsh1_n, HAVE_NATIVE_mpn_sublsh1_n): Don't undef.
6593
6594         * Makefile.am (EXTRA_DIST): Remove macos.
6595
6596 2009-11-28  Torbjorn Granlund  <tege@gmplib.org>
6597
6598         * tune/tuneup.c (tune_redc): Set min_size to 16 for redc_n tuning.
6599
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.
6602
6603 2009-11-28  Marco Bodrato <bodrato@mail.dm.unipi.it>
6604
6605         * mpn/generic/mulmod_bnm1.c: Basecases made simpler, this also corrects
6606         a bug affecting previous version.
6607
6608 2009-11-28  Torbjorn Granlund  <tege@gmplib.org>
6609
6610         * configure.in: Handle atom also in 32-bit mode.
6611         * mpn/x86/atom/gmp-mparam.h: New file.
6612
6613         * gmp-impl.h (MULMOD_BNM1_THRESHOLD): Default.
6614
6615         * mpn/generic/redc_n.c: Use mpn_mulmod_bnm1 instead of mpn_mul_n.
6616
6617         * Use TMP_ALLOC_LIMBS consistently.
6618         * Finish renaming BITS_PER_MP_LIMB to GMP_LIMB_BITS.
6619
6620         * macos: Remove entire directory.
6621
6622 2009-11-27  Torbjorn Granlund  <tege@gmplib.org>
6623
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.
6629
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.
6635
6636         * mpz/powm.c: Allow input operand overlap also when exponent = 1.
6637         Misc cleanups.
6638
6639 2009-11-26  Marco Bodrato <bodrato@mail.dm.unipi.it>
6640
6641         * tests/mpn/t-mulmod_bnm1.c: New test file.
6642         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-mulmod_bnm1.
6643
6644         * mpn/generic/mullow_n.c: Comments on Mulders' trick implementation.
6645
6646 2009-11-26  Torbjorn Granlund  <tege@gmplib.org>
6647
6648         * mpn/generic/powm.c: Make comments reflect current code state.
6649
6650         * tests/devel/try.c: Make mpn_mullow_n testing actually work.
6651
6652 2009-11-25  Torbjorn Granlund  <tege@gmplib.org>
6653
6654         * mpz/powm.c: Clean up unused defs.
6655
6656 2009-11-24  Torbjorn Granlund  <tege@gmplib.org>
6657
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.
6664
6665 2009-11-23  Torbjorn Granlund  <tege@gmplib.org>
6666
6667         * mpn/generic/powm.c: Fix typo.
6668         Define LOCAL_REDC_N_THRESHOLD, use in REDC_2_THRESHOLD...
6669         REDC_N_THRESHOLD chain.
6670
6671 2009-11-22  Torbjorn Granlund  <tege@gmplib.org>
6672
6673         * tune/tuneup.c (tune_mullow): Set min_size to 1.
6674
6675         * mpn/generic/powm_sec.c: Use just mpn_mul_basecase and
6676         mpn_sqr_basecase for multiplication and squaring.
6677
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.
6683
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
6689         for tuneup.
6690
6691 2009-11-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
6692
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.
6696
6697 2009-11-22  Torbjorn Granlund  <tege@gmplib.org>
6698
6699         * tune/tuneup.c (tune_mullow): Rewrite.
6700
6701 2009-11-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
6702
6703         * gmp-impl.h: Removed unused macros (CACHED_ABOVE_THRESHOLD and
6704         CACHED_BELOW_THRESHOLD).
6705
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}.
6710
6711         * tune/speed.c (routine): Add entry related to mpn_mulmod_bnm1.
6712
6713 2009-11-19  Niels Möller  <nisse@lysator.liu.se>
6714
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.
6720
6721         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2) [HAVE_NATIVE_mpn_addlsh_n]:
6722         Fixed missing declaration.
6723
6724         * mpn/asm-defs.m4 (define_mpn): Add addlsh_n.
6725         * gmp-impl.h (mpn_addlsh_n): Added prototype and name-mangling.
6726
6727 2009-11-19  Niels Möller  <nisse@lysator.liu.se>
6728
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.
6733
6734 2009-11-18  Torbjorn Granlund  <tege@gmplib.org>
6735
6736         * gmp-impl.h (mpn_and_n, etc): Adapt to now-public logic functions.
6737
6738         * config.guess: Recognise VIA nano.
6739         * config.sub: Likewise.
6740         * configure.in: Generalise x86_64 support; recognise VIA nano.
6741
6742 2009-11-16  Torbjorn Granlund  <tege@gmplib.org>
6743
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.
6747
6748         * mpn/generic/divis.c: Use MU_BDIV_QR_THRESHOLD.
6749
6750         * configure.in (gmp_mpn_functions_optional): Add *lsh_n functions.
6751
6752         * mpn/generic/toom_eval_pm2exp.c: Make HAVE_NATIVE_mpn_addlsh_n code
6753         work.
6754
6755         * mpn/x86_64/aorrlsh2_n.asm: Optimise inner loop.
6756
6757         * configure.in (gmp_mpn_functions_optional): Remove copyi,copyd, they
6758         are now in gmp_mpn_functions.  Analogously move logical functions.
6759
6760 2009-11-16  Marco Bodrato <bodrato@mail.dm.unipi.it>
6761
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).
6764
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.
6768
6769 2009-11-15  Torbjorn Granlund  <tege@gmplib.org>
6770
6771         * mpn/x86_64/aorrlsh2_n.asm: New file.
6772         * configure.in: Add support for addlsh2_n, sublsh2_n, and rsblsh2_n,
6773         including mulfuncs.
6774         * gmp-impl.h (mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n): Declare.
6775         * mpn/asm-defs.m4: Likewise.
6776
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.
6782
6783 2009-11-15  Marco Bodrato <bodrato@mail.dm.unipi.it>
6784
6785         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): fix typo
6786
6787         * mpn/generic/toom33_mul.c: Use rsblsh1 for evaluation.
6788         * mpn/generic/toom3_sqr.c: Likewise.
6789
6790 2009-11-14  Torbjorn Granlund  <tege@gmplib.org>
6791
6792         * mpn/generic/toom52_mul.c: Use mpn_addlsh1_n.
6793
6794         * mpn/generic/toom52_mul.c: Toggle the right flag bit in an
6795         HAVE_NATIVE_mpn_add_n_sub_n arm.
6796
6797         * tests/mpz/t-remove.c: New file.
6798
6799         * mpn/generic/remove.c: Major overhaul.  Add parameter 'cap'.
6800
6801         * mpn/generic/binvert.c: Fix typo in last change.
6802
6803         * mpn/generic/bdiv_qr.c: Make it actually work.  Also use passed-in
6804         scratch space.
6805
6806         * mpn/generic/mu_bdiv_qr.c: Reset FFT parameters for each call.
6807
6808 2009-11-12  Torbjorn Granlund  <tege@gmplib.org>
6809
6810         * mpn/x86/k7/gcd_1.asm (MASK): Compute from MAXSHIFT.
6811
6812 2009-11-11  Torbjorn Granlund  <tege@gmplib.org>
6813
6814         * mpn/generic/binvert.c: Simplify, fix comments.
6815
6816         * tests/devel/try.c: Test mpn_invert and mpn_binvert.
6817
6818         * tests/refmpn.c (refmpn_invert, refmpn_binvert): New functions.
6819         * tests/tests.h: Declare new functions.
6820
6821 2009-11-10  Torbjorn Granlund  <tege@gmplib.org>
6822
6823         * configure.in: Supply compiler options for atom in 32-bit mode.
6824
6825         * acinclude.m4 (X86_64_PATTERN): New.
6826         * configure.in: Setup and use X86_64_PATTERN.
6827
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.
6835
6836 2009-11-09  Torbjorn Granlund  <tege@gmplib.org>
6837
6838         * mpn/x86/fat/mod_1.c: New file.
6839
6840         * acinclude.m4 (GMP_C_FOR_BUILD_ANSI): Avoid poor quoting.
6841
6842 2009-11-08  Torbjorn Granlund  <tege@gmplib.org>
6843
6844         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Rewrite, update interface.  Callers
6845         updated.
6846         * mpn/generic/logops_n.c: New file.
6847         * doc/gmp.texi (Low-level Functions): Document logical mpn functions.
6848
6849 2009-11-07  Torbjorn Granlund  <tege@gmplib.org>
6850
6851         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): Adapt to new
6852         mpn_mulmod_bnm1 interface.
6853
6854 2009-11-07  Marco Bodrato <bodrato@mail.dm.unipi.it>
6855
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.
6859
6860 2009-11-05  Torbjorn Granlund  <tege@gmplib.org>
6861
6862         * mpn/x86/k7/gcd_1.asm: Actually use div-reduced value.
6863         Mnemonic cleanup.
6864
6865         * mpn/x86_64/gcd_1.asm: New file.
6866
6867 2009-11-03  Torbjorn Granlund  <tege@gmplib.org>
6868
6869         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqr_n.c.
6870
6871 2009-11-03  Marco Bodrato <bodrato@mail.dm.unipi.it>
6872
6873         * mpn/generic/toom_interpolate_6pts.c: removed an addmul_1 and cleanup.
6874
6875 2009-11-02  Torbjorn Granlund  <tege@gmplib.org>
6876
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.
6885
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.
6888
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
6894         mpn_sb_divrem.
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.
6901
6902         * mpn/generic/sb_divappr_q.c: Remove.
6903
6904 2009-11-01  Torbjorn Granlund  <tege@gmplib.org>
6905
6906         * gmp-impl.h: Misc minor cleanups.
6907
6908 2009-10-31  Torbjorn Granlund  <tege@gmplib.org>
6909
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.
6916
6917         * Globally change
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.
6922
6923 2009-10-31  Niels Möller  <nisse@lysator.liu.se>
6924
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.
6934
6935         * mpn/generic/toom_eval_pm2exp.c: New file.
6936         * mpn/generic/toom_eval_pm1.c: New file.
6937
6938         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
6939         mpn_toom_eval_dgr3_pm2.
6940
6941 2009-10-30  Torbjorn Granlund  <tege@gmplib.org>
6942
6943         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom2* and toom3* files.
6944
6945 2009-10-30  Niels Möller  <nisse@lysator.liu.se>
6946
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.
6950
6951 2009-10-29  Niels Möller  <nisse@lysator.liu.se>
6952
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.
6956
6957 2009-10-29  Torbjorn Granlund  <tege@gmplib.org>
6958
6959         * mpn/generic/mulmod_bnm1.c: Replace some add_1 by INCR.
6960
6961         * gmp-impl.h (mpn_mulmod_bnm1_itch): New macro.
6962
6963         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Call mpn_mul_fft.
6964         (mpn_mulmod_bnm1_next_size): Adopt to SS FFT.
6965
6966         * mpn/generic/mul_fft.c (mpn_mul_fft): Make it return high limb.
6967         (mpn_mul_fft_internal): Likewise.
6968
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.
6976
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.
6980
6981         * tests/devel/try.c: Clean up usage of %p printf arguments.
6982
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.
6988
6989 2009-10-29  Niels Möller  <nisse@lysator.liu.se>
6990
6991         * tune/speed.c: Added support for mpn_toom4_sqr,
6992
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.
6997
6998         * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove
6999         declarations.
7000         (mpn_toom2_sqr_itch): Add margin for recursive calls.
7001
7002 2009-10-28  Niels Möller  <nisse@lysator.liu.se>
7003
7004         * mpn/generic/mul_n.c (mpn_kara_mul_n): Deleted old Karatsuba
7005         implementation.
7006         (mpn_kara_sqr_n): Likewise deleted.
7007
7008         * mpn/generic/mul_n.c (mpn_sqr_n): Use mpn_toom2_sqr and
7009         mpn_toom3_sqr, not the old implementations.
7010
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
7014         mpn_toom3_sqr_itch.
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.
7022
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.
7026
7027 2009-10-26  Torbjorn Granlund  <tege@gmplib.org>
7028
7029         * gmp-impl.h (invert_pi1): Streamline, as suggested by Niels.
7030
7031 2009-10-24  Torbjorn Granlund  <tege@gmplib.org>
7032
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.
7059
7060         * configure.in (gmp_mpn_functions): Add new division functions, remove
7061         obsolete division functions.
7062
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.
7067
7068 2009-10-23  Niels Möller  <nisse@lysator.liu.se>
7069
7070         * gmp-impl.h (mpn_toom62_mul_itch): New function.
7071
7072         * tests/mpn/t-toom53.c: New test program.
7073         * tests/mpn/t-toom62.c: New test program.
7074
7075 2009-10-23  Torbjorn Granlund  <tege@gmplib.org>
7076
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.
7079
7080 2009-10-23  Niels Möller  <nisse@lysator.liu.se>
7081
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.
7085
7086         * gmp-impl.h (mpn_toom52_mul_itch): New function.
7087
7088         * tests/mpn/t-toom52.c: New test program.
7089
7090 2009-10-22  Torbjorn Granlund  <tege@gmplib.org>
7091
7092         * mpn/x86_64/sqr_basecase.asm: Tune for speed and a 7% size decrease.
7093
7094 2009-10-22  Niels Möller  <nisse@lysator.liu.se>
7095
7096         * tests/mpn/t-toom44.c: New test program.
7097         * tests/mpn/t-toom33.c: New test program.
7098
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.
7102
7103 2009-10-22  Torbjorn Granlund  <tege@gmplib.org>
7104
7105         * tests/devel/try.c: Fix typos in last change.
7106
7107 2009-10-21  Torbjorn Granlund  <tege@gmplib.org>
7108
7109         * mpn/asm-defs.m4 (define_mpn): Add mullow_basecase.
7110
7111         * tests/devel/try.c: Test mpn_mullow_n.
7112
7113         * tests/refmpn.c (refmpn_mullow_n): New function.
7114         * tests/tests.h: Declare it.
7115
7116 2009-10-21  Niels Möller  <nisse@lysator.liu.se>
7117
7118         * tests/mpn/toom-shared.h (main): Check for writes outside of the
7119         product or scratch area.
7120
7121         * gmp-impl.h (mpn_toom43_mul_itch): New function.
7122
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.
7126
7127 2009-10-20  Niels Möller  <nisse@lysator.liu.se>
7128
7129         * tests/mpn/toom-shared.h (MIN_BLOCK): New constant, which can be
7130         overridden by users. Needed by t-toom42 and t-toom43.
7131
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.
7137
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
7141         functions.
7142
7143 2009-10-14  Niels Möller  <nisse@lysator.liu.se>
7144
7145         * mpn/generic/hgcd.c (mpn_hgcd_itch): Thanks to the new
7146         mpn_matrix22_mul_strassen, the scratch need is reduced by 16%.
7147
7148 2009-10-14  Marco Bodrato  <bodrato@mail.dm.unipi.it>
7149
7150         * mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): New
7151         Strassen-like algorithm, to reduce the amount of temporary
7152         storage.
7153         (mpn_matrix22_mul_itch): Updated to reflect the reduced storage
7154         need.
7155
7156 2009-10-03  Torbjorn Granlund  <tege@gmplib.org>
7157
7158         * Rename mpn_addsub_n to mpn_add_n_sub_n.
7159
7160 2009-10-01  Torbjorn Granlund  <tege@gmplib.org>
7161
7162         * mpn/generic/tdiv_qr.c: Call mpn_divrem_1 and mpn_dc_div_qr instead of
7163         old functions.
7164
7165         * mpn/generic/mul_n.c: Call toom22 and toom33 instead of old functions.
7166
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.
7170
7171 2009-09-28  Niels Möller  <nisse@lysator.liu.se>
7172
7173         * mpn/x86_64/invert_limb.asm: Rewrite. Exploit cancellation in the
7174         Newton iteration.
7175
7176 2009-09-27  Niels Möller  <nisse@lysator.liu.se>
7177
7178         * mpn/x86/invert_limb.asm: Reduce register usage. Eliminated $1
7179         arguments to add, sub and shift.
7180
7181 2009-09-25  Niels Möller  <nisse@lysator.liu.se>
7182
7183         * mpn/x86/invert_limb.asm: New file.
7184
7185 2009-09-24  Torbjorn Granlund  <tege@gmplib.org>
7186
7187         * mpn/generic/toom33_mul.c: Use new toom functions for all recursive
7188         products.
7189         * mpn/generic/toom3_sqr.c: Likewise.
7190         * mpn/generic/toom44_mul.c: Likewise.
7191         * mpn/generic/toom4_sqr.c: Likewise.
7192
7193         * mpn/generic/add_n.c: Relax operand overlap ASSERTs.
7194         * mpn/generic/sub_n.c: Likewise.
7195
7196 2009-09-15  Torbjorn Granlund  <tege@gmplib.org>
7197
7198         Suggested by Uwe Mueller:
7199         * printf/doprnt.c: Use "%ld" for exponent printing.
7200         * printf/doprntf.c (__gmp_doprnt_mpf): Make expval "long".
7201
7202 2009-09-14  Torbjorn Granlund  <tege@gmplib.org>
7203
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".
7210
7211 2009-08-12  Torbjorn Granlund  <tege@gmplib.org>
7212
7213         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Remove silly ASSERT code.
7214
7215         * mpn/asm-defs.m4 (define_mpn): Remove mod_1s_1p, add mod_1_1p.
7216
7217         * mpn/arm/invert_limb.asm: Complete rewrite.
7218
7219         * longlong.h: Document LONGLONG_STANDALONE and NO_ASM.
7220
7221 2009-08-05  Torbjorn Granlund  <tege@gmplib.org>
7222
7223         * tests/mpz/dive_ui.c (check_random): Avoid zero divisors.
7224
7225 2009-07-31  Torbjorn Granlund  <tege@gmplib.org>
7226
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
7232         any modulus.
7233
7234 2009-07-28  Torbjorn Granlund  <tege@gmplib.org>
7235
7236         * configure.in: Pass arch for x86 also in 64-bit mode.
7237
7238 2009-07-26  Torbjorn Granlund  <tege@swox.com>
7239
7240         * config.guess (_cpuid): Recognise more Intel "Core" processors.
7241
7242 2009-07-13  Torbjorn Granlund  <tege@gmplib.org>
7243
7244         * mpf/eq.c: Rewrite.
7245
7246         * tests/mpf/t-eq.c: New test.
7247
7248 2009-07-06  Torbjorn Granlund  <tege@gmplib.org>
7249
7250         * gmp-impl.h (__mp_bases): Remove this alias.
7251
7252         * mpf/get_str.c: Use less overflow prone expression for computing limb
7253         allocation.
7254         * mpz/inp_str.c: Likewise.
7255         * mpf/set_str.c: Likewise.
7256         * mpz/set_str.c: Likewise.
7257
7258 2009-07-03  Niels Möller  <nisse@lysator.liu.se>
7259
7260         * mpn/generic/gcd_1.c (mpn_gcd_1): Use masking tricks to reduce
7261         the number of branches in the loop.
7262
7263 2009-06-28  Torbjorn Granlund  <tege@gmplib.org>
7264
7265         * demos/factorize.c (factor_using_pollard_rho): Rewrite.
7266
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.
7276
7277 2009-06-20  Torbjorn Granlund  <tege@gmplib.org>
7278
7279         * mp-h.in (mp_bitcnt_t): Declare here too.
7280
7281 2009-06-19  Torbjorn Granlund  <tege@gmplib.org>
7282
7283         * mpq/inits.c: New file.
7284         * mpf/inits.c: New file.
7285         * gmp-h.in (mpz_inits, mpq_inits, mpf_inits): Declare .
7286
7287         * mpn/generic/remove.c: New file.
7288         * configure.in (gmp_mpn_functions): Add remove.
7289         * gmp-impl.h (mpn_remove): Declare.
7290
7291         * gmp-h.in (mp_bitcnt_t): New basic type.
7292         * mpn/generic/perfpow.c (mp_bitcnt_t): Remove private definition.
7293
7294         * mpn/generic/bdiv_qr.c: Make it actually work.
7295
7296         * mpn/x86_64/core2/aorsmul_1.asm: Rewrite to use shorter pipeline and
7297         to need fewer registers.
7298
7299 2009-06-17  Torbjorn Granlund  <tege@gmplib.org>
7300
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.
7304
7305         * mpz/inits.c: New file.
7306
7307         * gen-trialdivtab.c: Wrap limb constants into CNST_LIMB.
7308
7309         With Martin Boij:
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.
7315
7316         * mpn/generic/dc_div_q.c: Add missing TMP_FREE.
7317
7318 2009-06-16  Torbjorn Granlund  <tege@gmplib.org>
7319
7320         Revert:
7321         * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
7322
7323 2009-06-16  Martin Boij  <mboij@kth.se>
7324
7325         * mpn/generic/perfpow.c (logs): Use more conservative table.
7326
7327 2009-06-15  Torbjorn Granlund  <tege@gmplib.org>
7328
7329         * mpn/pa64/aors_n.asm: New file.
7330         * mpn/pa64/add_n.asm: Remove.
7331         * mpn/pa64/sub_n.asm: Remove.
7332
7333         * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
7334
7335 2009-06-14  Torbjorn Granlund  <tege@gmplib.org>
7336
7337         * mpn/x86_64/bdiv_q_1.asm: Optimise away a mov insn.
7338         * mpn/x86_64/dive_1.asm: Likewise.
7339
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.
7343
7344         * Makefile.am (libmp_la_SOURCES): Add nextprime.c.
7345
7346 2009-06-13  Torbjorn Granlund  <tege@gmplib.org>
7347
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.
7351
7352 2009-06-13  Martin Boij  <mboij@kth.se>
7353
7354         * mpn/generic/perfpow.c: New file.
7355         * tests/mpz/t-perfpow.c: Rewrite.
7356
7357 2009-06-12  Torbjorn Granlund  <tege@gmplib.org>
7358
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.
7363
7364         * nextprime.c: New file.
7365         * gmp-impl.h (gmp_primesieve_t, gmp_init_primesieve, gmp_nextprime):
7366         Declare.
7367         * Makefile.am (libgmp_la_SOURCES): Add nextprime.c.
7368
7369 2009-06-11  Torbjorn Granlund  <tege@gmplib.org>
7370
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.
7376
7377         * longlong.h (arm count_leading_zeros): Define for armv5.
7378
7379         * gmp-impl.h: Move down toom itch functions to after we've #defined
7380         all THRESHOLDs.
7381
7382         * dumbmp.c (isprime): Replace with slightly less inefficient code.
7383         (mpz_tdiv_r): New function.
7384
7385 2009-06-11  Niels Möller  <nisse@lysator.liu.se>
7386
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.
7391
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.
7397
7398 2009-06-11  Torbjorn Granlund  <tege@gmplib.org>
7399
7400         * mpn/x86/k7/mod_1_4.asm: New file, mainly for k7, but perhaps useful
7401         also for k6 and non-sse p6.
7402
7403 2009-06-10  Torbjorn Granlund  <tege@gmplib.org>
7404
7405         * mpn/x86_64/mod_1_4.asm: Minor size reducing tweaks.
7406
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.
7412
7413 2009-06-08  Niels Möller  <nisse@lysator.liu.se>
7414
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.
7418
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.
7422
7423 2009-06-07  Torbjorn Granlund  <tege@gmplib.org>
7424
7425         * mpn/generic/toom2_sqr.c: Make it actually work.
7426
7427         * mpn/generic/toom3_sqr.c: Reduce local scratch space.
7428
7429 2009-06-05  Torbjorn Granlund  <tege@gmplib.org>
7430
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.
7435
7436 2009-06-05  Niels Möller  <nisse@lysator.liu.se>
7437
7438         * mpn/generic/toom44_mul.c (mpn_toom44_mult): Use
7439         mpn_toom_eval_dgr3_pm1.
7440
7441         * mpn/generic/toom_eval_dgr3_pm1.c: New file.
7442
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.
7445
7446         * mpn/generic/toom44_mul.c (mpn_toom44_mul): Reorganized, to
7447         reduce the need for scratch space, and get rid of TMP_ALLOC.
7448
7449 2009-06-05  Torbjorn Granlund  <tege@gmplib.org>
7450
7451         * mpn/generic/toom_interpolate_7pts.c: Fall back mpn_divexact_byN to
7452         mpn_bdiv_q_1_pi1, if the latter is NATIVE.
7453
7454 2009-06-04  Torbjorn Granlund  <tege@gmplib.org>
7455
7456         * mpn/x86_64/bdiv_q_1.asm: New file.
7457
7458         * configure.in (HAVE_NATIVE): Add recently added functions.
7459         (GMP_MULFUNC_CHOICES): Handle addlsh_n, sublsh_n, rsblsh_n.
7460
7461         * tune/common.c (speed_mpn_bdiv_q_1, speed_mpn_bdiv_q_1_pi1):
7462         New functions.
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.
7466
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.
7471
7472         * mpn/x86_64/lshift.asm: Cleanup.
7473         * mpn/x86_64/rshift.asm: Cleanup.
7474
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.
7478
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.
7485
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.
7490
7491         * mpn/generic/toom32_mul.c: Consistently use TOOM22_MUL_N_REC.
7492
7493 2009-06-03  Marco Bodrato  <bodrato@mail.dm.unipi.it>
7494
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.
7498
7499 2009-06-03  Torbjorn Granlund  <tege@gmplib.org>
7500
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.
7505
7506         * gmp-impl.h: Rename  toom4_* flags enum to toom7_*.  Relevant C files
7507         updated.
7508
7509         * mpn/generic/toom_interpolate_7pts (divexact_2exp): Remove.
7510
7511 2009-06-02  Torbjorn Granlund  <tege@gmplib.org>
7512
7513         * demos/factorize.c: Add -q command line option.
7514
7515 2009-06-02  Marco Bodrato  <bodrato@mail.dm.unipi.it>
7516
7517         * mpn/generic/toom_interpolate_7pts.c: Streamline, resulting in speed
7518         improvements.
7519
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.
7523
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.
7529
7530         * mpn/generic/toom33_mul.c: Reduce local scratch space.
7531         * mpn/generic/toom32_mul.c: Rewrite to not use local scratch space.
7532
7533 2009-06-02  Torbjorn Granlund  <tege@gmplib.org>
7534
7535         * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): New macro, use it for
7536         oo point.
7537
7538 2009-06-01  Torbjorn Granlund  <tege@gmplib.org>
7539
7540         * mpn/generic/mul.c: Loop to avoid excessive recursion in toom33 and
7541         toom44 slicing code.
7542
7543         * mpz/remove.c: Correctly handle multiplicity that does not fit an int.
7544
7545         * Makefile.am (dist-hook): Check library version consistency.
7546
7547         * mpn/generic/mul.c: Rewrite.
7548
7549 2009-05-29  Torbjorn Granlund  <tege@gmplib.org>
7550
7551         * tests/mpz/t-divis.c (check_random): Create huge test operands.
7552
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.
7556
7557         * gmp-impl.h (mpn_toom22_mul_itch): Replace totally wrong code.
7558
7559         * mpn/generic/mullow_n.c: Relax overlap requirement implied by ASSERT.
7560
7561         * mpn/generic/divis.c: Rewrite.
7562
7563         * gmp-impl.h (mpn_mu_bdiv_qr): Now returns mp_limb_t.
7564         (mpn_toom2_sqr_itch): Simplify.
7565
7566         * mpn/generic/mu_bdiv_qr.c: Implement properly.
7567
7568 2009-05-27  Torbjorn Granlund  <tege@gmplib.org>
7569
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.
7574
7575         * tune: Add speed measuring of toom22, toom33, and toom44.
7576
7577         * mpn/generic/toom22_mul.c: Handle potentially unbalanced coefficient
7578         product better.
7579
7580 2009-05-26  Torbjorn Granlund  <tege@gmplib.org>
7581
7582         * tests/mpz/t-mul.c (ref_mpn_mul): Use mpn_toom44_mul in FFT range for
7583         better huge-operands performance.
7584
7585 2009-05-24  Torbjorn Granlund  <tege@gmplib.org>
7586
7587         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Try "$L" too, before "$".
7588
7589 2009-05-23  Torbjorn Granlund  <tege@gmplib.org>
7590
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.
7593
7594         * tune/tuneup.c (tune_mod_1): Specify check_size for measuring mod_1_N
7595         functions.
7596         (one): Remove redundant size loop exit condition.
7597
7598 2009-05-20  Torbjorn Granlund  <tege@gmplib.org>
7599
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).
7602
7603 2009-05-18  Torbjorn Granlund  <tege@gmplib.org>
7604
7605         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 4.
7606         (__GNU_MP_VERSION_PATCHLEVEL): Set to -1.
7607
7608         * mpn/x86_64/mod_1_4.asm: New file.
7609
7610         * mpn/asm-defs.m4: Correct names for mod_1_N functions.
7611         Add defines for corresponding cps functions.
7612
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.
7616
7617 2009-05-12  Torbjorn Granlund  <tege@gmplib.org>
7618
7619         * Version 4.3.1 released.
7620
7621 2009-05-11  Torbjorn Granlund  <tege@gmplib.org>
7622
7623         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
7624
7625         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
7626         Bump version info.
7627
7628 2009-05-09  Torbjorn Granlund  <tege@gmplib.org>
7629
7630         * tests/mpz: Add MPZ_CHECK_FORMAT to many tests.
7631
7632 2009-05-07  Torbjorn Granlund  <tege@gmplib.org>
7633
7634         * mpn/x86/pentium4/sse2/mul_basecase.asm: Avoid L(ret), "ret" is
7635         defined in x86-defs.m4.
7636
7637 2009-05-06  Torbjorn Granlund  <tege@gmplib.org>
7638
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.
7646
7647         * tests/cxx/t-locale.cc (point_string): Declare as extern "C" to
7648         placate compilers that mangle variable names.
7649
7650 2009-05-04  Torbjorn Granlund  <tege@gmplib.org>
7651
7652         * tests/mpz/t-gcd.c: Generate operands that are multiple of each other.
7653
7654 2009-05-01  Torbjorn Granlund  <tege@gmplib.org>
7655
7656         * gmp-h.in (__GMP_EXTERN_INLINE): Support for more systems.
7657         (gmp_randinit_set): Add missing __GMP_DECLSPEC.
7658
7659 2009-04-28  Torbjorn Granlund  <tege@gmplib.org>
7660
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.
7666
7667         * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Nailify.
7668
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.
7673
7674         * mpn/generic/binvert.c: Remove own mpn_neg_n.
7675
7676         * tests/mpz/t-gcd.c: Add some MPZ_CHECK_FORMAT calls.
7677
7678 2009-04-27  Torbjorn Granlund  <tege@gmplib.org>
7679
7680         * mpn/Makefile.am (TARG_DIST): Add minithres.
7681
7682         * mpn/generic/bdiv_dbm1c.c: Handle nails.
7683
7684 2009-04-26  Torbjorn Granlund  <tege@gmplib.org>
7685
7686         * config.guess: Recognise more POWER processor types.
7687
7688 2009-04-25  Torbjorn Granlund  <tege@gmplib.org>
7689
7690         * mpn/x86/pentium4/sse2/popcount.asm: Work around Apple reloc bug.
7691         * mpn/x86/darwin.m4: Define symbol "DARWIN".
7692
7693 2009-04-19  Torbjorn Granlund  <tege@gmplib.org>
7694
7695         * mpn/generic/powm.c (mpn_redc_n): Use ASSERT_ALWAYS, not abort().
7696         * mpn/generic/powm_sec.c: Likewise.
7697
7698         * mpn/powerpc64/aix.m4 (EXTERN_FUNC): New define.  Add dummy variants
7699         for other m4 files.
7700         * mpn/powerpc64/mode64/divrem_1.asm: Use EXTERN_FUNC.
7701         * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
7702
7703 2009-04-16  Torbjorn Granlund  <tege@gmplib.org>
7704
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.
7708
7709         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
7710         Remove an unused variable.
7711
7712         * mpn/x86/x86-defs.m4 (LEA): Get SIZE arguments right.
7713
7714 2009-04-14  Torbjorn Granlund  <tege@gmplib.org>
7715
7716         * Version 4.3.0 released.
7717
7718         * scanf/doscan.c (__gmp_doscan): Pad 3-operand scanf call with dummy
7719         argument.
7720         * scanf/sscanffuns.c (scan): Disable vsscanf variant for now.
7721
7722 2009-04-13  Torbjorn Granlund  <tege@gmplib.org>
7723
7724         * scanf/sscanffuns.c (scan): Rewrite to use stdarg.
7725
7726         * tests/mpz/t-root.c: Rewrite.  Add unconditional gcc 4.3.2 tests.
7727
7728 2009-04-09  Torbjorn Granlund  <tege@gmplib.org>
7729
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.
7734
7735 2009-04-08  Torbjorn Granlund  <tege@gmplib.org>
7736
7737         * mpz/urandomm.c: Amend last fix.
7738
7739 2009-04-06  Torbjorn Granlund  <tege@gmplib.org>
7740
7741         * configure.in: Support Sun cc for x86_64.
7742
7743         * mpz/urandomm.c: Handle operand overlap.
7744
7745 2009-03-11  Torbjorn Granlund  <tege@gmplib.org>
7746
7747         * configure.in (powerpc): Brave removing -Wa,-mppc64, in the hope that
7748         GCC now passes the proper options.
7749
7750 2009-03-09  Torbjorn Granlund  <tege@gmplib.org>
7751
7752         * mpn/x86_64/divrem_1.asm: Add a nop to save a cycle in unnormalised
7753         case.
7754
7755 2009-03-05  Torbjorn Granlund  <tege@gmplib.org>
7756
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.
7759
7760 2009-03-03  Torbjorn Granlund  <tege@gmplib.org>
7761
7762         * mpn/ia64/bdiv_dbm1c.asm: Accept/return carry.
7763
7764 2009-03-02  Torbjorn Granlund  <tege@gmplib.org>
7765
7766         * configure.in (64-bit sparc/solaris): Pass -xO3, not -O3 to solaris
7767         system compiler.
7768
7769 2009-03-01  Torbjorn Granlund  <tege@gmplib.org>
7770
7771         * longlong.h (mips, powerpc): Provide assembly-free umul_ppmm for newer
7772         gcc.
7773
7774 2009-02-04  Torbjorn Granlund  <tege@gmplib.org>
7775
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.
7779
7780 2009-01-21  Torbjorn Granlund  <tege@gmplib.org>
7781
7782         * mpz/powm.c (redc): Remove.
7783         (mpz_powm): Use mpn_redc_1 instead of redc.
7784
7785         * tests/mpz/t-powm.c: Rewrite reference code.
7786
7787 2009-01-18  Torbjorn Granlund  <tege@gmplib.org>
7788
7789         * tests/mpz: Increase reps for many tests.
7790
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).
7793
7794 2009-01-16  Torbjorn Granlund  <tege@gmplib.org>
7795
7796         * tests/tests.h: Declare refmpn_divrem_2.
7797
7798 2009-01-15  Torbjorn Granlund  <tege@gmplib.org>
7799
7800         * mpz/perfpow.c: Add TMP_FREE before every return statement.
7801
7802         * mpn/generic/rootrem.c (mpn_rootrem_internal): Add a missing TMP_FREE.
7803
7804         * configure.in (gcc_cflags, gcc_64_cflags): Revert from -O3 to -O2,
7805         the change was accidental and cause too much miscompilation.
7806
7807 2009-01-14  Torbjorn Granlund  <tege@gmplib.org>
7808
7809         * tune/tuneup.c (tune_mod_1): Run MOD_1_x_THRESHOLD tests also when
7810         longlong.h specified UDIV_PREINV_ALWAYS.
7811
7812         * mpn/generic/mod_1.c (mpn_mod_1): Properly check for normalisation
7813         divisor.
7814
7815 2009-01-13  Torbjorn Granlund  <tege@gmplib.org>
7816
7817         * tune/tuneup.c (tune_mod_1): Tune for MOD_1_1_THRESHOLD,
7818         MOD_1_2_THRESHOLD, and MOD_1_4_THRESHOLD.
7819
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
7829         THRESHOLD macros.
7830         (udiv_rnd_preinv): New macro.
7831
7832 2009-01-12  Torbjorn Granlund  <tege@gmplib.org>
7833
7834         * tune/tuneup.c (tune_gcd_dc,tune_gcdext_dc): Lower step_factor to 0.1.
7835
7836 2009-01-08  Torbjorn Granlund  <tege@gmplib.org>
7837
7838         * tests/mpz/t-nextprime.c: New test file.
7839         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-nextprime.
7840
7841         From Niels Möller:
7842         * mpz/nextprime.c: Handle large prime gaps by limiting incr.
7843
7844 2009-01-04  Torbjorn Granlund  <tege@gmplib.org>
7845
7846         * mpz/and.c, mpz/ior.c, mpz/xor.c: Re-read only necessary source
7847         pointers after reallocation.  Misc cleanup.
7848
7849         * gmp-impl.h (MPN_TOOM44_MAX_N): New define, replaces MPN_TOOM3_MAX_N.
7850
7851         * mpn/x86/fat/diveby3.c: New file.
7852
7853 2008-12-30  Niels Möller  <nisse@lysator.liu.se>
7854
7855         * doc/gmp.texi (Greatest Common Divisor Algorithms): Updated
7856         section on GCD algorithms.
7857
7858 2008-12-29  Torbjorn Granlund  <tege@gmplib.org>
7859
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.
7864
7865         * mpn/generic/toom*.c: Use coherent MAYBE_ macros for trimming
7866         unreachable recursive functions.
7867         * gmp-impl.h: Update toom itch functions.
7868
7869         * mpn/x86_64/sqr_basecase.asm: Slightly increase stack allocation, to
7870         placate tuneup.
7871
7872 2008-12-28  Torbjorn Granlund  <tege@gmplib.org>
7873
7874         * mpn/x86_64/pentium4/aors_n.asm: Tune prologue code.
7875
7876         * mpn/x86_64/pentium4/aorslsh1_n.asm: New file.
7877
7878         * mpn/x86_64/darwin.m4: Define symbol "DARWIN".
7879         * mpn/x86_64/invert_limb.asm: Work around darwin quirks.
7880
7881         * mpn/x86_64/sqr_basecase.asm: Further optimize, support Darwin.
7882
7883         * mpn/x86_64/invert_limb.asm: New file.
7884
7885 2008-12-27  Torbjorn Granlund  <tege@gmplib.org>
7886
7887         * mpn/x86_64/core2/aorslsh1_n.asm: New file.
7888
7889 2008-12-26  Torbjorn Granlund  <tege@gmplib.org>
7890
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.
7894
7895 2008-12-23  Torbjorn Granlund  <tege@gmplib.org>
7896
7897         * tests/mpz/t-mul.c (dump_abort): Improve error message.
7898
7899         * gcd.c gcd_subdiv_step.c gcdext.c gcdext_subdiv_step.c:
7900         Remove private mpn_zero_p.
7901
7902         * tune/tuneup.c (tune_mul): Tune for MUL_TOOM44_THRESHOLD.
7903         (tune_sqr): Tune for SQR_TOOM4_THRESHOLD.
7904
7905         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom44_mul.c and
7906         toom4_sqr.c.
7907
7908         * configure.in (gmp_mpn_functions): Toom function updates.
7909
7910         * Rename mpn/mul_toomMN.c to mpn/toomMN_mul.c.  Function names changed
7911         accordingly.
7912
7913         * mpn/toomMN_mul.c: Add scratch parameter.  Do recursive multiplies
7914         properly.  Misc tuning.  Remove CHECK and TIMING code.
7915
7916         * mpn/toom2_sqr.c, mpn/toom3_sqr.c, mpn/toom4_sqr.c: New files.
7917
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.
7922
7923         * mpn/generic/mul_n.c (mpn_mul_n): Call mpn_toom44_mul.  Use TMP_BALLOC
7924         instead of malloc.
7925         (mpn_sqr_n): Analogous changes.
7926
7927         * mpn/generic/mul.c: Update unbalanced toom code to pass scratch space.
7928
7929 2008-12-21  Torbjorn Granlund  <tege@gmplib.org>
7930
7931         * mpz/nextprime.c: Add TMP_SDECL/MARK/FREE.
7932
7933 2008-12-20  Torbjorn Granlund  <tege@gmplib.org>
7934
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.
7939
7940 2008-12-18  Torbjorn Granlund  <tege@gmplib.org>
7941
7942         * mpz/nextprime.c: Run 10 mpz_millerrabin tests (was 5).
7943         Give credit to authors.
7944
7945         * mpn/x86_64/redc_1.asm: Align stack as mandated by ABI.
7946
7947         * mpn/x86_64/divrem_2.asm: Add some comments.
7948
7949         * mpn/x86_64/darwin.m4: New file.
7950         * configure.in: Use x86_64/darwin.m4.
7951
7952 2008-12-15  Torbjorn Granlund  <tege@gmplib.org>
7953
7954         * doc/projects.html: Remove GCD and division projects, update text on
7955         multiplication.
7956
7957         * doc/tasks.html: Add a caution about that the file is somewhat
7958         outdated.
7959
7960 2008-12-14  Torbjorn Granlund  <tege@gmplib.org>
7961
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.
7966
7967 2008-12-09  Torbjorn Granlund  <tege@gmplib.org>
7968
7969         From David Harvey:
7970         * mpn/x86_64/mul_basecase.asm: Further tweaks for code size and speed.
7971
7972         * mpn/powerpc64/mode64/divrem_1.asm: Rewrite.
7973
7974         * mpn/powerpc64/mode64/mul_basecase.asm: New file.
7975
7976 2008-12-08  Torbjorn Granlund  <tege@gmplib.org>
7977
7978         * mpn/powerpc64/mode64/gmp-mparam.h: New file.
7979
7980         * gmp-impl.h: Additional cleanups.
7981         (mpn_set_str_compute_powtab): New prototype.
7982         (mpn_powm, mpn_powlo): New prototypes.
7983
7984         * mpz/pow_ui.c: Handle some small exponents locally.
7985
7986 2008-12-07  Torbjorn Granlund  <tege@gmplib.org>
7987
7988         * mpn/generic/set_str.c: Remove prototypes (they are in gmp-impl.h).
7989
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.
7992
7993         * All files: Change _PROTO => __GMP_PROTO.
7994
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.
7997
7998         * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Make this static,
7999         and inline it.
8000
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.)
8005
8006         * configure.in (gmp_mpn_functions): Add mul_toom33.  Reformat.
8007
8008 2008-12-05  Torbjorn Granlund  <tege@gmplib.org>
8009
8010         * mpn/generic/redc_1.c: New file.
8011         * mpn/generic/redc_2.c: New file.
8012
8013         * configure.in (gmp_mpn_functions): List redc_1 and redc_2.
8014         (HAVE_NATIVE): Likewise.
8015
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.
8019         Updated call.
8020         * tune/tuneup.c (tune_powm): Update redc call.
8021
8022 2008-12-04  Torbjorn Granlund  <tege@gmplib.org>
8023
8024         * mpn/x86_64/sqr_basecase.asm: Inline a combined diagonal product code
8025         and addlsh1 loop.  Misc cleanup.
8026
8027 2008-12-02  Torbjorn Granlund  <tege@gmplib.org>
8028
8029         * mpn/x86_64/sqr_basecase.asm: New file.
8030
8031 2008-11-30  Torbjorn Granlund  <tege@gmplib.org>
8032
8033         * mpn/generic/sqr_basecase.c: Fix typo in mpn_addmul_2s variant.
8034
8035 2008-11-28  Torbjorn Granlund  <tege@gmplib.org>
8036
8037         * mpn/x86_64/redc_1.asm: Rewrite.
8038
8039 2008-11-27  Torbjorn Granlund  <tege@gmplib.org>
8040
8041         * tests/refmpn.c (refmpn_redc_1): New function.
8042
8043 2008-11-25  Torbjorn Granlund  <tege@gmplib.org>
8044
8045         * mpn/x86/k7/aorsmul_1.asm: Actually handle mpn_submul_1.
8046
8047 2008-11-23  Torbjorn Granlund  <tege@gmplib.org>
8048
8049         * mpn/x86_64/divrem_1.asm: Rewrite.
8050
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.
8057
8058 2008-11-22  Torbjorn Granlund  <tege@gmplib.org>
8059
8060         * mpn/x86/k7/mul_1.asm: Rewrite for smaller size and better speed.
8061         * mpn/x86/k7/aorsmul_1.asm: Likewise.
8062
8063         * acinclude.m4 (GMP_VERSION): Include last component even when zero.
8064
8065 2008-11-21  Torbjorn Granlund  <tege@gmplib.org>
8066
8067         * mpn/x86_64/README: Rewrite.
8068
8069         * tests/devel/try.c (malloc_region, mprotect_maybe): Add casts for
8070         printf type correctness.
8071
8072         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
8073
8074         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
8075         Bump version info.
8076
8077 2008-11-20  Torbjorn Granlund  <tege@gmplib.org>
8078
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.
8111
8112         * mpn/x86_64/aors_n.asm: Replace with slightly faster, more alignment
8113         neutral loop.
8114
8115 2008-11-18  Torbjorn Granlund  <tege@gmplib.org>
8116
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.
8131
8132         * tests/mpz/t-powm.c: Print test number when failing a test.
8133
8134         * mpn/x86_64/redc_1.asm (CALL): Move from here...
8135         * mpn/x86_64/x86_64-defs.m4: ...to here.
8136
8137         * gmp-impl.h (mpn_jacobi_base): Remove parameter names.
8138
8139 2008-11-11  Torbjorn Granlund  <tege@gmplib.org>
8140
8141         * tests/mpf/t-conv.c: Add some specific tests, supplementing the random
8142         tests.
8143
8144 2008-11-09  Torbjorn Granlund  <tege@gmplib.org>
8145
8146         * mpf/set_str.c: Default 'base' before letting exp_base inherit it.
8147
8148         * tests/cxx/t-prec.cc: Use the right precision for all float constants.
8149
8150 2008-11-08  Torbjorn Granlund  <tege@gmplib.org>
8151
8152         * doc/gmp.texi (Float Comparison): Update mpf_eq documentation.
8153
8154         * mpf/eq.c: Compare the right number of bits.
8155
8156 2008-11-02  Torbjorn Granlund  <tege@gmplib.org>
8157
8158         Undo, it made testing too slow:
8159         * tests/mpz/t-mul.c: Use slower geometric progression for operand
8160         sizes.
8161
8162         * mpn/x86/k7/mod_34lsub1.asm: Use movzb for masking low 8 bits.
8163
8164 2008-10-31  Niels Möller  <nisse@lysator.liu.se>
8165
8166         * mpn/generic/hgcd2.c (div1): New function (taken from old gcdext
8167         implementation)
8168         (mpn_hgcd2): Use single precision for the second half of the work.
8169
8170 2008-10-30  Torbjorn Granlund  <tege@gmplib.org>
8171
8172         * mpn/x86/p6/sse2/gmp-mparam.h: New file.
8173
8174 2008-10-29  Torbjorn Granlund  <tege@gmplib.org>
8175
8176         * configure.in (x86 fat_path): Add "x86/p6/sse2".
8177
8178         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Recognize sse2 capable p6
8179         (pentiumm, core2).
8180
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.
8187
8188         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Handle "extended" fields for
8189         model and family.
8190
8191 2008-10-28  Torbjorn Granlund  <tege@gmplib.org>
8192
8193         From Mickael Gastineau:
8194         * gmp-h.in (gmp_urandomm_ui, gmp_urandomb_ui): Add __GMP_DECLSPEC.
8195
8196 2008-10-27  Torbjorn Granlund  <tege@gmplib.org>
8197
8198         * gmp-h.in (mpn_gcdext_1): Remove bogus __GMP_ATTRIBUTE_PURE.
8199
8200 2008-10-27  Niels Möller  <nisse@lysator.liu.se>
8201
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.
8205
8206 2008-10-26  Torbjorn Granlund  <tege@gmplib.org>
8207
8208         * configure.in: Point to p6/sse2 for pentiumm and core2.
8209
8210         * gmp-impl.h (mpn_add_nc, mpn_sub_nc): Move these macros to after fat
8211         definitions.
8212
8213         * tune/common.c, tune/speed.c, tune/speed.h:
8214         Add speed measurement of mpn_bdiv_dbm1c.
8215
8216 2008-10-24  Torbjorn Granlund  <tege@gmplib.org>
8217
8218         * mpn/x86_64/gmp-mparam.h (MUL_FFT_TABLE2, SQR_FFT_TABLE2): Extend.
8219
8220         * mpz/nextprime.c: Move declarations to function beginning.
8221
8222 2008-10-23  Niels Möller  <nisse@lysator.liu.se>
8223
8224         * gmp-impl.h (DECL_gcdext_1): Deleted.
8225
8226 2008-10-22  Torbjorn Granlund  <tege@gmplib.org>
8227
8228         * mpn/x86_64/atom/aors_n.asm: New file.
8229         * mpn/x86_64/atom/gmp-mparam.h: New file.
8230
8231 2008-10-21  Torbjorn Granlund  <tege@gmplib.org>
8232
8233         With Neils Möller:
8234         * mpz/nextprime.c: Rewrite.
8235
8236         * tests/devel/try.c (main): Use strtol for 's' and 'S' optargs.
8237
8238         * mpn/x86_64/pentium4/rshift.asm: Misc cleanups.
8239         * mpn/x86_64/pentium4/lshift.asm: Likewise.
8240
8241         * mpn/x86_64/pentium4/aors_n.asm: Use fewer registers.
8242
8243         * configure.in: Set up specific path for x86_64/atom.
8244
8245 2008-10-21  Niels Möller  <nisse@lysator.liu.se>
8246
8247         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Removed
8248         qstack.c.
8249         * mpn/generic/qstack.c: Deleted obsolete file.
8250
8251 2008-10-20  Torbjorn Granlund  <tege@gmplib.org>
8252
8253         * mpn/x86_64/core2/aorsmul_1.asm: New file.
8254
8255 2008-10-19  Torbjorn Granlund  <tege@gmplib.org>
8256
8257         * mpn/x86_64/aors_n.asm: Remove redundant MULFUNC_PROLOGUE.
8258
8259         * gmp-impl.h (popc_limb): Remove redundant checks of GMP_LIMB_BITS
8260         inside several of these macros.
8261
8262 2008-10-17  Torbjorn Granlund  <tege@gmplib.org>
8263
8264         * tests/mpz/t-mul.c: Use slower geometric progression for operand
8265         sizes.  Do every other tests for same size operands.
8266
8267 2008-10-15  Torbjorn Granlund  <tege@gmplib.org>
8268
8269         * mpn/x86_64/mul_basecase.asm: Simplify addressing in epilogue.
8270
8271         * mpn/mips64/divrem_1.asm: Remove file, it is n32-only, and uses an old
8272         algorithm.
8273
8274         * config.guess, config.sub, configure.in: Support Intel Atom processor.
8275
8276 2008-10-10  Torbjorn Granlund  <tege@gmplib.org>
8277
8278         * mpq/mul.c: Fix typo in last change.
8279
8280 2008-10-09  Torbjorn Granlund  <tege@gmplib.org>
8281
8282         * tests/refmpn.c (refmpn_sb_divrem_mn): Work around a gcc bug.
8283
8284 2008-10-08  Torbjorn Granlund  <tege@gmplib.org>
8285
8286         * mpq/mul.c: Use TMP_ALLOC.  Cleanup.
8287         * mpq/div.c: Likewise.
8288
8289         * mpn/x86_64/mul_basecase.asm: Use lea directly for loading entry point
8290         addresses.
8291
8292 2008-10-09  Niels Möller  <nisse@lysator.liu.se>
8293
8294         * mpn/x86/k7/gmp-mparam.h: Updated GCD-related values.
8295
8296 2008-10-05  Torbjorn Granlund  <tege@gmplib.org>
8297
8298         * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Do store
8299         mpn_fft_norm_modF return value, if (rec).
8300
8301 2008-10-04  Torbjorn Granlund  <tege@gmplib.org>
8302
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.
8308
8309 2008-10-02  Torbjorn Granlund  <tege@gmplib.org>
8310
8311         * mpn/minithres/gmp-mparam.h: Update FFT values.
8312
8313 2008-10-02  Niels Möller  <nisse@lysator.liu.se>
8314
8315         * hgcd.c (mpn_hgcd_matrix_mul): Fixed normalization bug.
8316
8317 2008-09-24  Torbjorn Granlund  <tege@gmplib.org>
8318
8319         * configure.in: Handle --enable-minithres.
8320         * mpn/minithres/gmp-mparam.h: Update all values.
8321
8322 2008-09-22  Torbjorn Granlund  <tege@gmplib.org>
8323
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.
8329
8330         * tune/common.c: Corresponding changes.
8331
8332 2008-09-22  Niels Möller  <nisse@lysator.liu.se>
8333
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
8338
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.
8343
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.
8347
8348         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Updated for
8349         interface change in mpn_hgcd_mul_matrix1_inverse_vector.
8350
8351         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): Use
8352         separate scratch arguments for the quotient and for the cofactor
8353         update.
8354
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.
8360
8361 2008-09-22  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
8362
8363         * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Use mpn_addaddmul_1msb0.
8364         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Likewise.
8365
8366         * mpn/generic/gcd.c: Use libspeed for timing measurements.
8367
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
8372         addaddmul_1msb0.
8373         (HAVE_NATIVE): List addaddmul_1msb0.
8374
8375 2008-09-21  Torbjorn Granlund  <tege@gmplib.org>
8376
8377         * mpn/generic/get_str.c (GET_STR_DC_THRESHOLD): Remove default.
8378         (GET_STR_PRECOMPUTE_THRESHOLD): Likewise.
8379         Misc code cleanups.
8380
8381         * gmp-impl.h (mpn_dc_set_str_itch): Allocate GMP_LIMB_BITS more limbs.
8382
8383         Revert:
8384         * mpn/generic/set_str.c:
8385         (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
8386
8387 2008-09-18  Torbjorn Granlund  <tege@gmplib.org>
8388
8389         * mpn/alpha/ev6/gmp-mparam.h (DIVEXACT_BY3_METHOD): Define.
8390
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.
8399
8400         * configure.in (HAVE_NATIVE): List divexact_by3c.
8401
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.
8405
8406 2008-09-18  Niels Möller  <nisse@lysator.liu.se>
8407
8408         * mpn/generic/gcd.c (main): Added code for tuning of CHOOSE_P.
8409
8410         * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Assert that inputs are
8411         normalized.
8412
8413 2008-09-17  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
8414
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.
8419
8420         * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
8421         from 409 to 390.
8422
8423         * mpn/generic/gcdext.c (CHOOSE_P): New macro. Use p = n/5.
8424         (mpn_gcdext): Use CHOOSE_P, and generalized the calculation of
8425         scratch space.
8426
8427         * tune/tuneup.c (tune_hgcd): Use default step factor.
8428
8429         * mpn/x86_64/gmp-mparam.h: (GCD_DC_THRESHOLD): Reduced from 493 to
8430         412.
8431
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
8436         scratch space.
8437
8438 2008-09-16  Torbjorn Granlund  <tege@gmplib.org>
8439
8440         * mpn/generic/toom_interpolate_7pts.c: Use new mpn_divexact_byN
8441         functions.
8442
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.
8446
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.
8459
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.
8463
8464 2008-09-16  Niels Möller  <nisse@lysator.liu.se>
8465
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.
8472
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.
8477
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.
8484
8485         * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Use
8486         overlapping arguments to mpn_tdiv_qr. Use mpn_zero_p.
8487
8488         * mpn/generic/gcd.c (mpn_gcd): Use mpn_zero_p.
8489
8490 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
8491
8492         * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Updated for deleted
8493         tp pointer.
8494         (hgcd_matrix_update_q): Likewise.
8495         (mpn_hgcd_matrix_mul): Likewise.
8496         (mpn_hgcd_itch): Updated calculation of scratch space.
8497
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.
8501
8502 2008-09-15  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
8503
8504         * mpn/x86_64/gmp-mparam.h (MATRIX22_STRASSEN_THRESHOLD): New
8505         threshold.
8506
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.
8510
8511         * mpn/generic/gcd.c (mpn_gcd): Fixed calculation of scratch space,
8512         and use mpn_hgcd_itch.
8513
8514 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
8515
8516         * tune/tuneup.c (tune_matrix22_mul): New function.
8517         (all): Use it.
8518
8519         * tune/common.c (speed_mpn_matrix22_mul): New function.
8520
8521         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added matrix22_mul.c.
8522
8523         * tests/mpn/t-matrix22.c: Use MATRIX22_STRASSEN_THRESHOLD to
8524         select sizes for tests.
8525
8526         * gmp-impl.h (MATRIX22_STRASSEN_THRESHOLD): New threshold
8527
8528         * configure.in (gmp_mpn_functions): Added matrix22_mul.
8529         * gmp-impl.h: Added declarations for mpn_matrix22_mul and related
8530         functions.
8531
8532         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
8533         matrix22_mul.c.
8534         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-matrix22.
8535
8536         * tests/mpn/t-matrix22.c: New file.
8537         * mpn/generic/matrix22_mul.c: New file.
8538
8539 2008-09-11  Niels Möller  <nisse@king.swox.se>
8540
8541         * tune/tuneup.c: Updated tuning of gcdext.
8542
8543         * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
8544         from 713 to 409.
8545
8546 2008-09-11  Niels Möller  <nisse@lysator.liu.se>
8547
8548         * gmp-impl.h: Updated for gcdext changes.
8549         (GCDEXT_DC_THRESHOLD): New constant, renamed from
8550         GCDEXT_SCHOENHAGE_THRESHOLD.
8551
8552         * mpn/generic/gcdext.c (compute_v): Accept non-normalized a and b
8553         as inputs.
8554         (mpn_gcdext): Rewrote and simplified. Now uses the new mpn_hgcd
8555         interface.
8556
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.
8561
8562         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): Deleted
8563         function.
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
8568         file, new function.
8569
8570         * configure.in (gmp_mpn_functions): Added gcdext_subdiv_step.
8571
8572 2008-09-10  Torbjorn Granlund  <tege@gmplib.org>
8573
8574         * tests/devel/anymul_1.c: Include <string.h>.
8575
8576         * gmp-h.in: Unconditionally include <cstdio>.
8577
8578 2008-09-10  Niels Möller  <nisse@lysator.liu.se>
8579
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
8583         and find_a.
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.
8587
8588         * mpn/generic/gcd.c (mpn_gcd): Rewrote and simplified. Now uses
8589         the new mpn_hgcd interface.
8590
8591         * */gmp-mparam.h: Renamed GCD_SCHOENHAGE_THRESHOLD to
8592         GCD_DC_THRESHOLD.
8593
8594         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Renamed (was
8595         mpn_gcd_lehmer). Now takes inputs of equal size.
8596
8597         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer): Reintroduced gcd_2,
8598         to get better performance for small inputs.
8599
8600         * mpn/generic/hgcd.c: Don't hardcode small HGCD_THRESHOLD.
8601         * mpn/x86_64/gmp-mparam.h (HGCD_THRESHOLD): Reduced from 145 to
8602         120.
8603         * */gmp-mparam.h: Renamed HGCD_SCHOENHAGE_THRESHOLD to
8604         HGCD_THRESHOLD.
8605
8606 2008-09-09  Torbjorn Granlund  <tege@gmplib.org>
8607
8608         * doc/gmp.texi: Fix a typo and clarify mpn_gcdext docs.
8609
8610 2008-09-09  Niels Möller  <nisse@lysator.liu.se>
8611
8612         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Adapted
8613         to new hgcd interface.
8614
8615         * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): New macro.
8616
8617         * hgcd.c (mpn_hgcd_lehmer): Renamed function, from hgcd_base. Made
8618         non-static.
8619
8620         * gcd_lehmer.c (mpn_gcd_lehmer): Use hgcd2 also for n == 2.
8621
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.
8625
8626         * tests/mpz/t-gcd.c (one_test): Display co-factor when mpn_gcdext
8627         fails.
8628
8629         * gcd_lehmer.c (mpn_gcd_lehmer): At end of loop, need to handle
8630         the special case n == 1 correctly.
8631
8632         * gcd_subdiv_step.c (mpn_gcd_subdiv_step): Simplified function.
8633         The special cancellation logic is not needed here.
8634
8635 2008-09-08  Torbjorn Granlund  <tege@gmplib.org>
8636
8637         * mpn/generic/invert.c: Add working but slow code.
8638
8639         * mpn/x86_64/x86_64-defs.m4 (R32, R8): New macros.
8640
8641         * mpn/ia64/submul_1.asm: Move some labels for broader assembler
8642         compatibility.
8643
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.
8648         (call): 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.
8658
8659         * ltmain.sh: Update to libtool 1.5.24.
8660
8661         * mpn/generic/mul_toom22.c: Compute s and t more cleverly.
8662
8663 2008-09-08  Niels Möller  <nisse@lysator.liu.se>
8664
8665         * tests/mpn/t-hgcd.c: Updated tests. Rewrite of hgcd_ref.
8666
8667         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): New function.
8668         (mpn_gcdext_lehmer): Various bugfixes.
8669
8670         * gcdext.c (mpn_gcdext): Allocate scratch space for gcdext_lehmer.
8671
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.
8675
8676         * mpn/generic/hgcd.c (mpn_hgcd): Allow the trivial case n <= 2,
8677         and return 0 immediately.
8678
8679         * gmp-impl.h (MPN_EXTRACT_NUMB): New macro.
8680
8681         * configure.in (gmp_mpn_functions): Added gcdext_lehmer.
8682
8683 2008-09-05  Torbjorn Granlund  <tege@gmplib.org>
8684
8685         * mpn/generic/toom_interpolate_7pts.c: Use mpn_divexact_by3c instead of
8686         divexact_odd.
8687
8688         * doc/texinfo.tex: Update to 2007-06-29.13.
8689
8690         * doc/gmp.texi: Update GMP site URL.  Fix some typos.
8691
8692         * demos/pexpr.c (main): Allow bases up to 62.
8693
8694         * gmp-impl.h: Remove formal parameter names from function prototypes.
8695
8696         * config.guess: Recognize recent AMD and Itanium CPUs.
8697         Default X86 CPU recognition to configfsf.guess' value.
8698
8699         * configure.in: Handle core2 separately from athlon64.
8700
8701 2008-09-05  Niels Möller  <nisse@lysator.liu.se>
8702
8703         * */Makefile.in, configure, aclocal.m4, config.in: Removed files
8704         from repository. They're instead generated by automake and
8705         autoconf before distribution.
8706
8707 2008-08-25  Torbjorn Granlund  <tege@gmplib.org>
8708
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.
8712
8713 2008-08-06  Torbjorn Granlund  <tege@gmplib.org>
8714
8715         * mpn/generic/mul_toom22.c: Add statistics gathering functionality,
8716         triggered by cpp predef STAT.
8717
8718         From David Harvey:
8719         * mpn/generic/mul_toom22.c: Decrease scratch space usage.
8720
8721 2008-08-02  Torbjorn Granlund  <tege@gmplib.org>
8722
8723         * tests/misc/t-scanf.c: Avoid negative arguments to _ui functions.
8724         * tests/misc/t-printf.c: Likewise.
8725
8726         * acinclude.m4 (X86_PATTERN): Add geode.
8727
8728         * acinclude.m4 (CL_AS_NOEXECSTACK): Avoid -q flag to grep.
8729
8730 2008-08-01  Torbjorn Granlund  <tege@gmplib.org>
8731
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).
8735
8736         * gmpxx.h (__GMP_DBL_LIMBS): Use DBL_MAX_EXP instead of
8737         std::numeric_limits<double>::max_exponent for better portability.
8738
8739 2008-07-29  Torbjorn Granlund  <tege@gmplib.org>
8740
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.
8749
8750 2008-07-28  Torbjorn Granlund  <tege@gmplib.org>
8751
8752         * tests/cxx/t-binary.cc: Add some tests for logical operations.
8753
8754 2008-07-24  Torbjorn Granlund  <tege@gmplib.org>
8755
8756         * gmpxx.h: Use __GMPZ_* instead of __GMPZZ_* for bitwise ops, remove
8757         __GMPZZ_*.
8758         Remove repeated #undefs.
8759         (__gmp_alloc_cstring): Declare freefunc as extern "C".
8760
8761 2008-07-23  Torbjorn Granlund  <tege@gmplib.org>
8762
8763         * gmp-h.in (__GMP_CC): New define, undocumented for now.
8764         (__GMP_CFLAGS): Likewise.
8765
8766 2008-07-21  Torbjorn Granlund  <tege@gmplib.org>
8767
8768         * tests/amd64check.c: Fix a printf type clash.
8769
8770         * mpz/realloc.c: Amend last fix.
8771
8772         * gmp-h.in: Include <cstdlib> for C++.
8773         * gmp-h.in: Handle new gcc 4.3 inline semantics defaults.
8774
8775         * configfsf.guess: Update to version of 2008-04-14.
8776         * configfsf.sub: Update to version of 2008-06-16.
8777
8778         * configure.in: Separate core2 and athlon64 flags handling.
8779
8780 2008-06-19  Torbjorn Granlund  <tege@gmplib.org>
8781
8782         * config.guess: Recognize pentiumm and AMD geode.
8783         * config.sub: Likewise.
8784         * configure.in: Likewise.
8785
8786 2008-06-02  Torbjorn Granlund  <tege@gmplib.org>
8787
8788         * configure.in: Disallow odd nails sizes.
8789         * configure.in: Inherit default gcc_cflags/gcc_64_cflags everywhere.
8790
8791 2008-05-23  Torbjorn Granlund  <tege@gmplib.org>
8792
8793         * mpz/init2.c: Rewrite to avoid internal overflow and to detect mpz_t
8794         overflow.
8795         * mpz/realloc2.c: Likewise.
8796         * mpz/realloc.c: Detect mpz_t overflow.
8797
8798 2008-05-22  Torbjorn Granlund  <tege@gmplib.org>
8799
8800         * configure.in (sparc): Remove -fast, it causes documented
8801         miscompilation.
8802
8803         * config.guess: Properly handle the "extended" variants of x86 cpuid.
8804
8805 2008-05-09  Torbjorn Granlund  <tege@gmplib.org>
8806
8807         * gmp-impl.h (mpn_mul_fft): Now void.
8808         (udiv_qrnnd_preinv3): Special case for constant (nl).
8809
8810 2008-05-08  Torbjorn Granlund  <tege@gmplib.org>
8811
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
8822         mpn_fft_fftinv.
8823
8824 2008-03-10  Torbjorn Granlund  <tege@gmplib.org>
8825
8826         * tests/mpz/t-mul.c (main): Let GMP_CHECK_FFT mean largest allowed
8827         power-of-2 of test operands.
8828
8829 2008-02-28  Torbjorn Granlund  <tege@gmplib.org>
8830
8831         * tests/cxx/t-binary.cc (check_mpz): Expect floor rounding for right
8832         shift.
8833
8834 2008-02-27  Torbjorn Granlund  <tege@gmplib.org>
8835
8836         * mpz/mul_i.h: Check sml's size (not the signed small_mult).
8837
8838         * longlong.h (umul_ppmm) [alpha]: Define using __builtin_alpha_umulh
8839         when possible.
8840
8841         * longlong.h (count_trailing_zeros): Force destination register mode.
8842
8843         * gmpxx.h (struct __gmp_binary_rshift): Use floor rounding, not
8844         truncation.
8845
8846         * gmpxx.h (__gmp_binary_and, __gmp_binary_ior, __gmp_binary_xor):
8847         Add variants with unsigned long int argument.
8848
8849         * config.sub: Recog geode.
8850         * config.guess: Likewise.
8851         * acinclude.m4 (X86_PATTERN): Likewise.
8852
8853 2008-02-10  Torbjorn Granlund  <tege@gmplib.org>
8854
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.
8857
8858 2008-02-08  Torbjorn Granlund  <tege@gmplib.org>
8859
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.
8863
8864 2008-02-07  Torbjorn Granlund  <tege@gmplib.org>
8865
8866         * mpn/x86/k6/mmx/dive_1.asm: Fix typo in last change.
8867
8868 2007-12-10  Torbjorn Granlund  <tege@swox.com>
8869
8870         * mpf/set_str.c (mpf_set_str): Write own code for converting the
8871         exponent, avoids strtol base < 36 limitation.
8872
8873 2007-10-28  Torbjorn Granlund  <tege@swox.com>
8874
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".
8878
8879         * mpn/generic/get_str.c: Compute powers without low zero limbs; all
8880         functions modified.  Correct temporary allocation.  Misc cleanups.
8881
8882         * mpn/generic/set_str.c: Compute powers without low zero limbs; all
8883         functions modified.
8884         (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
8885
8886 2007-10-26  Torbjorn Granlund  <tege@swox.com>
8887
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.
8890
8891 2007-10-22  Torbjorn Granlund  <tege@swox.com>
8892
8893         * gmp-impl.h (mpn_add_nc): Define as inline function, unless NATIVE.
8894         (mpn_sub_nc): Likewise.
8895
8896 2007-10-17  Torbjorn Granlund  <tege@swox.com>
8897
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.
8901
8902         * acinclude.m4: Conditionally disable some tests when compiled by a C++
8903         compiler.
8904
8905         * gmp-impl.h (udiv_qrnnd_preinv3): Remove an unused variable.
8906
8907         * mpn/generic/hgcd.c: Add some WANT_ASSERTs to shut up warnings.
8908
8909 2007-10-08  Torbjorn Granlund  <tege@swox.com>
8910
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.
8914
8915         * mpn/powerpc64/vmx/popcount.asm: Use LEAL.
8916
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.
8920
8921         * mpn/powerpc32/vmx/mod_34lsub1.asm: Use LEAL.
8922
8923 2007-10-07  Torbjorn Granlund  <tege@swox.com>
8924
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.
8935
8936         * mpn/x86/p6/aors_n.asm: Table cycle counts.
8937
8938         * mpn/x86/k7/mod_34lsub1.asm: Fix over-optimistic cycle count claims.
8939
8940         * mpn/x86/x86-defs.m4 (DEF_OBJECT, END_OBJECT): New define's.
8941
8942         * mpn/x86/darwin.m4 (LEA): Put also movl_eip_XX into EPILOGUE_cpu.
8943         Expect target register to have prepended %.
8944
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.
8969
8970         * mpn/x86_64/x86_64-defs.m4: New file, defining LEA, DEF_OBJECT, and
8971         END_OBJECT.
8972
8973         * mpn/generic/mul.c: Put TMP_DECL as last decl.
8974
8975 2007-10-06  Torbjorn Granlund  <tege@swox.com>
8976
8977         * mpn/x86/pentium4/sse2/popcount.asm: New file.
8978
8979 2007-09-26  Torbjorn Granlund  <tege@swox.com>
8980
8981         * mpz/get_str.c: Cast a char index to int to shut up compilers.
8982
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.
8989
8990         * mpn/generic/invert.c: New file, placeholder for now.
8991
8992 2007-09-24  Torbjorn Granlund  <tege@swox.com>
8993
8994         * mpn/generic/toom_interpolate_5pts.c: New file, contents from
8995         mpn/generic/mul_n.c
8996         * mpn/generic/mul_n.c (mpn_toom3_interpolate): Function removed.
8997
8998         * mpn/generic/toom_interpolate_7pts.c: New file.
8999
9000         * mpn/x86/k7/mmx/popham.asm: Table cycle counts.
9001
9002         * mpn/x86/k6/README: Update URLs.
9003
9004         * mpn/powerpc32/README: Update URL's, company names.
9005
9006         * mpn/generic/get_d.c: Complete rewrite.
9007
9008         * mpn/generic/mul_toom33.c: New file.
9009
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.
9013
9014         * mpn/alpha/invert_limb.asm: Update cycle counts.  Fix a comment typo.
9015
9016         * mpf/get_str.c: Include stdlib.h, not stdio.h for NULL.
9017
9018         * doc/gmp.texi: Fix a typo.
9019
9020         * memory.c (__gmp_default_allocate, __gmp_default_reallocate):
9021         Cast size operands in error fprintf's.
9022
9023         * longlong.h (sub_ddmmss) [powerpc 64]: Add more variants for constant
9024         args.
9025
9026         * gmp-impl.h (udiv_qrnnd_preinv3): New define.
9027         * gmp-impl.h (ULONG_PARITY): Exclude masquerading __INTEL_COMPILER from
9028         ia64 asm.
9029
9030         * gmp-h.in (mpn_neg_n): New function.
9031
9032 2007-09-18  Torbjorn Granlund  <tege@swox.com>
9033
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.
9038
9039         * gmp-impl.h: Add decls and THRESHOLDs for new toom multiplication
9040         functions and division functions.
9041
9042 2007-09-10  Torbjorn Granlund  <tege@swox.com>
9043
9044         * mpn/powerpc32/addlsh1_n.asm: Use L() for labels.
9045         * mpn/powerpc32/sublsh1_n.asm: Likewise.
9046
9047 2007-09-09  Torbjorn Granlund  <tege@swox.com>
9048
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.
9053
9054         * configure.in: For X86/32, treat core2 like pentium3.
9055
9056 2007-09-06  Torbjorn Granlund  <tege@swox.com>
9057
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
9062         array.
9063
9064 2007-09-04  Torbjorn Granlund  <tege@swox.com>
9065
9066         * mpn/x86/pentium4/sse2/mul_basecase.asm: Misc cleanups.
9067         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
9068
9069         * mpn/x86_64/mod_34lsub1.asm: Optimize loop, reduce code size.
9070
9071         * tests/amd64call.asm: Remove bogus no-op moves.
9072
9073 2007-09-03  Torbjorn Granlund  <tege@swox.com>
9074
9075         From Richard Guenther:
9076         * gmp-h.in (__GMP_EXTERN_INLINE): Declare conditionally on
9077         __GNUC_STDC_INLINE__.
9078
9079         * tests/cxx/t-locale.cc: #include <cstdlib>, for abort.
9080
9081         * mpn/x86_64/core2/popcount.asm: New file.
9082         * mpn/x86_64/pentium4/popcount.asm: New file.
9083
9084         * mpn/x86_64/addmul_2.asm: New file.
9085         * mpn/x86_64/mul_2.asm: New file.
9086
9087         * mpn/x86_64/aorsmul_1.asm: Use 32-bit mov for zeroing registers
9088         (saves space).
9089
9090 2007-09-01  Torbjorn Granlund  <tege@swox.com>
9091
9092         * configure.in: Handle athlon64, core2, and pentium4 separately for
9093         64-bit ABI.
9094
9095         * config.sub: Recog athlon64, core2, and opteron.
9096
9097         * config.guess: Do two x86 variants, for 32-bit ABI and 64-bit ABI.
9098         Return "athlon64" and "core2", not x86_64.
9099
9100 2007-08-31  Torbjorn Granlund  <tege@swox.com>
9101
9102         From Patrick Pelissier:
9103         * gmp-h.in: Don't refer to FILE from C++ unless we've seen FILE.
9104
9105 2007-08-30  Torbjorn Granlund  <tege@swox.com>
9106
9107         * demos/isprime.c: Include string.h for strcmp.
9108
9109         * demos/factorize.c (main): Declare to int.
9110
9111 2007-06-22  Torbjorn Granlund  <tege@swox.com>
9112
9113         * mpn/x86_64/pentium4/lshift.asm: Minor tuning.
9114         * mpn/x86_64/pentium4/rshift.asm: Likewise.
9115
9116 2007-05-30  Torbjorn Granlund  <tege@swox.com>
9117
9118         * mpn/powerpc64/mode64/aors_n.asm: Add _nc entry points.
9119
9120 2007-05-22  Torbjorn Granlund  <tege@swox.com>
9121
9122         * tests/memory.c: Cast calls to new mem* calls to avoid unaligned ops.
9123
9124 2007-05-16  Torbjorn Granlund  <tege@swox.com>
9125
9126         * tests/mpz/convert.c: Tweak operand sizes for best coverage.
9127
9128         * tests/memory.c: Add red zones around allocations.
9129
9130 2007-05-15  Torbjorn Granlund  <tege@swox.com>
9131
9132         * mpn/ia64/mul_1.asm: Make mul_1c entry point actually work.
9133
9134         * mpn/generic/set_str.c (mpn_dc_set_str): Avoid calling mpn_add_n when
9135         ln == 0.
9136
9137         * tests/mpz/convert.c (string_urandomb): New function.
9138         (main): Use it by enabling ifdef'ed out code.
9139
9140 2007-04-30  Torbjorn Granlund  <tege@swox.com>
9141
9142         * mpn/x86_64/mul_basecase.asm: Complete rewrite.
9143
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.
9147
9148         * mpn/x86_64/aorsmul_1.asm: Cleanup formatting.
9149
9150 2007-04-25  Torbjorn Granlund  <tege@swox.com>
9151
9152         * mpz/divexact.c: Handle undefined case of |N| < |D| to avoid segfaults.
9153
9154 2007-02-24  Torbjorn Granlund  <tege@swox.com>
9155
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.
9159
9160 2007-02-12  Torbjorn Granlund  <tege@swox.com>
9161
9162         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Complete rewrite (except
9163         diagonal code).
9164
9165 2007-02-05  Torbjorn Granlund  <tege@swox.com>
9166
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.
9172
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.
9177
9178 2007-01-31  Torbjorn Granlund  <tege@swox.com>
9179
9180         * mpn/generic/get_str.c (mpn_sb_get_str): Get loop count for frac
9181         development right.
9182
9183         * mpn/powerpc32/vmx/mod_34lsub1.asm: New file.
9184
9185         * mpn/powerpc32/aors_n.asm: New file, complete rewrite.
9186         * mpn/powerpc32/add_n.asm: Remove.
9187         * mpn/powerpc32/sub_n.asm: Remove.
9188
9189 2007-01-25  Torbjorn Granlund  <tege@swox.com>
9190
9191         * mpn/x86_64/core2/aors_n.asm: Add _nc entry points, minor cleanups.
9192
9193         * mpn/x86_64/core2/lshift.asm: Rewrite.
9194         * mpn/x86_64/core2/rshift.asm: Rewrite.
9195
9196         * mpn/x86_64/pentium4/lshift.asm: Swap some loop insns for a small
9197         speedup.
9198         * mpn/x86_64/pentium4/rshift.asm: New file, based on lshift.asm.
9199
9200         * mpn/x86_64/pentium4/gmp-mparam.h: New file.
9201
9202         * mpn/x86_64/pentium4/aors_n.asm: Complete rewrite of add/subtract
9203         code.
9204         * mpn/x86_64/pentium4/add_n.asm: Remove.
9205         * mpn/x86_64/pentium4/sub_n.asm: Remove.
9206
9207 2007-01-20  Torbjorn Granlund  <tege@swox.com>
9208
9209         * mpn/x86_64/lshift.asm: Add special case for cnt=1.
9210
9211 2007-01-19  Torbjorn Granlund  <tege@swox.com>
9212
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.
9217
9218 2006-12-29  Torbjorn Granlund  <tege@swox.com>
9219
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
9223         look similar.
9224         (__gmp_randclear_mt): Pass actually allocated size.
9225
9226         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mul_toom22.c,
9227         mul_toom32.c, mul_toom42.c.
9228
9229         * configure.in: Recognize athlon64 and core2 as alternatives to x86_64.
9230         Provide special settings for core2.
9231
9232         * configure.in (gmp_mpn_functions): Add mul_toom22, mul_toom32,
9233         mul_toom42.
9234
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
9238         entry.
9239
9240 2006-12-29  Marco Bodrato  <bodrato@mail.dm.unipi.it>
9241
9242         * mpn/generic/mul_n.c: Rewrite interpolation code.
9243
9244 2006-12-28  Torbjorn Granlund  <tege@swox.com>
9245
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.
9250
9251 2006-12-17  Torbjorn Granlund  <tege@swox.com>
9252
9253         * mpn/x86_64/aorrlsh_n.asm: New file.
9254         * mpn/x86_64/lshsub_n.asm: New file.
9255
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.
9259
9260         * mpn/x86/p6/aors_n.asm: Replace K7 grabbing code with P6 specific
9261         code.
9262
9263         * mpn/x86/p6/lshsub_n.asm: New file.
9264
9265 2006-11-23  Torbjorn Granlund  <tege@swox.com>
9266
9267         * tune/speed.h (SPEED_ROUTINE_MPN_MUL_BASECASE): Allocate space for xp
9268         locally, s->xp might be insufficient.
9269
9270 2006-11-22  Torbjorn Granlund  <tege@swox.com>
9271
9272         * randmt.c (__gmp_randinit_mt_noseed): Initialize ALLOC field of result
9273         param.
9274
9275 2006-11-06  Torbjorn Granlund  <tege@swox.com>
9276
9277         * tune/set_strp.c: New file.
9278
9279 2006-11-04  Torbjorn Granlund  <tege@swox.com>
9280
9281         * extract-dbl.c: Rewrite to handle nails better, and for general
9282         optimization.
9283
9284         * mpz/bin_uiui.c: Simplify.
9285
9286         * longlong.h (umul_ppmm) [mmix]: New.
9287
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.
9292
9293 2006-10-31  Torbjorn Granlund  <tege@swox.com>
9294
9295         * gmpxx.h: Remove ternary stuff, it is hardly an optimization and it
9296         writes to destination before reading all source operands.
9297
9298 2006-10-25  Torbjorn Granlund  <tege@swox.com>
9299
9300         * mpn/generic/set_str.c: Complete rewrite.
9301         * mpn/generic/get_str.c: Likewise.
9302
9303         * gmp-impl.h (struct powers, powers_t): New types.
9304         Restructure GET_STR_* and SET_STR_* thresholds.
9305
9306 2006-09-21  Torbjorn Granlund  <tege@swox.com>
9307
9308         * mpn/generic/rootrem.c: Remove some redundant casts.
9309
9310 2006-07-12  Torbjorn Granlund  <tege@swox.com>
9311
9312         * mpn/alpha/ev6/nails/addmul_2.asm: Make it run at claimed speed.
9313         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
9314
9315         * mpf/get_str.c: Avoid copying result when not needed.  Misc cleanups.
9316
9317         * tests/amd64call.asm: Use jmp instead of jmpq to placate Solaris.
9318
9319 2006-06-30  Torbjorn Granlund  <tege@swox.com>
9320
9321         * configure.in (powerpc-*): Remove repeated path component.
9322
9323 2006-06-15  Torbjorn Granlund  <tege@swox.com>
9324
9325         * configure.in: (ia64-*-linux*): Don't use -O3.
9326
9327 2006-06-14  Torbjorn Granlund  <tege@swox.com>
9328
9329         * mpq/get_str.c: Fix upper base limit boundary in an ASSERT.
9330
9331         * tests/refmpn.c (refmpn_sb_divrem_mn): Use ASSERT_CARRY for add-back.
9332
9333 2006-05-31  Torbjorn Granlund  <tege@swox.com>
9334
9335         * tests/mpz/t-set_d.c (check_data): Add more data points.
9336
9337         * mpz/set_d.c: Handle negative return values from __gmp_extract_double.
9338
9339 2006-05-17  Torbjorn Granlund  <tege@swox.com>
9340
9341         * configure.in: Clear out gcc_cflags_cpu and gcc_cflags_arch for a fat
9342         build.
9343
9344 2006-05-16  Torbjorn Granlund  <tege@swox.com>
9345
9346         * demos/primes.c (find_primes): Increase mpz_probab_prime_p cnt to 10.
9347
9348         * mpn/generic/addsub_n.c: Fix criteria form when to call _nc functions.
9349
9350 2006-05-12  Torbjorn Granlund  <tege@swox.com>
9351
9352         * config.guess: Recognize more ppc processor types.
9353
9354 2006-05-11  Torbjorn Granlund  <tege@swox.com>
9355
9356         * tune/speed.c (usage): Update URL for gnuplot and quickplot.
9357
9358 2006-05-10  Torbjorn Granlund  <tege@swox.com>
9359
9360         * configure.in (powerpc-*-*): Pass -maltivec to assembler for
9361         appropriate CPUs.
9362
9363 2006-05-08  Torbjorn Granlund  <tege@swox.com>
9364
9365         * mpn/powerpc32/aix.m4 (LEA): Remove [RW] attribute.
9366
9367 2006-05-03  Torbjorn Granlund  <tege@swox.com>
9368
9369         * mpn/powerpc64/vmx/popcount.asm: Conditionally zero extend n.
9370
9371 2006-04-27  Torbjorn Granlund  <tege@swox.com>
9372
9373         * mpz/divexact.c: Call mpz_tdiv_q for large operands.
9374
9375         * configure.in (powerpc-*-darwin): Remove -fast, it affects PIC.
9376
9377 2006-04-26  Torbjorn Granlund  <tege@swox.com>
9378
9379         * config.guess: Try to recognize Ultrasparc T1 (as ultrasparct1).
9380         * config.sub: Handle ultrasparct1.
9381
9382 2006-04-25  Torbjorn Granlund  <tege@swox.com>
9383
9384         * mpn/sparc64/gmp-mparam.h: Retune, without separation of GNUC and
9385         non-GNUC data.
9386
9387 2006-04-20  Torbjorn Granlund  <tege@swox.com>
9388
9389         * tests/mpz/convert.c: Increase operands range.
9390
9391 2006-04-19  Torbjorn Granlund  <tege@swox.com>
9392
9393         * configure.in: Support powerpc eABI.
9394         * mpn/powerpc32/eabi.m4: New file.
9395
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.
9399
9400         * mpn/powerpc64/linux64.m4 (ASM_END): Quote TOC_ENTRY.
9401
9402 2006-04-18  Torbjorn Granlund  <tege@swox.com>
9403
9404         * configure.in (gmp_mpn_functions_optional): Add lshiftc.
9405         (HAVE_NATIVE): Add lshiftc.
9406
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.
9410
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.
9414
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.
9419
9420 2006-04-13  Torbjorn Granlund  <tege@swox.com>
9421
9422         * mpn/generic/mul_fft.c: Use new thresholds mechanism if MUL_FFT_TABLE2
9423         is defined.
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
9427         divisions.
9428
9429         * tests/devel/try.c (choice_array): Add mpn_addsub_n[c].
9430
9431 2006-04-11  Torbjorn Granlund  <tege@swox.com>
9432
9433         * aclocal.m4: Regenerate with patched libtool.
9434
9435         * mpn/asm-defs.m4 (ASM_END): Provide (empty) default.
9436
9437 2006-04-08  Torbjorn Granlund  <tege@swox.com>
9438
9439         * configure.in (gmp_mpn_functions_optional): Add addsub.
9440
9441         * gmpxx.h: Remove missed MPFR references.
9442
9443         * gmp-impl.h (LIMBS_PER_DOUBLE): Adjust formula to not be pessimistic.
9444
9445         * gmp-impl.h (TMP_*, WANT_TMP_DEBUG): Don't expect marker argument;
9446         define TMP_SALLOC and TMP_BALLOC.
9447
9448         * mpn/minithres/gmp-mparam.h: New file.
9449
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.
9454
9455         * mpn/ia64/popcount.asm: Append "cond.dptk" to conditional branches to
9456         placate icc.
9457         * mpn/ia64/hamdist.asm: Likewise.
9458         * mpn/ia64/lorrshift.asm: Likewise.
9459         * mpn/ia64/dive_1.asm: Likewise.
9460
9461 2006-04-05  Torbjorn Granlund  <tege@swox.com>
9462
9463         * tal-notreent.c (__gmp_tmp_mark): Add "struct" tag for tmp_marker.
9464         (__gmp_tmp_free): Likewise.
9465
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.
9469
9470 2006-03-26  Torbjorn Granlund  <tege@swox.com>
9471
9472         * Version 4.2 released.
9473
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.
9478
9479 2006-03-23  Torbjorn Granlund  <tege@swox.com>
9480
9481         * gmp-impl.h: (class gmp_allocated_string): Prefix strlen with std::.
9482
9483         * gmpxx.h (__GMP_DEFINE_TERNARY_EXPR2): Remove for now.
9484         (struct __gmp_ternary_addmul2): Likewise.
9485         (struct __gmp_ternary_submul2): Likewise.
9486
9487         * gmpxx.h: #include <cstring>.
9488         (struct __gmp_alloc_cstring): Prefix strlen with std::.
9489
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.
9493
9494 2006-03-22  Torbjorn Granlund  <tege@swox.com>
9495
9496         * gmp-h.in: Add a "using std::FILE" for C++.
9497         (_GMP_H_HAVE_FILE): Check also _ISO_STDIO_ISO_H.
9498
9499         * gmpxx.h: Remove mpfr code.
9500         * tests/cxx: Likewise.
9501
9502         * gmp-impl.h (FORCE_DOUBLE): Rename a tempvar to avoid a clash with
9503         GNU/Linux public include file.
9504
9505         * configure.in (powerpc64, darwin): New optional, gcc_cflags_subtype.
9506         Grab powerpc32/darwin.m4 for ABI=mode32.
9507
9508         * configure.in: Use host_cpu whenever just the cpu type is needed.
9509
9510 2006-03-08  Torbjorn Granlund  <tege@swox.com>
9511
9512         * mpz/get_si.c: Fix a typo.
9513
9514         * tests/mpq/t-get_d.c (check_random): Improve random generation for
9515         nails.
9516
9517 2006-02-28  Torbjorn Granlund  <tege@swox.com>
9518
9519         * tests/mpq/t-get_d.c (check_random): New function.
9520         (main): Call check_random.
9521
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.
9524         Use MPZ_REALLOC.
9525
9526         * mpz/set_d.c: Make it work for LIMBS_PER_DOUBLE == 4.
9527
9528         * extract-dbl.c: Make it work for LIMBS_PER_DOUBLE > 3.
9529
9530 2006-02-27  Torbjorn Granlund  <tege@swox.com>
9531
9532         * mpz/cmp_d.c: Declare `i'.
9533         * mpz/cmpabs_d.c: Likewise.
9534
9535 2006-02-23  Torbjorn Granlund  <tege@swox.com>
9536
9537         * mpn/powerpc32/vmx/copyd.asm: Set right VRSAVE bits.
9538         * mpn/powerpc32/vmx/copyi.asm: Likewise.
9539
9540 2006-02-22  Torbjorn Granlund  <tege@swox.com>
9541
9542         * mpn/powerpc32/vmx/logops_n.asm: New file.
9543
9544         * mpn/powerpc32/diveby3.asm: Rewrite.
9545
9546 2006-02-21  Torbjorn Granlund  <tege@swox.com>
9547
9548         * mpn/powerpc32/vmx/copyi.asm: New file.
9549         * mpn/powerpc32/vmx/copyd.asm: New file.
9550
9551 2006-02-17  Torbjorn Granlund  <tege@swox.com>
9552
9553         * mpn/alpha/ev6/nails/aors_n.asm (CYSH): Import proper setting from
9554         deleted mpn_sub_n.
9555
9556 2006-02-16  Torbjorn Granlund  <tege@swox.com>
9557
9558         * mpn/alpha/ev6/addmul_1.asm: Correct slotting comments.
9559
9560 2006-02-15  Torbjorn Granlund  <tege@swox.com>
9561
9562         * tests/devel/anymul_1.c: Copy error reporting code from addmul_N.c.
9563
9564         * tests/devel/addmul_N.c: New file.
9565         * tests/devel/mul_N.c: New file.
9566
9567         * mpn/alpha/default.m4 (PROLOGUE_cpu): Align functions at 16-byte
9568         boundary.
9569
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.
9573
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.
9577
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.
9581
9582 2006-02-13  Torbjorn Granlund  <tege@swox.com>
9583
9584         * mpn/powerpc32/diveby3.asm: Trivially reorder loop insns to save
9585         1 c/l.
9586
9587         * mpn/x86_64/dive_1.asm: Use movabsq to support large model non-PIC.
9588
9589         * mpn/x86_64/rsh1add_n.asm: Replace high register with rbx.
9590         * mpn/x86_64/rsh1sub_n.asm: Likewise.
9591
9592 2006-02-10  Torbjorn Granlund  <tege@swox.com>
9593
9594         * mpn/powerpc64/sqr_diagonal.asm: Software pipeline.
9595
9596         * mpn/powerpc64/vmx/popcount.asm: Add prefetching.
9597
9598 2006-02-07  Torbjorn Granlund  <tege@swox.com>
9599
9600         * mpn/powerpc64/mode64/diveby3.asm: Rewrite.
9601
9602 2006-02-04  Torbjorn Granlund  <tege@swox.com>
9603
9604         * mpn/powerpc64/vmx/popcount.asm: Remove mpn_hamdist partial code.
9605         Move compare for huge n so that it is always executed.
9606
9607 2006-02-03  Torbjorn Granlund  <tege@swox.com>
9608
9609         * mpn/powerpc32/linux.m4 (LEA): Add support for PIC.
9610
9611         * configure.in (powerpc): New optional, gcc_cflags_subtype.
9612
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.
9616
9617         * mpn/powerpc64/linux64.m4 (PROLOGUE_cpu): Align function start to
9618         16-multiple.
9619         * mpn/powerpc64/aix.m4: Likewise.
9620         * mpn/powerpc64/darwin.m4: Likewise.
9621
9622         * mpn/powerpc64/copyi.asm: Align loop to 16-multiple.
9623         * mpn/powerpc64/copyd.asm: Likewise
9624
9625         * configure.in (powerpc): Add vmx to relevant paths.
9626
9627         * mpn/powerpc64/linux64.m4 (DEF_OBJECT): Accept 2nd argument, for
9628         alignment.
9629         * mpn/powerpc64/aix.m4: Likewise.
9630         * mpn/powerpc64/darwin.m4: Likewise.
9631
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.
9636
9637         * mpn/powerpc64/vmx/popcount.asm: New file, for ppc32 and ppc64.
9638         * mpn/powerpc32/vmx/popcount.asm: New file, grabbing above file.
9639
9640 2006-01-22  Torbjorn Granlund  <tege@swox.com>
9641
9642         * configure.in: Generalize OS-dependent patterns for powerpcs.
9643
9644 2006-01-20  Torbjorn Granlund  <tege@swox.com>
9645
9646         * mpn/x86_64/popham.asm: Optimize.
9647
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
9652         processors.
9653
9654 2006-01-19  Torbjorn Granlund  <tege@swox.com>
9655
9656         * mpn/x86_64/logops_n.asm: Rewrite for more stable speed and smaller
9657         code.
9658         * mpn/x86_64/com_n.asm: Likewise.
9659
9660 2006-01-18  Torbjorn Granlund  <tege@swox.com>
9661
9662         * mpn/x86_64/addlsh1_n.asm: Rewrite to use indexed addressing.
9663         * mpn/x86_64/sublsh1_n.asm: Likewise.
9664
9665 2006-01-17  Torbjorn Granlund  <tege@swox.com>
9666
9667         * mpn/generic/diveby3.c: Use GMP standard parameter names.  Nailify
9668         alternative code.  Use restrict for params.
9669
9670         * configure.in: Recognize andn_n as not needing nailification.
9671
9672         * tests/mpq/t-equal.c (check_various): Disable a test that gives common
9673         factors for GMP_NUMB_BITS == 62.
9674
9675 2006-01-16  Torbjorn Granlund  <tege@swox.com>
9676
9677         * mpn/generic/get_str.c (mpn_sb_get_str): Fix digit count computation,
9678         was inaccurate for nails.
9679
9680 2006-01-15  Torbjorn Granlund  <tege@swox.com>
9681
9682         * mpn/x86_64/mode1o.asm: Remove unneeded carry register zeroing.
9683
9684 2006-01-08  Torbjorn Granlund  <tege@swox.com>
9685
9686         * mpn/alpha/ev6/sqr_diagonal.asm: New file.
9687
9688 2006-01-06  Torbjorn Granlund  <tege@swox.com>
9689
9690         * mpn/powerpc64/mode64/mod_34lsub1.asm: Tune to 1.5 c/l.
9691
9692         * mpn/generic/mullow_n.c (MUL_BASECASE_ALLOC): New #define.
9693         (mpn_mullow_n): Use it.
9694
9695         * mpn/powerpc64/mode64/dive_1.asm: Use EXTERN.
9696         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
9697
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.
9702
9703 2006-01-05  Torbjorn Granlund  <tege@swox.com>
9704
9705         * mpn/powerpc64/mode64/mode1o.asm: New file.
9706
9707         * mpn/powerpc64/mode64/dive_1.asm: Use L() for labels.  Invoke ASM_END.
9708
9709         * mpn/powerpc64/mode64/invert_limb.asm: Invoke ASM_END.
9710
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.
9715
9716         * mpn/powerpc64/mode64/addmul_1.asm: Add POWER5 timings.
9717         * mpn/powerpc64/mode64/mul_1.asm: Likewise.
9718
9719         * mpn/powerpc64/mode64/submul_1.asm: Tweak to save 1.5 c/l for POWER5.
9720
9721 2006-01-04  Torbjorn Granlund  <tege@swox.com>
9722
9723         * mpn/powerpc64/mode64/dive_1.asm: New file.
9724
9725         * mpn/powerpc64/mode64/invert_limb.asm: Add missing ASM_START.
9726
9727         * mpn/powerpc64/mode64/addmul_1.asm: Fix a comment typo.
9728
9729         * mpn/x86_64/diveby3.asm: Rewrite.
9730
9731 2006-01-03  Torbjorn Granlund  <tege@swox.com>
9732
9733         * configure.in: Update bugs reporting address.
9734
9735         * mpn/powerpc64/mode64/diveby3.asm: Trim a cycle off of POWER4 timing.
9736         Misc cleanup.
9737
9738 2006-01-02  Torbjorn Granlund  <tege@swox.com>
9739
9740         * mpn/powerpc64/linux64.m4 (CALL): New macro.
9741         * mpn/powerpc64/aix.m4: Likewise.
9742         * mpn/powerpc64/darwin.m4: Likewise, also define macro "DARWIN".
9743
9744 2005-12-28  Torbjorn Granlund  <tege@swox.com>
9745
9746         * mpn/powerpc64/mode64/mod_34lsub1.asm: New file.
9747
9748 2005-12-26  Torbjorn Granlund  <tege@swox.com>
9749
9750         * mpn/x86_64/mod_34lsub1.asm: New file.
9751
9752 2005-12-20  Torbjorn Granlund  <tege@swox.com>
9753
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.)
9757
9758 2005-12-18  Torbjorn Granlund  <tege@swox.com>
9759
9760         * mpf/ui_div.c: Implement workaround for GCC bug triggered on alpha.
9761         * mpf/set_q.c: Likewise.
9762
9763 2005-12-16  Torbjorn Granlund  <tege@swox.com>
9764
9765         * mpn/generic/tdiv_qr.c: Remove statement with no effect.
9766         Rename dead variable to `dummy'.
9767
9768 2005-12-15  Torbjorn Granlund  <tege@swox.com>
9769
9770         * demos/pexpr.c (setup_error_handler): Add a missing ";".
9771
9772 2005-11-27  Torbjorn Granlund  <tege@swox.com>
9773
9774         * mpn/generic/mul.c: Crudely call mpn_mul_fft_full before checking
9775         for unbalanced operands.
9776
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
9780         operands.
9781
9782 2005-11-22  Torbjorn Granlund  <tege@swox.com>
9783
9784         * configure.in: Properly recognize all 32-bit Solaris releases.
9785
9786 2005-11-10  Torbjorn Granlund  <tege@swox.com>
9787
9788         * mpn/generic/mul_fft.c: Inline mpn_fft_mul_2exp_modF,
9789         mpn_fft_add_modF and mpn_fft_normalize.
9790
9791 2005-11-02  Torbjorn Granlund  <tege@swox.com>
9792
9793         * tests/mpz/reuse.c: Increase operand size, decrease # of reps.
9794
9795         * mpz/rootrem.c: Adapt to new mpn_rootrem.
9796         * mpz/root.c: Likewise.
9797
9798         * tests/mpz/reuse.c: Test mpz_rootrem.
9799
9800         With Paul Zimmermann:
9801         * mpn/generic/rootrem.c: Complete rewrite.
9802
9803 2005-10-31  Torbjorn Granlund  <tege@swox.com>
9804
9805         * mpz/pprime_p.c (mpz_probab_prime_p): Considerably limit trial
9806         dividing.
9807
9808         * mpz/perfpow.c (mpz_perfect_power_p): Use mpz_divisible_ui_p instead
9809         of mpz_tdiv_ui.
9810
9811         * mpz/divegcd.c: Correct probability number for GCD == 1.
9812
9813         * mpn/x86_64/mul_basecase.asm: Remove an obsolete comment.
9814
9815         * mpn/x86: Add cycle counts for array of x86 processors.
9816
9817         * mpn/x86/k7/mod_34lsub1.asm: Remove spurious mentions of ebp.
9818
9819         * mpn/powerpc32: Add POWER5 timings.
9820
9821         * mpn/powerpc32/README: Describe global reference variations.
9822
9823         * mpn/ia64/divrem_2.asm: Add some comments.
9824
9825         * mpn/ia64/divrem_1.asm: Reformat.
9826
9827         * mpn/ia64/addmul_2.asm: Correct a comment on slotting.
9828         * mpn/ia64/logops_n.asm: Likewise.
9829
9830         * mpn/ia64/addmul_1.asm: Remove a redundant preg mutex decl.
9831
9832         * mpn/generic/dive_1.c: Whitespace cleanup.
9833
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.
9837
9838         * mpf/out_str.c: List some allocation improvement ideas.
9839
9840         * doc/gmp.texi: Update many URLs and email addresses.
9841
9842         * gmp-h.in (_GMP_H_HAVE_FILE): Check also _STDIO_H_INCLUDED.
9843
9844 2005-10-26  Torbjorn Granlund  <tege@swox.com>
9845
9846         * tune/tuneup.c (tune_mullow): Update param.max_size for each threshold
9847         measurement.
9848
9849         * configure.in (POWERPC64_PATTERN/*-*-darwin*): Set
9850         SPEED_CYCLECOUNTER_OBJ_mode64 and cyclecounter_size_mode64.
9851         (POWERPC64_PATTERN/*-*-linux*): Likewise.
9852
9853 2005-10-03  Torbjorn Granlund  <tege@swox.com>
9854
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.
9858
9859 2005-09-17  Torbjorn Granlund  <tege@swox.com>
9860
9861         * demos/pexpr.c (fns): Add factorial keywords.
9862
9863 2005-08-16  Torbjorn Granlund  <tege@swox.com>
9864
9865         * tune/Makefile.am (EXTRA_DIST): Change "amd64" => "x86_64".
9866         * mpn/Makefile.am (TARG_DIST): Change "amd64" => "x86_64".
9867
9868 2005-08-15  Torbjorn Granlund  <tege@swox.com>
9869
9870         * configure.in: Change "amd64" => "x86_64".
9871
9872 2005-06-13  Torbjorn Granlund  <tege@swox.com>
9873
9874         * mpn/generic/pre_mod_1.c: Canonicalize variable names.
9875
9876         * mpn/generic/divrem.c: Rate qxn test as UNLIKELY.
9877
9878         * mpn/generic/gcdext.c (sanity_check_row): Invoke TMP_MARK.
9879
9880         * tune/tuneup.c (tune_mullow): Fix all max_size fields.
9881
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.
9885
9886         * mpn/generic/mul_n.c (mpn_sqr_n): Use SQR_TOOM3_THRESHOLD_LIMIT.
9887
9888         * gmp-impl.h (mpn_nand_n, mpn_iorn_n, mpn_nior_n, mpn_xnor_n):
9889         Handle nails.
9890
9891 2005-06-13  Niels Möller  <nisse@lysator.liu.se>
9892
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.
9896
9897 2005-06-12  Torbjorn Granlund  <tege@swox.com>
9898
9899         * mpn/alpha/ev6/sub_n.asm: Analogous changes as to add_n.asm last.
9900
9901 2005-06-11  Torbjorn Granlund  <tege@swox.com>
9902
9903         * mpn/alpha/ev6/add_n.asm: Rewrite inner loop to load later.
9904         Add mpn_add_nc entry.
9905
9906         * mpn/alpha/ev6/addmul_1.asm: Remove redundant initial loads.
9907
9908 2005-06-09  Torbjorn Granlund  <tege@swox.com>
9909
9910         * mpn/ia64/dive_1.asm: Fix issues with HP-UX.
9911
9912 2005-06-08  Torbjorn Granlund  <tege@swox.com>
9913
9914         * mpn/ia64/diveby3.asm: Update TODO list.
9915
9916         * mpn/ia64/mode1o.asm: Fix comment typos.
9917
9918         * mpn/ia64/dive_1.asm: New file.
9919
9920 2005-06-07  Torbjorn Granlund  <tege@swox.com>
9921
9922         * mpn/ia64/mode1o.asm: Add prefetching.
9923
9924         * mpn/generic/dive_1.c: Use variable h for upper umul_ppmm result.
9925
9926 2005-06-06  Torbjorn Granlund  <tege@swox.com>
9927
9928         * mpn/ia64/hamdist.asm: Complete rewrite.
9929         * mpn/ia64/popcount.asm: Rewrite to use multi-pronged feed-in.
9930
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.
9935
9936 2005-06-04  Torbjorn Granlund  <tege@swox.com>
9937
9938         * tests/devel/try.c (choice_array): Exclude mpn_preinv_mod_1 unless
9939         USE_PREINV_MOD_1.
9940         (choice_array): Exclude mpn_sqr_basecase if SQR_KARATSUBA_THRESHOLD
9941         is zero.
9942
9943 2005-06-03  Torbjorn Granlund  <tege@swox.com>
9944
9945         * mpn/alpha/ev6/addmul_1.asm: Prefix all labels with "$".
9946         * mpn/alpha/ev6/mul_1.asm: Likewise.
9947
9948 2005-06-02  Torbjorn Granlund  <tege@swox.com>
9949
9950         * tests/refmpn.c (refmpn_divmod_1c_workaround): Implement workaround
9951         to gcc 3.4.x bug triggered on powerpc64 with 32-bit ABI.
9952
9953 2005-06-01  Torbjorn Granlund  <tege@swox.com>
9954
9955         * tests/devel/try.c (main): Fix a typo.
9956
9957 2005-05-31  Torbjorn Granlund  <tege@swox.com>
9958
9959         * mpn/alpha/ev6/addmul_1.asm: Rewrite for L1 cache, add prefetch.
9960
9961 2005-05-30  Torbjorn Granlund  <tege@swox.com>
9962
9963         * tests/misc.c (tests_rand_start): Mask random seed to 32 bits.
9964
9965 2005-05-29  Torbjorn Granlund  <tege@swox.com>
9966
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.
9970
9971         * mpn/powerpc32/mode1o.asm: Rewrite to actually work.
9972
9973         * mpn/powerpc32/aix.m4 (LEA): New macro.
9974         (ASM_END): New macro.
9975
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.
9980
9981 2005-05-25  Torbjorn Granlund  <tege@swox.com>
9982
9983         * mpn/generic/mullow_n.c: Remove FIXME mentioning fixed flaw.
9984
9985         * tests/mpz/t-cmp_d.c (check_one): Fix printf fmt string typo.
9986
9987         * demos/isprime.c: #include stdlib.h.
9988         * tests/rand/t-urbui.c: Likewise.
9989         * tests/rand/t-urmui.c: Likewise.
9990
9991         * tests/mpz/t-popcount.c (check_random): Remove spurious printf arg.
9992
9993         * mpn/ia64/lorrshift.asm: Cleanup code layout.
9994         * mpn/ia64/popcount.asm: Likewise.
9995
9996 2005-05-24  Torbjorn Granlund  <tege@swox.com>
9997
9998         * tests/devel/try.c (param_init) [TYPE_GET_STR]: Set retval field.
9999         (compare): Handle SIZE_GET_STR as SIZE_RETVAL.
10000
10001         * tests/refmpn.c (refmpn_get_str): Rewrite to make it work.
10002
10003 2005-05-23  Torbjorn Granlund  <tege@swox.com>
10004
10005         * mpn/amd64/add_n.asm: Add mpn_add_nc entry point.
10006         * mpn/amd64/sub_n.asm: Add mpn_sub_nc entry point.
10007
10008         * longlong.h (many places): Remove lvalue casts.
10009
10010         * gmp-impl.h (MPF_SIGNIFICANT_DIGITS): Cast prec to avoid overflow
10011         for > 4G digits.
10012
10013         * mpn/alpha/ev6/add_n.asm: Prefetch using ldl.
10014         * mpn/alpha/ev6/sub_n.asm: Likewise.
10015
10016         * mpn/alpha/ev6/slot.pl (optable): Recognize negq and ldl.
10017
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.
10022
10023 2005-05-22  Torbjorn Granlund  <tege@swox.com>
10024
10025         * mpn/alpha/ev67/popcount.asm: Prefetch.
10026         * mpn/alpha/ev67/hamdist.asm: Prefetch.
10027
10028         * longlong.h (add_ssaaaa) [x86]: Remove lvalue casts.
10029         (sub_ddmmss) [x86]: Likewise.
10030
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.
10034
10035 2005-05-21  Torbjorn Granlund  <tege@swox.com>
10036
10037         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Initialize divisor
10038         field according to UDIV_NEEDS_NORMALIZATION.
10039
10040         * mpz/mul_i.h: Remove left-over TMP_XXXX marker arguments.
10041
10042 2005-05-20  Torbjorn Granlund  <tege@swox.com>
10043
10044         * mpn/x86/pentium4/sse2/addmul_1.asm (mpn_addmul_1c): Put carry in
10045         proper register.
10046
10047         * mpn/generic/sqr_basecase.c (mpn_sqr_basecase, addmul_2 version):
10048         Avoid accesses out-of-bound in MPN_SQR_DIAGONAL applicate code.
10049
10050 2005-05-19  Torbjorn Granlund  <tege@swox.com>
10051
10052         * mpn/alpha/diveby3.asm: Make it actually work.
10053
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.
10057
10058         * gmp-impl.h: Remove nested TUNE_PROGRAM_BUILD test.
10059
10060 2005-05-18  Torbjorn Granlund  <tege@swox.com>
10061
10062         * mpn/generic/mul_n.c: Make squaring and multiplication code more
10063         similar.  Use TMP_S* functions.
10064
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
10069         just TMP_SALLOC.
10070         (WANT_TMP_ALLOCA): Make default functions choose alloca or reentrant
10071         functions, depending on size.
10072
10073         * *.c: Remove TMP_XXXX marker arguments.
10074
10075         * acinclude.m4 (WANT_TMP): Want tal-reent.lo also for alloca case.
10076
10077 2005-05-16  Torbjorn Granlund  <tege@swox.com>
10078
10079         * mpn/ia64/gmp-mparam.h: Further extend FFT tables.
10080
10081 2005-05-15  Torbjorn Granlund  <tege@swox.com>
10082
10083         * gmp-impl.h (udiv_qrnnd_preinv2): Pull an add into add_ssaaaa.
10084         (udiv_qrnnd_preinv2gen): Likewise.
10085
10086 2005-05-14  Torbjorn Granlund  <tege@swox.com>
10087
10088         * longlong.h (add_ssaaaa) [x86_64]: Restrict allowed immediate
10089         operands.
10090         * (sub_ddmmss) [x86_64]: Likewise.
10091
10092 2005-05-02  Torbjorn Granlund  <tege@swox.com>
10093
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.
10096
10097         * mpn/m68k/aors_n.asm: Correct MULFUNC_PROLOGUE.
10098
10099         * mpn/powerpc64/mode64/aors_n.asm: Add a MULFUNC_PROLOGUE.
10100
10101         * mpf/inp_str.c: Use plain int for mpf_set_str return value (works
10102         around gcc 4 bug).
10103
10104         * acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly
10105         syntax.
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.
10108
10109         * configure.in: Add mode64 support for darwin.  Use darwin.m4.
10110         Add cflags_opt flags for mode32 darwin.
10111
10112         * mpn/powerpc64: Use L() for all asm files.
10113
10114         * mpn/asm-defs.m4 (PIC_ALWAYS): Define PIC just iff PIC_ALWAYS = "yes".
10115
10116         * mpn/powerpc64/darwin.m4: New file.
10117
10118         * mpn/powerpc64/linux64.m4: Remove TOCREF, add LDSYM.
10119         Rework DEF_OBJECT to need just one argument.
10120         * mpn/powerpc64/aix.m4: Likewise.
10121
10122         * mpn/powerpc64/mode64/invert_limb.asm: Load approx_tab address with
10123         LDSYM.  Optimize somewhat.  Remove 2nd DEF_OBJECT operand.
10124
10125 2005-05-01  Torbjorn Granlund  <tege@swox.com>
10126
10127         * mpn/generic/popham.c: Compute final summation differently for 64-bit.
10128
10129         * tests/mpz/t-popcount.c (check_random): New function.
10130         (main): Call it.
10131
10132 2005-04-28  Torbjorn Granlund  <tege@swox.com>
10133
10134         * mpn/amd64/add_n.asm: Use r9 instead of rbx to save push/pop.
10135         * mpn/amd64/sub_n.asm: Likewise.
10136
10137 2005-04-09  Torbjorn Granlund  <tege@swox.com>
10138
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.
10147
10148 2005-04-08  Torbjorn Granlund  <tege@swox.com>
10149
10150         * mpn/generic/rootrem.c: Allocate PP_ALLOC limbs also for qp.
10151
10152 2005-04-07  Torbjorn Granlund  <tege@swox.com>
10153
10154         * mpn/powerpc32/add_n.asm: Add nc entry point.
10155         * mpn/powerpc32/sub_n.asm: Likewise.
10156
10157         * mpn/amd64/*.asm: Add Prescott/Nocona cycle/limb numbers.
10158
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.
10163
10164 2005-03-31  Torbjorn Granlund  <tege@swox.com>
10165
10166         * mpn/x86/k7/gmp-mparam.h: Fix typo in last change.
10167
10168 2005-03-19  Torbjorn Granlund  <tege@swox.com>
10169
10170         * mpn/amd64/gmp-mparam.h: Update.
10171
10172         * mpn/alpha/gmp-mparam.h: Update.
10173         * mpn/alpha/ev5/gmp-mparam.h: Update.
10174         * mpn/alpha/ev6/gmp-mparam.h: Update.
10175
10176         * mpn/ia64/gmp-mparam.h: Update.
10177
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.
10181
10182         * tests/mpz/t-gcd.c (main): Honor command line reps argument.
10183
10184         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Simplify and correct code
10185         for generating test operands.
10186
10187 2005-03-17  Niels Möller  <nisse@lysator.liu.se>
10188
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.
10192
10193 2005-03-16  Torbjorn Granlund  <tege@swox.com>
10194
10195         * tests/mpz/t-gcd.c (MAX_SCHOENHAGE_THRESHOLD): Set to largest of
10196         gcd,gcdext thresholds.
10197
10198 2005-03-15  Niels Möller  <nisse@lysator.liu.se>
10199
10200         * mpn/generic/gcdext.c (gcdext_schoenhage): When calling gcdext_lehmer,
10201         reuse all temporary limb storage, including the storage used for the
10202         qstack.
10203
10204 2005-03-09  Torbjorn Granlund  <tege@swox.com>
10205
10206         * mpn/amd64/logops_n.asm: Add MULFUNC_PROLOGUE.
10207
10208 2005-03-05  Torbjorn Granlund  <tege@swox.com>
10209
10210         * mpn/amd64/gmp-mparam.h: Extend MUL_FFT_TABLE and SQR_FFT_TABLE.
10211         * mpn/ia64/gmp-mparam.h: Likewise.
10212
10213 2005-02-17  Torbjorn Granlund  <tege@swox.com>
10214
10215         * mpn/ia64/divrem_1.asm: Add preinv entry point.
10216
10217 2005-01-13  Torbjorn Granlund  <tege@swox.com>
10218
10219         * gmp-impl.h (MPN_SIZEINBASE): Count bits in type size_t.
10220         (MPN_SIZEINBASE_16): Likewise.
10221
10222 2004-12-17  Torbjorn Granlund  <tege@swox.com>
10223
10224         * tune/speed.c (run_gnuplot): Use lines, not linespoints.
10225         Output a reset gnuplot command initially.
10226
10227 2004-12-04  Torbjorn Granlund  <tege@swox.com>
10228
10229         * mpn/generic/random2.c (gmp_rrandomb): Rework again.
10230         * mpz/rrandomb.c (gmp_rrandomb): Likewise.
10231
10232         * mpn/amd64/redc_1.asm: Call via PLT when PIC.
10233
10234 2004-11-29  Torbjorn Granlund  <tege@swox.com>
10235
10236         * mpn/amd64/divrem_1.asm: Add preinv entry point.
10237         * mpn/amd64/gmp-mparam.h: Set USE_PREINV_DIVREM_1 to 1.
10238
10239 2004-11-24  Torbjorn Granlund  <tege@swox.com>
10240
10241         * mpn/alpha/diveby3.asm: Use correct prefetch instruction.
10242
10243 2004-11-19  Torbjorn Granlund  <tege@swox.com>
10244
10245         * mpn/alpha/diveby3.asm: Add ",gp" glue in PROLOGUE.
10246         Add r31 dummy operand to `br' instruction.
10247
10248 2004-11-17  Torbjorn Granlund  <tege@swox.com>
10249
10250         * mpn/powerpc64/mode64/addmul_1.asm: Rewrite.
10251         * mpn/powerpc64/mode64/mul_1.asm: Rewrite.
10252
10253         * configure.in: Invoke AC_C_RESTRICT.
10254
10255 2004-11-16  Torbjorn Granlund  <tege@swox.com>
10256
10257         * mpn/alpha/diveby3.asm: New file.
10258
10259 2004-11-13  Torbjorn Granlund  <tege@swox.com>
10260
10261         * mpn/amd64/popham.asm: New file.
10262
10263 2004-11-12  Torbjorn Granlund  <tege@swox.com>
10264
10265         * mpn/amd64/add_n.asm: Correct cycle count.
10266         * mpn/amd64/sub_n.asm: Likewise.
10267
10268         * mpn/amd64/dive_1.asm: Speed divisors with many factors of 2.
10269
10270 2004-11-11  Torbjorn Granlund  <tege@swox.com>
10271
10272         * mpn/amd64/dive_1.asm: New file.
10273
10274 2004-11-10  Torbjorn Granlund  <tege@swox.com>
10275
10276         * mpn/generic/popham.c: Add comment.
10277
10278 2004-11-09  Torbjorn Granlund  <tege@swox.com>
10279
10280         * mpn/amd64/com_n.asm: New file.
10281
10282         * mpn/amd64/logops_n.asm: New file.
10283
10284 2004-11-08  Torbjorn Granlund  <tege@swox.com>
10285
10286         * mpn/powerpc64/com_n.asm: New file.
10287
10288 2004-11-05  Torbjorn Granlund  <tege@swox.com>
10289
10290         * mpn/amd64/diveby3.asm: New file.
10291
10292         * config.guess: Strip any PPC string in /proc/cpuinfo.
10293         Recognize 970 in that code.
10294
10295 2004-11-01  Torbjorn Granlund  <tege@swox.com>
10296
10297         * mpn/amd64/mul_basecase.asm: New file.
10298
10299         * mpn/amd64/redc_1.asm: New file.
10300
10301 2004-10-25  Torbjorn Granlund  <tege@swox.com>
10302
10303         * mpn/powerpc64/mode64/addlsh1_n.asm: Correct cycle counts.
10304
10305         * mpn/powerpc64/README: Update POWER5/PPC970 pipeline information.
10306
10307         * mpn/generic/mul_basecase.c (MAX_LEFT): Add comment.
10308
10309         * doc/gmp.texi: Consistently use "x86" denotation.
10310         (Assembler SIMD Instructions): Mention SSE2 usage.
10311
10312         * demos/pexpr.c (main): Handle "negative" base in mpz_sizeinbase call.
10313
10314 2004-10-18  Torbjorn Granlund  <tege@swox.com>
10315
10316         * mpn/powerpc64/mode64/submul_1.asm: Shave 2 cycles/limb with new carry
10317         inversion trick.
10318
10319 2004-10-16  Torbjorn Granlund  <tege@swox.com>
10320
10321         * configure.in: Support icc under x86.
10322         (ia64-*-linux*): Pass -no-gcc to icc.
10323
10324 2004-10-15  Torbjorn Granlund  <tege@swox.com>
10325
10326         * longlong.h (ia64 umul_ppmm): Add version for icc.
10327
10328         * configure.in: Support icc under ia64-*-linux*.
10329
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.
10332
10333 2004-10-14  Torbjorn Granlund  <tege@swox.com>
10334
10335         * mpn/generic/gcdext.c: Add a few missing TMP_MARK.
10336
10337 2004-10-14  Torbjorn Granlund  <tege@swox.com>
10338
10339         * acinclude.m4 (GMP_ASM_W32): Try also "data4".
10340
10341         * mpn/ia64/logops_n.asm: Don't use naked "br", rejected by Intel
10342         assembler.
10343         * mpn/ia64/aors_n.asm: Likewise.
10344
10345         * mpn/ia64/divrem_2.asm: Add ".prologue".
10346
10347         * mpn/ia64/hamdist.asm: Put alloc first in bundle, enforced by the
10348         Intel assembler.
10349
10350         * longlong.h: Exclude masquerading __INTEL_COMPILER from ia64 asm.
10351         * gmp-impl.h: Likewise.
10352
10353 2004-10-12  Torbjorn Granlund  <tege@swox.com>
10354
10355         * mpn/ia64/mul_2.asm: Rewrite function entry code, write new code for
10356         n=2.
10357         * mpn/ia64/addmul_2.asm: Likewise.
10358
10359         * tests/devel/try.c: Handle mpn_mul_2 like mpn_addmul_2.
10360
10361         * tune/speed.c (routine): Make R parameter optional for mpn_mul_2.
10362
10363 2004-10-11  Torbjorn Granlund  <tege@swox.com>
10364
10365         * mpn/sparc64/addmul_1.asm: Update a comment.
10366
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.
10371
10372         * tests/devel/aors_n.c: Handle also mpn_addlsh1_n, mpn_sublsh1_n,
10373         mpn_rsh1add_n, and mpn_rsh1sub_n.
10374
10375         * mpn/ia64/submul_1.asm: Add TODO item.
10376
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.
10380
10381         * mpn/ia64/rsh1aors_n.asm: Tune function entry and feed-in code.
10382         * mpn/ia64/lorrshift.asm: Likewise.  Remove several spurious loads.
10383
10384         * tests/devel/Makefile.am (EXTRA_PROGRAMS): Updates for yesterday's
10385         file removals and additions.
10386
10387 2004-10-10  Torbjorn Granlund  <tege@swox.com>
10388
10389         * mpn/ia64/copyi.asm: Tune function entry code.
10390         * mpn/ia64/copyd.asm: Likewise.
10391
10392         * mpn/ia64/logops_n.asm: Tune function entry and feed-in code for speed
10393         and size.
10394         * mpn/ia64/aors_n.asm: Likewise.
10395
10396         * mpn/powerpc64/logops_n.asm: Correct cycles counts.
10397         * mpn/powerpc64/mode64/aors_n.asm: Likewise.
10398
10399         * tests/devel/copy.c: Handle both MPN_COPY_INCR and MPN_COPY_DECR.
10400
10401         * tests/devel/logops_n.c: New file, handle all logical operations.
10402
10403         * tests/devel/anymul_1.c: New file, handle mpn_mul_1, mpn_addmul_1, and
10404         mpn_submul_1
10405         * tests/devel/mul_1.c: Remove.
10406         * tests/devel/addmul_1.c: Remove.
10407         * tests/devel/submul_1.c: Remove.
10408
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.
10412
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.
10416
10417 2004-10-09  Torbjorn Granlund  <tege@swox.com>
10418
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.
10423
10424         * mpn/amd64/mul_1.asm: Add mpn_mul_1c entry point.
10425
10426 2004-10-08  Torbjorn Granlund  <tege@swox.com>
10427
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.
10432
10433         * mpn/powerpc64/logops_n.asm: New file.
10434
10435         * mpn/powerpc64/mode64/invert_limb.asm: New file.
10436
10437 2004-10-07  Torbjorn Granlund  <tege@swox.com>
10438
10439         * mpn/powerpc64/mode64/aors_n.asm: New file, optimized for POWER4 and
10440         its derivatives.
10441         * mpn/powerpc64/mode64/add_n.asm: Delete.
10442         * mpn/powerpc64/mode64/sub_n.asm: Delete.
10443
10444         * configfsf.guess: Patch HP-UX code to accommodate HP compiler's new
10445         inability to read from stdin.
10446
10447         * mpn/powerpc64/mode64/addsub_n.asm: Remove accidentally added file.
10448
10449 2004-10-02  Torbjorn Granlund  <tege@swox.com>
10450
10451         * mpn/amd64/README: Update for new developments, fix typos.
10452
10453         * mpn/amd64/mul_1.asm: Tweak addressing (3.25 => 3.0 cycles/limb).
10454
10455         * mpn/amd64/addmul_1.asm: Remove unreachable code block.
10456
10457 2004-09-30  Torbjorn Granlund  <tege@swox.com>
10458
10459         * mpn/amd64/addmul_1.asm: Rewrite, now 3.25 cycles/limb.
10460
10461         * mpn/ia64/addmul_1.asm: Slightly enhance cross-jumping for code
10462         density.
10463         * mpn/ia64/mul_1.asm: Analogous changes.
10464
10465 2004-09-29  Torbjorn Granlund  <tege@swox.com>
10466
10467         * gmp-impl.h (x86 ULONG_PARITY): Work around GCC change of "q" register
10468         flag.
10469
10470 2004-09-28  Torbjorn Granlund  <tege@swox.com>
10471
10472         * mpn/ia64/divrem_1.asm: Add cycle counts to loop.
10473
10474         * mpn/ia64/divrem_2.asm: New file.
10475
10476 2004-09-28  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
10477
10478         * mpn/generic/mul_fft.c (mpn_mul_fft): Fix a bug in the choice of the
10479         recursive fft parameters.
10480
10481 2004-09-20  Torbjorn Granlund  <tege@swox.com>
10482
10483         * tests/misc.c (tests_rand_start): Default to strtoul for re-seeding.
10484
10485         * tests/mpz/t-mul.c (ref_mpn_mul): Fudge tmp allocation for toom3.
10486
10487 2004-09-19  Torbjorn Granlund  <tege@swox.com>
10488
10489         * tests/misc.c (tests_rand_start): Shift tv_usec for better seeding.
10490
10491 2004-09-18  Torbjorn Granlund  <tege@swox.com>
10492
10493         * tests/misc.c (tests_rand_start): Invoke fflush after printing seed.
10494
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.
10502
10503 2004-09-15  Torbjorn Granlund  <tege@swox.com>
10504
10505         * mpn/ia64/mul_2.asm: For HAVE_ABI_32, convert vp.
10506         * mpn/ia64/addmul_2.asm: Likewise.
10507
10508 2004-09-13  Torbjorn Granlund  <tege@swox.com>
10509
10510         * mpn/ia64/invert_limb.asm: Rewrite.
10511
10512         * mpn/ia64/logops_n.asm: Insert some more stops.
10513
10514 2004-09-12  Torbjorn Granlund  <tege@swox.com>
10515
10516         * mpn/ia64/gmp-mparam.h: Update.
10517         * mpn/amd64/gmp-mparam.h: Update.
10518
10519         * mpn/ia64/sqr_diagonal.asm: Shave off a few cycles.
10520
10521 2004-09-11  Torbjorn Granlund  <tege@swox.com>
10522
10523         * mpn/ia64/mul_2.asm: New file.
10524         * mpn/ia64/addmul_2.asm: New file.
10525
10526         * mpn/ia64/addmul_1.asm: Tune a cycle from prologue.
10527
10528         * mpn/ia64/lorrshift.asm: Insert stops after several branches.
10529         * mpn/ia64/aorslsh1_n.asm: Likewise.
10530         * mpn/ia64/rsh1aors_n.asm: Likewise.
10531
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.
10534
10535 2004-09-07  Torbjorn Granlund  <tege@swox.com>
10536
10537         * mpn/ia64/submul_1.asm: Rewrite.
10538
10539         * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
10540         * mpn/ia64/mul_1.asm: Likewise.
10541
10542 2004-09-02  Torbjorn Granlund  <tege@swox.com>
10543
10544         * mpn/ia64/mul_1.asm: Optimize feed-in code.
10545         * mpn/ia64/addmul_1.asm: Rewrite feed-in code.
10546
10547 2004-08-29  Torbjorn Granlund  <tege@swox.com>
10548
10549         * tests/mpz/t-sizeinbase.c: Disable mpz_fake_bits and check_sample.
10550
10551 2004-07-16  Torbjorn Granlund  <tege@swox.com>
10552
10553         * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
10554
10555 2004-06-17  Kevin Ryde  <kevin@swox.se>
10556
10557         * doc/gmp.texi: Use @. when sentence ends with a capital, for good
10558         spacing in tex.
10559         (Language Bindings): Add gmp-d, reported by Ben Hinkle.  Update SWI
10560         Prolog URL, reported by Jan Wielemaker.
10561
10562 2004-06-09  Torbjorn Granlund  <tege@swox.com>
10563
10564         * configure.in: Handle --enable-fat.  Use that to enable x86 fat
10565         builds, remove magic meaning of i386-*-*.
10566
10567 2004-06-03  Kevin Ryde  <kevin@swox.se>
10568
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é.
10571
10572 2004-06-01  Kevin Ryde  <kevin@swox.se>
10573
10574         * config.guess (i?86-*-*): Avoid "Illegal instruction" message which
10575         goes to stdout on 80386 freebsd4.9.
10576
10577 2004-05-23  Niels Möller  <nisse@lysator.liu.se>
10578
10579         * mpn/generic/gcdext.c (gcdext_1_u): New function.
10580         (mpn_gcdext): Use it.
10581
10582 2004-05-23  Torbjorn Granlund  <tege@swox.com>
10583
10584         * mpn/generic/gcdext.c (gcdext_1_odd): Use masking to avoid jumps.
10585
10586 2004-05-22  Torbjorn Granlund  <tege@swox.com>
10587
10588         * mpn/x86/pentium4/sse2/addmul_1.asm: Add Prescott cycle numbers.
10589
10590         * mpn/amd64/divrem_1.asm: Shave a cycle from fraction development code.
10591
10592         * mpn/powerpc32/lshift.asm: Add more cycle numbers.
10593         * mpn/powerpc32/rshift.asm: Likewise.
10594
10595         * mpn/ia64/addmul_1.asm: Reformat.
10596
10597 2004-05-21  Torbjorn Granlund  <tege@swox.com>
10598
10599         * gmp-impl.h (mpn_mullow_n, mpn_mullow_basecase): Declare.
10600
10601         * tune/Makefile.am: Compile gcdext.c.
10602
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.
10607
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.
10614
10615 2004-05-21  Niels Möller  <nisse@lysator.liu.se>
10616
10617         * mpn/generic/gcdext.c: Complete rewrite.  Uses fast Lehmer code for
10618         small operands, and Schoenhage code for large operands.
10619
10620         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Ensure first operand is
10621         not smaller than 2nd operand.
10622
10623 2004-05-17  Kevin Ryde  <kevin@swox.se>
10624
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.
10628
10629 2004-05-15  Kevin Ryde  <kevin@swox.se>
10630
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
10634         doesn't exist.
10635         * tune/README (NetBSD 1.4.1 m68k): Update notes.
10636
10637         * configure.in (mips*-*-* ABI=n32): Remove gcc_n32_ldflags and
10638         cc_n32_ldflags, libtool knows to put the linker in n32 mode.
10639
10640 2004-05-15  Torbjorn Granlund  <tege@swox.com>
10641
10642         * config.guess (powerpc*-*-*): Add more processor types to mfpvr code.
10643         * configure.in: Generalize powerpc subtype matching code.
10644
10645         * mpz/fac_ui.c: Misc cleanups, spelling corrections.
10646
10647 2004-05-14  Kevin Ryde  <kevin@swox.se>
10648
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.
10656
10657 2004-05-12  Kevin Ryde  <kevin@swox.se>
10658
10659         * configure.in (AC_PROG_RANLIB): New macro, supposedly required by
10660         automake, though it doesn't complain.
10661
10662         * demos/expr/Makefile.am (ARFLAGS): Add a default setting, to
10663         workaround an automake bug.
10664
10665 2004-05-10  Kevin Ryde  <kevin@swox.se>
10666
10667         * */Makefile.in, install-sh, aclocal.m4: Update to automake 1.8.4.
10668
10669         * doc/gmp.texi (Demonstration Programs): Add a remark about expression
10670         evaluation in the main gmp library.
10671
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.
10676
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.
10683
10684 2004-05-08  Kevin Ryde  <kevin@swox.se>
10685
10686         * doc/configuration (Configure): Update for current automake not
10687         copying acinclude.m4 into aclocal.m4.
10688
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.
10696
10697 2004-05-07  Kevin Ryde  <kevin@swox.se>
10698
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).
10703
10704 2004-05-06  Kevin Ryde  <kevin@swox.se>
10705
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.
10709
10710         * tune/amd64.asm: Save rbx in r10 rather than on the stack.
10711
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.
10716
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.
10725
10726 2004-05-05  Torbjorn Granlund  <tege@swox.com>
10727
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.
10731
10732         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD, MULLOW_DC_THRESHOLD,
10733         MULLOW_MUL_N_THRESHOLD): Override for TUNE_PROGRAM_BUILD.
10734
10735         * tune/Makefile.am: Compile mullow_n.c.
10736         * tune/common.c (speed_mpn_mullow_n, speed_mpn_mullow_basecase):
10737         New functions.
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.
10743
10744         * gmp-impl.h (invert_limb): Compute branch-freely.
10745
10746 2004-05-02  Kevin Ryde  <kevin@swox.se>
10747
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.
10751
10752 2004-05-01  Kevin Ryde  <kevin@swox.se>
10753
10754         * doc/gmp.texi (References): Update gcc online docs url to
10755         gcc.gnu.org.
10756
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.
10760
10761 2004-04-30  Kevin Ryde  <kevin@swox.se>
10762
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.
10767
10768         * doc/gmp.texi (Reentrancy): Note also gmp_randinit_default as an
10769         alternative to gmp_randinit.
10770
10771 2004-04-29  Torbjorn Granlund  <tege@swox.com>
10772
10773         * configfsf.guess: Update to 2004-03-12.
10774         * configfsf.sub: Likewise.
10775
10776 2004-04-27  Torbjorn Granlund  <tege@swox.com>
10777
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.
10781
10782 2004-04-25  Kevin Ryde  <kevin@swox.se>
10783
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
10786         from gcc 3.4.
10787
10788 2004-04-24  Kevin Ryde  <kevin@swox.se>
10789
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
10793         3.4.
10794
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
10797         about -mcpu.
10798
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.
10802
10803 2004-04-22  Kevin Ryde  <kevin@swox.se>
10804
10805         * tests/rand/t-lc2exp.c (check_bigc1): New test.
10806
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.
10810
10811 2004-04-20  Kevin Ryde  <kevin@swox.se>
10812
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.
10816
10817         * demos/perl/GMP.xs (static_functable): Treat cygwin the same as mingw
10818         DLLs.
10819
10820         * */Makefile.in, install-sh: Update to automake 1.8.3.
10821         * ltmain.sh, aclocal.m4, configure: Update to libtool 1.5.6.
10822
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
10826         needed.
10827         * tests/t-hightomask.c: New file.
10828         * tests/Makefile.am (check_PROGRAMS): Add it.
10829
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.
10838
10839 2004-04-19  Torbjorn Granlund  <tege@swox.com>
10840
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.
10845
10846 2004-04-16  Kevin Ryde  <kevin@swox.se>
10847
10848         * doc/fdl.texi: Update from FSF, just fixing a couple of typos.
10849
10850         * macos/configure, macos/Makefile.in: Add printf and scanf directories.
10851
10852         * tests/mpz/t-gcd.c (check_data): New function, exercising K6
10853         gcd_finda bug.
10854
10855 2004-04-14  Kevin Ryde  <kevin@swox.se>
10856
10857         * doc/gmp.texi (Reentrancy, Random State Initialization): Note
10858         gmp_randinit use of gmp_errno is not thread safe.  Reported by Vincent
10859         Lefèvre.
10860
10861         * doc/gmp.texi (Random State Initialization): Add index entries for
10862         gmp_errno and constants.
10863
10864         * mpn/m68k/README: Update _SHORT_LIMB -> __GMP_SHORT_LIMB.
10865
10866         * configure.in (--enable-mpbsd): Typo Berkley -> Berkeley in help msg.
10867
10868 2004-04-12  Kevin Ryde  <kevin@swox.se>
10869
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.
10874
10875         * demos/perl/sample.pl: Print the module and library versions in use.
10876
10877         * demos/perl/GMP.pm, Makefile.PL (VERSION): Set to '2.00'.
10878         * demos/perl/GMP.pm (COPYRIGHT): New in the doc section.
10879
10880         * Makefile.am: Note 4.1.3 libtool versioning info, and REVISION policy.
10881
10882         * tal-debug.c: Add <stdlib.h> for abort.
10883
10884 2004-04-07  Torbjorn Granlund  <tege@swox.com>
10885
10886         * tests/refmpf.c (refmpf_add_ulp): Adjust exponent when needed.
10887
10888         * mpn/generic/random2.c: Rewrite (clone mpz/rrandomb.c).
10889
10890 2004-04-07  Kevin Ryde  <kevin@swox.se>
10891
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.
10896
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
10900         Jerry James.
10901
10902         * tests/refmpn.c (refmpn_mod2): Correction to ASSERTs, r==a is allowed.
10903
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.
10907
10908 2004-04-04  Kevin Ryde  <kevin@swox.se>
10909
10910         * gmp-impl.h (BSWAP_LIMB) [amd64]: New macro.
10911         (FORCE_DOUBLE): Use this for amd64 too.
10912
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.
10917
10918 2004-04-03  Kevin Ryde  <kevin@swox.se>
10919
10920         * mpn/amd64/mode1o.asm: New file.
10921         * mpn/amd64/amd64-defs.m4 (ASSERT): New macro.
10922
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.
10925
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.
10928
10929 2004-03-31  Kevin Ryde  <kevin@swox.se>
10930
10931         * doc/gmp.texi (Language Bindings): Add GOO, MLGMP and Numerix.
10932
10933         * mpf/mul_2exp.c, mpf/div_2exp.c: Rate u==0 as UNLIKELY.
10934
10935 2004-03-28  Torbjorn Granlund  <tege@swox.com>
10936
10937         * mpn/amd64/divrem_1.asm: Trim a few cycles.
10938
10939 2004-03-27  Torbjorn Granlund  <tege@swox.com>
10940
10941         * mpn/amd64/sublsh1_n.asm: Fix typo.
10942
10943         * mpn/generic/divrem_1.c: Fix typo.
10944
10945         * mpn/generic/sqr_basecase.c: Fix typo.
10946
10947         * mpn/amd64/divrem_1.asm: New file.
10948
10949 2004-03-20  Kevin Ryde  <kevin@swox.se>
10950
10951         * longlong.h (power, powerpc): Add comments on how we select this code.
10952
10953         * gmp-h.in (mpz_get_ui): Use ?: instead of mask style, gcc treats the
10954         two identically but ?: is a bit clearer.
10955
10956         * insert-dbl.c: Remove file, no longer used, scaling is now integrated
10957         in mpn_get_d.
10958         * Makefile.am (libgmp_la_SOURCES): Remove insert-dbl.c.
10959         * gmp-impl.h (__gmp_scale2): Remove prototype.
10960
10961 2004-03-17  Kevin Ryde  <kevin@swox.se>
10962
10963         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init, fake_cpuid_table): Add x86_64.
10964
10965         * mpq/get_d.c: Use mpn_tdiv_qr, demand den>0 per canonical form.
10966
10967 2004-03-16  Torbjorn Granlund  <tege@swox.com>
10968
10969         * mpn/generic/sqr_basecase.c: Add versions using mpn_addmul_2 and
10970         mpn_addmul_2s.
10971
10972 2004-03-14  Kevin Ryde  <kevin@swox.se>
10973
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.
10977
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.
10982
10983         * tests/mpf/t-set_q.c, tests/mpf/t-ui_div.c (check_various): Amend
10984         bogus 99/4 test.
10985         * tests/mpf/t-ui_div.c (check_rand): Exercise r==v overlap.
10986
10987         * tests/refmpf.c, tests/tests.h (refmpf_set_overlap): New function.
10988
10989         * mpf/cmp_si.c [nails]: Correction, cast vval in exp comparisons, for
10990         when vval=-0x800..00 and limb==longlong.
10991
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.
10995
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.
10998
10999 2004-03-12  Torbjorn Granlund  <tege@swox.com>
11000
11001         * mpn/generic/sb_divrem_mn.c: Correct header comment.
11002
11003 2004-03-11  Kevin Ryde  <kevin@swox.se>
11004
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
11008         we have.
11009
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
11013         linking mode.
11014
11015         * randbui.c, randmui.c [longlong+nails]: Correction to conditionals
11016         for second limb.
11017
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.
11024
11025 2004-03-07  Kevin Ryde  <kevin@swox.se>
11026
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
11029         UNLIKELY.
11030
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.
11035
11036         * mpf/set_q.c: Expand TMP_ALLOC_LIMBS_2, to make conditional clearer
11037         and avoid 1 limb alloc when not wanted.
11038
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.
11042
11043         * mpf/mul_2exp.c, mpf/div_2exp.c: Add some comments.
11044
11045         * tests/refmpn.c (refmpn_sb_divrem_mn, refmpn_tdiv_qr): Nailify.
11046
11047 2004-03-04  Kevin Ryde  <kevin@swox.se>
11048
11049         * gen-psqr.c (print): Add CNST_LIMB in PERFSQR_MOD_TEST, for benefit
11050         of K&R.
11051         * tests/mpn/t-perfsqr.c (PERFSQR_MOD_1): Use CNST_LIMB for K&R.
11052
11053         * doc/configuration (Configure): Remove mkinstalldirs, no longer used.
11054
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
11057         linking mode.
11058
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).
11063
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
11067         bits.
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.
11071
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.
11076
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.
11082
11083         * mpf/set.c, mpf/iset.c: Do MPN_COPY last, for possible tail call.
11084
11085         * mpf/set_d.c: Rate d==0 as UNLIKELY.  Store size before extract call,
11086         to shorten lifespan of "negative".
11087
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.
11093
11094         * tests/refmpf.c, tests/tests.h (refmpf_fill, refmpf_normalize,
11095         refmpf_validate, refmpf_validate_division): New functions.
11096
11097         * tests/refmpn.c, tests/tests.h (refmpn_copy_extend,
11098         refmpn_lshift_or_copy_any, refmpn_rshift_or_copy_any): New functions.
11099
11100         * tal-debug.c: Add <string.h> for strcmp.
11101
11102         * tests/cxx/t-istream.cc (check_mpz, check_mpq, check_mpf): Use size_t
11103         for loop index, to quieten g++ warning.
11104
11105 2004-03-02  Kevin Ryde  <kevin@swox.se>
11106
11107         * tests/mpn/t-hgcd.c: Use __GMP_PROTO on prototypes.
11108
11109 2004-03-01  Torbjorn Granlund  <tege@swox.com>
11110
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
11118         mpn_dc_div_2_by_1.
11119
11120 2004-02-29  Kevin Ryde  <kevin@swox.se>
11121
11122         * longlong.h (count_leading_zeros) [alpha gcc]: New version, inlining
11123         mpn/alpha/cntlz.asm cmpbge technique.
11124
11125         * aclocal.m4, configure, install-sh, missing, ltmain.sh,
11126         */Makefile.in: Update to automake 1.8.2 and libtool 1.5.2.
11127
11128         * doc/gmp.texi (C++ Interface Integers): Note / and % rounding follows
11129         C99 / and %.
11130         (Exact Remainder): Index entries for divisibility testing algorithm.
11131
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.
11136
11137         * tests/mpn/t-get_d.c (check_rand): Correction to nhigh_mask setup.
11138
11139 2004-02-27  Torbjorn Granlund  <tege@swox.com>
11140
11141         * tune/tuneup.c (tune_dc, tune_set_str): Up param.step_factor.
11142
11143         * tests/mpz/t-gcd.c: Decrease # of tests to 50.
11144
11145 2004-02-27  Kevin Ryde  <kevin@swox.se>
11146
11147         * tests/devel/try.c: Add a comment that this is not for Cray systems.
11148
11149         * mpf/set_q.c: Don't support den(q)<0, demand canonical form in the
11150         usual way.
11151
11152 2004-02-24  Torbjorn Granlund  <tege@swox.com>
11153
11154         From Kevin:
11155         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Loop until normalization
11156         criterion met.
11157
11158 2004-02-22  Kevin Ryde  <kevin@swox.se>
11159
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.
11163
11164         * acinclude.m4 (GMP_PROG_CC_WORKS): Add test for lshift_com code
11165         mis-compiled by certain IA-64 HP cc at +O3.
11166
11167         * gmp-impl.h (USE_LEADING_REGPARM): Disable under prof or gprof, for
11168         the benefit of freebsd where .mcount clobbers registers.  Spotted by
11169         Torbjorn.
11170         * configure.in (WANT_PROFILING_PROF, WANT_PROFILING_GPROF): New
11171         AC_DEFINEs.
11172
11173 2004-02-21  Kevin Ryde  <kevin@swox.se>
11174
11175         * configure.in (sparc64-*-*bsd*): Amend -m32 setup for ABI=32, so it's
11176         not used in ABI=64 on the BSD systems.
11177
11178 2004-02-18  Niels Möller  <nisse@lysator.liu.se>
11179
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.
11185
11186 2004-02-18  Torbjorn Granlund  <tege@swox.com>
11187
11188         * gmp-impl.h (MPN_TOOM3_MAX_N): Move to !WANT_FFT section.
11189
11190         * tests/mpz/t-mul.c: Exclude special huge operands unless WANT_FFT.
11191
11192         * mpz/rrandomb.c (gmp_rrandomb): Rewrite.
11193
11194         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Remove write-only variable c5.
11195
11196 2004-02-18  Kevin Ryde  <kevin@swox.se>
11197
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.
11200
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.
11205
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.
11212
11213 2004-02-16  Kevin Ryde  <kevin@swox.se>
11214
11215         * mpz/scan0.c, mpz/scan1.c: Use count_trailing_zeros, instead of
11216         count_leading_zeros on limb&-limb.
11217
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.
11223
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.
11227
11228         * mpz/gcd_ui.c [nails]: Correction, actually return a value.
11229
11230         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails==1]: Add code.
11231
11232 2004-02-15  Kevin Ryde  <kevin@swox.se>
11233
11234         * tests/mpz/t-jac.c (check_data): Remove unnecessary variable
11235         "answer".
11236
11237 2004-02-14  Torbjorn Granlund  <tege@swox.com>
11238
11239         * mpn/ia64/aors_n.asm: Break a group with a RAW conflict.
11240
11241 2004-02-14  Kevin Ryde  <kevin@swox.se>
11242
11243         * acinclude.m4 (GMP_C_RIGHT_SHIFT): Note that it's "long"s which we're
11244         concerned about.
11245
11246         * mpn/generic/mul_n.c: Add some remarks about toom3 high zero
11247         stripping.
11248
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.
11252
11253 2004-02-12  Torbjorn Granlund  <tege@swox.com>
11254
11255         * tests/mpn/t-hgcd.c: Remove unused variables.
11256
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.
11260
11261 2004-02-11  Kevin Ryde  <kevin@swox.se>
11262
11263         * longlong.h (power, powerpc): Use HAVE_HOST_CPU_FAMILY_power and
11264         HAVE_HOST_CPU_FAMILY_powerpc rather than various cpp defines.
11265
11266         * gmp-impl.h: Add remarks about limits.h and Cray etc.
11267
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.
11271
11272         * dumbmp.c (mpz_mul): Set ALLOC(r) for new data block used.  Reported
11273         by Jason Moxham.
11274
11275         * mpn/pa32/README, mpn/pa64/README (REFERENCES): New sections.
11276
11277 2004-02-10  Torbjorn Granlund  <tege@swox.com>
11278
11279         * tests/mpz/t-gcd.c: Decrease # of tests run.
11280
11281         * mpn/*/gmp-mparam.h: Add HGCD values, update TOOM values.
11282
11283 2004-02-01  Torbjorn Granlund  <tege@swox.com>
11284
11285         From Kevin:
11286         * config.guess: Recognize AMD's hammer processors, return x86_64.
11287
11288 2004-01-31  Niels Möller  <nisse@lysator.liu.se>
11289
11290         * mpn/generic/hgcd.c (mpn_cmp_sum3): Declare static.
11291
11292 2004-01-25  Niels Möller  <nisse@lysator.liu.se>
11293
11294         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-hgcd.
11295
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.
11301
11302 2004-01-25  Torbjorn Granlund  <tege@swox.com>
11303
11304         * tune/tuneup.c (all): Reenable calls of tune_gcd_schoenhage and
11305         tune_hgcd.
11306
11307         * mpn/generic/gcd.c: Reenable Schoenhage code.
11308
11309         With Niels Möller:
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.
11318
11319 2004-01-24  Kevin Ryde  <kevin@swox.se>
11320
11321         * tests/mpf/t-sqrt.c (check_rand1): Further diagnostic printouts.
11322
11323         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Add ASSERT_MPN.
11324         (mpn_dc_sqrtrem): Add casts for K&R.
11325
11326         * mpf/sqrt_ui.c: Nailify.
11327
11328         * mpf/set_z.c: Do MPN_COPY last, for possible tail call.
11329
11330         * doc/gmp.texi (Miscellaneous Float Functions): For mpf_random2, note
11331         exponent is in limbs.
11332
11333         * mpn/ia64/README: Add remark about concentrating on itanium-2.
11334
11335 2004-01-22  Kevin Ryde  <kevin@swox.se>
11336
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.
11341
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.
11346
11347         * tests/refmpf.c, tests/tests.h (refmpf_add_ulp,
11348         refmpf_set_prec_limbs): New functions.
11349
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
11353         tail call.
11354
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,
11359         -march=k8.
11360         (amd64-*-*): Remove pattern, config.sub only gives x86_64.
11361         * doc/gmp.texi (ABI and ISA): Add x86_64 dual ABIs.
11362
11363         * mpn/amd64/README: Add reference to ABI spec.
11364
11365 2004-01-17  Niels Möller  <nisse@lysator.liu.se>
11366
11367         * mpn/generic/hgcd.c (hgcd_adjust): Backed out mpn_addlsh1_n
11368         change for now.
11369
11370         * mpn/generic/hgcd.c (hgcd_adjust): Fixed calls of mpn_addlsh1_n.
11371
11372 2004-01-17  Kevin Ryde  <kevin@swox.se>
11373
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.
11377
11378         * mpn/generic/mode1o.c: Use "c<s" to do underflow detection in last
11379         step, for better parallelism.
11380
11381         * mpn/generic/get_d.c: Preserve comments about hppa fcnv,udw,dbl from
11382         previous mpz_get_d code.
11383
11384         * tune/freq.c: Add some comments about systems not covered.
11385
11386         * gmp-h.in (_GMP_H_HAVE_FILE): Add _MSL_STDIO_H for Metrowerks.
11387         Reported by Tomas Zahradnicky.
11388
11389 2004-01-16  Niels Möller  <nisse@lysator.liu.se>
11390
11391         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use MPN_DECR_U.
11392         (hgcd_adjust): Use mpn_addlsh1_n when available.
11393
11394 2004-01-16  Kevin Ryde  <kevin@swox.se>
11395
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.
11399
11400 2004-01-15  Kevin Ryde  <kevin@swox.se>
11401
11402         * configure.in (--with-readline=detect): Check for readline/readline.h
11403         and readline/history.h.  Report result of detection.
11404
11405 2004-01-14  Niels Möller  <nisse@lysator.liu.se>
11406
11407         * tune/speed.c (routine): Disabled speed_mpn_hgcd_lehmer.
11408         * tune/common.c (speed_mpn_hgcd_lehmer): Disabled function.
11409
11410         * mpn/generic/hgcd.c (mpn_hgcd_lehmer_itch, mpn_hgcd_lehmer)
11411         (mpn_hgcd_equal): Deleted functions.
11412
11413         * mpn/generic/gcd.c (hgcd_start_row_p): Deleted function.
11414         (gcd_schoenhage): Deleted assertion code using mpn_hgcd_lehmer.
11415
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.
11419
11420         * mpn/generic/gcd.c (gcd_schoenhage): Updated for changes to
11421         mpn_hgcd and mpn_hgcd_fix. (Schoenhage code is still disabled).
11422
11423         * gmp-impl.h (mpn_hgcd_fix): Updated prototype.
11424
11425         * mpn/generic/hgcd.c (mpn_hgcd_fix): Replaced a bunch of arguments
11426         by a pointer const struct hgcd_row *s. Updated callers.
11427
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.
11435
11436         * mpn/generic/hgcd.c (hgcd_final): Streamlined logic for the first
11437         hgcd2 call.
11438
11439         * mpn/generic/hgcd2.c (mpn_hgcd2): Interface change. Return 1
11440         instead of 2, in the no progress case r0=A, r1=B.
11441
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
11444         updated uvsize.
11445         (hgcd_final): Special handling of the case hgcd2 returning 1. Now
11446         uses hgcd_adjust, instead of a full Euclid division.
11447
11448 2004-01-13  Niels Möller  <nisse@lysator.liu.se>
11449
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.
11454
11455         * tests/mpn/t-hgcd.c (hgcd_values): One more test value.
11456
11457         * tests/mpn/t-hgcd.c (hgcd_values): Added values that trigged the
11458         hgcd_jebelean bug.
11459
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).
11465
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.
11471
11472 2004-01-12  Niels Möller  <nisse@lysator.liu.se>
11473
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.
11478
11479         * tests/tests.h: Added refmpn_free_limbs prototype.
11480         * tests/refmpn.c (refmpn_free_limbs): New function.
11481
11482         * tests/mpn/t-hgcd.c: Try the same kind of random inputs as for
11483         mpz/t-gcd.
11484
11485 2004-01-11  Niels Möller  <nisse@lysator.liu.se>
11486
11487         * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Rewritten, after some more
11488         analysis of the size reduction for one Lehmer step.
11489
11490         * tests/mpn/t-hgcd.c: New file.
11491
11492 2004-01-11  Torbjorn Granlund  <tege@swox.com>
11493
11494         With Niels Möller:
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
11498         normalized.
11499
11500 2004-01-11  Kevin Ryde  <kevin@swox.se>
11501
11502         * mpn/alpha/ev6/slot.pl: New file, derived in part from
11503         mpn/x86/k6/cross.pl.
11504
11505         * mpn/alpha/alpha-defs.m4 (ASSERT): New macro.
11506
11507         * mpn/asm-defs.m4 (m4_ifdef): New macro, avoiding OSF 4.0 m4 bug.
11508         (m4_assert_defined): Use it.
11509
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.
11512
11513         * configure.in, demos/calc/Makefile.am: Use -lcurses or -lncurses with
11514         readline, when available.
11515
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.
11519
11520         * longlong.h (sub_ddmmss) [ia64]: New macro.
11521
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.
11525
11526 2004-01-09  Kevin Ryde  <kevin@swox.se>
11527
11528         * mpn/x86/p6/mod_34lsub1.asm: New file, derived in part from
11529         mpn/x86/mod_34lsub1.asm.
11530
11531         * configure.in (IA64_PATTERN): Use -mtune on gcc 3.4.
11532
11533 2004-01-07  Kevin Ryde  <kevin@swox.se>
11534
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.
11538
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).
11541
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.
11545
11546 2004-01-06  Kevin Ryde  <kevin@swox.se>
11547
11548         * configfsf.sub, configfsf.guess: Update to 2004-01-05.
11549         * configure.in (amd64-*-* | x86_64-*-*): Update comments on what
11550         configfsf.sub does.
11551
11552 2004-01-04  Kevin Ryde  <kevin@swox.se>
11553
11554         * mpn/alpha/README (REFERENCES): Add tru64 assembly manuals.
11555         (ASSEMBLY RULES): Note what gcc says about !literal! etc.
11556
11557 2004-01-03  Kevin Ryde  <kevin@swox.se>
11558
11559         * mpn/alpha/ev67/gcd_1.asm: New file.
11560
11561         * mpn/x86/pentium4/sse2/rsh1add_n.asm: New file, derived in part from
11562         mpn/x86/pentium4/sse2/addlsh1_n.asm.
11563
11564         * mpn/x86/p6/p3mmx/popham.asm: Note measured speeds.
11565
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
11568         comments.
11569
11570         * mpn/x86/pentium4/sse2/addlsh1_n.asm (PARAM_CARRY): Remove macro, not
11571         used, no such parameter.
11572
11573         * mpn/generic/gcd.c: Use <stdio.h> for NULL.
11574
11575         * doc/gmp.texi (Single Limb Division): Correction to tex expression
11576         for (1/2)x1.  And minor wording tweaks elsewhere.
11577
11578         * gmp-impl.h (mpn_rsh1add_n, mpn_rsh1sub_n): Correction to comments
11579         about how carries returned.
11580
11581         * longlong.h (umul_ppmm) [generic]: Add comments about squaring
11582         (dropped from tasks list)
11583
11584 2003-12-31  Kevin Ryde  <kevin@swox.se>
11585
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.
11591
11592         * demos/perl/test.pl (fits_slong_p): Comment out uv_max test, it won't
11593         necessarily exceed a long.
11594
11595         * demos/perl/GMP.pm: Add a remark about get_str to the bugs section.
11596
11597         * mpn/generic/sqrtrem.c, mpz/fac_ui.c, tests/mpf/reuse.c: Add casts
11598         for K&R.
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.
11601
11602         * doc/gmp.texi (Square Root Algorithm): Add a summary of the algorithm.
11603         And add further index entries in various places.
11604
11605         * mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
11606
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.
11610
11611 2003-12-30  Torbjorn Granlund  <tege@swox.com>
11612
11613         * tune/tuneup.c (all): Disable calls of tune_gcd_schoenhage and
11614         tune_hgcd for now.
11615
11616 2003-12-29  Torbjorn Granlund  <tege@swox.com>
11617
11618         * tests/mpz/t-gcd.c: Rewrite, based on suggestions by Kevin.
11619
11620         * mpn/ia64/mul_1.asm: Amend TODO list.
11621
11622         * mpn/sparc64/README: Remove mpn_Xmul_2, done.
11623         Add blurb about L1 cache conflicts.
11624
11625         * mpn/generic/gcd.c: Disable Schoenhage code for now.
11626
11627 2003-12-29  Kevin Ryde  <kevin@swox.se>
11628
11629         * mpn/generic/mul_fft.c, mpz/root.c, mpq/cmp_ui.c: Add casts for K&R.
11630
11631 2003-12-27  Kevin Ryde  <kevin@swox.se>
11632
11633         * tests/mpz/t-mul.c (mul_kara, mul_basecase): Use __GMP_PROTO.
11634
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
11638         ANSI-ism, avoid.
11639
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.
11643
11644         * configure.in (cflags_maybe): Don't loop adding cflags_maybe if the
11645         user has set CFLAGS.
11646
11647 2003-12-24  Torbjorn Granlund  <tege@swox.com>
11648
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.
11652
11653 2003-12-23  Kevin Ryde  <kevin@swox.se>
11654
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.
11658
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.
11662
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.
11667
11668 2003-12-22  Kevin Ryde  <kevin@swox.se>
11669
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
11672         alpha build.
11673
11674 2003-12-21  Kevin Ryde  <kevin@swox.se>
11675
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.
11679
11680         * gmp-h.in (_GMP_H_HAVE_FILE): Note why defined(EOF) is not good.
11681
11682 2003-12-20  Torbjorn Granlund  <tege@swox.com>
11683
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.
11686
11687 2003-12-20  Kevin Ryde  <kevin@swox.se>
11688
11689         * tune/speed.h (SPEED_TMP_ALLOC_LIMBS): Correction to last change,
11690         don't want "- 1" on the TMP_ALLOC_LIMBS.
11691
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.
11694
11695         * demos/expr/exprfra.c (e_mpfr_ulong_p): Use mpfr_integer_p and
11696         mpfr_fits_ulong_p.
11697         (e_mpfr_get_ui_fits): Use mpfr_get_ui.
11698
11699         * mpfr/*: Update to mpfr cvs head 2003-12-20.
11700
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.
11704
11705         * mkinstalldirs: Remove, not required by automake 1.8.
11706         * doc/gmp.texi (Build Options): HTML is a usual target in automake 1.8.
11707
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,
11713         autoconf now ok.
11714
11715         * acinclude.m4 (GMP_C_INLINE): Remove.
11716         (GMP_H_EXTERN_INLINE): Use AC_C_INLINE.
11717         (GMP_PROG_AR): Comment on automake $ARFLAGS.
11718
11719 2003-12-19  Niels Möller  <nisse@lysator.liu.se>
11720
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.
11726
11727         * mpn/generic/hgcd.c (mpn_addmul2_n_1) [nails]: Fixed carry handling.
11728
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.
11734
11735         * mpn/generic/qstack.c (mpn_hgcd_max_recursion): ... moved from
11736         here.
11737
11738 2003-12-19  Torbjorn Granlund  <tege@swox.com>
11739
11740         * tests/mpf/t-get_d.c: Print message before aborting.
11741
11742         * mpn/generic/hgcd2.c (mpn_hgcd2): Substitute always-zero variable
11743         with 0.  Remove bogus comment.
11744
11745         * mpn/generic/get_d.c: Make ONE_LIMB case actually work for nails.
11746
11747 2003-12-18  Niels Möller  <niels@lysator.liu.se>
11748
11749         * mpn/generic/hgcd.c (hgcd_update_r): Assert that the output r2 is
11750         smaller than the input r1.
11751
11752 2003-12-18  Torbjorn Granlund  <tege@swox.com>
11753
11754         * mpz/get_d.c: Don't include longlong.h.
11755
11756         * tests/mpz/t-mul.c (ref_mpn_mul): Handle un == vn specially, to avoid
11757         a dummy r/w outside of allocated area.
11758
11759 2003-12-18  Kevin Ryde  <kevin@swox.se>
11760
11761         * mpn/alpha/unicos.m4 (ALIGN): Add comments on what GCC does.
11762
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.
11766
11767 2003-12-17  Niels Möller  <nisse@lysator.liu.se>
11768
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.
11774
11775         * mpn/generic/gcd.c [nails]: Use Schönhage's algorithm also for
11776         GMP_NAIL_BITS > 0.
11777
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.
11786
11787         * mpn/generic/hgcd2.c (div2) [nails]: Alternative nail-aware
11788         version.
11789         (SUB_2): New macro of Kevin's, which reduces do sub_ddmmss in the
11790         non-nail case.
11791         (HGCD2_STEP): Use SUB_2, not sub_ddmmss. Added alternative version
11792         for K&R compilers.
11793         (mpn_hgcd2) [nails]: Use SUB_2, not sub_ddmmss. New nail-aware
11794         code for checking Jebelean's condition.
11795
11796 2003-12-13  Kevin Ryde  <kevin@swox.se>
11797
11798         * mpq/get_d.c: Amend comments per mpn_get_d change.
11799         (limb2dbl): Remove, no longer used.
11800
11801         * gmp-impl.h (DIVREM_1_NORM_THRESHOLD etc) [nails]: Correction to
11802         comments, MP_SIZE_T_MAX means preinv never.
11803
11804         * gmp-impl.h (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD) [nails]:
11805         Remove overrides, divexact_1 and modexact_1 have been nailified.
11806
11807         * mpz/inp_str.c (mpz_inp_str_nowhite): Use ASSERT_ALWAYS for EOF value
11808         requirement.
11809
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
11819         initializers.
11820         * tests/devel/try.c (mpn_divexact_by3_fun, mpn_modexact_1_odd_fun):
11821         Correction to return values.
11822
11823         * doc/gmp.texi (Miscellaneous Integer Functions): Note mpz_sizeinbase
11824         can be used to locate the most significant bit.  Reword a bit for
11825         clarity.
11826
11827 2003-12-12  Niels Möller  <niels@lysator.liu.se>
11828
11829         * mpn/generic/hgcd.c (__gmpn_hgcd_sanity): Fixed stack buffer
11830         overrun.
11831         * mpn/generic/hgcd.c: Improved comments.
11832
11833 2003-12-11  Torbjorn Granlund  <tege@swox.com>
11834
11835         * gmp-impl.h: Change asm => __asm__, tabify.
11836         * mpz/get_d_2exp.c: Likewise.
11837         * mpf/get_d_2exp.c: Likewise.
11838
11839         * tests/cxx/t-ops.cc: #if .. #endif out tests that cause ambiguities.
11840
11841 2003-12-10  Torbjorn Granlund  <tege@swox.com>
11842
11843         * tests/mpz/t-gcd.c: Generate operands with sizes as a geometric
11844         progression, to allow for larger operands and less varying timing.
11845
11846         * tune/tuneup.c (tune_gcd_schoenhage): Set param.step_factor.
11847         (tune_hgcd): Likewise.
11848
11849 2003-12-10  Kevin Ryde  <kevin@swox.se>
11850
11851         * demos/perl/test.pl: Should be $] for perl version in old perl.
11852
11853         * configure.in (sparc64-*-*): Single block of gcc configs for all
11854         systems, on unknown systems try both ABI 32 and 64.
11855
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.
11859
11860         * mpn/generic/gcd.c: Use ABOVE_THRESHOLD / BELOW_THRESHOLD, to follow
11861         convention and cooperate with tune/tuneup.c.
11862
11863         * tune/tuneup.c (tune_gcd_schoenhage): Increase max_size to 3000, side
11864         default 1000 is approx the crossover point on athlon.
11865
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
11871         extraction.
11872
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
11876         mpfr_cmp_d.
11877         * tests/cxx/t-ops.cc: Exercise this.
11878
11879         * demos/perl/Makefile.PL: Don't install sample.pl and test2.pl.
11880
11881         * demos/perl/GMP.xs (use_sv): Prefer PV over IV or NV to avoid any
11882         rounding.
11883         * demos/perl/test.pl: Exercise this.
11884
11885         * demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage.
11886         * demos/perl/test.pl: Exercise this.
11887
11888 2003-12-08  Kevin Ryde  <kevin@swox.se>
11889
11890         * demos/perl/GMP.pm: Correction to canonicalize example.
11891
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.
11896
11897         * demos/perl/test.pl: Exercise magic, rearrange to make it clearer
11898         what's being tested.
11899
11900 2003-12-07  Kevin Ryde  <kevin@swox.se>
11901
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.
11905
11906         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Use intended
11907         align_xp, align_yp.
11908
11909         * tune/tuneup.c (mul_toom3_threshold): Use MUL_TOOM3_THRESHOLD_LIMIT,
11910         for the benefit of ASSERT in mpn_mul_n.
11911
11912         * tune/tuneup.c (tune_mul): Correction to toom3 param.min_size, should
11913         use MPN_TOOM3_MUL_N_MINSIZE.
11914
11915         * tune/speed.c (check_align_option): Correction to printf format.
11916         * tune/freq.c (freq_sysctl_hw_model): Remove unused "i" variable.
11917
11918         * scanf/doscan.c: Correction to a couple of trace printfs.
11919         Add <stdlib.h> for strtol.
11920
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.
11924
11925 2003-12-06  Torbjorn Granlund  <tege@swox.com>
11926
11927         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
11928         Move SPEED_TMP_ALLOC_LIMBS invocations out from calls.
11929
11930         * mpn/generic/get_str.c (mpn_get_str, POW2_P case):
11931         Don't append extra '\0' byte.
11932
11933 2003-12-05  Niels Möller  <niels@lysator.liu.se>
11934
11935         * tune/common.c (speed_mpn_hgcd_lehmer, speed_mpn_hgcd):
11936         Updated for the renaming hgcd_sanity -> ASSERT_HGCD.
11937
11938         * mpn/generic/gcd.c (gcd_schoenhage): TMP_DECL must be the final
11939         declaration in the declaration section of a block.
11940
11941         * tune/speed.h (mpn_gcd_accel): Added prototype.
11942
11943 2003-12-05  Torbjorn Granlund  <tege@swox.com>
11944
11945         * randmt.c (__gmp_mt_recalc_buffer): Put parens around "&" expressions
11946         inside "!=".
11947
11948         * mpf/get_str.c: Remove unused variable "fracn".
11949
11950 2003-12-03  Kevin Ryde  <kevin@swox.se>
11951
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
11955         DLL with MS C.
11956
11957         * mpz/export.c: Allow NULL for countp.
11958         * doc/gmp.texi (Integer Import and Export): Describe this.
11959         Suggested by Jack Lloyd.
11960
11961         * mpn/x86/p6/aors_n.asm: New file, grabbing the K7 code.
11962         Superiority of this reported by Patrick Pelissier.
11963
11964 2003-11-30  Kevin Ryde  <kevin@swox.se>
11965
11966         * mpn/alpha/ev67/popcount.asm, mpn/alpha/ev67/hamdist.asm: New files.
11967
11968         * mpn/alpha/ev67: New directory.
11969         * configure.in (alphaev67, alphaev68, alphaev7*): Use it.
11970
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
11974         and GMPpxreftop.
11975         (Debugging): Remove debauch, seems to have disappeared.
11976         (Language Bindings): Corrections to URLs for CLN, Omni F77, Pike.
11977
11978 2003-11-29  Kevin Ryde  <kevin@swox.se>
11979
11980         * demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
11981         about $#.
11982
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.
11985
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.
11989
11990         * configure.in: Introduce ${cc}_cflags_maybe, used if they work.
11991         (*sparc*-*-*) [ABI=32]: Add gcc_cflags_maybe=-m32 to force that mode.
11992
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.
11996
11997 2003-11-28  Niels Möller  <nisse@lysator.liu.se>
11998
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.
12002
12003         * mpn/generic/gcd.c, mpn/generic/hgcd.c, mpn/generic/hgcd2.c
12004         [GMP_NAIL_BITS]: Disabled new code if we have nails.
12005
12006         * mpn/generic/gcd.c (MPN_LEQ_P): Copied macro definition (needed
12007         for compilation with --enable-assert).
12008
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.
12013
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
12017         mpn_gcd _accel.
12018         * tune/speed.h: Added corresponding prototypes.
12019
12020         * tune/gcd_accel.c: New file.
12021
12022         * tune/gcd_bin.c (GCD_SCHOENHAGE_THRESHOLD): Set to MP_SIZE_T_MAX.
12023
12024         * tune/Makefile.am (libspeed_la_SOURCES): Added gcd_accel.c.
12025         (TUNE_MPN_SRCS_BASIC): Added hgcd.c.
12026
12027         * mpn/x86/k7/gmp-mparam.h (HGCD_SCHOENHAGE_THRESHOLD)
12028         (GCD_SCHOENHAGE_THRESHOLD): Tuned values.
12029
12030         * mpn/generic/gcd.c (mpn_gcd, gcd_binary_odd): Renamed the
12031         old mpn_gcd function (which implements accelerated binary gcd) to
12032         gcd_binary_odd.
12033         (gcd_binary): New function, with the additional book keeping
12034         needed when using gcd_binary_odd to compute the gcd of non-odd
12035         numbers.
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
12043         the input.
12044
12045         * mpn/generic/hgcd.c (mpn_hgcd2_lehmer_step): Renamed function
12046         (was lehmer_step), and made non-static. Updated callers.
12047
12048         * gmp-impl.h (GCD_LEHMER_THRESHOLD): #if:ed out this macro.
12049         (mpn_hgcd2_lehmer_step): Added prototype.
12050
12051 2003-11-27  Niels Möller  <nisse@lysator.liu.se>
12052
12053         * tests/mpz/t-gcd.c (gcd_values): Moved definition, so that we
12054         don't need to forward declare the array.
12055
12056 2003-11-26  Niels Möller  <nisse@lysator.liu.se>
12057
12058         * mpn/generic/hgcd.c (mpn_hgcd2_fix): Deleted duplicate definition
12059         (the function belongs to hgcd2.c).
12060
12061 2003-11-26  Torbjorn Granlund  <tege@swox.com>
12062
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.
12066
12067 2003-11-26  Niels Möller  <niels@lysator.liu.se>
12068
12069         * gmp-impl.h: Added name mangling for hgcd-related functions. Also
12070         use __GMP_PROTO.
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.
12074
12075         * tests/mpz/t-gcd.c (main): Added some tests with non-random
12076         input.
12077
12078 2003-11-25  Niels Möller  <nisse@lysator.liu.se>
12079
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.
12084
12085         * configure.in (gmp_mpn_functions): Added hgcd2, hgcd and qstack.
12086
12087         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added hgcd2.c,
12088         hgcd.c and qstack.c.
12089
12090         * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
12091         New files, needed for the sub-quadratic gcd.
12092
12093 2003-11-25  Kevin Ryde  <kevin@swox.se>
12094
12095         * doc/gmp.texi (Language Bindings): Add Axiom.
12096
12097 2003-11-22  Kevin Ryde  <kevin@swox.se>
12098
12099         * mpn/alpha/README: More notes on assembler syntax variations.
12100
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
12103         everywhere.
12104
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.
12108
12109         * mpn/alpha/alpha-defs.m4: New file.
12110         * configure.in (alpha*-*-*): Use it.
12111
12112 2003-11-21  Kevin Ryde  <kevin@swox.se>
12113
12114         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-21.
12115
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".
12119
12120 2003-11-19  Torbjorn Granlund  <tege@swox.com>
12121
12122         * mpn/alpha/aorslsh1_n.asm: Slightly rework feed-in code, avoiding
12123         spurious reads beyond operand limits.
12124
12125         * mpn/alpha/ev5/com_n.asm: Add ASM_START/ASM_END.
12126
12127         * mpn/generic/mul_fft.c (mpn_fft_zero_p): Remove unused function.
12128         (mpn_lshift_com): Make static, nailify properly.
12129
12130 2003-11-19  Kevin Ryde  <kevin@swox.se>
12131
12132         * mpn/generic/diveby3.c: Use a "q" variable to make it clearer what
12133         the code is doing.
12134
12135         * mpn/powerpc32/750/lshift.asm, mpn/powerpc32/750/rshift.asm: New
12136         files.
12137
12138         * mpn/alpha/ev5/com_n.asm: New file.
12139
12140         * doc/gmp.texi (Assembler Functional Units, Assembler Writing Guide):
12141         New sections by Torbjorn, tweaked by me.
12142
12143 2003-11-17  Torbjorn Granlund  <tege@swox.com>
12144
12145         * mpn/powerpc32: Add power4/powerpc970 cycle counts.
12146         Use cmpwi instead of cmpi to placate darwin.
12147
12148 2003-11-15  Kevin Ryde  <kevin@swox.se>
12149
12150         * config.guess: Add comments on MacOS "machine" command.
12151
12152         * tests/devel/try.c (main): Use gmp_randinit_default explicitly on
12153         __gmp_rands, since RANDS doesn't allow seeding.
12154
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.
12159
12160         * mpn/generic/mul_n.c (toom3_interpolate, mpn_toom3_mul_n): Put
12161         if/else braces around whole of #if code, for readability.
12162
12163         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
12164         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps
12165         etc.
12166
12167         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-15.
12168
12169 2003-11-14  Torbjorn Granlund  <tege@swox.com>
12170
12171         * mpn/alpha/aorslsh1_n.asm: Use Cray-friendly syntax for "br".
12172
12173 2003-11-13  Torbjorn Granlund  <tege@swox.com>
12174
12175         * mpn/alpha/aorslsh1_n.asm: New file.
12176
12177 2003-11-12  Kevin Ryde  <kevin@swox.se>
12178
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.
12182
12183         * tune/speed.c (main): Use gmp_randinit_default explicitly on
12184         __gmp_rands, since RANDS doesn't allow seeding.
12185
12186         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-12.
12187
12188         * gmp-impl.h, randmt.h (__gmp_randinit_mt_noseed): Move prototype to
12189         gmp-impl.h, for use by RANDS.
12190
12191         * mpn/Makeasm.am (.s, .S, .asm): Quote $< in test -f, per automake.
12192         (.obj): Use test -f and $(CYGPATH_W) as per automake.
12193
12194 2003-11-11  Kevin Ryde  <kevin@swox.se>
12195
12196         * configure.in: Make umul and udiv standard-optional objects, rather
12197         than under various extra_functions.
12198
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.
12205
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
12208         the given string.
12209
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.
12216
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.
12220
12221         * mpn/ia64/ia64-defs.m4 (ALIGN): New define, using IA64_ALIGN_OK.
12222         * mpn/ia64/hamdist.asm: Use ALIGN instead of .align.
12223
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.
12227
12228 2003-11-10  Torbjorn Granlund  <tege@swox.com>
12229
12230         * mpn/ia64/mul_1.asm: Rewrite.
12231
12232 2003-11-08  Torbjorn Granlund  <tege@swox.com>
12233
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.
12237
12238 2003-11-07  Kevin Ryde  <kevin@swox.se>
12239
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.
12243
12244         * doc/gmp.texi (Notes for Package Builds): Add notes on multi-ABI
12245         system packaging.
12246         (ABI and ISA): Add GNU/Linux ABI=64.
12247         (Binary GCD): Add notes on 1x1 GCD algorithms.
12248
12249         * mpn/alpha/README: Add some literature references.
12250
12251         * mpn/ia64/mode1o.asm: Various corrections to initial checkin.
12252         * mpn/ia64/ia64-defs.m4 (ASSERT): Correction to arg quoting.
12253
12254 2003-11-05  Torbjorn Granlund  <tege@swox.com>
12255
12256         * mpn/powerpc64/linux64.m4: New file.
12257         * configure.in (POWERPC64_PATTERN): Handle *-*-linux*.
12258         Use linux64.m4.
12259
12260         * mpn/ia64/logops_n.asm: New file.
12261
12262 2003-11-05  Kevin Ryde  <kevin@swox.se>
12263
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.
12266
12267         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-05.
12268
12269         * mpn/alpha/ev5/dive_1.c: New file.
12270
12271         * configure.in (x86_64-*-*): Accept together with amd64-*-*.
12272
12273         * tune/speed.c: Check range of -x,-y,-w,-W alignment specifiers.
12274         * tune/speed.h (CACHE_LINE_SIZE): Amend comments.
12275
12276 2003-11-04  Torbjorn Granlund  <tege@swox.com>
12277
12278         * tune/speed.c: Fix typo in testing HAVE_NATIVE_mpn_modexact_1_odd.
12279
12280 2003-11-03  Kevin Ryde  <kevin@swox.se>
12281
12282         * mpn/ia64/hamdist.asm: New file.
12283         * mpn/ia64/mode1o.asm: New file.
12284         * mpn/ia64/ia64-defs.m4 (ASSERT): New macro.
12285
12286         * tests/mpz/t-set_d.c (check_2n_plus_1): New test.
12287
12288 2003-11-01  Kevin Ryde  <kevin@swox.se>
12289
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
12293         BITREV_ULONG.
12294         Fix by Jason Moxham.
12295
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.
12299
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.
12302
12303         * mpn/generic/diveby3.c: Show a better style carry handling in the
12304         alternative pipelined sample code.
12305
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
12309         when bad.
12310
12311 2003-10-31  Torbjorn Granlund  <tege@swox.com>
12312
12313         * mpn/powerpc64/mode64/submul_1.asm: Move an instruction to save a
12314         cycle on POWER4.
12315
12316         * mpn/powerpc64/mode64/divrem_1.asm: Fix several syntax problems
12317         revealed on Mac OS X.
12318
12319         * mpn/powerpc64/mode64/*.asm: Add cycle counts for POWER4.
12320
12321         * mpn/powerpc64/sqr_diagonal.asm: Rewrite to save a cycle on POWER4.
12322
12323 2003-10-31  Kevin Ryde  <kevin@swox.se>
12324
12325         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-31.
12326
12327         * mpn/powerpc64/README: Add subdirectory organisation notes.
12328
12329         * tests/mpn/t-get_d.c: Don't use limits.h, LONG_MIN is wrong on gcc
12330         2.95 with -mcpu=ultrasparc.
12331
12332         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
12333         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
12334         when bad.
12335
12336         * configure.in (powerpc64-*-darwin*) [ABI=mode32]: Use gcc -mcpu flags.
12337
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.
12340
12341         * mpn/ia64/ia64-defs.m4: Renamed from default.m4, per other defs files.
12342         * configure.in (IA64_PATTERN): Update GMP_INCLUDE_MPN.
12343
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.
12348
12349 2003-10-29  Kevin Ryde  <kevin@swox.se>
12350
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.
12354
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.
12357
12358         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-29.
12359
12360         * tests/cxx/t-istream.cc: Avoid tellg() checks if putback() doesn't
12361         update that, avoids certain g++ 2.96 problems.
12362
12363         * tests/mpn/t-fat.c: New file.
12364         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
12365
12366         * configure.in (CPUVEC_INSTALL, ITERATE_FAT_THRESHOLDS): New macros
12367         for fat.h.
12368         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Use CPUVEC_INSTALL instead
12369         of memcpy.  Correction to location of "initialized" set.  Improve
12370         various comments.
12371
12372 2003-10-27  Torbjorn Granlund  <tege@swox.com>
12373
12374         * mpn/sparc64/mul_1.asm: Change addcc => add in a few places.
12375         * mpn/sparc64/addmul_1.asm: Likewise.
12376
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.
12381
12382 2003-10-27  Kevin Ryde  <kevin@swox.se>
12383
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.
12386
12387         * tests/cxx/t-istream.cc: Correction to tellg tests, don't assume
12388         streampos is zero based.
12389
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.
12393
12394         * mpn/x86/README: Revise PIC coding notes a bit, add gcc visibility
12395         attribute.
12396
12397 2003-10-25  Kevin Ryde  <kevin@swox.se>
12398
12399         * mpn/ia64/gcd_1.asm: New file.
12400
12401         * tune/many.pl: Allow for PROLOGUE(fun,...), as used on alpha.
12402
12403         * doc/gmp.texi (C++ Formatted Input): Describe base indicator handling.
12404
12405         * tests/cxx/t-istream.cc: New file.
12406         * tests/cxx/Makefile.am: Add it.
12407
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.
12415
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.
12418
12419         * mpn/m68k/lshift.asm, mpn/m68k/rshift.asm: Support 16-bit int and
12420         stack alignment.
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.
12425
12426         * mpn/m68k/t-m68k-defs.pl: Don't use -> with hashes, to avoid
12427         deprecation warnings from perl 5.8.
12428
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.
12431
12432         * Makefile.am: Amend comments about not building from libtool
12433         convenience libraries.
12434
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.
12438
12439         * Makefile.am (CXX_OBJECTS): Remove $U, C++ files are not subject to
12440         ansi2knr rules.
12441
12442         * gmp-h.in (mpn_divmod_1): Use __GMP_CAST, to avoid warnings in
12443         applications using g++ -Wold-style-cast.
12444
12445         * mpn/z8000/README: New file.
12446
12447 2003-10-22  Kevin Ryde  <kevin@swox.se>
12448
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.
12452
12453         * configure.in (powerpc64-*-darwin*): Make ABI=32 available as the
12454         final fallback, remove mode64 until we know how it will work.
12455
12456         * doc/gmp.texi (Build Options): Add powerpc970 to available CPUs.
12457         (ABI and ISA): Add mode32 for Darwin.
12458
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
12461         HP-UX.
12462
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".
12466
12467         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-22.
12468
12469         * doc/gmp.texi (Notes for Particular Systems): Note m68k gcc -mshort
12470         and PalmOS calling conventions not supported.  Reported by Patrick
12471         Pelissier.
12472         (References): Add Paul Zimmermann's Inria 4475 paper.
12473
12474 2003-10-21  Torbjorn Granlund  <tege@swox.com>
12475
12476         * mpn/ia64/submul_1.asm: Slightly reschedule loop to accommodate
12477         Itanium 2 getf.sig latency.
12478
12479 2003-10-21  Kevin Ryde  <kevin@swox.se>
12480
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
12483         conditional.
12484
12485 2003-10-20  Torbjorn Granlund  <tege@swox.com>
12486
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.
12492
12493 2003-10-19  Torbjorn Granlund  <tege@swox.com>
12494
12495         * longlong.h (AMD64): __x86_64__ => __amd64__.
12496         (64-bit powerpc): Only define carry-dependent macros if
12497         !_LONG_LONG_LIMB.
12498
12499         * acinclude.m4 (POWERPC64_PATTERN): Add powerpc970-*-*.
12500
12501         * configure.in (POWERPC64_PATTERN): Handle *-*-darwin*.
12502         (POWERPC64_PATTERN, *-*-aix*): Prepend powerpc64/mode64 to path_aix64.
12503
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.
12508
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.
12521
12522         * mpn/powerpc64/lshift.asm: Handle mode32 ABI.
12523         * mpn/powerpc64/rshift.asm: Likewise.
12524         * mpn/powerpc64/umul.asm: Likewise.
12525
12526         * tune/powerpc64.asm: Make it actually work.
12527
12528 2003-10-19  Kevin Ryde  <kevin@swox.se>
12529
12530         * mpn/generic/get_d.c: Add a workaround for alpha gcc signed constant
12531         comparison bug.
12532
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.
12536
12537         * mpn/x86/pentium4/sse2/addlsh1_n.asm: New file, derived in part from
12538         mpn/x86/pentium4/sse2/add_n.asm.
12539
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.
12545
12546 2003-10-18  Kevin Ryde  <kevin@swox.se>
12547
12548         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-18.
12549
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.
12554
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.
12560
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.
12564
12565         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
12566         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
12567
12568         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use octal for character
12569         constants, hex is an ANSI-ism.
12570
12571         * mpn/alpha/ev5/mode1o.c: Corrections to ASSERTs, as per
12572         mpn/generic/mode1o.c.
12573
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.
12577
12578         * configure.in (powerpc970-*-*): Use gcc -mcpu=970 when available.
12579         (powerpc7400-*-*): Fallback on gcc -mcpu=750 if -mcpu=7400 not
12580         available.
12581
12582         * doc/gmp.texi (C++ Formatted Input): Note locale digit grouping not
12583         supported.
12584         (C++ Formatted Input, C++ Formatted Output): Cross reference class
12585         interface on overloading.
12586
12587         * mpn/m68k/README: Add various ideas from doc/tasks.html.
12588
12589         * mpn/m88k/README: New file.
12590
12591 2003-10-16  Torbjorn Granlund  <tege@swox.com>
12592
12593         * config.sub: Recognize powerpc970.
12594
12595 2003-10-15  Torbjorn Granlund  <tege@swox.com>
12596
12597         * config.guess: Recognize powerpc970 under MacOS.
12598
12599 2003-10-15  Kevin Ryde  <kevin@swox.se>
12600
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.
12604
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).
12608
12609         * mpfr/*: Update to mpfr cvs 2003-10-15.
12610
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.
12615
12616         * gmp-h.in (__mpz_struct): Add comment on __mpz_struct getting into
12617         C++ mangled function names.
12618
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.
12622
12623         * doc/configuration (Configure): mdate-sh now in doc subdir, add
12624         generated fat.h.
12625
12626 2003-10-14  Torbjorn Granlund  <tege@swox.com>
12627
12628         * mpn/ia64/lorrshift.asm: Rewrite.
12629
12630         * mpn/ia64/diveby3.asm: Remove explicit bundling; add branch hints.
12631
12632 2003-10-13  Torbjorn Granlund  <tege@swox.com>
12633
12634         * mpn/ia64/diveby3.asm: New file.
12635
12636 2003-10-13  Kevin Ryde  <kevin@swox.se>
12637
12638         * mpn/powerpc32/mod_34lsub1.asm: New file.
12639
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.
12643
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.
12647
12648         * doc/gmp.texi, doc/fdl.texi, doc/texinfo.tex, doc/mdate-sh: Moved
12649         from top-level.
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.
12657
12658         * mpz/and.c: For positive/positive, use mpn_and_n, rate a realloc as
12659         UNLIKELY.
12660
12661         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Don't test
12662         for high zero limbs.
12663
12664 2003-10-12  Torbjorn Granlund  <tege@swox.com>
12665
12666         * mpn/powerpc64/diveby3.asm: New file (trivial edits of
12667         powerpc32/diveby3.asm).
12668
12669         * mpn/powerpc32/diveby3.asm: Update cycle counts with more processors.
12670         * mpn/powerpc32/sqr_diagonal.asm: Likewise.
12671
12672         * mpn/pa64/add_n.asm: Correct PA8500 cycle counts.
12673         * mpn/pa64/sub_n.asm: Likewise.
12674
12675         * mpn/m68k/aors_n.asm (INPUT PARAMETERS): Fix typo.
12676         * mpn/m68k/lshift.asm: Likewise.
12677         * mpn/m68k/rshift.asm: Likewise.
12678
12679         * mpn/m68k/README: Correct an URL; add some STATUS comments.
12680
12681         * mpn/ia64/aorslsh1_n.asm: Avoid shrp when shl/shr works just as well.
12682
12683         * mpn/powerpc32/addlsh1_n.asm: New file.
12684         * mpn/powerpc32/sublsh1_n.asm: New file.
12685
12686 2003-10-12  Kevin Ryde  <kevin@swox.se>
12687
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.
12691
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.
12694
12695         * mpn/powerpc32/diveby3.asm: New file.
12696
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.
12700
12701         * Makefile.am (install-data-hook): Print a warning recommending "make
12702         check" to watch out for compiler bugs.  Proposed by Torbjorn.
12703
12704         * mpn/ia64/README (mpn_lshift, mpn_rshift): Amend prospective itanium2
12705         speed, 0.75 c/l with shrp plus shl/shr.
12706
12707         * mpn/ia64/popcount.asm: Add comment on optimality.
12708
12709 2003-10-11  Torbjorn Granlund  <tege@swox.com>
12710
12711         * mpn/ia64/rsh1aors_n.asm: New file.
12712
12713         * mpn/asm-defs.m4: Handle rsh1aors_n.
12714
12715         * configure.in (tmp_mulfunc): Handle rsh1aors_n.
12716
12717 2003-10-11  Kevin Ryde  <kevin@swox.se>
12718
12719         * mpn/x86/pentium4/sse2/diveby3.asm: Remove non-PIC RODATA memory
12720         access for 0xAAAAAAAB constant.
12721
12722         * gmp-impl.h (popc_limb, ULONG_PARITY) [ev67, ev68]: Add gcc asm
12723         versions using ctpop.
12724
12725         * mpn/x86/k6/aorsmul_1.asm: Tweak some comments, remove M4_description
12726         and M4_desc_retval used only in comments.
12727
12728         * mpn/x86/k6/mul_basecase.asm: Add comment on using mpn_mul_1.
12729
12730 2003-10-09  Torbjorn Granlund  <tege@swox.com>
12731
12732         * mpn/powerpc64/addlsh1_n.asm: Tweak for 0.25 c/l better loop speed.
12733         * mpn/powerpc64/sublsh1_n.asm: Likewise.
12734
12735 2003-10-09  Kevin Ryde  <kevin@swox.se>
12736
12737         * mpfr/*: Update to mpfr cvs 2003-10-09.
12738
12739         * tests/devel/try.c (_SC_PAGESIZE): Define from _SC_PAGE_SIZE on
12740         systems which use that, eg. hpux 9.
12741
12742 2003-10-07  Kevin Ryde  <kevin@swox.se>
12743
12744         * tune/freq.c (freq_sysctl_hw_model): Correction to last sscanf change.
12745
12746         * configure.in: Check for psp_iticksperclktick in struct pst_processor.
12747         * tune/freq.c (freq_pstat_getprocessor): Use this.
12748
12749         * tests/devel/try.c (divisor_array): Add a couple of half-limb values.
12750
12751         * acinclude.m4 (GMP_PROG_CC_WORKS): Correction to last change, need to
12752         set result "yes" when cross compiling.
12753
12754 2003-10-06  Torbjorn Granlund  <tege@swox.com>
12755
12756         * mpn/generic/mul_n.c: Use __GMPN_ADD_1/_GMPN_SUB_1 instead of
12757         mpn_add_1 and mpn_sub_1.
12758
12759         * mpn/pa64/aorslsh1_n.asm: Schedule register save and restore code.
12760
12761 2003-10-05  Torbjorn Granlund  <tege@swox.com>
12762
12763         * mpn/pa64/mul_1.asm: Misc comment cleanups.
12764         * mpn/pa64/addmul_1.asm: Likewise.
12765         * mpn/pa64/submul_1.asm: Likewise.
12766
12767         * mpn/pa64/README: Correct cycle counts.
12768
12769         * mpn/pa64/aorslsh1_n.asm: New file.
12770
12771 2003-10-04  Kevin Ryde  <kevin@swox.se>
12772
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
12777         for the frequency.
12778
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.
12782
12783         * configure.in (viac3*-*-*): Add gcc VIA c3 options.
12784
12785         * mpfr/*: Update to mpfr cvs 2003-10-04.
12786
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.
12791
12792         * tests/devel/try.c, tune/many.pl: Add mpn_addlsh1_n, mpn_sublsh1_n,
12793         mpn_rsh1add_n, mpn_rsh1sub_n.
12794
12795 2003-10-03  Torbjorn Granlund  <tege@swox.com>
12796
12797         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
12798         refmpn_rsh1sub_n): New functions.
12799
12800 2003-10-03  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
12801
12802         * mpn/generic/mul_n.c (toom3_interpolate): Use mpn_add_1/mpn_sub_1
12803         instead of MPN_INCR_/MPN_DECR_U.
12804
12805 2003-10-02  Torbjorn Granlund  <tege@swox.com>
12806
12807         * configure.in (ia64*-*-hpux*): Fall back to +O1, not +O.
12808
12809 2003-10-02  Kevin Ryde  <kevin@swox.se>
12810
12811         * configure.in (ia64*-*-hpux*): For cc, let +O optimization level
12812         fallback if +O3 doesn't work.
12813
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.
12817
12818 2003-10-01  Torbjorn Granlund  <tege@swox.com>
12819
12820         * mpn/ia64/gmp-mparam.h: Retune.
12821
12822         * mpn/asm-defs.m4: Handle aorslsh1_n.
12823
12824         * configure.in (tmp_mulfunc): Handle aorslsh1_n.
12825
12826         * mpn/ia64/aorslsh1_n.asm: New file.
12827
12828         * mpn/ia64/aors_n.asm: New file, complete rewrite of mpn_add_n and
12829         mpn_sub_n.
12830         * mpn/ia64/add_n.asm: Replace by aors_n.asm.
12831         * mpn/ia64/sub_n.asm: Replace by aors_n.asm.
12832
12833 2003-10-01  Kevin Ryde  <kevin@swox.se>
12834
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.
12838
12839         * demos/calc/Makefile.am: Use automake yacc/lex support, seems fine in
12840         separate objdir now.
12841
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.
12845
12846 2003-09-30  Torbjorn Granlund  <tege@swox.com>
12847
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
12852         100000 digits.
12853
12854 2003-09-28  Torbjorn Granlund  <tege@swox.com>
12855
12856         * mpn/*/*.asm: Clean up spacing, tabify.
12857
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.
12864
12865         * mpn/ia64/lorrshift.asm: Amend comments about performance.
12866
12867         * mpn/pa64/mul_1.asm: Fix comment typo.
12868         * mpn/pa64/addmul_1.asm: Likewise.
12869         * mpn/pa64/submul_1.asm: Likewise.
12870
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.
12874
12875         * mpn/amd64/rsh1add_n.asm: Add remarks about possible further speedup.
12876         * mpn/amd64/rsh1sub_n.asm: Likewise.
12877
12878 2003-09-27  Torbjorn Granlund  <tege@swox.com>
12879
12880         * mpn/powerpc64/README: Update with POWER4/PPC970 pipeline info.
12881
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.
12886
12887 2003-09-26  Torbjorn Granlund  <tege@swox.com>
12888
12889         * mpn/powerpc64/addlsh1_n.asm: New file.
12890         * mpn/powerpc64/sublsh1_n.asm: New file.
12891
12892 2003-09-25  Torbjorn Granlund  <tege@swox.com>
12893
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_*.
12897
12898 2003-09-25  Kevin Ryde  <kevin@swox.se>
12899
12900         * mpz/combit.c: Use GMP_NUMB_BITS not BITS_PER_MP_LIMB.
12901
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.
12904
12905         * demos/expr/exprfr.c, demos/expr/t-expr.c: Add erf, integer_p, zeta.
12906
12907         * demos/expr/Makefile.am (LDADD): Update comments on $(LIBM).
12908
12909 2003-09-24  Torbjorn Granlund  <tege@swox.com>
12910
12911         * tune/speed.c (routine): Add entires for mpn_addlsh1_n, mpn_sublsh1_n,
12912         mpn_rsh1add_n, and mpn_rsh1sub_n.
12913
12914         * tune/speed.h: Declare speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
12915         speed_mpn_rsh1add_n, and speed_mpn_rsh1sub_n.
12916
12917         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
12918         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): New functions.
12919
12920         * gmp-impl.h: Declare mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsh1add_n, and
12921         mpn_rsh1sub_n.
12922
12923         * mpn/asm-defs.m4: Add define_mpn's for addlsh1_n, sublsh1_n,
12924         rsh1add_n, and rsh1sub_n.
12925
12926         * mpn/powerpc64/*.asm: Add cycle counts in consistent style.  Misc
12927         styling edits.
12928
12929         * mpn/amd64/gmp-mparam.h: Retune.
12930
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,
12935         and rsh1sub_n.
12936
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.
12941
12942 2003-09-24  Kevin Ryde  <kevin@swox.se>
12943
12944         * mpfr/*: Update to mpfr cvs 2003-09-24.
12945
12946         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Remove conftest* temporary files.
12947
12948 2003-09-23  Torbjorn Granlund  <tege@swox.com>
12949
12950         * gmp-impl.h (MUL_TOOM3_THRESHOLD, SQR_TOOM3_THRESHOLD): Now 128.
12951
12952 2003-09-23  Kevin Ryde  <kevin@swox.se>
12953
12954         * gmp-h.in (gmp_randinit_set): Use __gmp_const rather than const.
12955
12956 2003-09-22  Torbjorn Granlund  <tege@swox.com>
12957
12958         * tune/mul_n_mpn.c: (__gmpn_sqr_n): New #define.
12959         * tune/mul_n_open.c (__gmpn_sqr_n): New #define.
12960
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.
12965
12966         * mpn/generic/mul_n.c: Add a missing ";". Misc comment fixes.
12967
12968         * mpn/generic/mul.c: Remove spurious #include <stdio.h>.
12969
12970         * mpn/x86/k7/gmp-mparam.h: Retune.
12971
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.
12974
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.
12978
12979         * mpn/amd64/gmp-mparam.h: Retune.
12980
12981         * mpn/Makefile.am (TARG_DIST): Add amd64.
12982
12983         * mpn/generic/sqr_basecase.c: Use mpn_addlsh1_n when available.
12984
12985         * mpn/generic/mul_n.c: Use proper form for HAVE_NATIVE macros.
12986
12987 2003-09-22  Kevin Ryde  <kevin@swox.se>
12988
12989         * mpfr/*: Update to mpfr cvs 2003-09-22.
12990
12991 2003-09-21  Kevin Ryde  <kevin@swox.se>
12992
12993         * mpn/x86/pentium4/sse2/gmp-mparam.h (USE_PREINV_DIVREM_1,
12994         USE_PREINV_MOD_1): Set to 1 for new asm versions.
12995
12996         * mpfr/*: Update to mpfr cvs 2003-09-21.
12997
12998 2003-09-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
12999
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
13003         workspace.
13004
13005         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Accomodate
13006         latest toom3 code.
13007
13008 2003-09-19  Kevin Ryde  <kevin@swox.se>
13009
13010         * mpn/x86/pentium4/sse2/divrem_1.asm, mpn/x86/pentium4/sse2/mod_1.asm:
13011         New files.
13012
13013 2003-09-16  Kevin Ryde  <kevin@swox.se>
13014
13015         * tune/speed.c (run_one): Don't scale the -1.0 not-available return.
13016         Print "n/a" for times not-available.
13017
13018 2003-09-13  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
13019
13020         * mpn/generic/mul_n.c (toom3_interpolate): New function.
13021         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Call toom3_interpolate.
13022
13023 2003-09-12  Torbjorn Granlund  <tege@swox.com>
13024
13025         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove unused
13026         variables.
13027         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use offset `+ 1', not `+ 2' in last
13028         MPN_DECR_U calls.
13029
13030 2003-09-12  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
13031
13032         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Rewrite.
13033
13034 2003-09-12  Torbjorn Granlund  <tege@swox.com>
13035
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
13039         code requirements.
13040         * mpn/generic/mul_n.c (evaluate3, interpolate3, add2Times): Remove.
13041         (USE_MORE_MPN): Remove.
13042
13043 2003-08-31  Kevin Ryde  <kevin@swox.se>
13044
13045         * mpfr/*: Update to mpfr cvs 2003-08-31.
13046
13047 2003-08-30  Kevin Ryde  <kevin@swox.se>
13048
13049         * mpfr/*: Update to mpfr cvs 2003-08-30.
13050
13051 2003-08-29  Torbjorn Granlund  <tege@swox.com>
13052
13053         * mpn/amd64/copyi.asm: New file.
13054         * mpn/amd64/copyd.asm: New file.
13055         * mpn/amd64/README: New file.
13056
13057 2003-08-28  Torbjorn Granlund  <tege@swox.com>
13058
13059         * mpn/amd64/lshift.asm: New file.
13060         * mpn/amd64/rshift.asm: New file.
13061         * mpn/amd64/gmp-mparam.h: Retune.
13062
13063 2003-08-23  Kevin Ryde  <kevin@swox.se>
13064
13065         * tune/freq.c (freq_getsysinfo): Correction to speed_cycletime value
13066         established.
13067
13068         * mpz/rootrem.c, gmp-h.in, gmp.texi (mpz_rootrem): Don't return
13069         exactness indication, can get that from testing the remainder.
13070
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.
13073
13074 2003-08-22  Torbjorn Granlund  <tege@swox.com>
13075
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.
13081
13082 2003-08-19  Kevin Ryde  <kevin@swox.se>
13083
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.
13087
13088         * longlong.h (count_leading_zeros) [__mcpu32__]: Check __mcpu32__ to
13089         avoid bfffo on GCC 3.4 in CPU32 mode.  Reported by Bernardo Innocenti.
13090
13091         * longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force
13092         64-bit register destination.  Pointed out by Torbjorn.
13093
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.
13098
13099         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add
13100         get_d_2exp.
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.
13106
13107 2003-08-19  Torbjorn Granlund  <tege@swox.com>
13108
13109         * tune/Makefile.am (EXTRA_DIST): Add amd64.asm.
13110
13111 2003-08-17  Kevin Ryde  <kevin@swox.se>
13112
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.
13116
13117         * tests/cxx/t-constr.cc: Include config.h for WANT_MPFR.
13118
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.
13122
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.
13126
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
13130         tests.
13131
13132 2003-08-16  Torbjorn Granlund  <tege@swox.com>
13133
13134         * configure.in (amd64): New.
13135
13136         * mpn/amd64/gmp-mparam.h: New file.
13137
13138         * tune/amd64.asm: New file, derived in part from tune/pentium.asm.
13139
13140 2003-08-15  Kevin Ryde  <kevin@swox.se>
13141
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.
13144
13145 2003-08-14  Kevin Ryde  <kevin@swox.se>
13146
13147         * mpq/get_d.c: Use mpn_get_d.
13148         * tests/mpq/t-get_d.c (check_onebit): New test.
13149
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.
13164
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.
13169
13170 2003-08-03  Kevin Ryde  <kevin@swox.se>
13171
13172         * tune/tuneup.c (tune_mul): Use MUL_KARATSUBA_THRESHOLD_LIMIT.
13173
13174 2003-08-02  Kevin Ryde  <kevin@swox.se>
13175
13176         * mpn/asm-defs.m4: Tweak some comments, add hpux11 to m4wrap 0xFF
13177         problem systems.
13178
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.
13183
13184         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Remove, libtool no
13185         longer demands HOST_CC.
13186
13187         * configure.in: When C or C++ compiler not found, refer user to
13188         config.log.
13189
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:
13193         New files.
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
13199         binaries.
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.
13202
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.
13219
13220         * config.guess (alpha-*-*): Update comments on what configfsf.guess
13221         does and doesn't do for us.
13222
13223 2003-07-31  Kevin Ryde  <kevin@swox.se>
13224
13225         * config.guess: Remove $dummy.o files everywhere, in case vendor
13226         compilers produce that even when not asked.
13227
13228         * demos/perl/GMP.xs (class_or_croak): Rename "class" parameter to
13229         avoid C++ keyword.
13230         (coerce_ulong, coerce_long): Move croaks to stop g++ 3.3 complaining
13231         about uninitialized variables.
13232
13233         * demos/perl/INSTALL: Add notes on building with a DLL.
13234
13235         * longlong.h (count_trailing_zeros) [x86_64]: Ensure bsfq destination
13236         is a 64-bit register.  Diagnosed by Francois G. Dorais.
13237
13238 2003-07-31  Torbjorn Granlund  <tege@swox.com>
13239
13240         * longlong.h [ppc]: Remove nested test for vxworks.
13241
13242 2003-07-24  Kevin Ryde  <kevin@swox.se>
13243
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.
13247
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.
13251
13252         * gmpxx.h (struct __gmp_hypot_function): Use mpfr_hypot.
13253         * tests/cxx/t-misc.cc (check_mpfr_hypot): New tests.
13254
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.
13258
13259         * tests/mpz/bit.c (check_single): Correction to a diagnostic print.
13260
13261 2003-07-24  Niels Möller  <nisse@lysator.liu.se>
13262
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.
13267
13268 2003-07-16  Kevin Ryde  <kevin@swox.se>
13269
13270         * mpn/generic/get_d.c: Correction to infinity handling for large exp.
13271
13272 2003-07-14  Kevin Ryde  <kevin@swox.se>
13273
13274         * mpz/get_d.c, mpz/get_d_2exp.c, mpf/get_d.c, mpf/get_d_2exp.c: Use
13275         mpn_get_d.
13276
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.
13280
13281         * tests/mpn/t-get_d.c: New file.
13282         * tests/mpn/Makefile.am: Add it.
13283
13284         * tests/mpz/t-get_d_2exp.c (check_onebit, check_round): Test negatives.
13285         (check_onebit): Add a few more bit sizes.
13286
13287         * tests/misc.c, tests/tests.h (tests_isinf): New function.
13288
13289 2003-07-12  Kevin Ryde  <kevin@swox.se>
13290
13291         * configure.in (GMP_PROG_CXX_WORKS): Include $CPPFLAGS, same as
13292         automake does in the actual build.
13293
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.
13297
13298 2003-07-08  Kevin Ryde  <kevin@swox.se>
13299
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
13303         compiled program.
13304
13305 2003-07-05  Kevin Ryde  <kevin@swox.se>
13306
13307         * config.sub: Add comments to our alias transformations.
13308
13309         * configfsf.sub, configfsf.guess: Update to 2003-07-04.
13310
13311         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_PROG_CC_WORKS_LONGLONG): Show
13312         failing program in config.log, per other autoconf tests.
13313
13314         * configure.in (i786-*-*): Recognise as pentium4, per configfsf.sub.
13315
13316 2003-06-28  Kevin Ryde  <kevin@swox.se>
13317
13318         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Avoid res==1.0 when floats round
13319         upwards.
13320
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
13326         functions.
13327         * tests/misc.c, tests/tests.h (tests_hardware_getround,
13328         tests_hardware_setround): New functions.
13329
13330 2003-06-25  Kevin Ryde  <kevin@swox.se>
13331
13332         * mpn/sparc64/dive_1.c: New file.
13333
13334         * mpn/sparc64/sparc64.h: New file.
13335         * mpn/sparc64/mode1o.c: Remove things now in sparc64.h.
13336
13337         * mpfr/*: Update to mpfr cvs 2003-06-25.
13338
13339         * acinclude.m4 (GMP_PROG_CC_WORKS): In last change provoking gnupro
13340         gcc, don't use ANSI style function definition.
13341
13342 2003-06-22  Kevin Ryde  <kevin@swox.se>
13343
13344         * mpn/pa32/hppa1_1/udiv.asm: Remove .proc, .entry, .exit and .procend,
13345         handled by PROLOGUE and EPILOGUE.  Comment out .callinfo, per other
13346         asm files.
13347
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.
13353
13354 2003-06-21  Kevin Ryde  <kevin@swox.se>
13355
13356         * mpfr/*: Update to mpfr cvs 2003-06-21.
13357
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
13361         this compiler.
13362
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.
13365
13366 2003-06-19  Kevin Ryde  <kevin@swox.se>
13367
13368         * mpfr/*: Update to mpfr cvs 2003-06-19.
13369
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.
13372
13373         * mpz/get_d_2exp.c, mpq/set_si.c, mpq/set_ui.c: Nailify.
13374
13375         * mpf/iset_si.c: Rewrite using mpf/set_si.c code, in particular this
13376         nailifies it.
13377         * tests/mpf/t-set_si.c: Nailify tests.
13378
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.
13382
13383 2003-06-15  Kevin Ryde  <kevin@swox.se>
13384
13385         * mpfr/*: Update to mpfr cvs 2003-06-15.
13386
13387         * mpn/x86/k6/mode1o.asm: Remove a bogus ASSERT.
13388
13389 2003-06-12  Kevin Ryde  <kevin@swox.se>
13390
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.
13394
13395         * mpn/sparc32/v9/udiv.asm: Amend heading, this file is for sparc v9.
13396
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.*.
13400
13401         * tests/devel/try.c (try_one): When overlapping, copy source data
13402         after filling dst.  Previously probably used only DEADVAL in
13403         overlapping cases.
13404
13405 2003-06-11  Torbjorn Granlund  <tege@swox.com>
13406
13407         * mpf/random2.c: Rewrite.  Ignore sign of exp parameter.
13408
13409 2003-06-10  Kevin Ryde  <kevin@swox.se>
13410
13411         * mpn/sparc64/mode1o.c: New file.
13412
13413 2003-06-09  Torbjorn Granlund  <tege@swox.com>
13414
13415         * mpn/powerpc32/lshift.asm: Add more cycle counts.
13416         * mpn/powerpc32/rshift.asm: Add more cycle counts.
13417
13418         * mpn/ia64/addmul_1.asm: Reformat comments for 80 columns.
13419
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
13423         the default.
13424         * tune/speed.c: Corresponding changes.
13425         * tune/speed.h: Likewise.
13426         * tune/common.c: Likewise.
13427
13428         * mpf/get_str.c: Simplify `off' computation.
13429
13430         * longlong.h: Tabify.
13431
13432 2003-06-09  Kevin Ryde  <kevin@swox.se>
13433
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.
13437
13438         * mpfr/*: Update to mpfr cvs 2003-06-09.
13439
13440         * tests/cxx/Makefile.am (LDADD): Add -L$(top_builddir)/$(LIBS), for
13441         the benefit of gcc 3.2 on itanium2-hp-hpux11.22.
13442
13443         * tune/many.pl (mul_2): Add speed routine settings.
13444         (MAKEFILE): Close when done, for the benefit of development hackery.
13445
13446 2003-06-08  Kevin Ryde  <kevin@swox.se>
13447
13448         * mpfr/*: Update to mpfr cvs 2003-06-08.
13449
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.
13457
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.
13461
13462         * mpn/x86/k6/divrem_1.asm: New file, derived from mpn/x86/divrem_1.asm.
13463
13464         * mpn/x86/k6/pre_mod_1.asm: Remove comments now in mpn/x86/mod_1.asm.
13465
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.
13469
13470 2003-06-07  Kevin Ryde  <kevin@swox.se>
13471
13472         * mpn/generic/mode1o.c: Fix ASSERTs on return value.
13473
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.
13476
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.
13480
13481 2003-06-06  Torbjorn Granlund  <tege@swox.com>
13482
13483         * mpn/ia64/submul_1.asm: Add branch over .align block.
13484
13485 2003-06-05  Torbjorn Granlund  <tege@swox.com>
13486
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.
13492
13493         * mpn/pa64: Change ".level 2.0W" to ".level 2.0w" to please
13494         picky GNU assembler.
13495
13496 2003-06-05  Kevin Ryde  <kevin@swox.se>
13497
13498         * gmp.texi (Integer Special Functions): In mpz_array_init, fix type
13499         shown for integer_array and give an example use.
13500
13501 2003-06-04  Torbjorn Granlund  <tege@swox.com>
13502
13503         * mpf/set_str.c (mpf_set_str): Work around gcc 2 bug triggered on
13504         alpha.
13505
13506 2003-06-03  Kevin Ryde  <kevin@swox.se>
13507
13508         * mpn/x86/pentium/README: Add 7 c/l mmx mul_1, tweak wordings.
13509
13510         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Use octal char constants in test
13511         program, hex is not supported by K&R.
13512
13513 2003-06-02  Torbjorn Granlund  <tege@swox.com>
13514
13515         * mpn/mips64/divrem_1.asm: New file.
13516
13517 2003-06-01  Torbjorn Granlund  <tege@swox.com>
13518
13519         * mpn/powerpc32/lshift.asm: Reformat code.
13520         * mpn/powerpc32/rshift.asm: Reformat code.
13521
13522 2003-05-30  Kevin Ryde  <kevin@swox.se>
13523
13524         * tests/misc.c (tests_start): Set stdout and stderr to unbuffered, to
13525         avoid any chance of losing output on segv etc.
13526
13527 2003-05-28  Torbjorn Granlund  <tege@swox.com>
13528
13529         * mpf/get_str.c: Move label `done' to match TMP_MARK and TMP_FREE.
13530         Remove redundant variable prec.
13531
13532 2003-05-26  Torbjorn Granlund  <tege@swox.com>
13533
13534         * tests/mpz/convert.c: Test bases up to 62.
13535
13536         * tests/mpf/t-conv.c: Test bases up to 62.
13537
13538         * demos/pexpr.c: Don't iterate to get accurate timing.
13539
13540         * mpf/set_str.c (mpn_pow_1_highpart): Cleanup.
13541
13542         * mp_dv_tab.c: Fix typo.
13543
13544         * mpf/get_str.c: Rewrite (now sub-quadratic).
13545
13546 2003-05-22  Kevin Ryde  <kevin@swox.se>
13547
13548         * tests/mpn/t-divrem_1.c: New file.
13549         * tests/mpn/Makefile.am: Add it.
13550
13551 2003-05-22  Torbjorn Granlund  <tege@swox.com>
13552
13553         * config.sub: Recognize viac3* processors.
13554
13555 2003-05-20  Torbjorn Granlund  <tege@swox.com>
13556
13557         * mpn/sparc64/addmul_2.asm: New file.
13558
13559 2003-05-19  Torbjorn Granlund  <tege@swox.com>
13560
13561         * configure.in: Recognize alphaev7* as alphaev67.
13562
13563         * config.guess: Recognize viac3* processors.
13564         * configure.in: Set up path for viac3* processors.
13565         * acinclude.m4 (X86_PATTERN): Include viac3* processors.
13566
13567 2003-05-19  Kevin Ryde  <kevin@swox.se>
13568
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.
13573
13574 2003-05-15  Kevin Ryde  <kevin@swox.se>
13575
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.
13579
13580 2003-05-13  Kevin Ryde  <kevin@swox.se>
13581
13582         * gmp.texi (Notes for Particular Systems): Libtool directory is .libs
13583         not _libs for mingw dll.  Reported by Andreas Fabri.
13584
13585 2003-05-07  Kevin Ryde  <kevin@swox.se>
13586
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
13591         (with sse2) is ok.
13592
13593 2003-05-06  Kevin Ryde  <kevin@swox.se>
13594
13595         * mpz/com.c: Rate size==0 as UNLIKELY, fix comment to mpn_add_1.
13596
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.
13599
13600 2003-05-03  Torbjorn Granlund  <tege@swox.com>
13601
13602         * mpf/set_str.c: Do not ignore supposedly superfluous digits (in part
13603         reverting last change).
13604
13605 2003-05-03  Kevin Ryde  <kevin@swox.se>
13606
13607         * gmp.texi: Use @code for files in @cindex entries, it looks nicer
13608         than @file.
13609
13610         * Makefile.am: Note gmp 4.1.1 and 4.1.2 version info.
13611
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
13614         AC_PROG_EGREP.
13615
13616         * config.guess: Amend fake RANDOM to avoid ". configfsf.guess" which
13617         segfaults on Debian "ash" 0.4.16.
13618
13619 2003-05-01  Kevin Ryde  <kevin@swox.se>
13620
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.
13628
13629 2003-04-28  Torbjorn Granlund  <tege@swox.com>
13630
13631         * mpf/set_str.c: Major overhaul.
13632         (mpn_pow_1_highpart): New helper function, meat extracted from
13633         mpf_set_str.
13634
13635 2003-04-24  Kevin Ryde  <kevin@swox.se>
13636
13637         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Quote result string against m4.
13638
13639         * configure, ltmain.sh, aclocal.m4: Update to libtool 1.5.
13640
13641         * longlong.h (add_ssaaaa) [all]: Remove first "%" commutative in each,
13642         since gcc only supports one per asm.
13643
13644         * printf/doprnt.c: Add M for mp_limb_t.
13645         * tests/misc/t-printf.c: Exercise this.
13646
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.
13650
13651         * mpz/cmp_d.c, mpz/cmpabs_d.c, mpf/cmp_d.c: NaN invalid, Inf bigger
13652         than any value.
13653         * mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
13654
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.
13660
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.
13664
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.
13668
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.
13680
13681 2003-04-19  Kevin Ryde  <kevin@swox.se>
13682
13683         * configure.in (*sparc*-*-* ABI=32): Add umul to extra_functions.
13684
13685         * mpn/x86/p6/mul_basecase.asm: New file.
13686
13687 2003-04-18  Kevin Ryde  <kevin@swox.se>
13688
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
13692         Richard Zidlicky.)
13693         * mpn/m68k/README: Update notes on directory usage.
13694
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.
13697
13698         * gmp.texi (Language Bindings): Add Guile.
13699
13700 2003-04-12  Kevin Ryde  <kevin@swox.se>
13701
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.
13705
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.
13710
13711         * gmp-impl.h (mpn_copyi, mpn_copyd): Add __GMP_DECLSPEC.
13712
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.
13718
13719 2003-04-10  Torbjorn Granlund  <tege@swox.com>
13720
13721         * configure.in: Match turbosparc.
13722         * config.guess: Recognize turbosparc (just for *bsd for now).
13723
13724 2003-04-09  Kevin Ryde  <kevin@swox.se>
13725
13726         * mpf/mul_ui.c [nails]: Call mpf_mul to handle v > GMP_NUMB_MAX.
13727
13728         * tests/mpz/t-mul.c (main): Don't try FFT sizes when FFT disabled via
13729         MP_SIZE_T_MAX, eg. for nails.
13730
13731         * tests/cxx/t-ternary.cc: Split up tests to help compile speed and
13732         memory usage.
13733
13734         * tests/devel/try.c: Print seed under -R, add -E to reseed, use ulong
13735         for seed not uint.
13736
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.
13744
13745 2003-04-06  Kevin Ryde  <kevin@swox.se>
13746
13747         * tests/mpz/t-gcd_ui.c: New file.
13748         * tests/mpz/Makefile.am: Add it.
13749
13750         * mpz/gcd_ui.c: Correction to return value on longlong limb systems,
13751         limb might not fit a ulong.
13752
13753 2003-04-04  Kevin Ryde  <kevin@swox.se>
13754
13755         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
13756         2003-04-02.
13757
13758 2003-04-02  Kevin Ryde  <kevin@swox.se>
13759
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.
13764
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.
13768
13769 2003-04-01  Kevin Ryde  <kevin@swox.se>
13770
13771         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
13772         2003-03-31.
13773
13774         * configure.in (AC_PROG_F77): Add a dummy AC_PROVIDE to stop libtool
13775         running F77 probes.
13776
13777         * randlc2x.c (gmp_rand_lc_struct): Add comments about what exactly is
13778         in each field.
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.
13783
13784 2003-03-29  Kevin Ryde  <kevin@swox.se>
13785
13786         * configure.in (m68k-*-*): Use -O2, no longer need to fallback to -O.
13787         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): Remove macro.
13788
13789         * configure.in (AC_CHECK_TYPES): Add notes on why tested.
13790
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.
13795
13796 2003-03-29  Kevin Ryde  <kevin@swox.se>
13797
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.
13803
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.
13812
13813         * tests/misc.c, tests/tests.h (call_rand_algs): New function.
13814
13815 2003-03-27  Kevin Ryde  <kevin@swox.se>
13816
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.
13819
13820 2003-03-26  Kevin Ryde  <kevin@swox.se>
13821
13822         * demos/expr/exprfr.c (cbrt, cmpabs, exp2, gamma, nextabove,
13823         nextbelow, nexttoward): New functions.
13824         * demos/expr/t-expr.c: Exercise these.
13825
13826         * mpfr/*: Update to mpfr cvs 2003-03-26.
13827
13828         * gmp-impl.h (MPZ_REALLOC): Use UNLIKELY, to expect no realloc.
13829
13830         * tune/time.c (cycles_works_p): Scope variables down to relevant part
13831         to avoid warnings about unused.
13832
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.
13836
13837         * mpz/fac_ui.c: Remove unused variable "z1".
13838
13839         * tune/freq.c (freq_irix_hinv): Allow "Processor 0" line from IRIX 6.5.
13840
13841 2003-03-24  Torbjorn Granlund  <tege@swox.com>
13842
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.
13846
13847 2003-03-17  Torbjorn Granlund  <tege@swox.com>
13848
13849         * Makefile.am (libgmp_la_SOURCES): Add mp_dv_tab.c.
13850         (libmp_la_SOURCES): Add mp_dv_tab.c.
13851
13852         * mpn/alpha/invert_limb.asm: Add a few comments.
13853
13854         * mp_dv_tab.c: New file, defining __gmp_digit_value_tab.
13855
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.
13862
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.
13869
13870         * mpz/inp_str.c: Restucture to allocate more string space just
13871         before needed.
13872         * mpbsd/min.c: Likewise.
13873
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.
13877
13878 2003-03-17  Kevin Ryde  <kevin@swox.se>
13879
13880         * mpfr/*: Update to mpfr cvs 2003-03-17.
13881
13882 2003-03-15  Kevin Ryde  <kevin@swox.se>
13883
13884         * Makefile.am (EXTRA_libgmp_la_SOURCES): Use this for TMP_ALLOC
13885         sources, instead of a libdummy.la.
13886
13887 2003-03-16  Torbjorn Granlund  <tege@swox.com>
13888
13889         * config.guess: Recognize supersparc and microsparc for *BSD systems.
13890         Generalize some superscalar recognition patterns.
13891
13892 2003-03-14  Torbjorn Granlund  <tege@swox.com>
13893
13894         * mpn/sparc64/udiv.asm: New file.
13895
13896 2003-03-13  Torbjorn Granlund  <tege@swox.com>
13897
13898         * mpn/sparc64: Table cycle counts.  Update some comments.
13899
13900         * mpn/powerpc64/divrem_1.asm: New file.
13901
13902 2003-03-10  Torbjorn Granlund  <tege@swox.com>
13903
13904         * mpn/generic/mul.c (mpn_mul): Don't blindly expect
13905         MUL_KARATSUBA_THRESHOLD to be a constant.
13906
13907 2003-03-07  Torbjorn Granlund  <tege@swox.com>
13908
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.
13912
13913 2003-03-07  Kevin Ryde  <kevin@swox.se>
13914
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.
13918
13919 2003-03-06  Kevin Ryde  <kevin@swox.se>
13920
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.
13924
13925 2003-03-05  Torbjorn Granlund  <tege@swox.com>
13926
13927         * mpn/powerpc32/powerpc-defs.m4: Set up renaming for v registers.
13928
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.
13932
13933 2003-02-25  Torbjorn Granlund  <tege@swox.com>
13934
13935         * mpn/x86/pentium4/copyd.asm: Correct header comment.
13936
13937         * mpn/arm/addmul_1.asm: Correct cycle counts.
13938         * mpn/arm/submul_1.asm: Likewise.
13939
13940 2003-02-20  Kevin Ryde  <kevin@swox.se>
13941
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
13944         Pongsajapan.
13945
13946         * gmp.texi, fdl.texi: Update to FDL version 1.2.
13947
13948 2003-02-18  Torbjorn Granlund  <tege@swox.com>
13949
13950         * mpn/arm/mul_1.asm: Fix typo introduced in last change.
13951
13952 2003-02-17  Torbjorn Granlund  <tege@swox.com>
13953
13954         * mpn/ia64/gmp-mparam.h: Retune.
13955
13956         * mpn/sparc64/copyi.asm: Add some header comments.
13957         * mpn/sparc64/copyd.asm: Likewise.
13958
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.
13964
13965 2003-02-16  Torbjorn Granlund  <tege@swox.com>
13966
13967         * mpn/arm/copyi.asm: New file.
13968         * mpn/arm/copyd.asm: New file.
13969
13970 2003-02-16  Kevin Ryde  <kevin@swox.se>
13971
13972         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Tolerate incorrect last data
13973         byte seen on an arm system.
13974
13975 2003-02-15  Torbjorn Granlund  <tege@swox.com>
13976
13977         * mpn/arm/gmp-mparam.h: Retune.
13978
13979 2003-02-13  Torbjorn Granlund  <tege@swox.com>
13980
13981         * mpn/powerpc32/750/com_n.asm: Add more cycle counts.
13982
13983 2003-02-13  Kevin Ryde  <kevin@swox.se>
13984
13985         * configure.in (AC_PREREQ): Bump to 2.57.
13986
13987         * configure.in, acinclude.m4 (GMP_GCC_WA_OLDAS): New macro, applying
13988         -Wa,-oldas only when necessary.
13989
13990         * configure.in (powerpc*-*-*): Don't use -Wa,-mppc with gcc, it
13991         overrides options recent gcc adds for -mcpu, making generated code
13992         fail to assemble.
13993
13994         * tune/tuneup.c (mpn_fft_table): Remove definition, it's in mul_fft.c.
13995
13996 2003-02-12  Torbjorn Granlund  <tege@swox.com>
13997
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.
14003
14004         * tests/mpz/t-mul.c (main): Rewrite FFT testing code.
14005
14006 2003-02-10  Torbjorn Granlund  <tege@swox.com>
14007
14008         * config.guess: Recognize "power2" systems.
14009
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.
14024
14025         * configure.in: Undo this, problem doesn't happen any more:
14026         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
14027
14028 2003-02-03  Kevin Ryde  <kevin@swox.se>
14029
14030         * gmp-impl.h (MPN_NORMALIZE, MPN_NORMALIZE_NOT_ZERO): Add parens
14031         around macro parameters.  Reported by Jason Moxham.
14032
14033 2003-02-01  Kevin Ryde  <kevin@swox.se>
14034
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
14038         formatting.
14039         (BSD Compatible Functions): Add index entry for MINT.
14040
14041 2003-01-29  Torbjorn Granlund  <tege@swox.com>
14042
14043         * gmp-impl.h (mpn_mul_fft): Now returns int.
14044
14045 2003-01-29  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
14046
14047         * mpn/generic/mul_fft.c: Major rewrite.
14048
14049 2003-01-25  Kevin Ryde  <kevin@swox.se>
14050
14051         * config.guess (powerpc*-*-*): Remove $dummy.core file when mfpvr
14052         fails on NetBSD.
14053         (trap): Remove $dummy.core on abnormal termination too.
14054
14055         * mpfr/*: Update to mpfr cvs 2003-01-25.
14056
14057 2003-01-24  Torbjorn Granlund  <tege@swox.com>
14058
14059         * mpn/ia64/README: Update cycle counts to match current code.
14060
14061 2003-01-18  Kevin Ryde  <kevin@swox.se>
14062
14063         * mpfr/*: Update to mpfr cvs 2003-01-18.
14064
14065 2003-01-17  Torbjorn Granlund  <tege@swox.com>
14066
14067         * gmp.texi: Canonicalize URLs.
14068
14069 2003-01-15  Kevin Ryde  <kevin@swox.se>
14070
14071         * gmp.texi (Notes for Particular Systems): Add hardware floating point
14072         precision mode.
14073
14074         * mpfr/*, configure, aclocal.m4, config.in: Update to mpfr cvs
14075         2003-01-15.
14076
14077 2003-01-11  Kevin Ryde  <kevin@swox.se>
14078
14079         * mpfr/*: Update to mpfr cvs 2003-01-11.
14080
14081 2003-01-09  Kevin Ryde  <kevin@swox.se>
14082
14083         * mpfr/get_str.c: Update to mpfr cvs 2003-01-09.
14084
14085         * doc/configuration: Various updates.
14086
14087 2003-01-06  Torbjorn Granlund  <tege@swox.com>
14088
14089         * mpn/alpha/copyi.asm: Avoid `nop' mnemonic, unsupported on Cray.
14090         * mpn/alpha/copyd.asm: Likewise.
14091
14092 2003-01-05  Kevin Ryde  <kevin@swox.se>
14093
14094         * demos/expr/t-expr.c (check_r): Tolerate mpfr_set_str new return
14095         value.
14096
14097         * configure, aclocal.m4 (*-*-osf4*, *-*-osf5*): Regenerate with
14098         libtool patch to avoid bash printf option problem when building shared
14099         libraries with cxx.
14100
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
14103         enough kernels.
14104
14105         * acinclude.m4 (GMP_PROG_NM): Add some notes about failures, per
14106         report by Krzysztof Kozminski.
14107
14108         * gmp-h.in (mpz_mdivmod_ui, mpz_mmod_ui): Add parens around "r".
14109
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.
14116
14117 2003-01-04  Kevin Ryde  <kevin@swox.se>
14118
14119         * mpfr/set_str.c: Update to mpfr cvs 2003-01-04.
14120
14121         * demos/expr/exprfra.c (e_mpfr_number): Tolerate recent mpfr_set_str
14122         returning count of characters accepted.
14123
14124 2003-01-03  Torbjorn Granlund  <tege@swox.com>
14125
14126         * mpn/alpha/copyi.asm: New file.
14127         * mpn/alpha/copyd.asm: New file.
14128
14129 2003-01-03  Kevin Ryde  <kevin@swox.se>
14130
14131         * demos/expr/t-expr.c: Use __gmpfr on some mpfr internals that have
14132         changed.
14133
14134         * mpfr/*, aclocal.m4, config.in, configure: Update to mpfr cvs
14135         2003-01-03.
14136
14137         * gmp.texi (Introduction to GMP): Mention release announcements
14138         mailing list, and put home page and ftp before mailing lists.
14139
14140 2002-12-28  Torbjorn Granlund  <tege@swox.com>
14141
14142         * mpn/generic/mul_fft.c (mpn_fft_next_size): Simplify.
14143
14144 2002-12-28  Kevin Ryde  <kevin@swox.se>
14145
14146         * acinclude.m4 (M68K_PATTERN): New macro.
14147         (GMP_GCC_M68K_OPTIMIZE): Use it to avoid m6811 and friends.
14148         * configure.in: Ditto.
14149
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.
14153
14154 2002-12-28  Pedro Gimeno  <pggimeno@wanadoo.es>
14155
14156         * randmt.c (randseed_mt, default_state): Fix off-by-one bug on padding.
14157         (randseed_mt): Add ASSERT checking result of mpz_export.
14158
14159 2002-12-24  Kevin Ryde  <kevin@swox.se>
14160
14161         * gmp.texi (Integer Import and Export): Clarify treatment of signs,
14162         reported by Kent Boortz.
14163
14164         * randmt.c: Use gmp_uint_least32_t.
14165         (randseed_mt): Add nails to mpz_export in case mt[i] more than 32 bits.
14166
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.
14170
14171 2002-12-22  Kevin Ryde  <kevin@swox.se>
14172
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.
14177
14178         * longlong.h (count_trailing_zeros) [ia64]: New macro.
14179
14180         * tests/t-count_zeros.c (check_various): Remove unused variable "n".
14181
14182         * mpn/x86/README: Revise notes on PIC, PLT and GOT.
14183
14184         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add "mt"
14185         to GMP::Rand::randstate.
14186
14187 2002-12-22  Pedro Gimeno  <pggimeno@wanadoo.es>
14188
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.
14194
14195         * tests/rand/t-mt.c: New test.
14196         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
14197
14198 2002-12-21  Kevin Ryde  <kevin@swox.se>
14199
14200         * cxx/osdoprnti.cc: Use <cstdarg> and <cstring> rather than <stdarg.h>
14201         and <string.h>.  No need for <stdio.h>.
14202
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.
14208
14209         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
14210         __gmp_free_func): Move declarations to gmp-impl.h
14211
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.
14219
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.
14223
14224 2002-12-20  Torbjorn Granlund  <tege@swox.com>
14225
14226         * tests/mpz/t-perfsqr.c (check_sqrt): Print more variables upon
14227         failure.
14228
14229         * mpn/generic/rootrem.c: In Newton loop, pad qp with leading zero.
14230
14231 2002-12-19  Torbjorn Granlund  <tege@swox.com>
14232
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.
14235         Add some asserts.
14236
14237         * tests/mpz/t-root.c: Generalize and speed up.
14238
14239 2002-12-19  Kevin Ryde  <kevin@swox.se>
14240
14241         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt test.
14242
14243         * gmp-h.in: Don't bother trying to support Compaq C++ in pre-standard
14244         I/O mode.
14245         * gmp.texi (Notes for Particular Systems): Compaq C++ must be used in
14246         "standard" iostream mode.
14247
14248 2002-12-18  Torbjorn Granlund  <tege@swox.com>
14249
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.
14252
14253 2002-12-18  Kevin Ryde  <kevin@swox.se>
14254
14255         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): New
14256         defines in config.m4.
14257
14258 2002-12-17  Torbjorn Granlund  <tege@swox.com>
14259
14260         * printf/printffuns.c (gmp_fprintf_reps): Make it actually work
14261         for padding > 256.
14262
14263 2002-12-17  Kevin Ryde  <kevin@swox.se>
14264
14265         * tune/freq.c: Add <string.h> for memcmp.
14266
14267         * mpz/pprime_p.c: Use MPN_MOD_OR_MODEXACT_1_ODD.
14268
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.
14274
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
14281         decimal point.
14282
14283         * config.guess (sparc*-*-*): Look at BSD sysctl hw.model to recognise
14284         ultrasparcs.
14285
14286         * mpfr/tests/dummy.c: New file.
14287         * mpfr/tests/Makefile.am (libfrtests_a_SOURCES): Add it.
14288
14289 2002-12-14  Kevin Ryde  <kevin@swox.se>
14290
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.
14294
14295         * mpfr/tests/Makefile.am: Add libfrtests.a in preparation for new mpfr.
14296
14297 2002-12-13  Kevin Ryde  <kevin@swox.se>
14298
14299         * mpfr/Makefile.am (mpfr_TEXINFOS, AM_MAKEINFOFLAGS): Allow for
14300         fdl.texi in recent mpfr.
14301
14302         * configure.in (AC_PROG_EGREP): Ensure this is run outside the Cray
14303         conditional AC_EGREP_CPP.
14304
14305         * configure.in (alpha*-*-*): Use gcc -Wa,-oldas if it works, to avoid
14306         problems with new compaq "as" on OSF 5.1.
14307
14308         * mpn/Makefile.am (EXTRA_DIST): Remove Makeasm.am, automake 1.7.2 does
14309         it automatically.
14310
14311         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Remove this hack, fixed by
14312         autoconf 2.57.
14313
14314         * configure.in (AC_CONFIG_LIBOBJ_DIR): Set to mpfr, for the benefit of
14315         new mpfr using LIBOBJ.
14316
14317         * configure.in: (AM_INIT_AUTOMAKE): Use "gnu no-dependencies
14318         $(top_builddir)/ansi2knr".
14319         * */Makefile.am (AUTOMAKE_OPTIONS): Remove, now in configure.in.
14320
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.
14324
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.
14332
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.
14337
14338 2002-12-13  Pedro Gimeno  <pggimeno@wanadoo.es>
14339
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.
14345
14346         * tests/rand/t-lc2exp.c (check_bigs): Test negative seeds.
14347
14348 2002-12-12  Torbjorn Granlund  <tege@swox.com>
14349
14350         * mpn/pa32/pa-defs.m4 (PROLOGUE_cpu): Zap spurious argument to `.proc'.
14351         Add empty `.callinfo'.
14352
14353 2002-12-11  Torbjorn Granlund  <tege@swox.com>
14354
14355         * mpn/x86/pentium4/sse2/addmul_1.asm: Don't reuse `ret' symbol for a
14356         label.
14357
14358 2002-12-11  Kevin Ryde  <kevin@swox.se>
14359
14360         * configure.in (hppa*-*-*): Don't use gcc -mpa-risc-2-0 in ABI=1.0.
14361
14362         * mpn/pa32/pa-defs.m4: New file, arranging for .proc/.procend.
14363         * configure.in (hppa*-*-*): Use it.
14364
14365         * printf/doprnt.c: Comments on "ll" versus "L".
14366
14367         * tests/mpz/t-div_2exp.c: Reduce tests, especially the random ones.
14368
14369 2002-12-11  Torbjorn Granlund  <tege@swox.com>
14370
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.
14375
14376         * mpn/x86/pentium4/sse2/addmul_1.asm: Unroll to save one c/l.
14377
14378 2002-12-09  Kevin Ryde  <kevin@swox.se>
14379
14380         * tune/Makefile.am: Don't use -static under --disable-static, it tends
14381         not to work.
14382         * configure.in (ENABLE_STATIC): New AM_CONDITIONAL.
14383
14384         * gmp-h.in: Use <iostream> instead of <iosfwd> with Compaq C++ in
14385         pre-standard I/O mode.
14386
14387         * tests/mpz/t-jac.c, tests/mpz/t-scan.c: Reduce tests.
14388
14389 2002-12-08  Kevin Ryde  <kevin@swox.se>
14390
14391         * configure.in (*-*-ultrix*): Remove forcible --disable-shared,
14392         believe this was a generic problem with libtool, now gone.
14393
14394 2002-12-08  Torbjorn Granlund  <tege@swox.com>
14395
14396         * gmp-impl.h (USE_LEADING_REGPARM): Disable for PIC code generation.
14397
14398 2002-12-07  Torbjorn Granlund  <tege@swox.com>
14399
14400         * tests/cxx/t-misc.cc (check_mpq): Use 0/1 for canonical 0 in
14401         mpq_cmp_ui calls.
14402
14403         * configure.in (hppa2.0*-*-*): Pass +O2 instead of +O3 to work around
14404         compiler bug with mpfr/tests/tdiv.
14405
14406 2002-12-07  Kevin Ryde  <kevin@swox.se>
14407
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
14410         support for 2.0n.
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.
14414
14415 2002-12-07  Pedro Gimeno  <pggimeno@wanadoo.es>
14416
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.
14420
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.
14426
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
14430         mpz_export).
14431
14432         * randsdui.c (gmp_randseed_ui): Use MPZ_FAKE_UI.
14433
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.
14436
14437 2002-12-06  Torbjorn Granlund  <tege@swox.com>
14438
14439         * configure.in: Remove -g.
14440         (hppa*-*-*): Pass -Wl,+vnocompatwarnings with +DA2.0.
14441
14442 2002-12-05  Torbjorn Granlund  <tege@swox.com>
14443
14444         * mpn/pa64/sqr_diagonal.asm: Remove .entry, .proc, .procend.
14445         * mpn/pa64/udiv.asm: Likewise.
14446
14447 2002-12-05  Kevin Ryde  <kevin@swox.se>
14448
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".
14452
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.
14464
14465         * tests/tests.h (ostringstream::str): Must null-terminate
14466         ostrstream::str() for the string constructor.
14467
14468 2002-12-04  Torbjorn Granlund  <tege@swox.com>
14469
14470         * mpn/pa32/hppa1_1/udiv.asm: Don't wrap symbol to INT64 in L() stuff.
14471
14472         * longlong.h (mpn_udiv_qrnnd_r based udiv_qrnnd): Fix typo.
14473
14474         * mpn/powerpc32/powerpc-defs.m4: Define float registers with `f'
14475         prefix.
14476
14477 2002-12-04  Kevin Ryde  <kevin@swox.se>
14478
14479         * gmp.texi (Floating-point Functions): Note the mantissa is binary and
14480         decimal fractions cannot be represented exactly.  Suggested by Serge
14481         Winitzki.
14482         (Known Build Problems): Note libtool stripping options when linking.
14483         Reported by Vincent Lefevre.
14484
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.
14492
14493 2002-12-03  Torbjorn Granlund  <tege@swox.com>
14494
14495         * tune/hppa.asm: Use config.m4.
14496         * tune/hppa2.asm: Likewise.
14497         * tune/hppa2w.asm: Likewise.
14498
14499         * mpn/pa64: Use LDEF.
14500
14501 2002-12-03  Kevin Ryde  <kevin@swox.se>
14502
14503         * INSTALL: Use return rather than exit in the example programs.
14504         Suggested by Richard Dawe.
14505
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.
14510
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.
14516
14517         * longlong.h (count_leading_zeros, count_trailing_zeros) [ev67, ev68]:
14518         Restrict __asm__ ctlz and cttz to __GNUC__.
14519
14520         * gen-psqr.c (HAVE_CONST, const): New macros.
14521
14522         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt.
14523
14524 2002-12-02  Torbjorn Granlund  <tege@swox.com>
14525
14526         * gmp-impl.h: Split popc_limb again, combined version gives too many
14527         compiler warnings.
14528
14529 2002-12-01  Torbjorn Granlund  <tege@swox.com>
14530
14531         * mpn/generic/gcdext.c (div1): Disable unused function.
14532
14533         * mpz/root.c: Don't include stdlib.h or longlong.h.
14534         * mpz/rootrem.c: Likewise.
14535
14536         * extract-dbl.c: abort => ASSERT_ALWAYS.
14537         * mpz/set_d.c: Likewise.
14538         * mpn/generic/tdiv_qr.c: Likewise.
14539
14540         * gen-psqr.c (f_cmp_fraction, f_cmp_divisor): Change parameter to
14541         `const void *', to match qsort spec.
14542
14543 2002-12-01  Kevin Ryde  <kevin@swox.se>
14544
14545         * gmp.texi (Integer Division): Fix a couple of @math's for tex.
14546         Use @dots in more places.
14547
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.
14552
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>.
14557
14558 2002-11-30  Torbjorn Granlund  <tege@swox.com>
14559
14560         * printf/doprnt.c (__gmp_doprnt): Comment out a `break' to shut up
14561         compiler warnings.
14562
14563         * mpn/ia64/invert_limb.asm: Add `many' hints to return insns.
14564
14565         * mpn/ia64/divrem_1.asm: Allocate more local registers; put b0 in
14566         one of them.
14567
14568         * mpn/ia64/popcount.asm: Properly restore register ar.lc.
14569
14570         * longlong.h (umul_ppmm) [ia64]: Form both product parts in asm.
14571
14572         * mpz/bin_uiui.c: Cast umul_ppmm operands.
14573
14574         * scanf/doscan.c (gmpscan): Remove unused label store_get_digits.
14575
14576         * gmp-impl.h: #undef MIN and MAX before #defining.
14577
14578         * mpn/ia64/copyi.asm: Add `;' after bundle declarators.
14579         * mpn/ia64/copyd.asm: Likewise.
14580
14581         * mpn/ia64/divrem_1.asm: Add some syntax to placid the HP-UX assembler.
14582
14583 2002-11-30  Kevin Ryde  <kevin@swox.se>
14584
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.
14587
14588 2002-11-29  Torbjorn Granlund  <tege@swox.com>
14589
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.
14593
14594         * mpn/ia64/addmul_1.asm: Rewrite.
14595
14596 2002-11-28  Torbjorn Granlund  <tege@swox.com>
14597
14598         * mpn/ia64/sqr_diagonal.asm: Don't allocate any registers.
14599
14600         * mpn/ia64/submul_1.asm: Adapt to Itanium 2.
14601
14602         * mpn/ia64/mul_1.asm: Fix typo in HAVE_ABI_32 code.
14603
14604         * mpn/ia64/add_n.asm: Rewrite.
14605         * mpn/ia64/sub_n.asm: Rewrite.
14606
14607 2002-11-28  Kevin Ryde  <kevin@swox.se>
14608
14609         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Use this rather
14610         than libdummy.
14611         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Use this for
14612         x86call.asm and x86check.c rather than libdummy.
14613
14614 2002-11-27  Torbjorn Granlund  <tege@swox.com>
14615
14616         * tests/mpz/t-mul.c: Implement reference Karatsuba multiplication.
14617         Rewrite testing scheme to run fewer really huge tests.
14618
14619 2002-11-26  Torbjorn Granlund  <tege@swox.com>
14620
14621         * tests: Decrease repetition count for some of the slowest tests.
14622
14623         * mpn/ia64/divrem_1.asm: New file.
14624
14625 2002-11-25  Torbjorn Granlund  <tege@swox.com>
14626
14627         * mpfr/tests/tdiv.c: Decrease number of performed tests.
14628
14629 2002-11-23  Torbjorn Granlund  <tege@swox.com>
14630
14631         * mpn/ia64/mul_1.asm: Rewrite.
14632
14633 2002-11-23  Kevin Ryde  <kevin@swox.se>
14634
14635         * mpn/ia64/README: Add some references.
14636
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.
14643
14644         * config.sub, config.guess, configure.in (itanium, itanium2): New cpu
14645         types.
14646
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.
14649
14650 2002-11-22  Torbjorn Granlund  <tege@swox.com>
14651
14652         * mpn/ia64/copyi.asm: Optimize for Itanium 2.
14653         * mpn/ia64/copyd.asm: Likewise.
14654
14655 2002-11-20  Torbjorn Granlund  <tege@swox.com>
14656
14657         * mpn/ia64/sqr_diagonal.asm: New file.
14658
14659         * mpn/ia64/submul_1.asm: Handle vl == 0 specially.
14660
14661 2002-11-20  Kevin Ryde  <kevin@swox.se>
14662
14663         * tests/cxx/t-locale.cc: Test with locales imbued into stream, use
14664         <sstream>, eliminated some C-isms.  istream tests disabled, not yet
14665         locale-ized.
14666         * tests/cxx/Makefile.am (t_locale_SOURCES): Remove localeconv.c.
14667         * tests/cxx/localeconv.c: Remove file.
14668
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.
14675
14676         * gmp-h.in: More comments on __declspec for windows DLLs.
14677
14678         * mpf/set_str.c, scanf/doscan.c: Cast through "unsigned char" for
14679         decimal point string, same as input chars.
14680
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.
14687
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.
14693
14694         * tests/cxx/t-rand.cc (check_randinit): New function, collecting up
14695         constructor tests.
14696
14697         * tests/cxx/t-ostream.cc: Use <sstream> instead of <strstream>, use
14698         compare instead of strcmp.
14699
14700         * gmpxx.h (__gmp_randinit_lc_2exp_size_t): Return type is int.
14701
14702 2002-11-18  Kevin Ryde  <kevin@swox.se>
14703
14704         * tune/speed.c (r_string): Use CNST_LIMB with <N>bits, spotted by
14705         Torbjorn.
14706
14707 2002-11-19  Torbjorn Granlund  <tege@swox.com>
14708
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.
14714
14715 2002-11-17  Torbjorn Granlund  <tege@swox.com>
14716
14717         * mpn/generic/popham.c: New file, using new faster algorithm.
14718         * mpn/generic/popcount.c: Remove.
14719         * mpn/generic/hamdist.c: Remove.
14720
14721         * mpn/ia64/addmul_1.asm: Don't clobber callee-saves register f16.
14722         * mpn/ia64/mul_1.asm: Likewise.
14723
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.
14732
14733         * mpn/generic/random2.c: Add a cast to silence some compilers.
14734
14735 2002-11-16  Torbjorn Granlund  <tege@swox.com>
14736
14737         * mpz/powm.c: Cap allocation by limiting k to 10 (512 precomputed
14738         values).
14739
14740 2002-11-16  Kevin Ryde  <kevin@swox.se>
14741
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.
14746
14747 2002-11-14  Kevin Ryde  <kevin@swox.se>
14748
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.
14751
14752         * gmp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
14753         Use __dllexport__ and __dllimport__ to keep out of application
14754         namespace.
14755
14756 2002-11-14  Gerardo Ballabio <gerardo.ballabio@unimib.it>
14757
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.
14761
14762 2002-11-12  Kevin Ryde  <kevin@swox.se>
14763
14764         * gmpxx.h (gmp_randclass constructors): Patch from Roberto Bagnara to
14765         use extern "C" on C function pointer arguments.
14766
14767 2002-11-09  Kevin Ryde  <kevin@swox.se>
14768
14769         * configure.in, Makefile.am, printf/Makefile.am,
14770         printf/repl-vsnprintf.c: Handle vsnprintf replacement with C
14771         conditionals.
14772
14773         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Workaround troubles recent
14774         HP cc +O3 causes for AC_CHECK_FUNCS.
14775
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
14779         are not multibyte.
14780
14781 2002-11-06  Torbjorn Granlund  <tege@swox.com>
14782
14783         * mpn/generic/tdiv_qr.c: Remove a bogus assert.
14784
14785 2002-11-05  Torbjorn Granlund  <tege@swox.com>
14786
14787         * mpn/generic/tdiv_qr.c: Remove two dead mpn_divrem_2 calls.
14788
14789 2002-11-04  Kevin Ryde  <kevin@swox.se>
14790
14791         * acinclude.m4 (GMP_C_INLINE): Don't define "inline" for C++.
14792
14793         * demos/expr/expr-impl.h (stdarg.h): Test __DECC same as gmp.h.
14794
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
14799         memcpy.
14800
14801 2002-11-02  Kevin Ryde  <kevin@swox.se>
14802
14803         * longlong.h: Test __x86_64__ not __x86_64.  Reported by Andreas
14804         Jaeger.
14805
14806         * mpz/import.c, mpz/export.c: Use char* subtract from NULL to get
14807         pointer alignment, for the benefit of Cray vector systems.
14808
14809         * cxx/ismpf.cc: Use <clocale>.
14810         * tests/cxx/t-locale.cc: No need to conditionalize <clocale>.
14811
14812         * scanf/doscan.c: Don't use isascii, rely on C99 ctype.h.
14813
14814         * gmp.texi (Build Options): Describe CC_FOR_BUILD, cross reference
14815         texinfo manual.
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.
14821
14822 2002-10-31  Kevin Ryde  <kevin@swox.se>
14823
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.
14831
14832         * tests/devel/try.c (ASSERT_CARRY): Remove, now in gmp-impl.h
14833         (try_one): Do dest setups after sources, for benefit of
14834         dst0_from_src1.
14835
14836 2002-11-01  Torbjorn Granlund  <tege@swox.com>
14837
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
14841         few comments.
14842
14843 2002-10-29  Torbjorn Granlund  <tege@swox.com>
14844
14845         * configure.in (*-cray-unicos*): Pass -hnofastmd again.
14846
14847 2002-10-25  Torbjorn Granlund  <tege@swox.com>
14848
14849         * tests/tadd.c: Disable test of denorms.
14850
14851 2002-10-23  Linus Nordberg  <linus@swox.se>
14852
14853         * gmp.texi (Introduction to GMP): Update section about mailing
14854         lists.
14855
14856 2002-10-23  Kevin Ryde  <kevin@swox.se>
14857
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.
14862
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.
14867
14868 2002-10-21  Torbjorn Granlund  <tege@swox.com>
14869
14870         * mpn/cray/ieee/addmul_1.c: Handle overlap as in mul_1.c.
14871         * mpn/cray/ieee/submul_1.c: Likewise.
14872
14873 2002-10-19  Kevin Ryde  <kevin@swox.se>
14874
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.
14878
14879         * demos/calc/calc.y: Change ={ to {, needed for bison 1.50.
14880
14881         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]:
14882         Should be UDItype.
14883
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.
14886
14887 2002-10-18  Torbjorn Granlund  <tege@swox.com>
14888
14889         * tests/mpz/t-root.c: Test also mpz_rootrem.
14890
14891         * mpn/generic/rootrem.c: Avoid overflow problem when n is huge.
14892
14893         * mpz/root.c: Avoid overflow problems in allocation computation; also
14894         simplify it.  Misc cleanups.
14895
14896         * mpz/rootrem.c: New file.
14897         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
14898
14899 2002-10-17  Torbjorn Granlund  <tege@swox.com>
14900
14901         * gmp-impl.h (popc_limb): Combine variants.
14902
14903 2002-10-14  Kevin Ryde  <kevin@swox.se>
14904
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
14907         compile.
14908
14909 2002-10-08  Kevin Ryde  <kevin@swox.se>
14910
14911         * tune/time.c (speed_time_init): Allow for Cray times() apparently
14912         being a cycle counter.
14913
14914         * dumbmp.c (mpz_get_str): Fix buf size allocation.
14915
14916         * tests/trace.c, tests/tests.h (mp_limb_trace): New function.
14917
14918         * tune/speed-ext.c (SPEED_EXTRA_PROTOS): Use __GMP_PROTO.
14919         * tests/devel/try.c (malloc_region): Add a cast for SunOS cc.
14920
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.
14924
14925 2002-10-05  Kevin Ryde  <kevin@swox.se>
14926
14927         * configure.in (AC_CHECK_HEADERS): Test float.h, not in SunOS cc.
14928         * printf/repl-vsnprintf.c: Use this.
14929
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
14933         SunPRO cc configs.
14934
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
14938         two legs of a ?:.
14939
14940         * dumbmp.c (mpz_realloc): Add a cast to avoid a warning from SunOS cc.
14941
14942         * acinclude.m4: Allow for i960 b.out default cc output.
14943
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.
14950
14951 2002-10-03  Kevin Ryde  <kevin@swox.se>
14952
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.
14961
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.
14965
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.
14968
14969 2002-09-30  Kevin Ryde  <kevin@swox.se>
14970
14971         * mpn/Makeasm.am (.s.lo): Add --tag=CC for the benefit of CCAS!=CC,
14972         same as .S.lo and .asm.lo.
14973
14974         * Makefile.am (gen-fac_ui, gen-fib, gen-bases): Quote source files in
14975         test -f stuff to avoid Sun make rewriting them.
14976
14977 2002-09-28  Kevin Ryde  <kevin@swox.se>
14978
14979         * tests/devel/try.c, tune/speed.c: Avoid strings longer than C99
14980         guarantees.
14981
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.
14986
14987         * dumbmp.c: Add several new functions, allow for initial n<d in
14988         mpz_tdiv_q (now in mpz_tdiv_qr actually).
14989
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.
14994
14995         * Makefile.am, mpz/Makefile.am: Setups for gen-fac_ui.c generating
14996         mpz/fac_ui.h.
14997
14998 2002-09-28  Jason Moxham <J.L.Moxham@maths.soton.ac.uk>
14999
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.
15003
15004 2002-09-26  Kevin Ryde  <kevin@swox.se>
15005
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.
15009
15010         * tests/cxx/Makefile.am: Updates for Gerardo's new test programs.
15011
15012 2002-09-26  Gerardo Ballabio <gerardo.ballabio@unimib.it>
15013
15014         * gmpxx.h (__gmp_cmp_function): Bug fixes in double/mpq and
15015         double/mpfr comparisons.
15016
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
15024         t-allfuns.cc.
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.
15028
15029 2002-09-25  Torbjorn Granlund  <tege@swox.com>
15030
15031         * configure.in (*-cray-unicos*): Remove -hscalar0, it causes too much
15032         performance loss.  Let's trust Cray to fix their compilers.
15033
15034 2002-09-24  Torbjorn Granlund  <tege@swox.com>
15035
15036         * mpn/powerpc32/add_n.asm: Rewrite.
15037         * mpn/powerpc32/sub_n.asm: Rewrite.
15038
15039 2002-09-24  Pedro Gimeno  <pggimeno@wanadoo.es>
15040
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
15043         for mpn_mul.
15044         * gmp-impl.h (MPZ_FAKE_UI): New macro.
15045
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.
15049
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.
15053
15054         * mpz/urandomm.c: Replace mpn_cmp with MPN_CMP.
15055
15056         * tests/rand/gen.c: Get rid of gmp_errno.
15057
15058 2002-09-24  Kevin Ryde  <kevin@swox.se>
15059
15060         * gmp.texi (Custom Allocation): Keep allocate_function etc out of the
15061         function index by using @deftypevr.
15062         More index entries.
15063
15064 2002-09-24  Gerardo Ballabio <gerardo.ballabio@unimib.it>
15065
15066         * gmpxx.h (mpfr_class constructors from strings): Precision was set
15067         incorrectly, fixed.
15068
15069 2002-09-23  Torbjorn Granlund  <tege@swox.com>
15070
15071         * mpf/urandomb.c: Don't crash for overlarge nbits argument.
15072         Let nbits==0 mean to fill number with random bits.
15073
15074 2002-09-21  Torbjorn Granlund  <tege@swox.com>
15075
15076         * mpn/alpha/mod_34lsub1.asm: Add r31 dummy operand to `br' instruction.
15077
15078 2002-09-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
15079
15080         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal): Fix broken
15081         mpq/double functions.
15082
15083 2002-09-18  Torbjorn Granlund  <tege@swox.com>
15084
15085         * randmt.c (randget_mt): Fix typo.
15086
15087 2002-09-18  Kevin Ryde  <kevin@swox.se>
15088
15089         * gmp-impl.h (_gmp_rand): Avoid evaluating "state" more than once, for
15090         the benefit places calling it with RANDS.
15091
15092         * randmt.c (randseed_mt): Use mpz_init for mod and seed1, for safety.
15093
15094         * tune/tuneup.c (sqr_karatsuba_threshold): Initialize to
15095         TUNE_SQR_KARATSUBA_MAX so mpn_sqr_n works for randmt initialization.
15096
15097         * gmp.texi (Integer Comparisons): Remove mention of non-existent
15098         mpz_cmpabs_si, reported by Conrad Curry.
15099
15100         * tune/speed.c, tune/speed.h, tune/common.c: Add gmp_randseed,
15101         gmp_randseed_ui and mpz_urandomb.
15102
15103 2002-09-18  Pedro Gimeno  <pggimeno@wanadoo.es>
15104
15105         * tests/rand/gen.c: Add mt, remove lc and bbs.
15106
15107         * Makefile.am (libgmp_la_SOURCES): Add randmt.c, remove randlc.c and
15108         randraw.c.
15109
15110         * randmt.c: New file.
15111         * gmp-h.in (gmp_randinit_mt): Add prototype.
15112         * randdef.c: Use gmp_randinit_mt.
15113
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.
15125
15126         * randlc.c: Remove file, never documented and never worked.
15127         * gmp-h.in (gmp_randinit_lc): Remove prototype.
15128
15129 2002-09-16  Torbjorn Granlund  <tege@swox.com>
15130
15131         * mpn/alpha/mod_34lsub1.asm: New file.
15132
15133 2002-09-16  Kevin Ryde  <kevin@swox.se>
15134
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.
15138
15139         * configure.in (x86): Add gcc 3.2 -march and -mcpu flags, remove some
15140         unnecessary -march=i486 fallbacks.
15141
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):
15146
15147 2002-09-12  Kevin Ryde  <kevin@swox.se>
15148
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.
15152
15153         * tune/common.c: mpn_mod_34lsub1 only exists for GMP_NUMB_BITS%4==0
15154         * tune/speed.c: Add mpn_mod_34lsub1.
15155
15156 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
15157
15158         * rand.c: Remove old disabled BBS code.
15159         * mpf/urandomb.c: Use BITS_TO_LIMBS.
15160
15161 2002-09-10  Kevin Ryde  <kevin@swox.se>
15162
15163         * gmp.texi (Multiplication Algorithms): FFT is now enabled by default.
15164
15165 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
15166
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.
15171
15172         * gmp-impl.h (BITS_TO_LIMBS): New macro.
15173         * mpz/urandomb.c: Use it, and use MPZ_REALLOC.
15174
15175 2002-09-08  Kevin Ryde  <kevin@swox.se>
15176
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.
15180
15181 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
15182
15183         * gmpxx.h (__gmpz_value etc): Remove, use mpz_t etc instead.
15184         (__gmp_expr): Reorganise specializations, use __gmp_expr<T,T> not
15185         mpz_class etc.
15186         (mpfr evals): Remove mode parameter, was always
15187         __gmp_default_rounding_mode anyway.
15188
15189 2002-09-07  Kevin Ryde  <kevin@swox.se>
15190
15191         * gmp-h.in, mp-h.in: Use #ifdef for tests, for the benefit of
15192         applications using gcc -Wundef.
15193
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.
15197
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.
15202
15203         * demos/qcn.c: Add -p prime limit option.
15204
15205 2002-08-30  Kevin Ryde  <kevin@swox.se>
15206
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.
15211
15212 2002-08-26  Torbjorn Granlund  <tege@swox.com>
15213
15214         * gmp.texi (Converting Floats): Fix typo in mpf_get_d_2exp docs,
15215         reported by Paul Zimmermann.
15216
15217 2002-08-26  Kevin Ryde  <kevin@swox.se>
15218
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.
15222
15223 2002-08-24  Kevin Ryde  <kevin@swox.se>
15224
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.
15229
15230         * mpn/powerpc32/mode1o.asm: Forgot ASM_START.
15231
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.
15234
15235 2002-08-23  Torbjorn Granlund  <tege@swox.com>
15236
15237         * configure.in: Choose powerpc32/aix.m4 or powerpc64/aix.m4 based on
15238         ABI, not configuration triple.
15239
15240         * mpz/pprime_p.c: Partially undo last change--handle small and
15241         negative numbers in the same test.
15242
15243 2002-08-22  Kevin Ryde  <kevin@swox.se>
15244
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.
15248
15249         * configfsf.guess: Update to 2002-08-19.
15250         * configfsf.sub: Update to 2002-08-20.
15251
15252         * config.guess (powerpc*-*-*): Use a { } construct to suppress SIGILL
15253         message on AIX.
15254
15255 2002-08-20  Kevin Ryde  <kevin@swox.se>
15256
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.
15267
15268         * mpz/millerrabin.c: Need x to be size+1 for change to urandomm.
15269
15270         * gmp-impl.h: Comments on the use of __GMP_DECLSPEC.
15271
15272         * tune/time.c (freq_measure_mftb_one): Use struct_timeval, for the
15273         benefit of mingw.
15274
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.
15277
15278 2002-08-17  Kevin Ryde  <kevin@swox.se>
15279
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.
15283
15284         * configure.in (AC_PREREQ): Bump to 2.53.
15285
15286         * mpn/powerpc32/powerpc-defs.m4 (ASSERT): New macro.
15287         (PROLOGUE_cpu): New macro, giving ALIGN(4) not 8.
15288
15289 2002-08-16  Torbjorn Granlund  <tege@swox.com>
15290
15291         * mpn/m68k/lshift.asm: Fix typo in !scale_available_p code.
15292         * mpn/m68k/rshift.asm: Likewise.
15293
15294 2002-08-16  Kevin Ryde  <kevin@swox.se>
15295
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):
15299         Add support.
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.
15305
15306         * mpn/alpha/umul.asm: Add ASM_END.
15307
15308 2002-08-12  Kevin Ryde  <kevin@swox.se>
15309
15310         * mpz/pprime_p.c: Fake up a local mpz_t to take abs(n), rather than
15311         using mpz_init etc.
15312
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.
15316
15317         * mpn/alpha/umul.asm: Use "r" registers, for the benefit of Unicos.
15318
15319         * tests/devel/try.c: Add mpn_copyi and mpn_copyd.
15320
15321 2002-08-09  Kevin Ryde  <kevin@swox.se>
15322
15323         * Makefile.am: Remove configure.lineno from DISTCLEANFILES and gmp.tmp
15324         from MOSTLYCLEANFILES, automake does these itself now.
15325
15326         * */Makefile.in, aclocal.m4, configure, install-sh, missing,
15327         mkinstalldirs: Update to automake 1.6.3.
15328
15329         * mpn/ia64/README: Some notes on assembler syntax.
15330
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
15334         instruction.
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.
15338
15339         * configure.in (*-*-unicos*): Remove forcible --disable-shared,
15340         libtool gets this right itself now.
15341
15342 2002-08-07  Kevin Ryde  <kevin@swox.se>
15343
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.
15348
15349         * mpn/alpha/umul.asm: Use PROLOGUE/EPILOGUE, rename it mpn_umul_ppmm.
15350         * configure.in (alpha*-*-*): Add umul to extra_functions.
15351
15352         * mpz/remove.c: Make src==0 return 0, not do DIVIDE_BY_ZERO.
15353
15354 2002-08-05  Torbjorn Granlund  <tege@swox.com>
15355
15356         * acconfig.h: Remove spurious undefs for mpn_divrem_newton and
15357         mpn_divrem_classic.
15358
15359 2002-08-05  Kevin Ryde  <kevin@swox.se>
15360
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.
15366
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.
15370
15371         * mpn/lisp/gmpasm-mode.el: Set add-log-current-defun-header-regexp to
15372         pick up m4 defines etc.
15373
15374         * Makefile.am (libgmpxx_la_DEPENDENCIES): libgmp.la should be here,
15375         not libgmpxx_la_LIBADD, for the benefit of "make -j2".
15376
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.
15379
15380 2002-08-03  Kevin Ryde  <kevin@swox.se>
15381
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.
15385
15386         * configure.in (*-*-msdosdjgpp*): Remove forcible --disable-shared,
15387         libtool gets this right itself now.
15388
15389 2002-07-30  Kevin Ryde  <kevin@swox.se>
15390
15391         * mpn/powerpc32/lshift.asm, mpn/powerpc32/rshift.asm: Lose final mr,
15392         and make final stwu into an stw.
15393
15394         * gmp.texi (Known Build Problems): An easier workaround for DESTDIR,
15395         using LD_LIBRARY_PATH.
15396         (C++ Interface MPFR): Remove mpfrxx.h.
15397
15398         * mpfrxx.h: Remove file.
15399         * Makefile.am: Remove mpfrxx.h.
15400         * tests/cxx/Makefile.am: Add Gerardo's new test programs.
15401
15402 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
15403
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.
15409
15410 2002-07-27  Kevin Ryde  <kevin@swox.se>
15411
15412         * longlong.h (count_trailing_zeros) [ia64 __GNUC__]: Don't use
15413         __builtin_ffs for now, doesn't seem to work.
15414
15415         * configure.in: Establish CONFIG_SHELL to avoid a problem with
15416         AC_LIBTOOL_SYS_MAX_CMD_LEN on ia64-*-hpux*.
15417
15418         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_FINDA): Don't let calls to
15419         mpn_gcd_finda go dead.
15420
15421         * mpn/generic/tdiv_qr.c: Inline mpn_rshift and MPN_COPY of 2 limbs.
15422
15423 2002-07-24  Kevin Ryde  <kevin@swox.se>
15424
15425         * demos/primes.c: Use __GMP_PROTO and don't use signed, for the
15426         benefit of K&R.
15427
15428         * demos/calc/calclex.l: Add <string.h> for strcmp.
15429
15430         * mpn/ia64/invert_limb.asm: Use .rodata which works on ia64-*-hpux*
15431         and should be standard, rather than worrying about RODATA.
15432
15433         * gmp.texi (Function Classes): Add cross references.
15434         (Integer Import and Export): Fix return value grouping.
15435
15436         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add // for
15437         ia64.  Add notes on what the various styles are for.
15438
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.
15443
15444 2002-07-21  Kevin Ryde  <kevin@swox.se>
15445
15446         * tune/speed.h: Fix some missing _PROTOs.
15447
15448         * Makefile.am (DISTCLEANFILES): Add configure.lineno.
15449
15450         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Define
15451         HAVE_DOUBLE_IEEE_BIG_ENDIAN and HAVE_DOUBLE_IEEE_LITTLE_ENDIAN in
15452         config.m4 too.
15453         * mpn/ia64/invert_limb.asm: Add big-endian data.
15454
15455         * tests/mpz/t-jac.c (try_si_zi): Correction to "a" parameter type.
15456
15457 2002-07-20  Kevin Ryde  <kevin@swox.se>
15458
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.
15461
15462         * gmp-impl.h (invert_limb): Use parens around macro arguments.
15463         (mpn_invert_limb): Give prototype and define unconditionally.
15464
15465         * gmp-impl.h (CACHED_ABOVE_THRESHOLD, CACHED_BELOW_THRESHOLD): New
15466         macros.
15467         * mpn/generic/sb_divrem_mn.c: Use them to help gcc let preinv code go
15468         dead when not wanted.
15469
15470 2002-07-17  Kevin Ryde  <kevin@swox.se>
15471
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.
15474
15475         * configure.in (ia64*-*-hpux*): Need +DD64 in cc_64_cppflags to get
15476         the right headers for ansi2knr.
15477
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.
15481
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.
15487
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.
15496
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.
15502
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.
15506
15507         * mpz/fib_ui.c: Nailify.
15508         * mpz/random.c: Nailify.
15509
15510         * mpfr/acinclude.m4 (MPFR_CONFIGS): Patch by Vincent for an apparent
15511         float rounding gremlin on powerpc.
15512
15513 2002-07-15  Kevin Ryde  <kevin@swox.se>
15514
15515         * Makefile.am (PRINTF_OBJECTS): Avoid ending in a backslash, hpux ia64
15516         make doesn't like that.
15517
15518         * mpn/ia64/*.asm: Add .sptk to unconditional branches, add ";" after
15519         .mib etc, for the benefit of hpux.
15520
15521         * configure.in (ia64*-*-*): Use ABI=64 on non-HPUX systems, for
15522         consistency.
15523
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.
15527
15528 2002-07-13  Kevin Ryde  <kevin@swox.se>
15529
15530         * mpn/powerpc32/rshift.asm: Rewrite, transformed from lshift.asm.
15531
15532         * tune/tuneup.c (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD):
15533         Always zero for native mpn_divexact_1, mpn_modexact_1_odd.
15534
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.
15538
15539         * gmp-impl.h, mpn/asm-defs.m4 (mpn_addmul_2, mpn_addmul_3,
15540         mpn_addmul_4): Add prototypes and defines.
15541
15542         * gmp.texi (Number Theoretic Functions): Clarify return value.
15543         Reported by Peter Keller.
15544
15545 2002-07-10  Kevin Ryde  <kevin@swox.se>
15546
15547         * configure.in, acinclude.m4 (GMP_PROG_LEX): Remove this in favour of
15548         AM_PROG_LEX, now ok when lex is missing.
15549
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.
15553
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.
15558
15559         * mpz/divexact.c: Add an ASSERT that den divides num.
15560
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.
15565
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.
15569
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.
15573
15574         * mpn/ia64/invert_limb.asm: Use RODATA since ".section .rodata" is not
15575         accepted by ia64-*-hpux*.
15576
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.
15586
15587         * configure.in, acinclude.m4 (GMP_PROG_CC_WORKS_LONGLONG): New macro.
15588         * configure.in (ia64-*-hpux*): Add 32 and 64 bit ABI modes.
15589
15590 2002-07-06  Kevin Ryde  <kevin@swox.se>
15591
15592         * tests/cxx/t-allfuns.cc: New file.
15593         * tests/cxx/Makefile.am: Add it.
15594
15595         * mpz/clrbit.c, mpz/setbit.c: Only MPN_NORMALIZE if high limb changes
15596         to zero.  Use _mpz_realloc return value.
15597
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.
15603
15604 2002-07-01  Kevin Ryde  <kevin@swox.se>
15605
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.
15610
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.
15616
15617         * gmp-h.in (mpz_export): Remove a spurious parameter name.
15618         * gmp-impl.h (mpn_rootrem): Use __MPN.
15619
15620 2002-06-29  Kevin Ryde  <kevin@swox.se>
15621
15622         * longlong.h (udiv_qrnnd) [hppa32]: Remove mpn_udiv_qrnnd version, the
15623         general mechanism for that suffices.
15624
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.
15629
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.
15633
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.
15638
15639         * gmp-h.in (__GMP_CRAY_Pragma): New macro.
15640         (__GMPN_COPY_REST): Use it.
15641         * gmp-impl.h (CRAY_Pragma): Use it.
15642
15643 2002-06-25  Kevin Ryde  <kevin@swox.se>
15644
15645         * mpz/import.c, mpz/export.c: Cast data pointer through "char *" in
15646         alignment tests, for the benefit of Cray vector systems.
15647
15648         * configure.in (x86-*-*): Remove -march=pentiumpro check, seems ok
15649         with current code.
15650         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO, GMP_GCC_VERSION_GE): Remove
15651         macros, no longer needed
15652
15653         * acinclude.m4 (GMP_ASM_RODATA): Remove temporary files.
15654
15655         * configure.in (GMP_ASM_GLOBL_ATTR): Reposition to avoid duplication
15656         through AC_REQUIRE.
15657
15658 2002-06-23  Kevin Ryde  <kevin@swox.se>
15659
15660         * tests/mpz/t-fib_ui.c (check_fib_table): Check table values, not just
15661         that they're non-zero.
15662
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.
15666
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.
15673
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.
15677
15678 2002-06-22  Kevin Ryde  <kevin@swox.se>
15679
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.
15683
15684         * mpn/generic/mod_34lsub1.c: Nailify.
15685         * tests/devel/try.c (CNST_34LSUB1): Nailify.
15686         * gmp-impl.h (ADDC_LIMB): New macro.
15687
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.
15696
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
15699         on K&R.
15700
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.
15707
15708         * Makefile.am: Add mp.h to BUILT_SOURCES, distclean all BUILT_SOURCES,
15709         use += more.
15710
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.
15721
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.
15725
15726 2002-06-20  Torbjorn Granlund  <tege@swox.com>
15727
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.
15731
15732 2002-06-20  Kevin Ryde  <kevin@swox.se>
15733
15734         * mpn/ia64/submul_1.c: Add missing TMP_DECL, TMP_MARK, TMP_FREE.
15735         Reported by Paul Zimmermann.
15736
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.
15740
15741 2002-06-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
15742
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.
15746
15747 2002-06-18  Kevin Ryde  <kevin@swox.se>
15748
15749         * tests/rand/t-lc2exp.c: New file.
15750         * tests/rand/Makefile.am: Add it, and use tests/libtests.la.
15751
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.
15754
15755         * configure.in: Don't bother with line numbers in some diagnostics.
15756         (*-*-mingw*): Use -mno-cygwin if it works, suggested by delta trinity.
15757
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.
15761
15762 2002-06-16  Torbjorn Granlund  <tege@swox.com>
15763
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.
15766
15767 2002-06-15  Torbjorn Granlund  <tege@swox.com>
15768
15769         * mpn/sparc32/v9/udiv.asm: New file.
15770
15771 2002-06-15  Kevin Ryde  <kevin@swox.se>
15772
15773         * acinclude.m4 (GMP_GCC_VERSION_GE): Correction to recognising mingw
15774         gcc 3.1 version number.  Reported by Jim Fougeron.
15775
15776         * configure.in (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): New define, to make
15777         AC_LIBTOOL_WIN32_DLL work with autoconf 2.53.
15778
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.
15781
15782         * config.guess (CC_FOR_BUILD): Try c99, same as configfsf.guess.
15783
15784 2002-06-15  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
15785
15786         * mpfr/set_q.c: Allow for 1 bit numerator or denominator.
15787
15788 2002-06-14  Kevin Ryde  <kevin@swox.se>
15789
15790         * configure.in (AC_C_BIGENDIAN): Use new style action parameters.
15791
15792         * randlc2x.c: Allow for a<0, allow for c>=2^m2exp.
15793         * randraw.c (lc): Allow for a==0.
15794
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.
15800
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.
15811
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.
15815
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.
15819
15820         * Makefile.am (EXTRA_DIST): Remove mpfr/README, now in mpfr/Makefile.in
15821
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.
15826
15827 2002-06-12  Kevin Ryde  <kevin@swox.se>
15828
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.
15832
15833 2002-06-09  Torbjorn Granlund  <tege@swox.com>
15834
15835         * randraw.c (lc): Remove broken ASSERT_ALWAYS.
15836
15837         * mpn/x86: Update gmp-mparam.h files with current measures *_THRESHOLD
15838         values.
15839         * mpn/x86/p6/mmx/gmp-mparam.h: New file.
15840
15841 2002-06-09  Kevin Ryde  <kevin@swox.se>
15842
15843         * mpn/x86/*/gmp-mparam.h (USE_PREINV_DIVREM_1): Add tuned settings.
15844
15845         * acconfig.h (HAVE_NATIVE_mpn_preinv_divrem_1): New template.
15846
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.
15851
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.
15858
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.
15861
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.
15864
15865         * doc/configuration: Notes on bootstrapping.
15866
15867 2002-06-08  Kevin Ryde  <kevin@swox.se>
15868
15869         * mpfr/tests/tsqrt.c, mpfr/tests/tsqrt_ui.c: Suppress tests if sqrt is
15870         not affected by mpfr_set_machine_rnd_mode.
15871
15872         * mpfr/mul_2si.c: Workaround a mips gcc 2.95.3 bug under -O2 -mabi=n32.
15873
15874         * configure.in (alphev56): Fix to use ev5 path.
15875
15876 2002-06-06  Kevin Ryde  <kevin@swox.se>
15877
15878         * gmp-h.in: Use __gmp_const not const, in a number of places.
15879
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.
15885
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.
15889
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.
15895
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
15898         $MPFR_LIBS.
15899         * mpfr/rnd_mode.c: Use gmp-impl.h to get MPFR_HAVE_FESETROUND.
15900
15901         * tests/mpz/t-sizeinbase.c: Disable fake bits test, such pointer
15902         setups are bogus and have been seen failing on hppa.
15903
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.
15906
15907 2002-06-05  Torbjorn Granlund  <tege@swox.com>
15908
15909         * tests/mpz/t-powm_ui.c Print proper routine name in error message.
15910
15911 2002-06-03  Kevin Ryde  <kevin@swox.se>
15912
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.
15918
15919         * gmp-impl.h (popc_limb): Add versions for Cray and fallback for
15920         arbitrary limb size.
15921
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.
15931
15932 2002-06-01  Kevin Ryde  <kevin@swox.se>
15933
15934         * mpz/powm_ui.c: Fix for result range in certain circumstances.
15935
15936         * mpn/x86/k6/diveby3.asm: Speedup to 10 c/l, same as divexact_1.
15937         Anomaly pointed out by Alexander Kruppa.
15938
15939 2002-05-31  Torbjorn Granlund  <tege@swox.com>
15940
15941         * mpz/export.c: Cast pointer via `unsigned long' when checking
15942         alignment to avoid compiler warnings.
15943
15944 2002-05-29  Kevin Ryde  <kevin@swox.se>
15945
15946         * gmp-impl.h (BSWAP_LIMB): Versions for m68k, powerpc, and arbitrary
15947         limb size.
15948         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_m68k): New define.
15949
15950 2002-05-27  Torbjorn Granlund  <tege@swox.com>
15951
15952         * mpn/generic/mul_basecase.c: Improve MAX_LEFT handling, returning
15953         when possible.  Add code for mpn_addmul_5 and mpn_addmul_6.
15954
15955 2002-05-25  Kevin Ryde  <kevin@swox.se>
15956
15957         * tune/tuneup.c: Misc nailifications, and disable preinv thresholds
15958         with nails.
15959         * tune/speed.h: Use GMP_NUMB_HIGHBIT with mpn_sb_divrem_mn and
15960         mpn_divrem_2.
15961         * mpz/powm.c (redc): Nailify q.
15962
15963         * tests/mpn/t-scan.c: Reduce the amount of testing, to go faster.
15964
15965 2002-05-23  Torbjorn Granlund  <tege@swox.com>
15966
15967         * Version 4.1 released.
15968
15969         * mpn/alpha/ev6/nails/gmp-mparam.h: New file.
15970
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.
15975
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.
15980
15981 2002-05-22  Torbjorn Granlund  <tege@swox.com>
15982
15983         * mpn/alpha/ev6/nails/addmul_1.asm: New file.
15984
15985         * mpz/inp_str.c (mpz_inp_str_nowhite): Nailify.
15986
15987         * mpn/generic/mul_basecase.c: Update pointers before conditional
15988         MAX_LEFT break statements.
15989
15990 2002-05-21  Torbjorn Granlund  <tege@swox.com>
15991
15992         * tests/mpz/t-gcd.c: Test mpz_gcd_ui.
15993
15994         * mpz/lcm_ui.c: Nailify.
15995
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.
15998
15999         * mpz/set_str.c: Nailify.
16000
16001         * randlc2x.c (gmp_randinit_lc_2exp): Nailify.
16002
16003         From Jakub Jelinek:
16004         * longlong.h (add_ssaaaa,sub_ddmmss) [64-bit sparc]:
16005         Make it actually work.
16006
16007 2002-05-18  Torbjorn Granlund  <tege@swox.com>
16008
16009         * mpf/ui_div.c: Shut up compiler warning.
16010
16011         * mpn/generic/mul_basecase.c: Use mpn_addmul_2, mpn_addmul_3, and
16012         mpn_addmul_4, as available.
16013
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.
16017
16018         * configure.in (*-cray-unicos*): Back again to -hscalar0.
16019         (gmp_mpn_functions_optional): Add mul_3, mul_4, addmul_2, addmul_3,
16020         and addmul_4.
16021         * acconfig.h: Add #undefs for new optional mpn functions.
16022
16023 2002-05-18  Kevin Ryde  <kevin@swox.se>
16024
16025         * gmp.texi (Integer Import and Export): Mention Cray unfilled words.
16026
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.
16029
16030 2002-05-17  Torbjorn Granlund  <tege@swox.com>
16031
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.
16035
16036         * mpn/generic/dump.c: Rewrite and nailify.
16037
16038 2002-05-16  Kevin Ryde  <kevin@swox.se>
16039
16040         * mpfr/Makefile.am (EXTRA_DIST): Add BUGS file.
16041
16042 2002-05-15  Torbjorn Granlund  <tege@swox.com>
16043
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.
16047
16048 2002-05-14  Torbjorn Granlund  <tege@swox.com>
16049
16050         * configure.in (*-cray-unicos*): Pass -hscalar0 to work around
16051         compiler bug for mpz/import.c.
16052
16053 2002-05-11  Torbjorn Granlund  <tege@swox.com>
16054
16055         * mpz/import.c: Cast pointer via `unsigned long' when checking
16056         alignment to avoid compiler warnings.
16057
16058         * mpn/generic/rootrem.c: Adjust allocation of qp temporary area.
16059
16060 2002-05-09  Kevin Ryde  <kevin@swox.se>
16061
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.
16065
16066 2002-05-09  Torbjorn Granlund  <tege@swox.com>
16067
16068         * mpn/generic/rootrem.c: Use temp space for root, copy value in place
16069         before returning.
16070         * mpz/root.c: Don't allocate extra limb for root value.
16071         * mpz/perfpow.c: Undo last change.
16072
16073 2002-05-08  Torbjorn Granlund  <tege@swox.com>
16074
16075         * gmp-impl.h (powerpc BSWAP_LIMB_FETCH): Rename local variable to make
16076         it not clash with caller.
16077
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
16081         pow_1.c
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.
16085
16086 2002-05-08  Kevin Ryde  <kevin@swox.se>
16087
16088         * gmp-impl.h (MUL_KARATSUBA_THRESHOLD etc): Remove forced nail values.
16089
16090         * mpf/fits_u.h, mpf/fits_s.h, tests/mpf/t-fits.c: Ignore fraction
16091         part, making the code match the documentation.
16092
16093         * gmpxx.h (struct __gmp_binary_minus): Use mpz_ui_sub.
16094
16095 2002-05-07  Kevin Ryde  <kevin@swox.se>
16096
16097         * mpn/powerpc32/README: New file.
16098
16099         * mpz/root.c: Use unsigned long with mpz_sub_ui not mp_limb_t.
16100
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.
16104
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
16111         for operand of 0.
16112         (Language Bindings): Add GNU Pascal.
16113         (Low-level Functions): Add GMP_NUMB_MAX.
16114
16115         * tests/mpz/t-import.c, tests/mpz/t-export.c, tests/mpz/t-get_d.c:
16116         New tests.
16117         * tests/mpz/Makefile.am: Add them.
16118
16119         * mpz/import.c, mpz/export.c: New files.
16120         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
16121
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.
16127
16128 2002-05-07  Torbjorn Granlund  <tege@swox.com>
16129
16130         * mpz/aors_ui.h: Nailify.
16131
16132         * tests/mpz/t-addsub.c: New file.
16133         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-addsub.
16134
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.
16139
16140         * gmp-impl.h (MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc
16141         return value.
16142
16143         * gmp-h.in (mpn_pow_1): Add declaration.
16144
16145         * mpn/generic/pow_1.c: Handle exp <= 1.  Reverse rp/tp parity scheme
16146         for bn == 1 arm.
16147
16148         * Rename MP_LIMB_T_HIGHBIT => GMP_LIMB_HIGHBIT.
16149
16150 2002-05-06  Torbjorn Granlund  <tege@swox.com>
16151
16152         * demos/pexpr.c (main): Don't call mpz_sizeinbase with negative base.
16153
16154         * randraw.c (lc): Remove an unused variable.
16155
16156         * mpn/generic/get_str.c: Clarify an algorithm description.
16157
16158         * tests/mpf/t-trunc.c: Nailify.
16159         * tests/mpf/t-set_si.c: Disable for nails.
16160
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.
16182
16183         * gmp-impl.h (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Nailify.
16184
16185         * mpz/get_si.c: Misc variable name changes.
16186
16187         * mpf/fits_u.h: Rewrite - nailify.
16188         * mpf/fits_s.h: Likewise.
16189
16190         * mpz/mod.c: Disambiguate if-statament with extra {}.
16191
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.
16209
16210 2002-05-04  Torbjorn Granlund  <tege@swox.com>
16211
16212         * mpn/generic/gcd.c: Additional nailify changes.
16213
16214 2002-05-04  Kevin Ryde  <kevin@swox.se>
16215
16216         * gmp-h.in (__GNU_MP_VERSION): Set to 4.1.
16217         * Makefile.am (-version-info): Bump for new release.
16218
16219 2002-04-30  Torbjorn Granlund  <tege@swox.com>
16220
16221         * mpn/generic/divrem_1.c: Additional nailify changes.
16222         * mpn/generic/mod_1.c: Likewise.
16223
16224         * tests/mpq/t-get_d.c: Print floats with all 16 digits.
16225
16226         * mpq/get_d.c: Nailify.
16227
16228         * tests/mpq/t-set_f.c: Disable for nails.
16229
16230         * mpz/get_d.c: Nailify.
16231
16232         * gmp-impl.h (LIMBS_PER_DOUBLE, MP_BASE_AS_DOUBLE): Nailify.
16233
16234         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Cast maxval to before shifting it.
16235
16236         * extract-dbl.c: Nailify.
16237
16238 2002-04-29  Torbjorn Granlund  <tege@swox.com>
16239
16240         * mpq/md_2exp.c (mord_2exp): Nailify.
16241
16242         * mpq/cmp_ui.c: Nailify.
16243
16244         * mpq/cmp.c (mpq_cmp): Nailify.
16245
16246         * mpn/generic/gcd.c: Nailify.  GNUify code layout.
16247
16248         * mpn/generic/gcdext.c: Nailify.  Misc changes.
16249
16250         * tests/mpz/t-sqrtrem.c: Let argv[1] mean # of repetitions.
16251         * tests/mpz/t-gcd.c: Likewise.
16252
16253         * mpz/gcd.c: Nailify.
16254
16255         * mpn/generic/random.c: Nailify.
16256
16257         * gmp-impl.h (modlimb_invert): Nailify.
16258
16259 2002-04-27  Torbjorn Granlund  <tege@swox.com>
16260
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.
16264
16265 2002-04-27  Kevin Ryde  <kevin@swox.se>
16266
16267         * gmp-impl.h (JACOBI_MOD_OR_MODEXACT_1_ODD): Allow for odd
16268         GMP_NUMB_BITS.
16269
16270         * tune/time.c (sgi_works_p): Allow for 64-bit counter, and fix
16271         SGI_CYCLECNTR_SIZE handling.
16272
16273         * demos/expr/exprfr.c: Add nan and inf constants.
16274         * demos/expr/t-expr.c: Exercise them.
16275
16276 2002-04-26  Torbjorn Granlund  <tege@swox.com>
16277
16278         * mpz/cmp_ui.c: Fix overflow conditions for nails.
16279
16280         * gmp-h.in (mpz_get_ui): Fix typo from last change.
16281
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.
16285
16286 2002-04-24  Torbjorn Granlund  <tege@swox.com>
16287
16288         * mpn/generic/gcdext.c: Simplify by using mpn_tdiv_qr instead of
16289         mpn_divmod.
16290
16291 2002-04-24  Kevin Ryde  <kevin@swox.se>
16292
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.
16296
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.
16300
16301 2002-04-23  Torbjorn Granlund  <tege@swox.com>
16302
16303         * mpz/dive_ui.c: Fix typo.
16304
16305         * mpz/fits_s.h: Rewrite.
16306
16307         * mpz/jacobi.c: Nailify.
16308         * mpz/kronuz.c: Additional nailify changes.
16309         * mpz/kronsz.c: Likewise.
16310
16311 2002-04-23  Kevin Ryde  <kevin@swox.se>
16312
16313         * demos/expr/Makefile.am (LDADD): Add $(LIBM) for the benefit of mpfr.
16314
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.
16324
16325         * gmp-impl.h, mpn/mp_bases.c: Add back GMP_NUMB_BITS==30 bases data.
16326
16327         * mpfr/get_d.c: Patch from Paul to avoid problem with constant folding
16328         in gcc on OSF.
16329
16330         * mpn/lisp/gmpasm-mode.el: Remove mention of defunct LF macro.
16331
16332 2002-04-22  Torbjorn Granlund  <tege@swox.com>
16333
16334         * demos/pexpr.c: Handle "binomial" operator.
16335
16336         * mpz/cmp_ui.c: Move assignments of `up' out of conditionals.
16337
16338         * mpn/generic/gcdext.c: Fix fencepost error in STAT code.
16339
16340         * gmp-impl.h (mpn_com_n): Nailify.
16341
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.
16348
16349         * tests/misc/t-printf.c (CHECK_N): Add cast to allow `char' to be an
16350         unsigned type.
16351         * tests/misc/t-scanf.c: Likewise.
16352
16353         * mpz/mul_i.h: Rework nails code to handle parameter overlap.
16354
16355         * tests/mpz/t-set_f.c: Disable for nails.
16356
16357 2002-04-21  Torbjorn Granlund  <tege@swox.com>
16358
16359         * mpz/set_si.c: Add cast to support LONG_LONG_LIMB.
16360         * mpz/iset_si.c: Likewise.
16361
16362         * mpz/bin_ui.c: Nailify.
16363         * mpz/bin_uiui.c: Nailify.
16364
16365         * mpz/cmpabs_ui.c: Nailify.
16366
16367         * tests/mpz/t-aorsmul.c: Nailify.
16368         * mpz/aorsmul_i.c (mpz_addmul_ui, mpz_submul_ui): Nailify better.
16369
16370 2002-04-20  Torbjorn Granlund  <tege@swox.com>
16371
16372         * tests/mpz/t-fdiv_ui.c: Check mpz_fdiv_ui.
16373         * tests/mpz/t-tdiv_ui.c: Check mpz_tdiv_ui.
16374
16375         * mpz/tdiv_ui.c: Rewrite nails code.
16376         * mpz/fdiv_ui.c: Nailify.
16377
16378         * tests/mpz/t-tdiv_ui.c: Check returned remainders.
16379         * tests/mpz/t-fdiv_ui.c: Merge in recent t-tdiv_ui changes.
16380
16381         * mpz/tdiv_q_ui.c: Remove spurious TMP_* calls.
16382
16383         * mpz/fdiv_qr_ui.c: Nailify.
16384         * mpz/fdiv_q_ui.c: Nailify.
16385         * mpz/fdiv_r_ui.c: Nailify.
16386
16387         * mpz/get_si.c: Misc nailify changes to shut up compiler warnings.
16388
16389         * mpz/ui_pow_ui.c: Fix typo in last change.
16390
16391 2002-04-20  Kevin Ryde  <kevin@swox.se>
16392
16393         * tests/misc/t-printf.c, tests/misc/t-scanf.c: Check all %n types.
16394
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.
16400
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.
16404
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.
16408
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.
16413
16414         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm: Add
16415         NAILS_SUPPORT indicators.
16416
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.
16420
16421         * mpfr/mpfr-test.h: Include config.h, for the benefit of test programs
16422         not using gmp-impl.h.
16423
16424 2002-04-19  Torbjorn Granlund  <tege@swox.com>
16425
16426         * tests/mpz/t-scan.c: Nailify.
16427
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.
16432
16433         * mpz/cmp_ui.c: Nailify.
16434
16435         * mpz/ui_pow_ui.c: Misc nailify changes to shut up compiler warnings.
16436
16437         * mpz/scan0.c: Nailify.
16438         * mpz/scan1.c: Nailify.
16439
16440         * tests/mpz/t-sizeinbase.c (mpz_fake_bits): Nailify.
16441
16442 2002-04-18  Torbjorn Granlund  <tege@swox.com>
16443
16444         * mpz/aorsmul_i.c: Nailify.
16445
16446         * mpz/cmp_si.c: Nailify (botched).
16447
16448         * mpz/ui_pow_ui.c: Nailify.
16449
16450         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Nailify.
16451
16452         * mpz/fits_s.h: Nailify.
16453
16454         * tests/mpz/bit.c (check_tstbit): Nailify.
16455
16456         From Paul Zimmermann:
16457         * mpn/generic/sqrtrem.c: Nailify.
16458
16459         * mpz/n_pow_ui.c: Nailify.
16460
16461         * mpz/cfdiv_r_2exp.c: Nailify.
16462
16463         * randraw.c (lc): Undo: Let mpn_rshift put result in place to avoid
16464         extra MPN_COPY.
16465
16466 2002-04-17  Torbjorn Granlund  <tege@swox.com>
16467
16468         * mpz/clrbit.c: Add two GMP_NUMB_MASK masks after addition.
16469
16470         * mpn/generic/random2.c (LOGBITS_PER_BLOCK): Decrease to 4.
16471
16472         * gmp-impl.h (nail DIV_DC_THRESHOLD): Decrease to 50 to allow fast
16473         division.
16474
16475         * mpn/generic/random2.c: Nailify.
16476
16477         * mpz/fac_ui.c: Nailify.
16478
16479         * mpz/mul_i.h: #if ... #endif code block to shut up gcc warnings.
16480
16481         * mpn/generic/sqrtrem.c: Adopt to GNU coding standards.
16482         (mpn_dc_sqrtrem): New name for mpn_dq_sqrtrem.
16483         Partial nailification.
16484
16485         * configure.in: As a temporary hack, clear extra_functions for nails
16486         builds.
16487
16488         * gmp-h.in (mpz_get_ui): #if ... #endif else code block to shut up gcc
16489         warnings.
16490
16491 2002-04-17  Kevin Ryde  <kevin@swox.se>
16492
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
16495         in one run).
16496
16497         * mpn/generic/scan0.c, mpn/generic/scan1.c: Nailify.
16498
16499         * tests/mpn/t-scan.c: New file.
16500         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
16501
16502         * tests/refmpn.c, tests/tests.h (refmpn_tstbit): Use unsigned long for
16503         bit index.
16504         (refmpn_setbit, refmpn_clrbit, refmpn_scan0, refmpn_scan1): New
16505         functions.
16506
16507         * mpfr/cmp_ui.c (mpfr_cmp_si_2exp): Fix b==0 i!=0 case.
16508
16509 2002-04-17  Gerardo Ballabio <gerardo.ballabio@unimib.it>
16510
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.
16514
16515 2002-04-17  Torbjorn Granlund  <tege@swox.com>
16516
16517         * mpz/powm.c: Nailify.
16518         * mpz/powm_ui.c: Nailify.
16519
16520 2002-04-16  Torbjorn Granlund  <tege@swox.com>
16521
16522         * mpz/hamdist.c: Nailify.
16523         * tests/misc.c (urandom): Nailify.
16524
16525         * mpz/get_si.c: Nailify.
16526         * gmp-h.in (mpz_get_ui): Nailify.  Streamline (and probably upset
16527         memory checkers).
16528
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.
16532
16533         * mpz/iset_si.c: Nailify.
16534         * mpz/iset_ui.c: Nailify
16535
16536         * tests/mpz/convert.c (main): Print test number in error message.
16537
16538         * mpn/generic/get_str.c (mpn_sb_get_str): Shift up `frac' into nails
16539         field after bignum division.
16540
16541 2002-04-16  Kevin Ryde  <kevin@swox.se>
16542
16543         * gmp-h.in, gmp-impl.h (GMP_NAIL_MASK): Move to gmp.h.
16544
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.
16552
16553         * macos/configure (%vars): Remove __GMP from substitutions, per change
16554         to main configure.
16555
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.
16560
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.
16565
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.
16571
16572         * configure.in, acinclude.m4: Establish GMP_NAIL_BITS and
16573         GMP_LIMB_BITS for gmp-h.in configure tests.
16574
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.
16578
16579 2002-04-15  Torbjorn Granlund  <tege@swox.com>
16580
16581         * mpn/generic/divrem_1.c (EXTRACT): Remove.
16582
16583         * tests/mpz/t-tdiv_ui.c (dump_abort): Accept argument for error string.
16584
16585         * mpz/rrandomb.c: Nailify.  Needs further work.
16586
16587         * mpn/generic/mod_1.c: Nailify.
16588
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.
16592
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
16596         difference.
16597
16598         * mpn/generic/set_str.c: Nailify.
16599
16600         * gmp-h.in (__GMPN_ADD, __GMPN_SUB): Nailify.
16601
16602 2002-04-14  Torbjorn Granlund  <tege@swox.com>
16603
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.
16611
16612         * mpz/set_si.c: Nailify.
16613         * mpz/set_ui.c: Nailify.
16614         * mpz/mul_i.h: Nailify.
16615
16616         * tests/mpz/t-mul_i.c: Actually test _ui routines.  Add some more test
16617         values.
16618
16619         * mpn/generic/mul_n.c: Finish nailifying toom3 code.
16620
16621 2002-04-13  Kevin Ryde  <kevin@swox.se>
16622
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.
16626
16627         * mpfr/tests/Makefile.am: Correction to convenience rule for libmpfr.a.
16628
16629 2002-04-11  Kevin Ryde  <kevin@swox.se>
16630
16631         * mpfr/set_q.c: gmp-impl.h before mpfr.h to avoid _PROTO redefine.
16632
16633         * mpfr/*, configure.in: Update to new mpfr 2.0.1.
16634
16635         * tests/refmpn.c (refmpn_udiv_qrnnd, refmpn_divmod_1c_workaround):
16636         Fixes for nails.
16637
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.
16642
16643 2002-04-11  Gerardo Ballabio <gerardo.ballabio@unimib.it>
16644
16645         * gmpxx.h: Remove bool combinations, remove mpf_class::get_str2, only
16646         need <iosfwd> now.
16647
16648 2002-04-11  Torbjorn Granlund  <tege@swox.com>
16649
16650         * mpn/generic/diveby3.c: Nailify.
16651         * gmp-impl.h (MODLIMB_INVERSE_3): Nailify.
16652
16653         * mpn/generic/mul_n.c: Nailify Toom3 code.
16654
16655 2002-04-10  Kevin Ryde  <kevin@swox.se>
16656
16657         * gmp-impl.h (MPN_KARA_MUL_N_MINSIZE, MPN_KARA_SQR_N_MINSIZE): Set to
16658         3, as needed by nails case.
16659
16660         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails]: Fix vl
16661         assert, add rp,n and up,n asserts.
16662
16663         * mpfr/Makefile.am: Add new mpfr-math.h, install mpf2mpfr.h.
16664
16665 2002-04-10  Torbjorn Granlund  <tege@swox.com>
16666
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.
16673
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.
16677
16678         * gmp-h.in (GMP_NUMB_MASK): New #define.
16679         (__GMPN_AORS_1): Add version for nails.
16680
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.
16684
16685 2002-04-09  Kevin Ryde  <kevin@swox.se>
16686
16687         * mpfr/*, configure.in: Update to mpfr 2.0.1.
16688
16689         * tests/refmpn.c (refmpn_mul_1c, lshift_make): Corrections for nails.
16690         * tssts/refmpn.c, tests/tests.h (refmpn_cmp_allowzero): New function.
16691
16692         * mpn/generic/mul_1.c [nails]: Fix vl assert, add {up,n} assert.
16693
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.
16697
16698         * tests/mpz/t-set_si.c: Add nails support.
16699
16700 2002-04-05  Torbjorn Granlund  <tege@swox.com>
16701
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.
16706
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.
16717
16718 2002-04-02  Kevin Ryde  <kevin@swox.se>
16719
16720         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE) [powerpc]:
16721         Corrections to constraints, and restrict to bigendian.
16722
16723 2002-03-31  Kevin Ryde  <kevin@swox.se>
16724
16725         * tests/mpz/dive.c: Better diagnostics.
16726
16727         * tests/devel/try.c (mpn_get_str, mpn_umul_ppmm_r): New tests.
16728
16729         * tests/misc.c, tests/tests.h (byte_diff_lowest, byte_diff_highest):
16730         New functions.
16731
16732         * tests/t-bswap.c: New file.
16733         * tests/Makefile.am (check_PROGRAMS): Add it.
16734
16735         * tests/mpn/t-aors_1.c, tests/mpn/t-iord_u.c: Add nails support.
16736
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.
16741
16742         * tests/trace.c, tests/tests.h (byte_trace, byte_tracen): New
16743         functions.
16744         * tests/trace.c: Handle NULL operands.
16745
16746         * tests/refmpn.c, tests/devel/try.c, tune/speed.c: Add preliminary
16747         nail support.
16748
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):
16752         New functions.
16753
16754         * gmp-impl.h, tests/refmpn.c (ASSERT_LIMB): Renamed from
16755         ASSERT_MP_LIMB_T.
16756
16757         * mpn/x86/*/*.asm, mpn/powerpc32/*/*.asm, mpn/powerpc64/*/*.asm: Put
16758         speeds after the copyright notice, so as to keep that clear.
16759
16760 2002-03-29  Kevin Ryde  <kevin@swox.se>
16761
16762         * configure.in (powerpc*-*-aix*): Correction to xlc -qarch selection,
16763         for 32-bit mode.
16764
16765 2002-03-28  Torbjorn Granlund  <tege@swox.com>
16766
16767         * mpn: Fix spacing in many files.
16768
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.
16771
16772         * mpn/pa64/add_n.asm: Trim another 0.125 cycle/limb.  Fix a comment.
16773         * mpn/pa64/sub_n.asm: Likewise.
16774
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.
16778
16779 2002-03-28  Kevin Ryde  <kevin@swox.se>
16780
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
16784         Briggs.
16785
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
16788         not portable.
16789
16790         * demos/expr/run-expr.c: Declare optarg, optind, opterr if necessary.
16791         * configure.in, demos/expr/expr-config-h.in: Configs for this.
16792
16793 2002-03-27  Torbjorn Granlund  <tege@swox.com>
16794
16795         * mpn/Makefile.am (TARG_DIST): Remove pa64w and hppa, add pa32.
16796
16797         * configure.in (path_20w): Remove pa64w.
16798
16799         * mpn/pa64/udiv_qrnnd.asm: Tweak for PA8000 performance comparative to
16800         that on PA8500.
16801
16802 2002-03-26  Torbjorn Granlund  <tege@swox.com>
16803
16804         * mpn/pa32: New name for mpn/hppa.
16805         * configure.in: Corresponding changes.
16806
16807         * mpn/pa64/umul_ppmm.asm: New file, generalized for both 2.0N and 2.0W.
16808         * mpn/pa64/umul_ppmm.S: Remove.
16809
16810         * mpn/pa64/udiv_qrnnd.asm: Generalize for both 2.0N and 2.0W.
16811         * mpn/pa64w/udiv_qrnnd.asm: Remove.
16812
16813 2002-03-26  Kevin Ryde  <kevin@swox.se>
16814
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.
16817
16818         * configure (hppa2.0w): Set path to "pa64w pa64".
16819
16820         * acinclude.m4, configure.in (GMP_C_INLINE): New macro.
16821         * acinclude.m4 (GMP_H_EXTERN_INLINE): Use it, and fix "yes" handling.
16822
16823 2002-03-25  Torbjorn Granlund  <tege@swox.com>
16824
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.
16833
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.
16839
16840         * mpn/pa64/sqr_diagonal.asm: Generalize for both 2.0N and 2.0W.
16841
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.
16850
16851 2002-03-24  Kevin Ryde  <kevin@swox.se>
16852
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.
16856
16857         * mpn/powerpc32/750/com_n.asm: New file.
16858
16859         * mpfr/tests/tout_str.c: Disable random tests, since they fail on
16860         alphaev56-unknown-freebsd4.1 and do nothing by default.
16861
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.
16865
16866         * demos/factorize.c: Use mpn_random() instead of random(), to avoid
16867         portability problems.
16868
16869         * demos/isprime.c (print_usage_and_exit): Declare as "void" to avoid
16870         warnings.
16871
16872         * demos/pexpr.c (setup_error_handler): Corrections to sigstack code.
16873
16874         * demos/calc/calc.y: Add some `;'s to make bison 1.34 happy.
16875
16876 2002-03-23  Torbjorn Granlund  <tege@swox.com>
16877
16878         * mpn/pa64/addmul_1.asm: New file with twice faster code; generalized
16879         for both 2.0N and 2.0W.
16880
16881 2002-03-22  Kevin Ryde  <kevin@swox.se>
16882
16883         * tune/time.c: Add SGI hardware counter measuring method, change some
16884         abort()s into ASSERT_FAIL()s.
16885
16886         * configure.in (AC_CHECK_HEADERS): Add fcntl.h and sys/syssgi.h.
16887         (AC_CHECK_FUNCS): Add syssgi.
16888
16889         * configure.in, mpfr/Makefile.am, mpfr/tests/Makefile.am: Use
16890         -mieee-with-inexact or -ieee_with_inexact for mpfr on alpha, so
16891         denorms work.
16892
16893         * mpfr/isinteger.c: Fix a memory leak.
16894
16895 2002-03-21  Torbjorn Granlund  <tege@swox.com>
16896
16897         * tune/speed.c (struct choice_t): Make `r' an mp_limb_t.
16898
16899 2002-03-21  Kevin Ryde  <kevin@swox.se>
16900
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
16904         constants.
16905
16906         * gmp.texi (Number Theoretic Functions): Clarify sign of GCD returned
16907         by mpz_gcdext.
16908
16909         * demos/pexpr.c, demos/pexpr-config-h.in, configure.in: Use an
16910         autoconf test for stack_t.
16911
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.
16916
16917         * gmp-impl.h (mp_bases): Add __GMP_DECLSPEC, for the benefit of
16918         tests/t-constants.c.
16919
16920         * tune/many.pl, tune/speed.h: Remove suffix hack for back.asm.
16921
16922 2002-03-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
16923
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.
16927
16928         * mpfr/log10.c: Fix hangs on certain inputs.
16929
16930 2002-03-20  Torbjorn Granlund  <tege@swox.com>
16931
16932         * demos/pexpr.c (setup_error_handler): Declare `s', the first
16933         sigaltstack parameter, using `stack_t' just on AIX.
16934
16935 2002-03-19  Torbjorn Granlund  <tege@swox.com>
16936
16937         * mpn/powerpc32/mul_1.asm: Use free caller-saves registers instead
16938         of the callee-saves r30 and r31.
16939
16940 2002-03-19  Kevin Ryde  <kevin@swox.se>
16941
16942         * tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
16943         previously got the wrong result from "bogomips".
16944
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.
16948
16949         * longlong.h (count_trailing_zeros) [vax]: Add a version using ffs,
16950         but commented out.
16951
16952 2002-03-17  Kevin Ryde  <kevin@swox.se>
16953
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.
16958
16959         * gmp.texi (Known Build Problems): Note `make' problem with long
16960         libgmp.la dependencies list.
16961
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.
16966
16967         * configure.in: Use AC_COPYRIGHT.
16968         Add m4_pattern_allow(GMP_MPARAM_H_SUGGEST).
16969
16970         * tune/Makefile.am (libdummy.la): Remove this, sqr_basecase.c already
16971         gets an ansi2knr rule from nodist_tuneup_SOURCES.
16972
16973         * longlong.h (count_leading_zeros) [pentiumpro gcc<3]: Test
16974         HAVE_HOST_CPU_i686 too.
16975
16976         * mpz/out_raw.c (HTON_LIMB_STORE): Fix a typo in big endian #if.
16977
16978 2002-03-14  Kevin Ryde  <kevin@swox.se>
16979
16980         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm,
16981         mpn/x86/k6/mmx/com_n.asm: Add nails support.
16982
16983         * texinfo.tex: Update to 2002-03-01.06 (per texinfo 4.1).
16984         * gmp.texi (@ma): Remove, @math does this now.
16985
16986         * mpfr/tests/reuse.c: Clear op1 and op2 flags only in their respective
16987         outer loops.
16988
16989         * configure.in (--enable-cxx): Correction to the default stated in the
16990         help string.
16991         (power*-*-aix*, not powerpc): Use aix.m4, don't run
16992         GMP_ASM_POWERPC_R_REGISTERS or use powerpc-defs.m4.
16993
16994 2002-03-13  Torbjorn Granlund  <tege@swox.com>
16995
16996         * mpn/sparc32/gmp-mparam.h: New file.
16997
16998 2002-03-13  Kevin Ryde  <kevin@swox.se>
16999
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.
17003
17004         * mpz/inp_raw.c (NTOH_LIMB_FETCH) [generic 16bit]: Remove spurious "+".
17005
17006         * mpfr/acos.c: Avoid a memory leak for certain operands.
17007
17008         * acinclude.m4, configure.in (GMP_C_DOUBLE_FORMAT): New macro.
17009
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.
17013
17014         * config.guess (powerpc*-*-*): Use #ifdef on constants POWER_630 etc
17015         in the AIX test, since old versions don't have them all.
17016
17017 2002-03-11  Kevin Ryde  <kevin@swox.se>
17018
17019         * configure.in (LIBC211): New AC_DEFINE, for mpfr.
17020
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).
17027
17028         * mpn/powerpc32/750: New directory.
17029         * configure.in (powerpc740, powerpc750, powerpc7400): Use it.
17030         * mpn/powerpc32/750/gmp-mparam.h: New file.
17031
17032         * config.sub, gmp.texi (ultrasparc1): Remove this, just use plain
17033         "ultrasparc".
17034
17035 2002-03-10  Kevin Ryde  <kevin@swox.se>
17036
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
17045         sorted out.
17046
17047         * configure.in (powerpc*-*-*): Separate gcc and xlc cpu flags setups
17048         for clarity.
17049
17050         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]: New
17051         macros.
17052
17053 2002-03-07  Kevin Ryde  <kevin@swox.se>
17054
17055         * gmp.texi (Build Options): Note all the ultrasparcs accepted.
17056         (Language Bindings): Add Math::BigInt::GMP.
17057
17058         * config.sub (ultrasparc2i): New cpu type.
17059         * config.guess (sparc-*-*, sparc64-*-*): Add some exact CPU detection.
17060
17061 2002-03-05  Kevin Ryde  <kevin@swox.se>
17062
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
17066         longlong.h).
17067         * acconfig.h (HAVE_HOST_CPU_alphaev68): New define.
17068
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.
17072
17073 2002-03-04  Torbjorn Granlund  <tege@swox.com>
17074
17075         * mpn/generic/pow_1.c: New file.
17076
17077 2002-03-03  Kevin Ryde  <kevin@swox.se>
17078
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.
17084
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.
17088
17089         * gmp-h.in, mp-h.in (__GMP_DECLSPEC, __GMP_DECLSPEC_XX): Test
17090         __WIN32__ for Borland C, reported by "delta trinity".
17091
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.
17095
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.
17103
17104         * longlong.h (COUNT_TRAILING_ZEROS_TIME): Remove, no longer used.
17105
17106         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): Correction to
17107         __totbits for nails.
17108
17109         * gmp-impl.h (JACOBI_LS0): Test size before limb, to pacify valgrind.
17110         (JACOBI_0LS): Ditto, and fix parens around arguments.
17111
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.
17116
17117         * configure.in (*sparc*): Fix cycle counter setups for ABI=64.
17118
17119 2002-02-28  Torbjorn Granlund  <tege@swox.com>
17120
17121         * mpn/vax/gmp-mparam.h: New file.
17122
17123 2002-02-28  Kevin Ryde  <kevin@swox.se>
17124
17125         * gmp-h.in (gmp_errno, gmp_version): Move into extern "C" block,
17126         reported by librik@panix.com.
17127
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".
17132
17133         * gmp-impl.h (va_copy): Fall back on memcpy, not "=".
17134
17135         * mpn/generic/pre_mod_1.c: Add a comment about obsolescence.
17136
17137         * tune/time.c (MICROSECONDS_P): Don't trust time differences of 1
17138         microsecond.
17139
17140         * tests/cxx/t-ostream.cc: Use "const char *" not just "char *" for
17141         test data strings, avoids warnings on Sun CC.
17142
17143 2002-02-27  Torbjorn Granlund  <tege@swox.com>
17144
17145         * configure.in: For sparc under solaris2.[7-9], pass -fsimple=1 to
17146         disable some crazy -fast optimizations.
17147
17148 2002-02-25  Torbjorn Granlund  <tege@swox.com>
17149
17150         * configure.in: For sparc under solaris2.[7-9], pass -fns=no to enable
17151         denorm handling under -fast.
17152
17153 2002-02-25  Kevin Ryde  <kevin@swox.se>
17154
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.
17158
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.
17162
17163         * tune/time.c (DIFF_SECS_ROUTINE): Eliminate the unused "type"
17164         parameter, try to make the code a bit clearer.
17165
17166         * tune/freq.c: Reduce the period measured for cycles versus
17167         gettimeofday, add cycles versus microsecond getrusage.
17168
17169         * mpz/array_init.c: "i" should be mp_size_t, noticed by E. Khong.
17170
17171 2002-02-24  Torbjorn Granlund  <tege@swox.com>
17172
17173         * configure.in: For sparc under solaris2.[7-9], pass -fast instead of
17174         other optimization options.
17175
17176 2002-02-23  Kevin Ryde  <kevin@swox.se>
17177
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.
17181
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.
17185
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.
17188
17189 2002-02-22  Torbjorn Granlund  <tege@swox.com>
17190
17191         * demos/pexpr.c: Increase RLIMIT_STACK to 4Mibyte.
17192
17193 2002-02-22  Kevin Ryde  <kevin@swox.se>
17194
17195         * tune/tuneup.c: Don't confuse gcc with mipspro cc in diagnostic.
17196
17197 2002-02-20  Torbjorn Granlund  <tege@swox.com>
17198
17199         * configure.in (mips*-*-irix[6789]*]): Set `extra_functions_n32', not
17200         `extra_functions'.
17201
17202         * printf/doprnt.c: Conditionally include inttypes.h.
17203         * printf/repl-vsnprintf.c: Likewise.
17204         * scanf/doscan.c: Likewise.
17205
17206 2002-02-20  Kevin Ryde  <kevin@swox.se>
17207
17208         * mpn/x86/k7/mmx/com_n.asm: New file.
17209
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.
17212
17213         * mpn/generic/mod_34lsub1.c: Note this is for internal use.
17214
17215 2002-02-19  Torbjorn Granlund  <tege@swox.com>
17216
17217         * Clean up *_THRESHOLD names.  Many files affected.
17218
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'.
17223
17224 2002-02-19  Kevin Ryde  <kevin@swox.se>
17225
17226         * acinclude.m4, configure.in (GMP_PROG_LEX): New macro.
17227
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).
17231
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.
17235
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.
17240
17241 2002-02-18  Torbjorn Granlund  <tege@swox.com>
17242
17243         * longlong.h: Add basic x86-64 support.
17244
17245 2002-02-17  Torbjorn Granlund  <tege@swox.com>
17246
17247         * demos/pexpr.c: Support `-X' for upper case hex, make `-x' output
17248         lower case hex.
17249
17250         * mpn/mips2/umul.s: Make it actually work.
17251         * mpn/mips3/umul.asm: New file.
17252
17253         * mpn/mips2/gmp-mparam.h: New file.
17254
17255 2002-02-16  Torbjorn Granlund  <tege@swox.com>
17256
17257         * mpn/generic/get_str.c (mpn_sb_get_str): Round frac upwards after
17258         umul_ppmm calls.
17259
17260 2002-02-16  Kevin Ryde  <kevin@swox.se>
17261
17262         * config.guess (alpha-*-*): Do alpha exact cpu probes on any system,
17263         and only if configfsf.guess gives a plain "alpha".
17264
17265         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect a gcc 3.0.3 powerpc64
17266         linker invocation problem.
17267
17268 2002-02-15  Torbjorn Granlund  <tege@swox.com>
17269
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.
17272
17273         * config.guess: Rewrite Alpha subtype detection code for *bsd systems.
17274
17275 2002-02-15  Kevin Ryde  <kevin@swox.se>
17276
17277         * gmp.texi (Build Options): Note powerpc exact cpu types.
17278         (Debugging): Advertise DEBUG in memory.c.
17279
17280         * config.sub, config.guess: Add some powerpc exact cpus.
17281         * configure.in: Add configs for them.
17282
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.
17286
17287         * gmp-h.in: g++ 3 demands __GMP_NOTHROW is before other attributes.
17288
17289 2002-02-14  Torbjorn Granlund  <tege@swox.com>
17290
17291         * mpn/alpha/mul_1.asm: Fix typo preventing build on T3E systems.
17292
17293 2002-02-14  Kevin Ryde  <kevin@swox.se>
17294
17295         * tune/tuneup.c (tune_set_str): Increase max_size, for the benefit of
17296         alpha.
17297
17298         * macos/README: Bug reports to bug-gmp@gnu.org, clarify MacOS X a bit.
17299
17300         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Add missing TMP_FREE.
17301
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.
17305
17306 2002-02-12  Torbjorn Granlund  <tege@swox.com>
17307
17308         * mpn/alpha/mul_1.asm: Add mpn_mul_1c entry.
17309
17310         * mpn/pa64w/sqr_diagonal.asm: Use L() for labels.
17311
17312 2002-02-11  Torbjorn Granlund  <tege@swox.com>
17313
17314         * mpn/generic/get_str.c (mpn_sb_get_str): Change declaration of rp to
17315         accommodate tuneup compiles.
17316
17317 2002-02-11  Kevin Ryde  <kevin@swox.se>
17318
17319         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (PROLOGUE_cpu): Add
17320         noalign option.
17321         * mpn/alpha/default.m4 (PROLOGUE_cpu): use ALIGN instead of ".align".
17322
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.
17329
17330 2002-02-11  Torbjorn Granlund  <tege@swox.com>
17331
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.
17335
17336 2002-02-10  Torbjorn Granlund  <tege@swox.com>
17337
17338         * mpn/generic/set_str.c (mpn_set_str): Undo this:
17339         Change invocations of mpn_add_1 to instead use mpn_incr_u.
17340
17341         * tests/mpz/convert.c: Free str only after it is used in error message.
17342
17343         * mpn/generic/get_str.c (mpn_sb_get_str): Combine tail code for base 10
17344         and generic bases.
17345
17346         * mpn/mp_bases.c: Add entries for base 256.  Remove __ prefix from
17347         table name.
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.
17353
17354 2002-02-09  Torbjorn Granlund  <tege@swox.com>
17355
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.
17358
17359 2002-02-09  Kevin Ryde  <kevin@swox.se>
17360
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.
17366
17367         * mpz/iset_str.c [__CHECKER__]: Store a dummy value to the low limb to
17368         stop it appearing uninitialized.
17369
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.
17383
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
17387         MPN_SIZEINBASE.
17388         * mpbsd/mtox.c: Use MPN_SIZEINBASE_16.
17389
17390         * configure.in, mpn/Makefile.am, gmp-impl.h (mpn_sizeinbase): Remove.
17391         * mpn/generic/sizeinbase.c: Remove file.
17392
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.
17396
17397         * Makefile.am (dist-hook): Don't distribute cvs merge ".#" files.
17398
17399 2002-02-08  Torbjorn Granlund  <tege@swox.com>
17400
17401         * configure.in: Override extra_functions for all sparcv8 systems, not
17402         just supersparc.
17403
17404 2002-02-06  Kevin Ryde  <kevin@swox.se>
17405
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.
17409
17410         * printf/doprnt.c: Fix parsing of %s and %p conversions.
17411         * tests/misc/t-printf.c (check_misc): Add some tests.
17412
17413 2002-02-03  Torbjorn Granlund  <tege@swox.com>
17414
17415         * mpn/sparc32/v8/udiv.asm: New file, from v8/supersparc.
17416
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.
17420
17421 2002-02-03  Kevin Ryde  <kevin@swox.se>
17422
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.
17428
17429         * tune/tuneup.c (print_define_remark): New function.
17430         Turn some "#if"s into plain "if"s.
17431
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.
17436
17437 2002-02-02  Torbjorn Granlund  <tege@swox.com>
17438
17439         * mpn/generic/get_str.c (mpn_get_str): Fix typo in a declaration.
17440
17441 2002-02-02  Kevin Ryde  <kevin@swox.se>
17442
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.
17445
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[].
17450
17451 2002-02-01  Torbjorn Granlund  <tege@swox.com>
17452
17453         * tests/mpz/convert.c: Increase operand size.  Add (yet disabled) code
17454         for testing with random strings.
17455
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.
17458
17459 2002-01-31  Kevin Ryde  <kevin@swox.se>
17460
17461         * gmpxx.h (cmp): Renamed from "compare".
17462
17463         * configure.in (AC_C_BIGENDIAN): Don't abort when cross compiling.
17464         (PROLOGUE): Allow new style optional second parameter when grepping.
17465
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.
17470
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
17476         macros.
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.
17482
17483 2002-01-30  Torbjorn Granlund  <tege@swox.com>
17484
17485         * mpn/generic/set_str.c: Rewrite to become sub-quadratic.
17486         (convert_blocks): New function.
17487
17488 2002-01-30  Kevin Ryde  <kevin@swox.se>
17489
17490         * gmp-impl.h (GMP_NUMB_MASK, GMP_NAIL_MASK, GMP_NUMB_HIGHBIT,
17491         ASSERT_MPN, ASSERT_MP_LIMB_T): New macros.
17492
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.
17499
17500 2002-01-28  Kevin Ryde  <kevin@swox.se>
17501
17502         * mpz/set_si.c, mpz/iset_si.c: Store to _mp_d[0] unconditionally, use
17503         an expression for _mp_size.
17504
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.
17507
17508 2002-01-26  Kevin Ryde  <kevin@swox.se>
17509
17510         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use instead a patch from Paul and
17511         Vincent.
17512
17513 2002-01-24  Kevin Ryde  <kevin@swox.se>
17514
17515         * configure.in: Extra quoting to get argument help messages right.
17516
17517         * gmp.texi (Efficiency): Suggest hex or octal for input and output.
17518         (Formatted Output Strings): Mention "*" for width and precision.
17519
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.
17531
17532         * configure.in (--enable-nails): New option.
17533         (GMP_NAIL_BITS, GMP_LIMB_BITS, GMP_NUMB_BITS): New defines for gmp.h
17534         and config.m4.
17535         * gmp-h.in: Add templates.
17536
17537         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use #ifndef to avoid a redefine
17538         error on AIX xlc.
17539
17540 2002-01-23  Torbjorn Granlund  <tege@swox.com>
17541
17542         * mpn/generic/get_str.c: Correct type of `out_len'.
17543
17544 2002-01-22  Kevin Ryde  <kevin@swox.se>
17545
17546         * mpn/generic/pre_divrem_1.c: Corrections to some ASSERTs.
17547
17548         * mpfr/mul_ui.c: Don't call mpn_lshift with 0 shift.
17549
17550         * mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
17551
17552 2002-01-21  Torbjorn Granlund  <tege@swox.com>
17553
17554         * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
17555         declaration.
17556         (64-bit powerpc add_ssaaaa): Likewise.
17557
17558 2002-01-20  Kevin Ryde  <kevin@swox.se>
17559
17560         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Use %n to better detect sparc
17561         solaris 2.7 problems.
17562
17563 2002-01-19  Torbjorn Granlund  <tege@swox.com>
17564
17565         * demos/pexpr.c (mpz_eval_expr): Optimize s^rhs for -1 <= s <= 1.
17566         (cleanup_and_exit): Improve error message wording.
17567
17568 2002-01-19  Kevin Ryde  <kevin@swox.se>
17569
17570         * mpfr/mpfr.h (_PROTO): Use __GMP_PROTO, for compatibility with
17571         gmp-impl.h.
17572
17573 2002-01-17  Torbjorn Granlund  <tege@swox.com>
17574
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.
17577
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().
17580
17581 2002-01-17  Kevin Ryde  <kevin@swox.se>
17582
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++.
17588
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.
17596
17597         * gmp-h.in: Use __gmp prefix on variables in inlines.
17598
17599         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Remove __i, unused.
17600
17601         * mpn/generic/mul_fft.c: Use HAVE_NATIVE_mpn_addsub_n, not ADDSUB.
17602         Use CNST_LIMB for some constants.
17603
17604 2002-01-15  Kevin Ryde  <kevin@swox.se>
17605
17606         * tests/mpbsd/Makefile.am: Add a convenience rule for ../libtests.la.
17607
17608         * printf/Makefile.am: libdummy.la should be in EXTRA_LTLIBRARIES.
17609
17610         * mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
17611         mpf_get_str give the same for ndigits==0.
17612
17613         * mpfr/exceptions.c (mpfr_set_emin, mpfr_set_emax): Work around a
17614         powerpc64 gcc 3.0 -O2 bug.
17615
17616         * tests/memory.c, tests/tests.h (tests_memory_validate): New function.
17617
17618 2002-01-14  Kevin Ryde  <kevin@swox.se>
17619
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.
17629
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.
17634
17635         * tests/refmpn.c (refmpn_divmod_1c): Avoid a bug in i386 gcc 3.0.
17636
17637 2002-01-12  Kevin Ryde  <kevin@swox.se>
17638
17639         * mpz/root.c: Add <stdlib.h>, for abort().
17640
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.
17647
17648         * tests/misc/t-scanf.c (check_misc, check_misc):
17649
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.
17653
17654         * tests/tests.h (refmpn_mod_34lsub1): Add __GMP_PROTO.
17655
17656         * mpbsd/Makefile.am: Avoid an automake problem with ansi2knr and
17657         sources in a different directory.
17658
17659         * printf/repl-vsnprintf.c: Test HAVE_LONG_DOUBLE for long double.
17660
17661         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mod_34lsub1.c,
17662         mul_2.c, pre_divrem_1.c.
17663
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.
17668
17669         * gmp-impl.h (mpn_reciprocal): Remove, unused.
17670
17671         * tune/many.pl (cntlz, cnttz): Use new SPEED_ROUTINE_COUNT_ZEROS.
17672
17673 2002-01-11  Kevin Ryde  <kevin@swox.se>
17674
17675         * mpn/hppa/*.asm, mpn/pa64/*.asm, mpn/pa64w/*.asm: Use L().
17676
17677 2002-01-08  Kevin Ryde  <kevin@swox.se>
17678
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
17684         few more asserts.
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.
17688
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.
17692
17693         * mpz/get_str.c: Determine realloc size arithmetically.
17694
17695         * mpbsd/mtox.c: Size memory block returned to actual space needed.
17696         * gmp.texi (BSD Compatible Functions): Describe this.
17697
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
17700         missing TMP_FREE.
17701
17702         * mpz/get_str.c, mpbsd/mout.c: No longer need for +1 limb for
17703         mpn_get_str clobber.
17704
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.
17710
17711         * gmp-impl.h (POW2_P): New macro.
17712         * mpn/generic/get_str.c, tests/misc.c: Use it.
17713
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.
17717
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
17721         libmp can link.
17722
17723 2002-01-07  Torbjorn Granlund  <tege@swox.com>
17724
17725         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Rewrite generic versions.
17726
17727 2002-01-06  Kevin Ryde  <kevin@swox.se>
17728
17729         * mpn/generic/pre_divrem_1.c: Don't support size==0.
17730         * tests/devel/try.c: Update.
17731
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
17735         constants.
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.
17739
17740         * demos/pexpr.c, demos/expr/expr.h, demos/expr/expr-impl.h: Use
17741         __GMP_PROTO.
17742
17743         * gmp-h.in (mpn_divexact_by3c): Remove variables from prototype, to
17744         keep out of application namespace.
17745
17746 2002-01-04  Torbjorn Granlund  <tege@swox.com>
17747
17748         * gmp-impl.h: Move _PROTO declaration to before its first usages.
17749
17750 2002-01-04  Kevin Ryde  <kevin@swox.se>
17751
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.
17756
17757 2002-01-03  Torbjorn Granlund  <tege@swox.com>
17758
17759         * tune/speed.c (usage): Insert "\n\" into a string.
17760
17761 2001-12-30  Torbjorn Granlund  <tege@swox.com>
17762
17763         * mpn/pa64/udiv_qrnnd.c: Remove file.
17764         * mpn/pa64w/udiv_qrnnd.c: Remove file.
17765
17766         * gmp-impl.h (MPN_IORD_U): Change formatting (labels in pos 0, insns
17767         indented by tab).
17768         (MPN_INCR_U): Use "addl $1,foo; jc", not "incl foo; jz".
17769
17770         * gmp-impl.h (udiv_qrnnd_preinv): Use plain subtract, not sub_ddmmss,
17771         in one more case.
17772
17773 2001-12-30  Kevin Ryde  <kevin@swox.se>
17774
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.
17778
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.
17785
17786         * longlong.h (__vxworks__): Remove from powerpc tests, not correct,
17787         not on its own at least.
17788
17789         * tune/speed.c: Add "aas" to specify 0xAA..AA data.
17790
17791         * tune/tuneup.c (print_define_end): Indicate "never" and "always".
17792
17793 2001-12-29  Torbjorn Granlund  <tege@swox.com>
17794
17795         * mpq/set_d.c: ANSI-fy.
17796         * mpz/invert.c: Use PTR and SIZ (cosmetic change).
17797
17798         * mpz/cong.c: Rename `xor' to `sign' to avoid C++ reserved word.
17799
17800 2001-12-28  Torbjorn Granlund  <tege@swox.com>
17801
17802         * mpn/sparc64/sqr_diagonal.asm: New file.
17803
17804 2001-12-28  Kevin Ryde  <kevin@swox.se>
17805
17806         * mpn/generic/get_str.c: Avoid one mpn_divrem_1 by running main loop
17807         only until msize==1.
17808
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.
17812
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.
17817
17818         * mpz/inp_raw.c: Avoid a gcc 3.0 powerpc64 bug on AIX.
17819
17820         * acinclude.m4, configure.in (GMP_C_RESTRICT): New macro.
17821
17822         * mpfr/sin.c: Patch from Paul to fix sign of sin(3pi/2).
17823
17824         * demos/calc/calc.y: Improve some error messages.
17825
17826 2001-12-28  Torbjorn Granlund  <tege@swox.com>
17827
17828         * mpn/sparc64/mul_1.asm: Rename r72 -> r80.
17829         * mpn/sparc64/addmul_1.asm: Likewise.
17830
17831 2001-12-27  Torbjorn Granlund  <tege@swox.com>
17832
17833         * mpn/generic/tdiv_qr.c: Misc formatting cleanups.
17834         For switch case 2, replace `dn' with its value (2).
17835
17836 2001-12-25  Torbjorn Granlund  <tege@swox.com>
17837
17838         * tests/devel/mul_1.c: Add FIXED_XLIMB.
17839         * tests/devel/addmul_1.c: Likewise.
17840         * tests/devel/submul_1.c: Likewise.
17841
17842         * tests/devel/add_n.c: Improve error message.
17843         Accept command line argument for # of tests.
17844         * tests/devel/sub_n.c: Likewise.
17845
17846         * tests/devel/: Remove CLOCK settings.
17847
17848         * mpn/sparc32/v9/mul_1.asm: Rewrite.
17849         * mpn/sparc32/v9/addmul_1.asm: Rewrite.
17850         * mpn/sparc32/v9/submul_1.asm: Rewrite.
17851
17852 2001-12-24  Torbjorn Granlund  <tege@swox.com>
17853
17854         * mpn/sparc64/mul_1.asm: Get rid of global constant 0.0 (L(noll)).
17855         * mpn/sparc64/addmul_1.asm: Likewise.
17856
17857 2001-12-23  Torbjorn Granlund  <tege@swox.com>
17858
17859         * mpn/generic/get_str.c: Move final ASSERT to just before zero fill
17860         loop.
17861
17862 2001-12-22  Torbjorn Granlund  <tege@swox.com>
17863
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.
17866
17867 2001-12-22  Kevin Ryde  <kevin@swox.se>
17868
17869         * mpn/x86/x86-defs.m4, mpn/x86/*/*.asm: Remove L / LF scheme putting
17870         function name in local labels.
17871
17872         * mpn/generic/get_str.c: Use mpn_preinv_divrem_1, add a couple of
17873         ASSERTs.
17874
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
17881         measuring.
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.
17885
17886         * tests/mpz/t-io_raw.c: New file.
17887         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
17888
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.
17892
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
17897         setting an ABI.
17898
17899         * tune/tuneup.c, configure.in: Print the gmp-mparam.h filename.
17900         * tune/tuneup.c: Print the CPU frequency.
17901
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.
17905
17906         * tune/freq.c (speed_cpu_frequency_irix_hinv): New function.
17907
17908         * Makefile.am, configure.in: Restore mpfr.
17909
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
17912         lucnum function.
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.
17917
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.
17923
17924         * demos/expr/exprfr.c: Use mpfr_sin and mpfr_cos, remove some spurious
17925         returns.
17926
17927 2001-12-20  Torbjorn Granlund  <tege@swox.com>
17928
17929         * mpn/sparc64/mul_1.asm: Trim an instruction.
17930         * mpn/sparc64/addmul_1.asm: Likewise.
17931
17932         * mpn/ia64/add_n.asm: Rewrite.
17933         * mpn/ia64/sub_n.asm: Rewrite.
17934
17935 2001-12-19  Torbjorn Granlund  <tege@swox.com>
17936
17937         * mpn/ia64/mul_1.asm: Rewrite.
17938         * mpn/ia64/addmul_1.asm: Rewrite.
17939         * mpn/ia64/submul_1.c: Use TMP_ALLOC_LIMBS.
17940
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.
17945
17946 2001-12-18  Torbjorn Granlund  <tege@swox.com>
17947
17948         * mpn/mips3/mul_1.asm: Add NOPs to save a cycle on R1x000.
17949
17950 2001-12-18  Kevin Ryde  <kevin@swox.se>
17951
17952         * gmpxx.h (gmp_randclass): Don't allow copy constructors or "=",
17953         implementation by Gerardo.
17954
17955         * gmp-h.in (operator<<, operator>>): Remove parameter names from
17956         prototypes, to keep out of user namespace.
17957
17958         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Let the test program work as C++.
17959
17960 2001-12-16  Torbjorn Granlund  <tege@swox.com>
17961
17962         * mpn/sparc64/mul_1.asm: Rewrite.
17963         * mpn/sparc64/addmul_1.asm: Rewrite.
17964         * mpn/sparc64/submul_1.asm: Rewrite.
17965
17966         * mpn/sparc64/addmul1h.asm: Remove.
17967         * mpn/sparc64/submul1h.asm: Remove.
17968         * mpn/sparc64/mul1h.asm: Remove.
17969
17970 2001-12-15  Kevin Ryde  <kevin@swox.se>
17971
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.
17974
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).
17978
17979 2001-12-12  Torbjorn Granlund  <tege@swox.com>
17980
17981         * gmp-impl.h (MPN_ZERO): Rewrite generic version to be similar to
17982         powerpc version.
17983
17984 2001-12-12  Kevin Ryde  <kevin@swox.se>
17985
17986         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect cmov problems with gcc
17987         -march=pentiumpro on solaris 2.8.
17988
17989         * tune/common.c, tune/speed.h: Allow for commas in count_leading_zeros
17990         and count_trailing_zeros macros.
17991
17992         * demos/expr/Makefile.am: Distribute exprfr.c and exprfra.c.
17993
17994         * tune/Makefile.am (speed_ext_SOURCES): Should be speed-ext.c.
17995
17996 2001-12-10  Torbjorn Granlund  <tege@swox.com>
17997
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.
18002
18003 2001-12-07  Kevin Ryde  <kevin@swox.se>
18004
18005         * gmp-h.in, mp-h.in, gmp-impl.h: __GMP_DECLSPEC at start of
18006         prototypes, for the benefit of Microsoft C.
18007
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.
18012
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.
18016
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
18019         Jetzer.
18020
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.
18023
18024 2001-12-04  Kevin Ryde  <kevin@swox.se>
18025
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.
18036
18037         * tests/cxx/t-headers.cc: New file.
18038         * tests/cxx/Makefile.am: Add it.
18039
18040         * gmpxx.h: Add <strstream>, needed by mpf_class::get_str2.
18041
18042         * gmp-h.in (mpq_inp_str, mpn_hamdist): Add __GMP_DECLSPEC.
18043
18044 2001-12-01  Torbjorn Granlund  <tege@swox.com>
18045
18046         * Version 4.0 released.
18047
18048         * mpfr/README: Replace contents with explanation of why mpfr is gone.
18049
18050 2001-12-01  Kevin Ryde  <kevin@swox.se>
18051
18052         * Makefile.am, configure.in: Temporarily remove mpfr, just leave a
18053         README.
18054
18055         * mpn/Makefile.am (EXTRA_DIST): Add Makeasm.am.
18056
18057 2001-11-30  Gerardo Ballabio  <ballabio@sissa.it>
18058
18059         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: New files.
18060         * tests/cxx/Makefile.am (check_PROGRAMS): Add them.
18061
18062 2001-11-30  Kevin Ryde  <kevin@swox.se>
18063
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.
18067
18068         * mpn/s370: Rename to s390.
18069         * configure.in (s3[6-9]0*-*-*): Update.
18070         * mpn/Makefile.am (TARG_DIST): Add s390.
18071
18072         * mpz/fits_s.c, mpf/fits_s.c, mpf/fits_u.c: Remove files, unused since
18073         change to .h style.
18074
18075 2001-11-29  Torbjorn Granlund  <tege@swox.com>
18076
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.
18081
18082 2001-11-29  Kevin Ryde  <kevin@swox.se>
18083
18084         * mpn/*/gmp-mparam.h: Update measured thresholds.
18085         * mpn/s370/gmp-mparam.h: New file.
18086
18087         * mpz/millerrabin.c: Mark for internal use only, for now.
18088         * gmp.texi (Number Theoretic Functions): Remove documentation.
18089
18090 2001-11-28  Torbjorn Granlund  <tege@swox.com>
18091
18092         * mpf/get_d_2exp.c: New file.
18093         * mpz/get_d_2exp.c: New file.
18094
18095         * mpz/realloc2.c: Fix typo.  Make more similar to mpz_realloc.
18096         * mpz/realloc.c: Use __GMP_REALLOCATE_FUNC_LIMBS.
18097
18098 2001-11-27  Gerardo Ballabio  <ballabio@sissa.it>
18099
18100         * gmpxx.h, mpfrxx.h: Various updates and improvements.
18101
18102 2001-11-27  Kevin Ryde  <kevin@swox.se>
18103
18104         * gmp.texi (Useful Macros and Constants): Add gmp_version, add @findex
18105         for mp_bits_per_limb.
18106
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.
18110
18111 2001-11-26  Torbjorn Granlund  <tege@swox.com>
18112
18113         * mpz/realloc.c: Clear variable when decreasing allocation to less than
18114         needed.  Misc updates.
18115
18116 2001-11-25  Kevin Ryde  <kevin@swox.se>
18117
18118         * tests/misc/t-locale.c: Avoid printf in the normal case, since the
18119         replacement localeconv breaks it on SunOS 4.
18120
18121         * gmp.texi (Build Options, Notes for Package Builds): Note libgmpxx
18122         depends on libgmp from same GMP version.
18123
18124         * acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
18125         test.
18126         * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is
18127         writable, if necessary.
18128
18129         * tests/misc/t-scanf.c: Ensure sscanf arguments are writable, always.
18130         * configure.in (AC_CHECK_DECLS): Remove sscanf, no longer required.
18131
18132         * configure.in (none-*-*): Fix default CFLAGS setups.
18133
18134         * doc/configuration: Misc updates.
18135
18136 2001-11-23  Kevin Ryde  <kevin@swox.se>
18137
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.
18143
18144 2001-11-22  Torbjorn Granlund  <tege@swox.com>
18145
18146         * mpn/cray/ieee/addmul_1.c: Fix logic for more_carries scalar loop.
18147         * mpn/cray/ieee/submul_1.c: Likewise.
18148
18149 2001-11-20  Kevin Ryde  <kevin@swox.se>
18150
18151         * gmp.texi (Known Build Problems): Note an out of memory on DJGPP.
18152         (Function Classes): Update function counts.
18153         Misc tweaks elsewhere.
18154
18155         * configure.in (AC_CHECK_DECLS): Add sscanf.
18156         * tests/misc/t-scanf.c: Use it, for the benefit of SunOS 4.
18157
18158         * tal-debug.c, gmp-impl.h: More checks of TMP_DECL/TMP_MARK/TMP_FREE
18159         consistency.
18160
18161         * mpfr/Makefile.am (AR): Explicit AR=@AR@ to override automake
18162         default, necessary for powerpc64 ABI=aix64.
18163
18164 2001-11-18  Torbjorn Granlund  <tege@swox.com>
18165
18166         * mpz/powm.c: Move TMP_MARK to before any TMP_ALLOCs.
18167
18168 2001-11-18  Kevin Ryde  <kevin@swox.se>
18169
18170         * configure.in (--enable-fft): Make this the default.
18171         * gmp.texi (Build Options): Update.
18172
18173         * Makefile.am (libmp_la_DEPENDENCIES): Revise mpz objects needed by
18174         new mpz/powm.c.
18175
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".
18180
18181         * configure.in (AC_CHECK_DECLS): Add fgetc, fscanf, ungetc.
18182         * scanf/fscanffuns.c: Use these, for the benefit of SunOS 4.
18183
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.
18186
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
18194         prototypes.
18195         * Makefile.am (libgmp_la_SOURCES): Add randdef.c and randlc2s.c.
18196
18197         * printf/asprntffuns.c: Include config.h before using its defines.
18198
18199         * gmp-impl.h: Move C++ <string> to top of file to avoid the memset
18200         redefine upsetting configure tests.  Remove <iostream> since <iosfwd>
18201         in gmp.h suffices.
18202
18203 2001-11-16  Kevin Ryde  <kevin@swox.se>
18204
18205         * gmp.texi (Integer Exponentiation): mpz_powm supports negative
18206         exponents.
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
18213         Gerardo.
18214
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
18219         additions.
18220
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.
18227
18228         * tests/cxx/t-locale.cc: New file.
18229         * tests/cxx/Makefile.am: Add it.
18230
18231         * mpf/set_str.c, cxx/ismpf.cc: Use localeconv for the decimal point.
18232
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.
18235
18236         * gmp-impl.h (__gmp_replacement_vsnprintf): Add prototype.
18237
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.
18242
18243         * mpn/x86/t-zdisp2.pl: New file.
18244
18245         * mpn/x86/pentium4/README: New file.
18246
18247 2001-11-15  Torbjorn Granlund  <tege@swox.com>
18248
18249         * mpz/powm.c (HANDLE_NEGATIVE_EXPONENT): #define to 1.
18250         * tests/mpz/reuse.c (main): Use mpz_invert to avoid undefined mpz_powm
18251         cases.
18252
18253 2001-11-14  Torbjorn Granlund  <tege@swox.com>
18254
18255         * mpz/powm_ui.c: Rewrite along the lines of mpz/powm.c (except still no
18256         redc).
18257         * mpz/powm.c: Adjust for negative b, after exponentiation done.  Add
18258         (still disabled) code for handling negative exponents.  Misc cleanups.
18259
18260 2001-11-14  Kevin Ryde  <kevin@swox.se>
18261
18262         * mpf/out_str.c: Use localeconv for the decimal point.
18263
18264         * tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
18265         available (eg. on mingw).
18266
18267 2001-11-11  Kevin Ryde  <kevin@swox.se>
18268
18269         * gmp-h.in: Remove parameter names from prototypes, to keep out of
18270         application namespace.
18271
18272 2001-11-08  Kevin Ryde  <kevin@swox.se>
18273
18274         * acinclude.m4 (GMP_GCC_VERSION_GE): Fix sed regexps to work on
18275         Solaris 8.
18276
18277         * printf/doprnt.c: Support %n of all types, per glibc.
18278
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
18283         becomes mpfr.
18284
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.
18290
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.
18293
18294         * mpq/set_si.c, mpq/set_ui.c: Set _mp_den._mp_size correctly if den==0.
18295
18296 2001-11-07  Torbjorn Granlund  <tege@swox.com>
18297
18298         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Work around gas bug.
18299
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).
18302
18303 2001-11-06  Torbjorn Granlund  <tege@swox.com>
18304
18305         * gmp-impl.h (MPN_COPY_INCR): Prepend local variable by `__'.
18306         (MPN_COPY_DECR): Likewise.
18307
18308 2001-11-05  Torbjorn Granlund  <tege@swox.com>
18309
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.
18314
18315 2001-11-05  Kevin Ryde  <kevin@swox.se>
18316
18317         * mpq/inp_str.c: Remove unused variable "ret".
18318
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.
18321
18322         * mpq/canonicalize.c: DIVIDE_BY_ZERO if denominator is zero.
18323
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.
18328
18329 2001-11-03  Torbjorn Granlund  <tege@swox.com>
18330
18331         * tests/refmpn.c (refmpn_overlap_p): Reverse return values.
18332
18333 2001-11-02  Kevin Ryde  <kevin@swox.se>
18334
18335         * tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
18336         longer done by configure.
18337
18338         * mpn/x86/pentium4/mmx/popham.asm: New file.
18339
18340         * mpn/x86/x86-defs.m4 (psadbw): New macro.
18341         * mpn/x86/k7/mmx/popham.asm: Use it.
18342
18343         * tests/refmpn.c (refmpn_overlap_p): New function, independent of
18344         MPN_OVERLAP_P.
18345
18346 2001-10-31  Torbjorn Granlund  <tege@swox.com>
18347
18348         * tests/mpz/t-powm.c: Print proper error message when finding
18349         discrepancy.
18350
18351 2001-10-31  Kevin Ryde  <kevin@swox.se>
18352
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.
18356
18357 2001-10-30  Kevin Ryde  <kevin@swox.se>
18358
18359         * tests/printf/t-printf.c (check_misc): Add checks from the glibc docs.
18360         (check_vasprintf, check_vsnprintf): Run these unconditionally.
18361
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.
18365
18366         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Add "dnl".
18367
18368 2001-10-27  Torbjorn Granlund  <tege@swox.com>
18369
18370         * demos/pexpr.c: Remove some unused variables.
18371         (main): Allocate more buffer space to accommodate minus sign.
18372
18373 2001-10-27  Kevin Ryde  <kevin@swox.se>
18374
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
18377         mpn_mod_34lsub1.
18378         * tests/refmpn.c, tests/tests.h (refmpn_mod_34lsub1): New function.
18379
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.
18384
18385         * gmp-h.in, gmpxx.h: Use <iosfwd> not whole <iostream>.
18386
18387         * gmp.texi (Known Build Problems): Add note on test programs with
18388         Windows DLLs.
18389
18390 2001-10-26  Kevin Ryde  <kevin@swox.se>
18391
18392         * tests/mpq/t-get_d.c: Limit the size of "eps" for vax.
18393
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
18397         library problems.
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.
18411
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.
18416
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.
18423
18424 2001-10-24  Kevin Ryde  <kevin@swox.se>
18425
18426         * configure, aclocal.m4: Regenerate with a libtool patch for a stray
18427         quote in AC_LIBTOOL_PROG_LD_SHLIBS under mingw and cygwin.
18428
18429         * gmp-impl.h (modlimb_invert): More comments.
18430
18431         * printf/doprnt.c, printf/doprnti.c: Use the precision field to print
18432         leading zeros.
18433         * tests/printf/t-printf.c: Test this.
18434         * cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
18435
18436         * tune/speed.c, tune/speed.h, tune/common.c: Add mpn_mul_1_inplace.
18437
18438 2001-10-23  Torbjorn Granlund  <tege@swox.com>
18439
18440         * mpz/pprime_p.c (mpz_millerrabin): Remove function and its descendant.
18441
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.
18446
18447 2001-10-22  Torbjorn Granlund  <tege@swox.com>
18448
18449         * tests/mpz/t-perfsqr.c: New file.
18450         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
18451
18452         * demos/factorize.c (factor): Check for number to factor == 0.
18453         (main): When invoked without arguments, read from stdin.
18454
18455         * mpz/perfpow.c: Add code to handle negative perfect powers ((-b)^odd).
18456         Treat 0 and 1 as perfect powers.
18457
18458         * mpn/sparc32/v9/sqr_diagonal.asm: Jump past .align.
18459
18460 2001-10-21  Torbjorn Granlund  <tege@swox.com>
18461
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.
18467
18468 2001-10-22  Kevin Ryde  <kevin@swox.se>
18469
18470         * demos/perl/GMP.xs (mutate_mpz, tmp_mpf_grow): Make these "static".
18471
18472         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm
18473         (mpn_popcount_table): Use GSYM_PREFIX.
18474
18475 2001-10-19  Kevin Ryde  <kevin@swox.se>
18476
18477         * mpn/x86/*.asm: Add some measured speeds on various x86s.
18478
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.
18481
18482         * configure.in (AC_CHECK_FUNCS): Add alarm.
18483         * tests/spinner.c: Conditionalize alarm and SIGALRM availability, for
18484         the benefit of mingw32.
18485
18486         * acinclude.m4 (GMP_ASM_TYPE, GMP_ASM_SIZE): Suppress .type and .size
18487         on COFF.
18488
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.
18493
18494         * aclocal.m4, configure: Regenerate with libtool patch to suppress
18495         warnings when probing command line limit on FreeBSD.
18496
18497         * demos/qcn.c (M_PI): Define if not already provided, helps mingw32.
18498
18499 2001-10-17  Kevin Ryde  <kevin@swox.se>
18500
18501         * printf/doprnt.c: Use <stdint.h> for intmax_t.
18502
18503         * longlong.h: Recognise __sparcv8 for gcc on Solaris.  Reported by
18504         Mark Mentovai <mark@mentovai.com>.
18505
18506         * gmp-impl.h (gmp_allocated_string): No need for inline on member funs.
18507
18508 2001-10-16  Kevin Ryde  <kevin@swox.se>
18509
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.
18517
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.
18521
18522         * printf/doprnt.c: Support %lln and %hhn.
18523
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.
18526
18527 2001-10-11  Kevin Ryde  <kevin@swox.se>
18528
18529         * acinclude.m4, configure.in (GMP_IMPL_H_IEEE_FLOATS): New macro.
18530
18531         * ltmain.sh: Send some rm errors to /dev/null, helps during compiles
18532         on Solaris 2.7 and HP-UX 10.
18533
18534         * tal-notreent.c: Renamed from stack-alloc.c.
18535         * Makefile.am, acinclude.m4, gmp-impl.h: Update.
18536
18537         * gmp-h.in: Don't give both prototypes and inlines, except on gcc.
18538
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.
18543
18544         * tests/*/Makefile.in, mpfr/tests/Makefile.in: Regenerate with
18545         automake patch to avoid Ultrix problem with empty $(TESTS).
18546
18547         * */Makefile.in: Regenerate with automake patch to only rm *_.c in
18548         "make clean" when ansi2knr actually in use, helps DOS 8.3.
18549
18550         * Makefile.in: Regenerate with automake patch to fix stamp-h
18551         numbering, avoiding an unnecessary config.status run.
18552
18553 2001-10-09  Torbjorn Granlund  <tege@swox.com>
18554
18555         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Use L macros for labels.
18556         Quote L reloc operator.
18557
18558         * gmp-impl.h: Declare class string.
18559
18560         * mpn/asm-defs.m4 (INT32, INT64): Quote $1 to prevent further
18561         expansion.
18562
18563         * mpn/alpha/ev6/mul_1.asm: New file.
18564
18565 2001-10-09  Kevin Ryde  <kevin@swox.se>
18566
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.
18573
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.
18576
18577         * printf/doprnt.c, tests/printf/t-printf.c: Remove support for %.*Fe
18578         prec -1 meaning all digits.
18579
18580         * acinclude.m4 (GMP_PROG_AR): Override libtool, use AR_FLAGS="cq".
18581         (GMP_HPC_HPPA_2_0): Print version string to config.log.
18582
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.
18586
18587         * Makefile.am, cxx/Makefile.am: Updates for Gerardo's stuff.
18588
18589 2001-10-09  Gerardo Ballabio  <ballabio@sissa.it>
18590
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.
18596
18597 2001-10-08  Kevin Ryde  <kevin@swox.se>
18598
18599         * configure.in (with_tags): Establish a default based on --enable-cxx.
18600
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.
18603
18604         * gmp-impl.h (doprnt_format_t, doprnt_memory_t, doprnt_reps_t,
18605         doprnt_final_t): Use _PROTO.
18606
18607 2001-10-05  Torbjorn Granlund  <tege@swox.com>
18608
18609         * mpn/asm-defs.m4 (INT32, INT64): Use LABEL_SUFFIX.
18610
18611         * mpn/hppa: Convert files to `.asm'.
18612
18613 2001-10-05  Kevin Ryde  <kevin@swox.se>
18614
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.
18619
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.
18623
18624         * configure.in (AC_PROG_CXXCPP): Add this, to make libtool happier.
18625
18626 2001-10-04  Torbjorn Granlund  <tege@swox.com>
18627
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.
18632
18633         * mpn/generic/random2.c: Changes for mirroring mpz/rrandomb.c.
18634
18635 2001-10-04  Kevin Ryde  <kevin@swox.se>
18636
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
18642         requirements.
18643         (C++ Formatted Output): New section.
18644         (Language Bindings): Add ALP
18645         (Contributors): Add Paul Zimmermann's square root, update my things.
18646
18647         * acinclude.m4 (GMP_PROG_CC_IS_GNU, GMP_PROG_CXX_WORKS): Send compiler
18648         errors to config.log.
18649
18650         * mpq/Makefile.am (INCLUDES): Remove -DOPERATION_$*, not needed.
18651
18652         * mpn/x86/*.asm: Change references to old README.family to just README.
18653
18654         * mpz/README: Remove file, now adequately covered in the manual.
18655
18656 2001-10-03  Torbjorn Granlund  <tege@swox.com>
18657
18658         * mpn/x86/pentium4/copyi.asm: New file.
18659         * mpn/x86/pentium4/copyd.asm: New file.
18660
18661         * gmp-impl.h: Implement separate MPN_COPY_INCR and MPN_COPY_DECR
18662         macros for CRAY systems.
18663         (CRAY _MPN_COPY): Delete.
18664
18665 2001-10-02  Kevin Ryde  <kevin@swox.se>
18666
18667         * tests/mpz/t-popcount.c (check_data): Use "~ (unsigned long) 0" to
18668         avoid compiler warnings on sco.
18669
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).
18673
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_$*.
18684
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_$*.
18691
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.
18694
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.
18705
18706         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Warn what's omitted when
18707         vsnprintf not available.
18708
18709         * mpn/underscore.h: Remove file, not used since m68k converted to asm.
18710         * mpn/Makefile.am (EXTRA_DIST): Remove it.
18711
18712         * tests/refmpz.c: Add <stdlib.h>, for free().
18713
18714 2001-10-01  Torbjorn Granlund  <tege@swox.com>
18715
18716         * mpn/x86/pentium4/sse2/submul_1.asm: Apply some algebraic
18717         simplifications.
18718         * mpn/x86/pentium4/sse2/addmul_1.asm: Comment.
18719
18720 2001-10-01  Kevin Ryde  <kevin@swox.se>
18721
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.
18725
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.
18732
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.
18736
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.
18740
18741         * acinclude.m4 (GMP_PROG_CXX_WORKS): New macro.
18742         (GMP_PROG_CC_WORKS): Write "conftest" test program, not a.out.
18743
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.
18748
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.
18755
18756         * configure.in (j90-*-*, sv1-*-*): Don't duplicate $path in $add_path.
18757         (*-*-mingw*): Don't assemble with -DPIC (as per cygwin).
18758
18759         * printf/snprntffuns.c (gmp_snprintf_final): Remove spurious formal
18760         parameters.
18761
18762         * tune/tuneup.c (POWM_THRESHOLD): Reduce stop_factor to 1.1 to help
18763         Cray vector systems.
18764
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.
18768
18769 2001-09-30  Kent Boortz  <kent@swox.com>
18770
18771         * macos/configure, macos/Makefile.in, macos/README: Updates for gmp 4.
18772         * gmp-h.in (_GMP_H_HAVE_FILE): Recognise Apple MPW.
18773
18774 2001-09-30  Torbjorn Granlund  <tege@swox.com>
18775
18776         * mpn/cray/ieee/submul_1.c: Rewrite.  Streamline multiplications;
18777         use `majority' logic.
18778
18779 2001-09-27  Torbjorn Granlund  <tege@swox.com>
18780
18781         * gmp-h.in (__GMPN_AORS_1): Rewrite to work around Cray compiler bug.
18782
18783 2001-09-26  Torbjorn Granlund  <tege@swox.com>
18784
18785         * mpn/x86/pentium4/sse2/gmp-mparam.h: New file.
18786
18787 2001-09-26  Kevin Ryde  <kevin@swox.se>
18788
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.
18792
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.
18796
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.
18801
18802         * tests/mpz/t-cmp_d.c (check_low_z_one): Patch by Torbjorn for vax
18803         limited float range.
18804
18805 2001-09-23  Torbjorn Granlund  <tege@swox.com>
18806
18807         * mpn/vax/lshift.s: Change `jsob*' to `sob*'.
18808         * mpn/vax/rshift.s: Likewise.
18809
18810 2001-09-23  Kevin Ryde  <kevin@swox.se>
18811
18812         * mpn/x86/pentium4/sse2/mul_basecase.asm: Some simple but real code.
18813
18814         * printf/doprnt.c: Use va_copy for va_list variables, copy function
18815         parameter in case it's call-by-reference.
18816
18817         * tune/freq.c (speed_cpu_frequency_bsd_dmesg): New function.
18818         (speed_cpu_frequency_table): Use it.
18819
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.
18825
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.
18832
18833 2001-09-22  Torbjorn Granlund  <tege@swox.com>
18834
18835         * mpn/x86/pentium4/sse2/mul_basecase.asm: New file, placeholder
18836         for real code, hiding the default x86 mul_basecase.asm.
18837
18838 2001-09-22  Kevin Ryde  <kevin@swox.se>
18839
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.
18844
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.
18847
18848 2001-09-20  Torbjorn Granlund  <tege@swox.com>
18849
18850         * mpz/cong.c (mpz_congruent_p): Fix one-limb c<d test.
18851
18852         * longlong.h: Rewrite __i370__ smul_ppmm; enable also for __s390__.
18853
18854         * configure.in: Add support for IBM 360, 370, 390 families.
18855
18856 2001-09-20  Kevin Ryde  <kevin@swox.se>
18857
18858         * mpn/x86/pentium4/sse2/diveby3.asm: New file.
18859         * mpn/x86/pentium4/sse2/mode1o.asm: New file.
18860
18861 2001-09-16  Kevin Ryde  <kevin@swox.se>
18862
18863         * printf/doprnt.c: '#' means showpoint and showtrailing for %e, %f, %g.
18864         * tests/printf/t-printf.c (check_f): More test cases.
18865
18866 2001-09-15  Torbjorn Granlund  <tege@swox.com>
18867
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.
18871
18872 2001-09-14  Kevin Ryde  <kevin@swox.se>
18873
18874         * ChangeLog: Merge in tests/rand/ChangeLog.
18875         * tests/rand/ChangeLog: Remove file.
18876
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.
18880
18881 2001-09-12  Torbjorn Granlund  <tege@swox.com>
18882
18883         * mpn/cray/ieee/invert_limb.c: Add a PROLOGUE in a comment to have
18884         HAVE_NATIVE_... defined.
18885
18886 2001-09-11  Kevin Ryde  <kevin@swox.se>
18887
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.
18892
18893         * acinclude.m4, configure.in (GMP_H_ANSI): New macro.
18894
18895         * gmp-h.in (__GMP_EXTERN_INLINE): Add a definition for SCO 8 cc.
18896
18897         * gmp-h.in, version.c (gmp_version): Make the pointer "const" as well
18898         as the string.
18899
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.
18903
18904 2001-09-11  Torbjorn Granlund  <tege@swox.com>
18905
18906         * gmp-h.in: Let __DECC mean __GMP_HAVE_CONST, etc.
18907         * mp-h.in: Likewise.
18908
18909 2001-09-10  Torbjorn Granlund  <tege@swox.com>
18910
18911         * mpn/x86/pentium4/mmx/lshift.asm: New file.
18912         * mpn/x86/pentium4/mmx/rshift.asm: New file.
18913
18914         * tests/mpn/t-iord_u.c (check_incr_data): Work around HP compiler bug.
18915         (check_decr_data): Likewise.
18916
18917 2001-09-08  Kevin Ryde  <kevin@swox.se>
18918
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.
18923
18924         * configure.in (AC_CHECK_FUNCS): Add mmap.
18925         * tests/devel/try.c (malloc_region): Use mmap if available.
18926
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.
18930
18931         * mpz/hamdist.c: Support neg/neg operands.
18932
18933         * macos/Makefile.in: Remove dual compile of mpq/aors.c and
18934         mpn/generic/popham.c.
18935
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"
18940         qualifiers.
18941         * mpn/generic/popham.c: Remove file.
18942
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.
18946
18947         * mpn/x86/pentium4/sse2/mul_1.asm: Use pointer increments not indexed
18948         addressing, to get 4.0 c/l flat.
18949
18950         * tests/mpq/t-cmp_si.c (check_data): Use ULONG_MAX for denominators.
18951
18952         * tests/misc.c (mpz_negrandom): Use given rstate, not RANDS.
18953
18954 2001-09-07  Torbjorn Granlund  <tege@swox.com>
18955
18956         * mpn/x86/pentium4/sse2/addmul_1.asm: New file.
18957
18958 2001-09-04  Kevin Ryde  <kevin@swox.se>
18959
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.
18965
18966         * mpz/fib_ui.c: Use ?: to avoid a gcc 3 bug on powerpc64.
18967         Store back a carry for limb<long.
18968
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.
18971
18972         * config.guess: Give m68020 for 68020 or better, not m68k.
18973         * configfsf.guess: Update to 2001-09-04.
18974
18975 2001-09-02  Kevin Ryde  <kevin@swox.se>
18976
18977         * configure.in (m68k-*-*): Let m68k mean 68000, not 68020.
18978         * gmp.texi (Notes for Particular Systems): Update.
18979
18980         * gmp-impl.h (union ieee_double_extract) [m68k]: Use longs, since int
18981         might be only 16 bits.
18982
18983         * tests/mpq/t-aors.c: New file.
18984         * tests/mpq/Makefile.am: Add it.
18985
18986         * tests/refmpq.c: New file.
18987         * tests/Makefile.am: Add it.
18988         * tests/tests.h: Add prototypes.
18989
18990         * mpq/aors.c: Share object code for mpq_add and mpq_sub.
18991         * Makefile.am, mpq/Makefile.am: Single mpq/aors.lo now.
18992
18993         * tests/devel/try.c (TYPE_SUBMUL_1): Use correct reference routine.
18994
18995 2001-08-30  Kevin Ryde  <kevin@swox.se>
18996
18997         * mpn/x86/x86-defs.m4 (cmov_available_p): Add pentium4.
18998
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.
19004
19005 2001-08-28  Kevin Ryde  <kevin@swox.se>
19006
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
19011         programs.
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.
19018
19019         * fdl.texi: New file, with two @appendix directive tweaks.
19020         * Makefile.am (gmp_TEXINFOS): Add it.
19021
19022         * tests/mpz/io.c: Check mpz_inp_str return against ftell, send error
19023         messages just to stdout.
19024
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.
19031
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.
19036
19037         * demos/Makefile.am (primes_LDADD): Use $(LIBM), for log().
19038
19039         * tune/many.pl, tune/Makefile.am: Fix some from clean and distclean.
19040
19041 2001-08-26  Kevin Ryde  <kevin@swox.se>
19042
19043         * tests/devel/try.c (ARRAY_ITERATION): Make types match on "?:" legs.
19044         (TYPE_MPZ_JACOBI, TYPE_MPZ_KRONECKER): Remove some superseded code.
19045
19046         * tests/printf/t-printf.c (check_plain): Don't compare "all digits"
19047         precision against plain printf.
19048
19049         * tune/Makefile.am: Eliminate empty TUNE_MPZ_SRCS.
19050
19051         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.52.
19052         * */Makefile.in, mdate-sh, missing, aclocal.m4, configure: Update to
19053         automake 1.5.
19054         * configfsf.guess, configfsf.sub: Update to 2001-08-23.
19055
19056 2001-08-24  Torbjorn Granlund  <tege@swox.com>
19057
19058         * demos/primes.c: Complete rewrite.
19059
19060 2001-08-24  Kevin Ryde  <kevin@swox.se>
19061
19062         * longlong.h: Test __ppc__ for apple darwin cc, reported by Jon
19063         Becker.  Also test __POWERPC__, PPC and __vxworks__.
19064
19065         * tune/speed.h (speed_cyclecounter) [x86]: Don't clobber ebx in PIC.
19066
19067 2001-08-22  Kevin Ryde  <kevin@swox.se>
19068
19069         * configure.in (x86 mmx): Correction to mmx path stripping.
19070
19071 2001-08-17  Kevin Ryde  <kevin@swox.se>
19072
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.
19078
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.
19085
19086         * gmp-impl.h, mpf/get_str.c (MPF_SIGNIFICANT_DIGITS): New macro,
19087         extracted from mpf/get_str.c.
19088
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".
19093
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
19096         mpf_get_str.
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.
19102
19103 2001-08-16  Kevin Ryde  <kevin@swox.se>
19104
19105         * printf/snprntffuns.c (gmp_snprintf_format): Correction to bufsize-1
19106         return value handling.
19107
19108         * demos/calc/calc.y: Reposition "%{" so copyright notice gets into
19109         generated files.
19110
19111         * INSTALL: Use gmp_printf.
19112
19113 2001-08-14  Kevin Ryde  <kevin@swox.se>
19114
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.
19118
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.
19122
19123 2001-08-12  Kevin Ryde  <kevin@swox.se>
19124
19125         * printf/sprintffuns.c, printf/doprntf.c: Don't use sprintf return
19126         value (it's a pointer on SunOS 4).
19127
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
19131         directories.
19132         * mpn/x86/README: Update.
19133
19134 2001-08-10  Torbjorn Granlund  <tege@swox.com>
19135
19136         * demos/pexpr.c (setup_error_handler): Catch also SIGABRT.
19137
19138 2001-07-31  Kevin Ryde  <kevin@swox.se>
19139
19140         * tests/refmpn.c (refmpn_mul_1c): Allow low to high overlaps.
19141
19142         * gmp-h.in, gmp-impl.h (_gmp_rand): Move prototype to gmp-impl.h.
19143
19144         * tune/Makefile.am (EXTRA_DIST): Add many.pl.
19145
19146 2001-07-28  Kevin Ryde  <kevin@swox.se>
19147
19148         * gmp.texi (Random Number Functions): Old rand functions no longer use
19149         the C library.
19150
19151         * configure.in, acinclude.m4 (GMP_FUNC_VSNPRINTF): New macro.
19152
19153         * mpn/generic/get_str.c: Add an ASSERT for high limb non-zero.
19154
19155 2001-07-24  Kevin Ryde  <kevin@swox.se>
19156
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.
19164
19165         * tests/memory.c (tests_free_nosize): New function.
19166         * tests/tests.h (tests_allocate etc): Add prototypes.
19167
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.
19171
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,
19176         quad_t.
19177         (AC_CHECK_FUNCS): Add localeconv, memset, obstack_vprintf, snprintf,
19178         strchr, vsnprintf.
19179         (AC_CHECK_DECLS): Add vfprintf.
19180
19181         * gmp-h.in, gmp-impl.h: Additions for gmp_printf etc.
19182
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
19189         files.
19190         * configure.in, Makefile.am: Add them.
19191
19192         * configure.in (HAVE_INLINE): Remove AC_DEFINE, unused.
19193         (AC_CHECK_TYPES): Don't test for void, assume it always exists.
19194
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.
19197
19198         * gmp-impl.h (mpn_fib2_ui): Use __MPN.
19199         (MPN_COPY_DECR): Fix an ASSERT.
19200         (CAST_TO_VOID): Remove macro.
19201
19202         * gmp-h.in (mpq_out_str): Give #define even without prototype.
19203         (mpz_cmp_d, mpz_cmpabs_d): Corrections to #defines.
19204
19205         * tests/devel/try.c: Add mpn_add and mpn_sub, don't use CAST_TO_VOID.
19206
19207 2001-07-23  Torbjorn Granlund  <tege@swox.com>
19208
19209         * config.guess: Recognize pentium4.
19210         * config.sub: Recognize pentium4.
19211
19212 2001-07-17  Kevin Ryde  <kevin@swox.se>
19213
19214         * gmp-h.in (__GMPN_AORS_1): Remove x86 and gcc versions, leave just
19215         one version.
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.
19219
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
19222         LSYM_PREFIX.
19223
19224 2001-07-11  Kevin Ryde  <kevin@swox.se>
19225
19226         * gmp-h.in (__GMPN_ADD_1 etc) [x86]: Don't use this on egcs 2.91.
19227
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.
19231
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.
19237
19238 2001-07-10  Kevin Ryde  <kevin@swox.se>
19239
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.
19243
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.
19246
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.
19250
19251         * randclr.c, randraw.c: Use ASSERT(0) for unrecognised algorithms.
19252
19253 2001-07-07  Kevin Ryde  <kevin@swox.se>
19254
19255         * configure.in (powerpc*-*-*): Use -no-cpp-precomp for Darwin.
19256
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.
19260
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.
19264
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.
19268
19269         * stack-alloc.c: Add some alignment ASSERTs.
19270
19271         * gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
19272
19273         * tests/devel/try.c (MPN_ZERO): Add testing.
19274         * tune/speed.c,speed.h,common.c,many.pl (MPN_ZERO): Add measuring.
19275
19276         * mpn/x86/divrem_1.asm: Update a remark about gcc and "loop".
19277
19278         * tests/mpq/t-cmp_si.c: New file.
19279         * tests/mpq/Makefile.am: Add it.
19280
19281         * tests/misc.c,tests.h (mpq_set_str_or_abort): New function.
19282
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.
19287
19288         * gmp-h.in (_GMP_H_HAVE_FILE): Add _FILE_DEFINED for microsoft, add
19289         notes on what symbols are for what systems.
19290
19291 2001-07-06  Torbjorn Granlund  <tege@swox.com>
19292
19293         * longlong.h (ibm032 umul_ppmm): Fix typo.
19294         * longlong.h (sparclite sdiv_qrnnd): Fix typo.
19295
19296 2001-07-03  Kevin Ryde  <kevin@swox.se>
19297
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
19300         pointer.
19301
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):
19305         New macros.
19306
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.
19313
19314         * gmp.texi (GMP Basics): Note the need for stdio.h to get FILE
19315         prototypes.
19316
19317 2001-07-01  Kevin Ryde  <kevin@swox.se>
19318
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.
19327
19328         * mpf/set_prc.c: Merge the two truncation conditionals, misc cleanups,
19329         no functional changes.
19330
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.
19334
19335         * mpn/x86/p6/dive_1.asm: New file.
19336
19337         * mpn/x86/dive_1.asm: New file.
19338         * mpn/x86/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Use it always.
19339
19340         * tests/refmpn.c, tests.h (refmpn_zero): New function.
19341         * tests/devel/try.c: Use it.
19342
19343         * tests/refmpn.c (refmpn_sb_divrem_mn): Use refmpn_cmp, not mpn_cmp.
19344
19345         * tests/mpf/t-get_d.c (main): Use || not |.
19346
19347         * tests/misc.c, tests/t-modlinv.c, tests/mpq/t-get_str.c,
19348         tests/mpf/reuse.c: Add string.h.
19349
19350 2001-06-29  Kevin Ryde  <kevin@swox.se>
19351
19352         * tune/speed.h (SPEED_ROUTINE_MPN_FIB2_UI,
19353         SPEED_ROUTINE_COUNT_ZEROS_C): Corrections to TMP block handling.
19354
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.
19360
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,
19368         t-trunc.c: Ditto.
19369         * tests/mpbsd/allfuns.c, t-misc.c: Ditto.
19370
19371         * mpn/generic/mul_n.c, mpz/cfdiv_r_2exp.c: Use MPN_INCR_U rather than
19372         mpn_incr_u.
19373
19374         * tests/devel/try.c (TYPE_SB_DIVREM_MN): More fixes for calling method.
19375
19376         * mpn/x86/k6/cross.pl: More insn exceptions.
19377
19378 2001-06-23  Kevin Ryde  <kevin@swox.se>
19379
19380         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1) [i386]: Fix some asm output
19381         constraints.
19382
19383         * gmp-impl.h (modlimb_invert): Mask after shifting, so mask constant
19384         fits a signed byte.
19385
19386         * tests/devel/try.c (TYPE_SB_DIVREM_MN): Fix initial fill of quotient
19387         with garbage.
19388
19389 2001-06-20  Kevin Ryde  <kevin@swox.se>
19390
19391         * config.guess (rs6000-*-aix4* | powerpc-*-aix4*): Suppress error
19392         messages if $CC_FOR_BUILD or program don't work.
19393
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).
19396
19397         * tests/mpn/t-aors_1.c: New file.
19398         * tests/mpn/Makefile.am: Add it.
19399
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.
19408
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.
19414
19415         * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro.
19416         * gmp-impl.h: Use it for all the malloc based TMP_ALLOCs.
19417
19418         * stack-alloc.h: Remove file.
19419         * tal-reent.c: New file.
19420         * Makefile.am: Update.
19421
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.
19432
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.
19435
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).
19440
19441         * gmp-h.in (mpn_cmp): Add __GMP_ATTRIBUTE_PURE.
19442
19443         * INSTALL: Clarify "make install", tweak formatting a bit.
19444
19445 2001-06-17  Kevin Ryde  <kevin@swox.se>
19446
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
19451         --disable-alloca.
19452         * assert.c (__gmp_assert_header): New function, split from
19453         __gmp_assert_fail.
19454
19455         * mpz/lcm.c: Don't TMP_MARK and then just return. Remove unnecessary
19456         _mpz_realloc prototype.
19457
19458         * mpn/generic/mul.c (mpn_sqr_n): Use __gmp_allocate_func for toom3
19459         temporary workspace.
19460
19461 2001-06-15  Kevin Ryde  <kevin@swox.se>
19462
19463         * tests/mpz/t-set_f.c: New file.
19464         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19465
19466         * mpz/set_f.c: Share MPN_COPY between pad and trunc cases, do exp<=0
19467         test earlier, store SIZ(w) earlier.
19468
19469         * tests/t-count_zeros.c: New file.
19470         * tests/t-gmpmax.c: New file.
19471         * tests/Makefile.am (check_PROGRAMS): Add them.
19472
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.
19476
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.
19479
19480         * longlong.h (count_leading_zeros) [pentium]: Decide to go with float
19481         method for p54.
19482         (count_leading_zeros) [alpha]: Add COUNT_LEADING_ZEROS_NEED_CLZ_TAB.
19483         (__clz_tab): Provide a prototype only if it's needed.
19484
19485         * tests/trace.c (mpz_trace): Don't use = on structures.
19486         (mpn_trace): Set _mp_alloc when creating mpz.
19487
19488 2001-06-12  Kevin Ryde  <kevin@swox.se>
19489
19490         * mpn/x86/divrem_1.asm: Amend some comments about P5 speed.
19491
19492         * tune/README: Clarify reconfigure on gmp-mparam.h update.
19493
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.
19497
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.
19501
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.
19508
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.
19513
19514         * acinclude.m4 (GMP_C_ATTRIBUTE_MODE): New macro.
19515         * configure.in: Call it.
19516         * gmp-impl.h (SItype etc): Use it.
19517
19518         * randraw.c (lc): Change mpn_mul_basecase->mpn_mul,
19519         mpn_incr_u->MPN_INCR_U, abort->ASSERT_ALWAYS(0).
19520
19521         * longlong.h (count_leading_zeros) [pentiumpro]: Work around a partial
19522         register stall on gcc < 3.
19523
19524         * gmp.texi (Introduction to GMP): Add IA-64.
19525         (Notes for Particular Systems): i386 means generic x86.
19526
19527         * tests/t-modlinv.c: Use tests_start and tests_end.
19528
19529 2001-06-10  Kevin Ryde  <kevin@swox.se>
19530
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.
19535
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.
19541
19542         * mpn/generic/mul_1.c: Allow "incr" style overlaps.
19543         * tests/devel/try.c (param_init): Test this.
19544
19545         * mpf/mul_ui.c: Do size==0 test earlier.
19546
19547 2001-06-08  Kevin Ryde  <kevin@swox.se>
19548
19549         * gmp-impl.h (ULONG_HIGHBIT, UINT_HIGHBIT, USHRT_HIGHBIT): Cast
19550         ULONG_MAX etc to unsigned long etc before attempting to right shift.
19551
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
19555         versions.
19556
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.
19561
19562         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add dive_1.c,
19563         fib2_ui.c.
19564
19565         * tests/mpn/t-iord_u.c: New file.
19566         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
19567
19568         * configure.in (mips*-*-irix[6789]*): Make ABI=n32 the default, same
19569         as in gmp 3.1.
19570         * gmp.texi (ABI and ISA): Update.
19571
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.
19579
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,
19584         lucnum2.
19585
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
19589         MPN_FIB2_SIZE.
19590
19591         * tune/tuneup.c, tune/Makefile.am, gmp-impl.h, mpn/*/gmp-mparam.h:
19592         Remove FIB_THRESHOLD, no longer required.
19593
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
19597         prototypes.
19598
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.
19603
19604         * acinclude.m4 (GMP_C_SIZES): Fix _LONG_LONG_LIMB define for mp_limb_t
19605         size test.
19606         (GMP_FUNC_ALLOCA): Add dummy __GMP_BITS_PER_MP_LIMB for gmp-h.in work.
19607
19608         * configure.in (CPPFLAGS): Remove -D__GMP_WITHIN_GMP, don't want it
19609         everywhere.
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.
19612
19613         * configure.in (*-*-msdosdjgpp*): Forcibly disable shared libraries,
19614         to make libtests.la work.
19615
19616         * acconfig.h (_LONG_LONG_LIMB, HAVE_MPFR): Remove dummy defines, no
19617         longer needed.
19618
19619         * mpz/set_ui.c: Store to _mp_d[0] unconditionally.
19620
19621 2001-05-27  Kevin Ryde  <kevin@swox.se>
19622
19623         * configure.in, gmp-h.in, mp-h.in: Add support for windows DLLs.
19624
19625 2001-05-26  Kevin Ryde  <kevin@swox.se>
19626
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
19630         2.95.4 and up.
19631         (Assembler Loop Unrolling): Mention non power-of-2 unrolling.
19632         (Internals): New chapter.
19633         * mpf/README: Remove file.
19634
19635         * demos/expr/README: Miscellaneous rewordings.
19636
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:
19641         New files.
19642
19643         * configure, aclocal.m4: Update to autoconf 2.50.
19644
19645         * configure, aclocal.m4, ltmain.sh: Update to libtool 1.4.
19646
19647         * configure, aclocal.m4, missing, ansi2knr.c, */Makefile.in: Update to
19648         automake 1.4f.
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.
19656
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
19660         similarly.
19661
19662         * config.guess (68k-*-*): Use $SHELL not "sh", tweak some comments.
19663
19664         * mpfr/mpfr.texi (Introduction to MPFR): Tweak table formatting, note
19665         non-free programs must be able to be re-linked.
19666
19667 2001-05-20  Kevin Ryde  <kevin@swox.se>
19668
19669         * mpn/powerpc64/addmul_1.asm, mpn/powerpc64/mul_1.asm,
19670         mpn/powerpc64/submul_1.asm: Add carry-in entrypoints.
19671
19672 2001-05-17  Kevin Ryde  <kevin@swox.se>
19673
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
19680         and mpf_set_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.
19684
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.
19688
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.
19693
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
19696         macros.
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.
19699
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.
19706
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.
19710
19711 2001-05-13  Kevin Ryde  <kevin@swox.se>
19712
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.
19716
19717 2001-05-11  Kevin Ryde  <kevin@swox.se>
19718
19719         * mpn/x86/pentium/dive_1.asm: New file.
19720
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.
19724
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.
19729
19730         * mpn/x86/k6/mmx/popham.asm, mpn/x86/k7/mmx/popham.asm: Don't support
19731         size==0.
19732         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm: Ditto,
19733         and shave a couple of cycles from the PIC entry code.
19734
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.
19737
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.
19740
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.
19744
19745         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Print a message if extra
19746         flags are added.
19747
19748         * tests/mpz/t-mul_i.c: New file.
19749         * tests/mpz/Makefile.am: Add it.
19750
19751         * mpz/mul_siui.c (mpz_mul_si): Fix for -0x80..00 on long long limb.
19752
19753         * gmp-h.in (mpf_set_si, mpf_set_ui): Revert last change, set exp to 0
19754         when n==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.
19757
19758 2001-05-07  Kevin Ryde  <kevin@swox.se>
19759
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.
19764
19765         * mpn/x86/README: Note gas _GLOBAL_OFFSET_TABLE_ with leal problem.
19766
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.
19774
19775 2001-05-06  Kevin Ryde  <kevin@swox.se>
19776
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.
19780
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.
19788
19789 2001-05-03  Kevin Ryde  <kevin@swox.se>
19790
19791         * extract-dbl.c: Add ASSERT d>=0.
19792
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.
19798
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
19801         versions.
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.
19804
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.
19807
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.
19816
19817         * tests/mpq/t-set_str.c: New file.
19818         * tests/mpq/Makefile.am: Add it.
19819
19820         * mpq/set_str.c: New file.
19821         * Makefile.am, mpq/Makefile.am: Add it.
19822         * gmp-h.in (mpq_set_str): Add prototype.
19823
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.
19826
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.
19829
19830 2001-04-30  Kevin Ryde  <kevin@swox.se>
19831
19832         * tests/mpz/t-lcm.c: New file.
19833         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19834
19835         * mpz/lcm.c: Add one limb special case.
19836
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.
19842
19843         * mp-h.in (mp_size_t, mp_exp_t): Fix typedefs to match gmp-h.in.
19844
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).
19848
19849         * gmp-h.in (__GMP_HAVE_TOKEN_PASTE): New macro.
19850         (__MPN): Use it.
19851         * gmp-impl.h (CNST_LIMB): Ditto.
19852
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.
19857
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.
19861
19862         * acinclude.m4 (GMP_C_STDARG): New macro.
19863         * configure.in: Call it.
19864         * rand.c: Use it.
19865
19866         * configure.in (AC_PROG_CC_STDC): New test.
19867
19868 2001-04-25  Kevin Ryde  <kevin@swox.se>
19869
19870         * mpn/x86/k6/mmx/dive_1.asm: New file.
19871         * mpn/x86/x86-defs.m4 (Zdisp): Two more insns.
19872
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.
19876
19877         * configure.in (ABI): Use AC_ARG_VAR.
19878
19879         * tests/devel/try.c: Run reference function when validate fails.
19880
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
19884         functions.
19885
19886 2001-04-24  Torbjorn Granlund  <tege@swox.com>
19887
19888         * mpz/lcm.c (mpz_lcm): Make result always positive.
19889
19890         * gmp-h.in (mpz_inp_binary, mpz_out_binary): Remove declarations.
19891
19892 2001-04-22  Kevin Ryde  <kevin@swox.se>
19893
19894         * mpn/powerpc64/addsub_n.asm: Use config.m4 not asm-syntax.m4.
19895
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):
19901         Add prototypes.
19902         * gmp.texi: Add documentation.
19903
19904         * mpf/set_prc.c: Avoid a realloc call if already the right precision.
19905
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:
19908         Use them.
19909
19910 2001-04-20  Kevin Ryde  <kevin@swox.se>
19911
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.
19915
19916         * mpz/popcount.c, mpz/hamdist.c: Don't pass size==0 to mpn_popcount
19917         and mpn_hamdist.
19918         * mpn/generic/popham.c: Don't support size==0.
19919
19920         * config.guess (m68k-*-*): Detect m68010, return m68360 for cpu32,
19921         cleanup the nesting a bit.
19922
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.
19928
19929         * tests/mpz/dive_ui.c: New file.
19930         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
19931
19932         * mpz/dive_ui.c: New file.
19933         * Makefile.am, mpz/Makefile.am: Add it.
19934         * gmp-h.in (mpz_divexact_ui): Add prototype.
19935
19936         * tune/many.pl, tune/speed.h: Add special mpn_back_to_back for
19937         development.
19938
19939         * gmp-impl.h (MPN_DIVREM_OR_DIVEXACT_1): New macro.
19940         * mpz/divexact.c: Use it.
19941
19942         * gmp-impl.h (DIVEXACT_1_THRESHOLD): New threshold.
19943         * tune/tuneup.c: Tune it.
19944
19945         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
19946         mpn_divexact_1, mpn_copyi, mpn_copyd.
19947
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).
19952
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.
19958
19959         * configure, config.in: Update to autoconf 2.49d.
19960
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.
19963
19964         * configure.in (m68*-*-*): Oops, m683?2 is 68000, m68360 is cpu32.
19965         * mpn/m68k/m68k-defs.m4 (scale_available_p): Ditto.
19966
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.
19971
19972 2001-04-17  Kevin Ryde  <kevin@swox.se>
19973
19974         * config.guess (m68k-*-*): Look for cpu in linux kernel /proc/cpuinfo.
19975
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.
19979
19980         * tune/freq.c (speed_cpu_frequency_sysctl): Avoid having unused
19981         variables on GNU/Linux.
19982
19983         * mpn/asm-defs.m4 (m4_instruction_wrapper): Fix a quoting problem if
19984         the name of the file is a macro.
19985
19986 2001-04-15  Kevin Ryde  <kevin@swox.se>
19987
19988         * mpn/powerpc64/*.asm: Add speeds on ppc630.
19989
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.
19993
19994         * mpn/x86/pentium/popcount.asm: New file.
19995         * mpn/x86/pentium/hamdist.asm: New file.
19996
19997         * mpn/asm-defs.m4: (m4_popcount): New macro.
19998         Amend a few comments elsewhere.
19999
20000         * acinclude.m4 (GMP_ASM_RODATA): If possible, grep compiler output for
20001         the right directive.
20002
20003         * tune/speed.c: Print clock speed in MHz, not cycle time.
20004
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.
20012
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.
20016
20017         * mpn/m68k/t-m68k-defs.pl: Allow white space in m4_definsn and
20018         m4_defbranch.
20019
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
20022         hamdist.
20023
20024 2001-04-13  Kevin Ryde  <kevin@swox.se>
20025
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
20028         lt_cv_proc_cc_pic.
20029
20030         * config.guess (m68*-*-*): Detect exact cpu with BSD sysctl hw.model,
20031         detect 68000/68010 with trapf, detect 68302 with bfffo.
20032
20033 2001-04-11  Kevin Ryde  <kevin@swox.se>
20034
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
20038         umul.
20039
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.
20047
20048         * configure.in (m68*-*-netbsd1.4*): Pretend getrusage doesn't exist.
20049         * tune/README: Update.
20050
20051         * configure.in (powerpc*-*-*): For the benefit of Darwin 1.3, add cc
20052         to cclist, make gcc_cflags -Wa,-mppc optional.
20053
20054 2001-04-06  Kevin Ryde  <kevin@swox.se>
20055
20056         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add | for 68k.
20057         (gmpasm-mode-syntax-table): Add to comments.
20058
20059         * tests/mpz/reuse.c (dsi_div_func_names): Add names for cdiv_[qr]_2exp.
20060
20061 2001-04-04  Kevin Ryde  <kevin@swox.se>
20062
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.
20065
20066         * gmp.texi (Compatibility with older versions): Note libmp
20067         compatibility.
20068
20069 2001-04-03  Kevin Ryde  <kevin@swox.se>
20070
20071         * tests/mpz/reuse.c: Add mpz_cdiv_q_2exp and mpz_cdiv_r_2exp.
20072
20073         * tests/mpz/t-pow.c: Drag in refmpn.o when testing mpz_pow_ui etc with
20074         refmpn_mul_2.
20075
20076         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of mpn_com_n
20077         and mpn_mul_2.
20078         * tests/devel/try.c: Add testing of mpn_mul_2, and a
20079         DATA_MULTIPLE_DIVISOR attribute.
20080
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.
20091
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.
20095
20096         * tests/mpz/t-cmp.c: New file.
20097         * tests/mpz/t-sizeinbase.c: New file.
20098         * tests/mpz/Makefile.am: Add them.
20099
20100         * gmp-impl.h (MPN_CMP): New macro.
20101         * mpz/cmp.c,cmpabs.c: Use it, and minor cleanups too.
20102
20103         * tests/mpq/t-equal.c: New file.
20104         * tests/mpq/t-get_str.c: New file.
20105         * tests/mpq/Makefile.am: Add them.
20106
20107         * mpq/get_str.c: New file.
20108         * Makefile.am, mpq/Makefile.am: Add it.
20109         * gmp-h.in (mpq_get_str): Add prototype.
20110
20111         * mpq/equal.c: Rewrite using inline compare loops.
20112
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.
20115
20116 2001-03-29  Kevin Ryde  <kevin@swox.se>
20117
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.
20121
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
20125         ceil and floor.
20126         * mpf/integer.c: Remove file.
20127         * Makefile.am, mpf/Makefile.am, macos/Makefile.in: Update.
20128
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.
20136
20137 2001-03-28  Kevin Ryde  <kevin@swox.se>
20138
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.
20141
20142         * tests/refmpn.c (refmpn_tdiv_qr): Use refmpn_divmod_1 rather than
20143         refmpn_divrem_1.
20144         * tests/tests.h: Add some prototypes that were missing.
20145
20146         * mpz/tdiv_q_ui.c: Remove a comment that belonged to mpz_tdiv_r_ui.
20147
20148 2001-03-26  Torbjorn Granlund  <tege@swox.com>
20149
20150         * mpn/generic/gcdext.c: Handle carry overflow after m*n multiply code
20151         in both arms.  Partially combine multiply arms.
20152
20153 2001-03-24  Kevin Ryde  <kevin@swox.se>
20154
20155         * longlong.h: Add comments to P5 count_leading_zeros.
20156
20157         * demos/expr/exprz.c,t-expr.c,README: Add congruent_p and divisible_p.
20158
20159 2001-03-23  Kevin Ryde  <kevin@swox.se>
20160
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.
20168
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()
20172         for local labels.
20173
20174         * mpn/x86/k6/mmx/com_n.asm: Relax code alignment (same speed).
20175
20176         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Use __pure__ to avoid application
20177         namespace.
20178
20179         * gmp-impl.h (ABS): Add parens around argument.
20180
20181 2001-03-20  Kevin Ryde  <kevin@swox.se>
20182
20183         * acinclude.m4 (GMP_PROG_M4): Use AC_ARG_VAR on $M4.
20184
20185         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): New macro.
20186         * configure.in: Use it.
20187         * mpn/asm-defs.m4: Ditto.
20188
20189 2001-03-18  Kevin Ryde  <kevin@swox.se>
20190
20191         * mpn/x86/pentium/logops_n.asm: New file.
20192
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.
20198
20199         * mpn/x86/k6/gcd_1.asm: New file.
20200
20201         * gmp-impl.h (NEG_MOD): Fix type of __dnorm.
20202
20203         * acinclude.m4 (GMP_C_SIZES): Fix use of __GMP_WITHIN_CONFIGURE.
20204
20205 2001-03-15  Kevin Ryde  <kevin@swox.se>
20206
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.
20213
20214         * tune/README: Notes on the 1x1 div threshold for mpn_gcd_1.
20215
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.
20221
20222         * tests/mpz/t-cong.c, tests/mpz/t-cong_2exp.c: New files.
20223         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
20224
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.
20231
20232         * mpq/aors.c: No need for ABS on denominator sizes.
20233
20234         * gmp-impl.h (mpn_divisible_p): Use __MPN.
20235
20236         * gmp-impl.h (LOW_ZEROS_MASK): New macro.
20237         * mpz/divis_ui.c, mpn/generic/divis.c: Use it.
20238
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.
20242
20243         * configure.in (none-*-*): Fix cclist for default ABI=long.
20244
20245 2001-03-10  Kevin Ryde  <kevin@swox.se>
20246
20247         * mpz/cfdiv_q_2exp.c: Don't scan for non-zero limbs if they don't
20248         matter to the rounding.
20249
20250         * mpz/get_ui.c: Fetch _mp_d[0] unconditionally, so the code can come
20251         out branch-free.
20252
20253 2001-03-08  Kevin Ryde  <kevin@swox.se>
20254
20255         * tests/devel/try.c (param_init): Fix reference functions for and_n
20256         and nand_n.
20257
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.
20261
20262         * configure.in (gmp.h, mp.h, demos/expr/expr-impl.h): Generate using
20263         AM_CONFIG_HEADER.
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
20268         automatically.
20269         * acinclude.m4 (GMP_FUNC_ALLOCA), gmp-impl.h: Set and use
20270         __GMP_WITHIN_CONFIGURE rather than GMP_FUNC_ALLOCA_TEST.
20271
20272         * mpf/random2.c: Use _gmp_rand and RANDS instead of random() for the
20273         exponent, ensures full range of values too.
20274
20275         * tests/mpz/t-div_2exp.c (check_various): Start with d based on i, but
20276         don't let it go negative.
20277
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 <=.
20281
20282 2001-03-07  Torbjorn Granlund  <tege@swox.com>
20283
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.
20287
20288         * tests/mpz/t-div_2exp.c (check_various): Start 2nd d loop from 0
20289         (avoid problems with Cray compilers).
20290
20291 2001-03-06  Torbjorn Granlund  <tege@swox.com>
20292
20293         * mpn/cray/ieee/submul_1.c: Don't call mpn_sub_n with size 0.
20294
20295         * mpn/cray/ieee/mul_basecase.c: New file.
20296         * mpn/cray/ieee/sqr_basecase.c: New file, derived from mul_basecase.c.
20297
20298 2001-03-06  Kevin Ryde  <kevin@swox.se>
20299
20300         * tests/devel/try.c (pointer_setup): Allow dst_size == SIZE_SIZE2 for
20301         the benefit of mpn_tdiv_qr.
20302
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.
20305
20306         * gmp-impl.h (USE_LEADING_REGPARM): Use __GMP_GNUC_PREREQ.
20307         Use __GMP_ATTRIBUTE_PURE and ATTRIBUTE_CONST in a few places.
20308
20309         * gmp-h.in (__GMP_GNUC_PREREQ) New macro.
20310         (__GMP_ATTRIBUTE_PURE): New macro, use it in many places.
20311
20312         * gmp-impl.h, gmp-h.in (mpn_jacobi_base): Move prototype to
20313         gmp-impl.h, use ATTRIBUTE_CONST.
20314
20315         * tune/speed.h (speed_cyclecounter): Inline asm version for i386.
20316
20317         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Only reread "up" after second
20318         realloc, first is under w!=u.
20319
20320 2001-03-05  Torbjorn Granlund  <tege@swox.com>
20321
20322         * mpn/cray/sub_n.c: Rewrite using `majority' logic.
20323
20324         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Reread `up' after realloc of w.
20325
20326         * mpn/cray/ieee/mul_1.c: Rewrite.  Streamline multiplications;
20327         use `majority' logic.
20328         * mpn/cray/ieee/addmul_1.c: Likewise.
20329
20330         * mpn/cray/add_n.c: Rewrite using `majority' logic.
20331
20332 2001-03-04  Torbjorn Granlund  <tege@swox.com>
20333
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.
20337
20338         * mpn/cray/ieee/invert_limb.c: New file.
20339
20340         * gmp-impl.h (RANDS): Add a `,0' to make it compile on more compilers.
20341
20342 2001-03-03  Kevin Ryde  <kevin@swox.se>
20343
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
20346         form by Torbjorn.
20347
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.
20351
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.
20354
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.
20362
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.
20366
20367         * configure.in (HAVE_ABI_$ABI): Re-enable this for config.m4, with
20368         dots changed to underscores (necessary for hppa).
20369
20370         * tests/mpz/t-divis.c, tests/mpz/t-divis_2exp.c: New files.
20371         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
20372
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.
20377
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.
20381
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.
20386
20387         * urandom.h: Remove file.
20388         * Makefile.am (EXTRA_DIST): Remove it.
20389
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.
20394
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.
20399
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.
20405
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.
20410
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.
20414
20415         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized): Add externs.
20416         (gmp_randstate_ptr): New typedef.
20417         (RANDS, RANDS_CLEAR): New macros.
20418
20419         * rands.c: New file.
20420         * Makefile.am (libgmp_la_SOURCES): Add it.
20421
20422         * configure.in (mpn_objs_in_libmp): New AC_SUBST.
20423         * Makefile.am (libmp_la_DEPENDENCIES): Use it.
20424
20425 2001-03-02  Torbjorn Granlund  <tege@swox.com>
20426
20427         * mpn/pa64/udiv_qrnnd.asm: New file.
20428
20429 2001-03-01  Kevin Ryde  <kevin@swox.se>
20430
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.
20436
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.
20439
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
20442         if available.
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.
20449
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.
20455
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.
20459
20460         * configure.in (none-*-*): Add ABI=longlong.
20461         * doc/configuration (Long long limb testing): Describe it.
20462
20463         * gmp.texi (Low-level Functions): Move some commented out remarks ...
20464         * mpn/generic/mul_basecase.c: ... to here.
20465
20466         * mpn/x86/README: Note "%=" as an alternative to "1:" in __asm__.
20467
20468         * tests/trace.c (mp_trace_start): Print "bin" for binary.
20469
20470         * mpn/generic/dump.c: Add a couple of casts to keep gcc quiet.
20471
20472         * gmp-h.in (mpn_incr_u, mpn_decr_u): Add parens around arguments.
20473
20474         * mpbsd/mout.c, mpbsd/mtox.c (num_to_text): Remove unused variable.
20475
20476         * mpfr/set_d.c (mpfr_get_d2): Declare "q" for 64-bit limbs.
20477
20478 2001-02-28  Torbjorn Granlund  <tege@swox.com>
20479
20480         * mpn/pa64w/udiv_qrnnd.asm: Tune.
20481
20482 2001-02-27  Torbjorn Granlund  <tege@swox.com>
20483
20484         * mpn/pa64w/udiv_qrnnd.asm: New file.
20485
20486 2001-02-26  Torbjorn Granlund  <tege@swox.com>
20487
20488         * longlong.h (arm): Optimize sub_ddmmss by testing for constant
20489         operands.
20490         * mpn/arm/invert_limb.asm: New file.
20491
20492 2001-02-24  Torbjorn Granlund  <tege@swox.com>
20493
20494         * mpn/generic/lshift.c: Rewrite.
20495         * mpn/generic/rshift.c: Rewrite.
20496
20497         * longlong.h: Use UWtype for external interfaces that expect mp_limb_t.
20498
20499         * longlong.h (arm): #define invert_limb.
20500
20501         * mpn/arm: Make labels have local scope.
20502
20503         * configure.in (arm*-*-*): Set extra_functions.
20504         * longlong.h (arm): #define udiv_qrnnd.
20505         * mpn/arm/udiv.asm: New file.
20506
20507 2001-02-24  Kevin Ryde  <kevin@swox.se>
20508
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
20512         ansi2knr.
20513         * tune/speed.h, tune/common.c: Consequent changes.
20514
20515         * demos/expr/*: Make a few more functions available in expressions,
20516         create only libexpr.a, misc minor updates.
20517
20518         * mpn/Makeasm.am: Add some comments about suffix ordering.
20519
20520         * tests/refmpn.c (rshift_make, lshift_make): No need to compare
20521         unsigned to zero.
20522
20523         * mpq/mul.c: Detect and optimize squaring.
20524
20525 2001-02-23  Torbjorn Granlund  <tege@swox.com>
20526
20527         * mpn/mips3: Convert files to `.asm'.
20528
20529         * mpn/arm: Convert files to `.asm'.  Misc cleanups.
20530         * mpn/arm/submul_1.asm: New file.
20531
20532 2001-02-21  Kevin Ryde  <kevin@swox.se>
20533
20534         * tune/tuneup.c (all): Only one compiler print should match, no need
20535         for #undef PRINTED_COMPILER.
20536
20537         * mpfr/mpfr.h (mpfr_sgn): Use mpfr_cmp_ui (patch from Paul).
20538
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.
20543
20544 2001-02-21  Torbjorn Granlund  <tege@swox.com>
20545
20546         * mpn/sparc64/copyi.asm: Streamline for small operands.
20547         * mpn/sparc64/add_n.asm: Likewise.
20548         * mpn/sparc64/sub_n.asm: Likewise.
20549
20550         * mpn/sparc64/copyd.asm: New file.
20551
20552 2001-02-20  Torbjorn Granlund  <tege@swox.com>
20553
20554         * mpn/sparc64/lshift.asm: Rewrite.
20555         * mpn/sparc64/rshift.asm: Rewrite.
20556
20557 2001-02-19  Torbjorn Granlund  <tege@swox.com>
20558
20559         * mpn/sparc64/add_n.asm: Rewrite using `majority' logic.
20560         * mpn/sparc64/sub_n.asm: Likewise.
20561
20562         * tune/tuneup.c (all): Recognise DECC and MIPSpro compilers.
20563
20564         * mpn/pa64/sqr_diagonal.asm: Use PROLOGUE/EPILOGUE.
20565         * mpn/pa642/sqr_diagonal.asm: Likewise.
20566
20567         * configure.in (HAVE_ABI_$abi): Disable for now.
20568
20569         * mpn/asm-defs.m4 (PROLOGUE): Use LABEL_SUFFIX.
20570
20571         * acinclude.m4 (GMP_ASM_ATTR): New check, for hppa oddities.
20572
20573 2001-02-18  Torbjorn Granlund  <tege@swox.com>
20574
20575         * mpn/hppa/hppa1_1/gmp-mparam.h: New file.
20576         * mpn/hppa/hppa2_0/gmp-mparam.h: New file.
20577
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.
20582
20583         * mpn/sparc32/v9/add_n.asm: Use `fitod' instead of `fxtod' for dummy
20584         FA-pipeline insns.
20585         * mpn/sparc32/v9/sub_n.asm: Likewise.
20586
20587 2001-02-18  Kevin Ryde  <kevin@swox.se>
20588
20589         * gmp.texi (Known Build Problems): Notes on make, $* and K&R, misc
20590         tweaks elsewhere.
20591         (Low-level Functions): Use {} notation in mpn_sqrtrem.
20592         (Basecase Multiplication): Mention BASECASE_SQR_THRESHOLD.
20593
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.
20597
20598         * acinclude.m4 (GMP_C_SIZES): Generate an error if mp_limb_t doesn't
20599         seem to work for some reason.
20600
20601 2001-02-16  Torbjorn Granlund  <tege@swox.com>
20602
20603         * mpn/sparc32/v9/gmp-mparam.h: Retune.
20604
20605         * mpn/sparc32/v9/add_n.asm: New file.
20606         * mpn/sparc32/v9/sub_n.asm: New file.
20607
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.
20611
20612         * mpn/sparc32/v9/sqr_diagonal.asm: New file.
20613
20614 2001-02-16  Kevin Ryde  <kevin@swox.se>
20615
20616         * configure.in: Fix flags selection when $CC is a compiler known to us.
20617
20618         * demos/expr/exprfr.c (e_mpfr_cos, e_mpfr_sin): mpfr_sin_cos now
20619         allows NULL for one parameter.
20620
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.
20627
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.
20631
20632         * Makefile.am (MPF_OBJECTS): Add a couple of missing $U's.
20633
20634         * tune/tuneup.c: Identify compiler used (GCC and Sun C so far).
20635
20636 2001-02-15  Torbjorn Granlund  <tege@swox.com>
20637
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.
20641
20642 2001-02-14  Torbjorn Granlund  <tege@swox.com>
20643
20644         * mpn/mips3/mips.m4: New file.
20645         * configure.in (mips*-*-irix[6789]*): Use mips3/mips.m4.
20646
20647         * mpn/powerpc64/sqr_diagonal.asm: New file.
20648
20649         * mpn/mips3/sqr_diagonal.asm: New file.
20650
20651 2001-02-12  Torbjorn Granlund  <tege@swox.com>
20652
20653         * mpn/powerpc32/sqr_diagonal.asm: New file.
20654
20655         * mpn/generic/sqr_basecase.c: Remove declaration of mpn_sqr_diagonal.
20656         Fix typo in header comment.
20657
20658 2001-02-12  Kevin Ryde  <kevin@swox.se>
20659
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.
20663
20664         * Makefile.am (libgmp.la, libmp.la): Revert change to build from
20665         mpn/libmpn.la etc, go back to explicitly listed objects.
20666
20667         * configure.in: Recognise sparc64-*-*, not just sparc64-*-linux*.
20668
20669 2001-02-11  Torbjorn Granlund  <tege@swox.com>
20670
20671         * mpn/asm-defs.m4 (sqr_diagonal): New define_mpn.
20672
20673         * mpn/alpha/sqr_diagonal.asm: New file.
20674
20675 2001-02-11  Kevin Ryde  <kevin@swox.se>
20676
20677         * gmp.texi (Low-level Functions): Note mpn_get_str clobbers its input
20678         plus 1 extra limb.
20679
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.
20684
20685         * configure.in (HAVE_ABI_$abi): New define in config.m4.
20686
20687         * gmp-impl.h (mpn_sqr_diagonal): Add prototype and define.
20688         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
20689         mpn_sqr_diagonal.
20690
20691         * gmp.texi, acinclude.m4: Mention x86 solaris 2.7 has the reg->reg
20692         movq bug the same as 2.6.
20693
20694         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr-test.h and mpf2mpfr.h.
20695
20696         * mpn/x86/README: Merge contents of README.family.
20697         * mpn/x86/README.family: Remove file.
20698
20699         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mode1o, gcd_finda,
20700         invert_limb, sqr_diagonal; remove mod_1_rs; sort alphabetically.
20701
20702 2001-02-10  Torbjorn Granlund  <tege@swox.com>
20703
20704         * configure.in (gmp_mpn_functions_optional): List sqr_diagonal.
20705
20706         * mpn/powerpc32/aix.m4: Use unnamed csects.
20707         * mpn/powerpc64/aix.m4: Likewise.
20708
20709         * acconfig.h: Add #undef of mpn_sqr_diagonal.
20710         Remove lots of spacing.
20711
20712         * configure.in (syntax testing section): Match power* instead of
20713         powerpc*.
20714         * mpn/power: Convert files to `.asm'.
20715         Prefix umul_ppmm and sdiv_qrnnd.
20716         Update some comments.
20717
20718 2001-02-09  Kevin Ryde  <kevin@swox.se>
20719
20720         * acconfig.h: Add HAVE_NATIVE_mpn_modexact_1_odd and
20721         HAVE_NATIVE_mpn_modexact_1c_odd.
20722
20723         * configure.in (CCAS): Don't override a user selection.
20724
20725         * mpq/cmp_ui.c: DIVIDE_BY_ZERO if den2==0.
20726
20727 2001-02-08  Torbjorn Granlund  <tege@swox.com>
20728
20729         * mpn/generic/sqr_basecase.c: Use mpn_sqr_diagonal when appropriate.
20730
20731 2001-02-07  Kevin Ryde  <kevin@swox.se>
20732
20733         * gmp.texi (Low-level Functions): mpn_preinv_mod_1 now undocumented.
20734
20735         * mpn/generic/random2.c (myrandom): Use rand() on mingw.
20736
20737         * mpn/alpha/gmp-mparam.h: Update tuned parameters.
20738
20739 2001-02-05  Torbjorn Granlund  <tege@swox.com>
20740
20741         * mpn/alpha/ev6/gmp-mparam.h: Retune.
20742
20743 2001-02-05  Kevin Ryde  <kevin@swox.se>
20744
20745         * Makefile.am (libgmp, libmp): Construct from mpn/libmpn.la etc rather
20746         than explicitly listed objects.
20747
20748         * urandom.h: Use rand() on mingw.
20749
20750         * mpn/powerpc64/lshift.asm,addsub_n.asm: Use r1 not 1.
20751
20752 2001-02-04  Torbjorn Granlund  <tege@swox.com>
20753
20754         * mpn/ia64/copyi.asm: New file.
20755         * mpn/ia64/copyd.asm: New file.
20756
20757 2001-02-04  Kevin Ryde  <kevin@swox.se>
20758
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.
20763
20764         * mpn/x86/i486: New directory.
20765         * configure.in (i486-*-*): Use it.
20766         * mpn/x86/i486/gmp-mparam.h: New file.
20767
20768         * mpn/x86/pentium/mode1o.asm: New file.
20769         * mpn/x86/p6/mode1o.asm: New file.
20770
20771         * tune/many.pl: Use $(ASMFLAGS_PIC) and $(CFLAGS_PIC).
20772
20773         * gmp.texi (Integer Division): Another rewording of 2exp divisions.
20774
20775 2001-02-03  Torbjorn Granlund  <tege@swox.com>
20776
20777         * mpn/arm/gmp-mparam.h: Tune.
20778
20779         * mpn/ia64/popcount.asm: Put a `;;' break at end of main loop.
20780
20781         * configure.in (arm*-*-*): Set gcc_cflags in order to pass
20782         $fomit_frame_pointer.
20783
20784         * tests/mpz/t-mul.c (base_mul): Remove an unused variable.
20785
20786 2001-02-02  Torbjorn Granlund  <tege@swox.com>
20787
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.
20791
20792         * longlong.h (arm): Add __CLOBBER_CC to add_ssaaaa and sub_ddmmss.
20793
20794 2001-02-02  Kevin Ryde  <kevin@swox.se>
20795
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.
20798
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.
20805
20806         * Makefile.am: Remove mpfr from main libgmp.
20807         * mpfr/Makefile.am: Build and install separate libmpfr.a.
20808         * mpfr/*: Update to mpfr 2001.
20809
20810         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 2.
20811         * Makefile.am (libtool -version-info): Bump appropriately.
20812         * NEWS: Updates.
20813
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.
20818
20819         * mpn/x86/*/README, mpn/x86/README.family: Misc updates.
20820         * tune/README: Misc updates.
20821         * doc/configuration: Misc updates.
20822
20823         * mpn/x86/pentium/mmx/gmp-mparam.h: Change UDIV_PREINV_TIME to
20824         UDIV_NORM_PREINV_TIME.
20825
20826         * mpz/pprime_p.c: Use ASSERT_ALWAYS instead of abort.
20827
20828         * rand.c (__gmp_rand_lc_scheme): Add "const".
20829         (struct __gmp_rand_lc_scheme_struct): Make astr "const char *".
20830
20831         * demos/calc/calc.y, demos/calc/calclex.l: Add kron function.
20832
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.
20837
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.
20842
20843         * mpn/x86/k6/cross.pl: Add a couple more exceptions.
20844
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
20852         mpz_set_f.
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.
20874
20875 2001-01-31  Torbjorn Granlund  <tege@swox.com>
20876
20877         * configure.in: Don't ever pass -mips3; let ABI flags imply ISA.
20878
20879 2001-01-31  Kevin Ryde  <kevin@swox.se>
20880
20881         * tune/time.c: Remove unnecessary longlong.h.
20882         (speed_endtime): Add some extra diagnostics.
20883
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.
20888
20889         * tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
20890         frequency" of 0, allow "BogoMIPS" as well as "bogomips".
20891
20892         * macos/Makefile.in: Add mpf/fits_s.c and mpf/fits_u.c objects.
20893
20894 2001-01-30  Torbjorn Granlund  <tege@swox.com>
20895
20896         * longlong.h: Add add_ssaaaa and sub_ddmmss for 64-bit sparc.
20897
20898 2001-01-29  Torbjorn Granlund  <tege@swox.com>
20899
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.
20903
20904         * configure.in (alpha*-*-*): Amend last change to handle pca*.
20905
20906 2001-01-29  Kevin Ryde  <kevin@swox.se>
20907
20908         * tune/speed.h (SPEED_ROUTINE_INVERT_LIMB_CALL): Don't let the
20909         compiler optimize everything away.
20910
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.
20917
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.
20920
20921         * mpn/generic/divrem_2.c: Use new DIVREM_2_THRESHOLD.
20922         * mpn/generic/sb_divrem_mn.c: Use new SB_PREINV_THRESHOLD.
20923
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.
20927
20928 2001-01-27  Kevin Ryde  <kevin@swox.se>
20929
20930         * configure.in (AC_CHECK_FUNCS): Add srand48.
20931         * tune/speed.c: Use this test.
20932
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.
20938
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
20942         freeing.
20943         * tests/mpf/t-conv.c: Ditto, and ensure x==0 is exercised.
20944
20945         * tests/mpz/t-fits.c: New file.
20946         * tests/mpz/Makefile.am: Add it.
20947
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.
20952
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
20960         prototypes.
20961
20962         * tests/memory.c (tests_allocate, tests_reallocate): Guard against
20963         size==0.
20964
20965         * tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
20966         tests_end.
20967
20968         * gmp-impl.h (USE_LEADING_REGPARM): Fix conditionals.
20969
20970 2001-01-23  Kevin Ryde  <kevin@swox.se>
20971
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.
20976
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.
20980
20981 2001-01-20  Torbjorn Granlund  <tege@swox.com>
20982
20983         * configure.in (alpha*-*-*): Default `flavour' to ev4.
20984
20985 2001-01-19  Kevin Ryde  <kevin@swox.se>
20986
20987         * assert.c, gmp-impl.h (__gmp_assert_fail): Change return type to
20988         void, since it's no longer used in expressions.
20989
20990         * mpn/x86/addsub_n.S: Remove file, since it doesn't work and it upsets
20991         tune/many.pl.
20992
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.
21002
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.
21007
21008         * acinclude.m4 (GMP_C_ATTRIBUTE_CONST, GMP_C_ATTRIBUTE_NORETURN): New
21009         macros.
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.
21014
21015 2001-01-18  Kevin Ryde  <kevin@swox.se>
21016
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.
21020
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.
21027
21028         * mpn/generic/sqrtrem.c: Use MPN_COPY_INCR (for when rp==NULL).
21029
21030         * tests/mpz/reuse.c: Only run mpz_divexact_gcd on positive divisors.
21031
21032 2001-01-18  Torbjorn Granlund  <tege@swox.com>
21033
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'.
21038
21039 2001-01-15  Kevin Ryde  <kevin@swox.se>
21040
21041         * mpn/alpha/ev5/mode1o.c: New file.
21042
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.
21046
21047 2001-01-13  Torbjorn Granlund  <tege@swox.com>
21048
21049         * tests/rand/t-rand.c (farr): Fix typo.
21050         (zarr): Fix typo.
21051
21052 2001-01-12  Kevin Ryde  <kevin@swox.se>
21053
21054         * mpz/kronsz.c: Don't depend on right shifting a negative.
21055
21056         * mpn/x86/gmp-mparam.h: New file.
21057
21058         * mpn/x86/pentium/mmx/mul_1.asm: New file.
21059
21060 2001-01-11  Torbjorn Granlund  <tege@swox.com>
21061
21062         * mpz/kronsz.c: Temporary workaround for Cray right shift oddities.
21063         Explicitly compare against zero in tests.
21064
21065 2001-01-10  Kevin Ryde  <kevin@swox.se>
21066
21067         * mpz/kronzs.c: Don't depend on right shifting a negative.
21068
21069 2001-01-09  Torbjorn Granlund  <tege@swox.com>
21070
21071         * tests/t-constants.c: Disable some undefined tests.
21072         (CHECK_MAX_S): Remove workaround for gcc 2.95.2 bug recently added.
21073
21074 2001-01-09  Kevin Ryde  <kevin@swox.se>
21075
21076         * tests/t-constants.c: Add more diagnostics.
21077         (CHECK_MAX_S): Fix for gcc 2.95.2 -mpowerpc64 -maix64.
21078
21079         * mpn/x86/k6/mode1o.asm: New file.
21080         * mpn/x86/k7/mode1o.asm: New file.
21081
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
21084         GSYM_PREFIX.
21085         * mpn/x86/x86-defs.m4 (Zdisp): Add a movzbl.
21086
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.
21092
21093         * mpz/kronzu.c, mpz/kronzs.c: Fix for a=0.
21094
21095         * tune/tuneup.c (USE_PREINV_MOD_1): Fix to use new DATA_HIGH_LT_R.
21096
21097 2001-01-08  Torbjorn Granlund  <tege@swox.com>
21098
21099         * urandom.h: Amend 2000-11-21 change to also handle cygwin.
21100
21101 2001-01-08  Kevin Ryde  <kevin@swox.se>
21102
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.
21106
21107         * tests/devel/try.c, tests/refmpn.c, tests/tests.h: Remove
21108         mpn_mod_1_rshift testing.
21109
21110         * tune/tuneup.c (fft_step_size): Test for overflow using the actual
21111         mp_size_t, don't use BITS_PER_INT.
21112
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.
21116
21117         * extract-dbl.c (BITS_PER_PART): Use BITS_PER_MP_LIMB not
21118         BITS_PER_LONGINT.
21119
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.
21124
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.
21128
21129         * tune/tuneup.c (MODEXACT_1_ODD_THRESHOLD): Add tuning.
21130
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.
21133
21134         * tests/mpz/t-jac.c (check_squares_zi): Ensure random a,b != 0.
21135
21136 2001-01-07  Kevin Ryde  <kevin@swox.se>
21137
21138         * configure.in (gmp_mpn_functions): Add mode1o, remove mod_1_rs.
21139
21140         * mpn/generic/mod_1_rs.c: Remove file, no longer needed.
21141         * gmp-h.in (mpn_mod_1_rshift): Remove prototype and define.
21142
21143         * mpq/set_f.c: Use MPN_STRIP_LOW_ZEROS_NOT_ZERO.
21144
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.
21148
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.
21151
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.
21157
21158         * mpn/generic/mode1o.c: New file.
21159
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.
21163
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
21167         doesn't.
21168
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.
21173
21174         * tune/common.c, tune/speed.h: Update for functions moved to
21175         tests/misc.c.
21176
21177         * tune/Makefile.am, tests/mpz/Makefile.am, tests/mpq/Makefile.am,
21178         tests/mpf/Makefile.am: Use tests/libtests.la.
21179
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.
21183
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.
21188
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.
21192
21193         * tests/memory.c: New file.
21194         * tests/misc.c: New file, a few subroutines from the test programs.
21195
21196         * mpz/tests, mpq/tests, mpf/tests, mpbsd/tests: Move directories to
21197         tests/mpz etc.
21198         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpbsd/Makefile.am
21199         (SUBDIRS): Remove.
21200
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.
21204
21205         * mpn/tests/ref.c: Move to tests/refmpn.c.
21206         * mpn/tests/spinner.c,trace.c,x86call.asm,x86check.c: Move to tests
21207         directory.
21208
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.
21212
21213 2001-01-05  Torbjorn Granlund  <tege@swox.com>
21214
21215         * mpn/cray/ieee/gmp-mparam.h: Retune.
21216
21217 2001-01-05  Kevin Ryde  <kevin@swox.se>
21218
21219         * configure.in (mp.h): Only create this under --enable-mpbsd.
21220
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.
21225
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.
21228
21229 2001-01-04  Kevin Ryde  <kevin@swox.se>
21230
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.
21235
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.
21240
21241         * mpz/tests/t-scan.c: New file.
21242         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
21243
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.
21247
21248 2001-01-03  Torbjorn Granlund  <tege@swox.com>
21249
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.
21254
21255         * stack-alloc.c (__gmp_tmp_alloc): Round `now' to required alignment.
21256
21257         * stack-alloc.h (__TMP_ALIGN): Append `L'.
21258
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.
21267
21268         * mpbsd/tests/t-misc.c (check_itom [data]): *SHORT* => *SHRT*;
21269         remove code disabling a test for Cray.
21270
21271         * tests/t-constants.c (CHECK_CONSTANT): Cast parameters to long.
21272
21273         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove unused variable `t'.
21274         (mpn_kara_mul_n): Likewise.
21275
21276         * mpz/fac_ui.c (MPZ_SET_1_NZ): Actually use `__z'.
21277
21278         * mpz/tests/t-jac.c
21279         (main, check_squares_zi): Generate test operands using new random
21280         functions.
21281
21282         All changes below on this date for enabling `make; make check'
21283         with C++ compilers:
21284
21285         * mpz/tests/t-pow_ui.c (debug_mp, ref_mpz_pow_ui): Provide prototypes.
21286
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++.
21290
21291         * mpz/tests/t-jac.c: #include stdlib.h and sys/time.h.
21292
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.
21303
21304         * mpz/tests/t-2exp.c: #include stdlib.h and sys/time.h.
21305         Remove #include of longlong.h.
21306
21307         * mpz/tests/io.c: #include config.h, stdlib.h, sys/time.h, and
21308         conditionally unistd.h.
21309
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.
21314
21315         * mpz/tests/convert.c (debug_mp): Provide prototype.
21316         * mpz/tests/t-root.c (debug_mp): Likewise.
21317
21318         * mpz/tests/bit.c: #include stdlib.h and sys/time.h.
21319
21320         * mpq/tests/t-get_d.c: #include stdlib.h and sys/time.h.
21321         (dump): Provide prototype and declare properly for C++.
21322
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++.
21325
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.
21329
21330         * mpf/random2.c (myrandom): New function.
21331         (mpf_random2): Use it.
21332
21333         * mpn/generic/random2.c: #include stdlib.h (for random/mrand48).
21334         (myrandom): New function.
21335         (mpn_random2): Use it.
21336
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.
21344
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.
21349
21350         * mpf/set_str.c: #include stdlib.h (for strtol).
21351
21352         * mpf/random2.c: #include stdlib.h (for random/mrand48).
21353         * mpn/alpha/udiv_arnnd: File deleted.
21354
21355         * Remove K&R function headers.
21356
21357 2001-01-02  Torbjorn Granlund  <tege@swox.com>
21358
21359         * mpn/generic/mul.c: Clean up spacing and indentation.
21360
21361         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Use mpn_decr_u.
21362         Clean up spacing and indentation.
21363
21364         * extract-dbl.c: Generalize to handle smaller limb sizes.
21365
21366 2001-01-01  Torbjorn Granlund  <tege@swox.com>
21367
21368         * mpbsd/mout.c: Output newline after "0".
21369
21370 2000-12-31  Torbjorn Granlund  <tege@swox.com>
21371
21372         * ltmain.sh: Remove space between `#!' and `$SHELL' when generating
21373         `libtool'.
21374
21375         * mpbsd/tests/t-misc.c (check_itom): Exclude test for all Cray
21376         vector systems.  Correct comment.
21377
21378 2000-12-31  Kevin Ryde  <kevin@swox.se>
21379
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.
21382
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
21386         generic C.
21387
21388         * config.sub (j90, t90): Preserve these, don't let configfsf.sub turn
21389         them into c90.
21390
21391         * config.guess (m68k-*-nextstep*,m68k-*-openstep*): Don't transform
21392         m68k to m68020, since m68k is already interpreted as 68020.
21393
21394 2000-12-30  Kevin Ryde  <kevin@swox.se>
21395
21396         * mpq/neg.c: Rewrite, use mpn, avoid denominator copy if unnecessary.
21397
21398         * mpz/tstbit.c: Rewrite, slightly simplified.
21399         * mpz/tests/bit.c (check_tstbit): New test, and add a couple more
21400         diagnostics elsewhere.
21401
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
21406         different name.
21407         (cclist): Use same style $abi as other variables.
21408
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++.
21415
21416         * configure.in (sys/mman.h, mprotect): New tests.
21417         * mpn/tests/try.c: Use them, and HAVE_UNISTD_H too.
21418
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>.
21422
21423         * configure.in, gmp-h.in (mips*-*-irix6*): Set limb_n32=longlong
21424         rather than using _ABIN32.
21425
21426 2000-12-29  Torbjorn Granlund  <tege@swox.com>
21427
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.
21431
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.
21438
21439 2000-12-27  Torbjorn Granlund  <tege@swox.com>
21440
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.
21445
21446         * mpn/cray/gmp-mparam.h: Disable UMUL_TIME and UDIV_TIME.
21447
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.
21452
21453         * longlong.h: Add count_leading_zeros for _CRAY.
21454         Reorganize _CRAY stuff.
21455
21456 2000-12-24  Kevin Ryde  <kevin@swox.se>
21457
21458         * configure.in (alpha*-cray-unicos*): Disable SPEED_CYCLECOUNTER_OBJ,
21459         as tune/alpha.asm doesn't suit.
21460
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.
21463
21464 2000-12-23  Torbjorn Granlund  <tege@swox.com>
21465
21466         * mpn/generic/mul_fft.c: Reformat.
21467         (mpn_fft_neg_modF): Remove.
21468         (mpn_fft_mul_2exp_modF): Inline mpn_fft_neg_modF.
21469
21470         * mpn/cray/gmp-mparam.h: Retune.
21471
21472         * configure.in (*-cray-unicos*): Pass `-O3 -htask0'.
21473         (vax*-*-*): Fix typo.
21474
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.
21480
21481         * configure.in (default cc_cflags,cc_64_cflags): Remove -g/add -O.
21482         (mips*-*-irix[6789]*]): Remove -g from cc_*_cflags.
21483
21484 2000-12-22  Torbjorn Granlund  <tege@swox.com>
21485
21486         * mpn/generic/mul_n.c: Delete K&R function headers.
21487
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.
21491
21492         * mpn/generic/mul_n.c (mpn_kara_mul_n): Use mpn_incr_u.
21493         (mpn_kara_sqr_n): Likewise.
21494
21495         * mpn/generic/mul_n.c (mpn_kara_mul_n): Change handling of `sign'
21496         to work around GCC 2.8.1 MIPS bug.
21497
21498         * configure.in (implied alpha*-cray-unicos*): Remove -g from cc_cflags.
21499
21500 2000-12-21  Torbjorn Granlund  <tege@swox.com>
21501
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).
21506
21507         * tests/t-constants.c (CHECK_CONSTANT): Print using %lx.
21508
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.
21512
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.
21517
21518         * mpn/alpha/cntlz.asm: Don't use `ldbu', use slightly slower
21519         `ldq_u' + `extbl' instead.
21520
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).
21525
21526 2000-12-21  Kevin Ryde  <kevin@swox.se>
21527
21528         * mpn/alpha/unicos.m4 (GSYM_PREFIX): Define for the benefit of
21529         __clz_tab.
21530
21531 2000-12-20  Torbjorn Granlund  <tege@swox.com>
21532
21533         * longlong.h: Add udiv_qrnnd and count_leading_zeros for _CRAYMPP
21534         systems.
21535
21536 2000-12-19  Torbjorn Granlund  <tege@swox.com>
21537
21538         * configure.in (*sparc*-*-*): Remove -g from cc_cflags and acc_cflags.
21539
21540         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Separate `limb' values from
21541         `size' values.
21542
21543         * configure.in (*-cray-unicos*): Add `-Wa,-B' to cc_cflags.
21544
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.
21550
21551 2000-12-19  Kevin Ryde  <kevin@swox.se>
21552
21553         * mpn/generic/sqrtrem.c: Rewrite by Paul Zimmermann, based on his
21554         Karatsuba Square Root algorithm.
21555         * gmp.texi (Square Root Algorithm): Update.
21556
21557         * tune/many.pl: New file.
21558
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.
21563
21564         * mpn/x86/k7/mmx/mod_1.asm: Add preinv_mod_1 entrypoint, remove extra
21565         variable for loop termination.
21566
21567         * mpn/x86/p6/mmx/mod_1.asm: Remove file, in favour of the following.
21568         * mpn/x86/p6/mod_1.asm: New file.
21569
21570         * mpn/x86/pentium/mod_1.asm: New file.
21571
21572 2000-12-18  Torbjorn Granlund  <tege@swox.com>
21573
21574         * configure.in (mips*-*-irix[6789]*): Pass options to compiler using
21575         `-Wc'.
21576
21577 2000-12-18  Kevin Ryde  <kevin@swox.se>
21578
21579         * mpn/x86/k6/pre_mod_1.asm: New file.
21580
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.
21584
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.
21587
21588         * configure.in: Let an asm mod_1 provide a preinv_mod_1 entrypoint.
21589
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.
21596
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.
21603
21604         * mpn/Makeasm.am (RM_TMP): New variable controlling tmp-*.s
21605         removal, for development purposes.
21606
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.
21609
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.
21613
21614         * mpn/generic/[lr]shift.c: Remove some DEBUG code adequately covered
21615         by new parameter ASSERTs.
21616
21617         * longlong.h (count_trailing_zeros): Assert x!=0.
21618
21619         * doc/configuration: Updates for new configure things, add some notes
21620         on test setups.
21621
21622 2000-12-16  Torbjorn Granlund  <tege@swox.com>
21623
21624         * configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc also for 64-bit
21625         compiles.
21626         * configure.in: Disable shared libs for *-*-ultrix*.
21627
21628 2000-12-15  Torbjorn Granlund  <tege@swox.com>
21629
21630         * configure.in (powerpc*-*-*): Pass -Wa,-mppc when using gcc.
21631
21632         * gmp-impl.h (_EXTERN_INLINE): #define different for GCC and other
21633         compilers.
21634
21635         * gmp-h.in (__gmp_inline): Remove.
21636         * mp-h.in: Likewise.
21637         * mpn/generic/gcd.c: Use `inline' instead of `__gmp_inline'.
21638
21639         * configure.in (mips*-*-irix[6789]*): Define *_ldflags.
21640
21641 2000-12-14  Torbjorn Granlund  <tege@swox.com>
21642
21643         * mpn/generic/pre_mod_1.c: Use proper type for udiv_qrnnd
21644         parameter `dummy'.
21645
21646         * mpn/generic/divrem_1.c: Use explicit `!= 0' in if statement.
21647         * mpn/generic/mod_1.c: Likewise.
21648
21649 2000-12-14  Kevin Ryde  <kevin@swox.se>
21650
21651         * config.guess (mips-*-irix[6789]*): Transform to mips64.
21652         (m68k-*-nextstep* | m68k-*-openstep*): Transform to m68020.
21653
21654 2000-12-13  Torbjorn Granlund  <tege@swox.com>
21655
21656         * tests/t-constants.c (main): Conditionalize use of PP_INVERTED.
21657
21658         * mpn/mp_bases.c: Handle 4-bit limbs.
21659         (main): Add code for generating tables.
21660
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.
21664
21665 2000-12-13  Kevin Ryde  <kevin@swox.se>
21666
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.
21670
21671         * configure.in (mips3, mips64): Don't bother with o32 (mips2 32-bit
21672         limb) on IRIX 6.
21673
21674         * Makefile.am (SUBDIRS): Put "tests" first so tests/t-constants.c is
21675         run first, to pick up any limb size mismatch.
21676
21677         * tune/tuneup.c (DIVREM_1, MOD_1): Fix result values, were off by 1.
21678
21679         * mpz/fib_ui.c (table1, table2): Add data for 4,8,16 bits per limb.
21680
21681 2000-12-12  Torbjorn Granlund  <tege@swox.com>
21682
21683         * gmp-impl.h (LIMBS_PER_DOUBLE): Define for any limb bitsize.
21684
21685 2000-12-11  Torbjorn Granlund  <tege@swox.com>
21686
21687         * mpn/mp_bases.c: Add tables for 8-bit and 16-bit limbs.
21688         Round existing `double' values properly.
21689
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.
21695
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.
21699         (PP_MASK): Remove.
21700         (PP_MAXPRIME): Remove.
21701
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.
21705
21706 2000-12-10  Torbjorn Granlund  <tege@swox.com>
21707
21708         * mpn/generic/mul_1.c: Declare parameters in C89 style.
21709
21710 2000-12-10  Kevin Ryde  <kevin@swox.se>
21711
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
21714         it.
21715
21716         * configure.in (mips3,mips64): Add ABI=64, name the others ABI=n32 and
21717         ABI=o32.
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.
21723
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.
21726
21727 2000-12-09  Torbjorn Granlund  <tege@swox.com>
21728
21729         * mpz/cmpabs.c: Remove unused variable.
21730         * mpz/rrandomb.c: Likewise.
21731         * mpz/xor.c: Likewise.
21732
21733 2000-12-07  Torbjorn Granlund  <tege@swox.com>
21734
21735         * mpn/generic/gcdext.c: Handle double carry when computing s1.
21736         Merge two code blocks for computing s0 and s1.
21737
21738 2000-12-07  Kevin Ryde  <kevin@swox.se>
21739
21740         * configure.in (hppa*-*-*): Remove -Aa -D_HPUX_SOURCE from
21741         cc_cflags/cppflags, and instead let AM_C_PROTOTYPES add it, or -Ae,
21742         whichever works.
21743
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.
21747
21748 2000-12-06  Torbjorn Granlund  <tege@swox.com>
21749
21750         * mpq/cmp_ui.c: Streamline.
21751
21752 2000-12-06  Kevin Ryde  <kevin@swox.se>
21753
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.
21759
21760         * speed.c (getopt_long): Don't use this, just plain getopt.
21761         * configure.in (getopt_long): Remove test.
21762
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.
21772
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.
21783
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.
21788
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.
21793
21794         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Don't add flags to a user
21795         selected $AR or $NM.
21796
21797         * tune/tuneup.c (all): Print how long the tuning took.
21798
21799         * configure.in (AM_C_PROTOTYPES): Use this, not GMP_ANSI2KNR.
21800         * acinclude.m4 (GMP_ANSI2KNR): Remove.
21801
21802         * Makefile.am (gmp.h, mp.h): In DISTCLEANFILES not CLEANFILES.
21803
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.
21806
21807         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add "*" for
21808         the benefit of cray.
21809
21810         * compat.c (mpn_divexact_by3, mpn_divmod_1): Return types should be
21811         mp_limb_t, not int, and need an actual "return".
21812
21813 2000-12-05  Torbjorn Granlund  <tege@swox.com>
21814
21815         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
21816         * mpn/alpha/gmp-mparam.h: Tune for 21064.
21817
21818         * longlong.h: Reformat to avoid newlines within strings.
21819
21820         * gmp-impl.h (inline): Disable if GCC has defined __STRICT_ANSI__.
21821
21822         * configure.in: Do a `mkdir tune' before creating tune/sqr_basecase.c.
21823
21824         * Makefile.am: Treat mp.h analogously to gmp.h.
21825
21826         configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc.
21827
21828         * mp-h.in: Renamed from mp.h.
21829         Add #define for _LONG_LONG_LIMB.
21830         Move some other fixes from gmp-h.in.
21831         * mp.h: Removed.
21832         * configure.in: Generate mp.h from mp-h.in like we handle
21833         gmp-h.in/gmp.h.
21834
21835 2000-12-04  Torbjorn Granlund  <tege@swox.com>
21836
21837         * acinclude.m4: Fix typo testing for bad HP compiler.
21838
21839 2000-12-03  Torbjorn Granlund  <tege@swox.com>
21840
21841         * mpbsd/tests/t-misc.c (check_itom): Exclude some tests for Cray
21842         CFP systems.
21843
21844         * longlong.h (CRAYIEEE umul_ppmm): New.
21845
21846         * mpn/cray/gmp-mparam.h (BITS_PER_SHORTINT): 32 => 64.
21847         (*_THRESHOLD): Tune.
21848
21849         * configure.in: Disable shared libs for *-*-unicos*.
21850
21851 2000-12-03  Kevin Ryde  <kevin@swox.se>
21852
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.
21856
21857 2000-12-01  Torbjorn Granlund  <tege@swox.com>
21858
21859         * mpf/tests/t-get_d.c (LOW_BOUND,HIGH_BOUND): #define for non-IEEE
21860         Cray systems.
21861
21862         * gmp-impl.h (union ieee_double_extract): Test for _CRAYIEEE.
21863
21864 2000-11-30  Torbjorn Granlund  <tege@swox.com>
21865
21866         * mpz/tests/t-mul.c (base_mul): Fix re-evaluation problems in macro
21867         invocations.
21868         (ref_mpz_mul): New name from mpz_refmul.  Make static.
21869         (base_mul): New name for _mpn_mul_classic.
21870
21871 2000-11-30  Kevin Ryde  <kevin@swox.se>
21872
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.
21881
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
21885         HAVE_HOST_CPU.
21886         * gmp.texi (Build Options, and elsewhere): Update.
21887
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.
21891
21892         * acinclude.m4 (GMP_PROG_AR): New macro, using AC_CHECK_TOOL, adding
21893         GMP flags.
21894         * configure.in: Use it
21895
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.
21904
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.
21911
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
21916         $(GMP_LDFLAGS).
21917         * gmp.texi (Notes for Particular Systems): Update AIX problem
21918
21919         * configure.in (AC_CONFIG_LINKS): Use where needed, not via gmp_links.
21920         (gmp_srclinks): Build up as needed, not via gmp_links.
21921
21922         * acinclude.m4 (GMP_INIT): Do CONFIG_TOP_SRCDIR and asm-defs.m4 here.
21923         * configure.in (asm-defs.m4): Consequent changes.
21924
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.
21929
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.
21933
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
21937         problem, fixed.
21938
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
21942         problem, fixed.
21943
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).
21949
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.
21953
21954         * gmp.texi (Build Options): List alphaev56, alphapca56, alphaev67,
21955         hppa2.0n and power among supported CPUs.
21956
21957 2000-11-30  Torbjorn Granlund  <tege@swox.com>
21958
21959         * mpz/tests/t-mul.c: Increase max operand size from 2^17 bits
21960         to 2^19 bits.  Misc cleanups.
21961
21962 2000-11-26  Kevin Ryde  <kevin@swox.se>
21963
21964         * tune/tuneup.c (FIB_THRESHOLD): Cope better with different speeds of
21965         odd and even sizes.
21966
21967         * longlong.h (alpha): Use udiv_qrnnd and count_leading_zeros on all
21968         compilers, not just gcc.
21969
21970         * pre_mod_1.c: Use conditional subtract to always skip a division.
21971         (UMUL_TIME, UDIV_TIME): Remove defaults, now in longlong.h.
21972
21973 2000-11-22  Torbjorn Granlund  <tege@swox.com>
21974
21975         * mpn/pa64w/gmp-mparam.h: Retune.
21976         * mpn/pa64/gmp-mparam.h: Retune.
21977         * mpn/sparc64/gmp-mparam.h: Retune.
21978
21979 2000-11-22  Kevin Ryde  <kevin@swox.se>
21980
21981         * gmp-impl.h (ABOVE_THRESHOLD, BELOW_THRESHOLD): New macros.
21982         * mpn/generic/gcdext.c: Use them.
21983
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
21986         and double.
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.
21992
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
21996         invert_limb.
21997
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.
22004
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.
22009
22010         * configure.in (alloca): Accept yes/no/detect, generate an error if
22011         "yes" but not available.
22012         * gmp.texi (Build Options): Update.
22013
22014         * acinclude.m4 (GMP_TRY_ASSEMBLE): Make conftest.out available.
22015         (GMP_ASM_ALIGN_FILL_0x90): Use it.
22016
22017         * acinclude.m4 (GMP_ASM_X86_MMX) [*-*-solaris*]: Check for solaris
22018         2.6 "as" movq bug.
22019         * gmp.texi (Notes for Particular Systems): Update x86 MMX note.
22020
22021 2000-11-21  Torbjorn Granlund  <tege@swox.com>
22022
22023         * tune/Makefile.am (EXTRA_DIST): List hppa2w.asm.
22024
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.
22028
22029         * mpn/pa64/gmp-mparam.h (BITS_PER_LONGINT): 64 => 32.
22030
22031 2000-11-21  Kevin Ryde  <kevin@swox.se>
22032
22033         * urandom.h (random): No prototype if glibc stdlib.h has already
22034         provided it (avoids an int32_t/long conflict).
22035
22036         * tune/Makefile.am (LDFLAGS): Use -all-static.
22037         (speed-dynamic): Dynamic linked version of speed.c.
22038         * tune/README: Update.
22039
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.
22047
22048         * tune/tuneup.c (POWM_THRESHOLD): Slightly bigger size steps.
22049
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.
22055
22056 2000-11-20  Torbjorn Granlund  <tege@swox.com>
22057
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.
22062
22063         * configure.in [compiler switch]: Pass "-Aa -D_HPUX_SOURCE" to cc for
22064         all hppa versions.
22065
22066         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Reference data using PC relative
22067         addressing (was r19 relative addressing).
22068
22069 2000-11-18  Torbjorn Granlund  <tege@swox.com>
22070
22071         * rand.c: (__gmp_rand_lc_scheme): Convert strings to hexadecimal.
22072         (gmp_randinit): Expect strings in hexadecimal.
22073
22074 2000-11-18  Kevin Ryde  <kevin@swox.se>
22075
22076         * configfsf.guess, configfsf.sub: Update to 2000-11-16.
22077         * config.guess (alpha*-*-openbsd*): Do exact cpu detection.
22078
22079 2000-11-14  Torbjorn Granlund  <tege@swox.com>
22080
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.
22086
22087 2000-11-13  Kevin Ryde  <kevin@swox.se>
22088
22089         * mpn/Makeasm.am: New file, splitting out assembler rules.
22090         * mpn/Makefile.am, tune/Makefile.am: Use it.
22091
22092         * mpn/Makefile.am (@CPP@): Remove this, automake already gives it.
22093
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.
22099
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.
22107
22108 2000-11-13  Torbjorn Granlund  <tege@swox.com>
22109
22110         * mpz/tests/t-mul.c: Remove #include urandom.h.
22111         * mpz/tests/t-tdiv.c: Likewise.
22112
22113         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]:
22114         Declare hppa.asm as just 32 bits (cyclecounter_size=1).
22115
22116 2000-11-12  Torbjorn Granlund  <tege@swox.com>
22117
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.
22124
22125         * demos/pexpr.c (HAVE_sigaltstack): Fix typo in testing for _UNICOS.
22126         Also test for __hpux.
22127
22128 2000-11-11  Torbjorn Granlund  <tege@swox.com>
22129
22130         * mpn/alpha/ev5/gmp-mparam.h: Retune.
22131
22132         * mpn/alpha/ev6/gmp-mparam.h: Retune.
22133
22134         * mpn/alpha/ev6/add_n.asm: Misc cleanups.
22135
22136         * mpn/alpha/ev6/sub_n.asm: New file.
22137
22138 2000-11-10  Torbjorn Granlund  <tege@swox.com>
22139
22140         * configure.in [path switch] (alphaev6*-*-*): Add alpha/ev5 to path.
22141
22142         * mpn/alpha/ev6/add_n.asm: New file.
22143
22144 2000-11-10  Kevin Ryde  <kevin@swox.se>
22145
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.
22150
22151         * tune/tuneup.c (POWM_THRESHOLD): Determine from redc and mpz_mod.
22152         * tune/Makefile.am (TUNE_MPZ_SRCS): Remove powm.
22153
22154 2000-11-10  Torbjorn Granlund  <tege@swox.com>
22155
22156         * mpn/mips3/gmp-mparam.h: Retune.
22157
22158         * configure.in (os_64bit): Rename to check_64bit_compiler.
22159
22160 2000-11-09  Torbjorn Granlund  <tege@swox.com>
22161
22162         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Choose hppa/hppa2 code
22163         depending on $CC64.
22164
22165 2000-11-09  Kevin Ryde  <kevin@swox.se>
22166
22167         * mpn/x86/pentium/mul_1.asm: Unroll 2x, saving 1 c/l when in L1.
22168         Add 1c entrypoint.
22169         * mpn/x86/pentium/aorsmul_1.asm: Add 1c entrypoints, shave a couple
22170         of cycles at entry and exit.
22171
22172         * configure.in (power1,2,2sc): Support these as synonyms for plain
22173         power.
22174
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.
22178
22179         * gmp.texi (Notes for Particular Systems): Remarks about power/powerpc.
22180         (Reentrancy): Remarks about simultaneous writing.
22181         (Reporting Bugs): Ask for configfsf.guess.
22182
22183 2000-11-08  Kevin Ryde  <kevin@swox.se>
22184
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).
22189
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.
22200
22201         * mpn/tests/spinner.c (spinner_signal): Use RETSIGTYPE.
22202         (spinner_init): Force output to unbuffered.
22203
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.
22207
22208 2000-11-06  Torbjorn Granlund  <tege@swox.com>
22209
22210         * urandom.h: Simplify and make it work properly for 64-bit
22211         machines also in environments without `random'.
22212
22213 2000-11-04  Torbjorn Granlund  <tege@swox.com>
22214
22215         * configure.in [path switch]: Don't match rs6000-*-*, in
22216         particular don't assume POWER.
22217
22218         * tune/tuneup.c (fft): Remove usleep calls.
22219
22220         * config.guess: Don't pass "$@" when it is known to be empty.
22221
22222         * Makefile.am (EXTRA_DIST): List configfsf.guess and configfsf.sub.
22223
22224 2000-11-04  Kevin Ryde  <kevin@swox.se>
22225
22226         * configfsf.guess, configfsf.sub: Moved from config.guess and
22227         config.sub.
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.
22232
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.
22238
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.
22243
22244         * longlong.h [pentium] (count_leading_zeros): New macro.
22245         (__clz_tab): Always provide prototype.
22246         * acconfig.h (HAVE_TARGET_CPU_): Add x86s.
22247
22248         * tune/speed.[ch],common.c (count_leading_zeros,
22249         count_trailing_zeros, __udiv_qrnnd_c): Add measuring.
22250
22251         * configure.in (X86_PATTERN): Move from here ...
22252         * acinclude.m4 (X86_PATTERN): ... to here.
22253         (GMP_ASM_RODATA): Use it.
22254
22255         * configure.in (srandom): New test.
22256         * mpn/tests/try.c: Use it.
22257         * tune/speed.c: Ditto, and conditionalize getrusage and headers.
22258
22259 2000-11-02  Kevin Ryde  <kevin@swox.se>
22260
22261         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add udiv_qrnnd.c
22262         and udiv_w_sdiv.c.
22263
22264         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove a duplicate
22265         subtract at the evaluate stage.
22266
22267 2000-11-01  Torbjorn Granlund  <tege@swox.com>
22268
22269         * configure.in [compiler switch] (sparc64-*-linux*): Spell
22270         gmp_xoptcflags_gcc properly, and pass same options as for other
22271         sparcv9 configs.
22272
22273         * tune/speed.h (SPEED_ROUTINE_MPN_GET_STR): Fix type of wsize.
22274
22275 2000-10-31  Torbjorn Granlund  <tege@swox.com>
22276
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.
22280
22281 2000-10-29  Torbjorn Granlund  <tege@swox.com>
22282
22283         * mpn/ia64/lorrshift.asm: New file.
22284
22285         * configure.in: New mulfunc `lorrshift' for lshift and rshift.
22286
22287 2000-10-29  Kevin Ryde  <kevin@swox.se>
22288
22289         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Delete code performing
22290         superfluous mpn_sub_n calls.
22291
22292         * configure.in (found_asm, M4): Account for SPEED_CYCLECOUNTER_OBJ,
22293         for the benefit of targets whose only .asm is a cycle counter.
22294
22295         * tune/tuneup.c (fft): Remove bogus usleep calls.
22296
22297 2000-10-28  Torbjorn Granlund  <tege@swox.com>
22298
22299         * mpn/ia64/invert_limb.asm: Get return value for 0x800...00 right.
22300
22301         * tune/Makefile.am (EXTRA_DIST): Add ia64.asm.
22302
22303         * tune/ia64.asm: Fix typo.
22304
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.
22308
22309         * configure.in [path switch] (ia64*-*-*): Set extra_functions.
22310         * mpn/ia64/invert_limb.asm: New file.
22311
22312 2000-10-27  Torbjorn Granlund  <tege@swox.com>
22313
22314         * configure.in [compiler switch]:
22315         Get rid of c89 for all hppa flavours--it is an evil compiler!
22316
22317         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix type of xp.
22318         (SPEED_ROUTINE_MPN_GET_STR): Fix type of wp.
22319
22320 2000-10-27  Kevin Ryde  <kevin@swox.se>
22321
22322         * gmp.texi (Fibonacci Number Algorithm): New section.
22323
22324         * mpz/tests/t-fib_ui.c: New file.
22325         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
22326
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
22332         data.
22333
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_.
22336
22337         * tune/freq.c (speed_cpu_frequency_measure): New test comparing
22338         gettimeofday and speed_cyclecounter, should cover many systems.
22339
22340 2000-10-27  Torbjorn Granlund  <tege@swox.com>
22341
22342         * mpn/ia64/gmp-mparam.h: Retune.
22343
22344 2000-10-26  Torbjorn Granlund  <tege@swox.com>
22345
22346         * longlong.h (ia64): Set UMUL_TIME and UDIV_TIME.
22347
22348         * mpn/ia64/submul_1.c: Fix typo.
22349
22350 2000-10-25  Kevin Ryde  <kevin@swox.se>
22351
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.
22355
22356 2000-10-24  Torbjorn Granlund  <tege@swox.com>
22357
22358         * tune/freq.c: Explicitly #include config.h before other include files.
22359
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.
22363
22364         * mpn/powerpc32/gmp-mparam.h: Retune.
22365         * mpn/powerpc64/gmp-mparam.h: Retune.
22366
22367 2000-10-24  Kevin Ryde  <kevin@swox.se>
22368
22369         * mpn/x86/k6/cross.pl: Support 8 and 16 byte code alignment.
22370
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.
22375
22376         * tune/tuneup.c (xp_block, yp_block): Initialize these with random
22377         data.  Fixes GCD_ACCEL and GCDEXT thresholds, and latest POWM.
22378
22379 2000-10-23  Torbjorn Granlund  <tege@swox.com>
22380
22381         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Add ia64 case.
22382
22383         * mpn/ia64/gmp-mparam.h: Fill in some parameters.
22384
22385         * mpn/ia64/submul_1.c: New file.
22386
22387         * tune/ia64.asm: New file.
22388
22389         * gmp-impl.h (union ieee_double_extract): Handle ia64.
22390
22391         * mpn/mp_bases.c: Decrease chars_per_bit_exactly for entry 1 to
22392         work around buggy ia64-linux.
22393
22394         * longlong.h (ia64 umul_ppmm): Update register flags to match new GCC.
22395
22396 2000-10-22  Torbjorn Granlund  <tege@swox.com>
22397
22398         * mpn/alpha/ev6/gmp-mparam.h (DC_THRESHOLD): Update.
22399         * mpn/alpha/ev6/submul_1.asm: New file.
22400
22401 2000-10-22  Kevin Ryde  <kevin@swox.se>
22402
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.
22407
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.
22412
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):
22416         Remove default.
22417
22418 2000-10-21  Torbjorn Granlund  <tege@swox.com>
22419
22420         * mpn/Makefile.am (TARG_DIST): Add ia64.
22421
22422 2000-10-21  Kevin Ryde  <kevin@swox.se>
22423
22424         * *: Change BZ -> DC.
22425         * mpn/generic/dc_divrem_n.c: Renamed from bz_divrem_n.c.
22426
22427         * doc/multiplication: Remove file, now in the manual.
22428         * doc/assembly_code: Ditto.
22429         * tune/README: Remove some parts now in the manual.
22430
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.
22438
22439         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove some
22440         unused variables.
22441         * mpn/generic/mul_fft.c (mpn_fft_best_k): Ditto.
22442
22443         * tune/freq.c: New file, split from time.c.
22444         * tune/time.c: Rewrite, now more automated.
22445         * configure.in, tune/*: Consequent changes.
22446
22447 2000-10-20  Torbjorn Granlund  <tege@swox.com>
22448
22449         * mpn/ia64/default.m4: New file.
22450         * configure.in [config.m4 switch] (ia64*-*-*): Use ia64/default.m4.
22451
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.
22458
22459         * mpn/alpha/cntlz.asm: Override `.set noat' from ASM_START.
22460
22461         * configure.in (HAVE_TARGET_CPU_*): Support hppa1.0, hppa1.1, hppa2.0
22462         by sed'ing the period into `_'.
22463
22464         * acconfig.h: Add #undefs for hppa targets.
22465
22466         * longlong.h (udiv_qrnnd): Fix typo in last change.
22467
22468         * mpz/tstbit.c: Rewrite (partly to work around GCC 2.95.2 HPPA bug).
22469
22470         * configure.in [path switch]:
22471         (hppa2.0*-*-*): For non-CC64 case, update path.
22472
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,
22477         gmp_cflags_c89.
22478
22479 2000-10-18  Torbjorn Granlund  <tege@swox.com>
22480
22481         * configure.in (alpha*-*-*): Define gmp_xoptcflags_gcc like for
22482         alpha*-*-osf*.
22483
22484         * longlong.h (x86 udiv_qrnnd): Change `d' => `dx' to avoid K&R C
22485         stringification.
22486
22487 2000-10-15  Kevin Ryde  <kevin@swox.se>
22488
22489         * doc/configuration: Updates.
22490
22491         * demos/calc.y: Remove some comments.
22492
22493 2000-10-14  Kevin Ryde  <kevin@swox.se>
22494
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.
22500
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.
22504
22505         * acinclude.m4, configure.in (GMP_ASM_*): Rename from GMP_CHECK_ASM_*,
22506         to follow autoconf conventions.
22507
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.
22510
22511         * mpn/x86/x86-defs.m4 (ASSERT): Allow no condition, to just emit code.
22512
22513 2000-10-13  Kevin Ryde  <kevin@swox.se>
22514
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.
22520
22521         * mpq/tests/t-md_2exp.c: New file.
22522         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
22523
22524         * mpn/generic/perfsqr.c: Add/amend some comments.
22525
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,
22529         mention HTML.
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
22535         variables.
22536         (Integer Logic and Bit Fiddling): Note bits are numbered from 0.
22537
22538         * INSTALL.autoconf: New file.
22539         * Makefile.am (EXTRA_DIST): Add it.
22540
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.
22544
22545         * tune/speed.h,common.c (SPEED_ROUTINE_MPZ_POWM): Use s->yp and
22546         s->xp_block, make exponent a fixed size.
22547
22548 2000-10-07  Torbjorn Granlund  <tege@swox.com>
22549
22550         * mpn/mips3/gmp-mparam.h: Retune.
22551
22552         * mpn/generic/mul_n.c (USE_MORE_MPN): Revert last change.
22553
22554 2000-10-06  Torbjorn Granlund  <tege@swox.com>
22555
22556         * mpn/mips3/add_n.s: Decrease carry recurrence from 4 to 3 cycles.
22557         * mpn/mips3/sub_n.s: Likewise.
22558
22559 2000-10-04  Torbjorn Granlund  <tege@swox.com>
22560
22561         * configure.in (sparc64-*-linux*): Set path according to CC64.
22562
22563 2000-10-04  Kevin Ryde  <kevin@swox.se>
22564
22565         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Use LABEL_SUFFIX, not a
22566         hard-coded ":".
22567
22568         * config.sub: Don't demand "86" in CPU name for SCO.
22569
22570         * configure.in (supersparc-*-*): Remove -DSUPERSPARC.
22571         * longlong.h: Use HAVE_TARGET_CPU_supersparc.
22572
22573         * configure.in (HAVE_TARGET_CPU_*): AC_DEFINE from $target_cpu.
22574         * acconfig.h: Add #undefs, but only for targets of interest.
22575
22576 2000-10-03  Torbjorn Granlund  <tege@swox.com>
22577
22578         * mpn/alpha/cntlz.asm: Rewrite.
22579
22580         * mp_clz_tab.c (__clz_tab): Half table size to 128 entires.
22581         * longlong.h (count_leading_zeros): Demand just 128 entries from
22582         __clz_tab.
22583
22584         * configure.in (mips-sgi-irix6.*): Pass -mips3 in addition to options
22585         for n32 ABI.
22586
22587         * longlong.h: Move NO_ASM test around all assembly code.
22588         From gcc:
22589         * longlong.h (count_leading_zeros): Sparclite scan instruction was
22590         being invoked incorrectly.
22591         Replace __mc68332__ with __mcpu32__.
22592         Add ARC support.
22593
22594 2000-10-02  Torbjorn Granlund  <tege@swox.com>
22595
22596         * mpn/mips3/gmp-mparam.h: Retune for both gcc and cc.
22597
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.
22601
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.
22612
22613         * mpn/m68k/gmp-mparam.h: New file.
22614         * mpn/alpha/ev5/gmp-mparam.h: New file.
22615
22616         * gmp-impl.h (default MPN_COPY): Remove final `;'.
22617
22618         * tune/time.c (speed_endtime): Rewrite.
22619
22620         * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Set base to a large value,
22621         not 2.
22622
22623         * demos/pexpr.c (setup_error_handler): Fix typo.
22624
22625         * mpz/powm.c (redc): New function, based on old mpz_redc.  Don't
22626         multiply here.
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.
22633
22634         * longlong.h: Use ia64 count_leading_zeros just when __GNUC__.
22635
22636 2000-09-29  Kevin Ryde  <kevin@swox.se>
22637
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.
22644
22645         * configure.in: Only run GMP_PROG_M4 if it's actually needed.
22646
22647 2000-09-27  Torbjorn Granlund  <tege@swox.com>
22648
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.
22652
22653         * mpn/alpha/ev6/addmul_1.asm: Use explicit offset for all load and
22654         store insns.  Helps old gas.
22655
22656         * longlong.h (count_leading_zeros): Define for ia64.
22657
22658 2000-09-27  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
22659
22660         * mpn/generic/bz_divrem_n.c: Fix qhl handling, simplify.
22661
22662 2000-09-27  Kevin Ryde  <kevin@swox.se>
22663
22664         * mpn/Makefile.in (.SUFFIXES): Regenerate with patched automake to
22665         get .s before .c, which is needed to override ansi2knr .c rules.
22666
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
22672         requirements.
22673         (mpn_gcd_1): Clarify value must be non-zero, not just size.
22674
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.
22678
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.
22682
22683 2000-09-26  Kevin Ryde  <kevin@swox.se>
22684
22685         * gmp-impl.h, longlong.h, mpn/generic/*.c: Add ASSERTs for various
22686         parameter restrictions.
22687
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.
22692
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.
22695
22696 2000-09-25  Kevin Ryde  <kevin@swox.se>
22697
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.
22703
22704 2000-09-12  Kevin Ryde  <kevin@swox.se>
22705
22706         * gmp-impl.h (mpn_tdiv_qr): Move prototype from here ...
22707         * gmp.h (mpn_tdiv_qr): ... to here.
22708
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.
22712
22713 2000-09-10  Kevin Ryde  <kevin@swox.se>
22714
22715         * mpn/x86/pentium/com_n.asm: New file.
22716
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.
22720
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.
22725
22726         * mpq/set_den.c: Don't discard sign when copying, this makes the
22727         code match the manual.
22728
22729 2000-09-07  Torbjorn Granlund  <tege@swox.com>
22730
22731         * tune/alpha.asm: Rewrite to actually work right.
22732
22733 2000-09-07  Kevin Ryde  <kevin@swox.se>
22734
22735         * tune/common.c,speed.[ch]: Add measuring of mpn_sqrtrem,
22736         mpn_get_str, mpn_set_str.
22737         * tune/README: Various updates.
22738
22739 2000-09-06  Torbjorn Granlund  <tege@swox.com>
22740
22741         * mpz/fits.c: Correct type of `data'.
22742
22743 2000-09-06  Kevin Ryde  <kevin@swox.se>
22744
22745         * gmp.texi (Build Options): Clarify where to find CFLAGS.
22746         (Known Build Problems): Note SCO -lc problem.
22747
22748         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Fix for sizes > 512 limbs.
22749
22750         * doc/multiplication: Corrections and additions suggested by Paul.
22751
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.
22756
22757         * mpn/x86/t-zdisp.sh: New file.
22758
22759         * tests/t-modlinv.c: New file.
22760         * tests/Makefile.am (check_PROGRAMS): Add it.
22761
22762         * mpq/tests/t-set_f.c: New file.
22763         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
22764
22765         * gmp-impl.h (MPQ_CHECK_FORMAT): New macro.
22766         * mpq/tests/t-get_d.c: Use it.
22767
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.
22774
22775 2000-09-03  Kevin Ryde  <kevin@swox.se>
22776
22777         * mpz/aors_ui.c: New file merging add_ui.c and sub_ui.c, no object
22778         code changes.
22779         * mpz/add_ui.c, mpz/sub_ui.c: Remove files.
22780         * mpz/Makefile.am: Update.
22781
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.
22789
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.
22793
22794         * mpn/x86/*/*.asm: Use "TEXT" not ".text".
22795
22796 2000-09-02  Kevin Ryde  <kevin@swox.se>
22797
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.
22801
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.
22805
22806         * configure.in: Re-apply "PROLOGUE.*" regexp change for the
22807         benefit of alpha PROLOGUE_GP, lost in path search reorganisation.
22808
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.
22814
22815 2000-08-29  Torbjorn Granlund  <tege@swox.com>
22816
22817         * demos/primes.c: Include string.h.
22818
22819         * config.guess (x86 variant recog code): Remove dummy*.o files
22820         generated by some compilers.
22821
22822 2000-08-28  Kevin Ryde  <kevin@swox.se>
22823
22824         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix Solaris 2.8
22825         warning message suppression, add notes about SCO.
22826
22827         * Makefile.am (MPZ_OBJECTS etc): Move some comments.
22828
22829 2000-08-25  Kevin Ryde  <kevin@swox.se>
22830
22831         * mpz/pprime_p.c (mpz_millerrabin): Fix a TMP_FREE.
22832
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.
22836
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.
22841
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.
22846
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.
22850
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.
22858
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.
22863
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.
22868
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.
22873
22874 2000-08-24  Torbjorn Granlund  <tege@swox.com>
22875
22876         * gmp-impl.h (mpn_com_n): Fix typo.
22877
22878 2000-08-23  Torbjorn Granlund  <tege@swox.com>
22879
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.
22885
22886 2000-08-23  Kevin Ryde  <kevin@swox.se>
22887
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.
22891
22892 2000-08-21  Torbjorn Granlund  <tege@swox.com>
22893
22894         * gmp-impl.h (ASSERT): Use do..while for dummy version.
22895
22896         * mpf/get_str.c: Don't set n_digits from digits_computed_so_far
22897         when the converted operand becomes zero.  Misc cleanups.
22898
22899 2000-08-21  Kevin Ryde  <kevin@swox.se>
22900
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.
22903
22904 2000-08-20  Kevin Ryde  <kevin@swox.se>
22905
22906         * mpz/set.c [BERKELEY_MP] (move): Add conditionals to build as
22907         "move" for libmp.
22908         * mpbsd/Makefile.am: Use mpz/set.c, not move.c.
22909         * Makefile.am (MPBSD_OBJECTS): Corresponding change.
22910         * mpbsd/move.c: Remove file.
22911
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
22915         cleaner.
22916         * mpz/mul_siui.c, mpf/integer.c: Revert to plain OPERATION_* forms.
22917
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.
22921
22922 2000-08-16  Kevin Ryde  <kevin@swox.se>
22923
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.
22928
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.
22932
22933         * tests/t-constants.c: New file.
22934         * tests/Makefile.am (check_PROGRAMS): Add it.
22935
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.
22941
22942         * mpn/tests/try.c (call): Cast popcount and hamdist calls,
22943         for the benefit of long long limb.
22944
22945 2000-08-15  Kevin Ryde  <kevin@swox.se>
22946
22947         * mp.h (mp_set_memory_functions): Add missing #define.
22948         * mpbsd/tests/allfuns.c (mp_set_memory_functions): Verify its
22949         existence.
22950
22951         * mpf/tests/t-misc.c (check_mpf_getset_prec): New test, verifying
22952         reverted behaviour of mpf_get_prec.
22953
22954         * mpn/tests/ref.c (refmpn_strip_twos): Use refmpn_copyi, not
22955         MPN_COPY_INCR.
22956
22957         * mpz/mul_siui.c, mpf/integer.c: Recognise OPERATION_*_ forms
22958         produced under ansi2knr.
22959
22960         * configure.in (mpn_objects, mpn_objs_in_libgmp): Add $U to .c
22961         objects when ansi2knr in use.
22962
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.
22971
22972 2000-08-03  Torbjorn Granlund  <tege@swox.com>
22973
22974         * mpn/alpha/ev6/addmul_1.asm: Correct number of cycles to 3.5/28.
22975
22976 2000-08-02  Torbjorn Granlund  <tege@swox.com>
22977
22978         * Version 3.1 released.
22979
22980         * gmp.texi: Rephrase mpf_urandomb documentation.
22981
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.
22985
22986 2000-08-02  Kevin Ryde  <kevin@swox.se>
22987
22988         * demos/factorize.c (random): Don't use "inline".
22989
22990         * mpfr/log.c, mpfr/mul_ui.c, mpfr/round.c, mpfr/set.c, mpfr/set_d.c:
22991         Corrections to K&R parts.
22992
22993         * Makefile.am (EXTRA_HEADERS): Omit $(MPFR_HEADERS_OPTION).
22994         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr.h.
22995
22996         * gmp.texi (Known Build Problems): Note problem stripping libgmp.a.
22997
22998 2000-08-02  Kent Boortz  <kent@swox.com>
22999
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.
23003
23004 2000-08-01  Torbjorn Granlund  <tege@swox.com>
23005
23006         * mpn/generic/popcount.c: Disable SPARC v9 popc_limb pattern.
23007         * mpn/generic/hamdist.c: Likewise.
23008
23009 2000-08-01  Kevin Ryde  <kevin@swox.se>
23010
23011         * mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
23012         source and dest regions.
23013
23014 2000-07-31  Torbjorn Granlund  <tege@swox.com>
23015
23016         * mpf/get_str.c: Develop three extra digits, not just one.
23017
23018 2000-07-31  Kevin Ryde  <kevin@swox.se>
23019
23020         * gmp.texi (References): Add URL for invariant division.
23021
23022 2000-07-30  Kevin Ryde  <kevin@swox.se>
23023
23024         * tune/time.c (speed_cpu_frequency_proc_cpuinfo): Add support for
23025         alpha linux "cycle frequency".
23026
23027         * mpn/sparc64/gmp-mparam.h: Re-run tune program for FFT thresholds.
23028
23029 2000-07-29  Kevin Ryde  <kevin@swox.se>
23030
23031         * gmp.texi (ABI and ISA): Add sparc64-*-linux*.
23032         * configure.in [sparc64-*-linux*] (gmp_cflags64_gcc): Same flags
23033         as under solaris.
23034
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.
23040
23041         * tune/README: Notes on FFT and GCD thresholds, other minor updates.
23042
23043         * Makefile.am: Expunge the macos generated files update stuff.
23044
23045 2000-07-28  Kevin Ryde  <kevin@swox.se>
23046
23047         * mpn/x86/*/gmp-mparam.h: Add some FFT thresholds.
23048
23049 2000-07-28  Kent Boortz  <kent@swox.se>
23050
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.
23062
23063 2000-07-27  Kevin Ryde  <kevin@swox.se>
23064
23065         * mpn/generic/mul_fft.c: New file, by Paul Zimmermann, minor mods
23066         applied.
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).
23070
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):
23073         New functions.
23074         (numberof, TMP_ALLOC_TYPE etc, _MP_ALLOCATE_FUNC_TYPE etc,
23075         UNSIGNED_TYPE_MAX etc): New macros.
23076
23077         * tune/*: Add FFT threshold tuning and speed measuring.
23078         * tune/common.c: Avoid huge macro expansions for umul and udiv.
23079
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.
23083
23084         * demos/Makefile.am (BUILT_SOURCES): Don't need calc.c etc under this.
23085
23086 2000-07-27  Torbjorn Granlund  <tege@swox.com>
23087
23088         * mpn/ia64/gmp-mparam.h: New file.
23089
23090 2000-07-26  Torbjorn Granlund  <tege@swox.com>
23091
23092         * demos/isprime.c: Handle any number of arguments and print
23093         classification for each.  Add `-q' option for old behaviour.
23094
23095 2000-07-26  Kevin Ryde  <kevin@swox.se>
23096
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.
23100
23101         * demos/factorize.c [__GLIBC__]: Don't declare random() under glibc.
23102
23103         * gmp.h (gmp_version): Add prototype and define.
23104
23105         * Makefile.am: Keep macos directory generated files up-to-date
23106         during development and on a "make dist".
23107
23108 2000-07-25  Torbjorn Granlund  <tege@swox.com>
23109
23110         * mpn/hppa/gmp-mparam.h: Update threshold values from new `tune' run.
23111
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.
23115
23116         * tune/hppa2.asm: Fix typo in .level directive.
23117
23118         * configure.in: Add sparc64-*-linux* support (from Jakub Jelinek).
23119         * configure: Regenerate.
23120
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.
23124
23125         * mpf/get_prc.c: Revert Aug 8, 1996 change.
23126
23127         * version.c: No longer static.
23128
23129         * mpn/pa64/gmp-mparam.h: Only #define *_THRESHOLD if not already
23130         defined.
23131         * mpn/pa64w/gmp-mparam.h: Likewise.
23132         * mpn/arm/gmp-mparam.h: Likewise.
23133         * mpn/mips3/gmp-mparam.h: Likewise.
23134
23135 2000-07-25  Kevin Ryde  <kevin@swox.se>
23136
23137         * INSTALL: It's "info -f ./gmp.info" to be sure of hitting the
23138         gmp.info in the current directory.
23139
23140         * Makefile.am (libmp_la_DEPENDENCIES): Add mpz/cmp.lo, for last
23141         mpz/powm.c fix.
23142
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
23145         filesystem.
23146         * mpn/sparc64/addmul_1.asm, mpn/sparc64/submul_1.asm,
23147         mpn/sparc64/mul_1.asm: Update include_mpn()s.
23148
23149 2000-07-24  Torbjorn Granlund  <tege@swox.com>
23150
23151         * Update header of all files previously under the Library GPL
23152         to instead be under the Lesser GPL.
23153
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).
23157
23158         * gmp.h (error code enum): Add GMP_ERROR_BAD_STRING (currently unused).
23159
23160         * mpz/tests/t-mul.c: Default SIZE to a function of TOOM3_MUL_THRESHOLD.
23161         Improve error messages.  Decrease reps.
23162
23163 2000-07-22  Kevin Ryde  <kevin@swox.se>
23164
23165         * tune/speed.h: Decrease the amount of data used for gcd and powm
23166         measuring, to make the tune go a bit faster.
23167
23168 2000-07-21  Kent Boortz  <kent@swox.se>
23169
23170         * macos/Asm*, macos/CmnObj, macos/Mp*: Directories no longer created
23171         from configure script, now part of dist.
23172         * macos/Makefile
23173         * macos/Makefile.cw
23174         * macos/config.h
23175         * macos/Asm/*.s
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.
23184
23185 2000-07-21  Torbjorn Granlund  <tege@swox.com>
23186
23187         * mpf/tests/t-muldiv.c: Relax error limit.  Make precision depend
23188         on SIZE.  Misc changes.
23189
23190         * configure: Regenerate.
23191
23192 2000-07-20  Kent Boortz  <kent@swox.com>
23193
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
23199         by Marco Bambini.
23200         * configure.in: Added comment about lines that the "macos/configure"
23201         script depend on.
23202
23203 2000-07-20  Torbjorn Granlund  <tege@swox.com>
23204
23205         * mpz/powm.c (mpz_powm): After final mpz_redc call, subtract `mod'
23206         from result if it is greater than `mod'.
23207
23208 2000-07-19  Torbjorn Granlund  <tege@swox.com>
23209
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.
23213
23214         * tune/hppa.asm: New file.
23215         * tune/hppa2.asm: New file.
23216         * configure.in (SPEED_CYCLECOUNTER_OBJS): Set for hppa2*-*-* and
23217         hppa*-*-*.
23218         * tune/Makefile.am (EXTRA_DIST): Add hppa.asm and hppa2.asm.
23219
23220         * tune/speed.h (SPEED_ROUTINE_MPN_BZ_DIVREM_CALL): Declare `marker';
23221         invoke TMP_FREE.
23222
23223         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Use "%" instead of "'" for
23224         reloc/symbol delimiter.
23225
23226 2000-07-16  Torbjorn Granlund  <tege@swox.com>
23227
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.
23231
23232 2000-07-16  Kevin Ryde  <kevin@swox.se>
23233
23234         * tune/*: Add measuring for umul_ppmm and udiv_qrnnd.
23235
23236 2000-07-14  Kevin Ryde  <kevin@swox.se>
23237
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,
23246         suiting plain K6.
23247         * mpn/x86/README, mpn/x86/k6/README: Updates.
23248         * mpn/x86/k6/mmx/*.asm: Update some comments.
23249
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.
23253
23254         * */Makefile.in: Regenerate with patched automake that adds
23255         $(EXEEXT) to EXTRA_PROGRAMS.
23256
23257         * mpn/tests/try.c: Add #ifdef to SIGBUS, for the benefit of djgpp.
23258         * config.guess: Recognise pc:*:*:* as an x86, for djgpp.
23259
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
23263         spec).
23264
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.
23267
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.
23271
23272         * tests/rand/*/Makefile.in: Regenerate with patched automake that adds
23273         $(EXEEXT) to EXTRA_PROGRAMS.
23274
23275 2000-07-13  Torbjorn Granlund  <tege@swox.com>
23276
23277         * mpz/tests/t-root.c: Also test mpz_perfect_power_p.
23278         Generate `nth' so that there will be fewer trivial values.
23279
23280         * mpz/root.c: Reverse return value in tests for detecting root of +1
23281         and -1.
23282
23283         * mpz/perfpow.c: Use TMP_ALLOC interface.
23284
23285 2000-07-12  Torbjorn Granlund  <tege@swox.com>
23286
23287         * mpz/perfpow.c (primes): Make it const.
23288
23289 2000-07-06  Kevin Ryde  <kevin@swox.se>
23290
23291         * mpn/x86/k6/cross.pl: New file.
23292
23293         * mpn/x86/*/gmp-mparam.h: Updates to thresholds, conditionalize
23294         all _TIME defines.
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.
23298
23299 2000-07-04  Kevin Ryde  <kevin@swox.se>
23300
23301         * NEWS: Updates.
23302         * mpn/x86/*/README: Miscellaneous updates.
23303
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.
23308
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.
23312
23313         * gmp.h (mpq_swap, mpf_swap): Add prototypes and defines.
23314
23315 2000-07-01  Kevin Ryde  <kevin@swox.se>
23316
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.
23324
23325         * configure.in (MPN_PATH): Renamed from mpn_path.
23326
23327         * gmp-impl.h (ULONG_MAX,ULONG_HIGHBIT,...,SHORT_MAX): New defines.
23328         * mp[zf]/tests/t-misc.c: Use them.
23329
23330         * mpbsd/tests/t-misc.c: New file.
23331         * mpbsd/tests/Makefile.am: Add it.
23332
23333         * Makefile.am (LIBGMP_LT_*, LIBMP_LT_*): Bump version info.
23334         * gmp.h (__GNU_MP_VERSION_*): Bump to 3.1.
23335
23336         * mpf/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
23337
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.
23342
23343 2000-06-30  Torbjorn Granlund  <tege@swox.com>
23344
23345         * demos/factorize.c (random): New function, defined conditionally.
23346         (factor_using_pollard_rho): Use it, not mrand48.
23347
23348         * mpn/cray/README: New file.
23349
23350 2000-06-30  Kevin Ryde  <kevin@swox.se>
23351
23352         * mpn/x86/pentium/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
23353
23354         * mpz/tests/t-jac.c: Test limbs on mpn_jacobi_base, not just ulongs.
23355
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.
23358
23359         * demos/pexpr.c [__DJGPP__]: Patch by Richard Dawe to not use
23360         setup_error_handler on djgpp.
23361
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.
23365
23366 2000-06-29  Torbjorn Granlund  <tege@swox.com>
23367
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.
23372
23373         * mpf/tests/t-dm2exp.c: Set u randomly in loop.  Perform more
23374         mpf_mul_2exp testing.
23375
23376         * configure.in: Recognize cray vector processors with a broad `*';
23377         move after alpha* not to match that.
23378
23379 2000-06-28  Kevin Ryde  <kevin@swox.se>
23380
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.
23384
23385 2000-06-27  Torbjorn Granlund  <tege@swox.com>
23386
23387         * mpf/tests/t-get_d.c: Be more lax about relative error, to handle Cray
23388         floating point format.
23389
23390         * mpq/tests/t-get_d.c: Decrease default reps to 1000.
23391
23392         * mpf/tests/t-conv.c: Correct type of `bexp'.
23393
23394         * configure.in (cray vector machines): Don't inherit gmp_cflags_cc.
23395
23396         * tune/Makefile.am (EXTRA_DIST): Delete sparc64.asm.
23397
23398         * configure.in (cray vector machines): Set extra_functions.
23399
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.
23407
23408 2000-06-26  Kevin Ryde  <kevin@swox.se>
23409
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
23413         sparc case.
23414
23415         * mpn/lisp/gmpasm-mode.el: Move keymap to the top of the docstring.
23416
23417 2000-06-21  Kevin Ryde  <kevin@swox.se>
23418
23419         * mpn/generic/mul_n.c (mpn_kara_mul_n, mpn_kara_sqr_n): Use
23420         mp_size_t for n2.
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.
23424
23425         * mpbsd/itom.c, mpbsd/sdiv.c: Add casts for correct handling of
23426         -0x80...00 on systems with sizeof(short)==sizeof(int).
23427
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.
23431
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.
23436
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.
23440
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.
23443
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.
23447
23448 2000-06-19  Torbjorn Granlund  <tege@swox.com>
23449
23450         * demos/primes.c: Properly handle arguments `m +n'.
23451
23452 2000-06-17  Torbjorn Granlund  <tege@swox.com>
23453
23454         * config.sub: Recognize k5 and k6 with common pattern.
23455
23456         * mpq/tests/t-get_d.c: Also test mpq_set_d.  Misc improvements.
23457
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
23460         ASSERT_ALWAYS(1).
23461
23462 2000-06-17  Kevin Ryde  <kevin@swox.se>
23463
23464         * mpz/perfsqr.c: Fix so that zero is considered a perfect square.
23465         (Was wrongly calling mpn_perfect_square_p with size==0.)
23466
23467 2000-06-16  Kevin Ryde  <kevin@swox.se>
23468
23469         * configure.in: Set k5*-*-* to use basic i386 code until there's
23470         something specific.  Add path=x86 as a default for x86s.
23471
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.
23478
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.
23482
23483 2000-06-15  Torbjorn Granlund  <tege@swox.com>
23484
23485         * mpn/x86/k7/mmx/copyi.asm: Use `testb' instead of `test'.
23486         * mpn/x86/k7/mmx/copyd.asm: Likewise.
23487
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.
23493
23494 2000-06-13  Torbjorn Granlund  <tege@swox.com>
23495
23496         * tune/sparcv9.asm: Tune, deleting two instructions.
23497
23498         * tune/alpha.asm: Update to unified speed_cyclecounter.
23499
23500 2000-06-11  Kevin Ryde  <kevin@swox.se>
23501
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".
23505
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.
23510
23511         * tests/rand/t-rand.c (main): Change "usage" to work with K&R.
23512
23513 2000-06-10  Kevin Ryde  <kevin@swox.se>
23514
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.
23518
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.
23524
23525 2000-06-09  Kevin Ryde  <kevin@swox.se>
23526
23527         * mpbsd/tests/allfuns.c (main): Call exit() instead of doing return.
23528
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.
23532
23533         * Makefile.am (libgmp_la_LIBADD, libmp_la_LIBADD): Remove
23534         unnecessary -lm.
23535         * INSTALL: Remove -lm from instructions.
23536         * demos/Makefile.am (qcn_LDADD): Add -lm.
23537
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.
23541
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.
23545
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.
23554
23555         * tests/rand/Makefile.am (libstat_la_LIBADD): Add -lm, no longer on
23556         libgmp.la.
23557         (findlc_LDADD): Use libstat.la.
23558         (AUTOMAKE_OPTIONS): Use ansi2knr.
23559
23560 2000-06-08  Torbjorn Granlund  <tege@swox.com>
23561
23562         * configure.in (alpha*-*-osf*): Default `flavour' to ev6 for ev6 and
23563         higher.
23564         (alpha*-*-*): Likewise.
23565         (alpha*-*-osf*: gmp_optcflags_cc): Move -arch/-tune flags from
23566         gmp_xoptcflags_gcc.
23567
23568         * mpn/Makefile.am (TARG_DIST): Add pa64w.
23569
23570         * longlong.h: Wrap 64-bit hppa code in #ifndef LONGLONG_STANDALONE.
23571
23572 2000-06-07  Torbjorn Granlund  <tege@swox.com>
23573
23574         * mpz/remove.c: Fail for `src' being zero.
23575
23576         * mpz/tests/reuse.c: Test more functions.
23577         (FAIL): New define.
23578
23579         * mpz/tests/t-powm.c: Loop during operand generation while they
23580         are mathematically ill-defined (used to just skip such tests).
23581
23582         * mpz/powm.c (mpz_redc): Clean up argument declarations.
23583
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'.
23587         (ia64*-*-*): New.
23588
23589         * mpn/generic/dump.c: Make it work when an mp_limb_t is not `long'.
23590
23591         * mpf/set_prc.c: MPN_COPY => MPN_COPY_INCR.
23592
23593 2000-06-06  Torbjorn Granlund  <tege@swox.com>
23594
23595         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n):
23596         Use mpn_incr_u for final carry propagation.
23597
23598         * mpz/tests/t-gcd.c: Add calls to mpz_gcdext with argument t == NULL.
23599
23600         * mpz/tests/reuse.c: Major rewrite; test many more functions.
23601
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.
23606
23607         * mpz/gcdext.c: Rework code after mpn_gcdext call to handle
23608         argument overlap.
23609
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.
23613
23614         * mpf/tests/reuse.c: Fix typo that effectively disabled `dis_funcs'
23615         tests.  Clean up test for mpf_ui_div.
23616
23617 2000-06-06  Kevin Ryde  <kevin@swox.se>
23618
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.
23623
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.
23631
23632 2000-06-05  Torbjorn Granlund  <tege@swox.com>
23633
23634         * mpf/tests/reuse.c (dsi_funcs): Add mpf_mul_2exp and mpf_div_2exp.
23635         (main): Clean up test for mpf_div_ui.
23636
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
23639         r->_mp_size.
23640
23641         * mpf/div_2exp.c: Use mpn_rshift instead of mpn_lshift when overlap
23642         so requires.  MPN_COPY => MPN_COPY_INCR.
23643
23644         * mpf/tests/t-dm2exp.c: Correct type of res_prec.
23645
23646 2000-06-04  Kevin Ryde  <kevin@swox.se>
23647
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.
23652
23653         * mpz/tests/t-misc.c: New file.
23654         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
23655
23656 2000-05-31  Kevin Ryde  <kevin@swox.se>
23657
23658         * tune/speed.* (FLAG_R_OPTIONAL): New option for routines, use on
23659         mpn_gcd_1 and mpn_mul_basecase.
23660         * tune/README: Update.
23661
23662         * tune/alpha.asm: New file, by Torbjorn.
23663         * tune/Makefile.am (EXTRA_DIST): Add it.
23664         * configure.in (alpha*-*-*): Use it.
23665
23666 2000-05-31  Linus Nordberg  <linus@swox.se>
23667
23668         * doc/configuration: New file.
23669
23670 2000-05-30  Torbjorn Granlund  <tege@swox.com>
23671
23672         * mpn/generic/mul_basecase.c: Call mpn_mul_2 and mpn_addmul_2
23673         if available.  Don't include longlong.h.
23674
23675         * doc/isa_abi_headache: New file.
23676
23677 2000-05-30  Linus Nordberg  <linus@swox.se>
23678
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.
23686
23687         * gmp.texi (Notes for Particular Systems): Remove comment about
23688         using GNU `nm' on AIX since system nm now works.
23689
23690 2000-05-29  Torbjorn Granlund  <tege@swox.com>
23691
23692         * mpn/power/mul_1.s: Remove [PR] from first word in function
23693         descriptor.
23694         * mpn/power/addmul_1.s: Likewise.
23695         * mpn/power/submul_1.s: Likewise.
23696
23697 2000-05-28  Kevin Ryde  <kevin@swox.se>
23698
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.
23705
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.
23711
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.
23720
23721 2000-05-27  Torbjorn Granlund  <tege@swox.com>
23722
23723         * mpn/pa64w: New directory, contents based on corresponding mpn/pa64
23724         files.
23725         * configure.in (hppa2.0w-*-*): New.
23726         * mpz/tests/io.c (_INCLUDE_POSIX_SOURCE): Define when __hpux before
23727         including stdio.h.
23728         * gmp-impl.h: Always define DItype and UDItype.
23729
23730 2000-05-27  Kevin Ryde  <kevin@swox.se>
23731
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.
23735
23736         * tune/time.c (speed_cpu_frequency_processor_info): New function.
23737         * configure.in (AC_CHECK_FUNCS): Add processor_info.
23738
23739 2000-05-26  Linus Nordberg  <linus@swox.se>
23740
23741         * gmp.texi (Installing GMP): Shared libraries work for AIX < 4.3
23742         if using GNU nm.
23743
23744 2000-05-26  Torbjorn Granlund  <tege@swox.com>
23745
23746         * tune/tuneup.c (SIGNED_TYPE_MAX): Shift `-1' instead of `1' to
23747         avoid signed overflow.
23748
23749         * demos/pexpr.c (setup_error_handler): Don't call sigaltstack on
23750         Unicos.
23751
23752 2000-05-25  Torbjorn Granlund  <tege@swox.com>
23753
23754         * insert-dbl.c: Work around GCC 2.8 bug.
23755         * extract-dbl.c: Likewise.
23756
23757         * config.sub: Allow i586, i686, i786 again.
23758
23759         * config.guess: Use X86CPU for lots more systems.
23760
23761 2000-05-25  Linus Nordberg  <linus@swox.se>
23762
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.)
23765
23766 2000-05-25  Kevin Ryde  <kevin@swox.se>
23767
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.
23770
23771 2000-05-24  Torbjorn Granlund  <tege@swox.com>
23772
23773         * mpz/tests/reuse.c: Use mpz_random2 instead of mpz_random.
23774
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'.
23778
23779         (*-*-aix4.[3-9]*): Disable shared libs just for problematic AIX
23780         versions.
23781         * configure.in (*-cray-unicos*): Disable asm syntax checking; set
23782         compiler explicitly.
23783         * configure.in (hppa*-*-*): Remove code disabling shared libs.
23784
23785 2000-05-24  Linus Nordberg  <linus@swox.se>
23786
23787         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't report progress to user
23788         when doing the AIX specific test to avoid "nested output".
23789
23790 2000-05-22  Kevin Ryde  <kevin@swox.se>
23791
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.
23797
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.
23801
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.
23804
23805 2000-05-21  Kevin Ryde  <kevin@swox.se>
23806
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.
23812
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.
23818
23819         * gmp.texi (Integer Arithmetic): Clarify mpz_jacobi op2; add
23820         mpz_*_kronecker_*.
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
23823         it's now a macro.
23824         (References): Add Henri Cohen.
23825
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.
23829
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
23836         exit code was 0).
23837
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).
23846
23847         * acconfig.h (HAVE_NATIVE_mpn_*): Add some missing carry-in
23848         variants, remove divmod_1.
23849
23850         * mpn/x86/diveby3.asm: Use imul, update comments.
23851
23852         * demos/qcn.c: New file.
23853         * demos/Makefile.am (EXTRA_PROGRAMS): Add it.
23854
23855         * mpz/tests/t-jac.c: New file.
23856         * mpz/tests/Makefile.am (check_PROGRAMS): Add it. Enable ansi2knr.
23857
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.
23866
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
23871         prototypes.
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.
23876
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.
23880
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.
23885
23886         * mpz/powm_ui.c: Use DIVIDE_BY_ZERO.
23887
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.
23890
23891 2000-05-20  Kevin Ryde  <kevin@swox.se>
23892
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.
23895
23896         * mpn/x86/x86-defs.m4 (Zdisp): Yet more instruction forms.
23897
23898 2000-05-19  Linus Nordberg  <linus@swox.se>
23899
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.
23903
23904 2000-05-19  Kevin Ryde  <kevin@swox.se>
23905
23906         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Fix
23907         carry propagation in final coefficient additions.
23908
23909 2000-05-18  Linus Nordberg  <linus@swox.se>
23910
23911         * configure.in: Set NM before looking for compiler since
23912         GMP_CHECK_CC_64BIT needs it.
23913
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.
23920
23921 2000-05-17  Linus Nordberg  <linus@swox.se>
23922
23923         * config.guess: Use X86CPU for x86 Cygwin.
23924
23925 2000-05-16  Kevin Ryde  <kevin@swox.se>
23926
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.
23932
23933 2000-05-14  Kevin Ryde  <kevin@swox.se>
23934
23935         * tune/speed.h: Run gcd functions on a set of data.
23936
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.
23947
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
23954         K6-2 problems.
23955         * configure.in (k6*-*-*, athlon-*-*): Add popham.
23956
23957         * mpn/x86/pentium/diveby3.asm: New file.
23958         * mpn/x86/pentium/README: Update.
23959
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.
23965
23966         * INSTALL: Better command line argument checking for test progs.
23967         Change MP -> GMP.
23968
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
23979         from configure.in.
23980
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.
23984
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.
23989
23990 2000-05-12  Kevin Ryde  <kevin@swox.se>
23991
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).
23997
23998 2000-05-11  Torbjorn Granlund  <tege@swox.com>
23999
24000         * randraw.c (lc): Major overhaul (pending rewrite).
24001         (_gmp_rand): Rewrite.
24002
24003 2000-05-08  Torbjorn Granlund  <tege@swox.com>
24004
24005         * mpz/tests/convert.c: Call free via _mp_free_func.
24006         * mpf/tests/t-conv.c: Likewise.
24007
24008         * memory.c: Add code enabled for DEBUG that adds special patterns
24009         around allocated blocks.
24010
24011 2000-05-05  Linus Nordberg  <linus@swox.se>
24012
24013         * gmp.texi (Miscellaneous Float Functions): Correct parameter list
24014         for mpf_urandomb().
24015
24016         * configure.in: Invoke AC_REVISION.
24017
24018 2000-05-05  Kevin Ryde  <kevin@swox.se>
24019
24020         * gmp.texi: Use @dircategory and @direntry.
24021         (Installing GMP): Clarification for --target, updates on SunOS
24022         problems.
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.
24030
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.
24034
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.
24040
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.
24045
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.
24051
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.
24057
24058         * mpn/x86/k6/mmx/com_n.asm: Fix an addressing bug (fortunately
24059         this code hasn't been used anywhere yet).
24060
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.
24065
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.
24069
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.
24075
24076         * mpn/asm-defs.m4: Add remarks on SunOS /usr/bin/m4 and new
24077         OpenBSD m4.
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.
24082
24083 2000-05-04  Linus Nordberg  <linus@swox.se>
24084
24085         * gmp.texi (Reporting Bugs): Be explicit about output from running
24086         a command.
24087
24088 2000-05-02  Torbjorn Granlund  <tege@swox.com>
24089
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.
24093
24094 2000-04-30  Kevin Ryde  <kevin@swox.se>
24095
24096         * tune/* (GCD_ACCEL_THRESHOLD, GCDEXT_THRESHOLD): Tune these.
24097
24098         * mpn/generic/gcdext.c (GCDEXT_THRESHOLD): Rename from THRESHOLD,
24099         use with >=, adjust default to 17 accordingly.
24100         Use new *_SWAP macros.
24101
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.
24105
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.
24109
24110         * stack-alloc.h: Add extern "C" around prototypes.
24111
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.
24115
24116 2000-04-28  Torbjorn Granlund  <tege@swox.com>
24117
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.
24123         Add PIC support.
24124
24125 2000-04-29  Kevin Ryde  <kevin@swox.se>
24126
24127         * gmp-impl.h [TUNE_PROGRAM_BUILD] (TOOM3_MUL_THRESHOLD_LIMIT): New
24128         define.
24129         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Use
24130         TOOM3_MUL_THRESHOLD_LIMIT, not a hard coded 500.
24131
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++.
24137
24138         * randraw.c, stack-alloc.c, mpbsd/mout.c, mpbsd/mtox.c: Add casts to
24139         help g++.
24140
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.
24148
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,
24151         sqrtrem.c: Ditto
24152         * mpf/sqrt.c,sqrt_ui.c: Ditto.
24153         * mpn/generic/perfsqr.c,sqrtrem.c: Ditto.
24154
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):
24158         Add prototypes.
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.
24162
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.
24168
24169         * demos/Makefile.am (ansi2knr): Use $(top_builddir) nor $(top_srcdir).
24170
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.
24175
24176         * configure.in (*-*-aix* gmp_m4postinc): Fix setting (don't overwrite
24177         a value just stored).
24178
24179 2000-04-26  Kevin Ryde  <kevin@swox.se>
24180
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.
24187
24188         * mpn/x86/syntax.h: Remove file, since now unused.
24189
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.
24196
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.
24203
24204         * gmp-impl.h (ASSERT_NOREALLOC): Not a good idea, remove it.
24205
24206         * acinclude.m4 (GMP_PROG_M4): New macro.
24207
24208 2000-04-25  Linus Nordberg  <linus@swox.se>
24209
24210         * gmp.texi (Random State Initialization): Correct arguments to
24211         `gmp_randinit'.
24212
24213         * acinclude.m4 (GMP_VERSION): Change `eval' --> `m4_eval'.  Fix
24214         from Kevin.
24215         * aclocal.m4: Regenerate.
24216
24217 2000-04-25  Kevin Ryde  <kevin@swox.se>
24218
24219         * mpn/x86/aors_n.asm: Remove parentheses around an immediate that
24220         Solaris "as" doesn't like, change by Torbjorn.
24221
24222 2000-04-24  Kevin Ryde  <kevin@swox.se>
24223
24224         * configure.in (AC_CHECK_FUNCS): Add strtoul.
24225
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.
24229
24230         * demos/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
24231         Add "allprogs:" pseudo-target.
24232         * demos/factorize.c, demos/isprime.c: Switch to ANSI functions,
24233         rely on ansi2knr.
24234
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.
24238
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.
24245
24246         * mpn/sparc64/addmul_1.asm, mul_1.asm, submul_1.asm: Use
24247         include_mpn().
24248
24249 2000-04-23  Torbjorn Granlund  <tege@swox.com>
24250
24251         * config.sub: Merge with FSF version of April 23.
24252
24253         * mpn/powerpc32: Use dnl/C instead of `#' for comments.
24254
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.)
24259
24260 2000-04-23  Kevin Ryde  <kevin@swox.se>
24261
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.
24265
24266         * gmp-impl.h (ASSERT_NOREALLOC,TMP_ALLOC_LIMBS): New macros.
24267         [TUNE_PROGRAM_BUILD] Further mods for tune program builds.
24268
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.
24273
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).
24277
24278         * mpn/asm-defs.m4 (include_mpn): New macro.
24279         (m4_assert_numargs) Changes to implementation.
24280
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.
24284
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.
24289
24290         * acconfig.h (HAVE_PENTIUM_RDTSC): New define.
24291
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
24300         tune progs.
24301         (AC_CHECK_FUNCS) Add getopt_long, sysconf and sysctlbyname for
24302         tune progs.
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.
24311
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.
24317
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.
24323
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.
24328
24329         * gmp.texi (Reporting Bugs): Itemize the list of things to include.
24330         (Miscellaneous Float Functions): Correct typo in mpf_ceil etc
24331         argument types.
24332         Change @ifinfo -> @ifnottex for benefit of makeinfo --html.
24333         Remove unnecessary @iftex's around @tex.
24334
24335 2000-04-22  Torbjorn Granlund  <tege@swox.com>
24336
24337         * config.guess: Generalize x86 cpu determination code.
24338         Now works on Solaris.
24339
24340         * mpz/nextprime.c: Rewrite still disabled code.
24341
24342         * configure.in: Specifically match freebsd[3-9].
24343
24344 2000-04-21  Torbjorn Granlund  <tege@swox.com>
24345
24346         * rand.c: Call mpz_clear for otherwise leaking mpz_t.
24347
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.
24355
24356 2000-04-19  Torbjorn Granlund  <tege@swox.com>
24357
24358         * gmp-impl.h: Fix parenthesis error in test for __APPLE_CC__.
24359
24360 2000-04-18  Linus Nordberg  <linus@swox.se>
24361
24362         * NEWS: Add info about shared libraries.  Remove reference to
24363         gmp_randinit_lc.
24364
24365 2000-04-17  Torbjorn Granlund  <tege@swox.com>
24366
24367         * Version 3.0 released.
24368
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.
24373
24374         * gmp.h (__GNU_MP_VERSION_PATCHLEVEL): Now 0.
24375
24376 2000-04-17  Linus Nordberg  <linus@swox.se>
24377
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
24382         to gcc.
24383         (alpha*-*-*): Don't bother searching for cc.
24384         * configure: Regenerate.
24385
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.
24390
24391 2000-04-16  Kevin Ryde  <kevin@swox.se>
24392
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.
24396
24397 2000-04-16  Linus Nordberg  <linus@swox.se>
24398
24399         * configure.in (*-*-cygwin*): Select BSD_SYNTAX to avoid
24400         .type/.size in PROLOGUE for ELF_SYNTAX.  Override ALIGN definition
24401         from x86/syntax.h.
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.
24408
24409 2000-04-16  Linus Nordberg  <linus@swox.se>
24410
24411         * configure.in: Invoke AC_PROG_LIBTOOL directly.
24412
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.
24417
24418         * aclocal.m4: Regenerate.
24419         * configure: Regenerate.
24420
24421 2000-04-16  Linus Nordberg  <linus@swox.se>
24422
24423         * tests/rand/t-rand.c (main): Add non-ANSI function declaration.
24424         Don't use `const'.
24425
24426 2000-04-16  Torbjorn Granlund  <tege@swox.com>
24427
24428         * mpn/generic/dump.c: Suppress output of leadign zeros.
24429
24430         * mpz/inp_str.c: Fix memory leakage.
24431
24432         * mpz/tests/reuse.c (dss_func_division): Add a final 1.
24433
24434         * longlong.h (alpha count_leading_zeros): Wrap in __MPN.
24435         * mpn/alpha/cntlz.asm: Use __gmpn prefix (by means of __MPN).
24436
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).
24446
24447         * mpn/generic/tdiv_qr.c: Work around gcc 2.7.2.3 i386 register handling
24448         bug.
24449
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.
24453
24454         * mpn/asm-defs.m4: invert_normalized_limb => invert_limb.
24455         * mpn/alpha/invert_limb.asm: mpn_invert_normalized_limb =>
24456         mpn_invert_limb.
24457         * gmp.h: Likewise.
24458         * gmp-impl.h (alpha specific): invert_normalized_limb => invert_limb;
24459         wrap with __MPN.
24460         * longlong.h (alpha udiv_qrnnd): Likewise.
24461
24462 2000-04-16  Kevin Ryde  <kevin@swox.se>
24463
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_*.
24470
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.
24474
24475         * mpn/*: Change __mpn to __gmpn.
24476         * gmp.h (__MPN): Ditto.
24477         * stack_alloc.c,stack-alloc.h: Change __tmp to __gmp_tmp.
24478
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).
24481
24482         * mpn/generic/divrem.c: Now contains mpn_divrem, which is not an
24483         internal function, so remove warning comment.
24484
24485         * gmp.texi (Compatibility with Version 2.0.x): Source level only.
24486
24487 2000-04-16  Linus Nordberg  <linus@swox.se>
24488
24489         * configure.in (hppa1.0*): Prefer c89 to cc.
24490         * configure: Regenerate.
24491
24492 2000-04-15  Linus Nordberg  <linus@swox.se>
24493
24494         * configure.in: If `mpn_path' is set by user on configure command
24495         line, use that as path.
24496         * configure: Regenerate.
24497
24498 2000-04-15  Linus Nordberg  <linus@swox.se>
24499
24500         * configure.in (hppa2.0*): Use path "hppa/hppa1_1 hppa" if no
24501         64-bit compiler was found.
24502         * configure: Regenerate.
24503
24504 2000-04-15  Linus Nordberg  <linus@swox.se>
24505
24506         * configure.in: Honor `CC' and `CFLAGS' set by user on configure
24507         command line.
24508         * acinclude.m4: (GMP_PROG_CC_SELECT): Set CFLAGS if not set already.
24509         * aclocal.m4: Regenerate.
24510         * configure: Regenerate.
24511
24512 2000-04-15  Linus Nordberg  <linus@swox.se>
24513
24514         * acinclude.m4 (GMP_PROG_CC_FIND): Remove debug output.  Remove
24515         commented out code.
24516         * aclocal.m4: Regenerate.
24517         * configure: Regenerate.
24518
24519         * configure.in: Make all `-mcpu' options to gcc optional.
24520         * configure: Regenerate.
24521
24522         * tests/rand/Makefile.am: Don't do anything for target 'all'.
24523         * tests/rand/Makefile.in: Regenerate.
24524
24525 2000-04-15  Kevin Ryde  <kevin@swox.se>
24526
24527         * README: Small updates.
24528         * NEWS: Add some things about 3.0.
24529
24530         * mpz/Makefile.am (EXTRA_DIST): Remove dmincl.c.
24531
24532         * Makefile.am: Use -version-info on libraries, not -release.
24533
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.
24539
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.
24544
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.
24547
24548 2000-04-15  Linus Nordberg  <linus@swox.se>
24549
24550         * configure.in: Remove debug output.
24551         * configure: Regenerate.
24552
24553 2000-04-15  Torbjorn Granlund  <tege@swox.com>
24554
24555         * mpn/generic/tdiv_qr.c: Don't use alloca directly.
24556
24557         * mpz/tdiv_qr.c: Fix typo.
24558         * mpz/tdiv_r.c: Fix typo.
24559         * mpz/tdiv_q.c: Fix typo.
24560
24561         * configure.in: Disable -march=pentiumpro due to apparent compiler
24562         problems.
24563
24564         * mpz/powm.c: Replace with new code from Paul Zimmermann.
24565
24566         * mpz/tdiv_q.c: Remove debug code.
24567
24568         * mpn/generic/divrem.c: Remove C++ style `//' commented-out code.
24569         * mpn/generic/sb_divrem_mn.c: Likewise.
24570
24571 2000-04-14  Torbjorn Granlund  <tege@swox.com>
24572
24573         * mpz/cdiv_q.c: Change temp allocation for new requirements of
24574         mpz_tdiv_qr.
24575         * mpz/fdiv_q.c: Likewise.
24576
24577         * mpn/sparc64/gmp-mparam.h: Set up parameters for TOOM3.
24578
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.
24583
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.
24587
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.
24592
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.
24597
24598         * gmp.h (mpn_divrem_newton): Remove declaration.
24599         (mpn_divrem_classic): Remove declaration.
24600
24601         * gmp.h (mpn_divrem): Remove function definition.
24602         * mpn/generic/divrem.c: Replace mpn_divrem_classic with a
24603         mpn_divrem wrapper.
24604
24605 2000-04-14  Kevin Ryde  <kevin@swox.se>
24606
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.
24614
24615         * mpq/div.c: Use DIVIDE_BY_ZERO (previously didn't get an
24616         exception on zero divisor).
24617
24618         * mpf/tests/t-get_d.c, mpz/tests/reuse.c: Add K&R function
24619         definitions.
24620         * mpz/tests/t-2exp.c: Don't use ANSI-ism 2ul.
24621
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
24625         disabled.
24626         (MP Basics): Add that undocumented things shouldn't be used.
24627         (Introduction to MP): Add to CPUs listed.
24628
24629         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Don't depend on C
24630         having "void".
24631
24632 2000-04-13  Linus Nordberg  <linus@swox.se>
24633
24634         * mpn/pa64/udiv_qrnnd.c (__udiv_qrnnd64): Add K&R function
24635         definition.
24636
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.
24641
24642         * gmp.h (gmp_randalg_t): Remove comma after last element.
24643
24644         * tests/rand/t-rand.c: Add copyright notice.
24645
24646 2000-04-13  Kevin Ryde  <kevin@swox.se>
24647
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.
24652
24653         * mpz/root.c: Use SQRT_OF_NEGATIVE on even roots of negatives.
24654         Use DIVIDE_BY_ZERO on a "zero'th" root.
24655
24656         * configure: Regenerate with autoconf backpatched to fix --srcdir
24657         absolute path wildcards that bash doesn't like, change by Linus.
24658
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.
24662
24663 2000-04-13  Linus Nordberg  <linus@swox.se>
24664
24665         * rand.c (gmp_randinit): Don't combine va_alist with ordinary
24666         arguments for non STDC.
24667
24668 2000-04-13  Torbjorn Granlund  <tege@swox.com>
24669
24670         * mpz/nextprime.c: Use proper names of new random types and functions.
24671
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.
24678
24679 2000-04-12  Linus Nordberg  <linus@swox.se>
24680
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'.
24686
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.
24692
24693 2000-04-12  Linus Nordberg  <linus@swox.se>
24694
24695         * randlc.c (gmp_randinit_lc): Disable function.
24696         * gmp.texi (Random State Initialization): Remove gmp_randinit_lc.
24697
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.
24701
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.
24706
24707         * mpf/urandomb.c (mpf_urandomb): Add third parameter 'nbits'.  If
24708         'nbits' doesn't make even limbs, shift up result before
24709         normalizing.
24710
24711         * gmp.h (mpf_urandomb): Add parameter to prototype.
24712
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.
24719
24720         * config.in: Regenerate for HAVE_DECL_OPTARG.
24721
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.
24730
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
24733         to mpf_urandomb.
24734
24735         * tests/rand/t-rand.c: New file for testing random number generation.
24736
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.
24740
24741 2000-04-12  Kevin Ryde  <kevin@swox.se>
24742
24743         * gmp-impl.h: Include config.h before TMP_ALLOC, so
24744         --disable-alloca works.
24745
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.
24749
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.
24752
24753         * acconfig.h: Add copyright notice using @TOP@.
24754
24755         * stack-alloc.c: Use _mp_allocate_func, not malloc.
24756         * gmp.texi (Installing MP): Note this under --disable-alloca.
24757
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.
24763
24764         * mpn/m68k/mc68020/udiv.S: Rename from udiv.s.
24765         * mpn/m68k/mc68020/umul.S: Ditto.
24766
24767         * mpn/alpha/umul.asm: Rename from umul.s, remove .file and
24768         compiler identifiers.
24769
24770         * mpn/powerpc32/syntax.h: Removed, no longer used.
24771
24772         * mpn/a29k/udiv.s: Remove .file and compiler identifiers.
24773         * mpn/a29k/umul.s: Ditto.
24774
24775         * mpn/tests/ref.c: Use WANT_ASSERT.
24776         * mpn/tests/ref.h: Use _PROTO.
24777
24778         * mpbsd/configure.in: Removed, no longer required.
24779
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.
24787
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).
24791
24792 2000-04-11  Linus Nordberg  <linus@swox.se>
24793
24794         * tests/rand/stat.c (main): Initialize `l1runs' at declaration.
24795
24796 2000-04-11  Kevin Ryde  <kevin@swox.se>
24797
24798         * mpz/fib_ui.c: Add K&R function definitions.
24799
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.
24803
24804 2000-04-10  Torbjorn Granlund  <tege@swox.com>
24805
24806         * mpz/bin_uiui.c: Delete several unused variables.
24807         Add copyright notice.
24808         * mpz/bin_ui.c: Add copyright notice.
24809
24810         * longlong.h: Declare __count_leading_zeros for alpha.
24811
24812 2000-04-10  Linus Nordberg  <linus@swox.se>
24813
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.
24817
24818         * configure.in: Check for `optarg'.
24819         * configure: Regenerate.
24820
24821         * mpn/Makefile.am: Remove incorrect comment.
24822         * mpn/Makefile.in: Regenerate.
24823
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.
24835
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.
24840
24841         * tests/rand/Makefile.am (test, bigtest): Quote argument to grep.
24842         * tests/rand/Makefile.in: Regenerate.
24843
24844         * tests/rand/gen.c: Declare optarg, optind, opterr if not already
24845         declared.
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().
24851
24852         * tests/rand/stat.c: Declare optarg, optind, opterr if not already
24853         declared.
24854
24855 2000-04-10  Torbjorn Granlund  <tege@swox.com>
24856
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.
24860
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.
24867
24868 2000-04-10  Kevin Ryde  <kevin@swox.se>
24869
24870         * move-if-change, mpz/tests/move-if-change, mpq/tests/move-if-change,
24871         mpf/tests/move-if-change: Remove, no longer used.
24872
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).
24880
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.
24884
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.
24894
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.
24901
24902         * gmp.texi (Top): Use @ifnottex, to help makeinfo --html.
24903         (Installing MP): Describe --enable-mpbsd and demo programs.
24904
24905         * tests/rand/statlib.c: mpz_cmp_abs => mpz_cmpabs.
24906
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.
24910
24911 2000-04-09  Torbjorn Granlund  <tege@swox.com>
24912
24913         * mpz/urandomm.c: Get type of count right.
24914         Simplify computation of nbits.
24915
24916 2000-04-08  Torbjorn Granlund  <tege@swox.com>
24917
24918         * mpz/urandomb.c: Fix reallocation condition.
24919         Simplify size computation.
24920
24921 2000-04-08  Linus Nordberg  <linus@swox.se>
24922
24923         * acinclude.m4 (GMP_CHECK_CC_64BIT): Add special handling for
24924         HPUX.
24925         (GMP_CHECK_ASM_W32): Ditto.
24926         * aclocal.m4: Regenerate.
24927
24928         * mpn/Makefile.am: Use $(CCAS) for assembling.
24929         (.asm.obj): Add rule.
24930         * mpn/Makefile.in: Regenerate.
24931
24932         * gmp.texi (Miscellaneous Integer Functions): Fix typos.
24933
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
24938         CCAS.
24939         * configure: Regenerate.
24940
24941 2000-04-08  Torbjorn Granlund  <tege@swox.com>
24942
24943         * mpz/bin_ui.c: Don't depend on ANSI C features.
24944         * mpz/bin_uiui.c: Likewise.
24945
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.
24950
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*.
24956
24957         * mpz/addmul_ui.c (mpn_neg1): Don't depend on ANSI C features.
24958
24959         * mpz/invert.c: Use TMP_MARK since we invoke MPZ_TMP_INIT.
24960
24961         * gmp.h (mpq_set_d): Declare correctly.
24962         (mpz_root): Use _PROTO.
24963         (mpz_remove): Use _PROTO.
24964         (mpf_pow_iu): Use _PROTO.
24965
24966         * mpn/asm-defs.m4 (MPN_PREFIX): Revert previous change.
24967         * gmp.h (__MPN): Revert previous change.
24968
24969         * mpz/perfpow.c: De-ANSI-fy.  Add copyright notice.
24970
24971         * mpz/set_d.c: Misc cleanups.
24972
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.
24977
24978 2000-04-07  Torbjorn Granlund  <tege@swox.com>
24979
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.
24989
24990 2000-04-06  Kevin Ryde  <kevin@swox.se>
24991
24992         * gmp.texi (Installing MP): Add known build problem SunOS 4.1.4 m4
24993         failure.
24994
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.
24999
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.
25003
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.
25007
25008         * mpn/generic/sqr_basecase.c: Add an assert.
25009
25010 2000-04-05  Torbjorn Granlund  <tege@swox.com>
25011
25012         * gmp.h, mpn/asm-defs.m4: List the same functions for __MPN, but
25013         leave some commented out.
25014
25015         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Optimize.
25016         (mpn_com_n): Optimize.
25017
25018         * gmp.h (__MPN): Make it use __gmpn instead of __mpn for consistency.
25019         * mpn/asm-defs.m4 (MPN_PREFIX): Likewise.
25020
25021         * gmp.h (GMP_ERROR_ALLOCATE): New errcode.
25022
25023         * gmp-impl.h (MPN_MUL_N_RECURSE): Delete.
25024         (MPN_SQR_RECURSE): Delete.
25025
25026         * gmp-impl.h (TARGET_REGISTER_STARVED): New define.
25027
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.
25033
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.
25038
25039         * gmp.h (mpn_udiv_w_sdiv): Move __MPN remap from here...
25040         * gmp-impl.h: ...to here.
25041
25042 2000-04-05  Linus Nordberg  <linus@swox.se>
25043
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
25049         miscellaneous.
25050         (Miscellaneous Integer Functions): Update mpz_urandomb,
25051         mpz_urandomm.
25052         (Low-level Functions): Remove mpn_rawrandom.
25053         (Random State Initialization): Update.
25054
25055         * mpf/urandom.c (mpf_urandomb): Remove SIZE parameter.  Normalize
25056         result correctly.
25057
25058         * gmp.h (mpf_urandomb): Remove SIZE parameter.
25059
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.
25063
25064 2000-04-05  Torbjorn Granlund  <tege@swox.com>
25065
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.
25071
25072 2000-04-05  Kevin Ryde  <kevin@swox.se>
25073
25074         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD<2): Remove cpp test.
25075         (tune_mul_threshold,tune_sqr_threshold): Add declarations, used in
25076         development only.
25077
25078         * mpn/x86/k7/sqr_basecase.asm: New file, only a copy of k6 for now.
25079
25080 2000-04-04  Torbjorn Granlund  <tege@swox.com>
25081
25082         * gmp-impl.h (TOOM3_MUL_THRESHOLD): Provide default.
25083         (TOOM3_SQR_THRESHOLD): Provide default.
25084
25085         * mpn/generic/mul_n.c: Rewrite (mostly by Robert Harley).
25086         * mpn/generic/mul.c: Rewrite (mostly by Robert Harley).
25087
25088         * configure.in (sparcv9 64-bit OS): Set extra_functions.
25089
25090 2000-04-04  Linus Nordberg  <linus@swox.se>
25091
25092         * mpn/generic/rawrandom.c: Remove file and replace with randraw.c
25093         on top level.
25094         (mpn_rawrandom): Rename to gmp_rand_getraw.
25095
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).
25099
25100         * mpz/urandomb.c (mpz_urandomb): Change mpn_rawrandom -->
25101         gmp_rand_getraw.
25102         * mpz/urandomm.c (mpz_urandomb): Ditto.
25103         * mpf/urandom.c (mpf_urandomb): Ditto.
25104
25105         * gmp.h (gmp_rand_getraw): Add function prototype.
25106         (mpn_rawrandom): Remove function prototype.
25107
25108         * Makefile.am (libgmp_la_SOURCES): Add randraw.c.
25109         * Makefile.in: Regenerate.
25110
25111         * configure.in (gmp_mpn_functions): Remove rawrandom.
25112         * configure: Regenerate.
25113
25114 2000-04-04  Linus Nordberg  <linus@swox.se>
25115
25116         * gmp.h (GMP_ERROR enum): Remove comma after last enumeration
25117         since the AIX compiler (xlc) doesn't like that.
25118
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.
25122
25123         * mpn/generic/rawrandom.c: Remove debugging code.
25124         (mpn_lc): Don't reallocate seed.
25125
25126         * mpz/urandomm.c (mpz_urandomm): Implement function.
25127
25128         * mpz/urandomb.c (mpz_urandomb): Fix typo in function definition.
25129
25130 2000-04-04  Kevin Ryde  <kevin@swox.se>
25131
25132         * make.bat: Removed (no longer works, no longer supported).
25133         * mpn/msdos/asm-syntax.h: Removed (was used only by make.bat).
25134
25135 2000-04-03  Torbjorn Granlund  <tege@swox.com>
25136
25137         * mpn/generic/brandom.c: New file, replacing random2.
25138
25139 2000-04-02  Torbjorn Granlund  <tege@swox.com>
25140
25141         * mpn/sparc32/v9/submul_1.asm: Change some carry-form instructions
25142         into their plain counterparts.
25143
25144         * mpn/sparc64/copyi.asm: Avoid executing ALIGN.
25145
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.
25149
25150 2000-04-01  Linus Nordberg  <linus@swox.se>
25151
25152         * gmp.h: Fix function prototypes for randomization functions.
25153         (__gmp_rand_lc_scheme_struct): Replace `m' with `m2exp'. Remove
25154         unused `bits'.
25155         (__gmp_rand_data_lc): Add `m2exp' as another way of representing
25156         the modulus.
25157         (__gmp_rand_state_struct): Remove unused `size'.
25158
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.
25163
25164         * randlc.c (gmp_rand_init_lc): Don't use malloc().  Change
25165         parameters.
25166
25167         * randclr.c (gmp_rand_clear): Don't use free().  Disable BBS
25168         algorithm.  Set `gmp_errno' on error.
25169
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.
25174
25175         * mpn/generic/rawrandom.c (mpn_rawrandom): Rewrite.
25176         (mpn_lc): New static function.
25177
25178         * mpz/urandomb.c (mpz_urandomb): Use ABSIZ() instead of SIZ() for
25179         determining size of ROP.
25180
25181         * mpf/urandom.c (mpf_urandomb): Add third parameter, nbits.  (Not
25182         used yet!)
25183         Change parameter order to mpn_rawrandom().
25184
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.
25189
25190         * mpz/Makefile.am (libmpz_la_SOURCES): Change urandom.c -->
25191         urandomb.c.  Add urandomm.c.
25192         * mpz/Makefile.in: Regenerate.
25193
25194         * tests/rand/Makefile.am (noinst_PROGRAMS): Change findcl --> findlc.
25195         Add gen.static.
25196         * tests/rand/Makefile.in: Regenerate.
25197
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
25200         gmp_rand_seed().
25201
25202 2000-04-01  Kevin Ryde  <kevin@swox.se>
25203
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.
25210
25211 2000-03-31  Linus Nordberg  <linus@swox.se>
25212
25213         * mpz/urandom.c: Rename to...
25214         * mpz/urandomb.c: ...this.
25215
25216         * mpz/urandomb.c (mpz_urandomb): Change operand order in call to
25217         mpn_rawrandom().  Use ABSIZ() instead of SIZ() when checking size
25218         of ROP.
25219
25220         * mpz/urandomm.c: New file.
25221
25222 2000-03-31  Kevin Ryde  <kevin@swox.se>
25223
25224         * acinclude.m4 (GMP_CHECK_ASM_MMX): Give a warning when mmx code
25225         will be omitted.
25226
25227 2000-03-30  Torbjorn Granlund  <tege@swox.com>
25228
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.
25235
25236 2000-03-28  Torbjorn Granlund  <tege@swox.com>
25237
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.
25241
25242 2000-03-25  Kevin Ryde  <kevin@swox.se>
25243
25244         * mpn/lisp/gmpasm-mode.el: Fix some comment detection, use custom,
25245         fontify more keywords, turn into a standalone mode.
25246
25247         * stamp-vti: New file, generated together with version.texi.
25248
25249         * acinclude.m4 (GMP_VERSION,GMP_HEADER_GETVAL): New macros.
25250         * configure.in (AM_INIT_AUTOMAKE): Use GMP_VERSION.
25251
25252 2000-03-24  Kevin Ryde  <kevin@swox.se>
25253
25254         * INSTALL: Updates for new configure system.
25255
25256         * configure.in: Add gmp_optcflags_gcc for the x86s, setting -mcpu
25257         and -march.
25258
25259 2000-03-23  Torbjorn Granlund  <tege@swox.com>
25260
25261         * demos/pexpr.c (mpz_eval_expr): Properly initialize rhs/lhs
25262         for ROOT.
25263
25264 2000-03-23  Kevin Ryde  <kevin@swox.se>
25265
25266         * config.guess (i?86:*:*:*): Use uname -m if detection program fails.
25267
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.
25270
25271         * gmp.texi (Installing MP): Corrections to target CPUs.
25272
25273         * version.c: Use VERSION from config.h, add copyright comment,
25274         restore "const" somehow lost.
25275
25276         * configure.in (a29k*-*-*): Fix directory name.
25277
25278 2000-03-22  Torbjorn Granlund  <tege@swox.com>
25279
25280         * demos/pexpr.c (op_t): Add ROOT.
25281         (fns): Add ROOT.
25282         (mpz_eval_expr): Add ROOT.
25283
25284         * mpz/root.c: Handle roots of negative numbers.
25285         Fix other border cases.
25286         Fix rare memory leakage.
25287
25288         * errno.c: New file.
25289
25290 2000-03-21  Torbjorn Granlund  <tege@swox.com>
25291
25292         * gmp.h (error number enum): New anonymous enum.
25293         (gmp_errno): New.
25294
25295         * gmp.h (__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR): Bump for GMP 3.0.
25296
25297 2000-03-20  Torbjorn Granlund  <tege@swox.com>
25298
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.
25302
25303 2000-03-21  Kevin Ryde  <kevin@swox.se>
25304
25305         * mpn/x86/k6/diveby3.asm: Tiny speedup.
25306
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
25310         WANT_SHLDL_CL.
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.
25318
25319 2000-03-20  Linus Nordberg  <linus@swox.se>
25320
25321         * mpn/generic/rawrandom.c (mpn_rawrandom): Handle seed value of 0
25322         correctly.
25323
25324         * configure.in: Fix detection of alpha flavour.
25325         Set compiler options for `sparcv8'.
25326         * configure: Regenerate.
25327
25328         * rand.c (__gmp_rand_scheme): Clean up some.  Use slightly better
25329         multipliers.
25330
25331         * configure.in (AC_OUTPUT): Add tests/Makefile and
25332         tests/rand/Makefile.
25333
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.
25338
25339         * Makefile.am (EXTRA_DIST): Add directory `tests'.
25340
25341         * mkinstalldirs: Update (Automake 2000-03-17).
25342         * ltconfig: Update (Libtool 2000-03-17).
25343         * ltmain.sh: Ditto.
25344
25345         * configure: Regenerate with new autoconf/-make/libtool suite.
25346         * aclocal.m4: Ditto.
25347         * config.in: Ditto.
25348         * all Makefile.in's: Ditto.
25349
25350 2000-03-20  Torbjorn Granlund  <tege@swox.com>
25351
25352         * demos/pexpr.c (main): Don't allow `-N' for base, require `-bN'.
25353
25354         * mpn/alpha/unicos.m4 (cvttqc): New define.
25355         * mpn/alpha/invert_limb.asm: Use new define for cvttqc.
25356
25357 2000-03-19  Kevin Ryde  <kevin@swox.se>
25358
25359         * mpn/x86/k6/sqr_basecase.asm: Tiny amendments for 3x3 case.
25360
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.
25365
25366         * configure.in (--enable-alloca): New option.
25367         * acconfig.h (USE_STACK_ALLOC): For --disable-alloca.
25368
25369 2000-03-18  Kent Boortz  <kent@swox.com>
25370
25371         * macos: New directory with macos port files.
25372
25373 2000-03-17  Torbjorn Granlund  <tege@swox.com>
25374
25375         * gmp-impl.h (union ieee_double_extract): Check _CRAYMPP.
25376
25377         * mpn/asm-defs.m4 (invert_normalized_limb): Define.
25378
25379         * mpn/alpha: Translate `.s' files to `.asm'.
25380
25381         * configure: Regenerate.
25382
25383         * mpn/alpha/invert_limb.asm: Replace dash in file name with underscore.
25384         * configure.in: Corresponding change.
25385
25386         * configure.in: Assign special "path" for alphaev6.
25387
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.
25393
25394 2000-03-17  Kevin Ryde  <kevin@swox.se>
25395
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.
25399
25400 2000-03-16  Torbjorn Granlund  <tege@swox.com>
25401
25402         * config.guess: Handle Cray T3D/E.
25403
25404 2000-03-15  Kevin Ryde  <kevin@swox.se>
25405
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.
25412
25413         * mpn/x86/pentium/sqr_basecase.asm: A few better addressing modes.
25414
25415         * configure.in: Add AC_C_STRINGIZE and AC_CHECK_TYPES((void)).
25416         * gmp-impl.h (ASSERT): Use them.
25417
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.
25421
25422 2000-03-14  Torbjorn Granlund  <tege@swox.com>
25423
25424         * mpn/sparc32/v8/mul_1.asm: Make PIC actually work.
25425         * mpn/sparc32/v8/addmul_1.asm: Likewise.
25426
25427         * mpn/sparc32/v8/mul_1.asm: Use m4 ifdef, not cpp #if.
25428         * mpn/sparc32/v8/addmul_1.asm: Likewise.
25429
25430         * mpn/asm-defs.m4 (C): New define for comments.
25431         * mpn/sparc32: Start comments with `C'.
25432
25433         * config.guess: Remove `SunOS 6' handling.
25434         Recognize sun4m and sun4d architectures under old SunOS.
25435
25436 2000-03-14  Linus Nordberg  <linus@swox.se>
25437
25438         * configure.in (gmp_srclinks): Set to list of links created by
25439         configure.
25440         * configure: Regenerate.
25441
25442         * Makefile.am (libgmp_la_LDFLAGS): Set version info.
25443         (DISTCLEANFILES): Include @gmp_srclinks@.
25444         * Makefile.in: Regenerate.
25445
25446 2000-03-13  Linus Nordberg  <linus@swox.se>
25447
25448         * configure.in: Remove some changequote's by quoting the strings
25449         containing `[]'.
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.
25455
25456         * acinclude.m4 (GMP_PROG_CCAS): Remove macro.
25457         * aclocal.m4: Regenerate.
25458
25459 2000-03-13  Kevin Ryde  <kevin@swox.se>
25460
25461         * mpn/x86/p6/README: New file.
25462
25463         * mpn/x86/k6/mul_1.asm: Rewrite, smaller and slightly faster.
25464
25465         * mpn/lisp/gmpasm-mode.el: Rewrite assembler comment detection and
25466         handling.
25467
25468         * configure.in: Separate mmx directories for each x86 flavour.
25469         * configure: Regenerate.
25470
25471 2000-03-12  Kevin Ryde  <kevin@swox.se>
25472
25473         * mpn/x86/x86-defs.m4 (ALIGN): Supplement definition from
25474         config.m4 so as to pad with nops not zeros on old gas.
25475
25476         * mpn/x86/k7/mmx/copyd.asm: Use plain emms (femms is just an alias
25477         for emms now).
25478         * mpn/x86/k7/mmx/copyi.asm: Ditto.
25479         * mpn/x86/k7/mmx/rshift.asm: Ditto.
25480         * mpn/x86/x86-defs.m4: Amend comments.
25481
25482         * mpn/x86/mod_1.asm: Add comments on speeds.
25483
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.
25487
25488 2000-03-10  Linus Nordberg  <linus@swox.se>
25489
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.
25501         (k6*): Likewise.
25502         * configure: Regenerate.
25503
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.
25510
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.
25519
25520         * acconfig.h (_LONG_LONG_LIMB): Add.
25521
25522         * gmp-impl.h: Include config.h only if HAVE_CONFIG_H is defined.
25523
25524 2000-03-09  Kevin Ryde  <kevin@swox.se>
25525
25526         * mpn/x86/pentium/mul_basecase.S: Small speedup by avoiding an AGI.
25527
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.
25531
25532 2000-03-07  Torbjorn Granlund  <tege@swox.com>
25533
25534         * config.guess: Better recognize POWER/PowerPC processor type.
25535
25536 2000-03-07  Kevin Ryde  <kevin@swox.se>
25537
25538         * mpn/generic/addsub_n.c: Use HAVE_NATIVE_* now in config.h.
25539
25540         * mpn/asm-defs.m4: Add comments about SysV m4.
25541         (m4_log2): Don't use <<.
25542         (m4_lshift,m4_rshift): New macros.
25543
25544 2000-03-06  Torbjorn Granlund  <tege@swox.com>
25545
25546         * mpn/powerpc32/regmap.m4: Map cr0 => `0', etc.
25547
25548 2000-03-06  Kevin Ryde  <kevin@swox.se>
25549
25550         * mpn/tests/ref.c (refmpn_divexact_by3): New function.
25551         * mpn/tests/ref.h: Prototype.
25552
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.
25563
25564         * mpn/x86/x86-defs.m4 (cmovnz_ebx_ecx): New macro.
25565         * mpn/x86/p6/aorsmul_1.asm: Use cmov.
25566
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.
25570
25571 2000-03-03  Torbjorn Granlund  <tege@swox.com>
25572
25573         * longlong.h: Add IA-64 support.
25574
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'.
25579
25580         * configure.in: Fix tyops.
25581         * configure: Regenerate.
25582
25583 2000-03-02  Torbjorn Granlund  <tege@swox.com>
25584
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.
25589
25590 2000-03-03  Kevin Ryde  <kevin@swox.se>
25591
25592         * mpn/lisp/gmpasm-mode.el: Suppress postscript comment prefixes in
25593         filladapt.
25594
25595         * mpn/x86/pentium/sqr_basecase.asm: New file.
25596         * mpn/x86/pentium/gmp-mparam.h (KARATSUBA_SQR_THRESHOLD): Update.
25597
25598         * configure.in: Add --enable-assert, enable k6 logops functions.
25599
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.
25603
25604 2000-03-02  Kevin Ryde  <kevin@swox.se>
25605
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.
25610
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.
25614
25615         * mpn/x86/x86-defs.m4 (Zdisp): New macro.
25616         * mpn/asm-defs.m4 (m4_stringequal_p): New macro.
25617
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.
25627
25628 2000-02-27  Kevin Ryde  <kevin@swox.se>
25629
25630         * mpn/generic/divrem.c (mpn_divrem_classic): Patch to avoid gcc
25631         2.7.2.3 i386 register handling bug.
25632
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.
25637
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
25642         MPN_COPY_DECR.
25643         * configure.in: Enable x86 copyi, copyd; add k6 com_n.
25644
25645 2000-02-25  Torbjorn Granlund  <tege@swox.com>
25646
25647         * demos/pexpr.c (power): Move factorial handing code from `factor'
25648         to `power'.
25649
25650         * demos/factorize.c (factor_using_pollard_rho): Move resetting of `c'
25651         to before checking for a non-zero gcd.
25652
25653 2000-02-25  Kevin Ryde  <kevin@swox.se>
25654
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.
25661
25662         * mpn/tests/ref.c (refmpn_copyi,refmpn_copyd): Allow size==0.
25663
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
25667         inlines.
25668
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.
25672
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.
25681
25682         * mpn/x86/k7/mmx/copyi.asm: New file.
25683         * mpn/x86/k7/mmx/copyd.asm: New file.
25684         * mpn/x86/k7/README: Update.
25685
25686 2000-02-24  Kevin Ryde  <kevin@swox.se>
25687
25688         * mpn/x86/x86-defs.m4 (femms): Generate emms if 3dnow not available.
25689         * mpn/x86/x86-defs.m4 (FRAME_popl): New macro.
25690
25691         * Makefile.am: Add info_TEXINFOS = gmp.texi
25692
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.
25699
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.
25712
25713 2000-02-24  Linus Nordberg  <linus@swox.se>
25714
25715         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Add dummy symbol to
25716         testcase to avoid nm failure.  Try nm before piping to grep.
25717
25718         * acconfig.h: Undef HAVE_NATIVE_func for every mpn function found
25719         in gmp.h.
25720
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
25724         HAVE_NATIVE_func.
25725
25726         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro.
25727
25728         * mpn/x86/p6/aorsmul_1.asm: Use MULFUNC_PROLOGUE.
25729         * mpn/x86/k6/aors_n.asm: Likewise.
25730
25731         * Makefile.am (EXTRA_DIST): Add config.in; needed when we don't
25732         use AM_CONFIG_HEADER in configure.in.
25733
25734         * mpn/Makefile.am (INCLUDES): Add `-I..' for config.h and
25735         gmp-mparam.h.
25736         * mpf/Makefile.am: Likewise.
25737         * mpq/Makefile.am: Likewise.
25738         * mpz/Makefile.am: Likewise.
25739
25740         * mpf/tests/Makefile.am (INCLUDES): Add `-I../..' for config.h and
25741         gmp-mparam.h.
25742         * mpq/tests/Makefile.am: Likewise.
25743         * mpz/tests/Makefile.am: Likewise.
25744
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.
25756
25757 2000-02-23  Kevin Ryde  <kevin@swox.se>
25758
25759         * mpn/x86/addmul_1.S: Amend comments, this code no longer used by
25760         PentiumPro.
25761         * mpn/x86/submul_1.S: Ditto.
25762
25763         * mpn/x86/k6/com_n.asm: Rewrite, smaller but same speed.
25764
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.
25782
25783 2000-02-22  Linus Nordberg  <linus@swox.se>
25784
25785         * acinclude.m4 (GMP_INIT): Use temporary file cnfm4p.tmp for
25786         post-defines.
25787         (GMP_FINISH): Ditto.
25788         (GMP_DEFINE): Add third optional argument specifying location in
25789         outfile.
25790         (GMP_DEFINE_RAW): New macro.
25791         * aclocal.m4: Regenerate.
25792
25793         * configure.in: Add `HAVE_TARGET_CPU_$target_cpu' using
25794         GMP_DEFINE_RAW.
25795         * configure: Regenerate.
25796
25797         * mpz/tests/Makefile.am: New test t-root.
25798         * mpz/tests/Makefile.in: Regenerate.
25799
25800 2000-02-22  Torbjorn Granlund  <tege@swox.com>
25801
25802         * mpz/root.c: Complete rewrite; still primitive, but at least correct.
25803         * mpz/tests/t-root.c: New test.
25804
25805 2000-02-22  Kevin Ryde  <kevin@swox.se>
25806
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.
25810
25811         * mpn/x86/x86-defs.m4 (loop_or_decljnz,cmov_bytes): New macros.
25812         * mpn/asm-defs.m4 (m4_ifdef_anyof_p): New macro.
25813
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).
25817
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.
25822
25823         * configure.in: Add HAVE_TARGET_CPU_$target_cpu for config.m4.
25824         * mpn/asm-defs.m4 (define_not_for_expansion): New macro.
25825
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.
25830
25831 2000-02-21  Torbjorn Granlund  <tege@swox.com>
25832
25833         * gmp.h: Undo 1996-10-06 NeXT change, it was clearly improperly
25834         written.
25835
25836 2000-02-21  Linus Nordberg  <linus@swox.se>
25837
25838         * configure.in: Link <src>/mpn/asm-defs.m4 to <build>mpn/asm.m4.
25839         * configure: Regenerate.
25840
25841 2000-02-21  Linus Nordberg  <linus@swox.se>
25842
25843         * mpn/x86/k7/aorsmul_1.asm: Change OPERATION_ADDMUL -->
25844         OPERATION_addmul_1.  Change OPERATION_SUBMUL -->
25845         OPERATION_submul_1.
25846
25847         * mpn/x86/k7/aors_n.asm: Change OPERATION_ADD --> OPERATION_add_n.
25848         Change OPERATION_SUB --> OPERATION_sub_n.
25849
25850         * mpn/Makefile.am: Pass -DOPERATION_$* to preprocessors.
25851         * mpn/Makefile.in: Regenerate.
25852
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.
25857
25858         * acinclude.m4 (GMP_FINISH): Tell user what we're doing.
25859         * aclocal.m4: Regenerate.
25860
25861 2000-02-21  Kevin Ryde  <kevin@swox.se>
25862
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.
25867
25868         * configure.in (gmp_m4postinc): Use x86-defs.m4 on athlon-*-* too.
25869
25870 2000-02-20  Kevin Ryde  <kevin@swox.se>
25871
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.
25876
25877         * mpn/x86/k6/gmp-mparam.h: New file.
25878         * mpn/asm-defs.m4 (m4_warning): New macro.
25879
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.
25884
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.
25890
25891 2000-02-19  Linus Nordberg  <linus@swox.se>
25892
25893         * configure.in: Don't try to symlink more than one multi-func
25894         file.
25895         * configure: Regenerate.
25896
25897 2000-02-18  Linus Nordberg  <linus@swox.se>
25898
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.
25904
25905         * configure.in: Don't define GSYM_PREFIX or ALIGN.
25906         Add mechanism for multi-function files.
25907         * configure: Regenerate.
25908
25909 2000-02-18  Kevin Ryde  <kevin@swox.se>
25910
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.
25923
25924 2000-02-17  Linus Nordberg  <linus@swox.se>
25925
25926         * Makefile.am (dist-hook): Don't include any emacs backup files
25927         (*.~*) in dist.
25928         * Makefile.in: Regenerate.
25929
25930 2000-02-17  Torbjorn Granlund  <tege@swox.com>
25931
25932         * mpn/sparc32/v9/mul_1.asm: Use `rd' to get current PC; get rid of
25933         getpc function.
25934         * mpn/sparc32/v9/addmul_1.asm: Likewise.
25935         * mpn/sparc32/v9/submul_1.asm: Likewise.
25936
25937 2000-02-17  Kevin Ryde  <kevin@swox.se>
25938
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.
25943
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.
25965
25966 2000-02-16  Torbjorn Granlund  <tege@swox.com>
25967
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.
25973
25974 2000-02-16  Linus Nordberg  <linus@swox.se>
25975
25976         * configure.in: Add mechanism for including target specific
25977         m4-files in config.m4.
25978         * configure: Regenerate.
25979
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.
25987
25988 2000-02-16  Linus Nordberg  <linus@swox.se>
25989
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.
25994
25995         * mpn/asm-defs.m4 (L): No argument to LSYM_PREFIX.
25996
25997 2000-02-15  Linus Nordberg  <linus@swox.se>
25998
25999         * acinclude.m4: Prefix all temporary shell variables with
26000         `gmp_tmp_'.
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.
26018
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.
26024
26025         * Makefile.am (dist-hook): *Really* remove all CVS dirs in
26026         dist.
26027         * Makefile.in: Regenerate.
26028
26029         * mpn/Makefile.am: Add target for building .lo and .o from
26030         .asm.
26031         Pass -DPIC to preprocessor (CPP/m4) when building .lo.
26032         Build .o a second time for target .lo, without -DPIC to
26033         preprocessor.
26034         (SUFFIX): Add `.asm'.
26035         (EXTRA_DIST): Add asm-defs.m4.
26036         * mpn/Makefile.in: Regenerate.
26037
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.
26044
26045 2000-02-15  Torbjorn Granlund  <tege@swox.com>
26046
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.
26052
26053         * mpn/sparc32/add_n.asm: Rename `size' -> `n'.
26054         * mpn/sparc32/sub_n.asm: Likewise.
26055
26056         * sparc32: Rename `.s' and `.S' files to `.asm'.
26057         * sparc64: Rename `.s' and `.S' files to `.asm'.
26058
26059 2000-02-11  Torbjorn Granlund  <tege@swox.com>
26060
26061         * config.sub: Adopt to new config.guess sparc naming conventions.
26062
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'.
26066
26067         * mpn/x86/add_n.S: Use PROLOGUE/EPILOGUE.
26068         * mpn/x86/sub_n.S: Likewise.
26069
26070         * mpn/x86/syntax.h (PROLOGUE): New name for PROLOG.
26071         * mpn/x86/syntax.h (EPILOGUE): New name for EPILOG.
26072
26073 2000-02-11  Linus Nordberg  <linus@swox.se>
26074
26075         * configure.in: Better path for 64-bit sparc without 64-bit cc.
26076         Change sparc8 --> sparcv8.
26077         Change sparc9 --> sparcv9.
26078         * configure: Regenerate.
26079
26080 2000-02-10  Linus Nordberg  <linus@swox.se>
26081
26082         * configure.in: Use Autoconf.
26083         * Makefile.am: New file.
26084
26085         * AUTHORS: New file.
26086         * COPYING: New file.
26087         * acinclude.m4: New file.
26088         * acconfig.h: New file.
26089
26090         * configure: Generate.
26091         * Makefile.in: Generate.
26092         * aclocal.m4: Generate.
26093         * config.in: Generate.
26094
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.
26100
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.
26107
26108         * mpn/Makefile.am: New file.
26109         * mpn/Makefile.in: Generate.
26110         * mpn/configure.in: Remove.
26111
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.
26118
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.
26125
26126 2000-02-10  Torbjorn Granlund  <tege@swox.com>
26127
26128         * mpn/x86/add_n.S: Don't use label L0 twice.
26129         * mpn/x86/sub_n.S: Likewise.
26130
26131 2000-01-20  Linus Nordberg  <linus@swox.se>
26132
26133         * demos/pexpr.c: Don't use setup_error_handler() in windoze.
26134
26135 2000-01-19  Torbjorn Granlund  <tege@swox.com>
26136
26137         * demos/pexpr.c (sigaltstack): #define to sigstack for AIX.
26138         (setup_error_handler): Don't write to ss_size and ss_flags
26139         on AIX.
26140
26141 2000-01-11  Torbjorn Granlund  <tege@swox.com>
26142
26143         * mpn/configure.in (hppa2.0*-*-*): Move assignment of
26144         target_makefile_frag to where it belongs.
26145
26146 1999-12-21  Torbjorn Granlund  <tege@swox.com>
26147
26148         * longlong.h (v9 umul_ppmm): New #define.
26149         (v9 udiv_qrnnd): New #define.
26150
26151 1999-12-14  Torbjorn Granlund  <tege@swox.com>
26152
26153         * mpn/generic/divmod_1.c: Use invert_limb.
26154         * mpn/generic/mod_1.c: Use invert_limb.
26155
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.
26159
26160         * gmp.h (mpn_divrem): Inhibit for non-gcc.
26161         But declare (undo 1999-11-22 change).
26162
26163         * gmp-impl.h (DItype,UDItype): Do these also if _LONG_LONG_LIMB.
26164
26165         * longlong.h: Move 64-bit hppa code out of __GNUC__ conditional.
26166
26167         * stack-alloc.c (HSIZ): New #define.
26168         (__tmp_alloc): Use HSIZ instead of sizeof(tmp_stack).
26169
26170 1999-12-10  Torbjorn Granlund  <tege@swox.com>
26171
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.
26176
26177         * configure.in: Recognize x86 CPU types known by config.guess.
26178         * mpn/configure.in: Likewise.  Add x86/mmx path component as
26179         appropriate.
26180         (athlon-*-*): Fix typo.
26181
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.
26185
26186         * config.guess: Recognize x86 CPU types.
26187         Update code for FreeBSD, NetBSD, OpenBSD, Linux.
26188
26189 1999-12-08  Torbjorn Granlund  <tege@swox.com>
26190
26191         * mpf/pow_ui.c: Avoid final squaring in loop.
26192
26193 1999-12-07  Torbjorn Granlund  <tege@swox.com>
26194
26195         * gmp-impl.h (udiv_qrnnd_preinv2gen): Prefix local variables with `_'.
26196         (udiv_qrnnd_preinv2norm): Likewise.
26197         From Kevin Ryde:
26198         (HAVE_ALLOCA): #define also if defined (alloca).
26199
26200 1999-12-04  Torbjorn Granlund  <tege@swox.com>
26201
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.
26207
26208         * mpn/tests/lshift.c: Update from add_n.c.
26209         * mpn/tests/rshift.c: Likewise.
26210
26211 1999-12-03  Torbjorn Granlund  <tege@swox.com>
26212
26213         * mpn/powerpc64/copy.S: New file.
26214
26215 1999-12-02  Torbjorn Granlund  <tege@swox.com>
26216
26217         * mpn/sparc64/copy.s: New file.
26218
26219         * mpn/tests/copy.c: New file.
26220
26221         * mpn/configure.in: Recognize more Amd CPUs; Set special paths for
26222         k7 CPU.
26223
26224         * configure.in: Recognize Amd x86 CPUs.
26225
26226         * mpz/fdiv_r_2exp.c: In rounding code, read in->_mp_size before
26227         writing to res->_mp_size.
26228
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.
26232
26233         * mpn/tests/add_n.c (main): Only print test number if TIMES==1
26234         and not printing.
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.
26240
26241         * mpn/tests/lshift.c: (main): Only print test number if TIMES==1
26242         and not printing.
26243         * mpn/tests/rshift.c: Likewise.
26244
26245 1999-11-22  Torbjorn Granlund  <tege@swox.com>
26246
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
26254         this file.
26255
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.
26261
26262 1999-11-21  Torbjorn Granlund  <tege@swox.com>
26263
26264         * mpn/sparc64/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
26265         (KARATSUBA_SQR_THRESHOLD): #define.
26266
26267         * mpn/sparc64/lshift.s: Compensate stack references for odd stack ptr.
26268         * mpn/sparc64/rshift.s: Likewise.
26269
26270         * mpn/sparc64/addmul_1.s: Propagate carry properly.
26271         * mpn/sparc64/submul_1.s: Likewise.
26272
26273         * mpn/sparc64/sub_n.s: Rewrite.
26274
26275         * mpn/sparc64/sub_n.s: Get operand order for main subcc right
26276         (before scrapping this code for new code).
26277
26278 1999-11-20  Torbjorn Granlund  <tege@swox.com>
26279
26280         * mpn/sparc64/add_n.s: Rewrite.
26281
26282 1999-11-17  Torbjorn Granlund  <tege@swox.com>
26283
26284         * mpn/x86/syntax.h (PROLOG): New #define.
26285         (EPILOG): New #define.
26286
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.
26291
26292 1999-11-17  Torbjorn Granlund  <tege@swox.com>
26293
26294         * mpn/alpha/gmp-mparam.h
26295         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
26296         (KARATSUBA_SQR_THRESHOLD): Likewise.
26297
26298 1999-11-14  Torbjorn Granlund  <tege@swox.com>
26299
26300         * mpn/x86/mul_1.S: Unroll and optimize for P6 and K7.
26301
26302 1999-11-09  Torbjorn Granlund  <tege@swox.com>
26303
26304         * mpn/x86/p6/gmp-mparam.h
26305         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
26306         (KARATSUBA_SQR_THRESHOLD): Likewise.
26307
26308 1999-11-05  Torbjorn Granlund  <tege@swox.com>
26309
26310         * mpn/generic/addsub_n.c: New file.
26311
26312 1999-11-02  Torbjorn Granlund  <tege@swox.com>
26313
26314         * config.guess: Handle alpha:FreeBSD with alpha:NetBSD.
26315
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.
26320
26321 1999-10-31  Torbjorn Granlund  <tege@swox.com>
26322
26323         * mpn/vax/rshift.s: New file.
26324         * mpn/vax/lshift.s: New file.
26325
26326 1999-10-29  Torbjorn Granlund  <tege@swox.com>
26327
26328         * config.sub: Handle k5 and k6.
26329         * mpn/configure.in: Recognize k6.
26330
26331         * mpf/tests/t-get_d.c (LOW_BOUND, HIGH_BOUND): New #defines.
26332         (main): Tighten error bounds to 14 digits.
26333
26334         * longlong.h (default umul_ppmm, when smul_ppmm exists):
26335         Rename __m0 => __xm0, __m1 => __xm1.
26336         (default smul_ppmm): Likewise.
26337
26338 1999-10-11  Torbjorn Granlund  <tege@swox.com>
26339
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.
26343
26344 1999-09-29  Torbjorn Granlund  <tege@swox.com>
26345
26346         * mpn/generic/divrem_2.c: Clean up comments.
26347
26348 1999-09-23  Torbjorn Granlund  <tege@swox.com>
26349
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.
26356
26357         * gmp.h (mpn_incr_u): New macro (from mpn/generic/mul_n.c).
26358         (mpn_decr_u): New macro.
26359
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.
26369
26370         * mpn/generic/sqrtrem.c: Start single-limb Newton iteration from 18
26371         bits.
26372
26373 1999-07-27  Torbjorn Granlund  <tege@swox.com>
26374
26375         * mpn/generic/divrem_1.c (__gmpn_divrem_1n): New function.
26376
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.
26382
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.
26386
26387         * mpn/generic/divrem.c: Rework variable usage for better register
26388         allocation.
26389
26390 1999-07-26  Torbjorn Granlund  <tege@swox.com>
26391
26392         * mpn/alpha/ev5/add_n.s: Rewrite for better ev6 speed.
26393         * mpn/alpha/ev5/sub_n.s: Likewise.
26394
26395 1999-07-21  Torbjorn Granlund  <tege@swox.com>
26396
26397         * longlong.h (alpha): Define umul_ppmm for cc.
26398
26399         * gmp-impl.h (DItype, UDItype): Define for non-gcc if _LONGLONG is
26400         defined.
26401
26402 1999-07-15  Torbjorn Granlund  <tege@swox.com>
26403
26404         * longlong.h (powerpc64 count_leading_zeros): Fix typo.
26405         (powerpc64 add_ssaaaa): Fix typos.
26406         (powerpc64 sub_ddmmss): Fix typos.
26407
26408 1999-07-14  Torbjorn Granlund  <tege@swox.com>
26409
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.
26414
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.
26421
26422         * Makefile.in (FLAGS_TO_PASS): Pass "AR=$(AR)".
26423
26424 1999-07-07  Torbjorn Granlund  <tege@swox.com>
26425
26426         * demos/pexpr.c (factor): Change alloca call to a malloc/free pair.
26427
26428         * mpn/powerpc32/syntax.h: Add #define's for crN.
26429
26430         * gmp.h (gmp_rand_algorithm): Remove spurious `,'.
26431
26432 1999-07-05  Torbjorn Granlund  <tege@swox.com>
26433
26434         * mpn/generic/divrem_1.c: Normalize divisor when needed.
26435
26436 1999-07-02  Torbjorn Granlund  <tege@swox.com>
26437
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
26442         of GCC.
26443
26444 1999-05-26  Linus Nordberg  <linus@swox.se>
26445
26446         * rand.c (gmp_rand_init): Fix typo.
26447
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'.
26453
26454         * randlc.c (gmp_rand_init_lc): Fix typo (don't call
26455         mpz_init_set_ui()).
26456
26457         * mpn/generic/rawrandom.c (mpn_rawrandom): Set SIZ(s->seed) when
26458         reallocating.
26459
26460         * tests/rand/Makefile (test, bigtest): Add 33-bit tests.
26461
26462         * tests/rand/gen.c (main): Set precision of variable passed to
26463         mpf_urandomb().  Add option `-p'.
26464
26465 1999-05-25  Linus Nordberg  <linus@swox.se>
26466
26467         * randcm.c: Remove.
26468         * randcmui.c: Remove.
26469         * Makefile.in: Remove randcm and randcmui.
26470         * make.bat: Ditto.
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().
26475
26476         * randlcui.c (gmp_rand_init_lc_ui): Don't call
26477         __gmp_rand_init_common_ui().
26478
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
26482
26483         * mpn/generic/rawrandom.c (mpn_rawrandom): Don't calculate nlimbs
26484         twice.
26485
26486         * gmp.h (__gmp_rand_dist): Remove.
26487
26488 1999-05-24  Linus Nordberg  <linus@swox.se>
26489
26490         * mpn/generic/rawrandom.c: Clean up comments.
26491
26492         * gmp.texi: Add documentation for random number generation.
26493
26494 1999-05-21  Linus Nordberg  <linus@swox.se>
26495
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.
26510
26511         * tests/rand/gen.c (main): Pass `s' to rand-funcs instead of address
26512         of `s'.
26513
26514 1999-05-20  Linus Nordberg  <linus@swox.se>
26515
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.
26518         * make.bat: Ditto.
26519
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().
26524
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.
26529
26530 1999-05-12  Torbjorn Granlund  <tege@swox.com>
26531
26532         * mpn/configure.in: Put generic m68k alternative last.
26533
26534 1999-05-04  Torbjorn Granlund  <tege@swox.com>
26535
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.
26540
26541         * demos/pexpr.c: Cast longjmp argument via long to silent warnings on
26542         64-bit hosts.
26543
26544 1999-05-03  Torbjorn Granlund  <tege@swox.com>
26545
26546         * demos/pexpr.c: Add #defines for GMP 1.x and 2.0 compatibility.
26547
26548         * demos/pexpr.c (setup_error_handler): New function; take signal
26549         handler setup code from main(), with major modifications to use modern
26550         signal interface.
26551         (main): Remove signal handler setup code; call setup_error_handler.
26552
26553 1999-04-29  Linus Nordberg  <linus@swox.se>
26554
26555         * tests/rand/findcl.c (main): Add option '-i' for interval factor.
26556         Separate v and merit lose figures.  Add '-v' for version.
26557
26558 1999-04-28  Linus Nordberg  <linus@swox.se>
26559
26560         * tests/rand/statlib.c: Change debugging stuff.
26561
26562         * tests/rand/gmpstat.h: Add debug values definitions.
26563
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.
26569
26570 1999-04-27  Linus Nordberg  <linus@swox.se>
26571
26572         * tests/rand/Makefile (clean): Add target.
26573
26574 1999-04-27  Linus Nordberg  <linus.nordberg@canit.se>
26575
26576         * tests/rand/stat.c: Include gmpstat.h.
26577         Add global int g_debug.
26578
26579         * tests/rand/spect.c: Include <unistd.h>.
26580
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.
26584
26585         * tests/rand/spect.c: Move everything but main() to statlib.c.
26586
26587         * tests/rand/findcl.c: New file.
26588
26589         * tests/rand/gmpstat.h: New file.
26590
26591         * tests/rand/statlib.c (merit, merit_u, f_floor, vz_dot,
26592         spectral_test): New functions.
26593
26594 1999-04-27  Torbjorn Granlund  <tege@swox.com>
26595
26596         * mpn/configure.in: Fix typo, "sparc-*)" was "sparc)".
26597
26598 1999-04-21  Torbjorn Granlund  <tege@swox.com>
26599
26600         * config.sub: Recognize ev6.
26601
26602 1999-04-12  Linus Nordberg  <linus.nordberg@canit.se>
26603
26604         * urandom.c: Split up into randclr.c, randi.c, randi_lc.c,
26605         randicom.c.
26606         * randclr.c, randi.c, randi_lc.c, randicom.c: New files.
26607         * Makefile.in: Remove urandom.  Add randclr, randi, randi_lc,
26608         randicom.
26609         * make.bat: Ditto
26610
26611 1999-03-31  Torbjorn Granlund  <tege@matematik.su.se>
26612
26613         * configure.in (sparc9-*-solaris2.[789]*, etc): New alternative.
26614         * mpn/configure.in: Use mt-sprc9 also for ultrasparc*-*-solaris2*.
26615
26616 1999-03-30  Linus Nordberg  <linus.nordberg@canit.se>
26617
26618         * urandom.c (__gmp_rand_scheme): Change NULL->0.
26619         Include "gmp.h" instead of <gmp.h>.
26620
26621 1999-03-29  Linus Nordberg  <linus.nordberg@canit.se>
26622
26623         * gmp.h (__gmp_rand_data_lc): Now holds a, c, m instead of scheme
26624         struct.
26625         (__gmp_rand_lc_scheme_struct): Remove mpz_t's `a' and `m'.
26626
26627         * tests/rand/stat.c (f_freq): Don't print 2nd level results if doing
26628         1st level.
26629
26630         * tests/rand/gen.c (main): Set default algorithm to mpz_urandomb.
26631         (main): Add option -c.
26632
26633 1999-03-24  Linus Nordberg  <linus.nordberg@canit.se>
26634
26635         * tests/rand/Makefile (GMPINC): Rename to GMPH.
26636         (GMPH): Add gmp-mparam.h.
26637         (CFLAGS): Add -I$(GMPLIBDIR)/mpn
26638
26639 1999-03-23  Linus Nordberg  <linus.nordberg@canit.se>
26640
26641         * Makefile.in: Compile top-dir/urandom.c.
26642         * make.bat: Ditto.
26643
26644         * mpn/Makefile.in: Compile rawrandom.c.
26645         * make.bat: Ditto.
26646
26647         * mpn/configure.in (functions): Add rawrandom.
26648
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().
26655
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.
26662
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().
26666
26667         * mpf/urandom.c (mpf_urandomb): Call mpn_rawrandom().
26668
26669         * mpn/generic/rawrandom.c: New file.
26670         (mpn_rawrandom): New function.
26671
26672 1999-03-17  Torbjorn Granlund  <tege@matematik.su.se>
26673
26674         * extract-dbl.c: When packing result, adjust exp when sc == 0.
26675
26676         * mpf/tests/t-get_d.c: New file.
26677         * mpf/tests/Makefile.in: Compile t-get_d.c.
26678
26679 1999-03-16  Linus Nordberg  <linus.nordberg@canit.se>
26680
26681         * mpz/urandom.c (__gmp_rand_scheme): Add extra braces around the
26682         mpz_t members.
26683
26684         * make.bat: Compile mpz/urandom.c and mpf/urandom.c
26685
26686         * tests/rand/statlib.c (ks_table): Use mpf_pow_ui() and exp().
26687
26688         * tests/rand/gen.c: Include unistd.h for getopt.
26689
26690 1999-03-15  Linus Nordberg  <linus.nordberg@canit.se>
26691
26692         * mpz/urandom.c (gmp_rand_init): New function.
26693         (gmp_rand_clear): New function.
26694         (mpz_urandomb): New function.
26695
26696         * mpz/Makefile.in: Compile urandom.c
26697
26698         * mpf/urandom.c (mpf_urandomb): New function.
26699
26700         * mpf/Makefile.in: Compile urandom.c.
26701
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
26705         functions.
26706         (mpz_urandomb, mpf_urandomb): Add prototype.
26707         (gmp_rand_init, gmp_rand_clear): Add prototype.
26708
26709         * tests/rand/gen.c, stat.c, statlib.c, statlib.h: New files.
26710         * tests/rand/Makefile, tests/rand/ChangeLog: New files.
26711
26712 1999-03-15  Torbjorn Granlund  <tege@matematik.su.se>
26713
26714         * .gdbinit: New file.
26715
26716         * mpz/dump.c: New file.
26717         * mpz/Makefile.in: Compile dump.c.
26718         * make.bat: Likewise.
26719         * gmp.h (mpz_dump): Declare.
26720
26721 1999-03-14  Torbjorn Granlund  <tege@matematik.su.se>
26722
26723         * mpz/tests/reuse.c: Also test mpz_invert and mpz_divexact.
26724
26725         * mpz/tests/convert.c: Update to GMP 2 variable syntax.
26726
26727 1999-03-13  Torbjorn Granlund  <tege@matematik.su.se>
26728
26729         * mpf/README: New file.
26730         * mpz/README: New file.
26731
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.
26736
26737 1999-03-12  Torbjorn Granlund  <tege@matematik.su.se>
26738
26739         * mpn/configure.in: Stage 1 of rewrite.
26740         * mpn/underscore.h: New name for bsd.h.
26741         * mpn/sysv.h: Deleted.
26742
26743         * mpn/m68k/*: Don't include sysdep.h.
26744
26745         * mpn/pa64/README: New file.
26746
26747 1999-03-11  Torbjorn Granlund  <tege@matematik.su.se>
26748
26749         * mpn/powerpc32/add_n.S: Add support for both AIX and ELF syntax.
26750         Renamed from `.s'.
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.
26757
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.
26763
26764         * mpn/Makefile.in (mul_basecase.o): Delete rule.
26765
26766 1999-02-22  Torbjorn Granlund  <tege@matematik.su.se>
26767
26768         * configure.in (hppa2.0*-*-*): Force use of GCC.
26769
26770         * extract-dbl.c: Handle IEEE denormalized numbrs.  Clean up.
26771
26772 1998-12-02  Torbjorn Granlund  <tege@matematik.su.se>
26773
26774         * mpn/Makefile.in (CCAS): New macro.
26775         (.s.o): Use CCAS.
26776         (.S.o): Likewise.
26777
26778         * mpn/Makefile.in (mul_basecase.o): Add dependency.
26779         (sqr_basecase.o): Likewise.
26780         (mod_1.o): Likewise.
26781
26782         * demos/pexpr.c (cputime): Test also __hpux.
26783         (cleanup_and_exit): Check SIGXCPU only #ifdef LIMIT_RESOURCE_USAGE.
26784
26785         * mpz/tests/t-2exp.c: Use urandom, not random.
26786
26787         * mpn/configure.in (arm*-*-*): New alternative.
26788
26789 1998-11-30  Torbjorn Granlund  <tege@matematik.su.se>
26790
26791         * gmp-impl.h (union ieee_double_extract): Special case for
26792         little-endian arm.
26793         (LIMBS): Alias for PTR.
26794
26795 1998-11-26  Torbjorn Granlund  <tege@matematik.su.se>
26796
26797         * longlong.h (m68000 umul_ppmm): Use `muluw', not `mulu'.
26798         (m68k stuff): Clean up; add coldfire support.
26799
26800 1998-11-23  Torbjorn Granlund  <tege@matematik.su.se>
26801
26802         * mpn/mips3/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
26803         (KARATSUBA_SQR_THRESHOLD): #define.
26804
26805         * mpn/sparc32/v9/README: New file.
26806
26807 1998-11-20  Torbjorn Granlund  <tege@matematik.su.se>
26808
26809         * mpn/x86/README: New file.
26810
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.
26818
26819         * mpn/alpha/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
26820         (KARATSUBA_SQR_THRESHOLD): #define.
26821
26822         * mpn/configure.in: Point to x86/p6 when appropriate.
26823
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.
26838
26839 1998-11-17  Torbjorn Granlund  <tege@matematik.su.se>
26840
26841         * mpn/x86/mul_basecase.S: New file for non-pentiums.
26842         * mpn/x86/mul_basecase.S: Move to mpn/x86/pentium.
26843
26844 1998-11-16  Torbjorn Granlund  <tege@matematik.su.se>
26845
26846         * make.bat: Compile mul_basecase.c and sqr_basecase.c.
26847
26848 1998-11-10  Torbjorn Granlund  <tege@matematik.su.se>
26849
26850         * mpz/invert.c: Defer writing to parameter `invert' until
26851         end.
26852
26853 1998-11-03  Torbjorn Granlund  <tege@matematik.su.se>
26854
26855         * mpn/pa64/udiv_qrnnd.c: Handle more border cases.
26856
26857 1998-10-29  Torbjorn Granlund  <tege@matematik.su.se>
26858
26859         * insert-dbl.c: Special case biased exponents < 1; Get boundary for
26860         Inf right.
26861
26862         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB): New #define.
26863
26864 1998-10-28  Torbjorn Granlund  <tege@matematik.su.se>
26865
26866         * mpn/powerpc32/submul_1.s: Rewrite, optimizing for PPC604.
26867         * mpn/powerpc32/addmul_1.s: Likewise.
26868         * mpn/powerpc32/lshift.s: Likewise.
26869
26870 1998-10-23  Torbjorn Granlund  <tege@matematik.su.se>
26871
26872         * config/mt-sprc9-gcc (XCFLAGS): Add -Wa,-xarch=v8plus.
26873
26874         * mpn/sparc32/v9/submul_1.s: New file.
26875
26876 1998-10-21  Torbjorn Granlund  <tege@matematik.su.se>
26877
26878         * mpn/config/mt-pa2hpux: New file.
26879         * mpn/configure.in (hppa2.0*-*-*): Use new 64-bit code.
26880
26881         * config.sub: Recognize hppa2.0 as CPU type.
26882
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.
26889
26890 1998-10-20  Torbjorn Granlund  <tege@matematik.su.se>
26891
26892         * mpz/pprime_p.c: Pass 1L, not 1, to mpz_cmp_ui.
26893
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.
26898
26899 1998-10-19  Torbjorn Granlund  <tege@matematik.su.se>
26900
26901         * mpn/generic/bdivmod.c: Avoid using switch statement with mp_limb_t
26902         index.
26903
26904 1998-10-17  Torbjorn Granlund  <tege@matematik.su.se>
26905
26906         * mpn/sparc32/v9/mul_1.s: Misc cleanups.
26907         * mpn/sparc32/v9/addmul_1.s: Misc cleanups.
26908
26909 1998-10-16  Torbjorn Granlund  <tege@matematik.su.se>
26910
26911         * mpn/tests/{add,sub,}mul_1.c: Print xlimb using mpn_print.
26912
26913         * mpz/tests/t-powm.c (SIZE): Increase to 50.
26914         (EXP_SIZE): New parameter; use it for computing exp_size.
26915
26916 1998-10-15  Torbjorn Granlund  <tege@matematik.su.se>
26917
26918         * mpn/generic/divrem_newt.c: Use TMP_ALLOC interface.
26919
26920         * mpn/generic/sqrtrem.c: Check BITS_PER_MP_LIMB before defining
26921         assembly variants of SQRT.
26922
26923 1998-10-14  Torbjorn Granlund  <tege@matematik.su.se>
26924
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.
26930
26931         * mpn/generic/mul_n.c: Delay assignment of `sign' for lower
26932         register pressure.
26933
26934         * mpn/sparc32/v9/mul_1.s: New file.
26935
26936         * config/mt-sprc9-gcc: New file.
26937         * configure.in: Use it.
26938
26939         * mpn/configure.in: Use sparc64 for Solaris 2.7 and later with a
26940         sparc v9 CPU.
26941         * mpn/configure.in: Use sparc32/v9 for Solaris 2.6 or earlier with
26942         a sparc v9 CPU.
26943
26944         * mpf/sub.c: In initial code for ediff == 0, limit precision
26945         before jumping to `normalize'.
26946
26947 1998-10-13  Torbjorn Granlund  <tege@matematik.su.se>
26948
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).
26952
26953         * config.guess: Update from egcs 1.1.
26954         (9000/[3478]??:HP-UX:*:*): Properly return 2.0 for all known 2.0
26955         machines.
26956
26957 1998-10-07  Torbjorn Granlund  <tege@matematik.su.se>
26958
26959         * mpz/root.c (mpz_root): New file.
26960         * mpz/Makefile.in: Compile it.
26961         * make.bat: Likewise.
26962         * gmp.h (mpz_root): Declare.
26963
26964         * mpz/perfpow.c: New file.
26965         * mpz/Makefile.in: Compile it.
26966         * make.bat: Likewise.
26967         * gmp.h (mpz_perfect_power_p): Declare.
26968
26969         * mpz/remove.c: New file.
26970         * mpz/Makefile.in: Compile it.
26971         * make.bat: Likewise.
26972         * gmp.h (mpz_remove): Declare.
26973
26974         * mpz/bin_ui.c: New file.
26975         * mpz/Makefile.in: Compile it.
26976         * make.bat: Likewise.
26977         * gmp.h (mpz_bin_ui): Declare.
26978
26979         * mpz/bin_uiui.c: New file.
26980         * mpz/Makefile.in: Compile it.
26981         * make.bat: Likewise.
26982         * gmp.h (mpz_bin_uiui): Declare.
26983
26984 1998-09-16  Torbjorn Granlund  <tege@matematik.su.se>
26985
26986         * longlong.h: Test for __powerpc__ in addition to _ARCH_PPC.
26987
26988 Sat Sep  5 17:22:28 1998  Torbjorn Granlund  <tege@matematik.su.se>
26989
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.
26993
26994 Tue Aug 18 10:24:39 1998  Torbjorn Granlund  <tege@matematik.su.se>
26995
26996         * mpz/pprime_p.c (mpz_probab_prime_p): Add new code block
26997         for doing more dividing.
26998
26999 Sat Aug 15 18:43:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
27000
27001         * mpn/generic/divrem_newt.c: New name for divrem_newton.c.
27002         * mpn/Makefile.in: Corresponding changes.
27003         * mpn/configure.in: Likewise.
27004
27005 Wed Aug 12 23:07:09 1998  Torbjorn Granlund  <tege@matematik.su.se>
27006
27007         * config.guess: Handle powerpc for NetBSD.
27008
27009 Tue Jul 28 23:10:55 1998  Torbjorn Granlund  <tege@matematik.su.se>
27010
27011         * mpz/fib_ui.c: New file.
27012         * mpz/Makefile.in: Compile it.
27013         * make.bat: Likewise.
27014         * gmp.h (mpz_fib_ui): Declare.
27015
27016 Wed Jun 17 22:52:58 1998  Torbjorn Granlund  <tege@matematik.su.se>
27017
27018         * make.bat: Fix typo, `asm-synt.h' => `asm-syntax.h'.
27019
27020 Wed Jun  3 11:27:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
27021
27022         * config/mt-pwr: New file.
27023         * config/mt-ppc: New file.
27024         * configure.in: Use the new files.
27025
27026 Tue Jun  2 13:04:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
27027
27028         * mpn/sparc32/v9/addmul_1.s: New file.
27029         * mpn/config/mt-sprc9: New file.
27030         * mpn/configure.in: Use mt-sprc9.
27031
27032 Tue May 26 11:24:18 1998  Torbjorn Granlund  <tege@matematik.su.se>
27033
27034         * demos/factorize.c (factor_using_pollard_rho): Pass correct
27035         parameters in recursive calls; join the two recursion arms.
27036
27037         * mpf/set_q.c: Set result sign.
27038         When normalizing the numerator, don't allow it to increase in size
27039         beyond prec.
27040
27041 Tue May 19 17:28:14 1998  Torbjorn Granlund  <tege@matematik.su.se>
27042
27043         * demos/factorize.c (factor_using_division): Call fflush
27044         also for the factor 2.
27045
27046 Mon May 18 15:51:01 1998  Torbjorn Granlund  <tege@matematik.su.se>
27047
27048         * make.bat: Pass -fomit-frame-pointer.  Do not pass -g.
27049
27050 Tue May  5 01:42:50 1998  Torbjorn Granlund  <tege@matematik.su.se>
27051
27052         * mpz/Makefile.in (LOCAL_CC): Remove definition.
27053
27054         * gmp.h: Get rid of GMP_SMALL stuff.
27055         * mpz/Makefile.in: Likewise.
27056         * mpq/Makefile.in: Likewise.
27057         * mpf/Makefile.in: Likewise.
27058
27059         * mpz/invert.c: Fix typo in comment.
27060
27061 Mon May  4 23:05:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
27062
27063         * mpn/generic/sqrtrem.c: Check that __arch64__ is not defined
27064         before defining sparc SQRT.
27065
27066 Mon Apr 20 19:16:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
27067
27068         * mpn/generic/gcdext.c: Allow gp to be NULL.
27069
27070 1998-04-03  Torbjorn Granlund  <tege@matematik.su.se>
27071
27072         * mpn/configure.in: Recognize `alphaev5*', not `alphaev5'.
27073
27074         * config.guess: Handle CPU variants for NetBSD.
27075
27076 Mon Mar 16 13:07:54 1998  Torbjorn Granlund  <tege@matematik.su.se>
27077
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.
27081
27082 Thu Mar 12 17:19:04 1998  Torbjorn Granlund  <tege@matematik.su.se>
27083
27084         * gmp.h (mpf_ceil, mpf_floor, mpf_trunc): Add declarations.
27085
27086         * config.guess: Update from FSF version.
27087         * config.sub: Likewise.
27088
27089         * config.guess: Add special handling of alpha-*-NetBSD.
27090
27091 Wed Mar 11 00:55:34 1998  Torbjorn Granlund  <tege@matematik.su.se>
27092
27093         * mpz/inp_str.c: Update from set_str.c.
27094         Properly increment `nread' when skipping minus sign.
27095
27096         * mpz/set_str.c: Check for empty string after having skipped
27097         leading zeros.
27098
27099 Mon Mar  9 19:28:00 1998  Torbjorn Granlund  <tege@matematik.su.se>
27100
27101         * mpz/set_str.c: Skip leading zeros.
27102
27103 Wed Mar  4 19:29:16 1998  Torbjorn Granlund  <tege@matematik.su.se>
27104
27105         * gmp.h (mpz_cmp_si): Cast argument before calling mpz_cmp_ui.
27106
27107         * demos/factorize.c: Rewrite.
27108
27109 1998-02-04  Torbjorn Granlund  <tege@matematik.su.se>
27110
27111         * configure.in (i[3456]86* etc): Check if using gcc before
27112         choosing mt-x86.
27113
27114         * configure.in (m68*-*-*): New alternative.
27115         * config/mt-m68k: New file.
27116
27117         * mpn/alpha/invert-limb.s: Put tables in text segment,
27118         since not all systems support "rdata".
27119
27120 Wed Feb  4 02:20:57 1998  Torbjorn Granlund  <tege@matematik.su.se>
27121
27122         * gmp.h (__GNU_MP_VERSION_SNAP): New #define.
27123         (__GNU_MP_VERSION_MINOR): Now 1.
27124
27125 Wed Jan 28 22:29:36 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
27126
27127         * longlong.h (alpha udiv_qrnnd): #define UDIV_NEEDS_NORMALIZATION.
27128
27129 Wed Jan 28 20:28:19 1998  Torbjorn Granlund  <tege@sophie.matematik.su.se>
27130
27131         * mpz/pprime_p.c (mpz_probab_prime_p): Delete 59 from tried divisors.
27132
27133 Mon Jan 26 01:39:02 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
27134
27135         * mpz/pprime_p.c (mpz_probab_prime_p): Major overhaul: Check small
27136         numers specifically; check small factors, then perform a fermat test.
27137
27138 Tue Jan 13 14:58:28 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
27139
27140         * longlong.h (alpha udiv_qrnnd): Call __mpn_invert_normalized_limb
27141         and udiv_qrnnd_preinv.
27142
27143 Wed Jan  7 01:52:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
27144
27145         * mpn/configure.in (alpha*, extra_functions): Add invert-limb and
27146         remove udiv_qrnnd.
27147
27148         * mpn/tests/divrem.c: Get allocations right.
27149
27150         * mpn/generic/divrem.c: Conditionally pre-invert most significant
27151         divisor limb.
27152
27153 Tue Jan  6 23:08:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
27154
27155         * mpn/generic/divrem_1.c: Rename variables to comply to conventions.
27156         Make `i' have type `mp_size_t'.
27157
27158 Tue Dec 30 22:21:42 1997  Torbjorn Granlund  <tege@matematik.su.se>
27159
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,
27164         mpz_tdiv_q_ui.
27165
27166         * mpz/tdiv_ui.c: New file.
27167         * mpz/Makefile.in: Compile it.
27168         * make.bat: Likewise.
27169         * gmp.h (mpz_tdiv_ui): Declare.
27170
27171 Fri Nov  7 04:21:15 1997  Torbjorn Granlund  <tege@matematik.su.se>
27172
27173         * mpf/integer.c (FUNC_NAME): Fix bogus test for mpf_trunc.
27174
27175         * demos/isprime.c: New file.
27176
27177         Sat Nov  1 19:32:25 1997  Torbjorn Granlund  <tege@matematik.su.se>
27178
27179         * mpz/cmp_abs.c: New file.
27180         * mpz/Makefile.in: Compile it.
27181         * make.bat: Likewise.
27182         * gmp.h (mpz_cmp_abs): Declare.
27183
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.
27188
27189 Sat Sep 27 04:49:52 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
27190
27191         * mpz/fdiv_r_2exp.c: Get allocation for `tmp' right.
27192
27193         * mpz/fdiv_q_2exp.c: In final result adjustment code, handle
27194         that intermediate result is zero.
27195
27196         * mpz/tests/t-2exp.c: New file.
27197         * mpz/tests/Makefile.in: Handle t-2exp.c.
27198
27199 Fri Sep 26 16:29:21 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
27200
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.
27204
27205         * mpn/generic/gcd.c: Change count argument of mpn_lshift/mpn_rshift
27206         calls to `unsigned int'.
27207         * mpz/divexact.c: Likewise.
27208
27209 Mon Sep 22 02:19:52 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27210
27211         * mpz/tests/t-powm.c: Decrease `reps' to 2500.
27212
27213         * mpz/tests/t-pow_ui.c: New file.
27214         * mpz/tests/Makefile.in: Handle t-pow_ui.c.
27215
27216         * mpz/ui_pow_ui.c: Get special cases for exponent and base right.
27217
27218         * mpz/pow_ui.c: Increase temp space allocation by 1 limb.
27219         Split `rsize' into two variables; compute space allocation into
27220         `ralloc'.
27221
27222 Sun Sep  7 04:15:12 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27223
27224         * mpn/pa64/lshift.s: New file.
27225         * mpn/pa64/rshift.s: New file.
27226         * mpn/pa64/sub_n.s: New file.
27227
27228 Sat Sep  6 19:14:13 1997  Torbjorn Granlund  <tege@gmp.tmg.se>
27229
27230         * mpn/pa64/add_n.s: New file.
27231         * mpn/pa64: New directory.
27232
27233 Tue Aug 19 16:17:09 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27234
27235         * mpz/swap.c: New file.
27236         * mpz/Makefile.in: Compile it.
27237         * make.bat: Likewise.
27238         * gmp.h (mpz_swap): Declare.
27239
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.)
27242
27243 Mon Aug 18 03:29:50 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27244
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.
27249
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.
27253
27254 Fri Aug 15 02:13:57 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27255
27256         * mpn/arm/m/mul_1.s: New file.
27257         * mpn/arm/m/addmul_1.s: New file.
27258
27259         * mpn/powerpc32/mul_1.s: Rewrite.
27260
27261         * mpn/alpha/mul_1.s: Prefix labels with `.'.
27262
27263 Mon Aug 11 02:37:16 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27264
27265         * mpn/powerpc32/add_n.s: Rewrite.
27266         * mpn/powerpc32/sub_n.s: Rewrite.
27267
27268 Sun Aug 10 17:07:15 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27269
27270         * mpn/powerpc32/addmul_1.s: Delete obsolete comments.
27271         * mpn/powerpc32/submul_1.s: Likewise.
27272
27273 Fri Jul 25 20:07:54 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27274
27275         * mpz/addmul_ui.c: New file.
27276         * mpz/Makefile.in: Compile it.
27277         * make.bat: Likewise.
27278         * gmp.h (mpz_addmul_ui): Declare.
27279
27280         * mpz/setbit.c: Add missing code after final `else'.
27281
27282 Tue Jul 22 17:45:01 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
27283
27284         * mpn/sh/add_n.s: Fix typo.
27285         * mpn/sh/sub_n.s: Likewise.
27286
27287         * longlong.h (ns32k count_trailing_zeros): Fix typo.
27288
27289         * insert-dbl.c: Check for exponent overflow and return Inf.
27290
27291         * mpz/get_d.c: Rewrite to avoid rounding errors.
27292
27293 Thu May 29 11:51:07 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27294
27295         * mpq/add.c: Swap some usages of tmp1 and tmp2 to make sure
27296         their allocation suffices.
27297         * mpq/sub.c: Likewise.
27298
27299 Wed Apr 16 02:24:25 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27300
27301         * demos/pexpr.c: New file.
27302
27303         * mpn/generic/mul_n.c: Misc optimizations from Robert Harley.
27304
27305         * gmp-impl.h (MPZ_PROVOKE_REALLOC): New #define.
27306
27307 Sat Apr 12 17:54:04 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27308
27309         * mpz/tstbit.c: New file.
27310         * mpz/Makefile.in: Compile it.
27311         * make.bat: Likewise.
27312         * gmp.h (mpz_tstbit): Declare.
27313
27314         * mpz/tests/logic.c: Use MPZ_CHECK_FORMAT.
27315         * mpz/tests/bit.c: New test.
27316         * mpz/tests/Makefile.in: Handle bit.c.
27317
27318         * mpz/ior.c: In -OP2,+OP1 case, normalize OP2 after call to mpn_sub_1.
27319
27320         * gmp-impl.h (MPZ_CHECK_FORMAT): New #define.
27321
27322 Thu Apr 10 00:30:14 1997  Torbjorn Granlund  <tege@tmg.se>
27323
27324         * longlong.h (POWER/PowerPC): Test _ARCH_PWR instead of _IBMR2.
27325
27326 Wed Apr  9 18:23:31 1997  Torbjorn Granlund  <tege@pro.tmg.se>
27327
27328         * gmp-impl.h: Move defaulting of UMUL_TIME and UDIV_TIME from here...
27329         * longlong.h: ...to here.
27330
27331 Sun Mar 30 12:16:23 1997  Torbjorn Granlund  <tege@matematik.su.se>
27332
27333         * mpn/generic/next_prime.c: New file.
27334
27335         * mpn/generic/perfsqr.c: Remove definitions of PP and PP_INVERTED.
27336         * gmp-impl.h: Put them here.
27337
27338 Fri Mar 28 08:18:05 1997  Torbjorn Granlund  <tege@matematik.su.se>
27339
27340         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Define as inline asm for
27341         for x86, but leave disabled for now.
27342
27343 Fri Feb 28 02:39:47 1997  Torbjorn Granlund  <tege@matematik.su.se>
27344
27345         * mpn/Makefile.in (.S.o): Pass SFLAGS and CFLAGS also to compiler
27346         for assembly phase.
27347         (.s.o): Pass SFLAGS.
27348
27349 Wed Feb 26 06:46:08 1997  Torbjorn Granlund  <tege@matematik.su.se>
27350
27351         * mpn/configure.in: For Pentium Pro, use default code, not Pentium
27352         optimized code.
27353
27354         * mpn/x86/addmul_1.S: Unroll and optimize for Pentium Pro.
27355         * mpn/x86/submul_1.S: Likewise.
27356
27357 Thu Feb 13 08:26:09 1997  Torbjorn Granlund  <tege@matematik.su.se>
27358
27359         * mpf/Makefile.in: Compile floor.o, ceil.o and trunc.o (from
27360         integer.c).
27361         * make.bat: Likewise.
27362
27363 Wed Feb  5 05:58:44 1997  Torbjorn Granlund  <tege@matematik.su.se>
27364
27365         * mpn/configure.in (alpha*): Add cntlz to extra_functions.
27366
27367 Wed Feb  4 03:30:45 1997  Torbjorn Granlund  <tege@matematik.su.se>
27368
27369         * mpf/integer.c: New file (supporting mpf_floor, mpf_ceil, mpf_trunc).
27370
27371 Mon Feb  3 14:21:36 1997  Torbjorn Granlund  <tege@matematik.su.se>
27372
27373         * make.bat: Fix typo, set_dfl_prc => set_dfl_prec.
27374
27375 Sun Feb  2 02:34:33 1997  Torbjorn Granlund  <tege@matematik.su.se>
27376
27377         * mpf/out_str.c: After outputting `-', decrement n_digits.
27378
27379 Wed Jan  8 02:50:20 1997  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27380
27381         * mpn/generic/divrem.c: qextra_limbs => qxn.
27382
27383 Wed Dec 18 07:50:46 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27384
27385         * mpz/tests/t-tdiv.c (SIZE): Increase to 200.
27386
27387 Tue Dec 17 19:32:48 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27388
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.
27394
27395 Thu Dec 12 17:55:13 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27396
27397         * gmp.h (_GMP_H_HAVE_FILE): Test also __dj_include_stdio_h_.
27398
27399 Sat Dec  7 09:40:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27400
27401         * mpn/alpha/invert-limb.s: New file.
27402
27403 Thu Dec  5 01:25:31 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27404
27405         * mpz/ui_pow_ui.c (mpz_pow2): New (static) function.
27406         (mpz_ui_pow_ui): Rewrite.
27407
27408         * make.bat: `pre_mod_1.c' => `pre_mod_.c'.  Fix typo in path to
27409         gmp-mpar.h.
27410
27411 Fri Nov 15 00:49:55 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27412
27413         * mpz/ui_pow_ui.c: Rewrite for better speed.
27414
27415 Fri Nov  1 16:36:56 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27416
27417         * Makefile.in (recursive make rules): Use `&&' instead of `;' as
27418         delimiter.
27419
27420 Fri Oct 25 17:12:36 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27421
27422         * gmp-impl.h (Cray/uxp MPN_COPY): Really declare as inline.
27423
27424 Thu Oct 24 15:08:19 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27425
27426         * mpn/fujitsu/rshift.c: Fix typo in loop boundaries.
27427
27428 Fri Oct 18 03:13:54 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27429
27430         * mpn/configure.in: Recognize `nextstep' for m68k variants; likewise
27431         for x86 variants.
27432
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.
27437
27438         * gmp-impl.h: In code for determining endianness, test also
27439         __BIG_ENDIAN__ and __hppa__.  Remove test of __NeXT__.
27440
27441 Wed Oct 16 03:50:34 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27442
27443         * mpf/set_str.c: Let `prec' determine precision used in
27444         exponentiation code; decrease allocation accordingly.
27445
27446         * mpn/vax: Change `jsob*' to `sob*' in all files.
27447
27448 Tue Oct 15 03:54:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27449
27450         * longlong.h (m88110 udiv_qrnnd): Change type of intermediate quotient
27451         to DImode (divu.d generates a 64-bit quotient).
27452
27453         * configure.in (m88110*): Fix typo.
27454
27455         * mpf/get_str.c: Compute exp_in_base using `double' to avoid overflow.
27456
27457         * gmp-impl.h (struct bases): Change type of chars_per_bit_exactly from
27458         float to double.
27459         * mpn/mp_bases.c (__mp_bases): Give 17 digits for chars_per_bit_exactly
27460         field.
27461
27462         * mpf/get_str.c: Let `prec' determine precision used in
27463         exponentiation code; decrease allocation accordingly.
27464
27465 Sun Oct 13 03:31:53 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27466
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.
27471
27472         * mpz/invert.c: Properly detect all operands that would yield an
27473         undefined inverse; make sure the inverse is always positive.
27474
27475         * mpz/xor.c: New file.
27476         * mpz/Makefile.in: Compile it.
27477         * make.bat: Likewise.
27478         * gmp.h (mpz_xor): Declare.
27479
27480         * mpz/tests/logic.c: Also test mpz_xor.
27481
27482         * mpz/lcm.c: Special case for when either operand equals 0.
27483
27484 Sat Oct 12 01:57:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27485
27486         * mpn/generic/gcd.c (find_a): Don't inline on x86.
27487
27488         * Makefile.in (CFLAGS): Default to just `-g'.
27489
27490         * configure.in: Recognize 386 and 486 wherever other x86 cpus are
27491         recognized.
27492         * configure.in: Use mt-x86 for all x86 cpus.
27493         * config/mt-x86: New file.
27494
27495         * mpn/alpha/cntlz.s: New file.
27496
27497 Tue Oct  8 00:16:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27498
27499         * longlong.h: Define smul_ppmm for Fujitsu vpp/uxp.
27500         Rewrite umul_ppmm to actually work on the hardware.
27501
27502         * mpn/x86/sub_n.S: Avoid parens around displacement of `leal'.
27503         * mpn/x86/add_n.S: Likewise.
27504
27505         * mpn/x86/syntax.h (R): Define differently depending on __STDC__.
27506
27507 Mon Oct  7 16:48:08 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27508
27509         * longlong.h: Don't test for __NeXT__ in outer 68k conditional;
27510         add test for __m68k__.
27511
27512 Sun Oct  6 00:59:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27513
27514         * gmp.h: Declare mpn_random.
27515         * make.bat: Compile mpn/generic/random.c.
27516
27517         * longlong.h: Define umul_ppmm for Fujitsu vpp/uxp.
27518
27519         * gmp-impl.h: Protect definitions using `__attribute__ ((mode (...)))'
27520         with test also for __GNUC_MINOR__.
27521
27522         * gmp.h: Don't define macros using __builtin_constant_p when using
27523         NeXT's compiler.
27524
27525 Fri Oct  4 16:53:50 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27526
27527         * mpz/lcm.c: New file.
27528         * mpz/Makefile.in: Compile it.
27529         * make.bat: Likewise.
27530         * gmp.h (mpz_lcm): Declare.
27531
27532 Wed Sep 25 00:06:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27533
27534         * mpq/tests/t-cmp_ui.c: Make sure numerator and denominator of `b' is
27535         within limits of an `unsigned long int'.
27536
27537         * mpz/tests/t-powm_ui.c: Change type of exp2 to `unsigned long int'.
27538
27539 Tue Sep 24 18:58:20 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27540
27541         * mpz/powm_ui.c: Make result always positive.
27542
27543         * urandom.h (urandom): Make it return mp_limb_t.
27544
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.
27550
27551 Fri Sep 20 03:08:10 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27552
27553         * mpz/pprime_p.c: When n <= 3, don't clear out n before using it.
27554
27555 Wed Sep 18 11:22:45 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27556
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.
27561
27562 Sun Sep 15 03:13:02 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27563
27564         * mpn/generic/random.c: New file.
27565         * mpn/configure.in (functions): Add `random'.
27566
27567         * gmp-impl.h (MPN_COPY): Define as annotated inline function for
27568         Crays and Fujitsu VPPs.
27569
27570         * gmp.h (mp_size_t): Define as `int' for non-MPP Cray.
27571         (mp_exp_t): Likewise.
27572
27573         * configure.in: Add support for Fujitsu VPP machines.
27574         * mpn/configure.in: Likewise.
27575         * config.guess: Likewise.
27576         * config.sub: Likewise.
27577
27578         * mpn/fujitsu/rshift.c: New file.
27579         * mpn/fujitsu/lshift.c: New file.
27580         * mpn/fujitsu: New directory, for Fujitsu VPP machines.
27581
27582 Wed Sep 11 11:34:38 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27583
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.
27597
27598         * mpn/x86/mul_basecase.S: New file.
27599         * mpn/generic/mul_basecase.c: New file.
27600         * mpn/generic/sqr_basecase.c: New file.
27601
27602 Wed Sep  4 02:59:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27603
27604         * mpz/set_str.c: Let `0b' and `0B' mean base 2.
27605
27606 Fri Aug 30 00:44:00 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27607
27608         * longlong.h (x86 umul_ppmm): Work around GCC bug that was
27609         triggered by Aug 28 change.
27610
27611         * mpbsd/min.c (digit_value_in_base): New function.
27612
27613         * mpz/set_str.c: Refine allocation size computation, use
27614         chars_per_bit_exactly instead of chars_per_limb.
27615
27616         * mpbsd/Makefile.in (.c.o): Add -D_mpz_realloc=_mp_realloc.
27617
27618 Wed Aug 28 02:52:14 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27619
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.
27631
27632 Tue Aug 27 01:03:25 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27633
27634         * gmp-impl.h (__gmp_0): Make it `const'.
27635
27636         * mpn/Makefile.in (clean mostlyclean): Comment out recursive clean
27637         of `tests'.
27638
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.
27643
27644         * mpn/generic/mul_n.c: Don't #define KARATSUBA_THRESHOLD.
27645         (impn_mul_n, impn_sqr_n): Rewrite, based on code contributed by
27646         Robert Harley.
27647         (impn_sqr_n_basecase): Rewrite.
27648
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.
27653
27654         * configure.in: Fix typo in last change.
27655
27656 Mon Aug 26 22:25:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27657
27658         * mpn/generic/random2.c: Fix typo, `alpha__' => `__alpha'.
27659         * mpf/random2.c: Likewise.
27660
27661 Sun Aug 25 00:07:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
27662
27663         * mpz/tests/t-mul.c: Also test squaring.
27664
27665 Fri Aug 16 05:12:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27666
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.
27670
27671 Thu Aug 15 02:34:47 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27672
27673         * gmp.h: Fix typo, `mips__' => `__mips'.
27674
27675         * mpf/set_str.c: Allow a number to start with a period, if next
27676         position contains a digit.
27677
27678 Tue Aug 13 18:41:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27679
27680         * mpz/gcdext.c: Get cofactor sign right for negative input operands.
27681         Clean up code for computing tt.
27682
27683         * mpz/invert.c: Get rid of variable `rv'.
27684
27685         * mpz/divexact.c: Test for zero divisor in special case for zero
27686         dividend.
27687
27688 Mon Aug 12 18:04:07 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27689
27690         * mpz/?div_*_ui.c: Special case for division by 0.
27691         * mpz/tdiv_q.c: Likewise.
27692
27693 Sat Aug 10 14:45:26 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27694
27695         * mpz/dmincl.c: Special case for division by 0.
27696
27697         * mpz/tdiv_*_ui.c: Delete special case for dividend being 0; handle
27698         it when computing size after mpn_divmod_1 call.
27699
27700         * mp_bpl.c: (__gmp_junk): New variable.
27701         (__gmp_0): New constant.
27702
27703         * gmp-impl.h (DIVIDE_BY_ZERO): New #define.
27704
27705 Fri Aug  9 20:03:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27706
27707         * mpz/divexact.c: Test for dividend being zero before testing
27708         for small divisors.
27709
27710 Thu Aug  8 13:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27711
27712         * configure.in: Require operating system specification for cpus
27713         where assembly syntax differs between system.
27714
27715         * Makefile.in (many targets): Change `-' action prefix to `@'.
27716
27717         * mpn/Makefile.in: (distclean): Fix typo.
27718
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.
27726
27727         * mpf/get_prc.c: Return the *highest* precision achievable.
27728
27729         * mpf/get_str.c: Complete rewrite.
27730
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.
27734         Misc cleanups.
27735
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.
27740
27741 Wed Aug  7 11:46:04 EDT 1996  Ken Weber <kweber@mcs.kent.edu>
27742
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
27747         reentrant.
27748
27749 Wed Aug  7 02:15:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27750
27751         * mpf/get_str.c: Rewrite code for converting integral part of a
27752         number with both an integral and fractional part.
27753
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.
27756
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.
27760
27761         * mpf/set_str.c: Ignore excess limbs in MP,MSIZE.
27762
27763 Thu Jul 25 04:39:10 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27764
27765         * mpn/configure.in: Fix typo in setting path, "sparc" => "sparc32".
27766
27767 Wed Jul 24 02:27:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27768
27769         * mpn/generic/gcdext.c: Reorganize and clean up.  Get rid of all
27770         signed limb arithmetic.
27771
27772 Mon Jul 22 02:39:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27773
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.
27778
27779         * mpz/gcdext.c: Fix typo in MPZ_TMP_INIT call.
27780
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.
27785
27786         * extract-dbl.c (MP_BASE_AS_DOUBLE): Don't redefine here.
27787
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.
27792
27793         * mpz/Makefile.in (.c.o): Don't pass non-portable `-f' to cp.
27794         * mpq/Makefile.in: Likewise.
27795         * mpf/Makefile.in: Likewise.
27796
27797 Sat Jul 20 01:35:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27798
27799         * mpz/getlimbn.c: Take ABS of integer->_mp_size.
27800
27801         * mpz/divexact.c: Use mpn_divmod_1 if divisor is a single limb.
27802
27803 Thu Jul 18 00:31:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27804
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.
27808
27809 Wed Jul 17 23:21:48 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27810
27811         * mpn/generic/divrem.c: In MPN_COPY_DECR call, copy dsize - 1 limbs.
27812
27813 Sun Jul 14 17:47:46 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27814
27815         * configure.in: Handle sparc9, sparc64, and ultrasparc like sparc8.
27816
27817 Thu Jul 11 14:05:54 1996  J.T. Conklin  <jtc@rtl.cygnus.com>
27818
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.
27822
27823 Sun Jul 14 15:24:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27824
27825         From Joe Keane:
27826         * mpq/equal.c: Take ABS of num1_size before passing it to mpn_cmp.
27827
27828 Fri Jul 12 17:11:17 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27829
27830         * mpn/generic/sqrtrem.c (SQRT): New asm for x86, but leave it
27831         disabled for now.
27832
27833         * mpn/generic/sqrtrem.c: Use MP_BASE_AS_DOUBLE.
27834
27835 Wed Jul 10 03:17:45 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27836
27837         * cre-mparam.c: Delete obsolete file.
27838
27839         * gmp.h: #define _LONG_LONG_LIMB if __mips && _ABIN32.
27840         * longlong.h: Test __mips instead of __mips__.
27841
27842 Sun Jul  7 23:19:13 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27843
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.
27848
27849 Mon Jul  1 01:44:30 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27850
27851         * config.guess: Update from master version; add Cray x90 handling.
27852
27853 Wed Jun 26 05:35:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27854
27855         * mpn/power/add_n.s (__mpn_add_n): Work around GAS bug.
27856         * mpn/power/sub_n.s (__mpn_sub_n): Likewise.
27857
27858         * insert-double.c: Rework loop to avoid potential overflow.
27859
27860         * mpq/get_d.c: For vax, if qsize > N_QLIMBS, ignore excess limbs.
27861
27862         * mpq/tests/t-get_d.c (SIZE): Special case for vax.
27863
27864         * gmp.h (mpX_cmp_ui): #define also when ! __GNUC__.
27865
27866 Mon Jun 24 17:13:21 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27867
27868         * longlong.h (vax sdiv_qrnnd): Fix typo.
27869
27870 Sat Jun 15 01:33:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27871
27872         * gmp.h: Support `small' and `large' type and function variants,
27873         controlled by GMP_SMALL.
27874
27875         * mpz/Makefile.in (.c.o): Compile each function twice, for small and
27876         large variant.
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.
27881
27882         * gmp.h: Prefix all functions with __gmp, to allow namespace-clean
27883         internal calls.
27884
27885         * mp.h: Rip out __MP_SMALL__ stuff.
27886         (__mpz_struct): mp_size_t => int.
27887
27888         * mpz/invert.c: #include "gmp-impl.h".
27889         Use MPZ_TMP_INIT, not mpz_init.
27890
27891         * mpz/gcdext.c: Rewrite to call mpn_gcdext.
27892
27893 Fri Jun 14 18:05:29 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27894
27895         * mpn/generic/gcdext.c (s0size): New parameter.
27896         * gmp.h (mpn_gcdext): Update prototype.
27897
27898         * mpn/generic/gcdext.c: Major rewrite.
27899
27900 Mon Jun 10 00:14:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27901
27902         * mpn/generic/dump.c: Add missing `else'.
27903
27904 Fri Jun  7 03:35:12 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27905
27906         * Makefile.in (gmp_toc.html): Pass -expandinfo to texi2html.
27907
27908 Thu Jun  6 19:00:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27909
27910         * Version 2.0.2 released.
27911
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.
27916
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).
27919
27920         * config/mt-linux (AR_FLAGS): New file.
27921         * configure.in: Use config/mt-linux for all linux systems.
27922
27923 Tue Jun  4 03:42:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27924
27925         * Version 2.0.1 released.
27926
27927         * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
27928
27929         * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
27930
27931         * insert-double.c: Don't #include stdlib.h.
27932
27933         * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
27934         Do not test __sparc__.
27935
27936         * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
27937         * mpq/equal.c: Likewise.
27938
27939         * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
27940
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.
27952
27953         * mpn/config/t-oldgas: Renamed from t-freebsd.
27954         * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
27955         configurations.
27956
27957         * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
27958         * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
27959
27960         * mpn/config/t-ppc-aix: New file.
27961         * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
27962
27963 Wed May 29 02:07:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27964
27965         * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
27966         __gmp_const.
27967
27968         * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
27969         * mpf/iset_str.c: Likewise.
27970
27971 Mon May 27 00:15:58 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27972
27973         * gmp-impl.h: Declare __gmp_extract_double.
27974
27975         * mpz/set_q.c: Delete unused variables.
27976
27977         * gmp.h (mpq_equal): Declare.
27978
27979         * mpf/eq.c: mpf_cmp2 -> mpf_eq.
27980
27981 Fri May 24 03:20:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
27982
27983         * mpz/iset_d.c: Don't include <math.h>.
27984
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.
27990
27991         * mpn/generic/scan0.c: Clarify comment.
27992
27993         * mpz/set_q.c: New file.
27994         * Makefile.in: Compile it.
27995         * make.bat: Likewise.
27996         * gmp.h: Declare mpz_set_q.
27997
27998         * insert-double.c: New file.
27999         * Makefile.in: Compile it.
28000         * make.bat: Likewise.
28001
28002         * mpz/get_d.c: New file.
28003         * mpz/Makefile.in: Compile it.
28004         * make.bat: Likewise.
28005         * gmp.h: Declare mpz_get_d.
28006
28007         * mpf/get_d.c: New file.
28008         * mpf/Makefile.in: Compile it.
28009         * make.bat: Likewise.
28010         * gmp.h: Declare mpf_get_d.
28011
28012         * make.bat: Compile things in alphabetical order.
28013
28014         * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
28015         (LIMBS_PER_DOUBLE): New #define.
28016
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.
28022
28023         * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
28024
28025 Wed May 22 02:48:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28026
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.
28031
28032         * mpn/config/t-pwr-aix: New file.
28033         * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
28034
28035 Mon May 20 16:30:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28036
28037         * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
28038
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.
28043
28044         * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
28045
28046         * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
28047
28048 Fri May 17 02:24:43 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28049
28050         * mpz/set_d.c: Call _mpz_realloc.
28051
28052         * mpq/set_z.c: New file.
28053         * mpq/Makefile.in: Compile it.
28054         * make.bat: Likewise.
28055         * gmp.h: Declare mpq_set_z.
28056
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.
28060
28061         * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
28062
28063         * mpn/configure.in: Treat ultrasparc just like sparc v8,
28064         until 64-bit compilers are ready.
28065
28066         * mpf/set_d.c: Make it work for 64-bit machines.
28067
28068 Thu May 16 20:53:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28069
28070         * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
28071         machines.
28072         * mpn/x86/gmp-mparam.h: Delete file.
28073
28074         * configure.in: Treat microsparc like sparc8.
28075
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.
28080
28081 Tue May 14 13:42:39 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
28082
28083         * mpz/set_f.c: New file.
28084         * mpz/Makefile.in: Compile it.
28085         * gmp.h: Declare mpz_set_f.
28086
28087         * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
28088
28089 Tue May 14 13:03:07 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
28090
28091         * make.bat: Add all new files.
28092
28093 Sun May 12 22:24:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28094
28095         * mpf/set_z.c: New file.
28096         * mpf/Makefile.in: Compile it.
28097         * gmp.h: Declare mpf_set_z.
28098
28099 Sat May 11 19:26:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28100
28101         * gmp.h: Declare mpf_set_q.
28102
28103         * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
28104
28105 Fri May 10 17:37:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28106
28107         * mpf/set_q.c: New file.
28108         * mpf/Makefile.in: Compile it.
28109
28110         * config.sub: Recognize sparc8.
28111
28112 Wed May  8 09:19:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28113
28114         * mpf/tests/t-dm2exp.c: New file.
28115
28116         * mpf/tests/t-add.c: Correct header comment.
28117         * mpf/tests/t-sub.c: Likewise.
28118         * mpf/tests/t-sqrt.c: Likewise.
28119
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.
28123
28124         * mpz/tests/Makefile.in (check): Depend on Makefile.
28125         * mpq/tests/Makefile.in (check): Likewise.
28126         * mpf/tests/Makefile.in (check): Likewise.
28127
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.
28131
28132         * mpf/sqrt.c: Properly detect negative input operand.
28133
28134         * mpf/sqrt_ui.c: Delete spurious header comment.
28135         * mpf/sqrt.c: Likewise.
28136         * mpz/sqrt.c: Likewise.
28137
28138         * mpz/tests/reuse.c (main): Read `reps' from command line.
28139
28140         * mpf/tests/reuse.c: New file.
28141         * mpf/tests/Makefile.in: Compile and run `reuse'.
28142
28143         * mpf/mul_ui.c: Disable code for removing low zero limbs.
28144
28145         * mpf/div.c: Fix condition for when vp and qp overlaps.
28146
28147         * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
28148
28149         * mpf/out_str.c: Don't output '\n' after exponent.
28150
28151         * mpf/add_ui.c: New special case for when U is completely cancelled.
28152
28153 Wed Apr 24 05:33:28 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28154
28155         * Version 2.0 released.
28156
28157         * All files: Update FSF's address.
28158
28159         * Makefile.in (gmp_toc.html): New name for gmp.html.
28160         (TAGS): Depend on force.
28161
28162         * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
28163
28164 Sat Apr 20 03:54:06 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28165
28166         * Makefile.in (ps): New target, depend on gmp.ps.
28167
28168 Fri Apr 19 14:03:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28169
28170         * mpf/out_str.c: Print `@' before exponent, not `e'.
28171
28172         * make.bat: Update from Makefiles.
28173
28174 Thu Apr 18 01:22:05 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28175
28176         * mpf/set_str.c: If parameter `base' is negative, expect exponent
28177         to be decimal, otherwise in the same base as the mantissa.
28178
28179 Wed Apr 17 17:28:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28180
28181         * mpf/set_dfl_prec.c: Don't return anything.
28182         * gmp.h: Corresponding changes.
28183
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.
28197         * gmp.h: Likewise.
28198
28199         * mpf/eq.c: New file, based on mpf/diff.c.
28200         * mpf/diff.c: Delete.
28201         * mpf/Makefile.in: Corresponding changes.
28202         * gmp.h: Likewise.
28203
28204         * mpf/reldiff.c: New file.
28205         * mpf/Makefile.in: Compile it.
28206         * gmp.h: Declare mpf_reldiff.
28207
28208         * mpz/iset_d.c: New file.
28209         * mpz/Makefile.in: Compile it.
28210         * gmp.h: Declare mpz_init_set_d.
28211
28212 Tue Apr 16 16:28:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28213
28214         * Makefile.in (gmp.html): Pass -acc to texi2html.
28215
28216 Mon Apr 15 16:20:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28217
28218         * mpf/set_str.c: Switch off code for defaulting the base from the
28219         leading characters.
28220
28221         * gmp.h (mp?_sign): Delete.
28222         (mp?_sgn): New macros.
28223
28224 Fri Apr 12 17:23:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28225
28226         * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
28227
28228 Wed Apr 10 22:52:02 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
28229
28230         * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
28231         * gmp.h: Corresponding change.
28232
28233         * gmp.h (mp_bits_per_limb): Make it const.
28234
28235 Sat Mar 30 01:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28236
28237         * configure.in: Re-enable recognition of with_gcc.
28238
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.
28247
28248         * Makefile.in (XCFLAGS): Default to empty.
28249         (FLAGS_TO_PASS): Pass on XCFLAGS.
28250         (.c.o): Pass XCFLAGS.
28251
28252         * config/mt-m88110 (XCFLAGS): Define instead of CC.
28253         * config/mt-sprc8-gcc (XCFLAGS): Likewise.
28254         * config/mt-supspc-gcc (XCFLAGS): Likewise.
28255
28256         * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
28257         specified.
28258
28259 Mon Mar 25 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28260
28261         * urandom.h: Test for __SVR4 in addition to __svr4__.
28262
28263         * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
28264
28265         * Makefile.in (CFLAGS): `-O2' => `-O'.
28266         * mpn/Makefile.in (CFLAGS): Likewise.
28267
28268         * gmp-impl.h: Get rid of obsolete field access macros.
28269
28270         * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
28271         cc compiler bug.
28272
28273         * gmp.h (__MPN): Make it work also for non-ANSI compilers.
28274
28275 Thu Mar 21 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28276
28277         * mpf/sub.c: New special case for ediff <= 1 before generic code.
28278         Simplify generic code for ediff == 0.
28279         Rename uexp => exp.
28280
28281 Mon Mar 11 18:24:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28282
28283         * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
28284         * mpf/tests/Makefile.in: Link ref.o to all executables.
28285
28286         * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
28287
28288 Sun Mar 10 21:03:17 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
28289
28290         * mpf/get_str.c: In digit development loop for fractions, change
28291         loop condition from `<' to `<='.
28292
28293 Thu Mar  7 04:58:11 1996  Torbjorn Granlund  <tege@tiny.matematik.su.se>
28294
28295         * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
28296
28297 Wed Mar  6 01:10:42 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28298
28299         * mpf/tests/t-sqrt.c: New file.
28300         * mpf/tests/Makefile.in: Corresponding changes.
28301
28302         * mpf/sqrt.c: Special case for square root of zero.
28303
28304         * mpq/add.c: Clean up variable names.
28305         * mpq/sub.c: Update from mpq/add.c.
28306
28307         * mpz/divexact.c: abs => ABS.
28308         * mpz/gcd.c: Likewise.  Rewrite final fixup code, to decrease
28309         allocation.  Misc cleanups.
28310
28311 Tue Mar  5 22:24:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
28312
28313         * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
28314
28315         * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
28316
28317         * mpn/configure.in: Use t-freebsd also for netbsd.
28318
28319 Mon Mar  4 15:13:28 1996  Torbjorn Granlund  <tege@matematik.su.se>
28320
28321         * mpq/Makefile.in (cmp.o): Depend on longlong.h.
28322
28323         * mpq/equal.c: New file.
28324         * mpq/Makefile.in: Corresponding changes.
28325
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.
28330
28331         * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
28332
28333 Sun Mar  3 07:45:46 1996  Torbjorn Granlund  <tege@matematik.su.se>
28334
28335         * mpf/set_str.c: In exponentiation code, allocate 3 extra
28336         limbs, not just 2.
28337
28338         * mpf/get_str.c: Allocate sufficient space for tstr.
28339         When calculating exp_in_base, round result down.
28340
28341         * mpf/tests/t-conv.c: New file.
28342         * mpf/tests/Makefile.in: Corresponding changes.
28343
28344         * mp_bpl.c: New file.
28345         * gmp.h: Declare it.
28346         * Makefile.in: Corresponding changes.
28347
28348 Sat Mar  2 06:27:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
28349
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.
28355
28356         * mpn/generic/gcdext.c: Add copyright header.
28357
28358 Fri Mar  1 01:22:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
28359
28360         * mpn/configure.in: For ppc601, search "power" before "powerpc32".
28361
28362         * mp?/Makefile.in (AR_FLAGS): New variable.
28363         (libmp?.a): Use it.
28364
28365         * make.bat: New file.
28366         * mpn/msdos: New directory.
28367         * mpn/msdos/asm-syntax.h: New file.
28368
28369         * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
28370
28371         * config.sub: Recognize [ctj]90-cray.
28372
28373         * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
28374
28375         * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
28376
28377         * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
28378         undefined behaviour.
28379
28380 Thu Feb 29 04:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
28381
28382         * Makefile.in (install-info-files): Update for new install-info
28383         behaviour.
28384
28385         * mpn/power/add_n.s: Rewrite.
28386         * mpn/power/sub_n.s: Rewrite.
28387
28388 Wed Feb 28 01:34:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
28389
28390         * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
28391         * mpz/ui_pow_ui.c: Likewise.
28392
28393         * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
28394
28395         * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
28396         * mpn/generic/gcd.c: Likewise.
28397         (SIGN_BIT): Compute differently.
28398
28399 Mon Feb 26 00:07:36 1996  Torbjorn Granlund  <tege@matematik.su.se>
28400
28401         * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
28402
28403         * Makefile.in (install, install-bsdmp, install-info-files): Depend
28404         on installdirs.  chmod all installed files.
28405
28406 Sun Feb 25 01:47:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
28407
28408         * mpbsd/configure.in: Delete debugging code.
28409
28410         * All Makefile.in: Update clean targets.
28411
28412         * Makefile.in (AR_FLAGS): New variable.
28413         (libgmp.a): Use it.
28414         (libmp.a): Likewise.
28415
28416         * VERSION: Delete file.
28417
28418         * Makefile.in (installdirs): New target.
28419         * mkinstalldirs: New file (from the texinfo package).
28420
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.
28432         (.PHONY): Assign.
28433
28434         * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
28435
28436         * mp{n,z,f,bsd}/move-if-change: Delete.
28437
28438         * mpbsd/Makefile.in (stamp-stddefh): Delete target.
28439
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.
28446         (.S.o): Likewise.
28447
28448         * memory.c: Change allocation error message.
28449
28450         * Makefile.in (install): Prefix gmp.h with $(srcdir).
28451         (install-bsdmp): Prefix mp.h with $(srcdir).
28452
28453         * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
28454
28455         * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
28456         (install targets): Install gmp.info-N.
28457
28458 Sat Feb 24 03:36:52 1996  Torbjorn Granlund  <tege@matematik.su.se>
28459
28460         * mpf/get_str.c: Fix typo.
28461
28462         * mpz/legendre.c: Clarify expression with extra parens.
28463
28464         * version.c (gmp_version): Not static.
28465
28466         * mpf/iset_str.c: Properly return error code.
28467
28468         * mpf/add.c: Delete unused variables.
28469         * mpf/inp_str.c: Likewise.
28470         * mpq/get_d.c: Likewise.
28471
28472         * mpn/generic/dump.c: #include <stdio.h>.
28473         * mpf/dump.c: Likewise.
28474         * mpf/set_str.c: #include <ctype.h>.
28475         (strtol): Declare.
28476
28477         * gmp.h: mpn_sqrt => mpn_sqrtrem.
28478
28479         * Makefile.in (clean, realclean): Clean in mpbsd.
28480         (check): Test in mpf.
28481
28482         * mpf/Makefile.in (clean): Clean in tests.
28483         * mpq/Makefile.in (clean): Clean in tests.
28484
28485         * mpf/tests/Makefile.in: New file.
28486         * mpf/tests/configure.in: New file.
28487         * mpf/tests/t-addsub.c: New file.
28488
28489         * mpf/sub_ui.c: Simply call mpf_sub for now.
28490
28491         * mpf/sub.c: Increase prec by 1.
28492         * mpf/ui_sub.c: Likewise.
28493
28494 Fri Feb 23 00:59:54 1996  Torbjorn Granlund  <tege@matematik.su.se>
28495
28496         * mpf/ui_sub.c: Fix typos.
28497
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.
28501
28502         * mpf/out_str.c: Output leading "0.".
28503         Default base to 10, before computing string allocation.
28504
28505         * mpf/get_str.c: Make variables for string size have type size_t.
28506         * gmp.h: Corresponding change.
28507
28508         * mpf/random2.c: Allow creation of prec+1 large mantissas.
28509
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.
28513
28514         * mpf/set_prec.c: Rewrite.
28515
28516         * mpf/init2.c: Compute precision as in set_prec.c.
28517
28518         * mpf/div_2exp.c: Special case for u == 0.
28519         * mpf/mul_2exp.c: Likewise.  Write r->_mp_size always.
28520
28521         * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
28522         * mpf/sqrt.c: Likewise.  When computing new exponent, round quotient
28523         towards -infinity.
28524
28525         * mpf/add.c: Fix typos.
28526         * mpf/sub.c: Fix typos.
28527
28528 Thu Feb 22 00:24:48 1996  Torbjorn Granlund  <tege@matematik.su.se>
28529
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.
28535
28536         * cre-stddefh.c: Delete.
28537
28538         * mpz/sqrt.c: Fix typo.
28539
28540         * mpz/powm.c: Special case for mod == 0.
28541         * mpz/powm_ui.c: Likewise.
28542
28543         * mpz/get_si.c: Handle -0x80000000 correctly.
28544
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.
28548
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.
28552
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.
28557
28558         * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
28559
28560         * mpf/out_str.c: Make return number of bytes written or error
28561         indication.
28562         * mpz/out_str.c: Likewise.
28563         * gmp.h: Corresponding changes.
28564
28565         * gmp.h (__mpz_struct): mp_size_t => int.
28566         (__mpq_struct): Likewise.
28567         (__mpf_struct): Likewise.
28568         (mp_size_t): int => long int.
28569
28570         * mpn/cray: New directory.
28571         * mpn/cray/gmp-mparam.h: New file.
28572         * mpn/configure.in: Recognize cray variants.
28573
28574         * Makefile.in: Set defaults for prefix, libdir, etc.
28575         (install): New target.
28576         (install-bsdmp): New target.
28577         (gmp.html): New target.
28578
28579         * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
28580
28581 Wed Feb 21 04:35:02 1996  Torbjorn Granlund  <tege@matematik.su.se>
28582
28583         * gmp.h: Sort mpn declarations.
28584         (mpn_gcdext): Add declaration.
28585
28586         * mpn/generic/divrem_1.c: New file.
28587         * mpn/Makefile.in (divrem_1.o): New rule.
28588         * configure.in (functions): Add divrem_1.
28589
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.
28594
28595         * gmp.h (mpn_next_bit_set): Delete spurious declaration.
28596
28597         * mpn/generic/divrem.c (default case): In code assigning
28598         most_significant_q_limb, move reassignment of n0 into if statement.
28599
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.
28605
28606         * mpn/Makefile.in (dump.o): Fix dependency path.
28607         (inlines.o): Likewise.
28608
28609         * mpn/configure.in: Make m68060 be the same as m68000.  Clean up
28610         m68k configs.
28611
28612 Tue Feb 20 01:35:11 1996  Torbjorn Granlund  <tege@matematik.su.se>
28613
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.
28620
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.
28625
28626         * mpn/mp_bases.c: New file.
28627         * mpn/Makefile.in: Compile mp_bases.c.
28628
28629         * mpz/set_str.c: Skip initial whitespace.
28630         * mpf/set_str.c: Likewise.
28631         * mpbsd/xtom.c: Likewise.
28632
28633         * gmp.h: Add missing mpz declarations.
28634         Delete all formal parameter names from declarations.
28635
28636         * mpn/Makefile.in: Add dependencies for .c files.
28637
28638         * Makefile.in (check): Write recursive make calls separately, not as
28639         a loop.
28640         (FLAGS_TO_PASS): New variable.  Use it for most recursive makes.
28641
28642 Mon Feb 19 01:02:20 1996  Torbjorn Granlund  <tege@matematik.su.se>
28643
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.
28647
28648         * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
28649
28650         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
28651         code.
28652         * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
28653
28654         * gmp.h: Fix typos in #defines of recently added mpn functions.
28655
28656         * mpz/inp_str.c: Skip all whitespace, not just plain space.
28657         * mpbsd/min.c: Likewise.
28658
28659         * mpn/configure.in (functions): Add gcdext.
28660         * mpn/generic/gcdext.c: New file.
28661
28662         * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
28663
28664         * gmp.h: Surround mpn declarations with extern "C" { ... }.
28665
28666         * Makefile.in (check): New target.
28667
28668         * mpq/get_d.c: Update comments.  Use rsize instead of dsize + N_QLIMBS
28669         when possible.  Add special case for nsize == 0.
28670
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.
28678
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.
28687
28688         * mpq/set_z.c: File deleted.
28689         * mpq/Makefile.in: Corresponding changes.
28690
28691 Sun Feb 18 01:34:47 1996  Torbjorn Granlund  <tege@matematik.su.se>
28692
28693         * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
28694
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.
28701
28702         * mpbsd/realloc.c: New file.
28703         * mpbsd/Makefile.in: Corresponding changes.
28704
28705         * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
28706         * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
28707
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).
28711
28712         * mpq/tests/Makefile.in (st-cmp): New file.
28713         * mpq/tests/configure.in (srcname): New file.
28714
28715         * mpz/tests/configure.in (srcname): Fix typo.
28716
28717         * mpq/cmp.c: Add check using number of significant bits, to avoid
28718         general multiplication.
28719
28720 Sat Feb 17 11:58:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
28721
28722         * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
28723
28724         * mpq/tests: New directory.
28725         * mpq/tests/t-cmp.c: New file.
28726         * mpq/tests/t-cmp_ui.c: New file.
28727
28728         * mpz/tests/dive.c (main): Generate zero numerator.
28729         (get_random_size) : Delete.
28730
28731         * mpz/divexact.c: Add special case for 0/x.
28732
28733         * gmp.h (mpz_mod): Add declaration.
28734
28735 Fri Feb 16 18:18:39 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
28736
28737         * mpn/m68k/*: Rewrite code not to use the INSN macros.
28738         (L): New macro to properly prefix local labels for ELF.
28739
28740 Fri Feb 16 00:20:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
28741
28742         * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
28743         fields.
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
28750         in AIX compilers.
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
28754         on it.
28755
28756         * Makefile.in (mpbsd/libmpbsd.a): New rule.
28757         * configure.in (configdirs): Add mpbsd.
28758
28759         * gmp.h: Add declarations for a few missing mpn functions.
28760
28761         * Makefile.in (libmp.a): New rule.
28762
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.
28770
28771         * Makefile.in: Set RANLIB_TEST.
28772         * (libgmp.a): Use it.
28773         * (libgmp.a): Do ranlib before moving the libgmp.a to the build
28774         directory.
28775         * mp?/Makefile.in: Don't use or set RANLIB.
28776
28777 Thu Feb 15 16:38:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
28778
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.
28791
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.
28796
28797         * mpz/pprime_p: Use mpz_scan1 to avoid looping.
28798
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.
28804
28805         * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
28806
28807         * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
28808
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.
28813
28814 Wed Feb 14 22:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
28815
28816         * gmp.h: Test __cplusplus in addition to __STDC__.
28817         * gmp-impl.h: Likewise.
28818
28819         * gmp.h: Surround declarations with extern "C" { ... }.
28820
28821 Tue Feb 13 15:20:45 1996  Torbjorn Granlund  <tege@matematik.su.se>
28822
28823         * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
28824         * mpz/tdiv_r_2exp.c: Likewise.
28825
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.
28831
28832         * mpz/scan0.c,scan1.c: New files.
28833         * mpz/Makefile.in: Compile them.
28834
28835         * gmp.h (mpn_normal_size): Delete.
28836
28837         * config.guess: Update from Cygnus version.
28838
28839         * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
28840         * mpn/m68k/lshift.S: Likewise.
28841
28842         * mpn/configure.in: Fix configuration for plain 68000.
28843
28844 Mon Feb 12 01:06:06 1996  Torbjorn Granlund  <tege@matematik.su.se>
28845
28846         * mpz/tests/t-powm.c: Generate negative BASE operand.
28847
28848         * mpz/powm.c: Make result always positive.
28849
28850 Sun Feb 11 01:44:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28851
28852         * mpz/tests/*.c: Add t- prefix.
28853         * mpz/tests/Makefile.in: Corresponding changes.
28854         * mpz/tests/configure.in: Update srctrigger.
28855
28856         * mpz/tests/gcd.c: Generate negative operands.
28857         * mpz/tests/gcd2.c: Likewise.
28858
28859         * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
28860
28861 Thu Feb  8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
28862
28863         * mp{z,n}/gcd.c: Change mpn_gcd interface.
28864         * gmp.h: Ditto.
28865         * gmp.texi: update documentation.
28866
28867 Mon Feb  7 23:58:43 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
28868
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
28874         .size directive.
28875         * mpn/configure.in: New target m68k-*-linux*.
28876
28877 Wed Feb  7 07:41:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28878
28879         * Makefile.in (cre-conv-tab): Workaround for SunOS make.
28880
28881         * mpz/tests/reuse.c: New file.
28882         * mpz/tests/Makefile.in: Handle reuse.c.
28883
28884 Tue Feb  6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
28885
28886         * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
28887
28888 Tue Feb  6 01:36:39 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28889
28890         * gmp.h (mpz_divexact): Delete parameter names.
28891         (mpz_lcm): Delete spurious declaration.
28892
28893         * mpz/dmincl.c: Fix typo.
28894
28895 Mon Feb  5 01:11:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28896
28897         * mpn/generic/gcd.c (gcd_2): Declare consistently.
28898
28899         * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
28900         * mpz/dmincl.c: Likewise.
28901
28902         * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
28903         * mpz/sub.c: Likewise.
28904         * mpn/generic/sqrt.c: Likewise.
28905
28906         * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
28907         destination arrays.
28908
28909 Fri Feb  2 02:21:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28910
28911         * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
28912         * mpz/Makefile.in: Compile them.
28913
28914         * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
28915
28916 Thu Feb  1 02:15:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28917
28918         Change from Ken Weber:
28919         * mpz/divexact.c: Make it work when quot is identical to either input.
28920
28921         * mpf/ui_sub.c: New file.
28922         * mpf/Makefile.in: Compile it.
28923
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.
28930
28931         * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
28932         * mpq/canonicalize.c: Likewise.
28933
28934 Wed Jan 31 01:45:00 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28935
28936         * mpn/generic/gcd.c: Misc changes from Ken.
28937
28938         * mpz/tests/gcd2.c: New file.
28939         * mpz/tests/Makefile.in: Handle gcd2.c.
28940
28941         * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
28942         not orig_vsize.  Fix parameter declaration.
28943
28944         * mpz/mod_ui.c: Delete file.
28945         * mpz/Makefile.in: Don't try to compile mod_ui.
28946
28947         * mpz/cdiv_*_ui.c): Make them work right.
28948         * gmp.h: Declare cdiv*.
28949
28950 Tue Jan 30 02:22:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28951
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.
28955
28956         * All files: Make file permissions right.
28957
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.
28970
28971 Mon Jan 29 03:53:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28972
28973         * mpz/random.c: Handle negative SIZE parameter.
28974
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.
28981
28982         * mpn/generic/divmod.c: Update from divrem.
28983         * mpn/generic/divrem.c: Misc cleanups.
28984
28985 Sun Jan 28 03:25:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
28986
28987         * All files: Use new TMP_ALLOC interface.
28988
28989         * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
28990
28991         * mpz/tests/powm_ui.c: New file.
28992         * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
28993
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
28999         to override it.
29000
29001         * mpz/Makefile.in (conf): Delete spurious target.
29002         (mp_bases.c): Delete.
29003         (cre-conv-tab rules): Delete.
29004
29005         * Makefile.in (cre-conv-tab): Greatly simplify.
29006
29007 Sat Jan 27 13:38:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29008
29009         * stack-alloc.c: New file.
29010         * stack-alloc.h: New file.
29011
29012         * gmp.h (__gmp_inline): Define using __inline__.
29013
29014 Thu Jan 25 00:28:37 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29015
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.
29019
29020         * mpn/m68k/*: #include sysdep.h.  Use C_GLOBAL_NAME.
29021
29022         * configure: Update from Cygnus version.
29023         * config.guess: Likewise.
29024         * config.sub: Likewise.
29025         * configure: Pass --nfp to recursive configures.
29026
29027         * mpz/tests/tst-*.c: Adjust SIZE and reps.
29028
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.
29032
29033         * mpz/tests/tst-powm.c: Fix thinko in checking code.
29034
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.
29038
29039         * mpn/generic/mul_n.c: Prepend `i' to internal routines.
29040         * gmp-impl.h: Add #defines using __MPN for those internal routines.
29041
29042         * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
29043
29044 Wed Jan 24 13:28:19 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29045
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.
29050
29051 Tue Jan 23 01:10:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29052
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.
29066
29067 Mon Jan 22 02:04:59 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29068
29069         * gmp.h (mpn_name): New #define.
29070
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.
29074
29075         * mpn/m88k/sub_n.s: Correctly initialize carry.
29076
29077         * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
29078
29079 Sun Jan 21 00:04:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29080
29081         * mpn/sparc64/addmul_1.s: New file.
29082         * mpn/sparc64/submul_1.s: New file.
29083         * mpn/sparc64/rshift.s: New file.
29084
29085 Sat Jan 20 00:32:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29086
29087         * mpz/iset.c: Fix typo introduced Dec 25.
29088
29089 Wed Jan 17 13:16:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29090
29091         * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
29092         * config/mt-sparcv8-gcc: Delete.
29093         * configure.in: Corresponding changes.
29094
29095 Tue Jan 16 16:31:01 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29096
29097         * gmp-impl.h: #include alloca.h when necessary.
29098
29099         * longlong.h: Test __alpha instead of __alpha__, since the former
29100         is the standard symbol.
29101
29102 Mon Jan 15 18:06:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29103
29104         * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
29105         * mpn/sparc64/lshift.s: New file.
29106
29107 Fri Dec 29 17:34:03 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29108
29109         * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
29110         * mpn/x86/pentium/sub_n.S: Likewise.
29111
29112 Thu Dec 28 03:16:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29113
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.
29118
29119 Mon Dec 25 23:22:55 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29120
29121         * All files: Prefix user-visible structure fields with _mp_.
29122
29123 Fri Dec 22 20:42:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29124
29125         * mpn/configure.in (m68k configs): Terminate path variable with
29126         plain "m68k".
29127
29128 Fri Dec 22 03:29:33 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29129
29130         * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
29131         clean things up.
29132
29133         * mpn/configure.in (m68k configs): Update #include path for new
29134         mpn directory organization.
29135
29136 Tue Dec 12 02:53:02 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29137
29138         * gmp.h: Prefix all structure field with _mp_.
29139         * gmp-impl.h: Define access macros for these fields.
29140
29141 Sun Dec 10 00:47:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29142
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.
29148
29149         * mpn/alpha/ev5/lshift.s: Fix typos.
29150
29151 Fri Dec  1 14:28:20 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29152
29153         * mpn/Makefile.in (.SUFFIXES): Define.
29154
29155 Wed Nov 29 23:11:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29156
29157         * mpn/sparc64/{add_n.s, sub_n.s}: New files.
29158
29159 Tue Nov 28 06:03:13 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29160
29161         * mpn/x86/syntax.h: Handle ELF_SYNTAX.
29162         Rename GAS_SYNTAX => BSD_SYNTAX.
29163
29164         * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
29165
29166 Mon Nov 27 01:32:12 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29167
29168         * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
29169
29170 Sun Nov 26 04:30:47 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
29171
29172         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
29173
29174         * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
29175         * mpn/sparc32/sub_n.S: Likewise.
29176
29177 Fri Nov 17 00:18:46 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29178
29179         * mpn/configure.in: Handle m68k on NextStep.
29180
29181 Thu Nov 16 02:30:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29182
29183         * mpn: Reorganize machine-specific directories.
29184         * mpn/configure.in: Corresponding changes.
29185         (sh, sh2): Handle these.
29186         (m68k targets): Create asm-syntax.h.
29187
29188 Thu Nov  9 02:20:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29189
29190         * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
29191         (____mpn_mul_n): Likewise.
29192
29193 Tue Nov  7 03:25:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29194
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.
29198
29199 Fri Nov  3 02:35:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29200
29201         * mpf/Makefile.in: Make sure all objects are listed in dependency list;
29202         delete spurious entries.
29203
29204         * mpf/mul.c: Handle U or V being 0.  Allow prec+1 for result precision.
29205
29206         * mpf/set_prec.c: New computation of limb precision.
29207         * mpf/set_dfl_prec.c: Likewise.
29208
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.
29212
29213 Thu Nov  2 16:25:07 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29214
29215         * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
29216         never read.
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].
29219
29220 Wed Nov  1 02:59:53 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29221
29222         * mpn/sparc/[lr]shift.S: New files.
29223
29224 Tue Oct 31 00:08:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29225
29226         * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
29227
29228         * gmp-impl.h (assert): Delete definition.
29229
29230         * mpf/sub.c: Delete all assert calls.  Delete variable `cy'.
29231
29232         * mpf/neg.c: Use prec+1 as precision.  Optimize for when arguments
29233         are the same.
29234         * mpf/abs.c: Likewise.
29235         * mpf/{set,neg,abs}.c: Make structure and variable names similar.
29236
29237 Mon Oct 30 12:45:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29238
29239         * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
29240         * mpn/generic/random2.c (random): Likewise.
29241
29242 Sun Oct 29 01:54:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29243
29244         * mpf/div.c: Special handle U or V being 0.
29245
29246         * mpf/random2.c: New file.
29247
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.
29254
29255 Sat Oct 28 19:09:15 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29256
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.
29260
29261 Thu Oct 26 00:02:56 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29262
29263         * gmp.h: #undef __need_size_t.
29264         * mp.h: Update from gmp.h.
29265
29266 Wed Oct 25 00:17:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29267
29268         * mpf/Makefile.in: Compile set_prec.c.
29269         * mpf/realloc.c: Delete this file.
29270         * mpf/Makefile.in: Delete mentions of realloc.c.
29271
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.
29277
29278         * mpf/iset_str.c: New file.
29279
29280         * mpn/configure.in: Handle pyramid.
29281
29282         * mpf/set.c: Use prec+1 as precision.
29283
29284         * mpf/set_prec.c: New file.
29285
29286 Tue Oct 24 00:56:41 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29287
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.
29292
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.
29302
29303 Sun Oct 22 03:02:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29304
29305         * cre-conv-tab.c: #include math.h; don't declare log and floor.
29306
29307 Sat Oct 21 23:04:10 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29308
29309         * mpf/mul_ui.c: Handle U being 0.
29310
29311 Wed Oct 18 19:39:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29312
29313         * mpn/generic/set_str.c: Correctly handle input like "000000000000".
29314         Misc cleanups.
29315
29316 Tue Oct 17 15:14:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29317
29318         * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
29319         appropriate.
29320
29321 Mon Oct 16 19:14:43 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29322
29323         * mpf/add.c: Rewrite.
29324         * mpf/set_str.c: New file.  Needs more work.
29325
29326 Sat Oct 14 00:14:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29327
29328         * mpf/div_2exp.c: Vastly simplify.
29329         * mpf/mul_2exp.c: Likewise.
29330
29331         * mpf/sub.c: Rewrite.
29332
29333         * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
29334
29335         * mpf/dump.c: Free allocated memory.
29336
29337         * gmp-impl.h (assert): Define.
29338
29339 Wed Oct 11 13:31:00 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29340
29341         * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
29342
29343 Tue Oct 10 00:37:21 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29344
29345         * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
29346
29347         * mpn/powerpc32/{lshift.s,rshift.s}: New files.
29348
29349         * configure.in: Fix typo.
29350
29351 Sat Oct  7 08:17:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29352
29353         * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
29354
29355 Wed Oct  4 16:31:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29356
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.
29361
29362 Tue Oct  3 15:06:45 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29363
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.
29367
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.
29370
29371 Mon Oct  2 11:40:18 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29372
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
29376
29377 Sun Oct  1 00:17:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29378
29379         * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
29380         * mpn/mc88100/sub_n.s: Likewise.
29381
29382         * config/mt-m88110: New file.
29383         * configure.in: Use it.
29384
29385         * mpn/mc88110/mul_1.s: Fix thinko.
29386
29387 Sat Sep 30 21:28:19 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29388
29389         * mpz/set_d.c: Declare `size' at function start.
29390
29391         * experimental: New directory for mpx and mpz2.
29392
29393         * mpz/tdiv_q.c: Clarify comments.
29394         * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
29395
29396         * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
29397
29398         * mpn/sh/{add_n.s,sub_n.s}: New files.
29399
29400         * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
29401
29402         * mpn/i960/{add_n.s,sub_n.s}: New files.
29403
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.
29408
29409 Thu Sep 28 02:48:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29410
29411         * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
29412         _LONG_LONG_LIMB is defined.
29413
29414         * longlong.h (m88110): Test __m88110__, not __mc88110__
29415
29416         * mpn/mc88110/mul_1.s: Rewrite.
29417
29418 Tue Sep 26 23:29:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29419
29420         * config.sub: Update from current Cygnus version.
29421
29422         * mpn/configure.in: Recognize canonical m88*, not mc88*.
29423
29424 Fri Sep 22 14:58:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29425
29426         * mpz/set_d.c: New file.
29427         * mpz/Makefile.in: Build new files.
29428
29429         * mpq/get_d.c: Replace usage of scalbn with ldexp.
29430
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.
29434
29435 Thu Sep 21 00:56:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29436
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.
29441
29442 Wed Sep 20 15:36:23 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29443
29444         * mpn/generic/divmod_1.c: Handle
29445         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
29446         specifically also when normalization_steps != 0.
29447
29448 Mon Sep 18 15:42:30 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29449
29450         * mpq/get_d.c: New file.
29451
29452 Sun Sep 17 02:04:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29453
29454         * longlong.h (pyr): Botch up for now.
29455
29456 Sat Sep 16 00:11:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29457
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*-*-*.
29462
29463         * mpn/configure.in: Recognize rs6000-*-*.
29464
29465 Fri Sep 15 00:41:34 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29466
29467         * mpn/alpha/add_n.s: New file.
29468         * mpn/alpha/sub_n.s: New file.
29469
29470         * mpn/mips3: New name for mpn/r4000.
29471         * mpn/mips2: New name for mpn/r3000.
29472         * mpn/configure.in: Corresponding changes.
29473
29474         * mpn/generic/perfsqr.c (primes): Delete.
29475         (residue_map): Delete.
29476
29477 Thu Sep 14 00:07:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29478
29479         * mpn/r3000/sub_n.s: Fix typo.
29480
29481         * dm_trunc.c: Delete spurious file.
29482
29483         * mpz/out_binary.c: Fix typo.
29484
29485         * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
29486
29487         * gmp-impl.h: For sparc and sgi, include alloca.h.
29488
29489         * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'.  Replace
29490         `ldk r,#0' with `xor r,r'.
29491
29492 Wed Sep  6 00:58:38 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29493
29494         * mpz/inp_binary.c: New file.
29495         * mpz/out_binary.c: New file.
29496         * mpz/Makefile.in: Build new files.
29497
29498 Tue Sep  5 22:53:51 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29499
29500         * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
29501         and size fields.
29502
29503 Sat Sep  2 17:47:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29504
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.
29508
29509 Fri Sep  1 05:35:52 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29510
29511         * mpn/r3000/mul_1.s: Fix typo.
29512
29513         * mpn/powerpc32: Fix some old vs new mnemonic issues.
29514
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.
29517
29518 Wed Aug 30 10:43:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29519
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.
29522
29523         * config.guess: Update to latest FSF revision.
29524
29525 Mon Aug 28 02:18:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29526
29527         * mpz/out_str.c: Cast str to char * in fputs call.
29528
29529         * gmp-impl.h: Define UQItype, SItype, and USItype also
29530         when not __GNUC__.
29531
29532 Fri Aug 25 01:45:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29533
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.
29537
29538 Sun Aug 13 19:20:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
29539
29540         * mpn/generic/random2.c: Test __hpux, not hpux.
29541
29542 Sat Apr 15 20:50:33 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29543
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.
29550
29551 Thu Apr 13 23:15:03 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29552
29553         * mpn/configure.in: Don't search power subdir for generic ppc configs.
29554         Add some ppc cpu-specific configs.  Misc clean up.
29555
29556 Mon Apr 10 00:16:35 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29557
29558         * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
29559
29560 Sun Apr  9 12:38:11 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29561
29562         * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
29563         not in asm.
29564
29565         * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
29566
29567 Tue Mar 28 00:19:52 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29568
29569         * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
29570
29571 Fri Mar 17 23:29:22 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29572
29573         * longlong.h (SH umul_ppmm): Define.
29574
29575 Thu Mar 16 16:40:44 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29576
29577         * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
29578         to help CSE.
29579
29580 Fri Mar 10 20:03:49 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29581
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.
29586
29587 Fri Feb 17 22:44:45 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29588
29589         * mpn/configure.in: Set target_makefile_frag for freebsd
29590         in new case stmt.
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.
29595
29596 Tue Feb  7 16:27:50 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29597
29598         * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
29599
29600 Tue Jan 24 04:23:20 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
29601
29602         * longlong.h (default umul_ppmm): Store input parameters in temporaries
29603         to avoid reading them twice.
29604         (default smul_ppmm): New definition.
29605
29606 Thu Dec 29 04:20:07 1994  Jim Meyering  (meyering@comco.com)
29607
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.
29612
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.
29616
29617 Wed Dec 28 13:31:40 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29618
29619         * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
29620
29621 Mon Dec 26 17:15:36 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29622
29623         * longlong.h: Test for more symbols, in __mc68000__ case.
29624
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.
29628
29629 Mon Dec 19 01:56:30 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29630
29631         * config.sub: Recognize pentium as a valid CPU.
29632         * mpn/configure.in: Handle pentium specifically, to use new assembly
29633         code.
29634
29635 Mon Dec 19 00:13:01 1994  Jim Meyering  (meyering@comco.com)
29636
29637         * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
29638         is defined.
29639         * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
29640
29641 Mon Dec 19 00:04:54 1994  Kent Boortz  (boortz@sics.se)
29642
29643         * Makefile.in (recursive makes): Pass CFLAGS.
29644
29645 Sun Dec 18 22:34:49 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29646
29647         * mpn/pentium: New directory.
29648
29649         * mpz/pprime.c: Make sure to mpz_clear all temporaries.
29650
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.
29655
29656 Mon Dec 12 22:22:10 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29657
29658         * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
29659         #include sysdep.h before asm-syntax.h.
29660
29661         * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
29662         * mpn/i386/asm-syntax.h: Likewise.
29663
29664         * mpn/mc68020/asm-syntax.h: New name for asm.h.
29665         * mpn/i386/asm-syntax.h: New name for asm.h.
29666
29667 Tue Dec  6 21:55:25 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29668
29669         * mpz/array_init.c: Fix typo in declaration.
29670
29671 Fri Nov 18 19:50:52 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29672
29673         * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
29674
29675 Mon Nov 14 00:34:12 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29676
29677         * mpn/generic/random2.c (random): Test for __svr4__.
29678
29679 Wed Oct 12 23:28:16 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29680
29681         * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
29682
29683 Tue Aug 23 17:16:35 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29684
29685         * mpz/perfsqr.c: Use mpn_perfect_square_p.
29686         * mpn/generic/perfsqr.c: New file.
29687
29688 Wed Jul  6 13:46:51 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29689
29690         * mpz/array_init.c: New file.
29691         * mpz/Makefile.in: Compile array_init.
29692         * gmp.h: Declare mpz_array_init.
29693
29694 Mon Jul  4 01:10:03 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29695
29696         * mpz/add.c: Fix bogus comment.
29697         * mpz/sub.c: Likewise.
29698
29699 Sat Jul  2 02:14:56 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29700
29701         * mpn/generic/pre_mod_1.c: New file.
29702         * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
29703
29704 Fri Jul 01 22:10:19 1994  Richard Earnshaw (rwe11@cl.cam.ac.uk)
29705
29706         * longlong.h (arm umul_ppmm): Fix typos in last change.  Mark
29707         hard-coded registers with "%|"
29708
29709 Thu Jun 30 03:59:33 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29710
29711         * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
29712         Use __mpn_mod_1.
29713         * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
29714
29715 Wed Jun 29 18:45:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29716
29717         * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
29718
29719         * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
29720
29721         * gmp.h: Use "defined (__STDC__)" consistently.
29722
29723 Tue Jun 28 18:44:58 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29724
29725         * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
29726
29727         * mpz/tests/Makefile.in: Use CFLAGS for linking.
29728
29729         * Makefile.in (CFLAGS): Use -O2 here.
29730         * mpn/Makefile (CFLAGS): Not here.
29731
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.
29736
29737 Mon Jun 27 16:10:27 1994  Torbjorn Granlund  (tege@rtl.cygnus.com)
29738
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.
29743
29744 Tue Jun 14 02:17:43 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
29745
29746         * mpn/i386/asm.h (ALIGN): Make it take a parameter.
29747         * mpn/i386/*.S: Use ALIGN to align all loops.
29748
29749         * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
29750         (Makes old versions of GAS happy.)
29751
29752 Sat May 28 01:43:54 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29753
29754         * Many files: Delete unused variables and labels.
29755         * mpn/generic/dump.c: cast printf width argument to int.
29756
29757 Wed May 25 00:42:37 1994  Torbjorn Granlund  (tege@thepub.cygnus.com)
29758
29759         * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
29760         (xmod): Ignore return value of __mpn_divmod.
29761         (xmod): Improve normalization code.
29762
29763 Sat May 21 01:30:09 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29764
29765         * mpz/gcdext.c: Cosmetic changes.
29766
29767         * mpz/fdiv_ui.c: New file.
29768
29769 Fri May 20 00:24:53 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29770
29771         * mpz/tests/Makefile.in: Use explicit rules for running tests,
29772         not a shell loop.
29773         (clean): Delete stmp-*.
29774
29775         * mpz/Makefile.in: Update.
29776
29777         * mpz/div_ui.c: Don't include longlong.h.
29778         * mpz/dm_ui.c: Likewise.
29779
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.
29786
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.
29791
29792         * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
29793         instead.
29794         (clean): Delete tmp-*.
29795
29796 Thu May 19 01:37:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29797
29798         * mpz/cmp.c: Call __mpn_cmp.
29799
29800         * mpz/popcount.c: Fix typo.
29801
29802         * mpz/powm_ui.c: Simplify main loop.  Keep principal operand size
29803         smaller than MSIZE when possible.
29804         * mpz/powm.c: Likewise.
29805
29806         * mpn/generic/sqrt.c: Move alloca calls into where the memory is
29807         needed.  Simplify.
29808
29809         * gmp.h: (_PROTO): New macro.
29810         Add many function declarations; use _PROTO macro in all declarations.
29811
29812         * mpf/*.c: Prepend mpn calls with __.
29813
29814 Wed May 18 20:57:06 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29815
29816         * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
29817         functions.
29818
29819         * mpf/div_ui.c: Simplify.
29820
29821 Tue May 17 01:05:14 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29822
29823         * mpz/*.c: Prepend mpn calls with __.
29824
29825         * mpz/mul_ui.c: Use mpn_mul_1.
29826
29827 Mon May 16 17:19:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29828
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:
29831         Nuke use of LAB.
29832
29833 Sat May 14 14:21:02 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29834
29835         * gmp-impl.h: Don't define abort here.
29836
29837         * mpz/pow_ui.c: Increase temporary allocation.
29838         * mpz/ui_pow_ui.c: Likewise.
29839
29840         * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
29841
29842         * All Makefile.in: Delete spurious -I arguments.
29843         Update dependencies.
29844
29845         * mpz/popcount.c: New file.
29846         * mpz/hamdist.c: New file.
29847
29848         * All configure: Latest version from Cygnus.
29849
29850         * mpq/Makefile.in: New file.
29851         * mpq/configure.in: New file.
29852         * Makefile.in, configure.in: Enable compilation of mpq.
29853
29854         * mpq/set_z.c: Fix typos.
29855         * mpq/canonicalize.c: Fix typos.
29856         * mpq/cmp_ui.c: Fix typos.
29857
29858         * mpf/add_ui.c: Read U->D into UP always.  Delete spurious MPN_COPY.
29859         * mpf/sub_ui.c: Likewise.
29860
29861         * gmp-impl.h: Don't redefine alloca.
29862
29863         * COPYING.LIB: Renamed from COPYING.
29864
29865 Wed May 11 01:45:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
29866
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.
29870
29871         * mpz/ui_pow_ui.c: New file.
29872         * mpz/Makefile.in: Update.
29873
29874         * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
29875
29876         * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
29877         * mpz/gcd.c: Declare mpn_xmod.
29878
29879         * mpz/powm.c: Major changes to accommodate changed mpn semantics.
29880         * mpz/powm_ui.c: Update from mpz/powm.c.
29881
29882         * mpz/tests/tst-io.c: New file.
29883         * mpz/tests/tst-logic: New file.
29884         * mpz/tests/Makefile.in: Update.
29885
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.
29888
29889         * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
29890         * mpz/and.c, mpz/ior.c: Likewise.  Simplify somewhat.
29891
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.
29896
29897 Tue Aug 10 19:41:16 1993  Torbjorn Granlund  (tege@prudens.matematik.su.se)
29898
29899         * mpf: New directory.
29900         * mpf/*.c: Merge basic set of mpf functions.
29901
29902         * Many logs missing...
29903
29904 Sun Apr 25 18:40:26 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
29905
29906         * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
29907         * bsd/xtom.c: Likewise.
29908
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
29911         convention.
29912         * mpz/powm.c: `carry_digit' => `carry_limb'.
29913         * bsd/sdiv.c: Clearify comment.
29914
29915 Sun Apr 25 00:31:28 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
29916
29917         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
29918
29919 Sat Apr 24 16:23:33 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
29920
29921         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
29922
29923         * gmp-impl.h: #define ABS.
29924         * (Many files): Use ABS instead of abs.
29925
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.
29928
29929         * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
29930         non-32-bit machines.
29931
29932 Tue Apr 20 13:13:58 1993  Torbjorn Granlund  (tege@du.nada.kth.se)
29933
29934         * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
29935         rounding them down to fit.
29936
29937         * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
29938
29939         * mpz/inp_str.c (char_ok_for_base): New function.
29940         (mpz_inp_str): Use it.
29941
29942 Sun Mar 28 21:54:06 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
29943
29944         * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
29945
29946 Mon Mar 15 11:44:06 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
29947
29948         * mpz/pprime.c: Declare param `const'.
29949         * gmp.h: Add declarations for mpz_com.
29950
29951 Thu Feb 18 14:10:34 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
29952
29953         * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
29954
29955 Fri Feb 12 20:27:34 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
29956
29957         * mpz/inp_str.c: Recog minus sign as first character.
29958
29959 Wed Feb  3 01:36:02 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
29960
29961         * mpz/iset.c: Handle 0 size.
29962
29963 Tue Feb  2 13:03:33 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
29964
29965         * mpz/mod_ui.c: Initialize dividend_size before it's used.
29966
29967 Mon Jan  4 09:11:15 1993  Torbjorn Granlund  (tege@sics.se)
29968
29969         * bsd/itom.c: Declare param explicitly 'signed'.
29970         * bsd/sdiv.c: Likewise.
29971
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.
29975
29976 Sun Nov 29 01:16:11 1992  Torbjorn Granlund  (tege@sics.se)
29977
29978         * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
29979         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
29980         specifically.
29981
29982         * Reorganize sources.  New directories mpn, mpn/MACH, mpn/generic,
29983         mpz, mpq, bsd.  Use full file name for change logs hereafter.
29984
29985 Wed Oct 28 17:40:04 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
29986
29987         * longlong.h (__hppa umul_ppmm): Fix typos.
29988         (__hppa sub_ddmmss): Swap input arguments.
29989
29990         * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
29991         initializator.
29992
29993 Sun Oct 25 20:30:06 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
29994
29995         * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
29996         specifically (used to consider all negative numbers prime).
29997
29998         * mpz_powm_ui: `carry_digit' => `carry_limb'.
29999
30000         * sdiv: Handle zero dividend specifically.  Replace most code in
30001         this function with a call to mpn_divmod_1.
30002
30003 Fri Sep 11 22:15:55 1992  Torbjorn Granlund  (tege@tarrega.sics.se)
30004
30005         * mpq_clear: Don't free the MP_RAT!
30006
30007         * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
30008
30009 Thu Sep  3 01:47:07 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
30010
30011         * All files: Remove leading _ from mpn function names.
30012
30013 Wed Sep  2 22:21:16 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
30014
30015         Fix from Jan-Hein Buhrman:
30016         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
30017
30018         * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
30019         life.
30020
30021 Sun Aug 30 18:37:15 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
30022
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.
30025
30026 Wed Mar  4 17:56:56 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30027
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.
30031
30032 Tue Feb 18 14:38:39 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30033
30034         longlong.h (hppa umul_ppmm): Add missing semicolon.  Declare type
30035         of __w1 and __w0.
30036
30037 Fri Feb 14 21:33:21 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30038
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.
30042
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.
30046
30047 Tue Feb 11 17:20:12 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30048
30049         * mpn_mul: Enhance base case by handling small multiplicands.
30050         * mpn_dm_1.c: Revert last change.
30051
30052 Mon Feb 10 11:55:15 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30053
30054         * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
30055
30056 Fri Feb  7 16:26:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30057
30058         * mpn_mul: Replace code for base case.
30059
30060 Thu Feb  6 15:10:42 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30061
30062         * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
30063         pre-inverting divisor.
30064
30065 Sun Feb  2 11:10:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30066
30067         * longlong.h: Make __LLDEBUG__ work differently.
30068         (_IBMR2): Reinsert old code.
30069
30070 Sat Feb  1 16:43:00 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30071
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.
30075
30076 Fri Jan 31 15:09:13 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30077
30078         * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
30079         * longlong.h (#ifdef __hppa): Define umul_ppmm.
30080
30081 Wed Jan 29 16:41:36 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30082
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.
30087
30088 Tue Jan 28 11:18:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30089
30090         * _mpz_get_str: Fix typo in comment.
30091
30092 Mon Jan 27 09:44:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30093
30094         * Makefile.in: Add new files.
30095
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.
30099
30100         * mpn_mod_1.c: New file with function _mpn_mod_1.
30101         * mpz_mod_ui: Use _mpn_mod_1.
30102
30103 Thu Jan 23 18:54:09 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30104
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.
30108
30109 Wed Jan 22 12:02:26 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30110
30111         * mpz_pprime.c: Use "" for #include.
30112
30113 Sun Jan 19 13:36:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30114
30115         * mpn_rshiftci.c (header): Correct comment.
30116
30117 Wed Jan 15 18:56:04 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30118
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.)
30122
30123 Tue Jan 14 21:28:48 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30124
30125         * mpz_powm_ui: Fix comment.
30126         * mpz_powm: Likewise.
30127
30128 Mon Jan 13 18:16:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30129
30130         * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
30131
30132 Sun Jan 12 13:54:28 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30133
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.
30138
30139 Tue Jan  7 17:50:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
30140
30141         * gmp.h, mp.h: Remove parameter names from prototypes.
30142
30143 Sun Dec 15 00:09:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30144
30145         * tests/Makefile.in: Prepend "./" to file names when executing
30146         tests.
30147
30148         * Makefile.in: Fix many problems.
30149
30150 Sat Dec 14 01:00:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30151
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.
30157
30158         * Makefile.in, configure, configure.subr: New files
30159         (from bothner@cygnus.com).
30160         * dist-Makefile: Delete.
30161
30162         * mpz_fac_ui: Fix comment.
30163
30164         * mpz_random2: Rewrite a bit to make it possible for the most
30165         significant limb to be == 1.
30166
30167         * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
30168
30169 Fri Dec 13 23:10:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30170
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.
30174
30175 Fri Dec 13 12:52:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30176
30177         * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
30178
30179 Thu Dec 12 22:17:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30180
30181         * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
30182         variables to mp_size.
30183
30184 Wed Dec 11 22:00:34 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30185
30186         * mpn_rshift.c: Fix header comments.
30187
30188 Mon Dec  9 17:46:10 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30189
30190         Released 1.2.
30191
30192         * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
30193
30194         * dist-Makefile: Add missing dependency for cre-mparam.
30195
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.
30198
30199         * dist-Makefile (clean): clean in tests subdir too.
30200         * tests/Makefile: Define default values for ROOT and SUB.
30201
30202         * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
30203         2 constraint.
30204
30205 Mon Nov 11 00:06:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30206
30207         * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
30208
30209 Sat Nov  9 23:47:38 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30210
30211         Released 1.1.94.
30212
30213         * dist-Makefile, Makefile, tests/Makefile: Merge tests into
30214         distribution.
30215
30216 Fri Nov  8 22:57:19 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30217
30218         * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
30219
30220 Thu Nov  7 22:06:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30221
30222         * longlong.h: Cosmetic changes to keep it identical to gcc2 version
30223         of longlong.h.
30224         * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
30225         sub_ddmmss.
30226
30227 Mon Nov  4 00:36:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30228
30229         * mpn_mul: Fix indentation.
30230
30231         * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
30232         4294967296.0).
30233         * mpz_do_sqrt: Handle overflow in conversion from double returned
30234         by SQRT to mp_limb.
30235
30236         * gmp.h: Add missing function definitions.
30237
30238 Sun Nov  3 18:25:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30239
30240         * mpz_pow_ui: Change type of `i' to int.
30241
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.
30250 Stack overflow.
30251
30252         * mpz_pow_ui.c: Fix typo in comment.
30253
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
30257         in mpz_powm_ui.c.
30258
30259         * mpz_fac_ui.c: New file.
30260         * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
30261
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.
30265
30266 Tue Oct 29 13:56:55 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30267
30268         * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
30269         header text.
30270
30271 Mon Oct 28 00:35:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30272
30273         * mpz_random2: Handle size == 0.
30274
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
30278         definition.
30279         * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
30280         Use chars_per_bit_exactly.
30281
30282         * mpz_random2: Change the loop termination condition in order to
30283         get a large most significant limb with higher probability.
30284
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.
30288
30289         * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
30290         power of 2, giving exact result.
30291
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.
30300
30301 Sun Oct 27 19:57:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30302
30303         * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
30304         when usize > 1.5 vsize.
30305
30306         * mpn_mul: Break between classical and Karatsuba's algorithm at
30307         KARATSUBA_THRESHOLD, if defined.  Default to 8.
30308
30309         * mpn_div: Kludge to fix stray memory read.
30310
30311 Sat Oct 26 20:06:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30312
30313         * mpz_gcdext: Handle a = b = 0.  Remove memory leakage by calling
30314         mpz_clear for all temporary variables.
30315
30316         * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
30317         function's argument constraints.  Compute wsize correctly.
30318
30319         * mpz_gcd: Fix typo in comment.
30320
30321         * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
30322         abort if allocation fails, don't just exit.
30323
30324 Fri Oct 25 22:17:20 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30325
30326         * mpz_random2.c: New file.
30327
30328 Thu Oct 17 18:06:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30329
30330         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
30331         * mpq_cmp: Take sign into account, don't just compare the
30332         magnitudes.
30333         * mpq_cmp: Call _mpn_mul in the right way, with the first argument
30334         not smaller than the second.
30335
30336 Wed Oct 16 19:27:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30337
30338         * mpz_random: Ensure the result is normalized.
30339
30340 Tue Oct 15 14:55:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30341
30342         * mpz_clrbit: Support non-ANSI compilers.
30343
30344 Wed Oct  9 18:03:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30345
30346         * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
30347
30348 Tue Oct  8 17:42:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30349
30350         * mpz_mdm_ui: Add comments.
30351
30352         * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
30353         * mpz_init_ui: Change spacing and header comment.
30354
30355 Thu Oct  3 18:36:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30356
30357         * dist-Makefile: Prepend `./' before some filenames.
30358
30359 Sun Sep 29 14:02:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30360
30361         Released 1.1 (public).
30362
30363         * mpz_com: New name of mpz_not.
30364         * dist-Makefile: Change mpz_not to mpz_com.
30365
30366 Tue Sep 24 12:44:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30367
30368         * longlong.h: Fix header comment.
30369
30370 Mon Sep  9 15:16:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30371
30372         Released 1.0.92.
30373
30374         * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
30375         case.
30376
30377         * longlong.h (m68000 umul_ppmm): Clobber one register less by
30378         slightly rearranging the code.
30379
30380 Sun Sep  1 18:53:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30381
30382         * dist-Makefile (stamp-stddefh): Fix typo.
30383
30384 Sat Aug 31 20:41:31 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30385
30386         Released 1.0.91.
30387
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.
30391
30392 Fri Aug 30 08:32:56 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30393
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
30396           NULL.
30397
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.
30400
30401         * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
30402
30403 Wed Aug 28 00:45:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30404
30405         * dist-Makefile (documentation): Go via tmp.texi to avoid the
30406           creation of gmp.dvi if any errors occur.  Make tex read input
30407           from /dev/null.
30408
30409 Fri Aug 23 15:58:52 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30410
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.
30416
30417 Thu Aug 22 00:28:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30418
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.
30425
30426 Wed Aug 21 15:45:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30427
30428         * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
30429           nops.  (Saves two insn.)
30430
30431         * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
30432           branch, and to permit input/output register overlap.
30433
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.
30438
30439 Tue Aug 20 17:57:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30440
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.
30444
30445 Mon Aug 19 00:37:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30446
30447         * cre-conv-tab.c (main): Output table in hex.  Output 4 fields, not
30448           3, for components 0 and 1.
30449
30450         * gmp.h: Add declaration of mpq_neg.
30451
30452         Released 1.0beta.13.
30453
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
30457           Beuning).
30458
30459         Released 1.0beta.12.
30460
30461         * mpz_mod_ui: Remove references to quot.  Remove quot_ptr, quot_size
30462           declarations and assignment code.
30463
30464 Sun Aug 18 14:44:26 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30465
30466         * mpz_mod_ui: Handle dividend < 0.
30467
30468         Released 1.0beta.11.
30469
30470         * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
30471           general structure, variable names, etc.
30472
30473         * sdiv: Un-normalize the remainder in n1 before it is negated.
30474
30475         * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
30476           udiv_qrnnd.
30477
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
30480           by Brian Beuning.)
30481
30482         * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
30483           (Bug found by Brian Beuning.)
30484
30485         * mpz_mod_ui: Replace "digit" by "limb".
30486
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.
30490
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
30498           constraints.)
30499
30500 Fri Aug 16 13:47:12 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30501
30502         Released 1.0beta.10.
30503
30504         * longlong.h (IBMR2): Add udiv_qrnnd.
30505
30506         * mpz_perfsqr: Remove unused variables.
30507
30508         * mpz_and (case for different signs): Initialize loop variable i!
30509
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.
30513
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.
30517
30518 Wed Aug 14 18:06:48 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30519
30520         * longlong.h: Add ARM, i860 support.
30521
30522         * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
30523
30524 Tue Aug 13 21:57:43 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30525
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'.
30530
30531 Mon Aug 12 17:11:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30532
30533         * cre-conv-tab.c (main): Use %lu in printf for long ints.
30534
30535         * dist-Makefile: Fix cre-* dependencies.
30536
30537         * cre-conv-tab.c (main): Output field big_base_inverted.
30538
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).
30542
30543         * mp.h, gmp.h: Change names of macros for avoiding multiple
30544           includes.
30545
30546 Fri Aug  9 18:01:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30547
30548         * _mpz_get_str: Only shift limb array if normalization_steps != 0
30549           (optimization).
30550
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
30556           on the CPU name.
30557         * longlong.h: Hack comments.
30558
30559 Thu Aug  8 14:13:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30560
30561         Released 1.0beta.9.
30562
30563         * longlong.h: Define BITS_PER_LONG to 32 if it's not already
30564           defined.
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.
30568
30569         * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
30570
30571         * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
30572           even for plain mc68000.
30573
30574         * mpq_div: Flip the sign of the numerator *and* denominator of the
30575           result if the intermediate denominator is negative.
30576
30577         * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
30578
30579         * mpz_and.c: Compute the result size more conservatively.
30580         * mpz_ior.c: Likewise.
30581
30582         * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
30583
30584         * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
30585           BSDMP_SRCS.
30586
30587         * dist-Makefile: Create mult.c from mpz_mul.c.
30588         * mult.c: Delete this file.
30589
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).
30592
30593 Sun Aug  4 16:54:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30594
30595         * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
30596           work with VPATH and GNU MP.
30597
30598         * mpz_gcd: Don't call mpz_set; inline its functionality.
30599
30600         * mpq_mul, mpq_div: Fix several serious typos.
30601
30602         * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
30603           zero.
30604
30605         * mpq_neg.c: New file.
30606
30607         * dist-Makefile: Remove obsolete dependencies.
30608
30609         * mpz_sub: Fix typo.
30610
30611         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
30612         * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
30613           is just 1.
30614         * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
30615
30616 Sat Aug  3 23:45:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30617
30618         * longlong.h: Clean up comments.
30619         * longlong.h: #undef internal macros.
30620
30621 Fri Aug  2 18:29:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30622
30623         * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
30624         * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
30625
30626         * mpz_dmincl.c: Normalize the remainder before shifting it back.
30627
30628         * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
30629
30630         * mpn_div.c: Fix comment.
30631
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.
30634
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.
30637           respectively.
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.
30642
30643 Tue Jul 16 15:19:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30644
30645         * mpq_get_den: No need for absolute value of the size, the
30646           denominator is always positive.
30647
30648         * mpz_get_ui: If the operand is zero, return zero.  Don't read the
30649           limb array!
30650
30651         * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
30652           is the size of the remainder.
30653
30654 Mon Jul 15 11:08:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30655
30656         * Several files: Remove unused variables and functions.
30657
30658         * gmp-impl.h: Declare _mpz_impl_sqrt.
30659
30660         * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
30661           UDIV_NEEDS_NORMALIZATION.  (Fix from Brian Beuning.)
30662
30663         * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
30664
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.
30669
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.
30673
30674         * mpz_gcdext: Loop in d1.size (not b->size).  (Fix from Brian
30675           Beuning.)
30676
30677         * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call.  (Fix from
30678           Brian Beuning.)
30679
30680 Fri Jul 12 17:10:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30681
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:
30684           New files.
30685
30686         * mpz_dmincl.c: Remove second re-allocation of rem->d.  It
30687           was never executed.
30688
30689         * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
30690           some unixes' test doesn't have the -r option).
30691
30692         * *.*: Cast allocated pointers to the appropriate type (makes old C
30693           compilers happier).
30694
30695         * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
30696           after conversion to double.  (Kludge for broken C compilers.)
30697
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
30700           exist.
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".
30705
30706 Thu Jul 11 10:08:21 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30707
30708         * min: Do ungetc of last read character.
30709         * min.c: include stdio.h.
30710
30711         * dist-Makefile: Go via tmp- files for cre* redirection.
30712         * dist-Makefile: Add tmp* to "clean" target.
30713
30714         * dist-Makefile: Use LOCAL_CC for cre*, to simplify cross
30715           compilation.
30716
30717         * gmp.h, mp.h: Don't define NULL here.
30718         * gmp-impl.h: Define it here.
30719
30720 Wed Jul 10 14:13:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30721
30722         * mpz_mod_2exp: Don't copy too much, overwriting most significant
30723           limb.
30724
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.
30727
30728         * mpz_and, mpz_ior: Clear up comments.
30729
30730         * cre-mparam.c: Output parameters for `short int' and `int'.
30731
30732         * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
30733
30734 Tue Jul  9 18:40:30 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30735
30736         * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
30737           (Fix for Sun lossage.)
30738
30739         * gmp.h: Add declaration of mpq_clear.
30740
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".
30744
30745 Fri Jul  5 19:08:09 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30746
30747         * move: Remove incorrect comment.
30748
30749         * mpz_free, mpq_free: Rename to *_clear.
30750         * dist-Makefile: Likewise.
30751         * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
30752
30753         * mpz_dmincl.c: Don't call "move", inline its functionality.
30754
30755 Thu Jul  4 00:06:39 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30756
30757         * Makefile: Include dist-Makefile.  Fix dist target to include
30758           dist-Makefile (with the name "Makefile" in the archive).
30759
30760         * dist-Makefile: New file made from Makefile.  Add new mpz_...
30761           functions.
30762
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
30766
30767         * mpz_dmincl.c: New file containing general division code.  Avoids
30768           code duplication.
30769         * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
30770           mpz_dmincl.c.
30771
30772         * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
30773           Instead, write the overlapping memory copying inline.
30774
30775         * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
30776
30777         * longlong.h: Don't use #elif.
30778         * mpz_do_sqrt.c: Likewise.
30779
30780         * longlong.h: Use __asm__ instead of asm.
30781         * longlong.h (sparc udiv_qrnnd): Make it to one string over several
30782           lines.
30783
30784         * longlong.h: Preend __ll_ to B, highpart, and lowpart.
30785
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.
30789
30790 Wed Jul  3 11:42:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30791
30792         * mpz_and: Initialize res_ptr always (used to be initialized only
30793           when reallocating).
30794
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
30798           instructions.
30799
30800         * mpz_mod_2exp: Handle input argument < modulo argument.
30801         * mpz_many: Make sure mp_size is the type for sizes, not int.
30802
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.
30806
30807 Sun Jun 30 19:21:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30808
30809         * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
30810           character file name length limit.
30811
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
30818           _mpz_get_cvtlen.
30819         * mpz_get_cvtlen.c: Remove.
30820         * Makefile: Update.
30821
30822 Sat Jun 29 21:57:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30823
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).
30828
30829 Mon Jun 24 17:37:23 1991  Torbjorn Granlund  (tege@amon.sics.se)
30830
30831         * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
30832           Swap 't' and 's'.
30833
30834 Sat Jun 22 13:54:01 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30835
30836         * mpz_gcdext.c: New file.
30837
30838         * mpn_mul: Handle carry and unexpected operand sizes in last
30839           additions/subtractions.  (Bug trigged when v1_size == 1.)
30840
30841         * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
30842         * mpq_*: Call mpz_init*.
30843
30844         * mpz_pow_ui, rpow: Use _mpn_mul instead of mult.  Restructure.
30845
30846 Wed May 29 20:32:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30847
30848         * mpz_get_cvtlen: multiply by size.
30849
30850 Sun May 26 15:01:15 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
30851
30852         Alpha-release 0.95.
30853
30854         Fixes from Doug Lea (dl@g.oswego.edu):
30855         * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE).  Adjust PROD_SIZE
30856           correctly.
30857         * mpz_div: Prepend _ to mpz_realloc.
30858         * mpz_set_xs, mpz_set_ds: Fix typos in function name.
30859
30860 Sat May 25 22:51:16 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
30861
30862         * mpz_divmod_ui: New function.
30863
30864         * sdiv: Make the sign of the remainder correct.
30865
30866 Thu May 23 15:28:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30867
30868         * Alpha-release 0.94.
30869
30870         * mpz_mul_ui: Include longlong.h.
30871
30872         * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
30873           of msqrt.
30874
30875         * mpz_impl_sqrt: Don't call "move", inline its functionality.
30876
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.
30880
30881         * xtom: Don't use mpz_alloc, inline needed code instead.  Call
30882           _mpz_set_str instead of mpz_set_str.
30883
30884         * Makefile: Make two libraries, libmp.a and libgmp.a.
30885
30886 Thu May 22 20:25:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30887
30888         * Add manual to distribution.
30889         * Fold in many missing routines descibed in the manual.
30890         * Update Makefile.
30891
30892 Wed May 22 13:48:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30893
30894         * mpz_set_str: Make it handle 0x prefix OK.
30895
30896 Sat May 18 18:31:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30897
30898         * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
30899           arguments.
30900         * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
30901         * min: Likewise.
30902
30903 Thu May 16 20:43:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30904
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.
30908
30909 Wed May  8 20:02:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30910
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.
30914
30915         * mpz_sub_ui.c, mpz_add_ui.c: New files.
30916
30917         * mpz_cmp.c, mpz_cmp_ui.c: New files.
30918
30919         * mpz_mul_2exp: Handle zero input MINT correctly.
30920
30921         * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
30922
30923         * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
30924
30925 Tue May  7 15:44:58 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30926
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.
30930
30931         * gcd, mpz_gcd: Handle common 2 factors correctly.
30932
30933 Mon May  6 20:22:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30934
30935         * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
30936
30937         * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
30938
30939 Sun May  5 15:16:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30940
30941         * mpz_div: Remove test for QUOT == 0.
30942
30943 Sun Apr 28 20:21:04 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30944
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.
30949
30950 Sat Apr 27 21:03:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30951
30952         * Install multiplication using Karatsuba's algorithm as default.
30953
30954 Fri Apr 26 01:03:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30955
30956         * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
30957
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.
30961
30962         * mlshift.c, mrshift.c: Remove.
30963
30964 Wed Apr 24 21:39:22 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30965
30966         * mpn_mul: Check only for m2_size == 0 in function header.
30967
30968 Mon Apr 22 01:31:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30969
30970         * karatsuba.c: New file for Karatsuba's multiplication algorithm.
30971
30972         * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
30973
30974         * mpn_cmp: Fix header comment.
30975
30976 Sun Apr 21 00:10:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30977
30978         * pow: Switch off initial base reduction.
30979
30980 Sat Apr 20 22:06:05 1991  Torbjorn Granlund  (tege@echnaton.sics.se)
30981
30982         * mpz_get_str: Don't generate initial zeros for initial word.
30983           Used to write outside of allocated storage.
30984
30985 Mon Apr 15 15:48:08 1991  Torbjorn Granlund  (tege@zevs.sics.se)
30986
30987         * _mpz_realloc: Make it accept size in number of mp_digits.
30988         * Most functions: Use new _mpz_realloc definition.
30989
30990         * mpz_set_str: Remove calls _mp_free_func.
30991
30992         * Most functions: Rename mpn_* to _mpn_*.  Rename mpz_realloc to
30993           _mpz_realloc.
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).
30997
30998 Sat Apr  6 14:05:16 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
30999
31000         * mpn_mul: Multiply by the first digit in M2 in a special
31001           loop instead of zeroing the product area.
31002
31003         * mpz_abs.c: New file.
31004
31005         * sdiv: Implement as mpz_div_si for speed.
31006
31007         * mpn_add: Make it work for second source operand == 0.
31008
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
31012           (optimization).
31013
31014 Fri Apr  5 00:19:36 1991  Torbjorn Granlund  (tege@black.nada.kth.se)
31015
31016         * mpn_sub: Make it work for subtrahend == 0.
31017
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).
31021
31022         * msqrt: Make it divide by zero if fed with a negative number.
31023         * Remove if statement at end of precision calculation that was
31024           never true.
31025
31026         * itom, mp.h: The argument is of type short, not int.
31027
31028         * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
31029
31030         * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
31031
31032         * Add COPYING to distribution.
31033
31034         * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
31035
31036 Fri Mar 15 00:26:29 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
31037
31038         * Add Copyleft headers to all files.
31039
31040         * mpn_mul.c, mpn_div.c: Add header comments.
31041         * mult.c, mdiv.c: Update header comments.
31042
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.
31045
31046         * mpn_lshift.c: Avoid writing the most significant word if it is 0.
31047
31048         * mdiv.c: Call mpn_lshift for the normalization.
31049         * mdiv.c: Remove #ifdefs.
31050
31051         * Makefile: Add ChangeLog to DISTFILES.
31052
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).
31060
31061         * README: Update routine names.
31062
31063 Thu Mar 14 18:45:28 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
31064
31065         * mpq_mul.c: New file for rational multiplication.
31066
31067         * gmp.h: Add definitions for rational arithmetics.
31068
31069         * mpn_div: Kludge the case where the high numerator digit > the
31070           high denominator digit.  (This code is going to be optimized later.)
31071
31072         * New files: gmp.h for GNU specific functions, gmp-common.h for
31073           definitions common for mp.h and gmp.h.
31074
31075         * Ensure mp.h just defines what BSD mp.h defines.
31076
31077         * pow.c: Fix typo for bp allocation.
31078
31079         * Rename natural number functions to mpn_*, integer functions to
31080           mpz_*.
31081
31082 Tue Mar  5 18:47:04 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
31083
31084         * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
31085           "n0 >= r" to "n0 > r".
31086
31087         * msqrt: Tune the increasing precision scheme, to do fewer steps.
31088
31089 Tue Mar  3 18:50:10 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
31090
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.)