tizen 2.3 release
[external/gmp.git] / ChangeLog
1 Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2           2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
3 .
4 This file is part of the GNU MP Library.
5 .
6 The GNU MP Library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or (at your
9 option) any later version.
10 .
11 The GNU MP Library is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14 License for more details.
15 .
16 You should have received a copy of the GNU Lesser General Public License
17 along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 MA 02110-1301, USA.
20
21 2006-05-04  Torbjorn Granlund  <tege@swox.com>
22
23         * Version 4.2.1 released.
24
25 2006-05-03  Torbjorn Granlund  <tege@swox.com>
26
27         * mpn/powerpc64/vmx/popcount.asm: Conditionally zero extend n.
28
29 2006-04-27  Torbjorn Granlund  <tege@swox.com>
30
31         * mpz/divexact.c: Call mpz_tdiv_q for large operands.
32
33         * configure.in (powerpc-*-darwin): Remove -fast, it affects PIC.
34
35 2006-04-26  Torbjorn Granlund  <tege@swox.com>
36
37         * config.guess: Try to recognize Ultrasparc T1 (as ultrasparct1).
38         * config.sub: Handle ultrasparct1.
39
40 2006-04-25  Torbjorn Granlund  <tege@swox.com>
41
42         * mpn/sparc64/gmp-mparam.h: Retune, without separation of GNUC and
43         non-GNUC data.
44
45 2006-04-19  Torbjorn Granlund  <tege@swox.com>
46
47         * configure.in: Support powerpc eABI.
48         * mpn/powerpc32/eabi.m4: New file.
49
50         * configure.in: Support powerpc *bsd.
51         * mpn/powerpc64/elf.m4: New name for mpn/powerpc64/linux64.m4.
52         * mpn/powerpc32/elf.m4: New name for mpn/powerpc32/linux.m4.
53
54         * mpn/powerpc64/linux64.m4 (ASM_END): Quote TOC_ENTRY.
55
56 2006-04-18  Torbjorn Granlund  <tege@swox.com>
57
58         * configure.in (gmp_mpn_functions_optional): Add lshiftc.
59         (HAVE_NATIVE): Add lshiftc.
60
61         * tune/speed.h (SPEED_ROUTINE_MPN_ADDSUB_N_CALL): New macro.
62         * tune/common.c (speed_mpn_addsub_n): New function.
63         * tune/speed.c (routine): Add measuring of mpn_addsub_n.
64
65         * mpn/powerpc64/linux64.m4 (TOC_ENTRY): Define to empty.
66         * mpn/powerpc64/aix.m4 (TOC_ENTRY): Likewise.
67         * mpn/powerpc32/aix.m4 (TOC_ENTRY): Likewise.
68
69         * mpn/powerpc32/aix.m4 (EXTERN): New, copied form powerpc64/aix.m4.
70         * mpn/powerpc32/mode1o.asm: Use EXTERN.
71         * mpn/powerpc32/linux.m4 (EXTERN): Provide dummy definition.
72         * mpn/powerpc32/darwin.m4 (EXTERN): Likewise.
73
74 2006-04-13  Torbjorn Granlund  <tege@swox.com>
75
76         * tests/devel/try.c (choice_array): Add mpn_addsub_n[c].
77
78 2006-04-12  Torbjorn Granlund  <tege@swox.com>
79
80         * extract-dbl.c: Don't rely on undefined casts to mp_limb_signed_t.
81
82         * configure.in: Disable AC_C_RESTRICT for now.
83         * mpn/generic/diveby3.c: Don't use restict keyword for now.
84
85 2006-04-11  Torbjorn Granlund  <tege@swox.com>
86
87         * gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
88
89         * aclocal.m4: Regenerate with patched libtool.
90
91         * mpn/asm-defs.m4 (ASM_END): Provide (empty) default.
92
93 2006-04-08  Torbjorn Granlund  <tege@swox.com>
94
95         * configure.in (gmp_mpn_functions_optional): Add addsub.
96
97         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
98         Bump version info.
99
100         * gmpxx.h: Remove missed MPFR references.
101
102         * gmp-impl.h (TMP_*, WANT_TMP_DEBUG): Don't expect marker argument;
103         define TMP_SALLOC and TMP_BALLOC.
104
105 2006-04-05  Torbjorn Granlund  <tege@swox.com>
106
107         * tal-notreent.c (__gmp_tmp_mark): Add "struct" tag for tmp_marker.
108         (__gmp_tmp_free): Likewise.
109
110 2006-03-26  Torbjorn Granlund  <tege@swox.com>
111
112         * Version 4.2 released.
113
114         * mpn/powerpc64/aix.m4 (LEA): Renamed from LDSYM.
115         * mpn/powerpc64/darwin.m4: Likewise.
116         * mpn/powerpc64/linux64.m4: Likewise.
117         * mpn/powerpc64/vmx/popcount.asm: Use LEA, not LDSYM.
118
119 2006-03-23  Torbjorn Granlund  <tege@swox.com>
120
121         * gmp-impl.h: (class gmp_allocated_string): Prefix strlen with std::.
122
123         * gmpxx.h (__GMP_DEFINE_TERNARY_EXPR2): Remove for now.
124         (struct __gmp_ternary_addmul2): Likewise.
125         (struct __gmp_ternary_submul2): Likewise.
126
127         * gmpxx.h: #include <cstring>.
128         (struct __gmp_alloc_cstring): Prefix strlen with std::.
129
130         * mpn/x86/pentium/com_n.asm: Add TEXT and ALIGN.
131         * mpn/x86/pentium/copyi.asm: Likewise.
132         * mpn/x86/pentium/copyd.asm: Likewise.
133
134 2006-03-22  Torbjorn Granlund  <tege@swox.com>
135
136         * gmp-h.in: Add a "using std::FILE" for C++.
137         (_GMP_H_HAVE_FILE): Check also _ISO_STDIO_ISO_H.
138
139         * gmpxx.h: Remove mpfr code.
140         * tests/cxx: Likewise.
141
142         * gmp-impl.h (FORCE_DOUBLE): Rename a tempvar to avoid a clash with
143         GNU/Linux public include file.
144
145         * configure.in (powerpc64, darwin): New optional, gcc_cflags_subtype.
146         Grab powerpc32/darwin.m4 for ABI=mode32.
147
148         * configure.in: Use host_cpu whenever just the cpu type is needed.
149
150 2006-03-08  Torbjorn Granlund  <tege@swox.com>
151
152         * mpz/get_si.c: Fix a typo.
153
154         * tests/mpq/t-get_d.c (check_random): Improve random generation for
155         nails.
156
157 2006-02-28  Torbjorn Granlund  <tege@swox.com>
158
159         * tests/mpq/t-get_d.c (check_random): New function.
160         (main): Call check_random.
161
162         * mpq/set_d.c: Make choices based on LIMBS_PER_DOUBLE, not
163         BITS_PER_MP_LIMB.  Make it work for LIMBS_PER_DOUBLE == 4.
164         Use MPZ_REALLOC.
165
166         * mpz/set_d.c: Make it work for LIMBS_PER_DOUBLE == 4.
167
168         * extract-dbl.c: Make it work for LIMBS_PER_DOUBLE > 3.
169
170 2006-02-27  Torbjorn Granlund  <tege@swox.com>
171
172         * mpz/cmp_d.c: Declare `i'.
173         * mpz/cmpabs_d.c: Likewise.
174
175 2006-02-23  Torbjorn Granlund  <tege@swox.com>
176
177         * mpn/powerpc32/vmx/copyd.asm: Set right VRSAVE bits.
178         * mpn/powerpc32/vmx/copyi.asm: Likewise.
179
180 2006-02-22  Torbjorn Granlund  <tege@swox.com>
181
182         * mpn/powerpc32/vmx/logops_n.asm: New file.
183
184         * mpn/powerpc32/diveby3.asm: Rewrite.
185
186 2006-02-21  Torbjorn Granlund  <tege@swox.com>
187
188         * mpn/powerpc32/vmx/copyi.asm: New file.
189         * mpn/powerpc32/vmx/copyd.asm: New file.
190
191 2006-02-17  Torbjorn Granlund  <tege@swox.com>
192
193         * mpn/alpha/ev6/nails/aors_n.asm (CYSH): Import proper setting from
194         deleted mpn_sub_n.
195
196 2006-02-16  Torbjorn Granlund  <tege@swox.com>
197
198         * mpn/alpha/ev6/addmul_1.asm: Correct slotting comments.
199
200 2006-02-15  Torbjorn Granlund  <tege@swox.com>
201
202         * tests/devel/anymul_1.c: Copy error reporting code from addmul_N.c.
203
204         * tests/devel/addmul_N.c: New file.
205         * tests/devel/mul_N.c: New file.
206
207         * mpn/alpha/default.m4 (PROLOGUE_cpu): Align functions at 16-byte
208         boundary.
209
210         * mpn/alpha/ev6/nails/aors_n.asm: New file.
211         * mpn/alpha/ev6/nails/add_n.asm: Remove.
212         * mpn/alpha/ev6/nails/sub_n.asm: Remove.
213
214         * mpn/alpha/ev6/nails/addmul_1.asm: Rewrite.
215         * mpn/alpha/ev6/nails/submul_1.asm: Likewise.
216         * mpn/alpha/ev6/nails/mul_1.asm: Likewise.
217
218         * mpn/alpha/ev6/nails/addmul_2.asm: Use L() for labels.
219         * mpn/alpha/ev6/nails/addmul_3.asm: Use L() for labels.
220         * mpn/alpha/ev6/nails/addmul_4.asm: Use L() for labels.
221
222 2006-02-13  Torbjorn Granlund  <tege@swox.com>
223
224         * mpn/powerpc32/diveby3.asm: Trivially reorder loop insns to save
225         1 c/l.
226
227 2006-02-10  Torbjorn Granlund  <tege@swox.com>
228
229         * mpn/powerpc64/sqr_diagonal.asm: Software pipeline.
230
231         * mpn/powerpc64/vmx/popcount.asm: Add prefetching.
232
233 2006-02-04  Torbjorn Granlund  <tege@swox.com>
234
235         * mpn/powerpc64/vmx/popcount.asm: Remove mpn_hamdist partial code.
236         Move compare for huge n so that it is always executed.
237
238 2006-02-03  Torbjorn Granlund  <tege@swox.com>
239
240         * mpn/powerpc32/linux.m4 (LEA): Add support for PIC.
241
242         * configure.in (powerpc): New optional, gcc_cflags_subtype.
243
244         * mpn/powerpc64/linux64.m4 (PROLOGUE_cpu): Align function start to
245         16-multiple.
246         * mpn/powerpc64/aix.m4: Likewise.
247         * mpn/powerpc64/darwin.m4: Likewise.
248
249         * mpn/powerpc64/copyi.asm: Align loop to 16-multiple.
250         * mpn/powerpc64/copyd.asm: Likewise
251
252         * configure.in (powerpc): Add vmx to relevant paths.
253
254         * mpn/powerpc64/linux64.m4 (DEF_OBJECT): Accept 2nd argument, for
255         alignment.
256         * mpn/powerpc64/aix.m4: Likewise.
257         * mpn/powerpc64/darwin.m4: Likewise.
258
259         * mpn/powerpc32/linux.m4 (DEF_OBJECT, END_OBJECT): New macros,
260         inherited from powerpc64 versions.
261         * mpn/powerpc32/aix.m4: Likewise.
262         * mpn/powerpc32/darwin.m4: Likewise.
263
264         * mpn/powerpc64/vmx/popcount.asm: New file, for ppc32 and ppc64.
265         * mpn/powerpc32/vmx/popcount.asm: New file, grabbing above file.
266
267 2006-01-22  Torbjorn Granlund  <tege@swox.com>
268
269         * configure.in: Generalize OS-dependent patterns for powerpcs.
270
271 2006-01-20  Torbjorn Granlund  <tege@swox.com>
272
273         * config.guess: Recognize power4 and up under linux-gnu.
274         * config.sub: Generalize power recognition code.
275         * acinclude.m4 (POWERPC64_PATTERN): Add 64-bit powerpc processors.
276         * configure.in: Recognize powerpc procssors masquerading as power
277         procssors.
278
279 2006-01-17  Torbjorn Granlund  <tege@swox.com>
280
281         * mpn/generic/diveby3.c: Use GMP standard parameter names.  Nailify
282         alternative code.  Use restrict for params.
283
284         * configure.in: Recognize andn_n as not needing nailification.
285
286         * tests/mpq/t-equal.c (check_various): Disable a test that gives common
287         factors for GMP_NUMB_BITS == 62.
288
289 2006-01-16  Torbjorn Granlund  <tege@swox.com>
290
291         * mpn/generic/get_str.c (mpn_sb_get_str): Fix digit count computation,
292         was inaccurate for nails.
293
294 2006-01-15  Torbjorn Granlund  <tege@swox.com>
295
296         * mpn/x86_64/mode1o.asm: Remove unneeded carry register zeroing.
297
298 2006-01-08  Torbjorn Granlund  <tege@swox.com>
299
300         * mpn/alpha/ev6/sqr_diagonal.asm: New file.
301
302 2006-01-06  Torbjorn Granlund  <tege@swox.com>
303
304         * mpn/generic/mullow_n.c (MUL_BASECASE_ALLOC): New #define.
305         (mpn_mullow_n): Use it.
306
307         * mpn/powerpc64/aix.m4 (EXTERN): Define to import symbol.
308         (LDSYM): Remove [RW] attribute.
309         * mpn/powerpc64/linux64.m4 (EXTERN): Dummy definition.
310         * mpn/powerpc64/darwin.m4 (EXTERN): Likewise.
311
312 2006-01-05  Torbjorn Granlund  <tege@swox.com>
313
314         * mpn/powerpc64/linux64.m4: Move toc entry generation from direct at
315         DEF_OBJECT to delayed via LDSYM, define ASM_END to output it.
316         * mpn/powerpc64/aix.m4: Likewise.
317         * mpn/powerpc64/darwin.m4: Define a dummy ASM_END.
318
319 2006-01-03  Torbjorn Granlund  <tege@swox.com>
320
321         * configure.in: Update bugs reporting address.
322
323 2006-01-02  Torbjorn Granlund  <tege@swox.com>
324
325         * mpn/powerpc64/linux64.m4 (CALL): New macro.
326         * mpn/powerpc64/aix.m4: Likewise.
327         * mpn/powerpc64/darwin.m4: Likewise, also define macro "DARWIN".
328
329 2005-12-18  Torbjorn Granlund  <tege@swox.com>
330
331         * mpf/ui_div.c: Implement workaround for GCC bug triggered on alpha.
332         * mpf/set_q.c: Likewise.
333
334 2005-12-16  Torbjorn Granlund  <tege@swox.com>
335
336         * mpn/generic/tdiv_qr.c: Remove statement with no effect.
337         Rename dead variable to `dummy'.
338
339 2005-12-15  Torbjorn Granlund  <tege@swox.com>
340
341         * demos/pexpr.c (setup_error_handler): Add a missing ";".
342
343 2005-11-27  Torbjorn Granlund  <tege@swox.com>
344
345         * mpn/generic/mul.c: Crudely call mpn_mul_fft_full before checking
346         for unbalanced operands.
347
348         * mpn/generic/mul_fft.c: Remove many scalar divisions.
349         (mpn_mul_fft_lcm): Simplify.
350         (mpn_mul_fft_decompose): Rewrite to handle arbitrarily unbalanced
351         operands.
352
353 2005-11-22  Torbjorn Granlund  <tege@swox.com>
354
355         * configure.in: Properly recognize all 32-bit Solaris releases.
356
357 2005-11-10  Torbjorn Granlund  <tege@swox.com>
358
359         * mpn/generic/mul_fft.c: Inline mpn_fft_mul_2exp_modF,
360         mpn_fft_add_modF and mpn_fft_normalize.
361
362 2005-11-02  Torbjorn Granlund  <tege@swox.com>
363
364         * tests/mpz/reuse.c: Increase operand size, decrease # of reps.
365
366 2005-10-31  Torbjorn Granlund  <tege@swox.com>
367
368         * mpz/pprime_p.c (mpz_probab_prime_p): Considerably limit trial
369         dividing.
370
371         * mpz/perfpow.c (mpz_perfect_power_p): Use mpz_divisible_ui_p instead
372         of mpz_tdiv_ui.
373
374         * mpz/divegcd.c: Correct probability number for GCD == 1.
375
376         * mpn/x86: Add cycle counts for array of x86 processors.
377
378         * mpn/x86/k7/mod_34lsub1.asm: Remove spurious mentions of ebp.
379
380         * mpn/powerpc32: Add POWER5 timings.
381
382         * mpn/powerpc32/README: Describe global reference variations.
383
384         * mpn/generic/dive_1.c: Whitespace cleanup.
385
386         * mpn/alpha/ev6/nails/addmul_1.asm: Correct comments on slotting.
387         * mpn/alpha/ev6/nails/addmul_2.asm: Likewise.
388         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
389
390         * mpf/out_str.c: List some allocation improvement ideas.
391
392         * doc/gmp.texi: Update many URLs and email addresses.
393
394         * gmp-h.in (_GMP_H_HAVE_FILE): Check also _STDIO_H_INCLUDED.
395
396 2005-10-26  Torbjorn Granlund  <tege@swox.com>
397
398         * tune/tuneup.c (tune_mullow): Update param.max_size for each threshold
399         measurement.
400
401         * configure.in (POWERPC64_PATTERN/*-*-darwin*): Set
402         SPEED_CYCLECOUNTER_OBJ_mode64 and cyclecounter_size_mode64.
403         (POWERPC64_PATTERN/*-*-linux*): Likewise.
404
405 2005-10-03  Torbjorn Granlund  <tege@swox.com>
406
407         * demos/factorize.c (factor_using_division_2kp): Honor verbose flag.
408         (factor_using_pollard_rho): Divide out new factor before it's
409         clobbered.  Don't stop factoring after a composite factor was found.
410
411 2005-09-17  Torbjorn Granlund  <tege@swox.com>
412
413         * demos/pexpr.c (fns): Add factorial keywords.
414
415 2005-08-16  Torbjorn Granlund  <tege@swox.com>
416
417         * tune/Makefile.am (EXTRA_DIST): Change "amd64" => "x86_64".
418         * mpn/Makefile.am (TARG_DIST): Change "amd64" => "x86_64".
419
420 2005-08-15  Torbjorn Granlund  <tege@swox.com>
421
422         * configure.in: Change "amd64" => "x86_64".
423
424 2005-06-13  Torbjorn Granlund  <tege@swox.com>
425
426         * mpn/generic/pre_mod_1.c: Canonicalize variable names.
427
428         * mpn/generic/divrem.c: Rate qxn test as UNLIKELY.
429
430         * tune/tuneup.c (tune_mullow): Fix all max_size fields.
431
432         * gmp-impl.h (SQR_TOOM3_THRESHOLD_LIMIT): New #define.
433         * tune/tuneup.c (tune_sqr): Use SQR_TOOM3_THRESHOLD_LIMIT.
434         (sqr_toom3_threshold): Initialize from SQR_TOOM3_THRESHOLD_LIMIT.
435
436         * mpn/generic/mul_n.c (mpn_sqr_n): Use SQR_TOOM3_THRESHOLD_LIMIT.
437
438         * gmp-impl.h (mpn_nand_n, mpn_iorn_n, mpn_nior_n, mpn_xnor_n):
439         Handle nails.
440
441 2005-06-12  Torbjorn Granlund  <tege@swox.com>
442
443         * mpn/alpha/ev6/sub_n.asm: Analogous changes as to add_n.asm last.
444
445 2005-06-11  Torbjorn Granlund  <tege@swox.com>
446
447         * mpn/alpha/ev6/add_n.asm: Rewrite inner loop to load later.
448         Add mpn_add_nc entry.
449
450         * mpn/alpha/ev6/addmul_1.asm: Remove redundant initial loads.
451
452 2005-06-07  Torbjorn Granlund  <tege@swox.com>
453
454         * mpn/generic/dive_1.c: Use variable h for upper umul_ppmm result.
455
456 2005-06-04  Torbjorn Granlund  <tege@swox.com>
457
458         * tests/devel/try.c (choice_array): Exclude mpn_preinv_mod_1 unless
459         USE_PREINV_MOD_1.
460         (choice_array): Exclude mpn_sqr_basecase if SQR_KARATSUBA_THRESHOLD
461         is zero.
462
463 2005-06-03  Torbjorn Granlund  <tege@swox.com>
464
465         * mpn/alpha/ev6/addmul_1.asm: Prefix all labels with "$".
466         * mpn/alpha/ev6/mul_1.asm: Likewise.
467
468 2005-06-02  Torbjorn Granlund  <tege@swox.com>
469
470         * tests/refmpn.c (refmpn_divmod_1c_workaround): Implement workaround
471         to gcc 3.4.x bug triggered on powerpc64 with 32-bit ABI.
472
473 2005-06-01  Torbjorn Granlund  <tege@swox.com>
474
475         * tests/devel/try.c (main): Fix a typo.
476
477 2005-05-31  Torbjorn Granlund  <tege@swox.com>
478
479         * mpn/alpha/ev6/addmul_1.asm: Rewrite for L1 cache, add prefetch.
480
481 2005-05-30  Torbjorn Granlund  <tege@swox.com>
482
483         * tests/misc.c (tests_rand_start): Mask random seed to 32 bits.
484
485 2005-05-29  Torbjorn Granlund  <tege@swox.com>
486
487         * mpn/powerpc64/mode32/mul_1.asm: Handle BROKEN_LONGLONG_PARAM.
488         * mpn/powerpc64/mode32/addmul_1.asm: Likewise.
489         * mpn/powerpc64/mode32/submul_1.asm: Likewise.
490
491         * mpn/powerpc32/mode1o.asm: Rewrite to actually work.
492
493         * mpn/powerpc32/aix.m4 (LEA): New macro.
494         (ASM_END): New macro.
495
496         * mpn/powerpc32/linux.m4: New file.
497         * mpn/powerpc32/darwin.m4: New file.
498         * configure.in: Use linux.m4 and darwin.m4.
499         (powerpc64-linux-gnu): Add support for mode32.
500
501 2005-05-25  Torbjorn Granlund  <tege@swox.com>
502
503         * mpn/generic/mullow_n.c: Remove FIXME mentioning fixed flaw.
504
505         * tests/mpz/t-cmp_d.c (check_one): Fix printf fmt string typo.
506
507         * demos/isprime.c: #include stdlib.h.
508         * tests/rand/t-urbui.c: Likewise.
509         * tests/rand/t-urmui.c: Likewise.
510
511         * tests/mpz/t-popcount.c (check_random): Remove spurious printf arg.
512
513 2005-05-24  Torbjorn Granlund  <tege@swox.com>
514
515         * tests/devel/try.c (param_init) [TYPE_GET_STR]: Set retval field.
516         (compare): Handle SIZE_GET_STR as SIZE_RETVAL.
517
518         * tests/refmpn.c (refmpn_get_str): Rewrite to make it work.
519
520 2005-05-23  Torbjorn Granlund  <tege@swox.com>
521
522         * longlong.h (many places): Remove lvalue casts.
523
524         * gmp-impl.h (MPF_SIGNIFICANT_DIGITS): Cast prec to avoid overflow
525         for > 4G digits.
526
527         * mpn/alpha/ev6/add_n.asm: Prefetch using ldl.
528         * mpn/alpha/ev6/sub_n.asm: Likewise.
529
530         * mpn/alpha/ev6/slot.pl (optable): Recognize negq and ldl.
531
532 2005-05-22  Torbjorn Granlund  <tege@swox.com>
533
534         * mpn/alpha/ev67/popcount.asm: Prefetch.
535         * mpn/alpha/ev67/hamdist.asm: Prefetch.
536
537         * longlong.h (add_ssaaaa) [x86]: Remove lvalue casts.
538         (sub_ddmmss) [x86]: Likewise.
539
540         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Add DATA_SRC1_ODD.
541         (param_init) [TYPE_MPZ_KRONECKER]: Clear inherited DATA_SRC1_ODD.
542         (param_init) [TYPE_DIVEXACT_1]: Use symbolic name DIVISOR_LIMB.
543
544 2005-05-21  Torbjorn Granlund  <tege@swox.com>
545
546         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Initialize divisor
547         field according to UDIV_NEEDS_NORMALIZATION.
548
549         * mpz/mul_i.h: Remove left-over TMP_XXXX marker arguments.
550
551 2005-05-20  Torbjorn Granlund  <tege@swox.com>
552
553         * mpn/x86/pentium4/sse2/addmul_1.asm (mpn_addmul_1c): Put carry in
554         proper register.
555
556         * mpn/generic/sqr_basecase.c (mpn_sqr_basecase, addmul_2 version):
557         Avoid accesses out-of-bound in MPN_SQR_DIAGONAL applicate code.
558
559 2005-05-19  Torbjorn Granlund  <tege@swox.com>
560
561         * mpn/alpha/diveby3.asm: Make it actually work.
562
563         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD_LIMIT): New #define.
564         * mpn/generic/mullow_n.c: Use fixed stack allocation for the smallest
565         operands; use TMP_S* allocation for medium operands.
566
567         * gmp-impl.h: Remove nested TUNE_PROGRAM_BUILD test.
568
569 2005-05-18  Torbjorn Granlund  <tege@swox.com>
570
571         * mpn/generic/mul_n.c: Make squaring and multiplication code more
572         similar.  Use TMP_S* functions.
573
574         * gmp-impl.h (TMP_DECL, TMP_MARK, TMP_FREE): Get rid of argument.
575         (TMP_SALLOC): New macro for "small" allocations.
576         (TMP_BALLOC): New macro for "big" allocations.
577         (TMP_SDECL, TMP_SMARK, TMP_SFREE): New macros for functions that use
578         just TMP_SALLOC.
579         (WANT_TMP_ALLOCA): Make default functions choose alloca or reentrant
580         functions, depending on size.
581
582         * *.c: Remove TMP_XXXX marker arguments.
583
584         * acinclude.m4 (WANT_TMP): Want tal-reent.lo also for alloca case.
585
586 2005-05-15  Torbjorn Granlund  <tege@swox.com>
587
588         * gmp-impl.h (udiv_qrnnd_preinv2): Pull an add into add_ssaaaa.
589         (udiv_qrnnd_preinv2gen): Likewise.
590
591 2005-05-14  Torbjorn Granlund  <tege@swox.com>
592
593         * longlong.h (add_ssaaaa) [x86_64]: Restrict allowed immediate
594         operands.
595         * (sub_ddmmss) [x86_64]: Likewise.
596
597 2005-05-02  Torbjorn Granlund  <tege@swox.com>
598
599         * acinclude.m4 (GMP_HPC_HPPA_2_0): Make gmp_tmp_v1 sed pattern handle
600         version numbers like B.11.X.32509-32512.GP.
601
602         * mpn/m68k/aors_n.asm: Correct MULFUNC_PROLOGUE.
603
604         * mpf/inp_str.c: Use plain int for mpf_set_str return value (works
605         around gcc 4 bug).
606
607         * acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly
608         syntax.
609         (long long reliability test 1): New GMP_PROG_CC_WORKS_PART test.
610         (long long reliability test 2): New GMP_PROG_CC_WORKS_PART test.
611
612         * configure.in: Add mode64 support for darwin.  Use darwin.m4.
613         Add cflags_opt flags for mode32 darwin.
614
615         * mpn/asm-defs.m4 (PIC_ALWAYS): Define PIC just iff PIC_ALWAYS = "yes".
616
617         * mpn/powerpc64/darwin.m4: New file.
618
619         * mpn/powerpc64/linux64.m4: Remove TOCREF, add LDSYM.
620         Rework DEF_OBJECT to need just one argument.
621         * mpn/powerpc64/aix.m4: Likewise.
622
623 2005-05-01  Torbjorn Granlund  <tege@swox.com>
624
625         * mpn/generic/popham.c: Compute final summation differently for 64-bit.
626
627         * tests/mpz/t-popcount.c (check_random): New function.
628         (main): Call it.
629
630 2005-04-09  Torbjorn Granlund  <tege@swox.com>
631
632         * mpn/powerpc64/copyi.asm: If HAVE_ABI_mode32, ignore upper 32 bits of
633         mp_size_t argument.
634         * mpn/powerpc64/copyd.asm: Likewise.
635         * mpn/powerpc64/sqr_diagonal.asm: Likewise.
636         * mpn/powerpc64/lshift.asm: Likewise.
637         * mpn/powerpc64/rshift.asm: Likewise.
638
639 2005-04-08  Torbjorn Granlund  <tege@swox.com>
640
641         * mpn/generic/rootrem.c: Allocate PP_ALLOC limbs also for qp.
642
643 2005-04-07  Torbjorn Granlund  <tege@swox.com>
644
645         * mpn/powerpc32/add_n.asm: Add nc entry point.
646         * mpn/powerpc32/sub_n.asm: Likewise.
647
648         * mpn/alpha/add_n.asm: Add correct cycle/limb numbers.
649         * mpn/alpha/sub_n.asm: Likewise.
650         * mpn/alpha/ev5/add_n.asm: Likewise.
651         * mpn/alpha/ev5/sub_n.asm: Likewise.
652
653 2005-03-31  Torbjorn Granlund  <tege@swox.com>
654
655         * mpn/x86/k7/gmp-mparam.h: Fix typo in last change.
656
657 2005-03-19  Torbjorn Granlund  <tege@swox.com>
658
659         * mpn/alpha/gmp-mparam.h: Update.
660         * mpn/alpha/ev5/gmp-mparam.h: Update.
661         * mpn/alpha/ev6/gmp-mparam.h: Update.
662
663         * mpn/x86/p6/mmx/gmp-mparam.h: Update.
664         * mpn/x86/pentium4/sse2/gmp-mparam.h: Update.
665         * mpn/x86/k7/gmp-mparam.h: Update.
666
667         * tests/mpz/t-gcd.c (main): Honor command line reps argument.
668
669         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Simplify and correct code
670         for generating test operands.
671
672 2005-01-13  Torbjorn Granlund  <tege@swox.com>
673
674         * gmp-impl.h (MPN_SIZEINBASE): Count bits in type size_t.
675         (MPN_SIZEINBASE_16): Likewise.
676
677 2004-12-17  Torbjorn Granlund  <tege@swox.com>
678
679         * tune/speed.c (run_gnuplot): Use lines, not linespoints.
680         Output a reset gnuplot command initially.
681
682 2004-12-04  Torbjorn Granlund  <tege@swox.com>
683
684         * mpn/generic/random2.c (gmp_rrandomb): Rework again.
685         * mpz/rrandomb.c (gmp_rrandomb): Likewise.
686
687 2004-11-24  Torbjorn Granlund  <tege@swox.com>
688
689         * mpn/alpha/diveby3.asm: Use correct prefetch instruction.
690
691 2004-11-19  Torbjorn Granlund  <tege@swox.com>
692
693         * mpn/alpha/diveby3.asm: Add ",gp" glue in PROLOGUE.
694         Add r31 dummy operand to `br' instruction.
695
696 2004-11-17  Torbjorn Granlund  <tege@swox.com>
697
698         * configure.in: Invoke AC_C_RESTRICT.
699
700 2004-11-16  Torbjorn Granlund  <tege@swox.com>
701
702         * mpn/alpha/diveby3.asm: New file.
703
704 2004-11-10  Torbjorn Granlund  <tege@swox.com>
705
706         * mpn/generic/popham.c: Add comment.
707
708 2004-11-05  Torbjorn Granlund  <tege@swox.com>
709
710         * config.guess: Strip any PPC string in /proc/cpuinfo.
711         Recognize 970 in that code.
712
713 2004-10-25  Torbjorn Granlund  <tege@swox.com>
714
715         * mpn/powerpc64/README: Update POWER5/PPC970 pipeline information.
716
717         * mpn/generic/mul_basecase.c (MAX_LEFT): Add comment.
718
719         * doc/gmp.texi: Consistently use "x86" denotation.
720         (Assembler SIMD Instructions): Mention SSE2 usage.
721
722         * demos/pexpr.c (main): Handle "negative" base in mpz_sizeinbase call.
723
724 2004-10-16  Torbjorn Granlund  <tege@swox.com>
725
726         * configure.in: Support icc under x86.
727         (ia64-*-linux*): Pass -no-gcc to icc.
728
729 2004-10-15  Torbjorn Granlund  <tege@swox.com>
730
731         * longlong.h (ia64 umul_ppmm): Add version for icc.
732
733         * configure.in: Support icc under ia64-*-linux*.
734
735         * acinclude.m4: New "compiler works" test for icc 8.1 bug.
736         (GMP_PROG_CC_IS_GNU): Don't let Intel's icc fool us it is GCC.
737
738 2004-10-14  Torbjorn Granlund  <tege@swox.com>
739
740         * acinclude.m4 (GMP_ASM_W32): Try also "data4".
741
742         * longlong.h: Exclude masquerading __INTEL_COMPILER from ia64 asm.
743         * gmp-impl.h: Likewise.
744
745 2004-10-12  Torbjorn Granlund  <tege@swox.com>
746
747         * tests/devel/try.c: Handle mpn_mul_2 like mpn_addmul_2.
748
749         * tune/speed.c (routine): Make R parameter optional for mpn_mul_2.
750
751 2004-10-11  Torbjorn Granlund  <tege@swox.com>
752
753         * mpn/sparc64/addmul_1.asm: Update a comment.
754
755         * tests/devel/aors_n.c: #include tests.h.
756         * tests/devel/anymul_1.c: Likewise.
757         * tests/devel/shift.c: Likewise.
758         * tests/devel/copy.c: Likewise.
759
760         * tests/devel/aors_n.c: Handle also mpn_addlsh1_n, mpn_sublsh1_n,
761         mpn_rsh1add_n, and mpn_rsh1sub_n.
762
763         * tests/devel/Makefile.am (EXTRA_PROGRAMS): Updates for yesterday's
764         file removals and additions.
765
766 2004-10-10  Torbjorn Granlund  <tege@swox.com>
767
768         * tests/devel/copy.c: Handle both MPN_COPY_INCR and MPN_COPY_DECR.
769
770         * tests/devel/logops_n.c: New file, handle all logical operations.
771
772         * tests/devel/anymul_1.c: New file, handle mpn_mul_1, mpn_addmul_1, and
773         mpn_submul_1
774         * tests/devel/mul_1.c: Remove.
775         * tests/devel/addmul_1.c: Remove.
776         * tests/devel/submul_1.c: Remove.
777
778         * tests/devel/shift.c: New file, handle mpn_lshift and mpn_rshift.
779         * tests/devel/lshift.c: Remove.
780         * tests/devel/rshift.c: Remove.
781
782         * tests/devel/aors_n.c: New file, handle mpn_add_n and mpn_sub_n.
783         * tests/devel/add_n.c: Remove.
784         * tests/devel/sub_n.c: Remove.
785
786 2004-10-09  Torbjorn Granlund  <tege@swox.com>
787
788         * mpn/powerpc64/linux64.m4: Define DEF_OBJECT, END_OBJECT, and TOCREF.
789         * mpn/powerpc64/aix.m4: Likewise.
790
791 2004-10-08  Torbjorn Granlund  <tege@swox.com>
792
793         * mpn/powerpc64/copyi.asm: New file.
794         * mpn/powerpc64/copyd.asm: New file.
795         * gmp-h.in: Remove PPC MPN_COPY variants.
796         * gmp-impl.h: Likewise.
797
798 2004-10-07  Torbjorn Granlund  <tege@swox.com>
799
800         * configfsf.guess: Patch HP-UX code to accomodate HP compiler's new
801         inability to read from stdin.
802
803         * mpn/powerpc64/mode64/addsub_n.asm: Remove accidentally added file.
804
805 2004-09-29  Torbjorn Granlund  <tege@swox.com>
806
807         * gmp-impl.h (x86 ULONG_PARITY): Work around GCC change of "q" register
808         flag.
809
810 2004-09-28  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
811
812         * mpn/generic/mul_fft.c (mpn_mul_fft): Fix a bug in the choice of the
813         recursive fft parameters.
814
815 2004-09-20  Torbjorn Granlund  <tege@swox.com>
816
817         * tests/misc.c (tests_rand_start): Default to strtoul for re-seeding.
818
819         * tests/mpz/t-mul.c (ref_mpn_mul): Fudge tmp allocation for toom3.
820
821 2004-09-19  Torbjorn Granlund  <tege@swox.com>
822
823         * tests/misc.c (tests_rand_start): Shift tv_usec for better seeding.
824
825 2004-09-18  Torbjorn Granlund  <tege@swox.com>
826
827         * tests/misc.c (tests_rand_start): Invoke fflush after printing seed.
828
829         * tests/mpz/t-mul.c (main): Check environment for GMP_CHECK_FFT, run
830         extra FFT tests if set.
831         (ref_mpn_mul): Use library code for kara and toom, but skewded so that
832         we never use the same algorithm that we're testing.
833         (mul_kara): Delete.
834         (debug_mp): Print just one line of large numbers.
835         (ref_mpn_mul): Rework usage of tp temporary space.
836
837 2004-09-11  Torbjorn Granlund  <tege@swox.com>
838
839         * mpn/generic/sqr_basecase.c: In variant for HAVE_NATIVE_mpn_addmul_2,
840         accumulate carry also for when HAVE_NATIVE_mpn_addlsh1_n.
841
842 2004-08-29  Torbjorn Granlund  <tege@swox.com>
843
844         * tests/mpz/t-sizeinbase.c: Disable mpz_fake_bits and check_sample.
845
846 2004-06-17  Kevin Ryde  <kevin@swox.se>
847
848         * doc/gmp.texi: Use @. when sentence ends with a capital, for good
849         spacing in tex.
850         (Language Bindings): Add gmp-d, reported by Ben Hinkle.  Update SWI
851         Prolog URL, reported by Jan Wielemaker.
852
853 2004-06-09  Torbjorn Granlund  <tege@swox.com>
854
855         * configure.in: Handle --enable-fat.  Use that to enable x86 fat
856         builds, remove magic meaning of i386-*-*.
857
858 2004-06-03  Kevin Ryde  <kevin@swox.se>
859
860         * gmp-impl.h (memset): Use a local char* pointer, in case parameter is
861         something else (eg. tune/common.c).  Reported by Emmanuel Thomé.
862
863 2004-06-01  Kevin Ryde  <kevin@swox.se>
864
865         * config.guess (i?86-*-*): Avoid "Illegal instruction" message which
866         goes to stdout on 80386 freebsd4.9.
867
868 2004-05-23  Torbjorn Granlund  <tege@swox.com>
869
870         * mpn/generic/gcdext.c (gcdext_1_odd): Use masking to avoid jumps.
871
872 2004-05-22  Torbjorn Granlund  <tege@swox.com>
873
874         * mpn/x86/pentium4/sse2/addmul_1.asm: Add Prescott cycle numbers.
875
876         * mpn/powerpc32/lshift.asm: Add more cycle numbers.
877         * mpn/powerpc32/rshift.asm: Likewise.
878
879 2004-05-21  Torbjorn Granlund  <tege@swox.com>
880
881         * gmp-impl.h (mpn_mullow_n, mpn_mullow_basecase): Declare.
882
883         * tune/Makefile.am: Compile gcdext.c.
884
885         * gmp-impl.h (GET_STR_THRESHOLD_LIMIT): Lower outrageous value to 150.
886
887 2004-05-21  Niels Möller  <nisse@lysator.liu.se>
888
889         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Ensure first operand is
890         not smaller than 2nd operand.
891
892 2004-05-17  Kevin Ryde  <kevin@swox.se>
893
894         * gmp-h.in (mpz_get_ui): Use #if instead of plain if, and for nails
895         use ?: same as normal case, to avoid warnings from Borland C++ 6.0.
896         Reported by delta trinity.
897
898 2004-05-15  Kevin Ryde  <kevin@swox.se>
899
900         * tune/time.c (getrusage_backwards_p): New function
901         (speed_time_init): Use it to exclude broken netbsd1.4.1 getrusage.
902         * configure.in (m68*-*-netbsd1.4*): Remove code pretending getrusage
903         doesn't exist.
904         * tune/README (NetBSD 1.4.1 m68k): Update notes.
905
906         * configure.in (mips*-*-* ABI=n32): Remove gcc_n32_ldflags and
907         cc_n32_ldflags, libtool knows to put the linker in n32 mode.
908
909 2004-05-15  Torbjorn Granlund  <tege@swox.com>
910
911         * config.guess (powerpc*-*-*): Add more processor types to mfpvr code.
912         * configure.in: Generalize powerpc subtype matching code.
913
914         * mpz/fac_ui.c: Misc cleanups, spelling corrections.
915
916 2004-05-14  Kevin Ryde  <kevin@swox.se>
917
918         * mpf/sub.c: When one operand cancels high limbs of the other, strip
919         high zeros on the balance before truncating to destination precision.
920         Truncating first loses accuracy and can lead to a result 0 despite
921         operands being not equal.  Reported by John Abbott.
922         Also, ensure exponent is zero when result is zero, for instance if
923         operands are exactly equal.
924         * tests/mpf/t-sub.c (check_data): New function, exercising these.
925
926 2004-05-12  Kevin Ryde  <kevin@swox.se>
927
928         * configure.in (AC_PROG_RANLIB): New macro, supposedly required by
929         automake, though it doesn't complain.
930
931         * demos/expr/Makefile.am (ARFLAGS): Add a default setting, to
932         workaround an automake bug.
933
934 2004-05-10  Kevin Ryde  <kevin@swox.se>
935
936         * */Makefile.in, install-sh, aclocal.m4: Update to automake 1.8.4.
937
938         * doc/gmp.texi (Demonstration Programs): Add a remark about expression
939         evaluation in the main gmp library.
940
941         * demos/expr/exprfa.c (mpf_expr_a): Correction to mpX_init, use
942         mpf_init2 to follow requested precision.
943         * demos/expr/exprza.c, demos/expr/exprqa.c: Use wrappers for mpX_init,
944         to make parameters match.
945
946         * demos/expr/run-expr.c: Don't use getopt, to avoid needing configury
947         for optarg declaration.  Remove TRY macro, rename foo and bar to var_a
948         and var_b, for clarity.
949         * demos/expr/expr-impl.h: Don't use expr-config.h.
950         * configure.in (demos/expr/expr-config.h): Remove.
951         * demos/expr/expr-config.in: Remove file.
952
953 2004-05-08  Kevin Ryde  <kevin@swox.se>
954
955         * doc/configuration (Configure): Update for current automake not
956         copying acinclude.m4 into aclocal.m4.
957
958         * configure.in, Makefile.am, doc/gmp.texi, doc/configuration,
959         tests/cxx/Makefile.am, demos/expr/Makefile.am, demos/expr/README,
960         demos/expr/expr.c, demos/expr/expr.h, demos/expr/expr-config-h.in,
961         demos/expr/expr-impl.h, demos/expr/run-expr.c, demos/expr/t-expr.c:
962         MPFR now published separately, remove various bits.
963         * mpfr/*, tests/cxx/t-headfr.cc, demos/expr/exprfr.c,
964         demos/expr/exprfra.c: Remove.
965
966 2004-05-07  Kevin Ryde  <kevin@swox.se>
967
968         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Amend c++ shared library
969         path hack, on k62-unknown-dragonfly1.0 /usr/bin/make runs its commands
970         "set -e", so we need an "|| true" in case there's nothing to copy (for
971         instance in a static build).
972
973 2004-05-06  Kevin Ryde  <kevin@swox.se>
974
975         * mpn/alpha/mode1o.c: Remove, in favour of ...
976         * mpn/alpha/mode1o.asm: New file.
977         * mpn/alpha/alpha-defs.m4 (bwx_available_p): New macro.
978
979         * tune/amd64.asm: Save rbx in r10 rather than on the stack.
980
981         * configure.in (x86_64-*-*): Try also "-march=k8 -mno-sse2", in case
982         we're in ABI=32 on an old OS not supporting xmm regs.
983         (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): Run these tests under
984         -march=k8 too, and not under ABI=64.
985
986         * doc/gmp.texi (Converting Integers): For mpz_get_d, note truncation
987         and overflows.  For mpz_get_d_2exp note truncation, note result if
988         OP==0, and cross reference libc frexp.
989         (Rational Conversions): For mpq_get_d, note truncation and overflows.
990         (Converting Floats): For mpf_get_d, note truncation and overflows.
991         For mpf_get_d_2exp, note truncation, note result if OP==0.
992         (Assembler Code Organisation): Note nails subdirectories.
993         Clarification of get_d_2exp OP==0 reported by Sylvain Pion.
994
995 2004-05-05  Torbjorn Granlund  <tege@swox.com>
996
997         * mpn/generic/mullow_n.c, mpn/generic/mullow_basecase.c: New files
998         (mainly by Niels Möller).
999         * configure.in, mpn/Makefile.am: Add them.
1000
1001         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD, MULLOW_DC_THRESHOLD,
1002         MULLOW_MUL_N_THRESHOLD): Override for TUNE_PROGRAM_BUILD.
1003
1004         * tune/Makefile.am: Compile mullow_n.c.
1005         * tune/common.c (speed_mpn_mullow_n, speed_mpn_mullow_basecase):
1006         New functions.
1007         * tune/speed.c (routine): Add entries for mpn_mullow_n and
1008         mpn_mullow_basecase.
1009         * tune/speed.h (SPEED_ROUTINE_MPN_MULLOW_N_CALL,
1010         SPEED_ROUTINE_MPN_MULLOW_BASECASE): New #defines.
1011         * tune/tuneup.c (tune_mullow): New function.
1012
1013         * gmp-impl.h (invert_limb): Compute branch-freely.
1014
1015 2004-05-02  Kevin Ryde  <kevin@swox.se>
1016
1017         * mpn/amd64/mode1o.asm: Use movabsq to support large model non-PIC.
1018         Use 32-bit insns to save code bytes, and to save a couple of cycles on
1019         the initial setup multiplies.
1020
1021 2004-05-01  Kevin Ryde  <kevin@swox.se>
1022
1023         * doc/gmp.texi (References): Update gcc online docs url to
1024         gcc.gnu.org.
1025
1026         * configure.in (mips*-*-irix[6789]*): Correction to m4 quoting of this
1027         pattern.  (Believe the mips64*-*-* part also used picks up all current
1028         irix6 tuples anyway.)  Reported by Rainer Orth.
1029
1030 2004-04-30  Kevin Ryde  <kevin@swox.se>
1031
1032         * acinclude.m4 (GMP_PROG_CC_X86_GOT_EAX_EMITTED,
1033         GMP_ASM_X86_GOT_EAX_OK): New macros.
1034         (GMP_PROG_CC_WORKS): Use them to detect an old gas bug tickled by
1035         recent gcc.  Reported by David Newman.
1036
1037         * doc/gmp.texi (Reentrancy): Note also gmp_randinit_default as an
1038         alternative to gmp_randinit.
1039
1040 2004-04-29  Torbjorn Granlund  <tege@swox.com>
1041
1042         * configfsf.guess: Update to 2004-03-12.
1043         * configfsf.sub: Likewise.
1044
1045 2004-04-27  Torbjorn Granlund  <tege@swox.com>
1046
1047         * mpz/rrandomb.c (gmp_rrandomb): Rework to avoid extra limb allocation
1048         and to generate even numbers.
1049         * mpn/generic/random2.c (gmp_rrandomb): Likewise.
1050
1051 2004-04-25  Kevin Ryde  <kevin@swox.se>
1052
1053         * gmp-impl.h (FORCE_DOUBLE): Don't use an asm with a match constraint
1054         on a memory output, apparently not supported and provokes a warning
1055         from gcc 3.4.
1056
1057 2004-04-24  Kevin Ryde  <kevin@swox.se>
1058
1059         * longlong.h (count_leading_zeros_gcc_clz,
1060         count_trailing_zeros_gcc_ctz): New macros.
1061         (count_leading_zeros, count_trailing_zeros) [x86]: Use them on gcc
1062         3.4.
1063
1064         * configure.in (x86-*-* gcc_cflags_cpu): Give a -mtune at the start of
1065         each option list, for use by gcc 3.4 to avoid deprecation warnings
1066         about -mcpu.
1067
1068         * mpz/aorsmul.c, mpz/aorsmul_i.c, mpz/cfdiv_q_2exp.c,
1069         mpz/cfdiv_r_2exp.c, mpq/aors.c, mpf/ceilfloor.c: Give REGPARM_ATTR()
1070         on function definition too, as demanded by gcc 3.4.
1071
1072 2004-04-22  Kevin Ryde  <kevin@swox.se>
1073
1074         * tests/rand/t-lc2exp.c (check_bigc1): New test.
1075
1076         * doc/fdl.texi: Tweak @appendixsubsec -> @appendixsec to match our
1077         preference for this in an @appendix, and because texi2pdf doesn't
1078         support @appendixsubsec directly within an @appendix.
1079
1080 2004-04-20  Kevin Ryde  <kevin@swox.se>
1081
1082         * doc/texinfo.tex: Update to 2004-04-07.08 from texinfo 4.7.
1083         * doc/gmp.texi, mpfr/mpfr.texi (@copying): Don't put a line break in
1084         @ref within @copying, recent texinfo.tex doesn't like that.
1085
1086         * demos/perl/GMP.xs (static_functable): Treat cygwin the same as mingw
1087         DLLs.
1088
1089         * */Makefile.in, install-sh: Update to automake 1.8.3.
1090         * ltmain.sh, aclocal.m4, configure: Update to libtool 1.5.6.
1091
1092         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): Use a compile-time constant
1093         expression, rather than a configure test.
1094         * acinclude.m4, configure.in (GMP_C_RIGHT_SHIFT): Remove, no longer
1095         needed.
1096         * tests/t-hightomask.c: New file.
1097         * tests/Makefile.am (check_PROGRAMS): Add it.
1098
1099         * macos/configure (parse_top_configure): Look for PACKAGE_NAME and
1100         PACKAGE_VERSION now used by autoconf.
1101         (what_objects): Only demand 9 object files, as for instance occurs in
1102         the scanf directory.
1103         (asm files): Transform labels L(foo) -> Lfoo.  Take func name from
1104         PROLOGUE to support empty "EPILOGUE()".  Recognise and subsitute
1105         register name "define()"s.
1106         * macos/Makefile.in (CmnObjs): Add tal-notreent.o.
1107
1108 2004-04-19  Torbjorn Granlund  <tege@swox.com>
1109
1110         * tune/speed.h (SPEED_ROUTINE_MPN_ROOTREM): New #define.
1111         (speed_mpn_rootrem): Declare.
1112         * tune/common.c (speed_mpn_rootrem): New function.
1113         * tune/speed.c (routine): Add entry for mpn_rootrem.
1114
1115 2004-04-16  Kevin Ryde  <kevin@swox.se>
1116
1117         * doc/fdl.texi: Update from FSF, just fixing a couple of typos.
1118
1119         * macos/configure, macos/Makefile.in: Add printf and scanf directories.
1120
1121         * tests/mpz/t-gcd.c (check_data): New function, exercising K6
1122         gcd_finda bug.
1123
1124 2004-04-14  Kevin Ryde  <kevin@swox.se>
1125
1126         * doc/gmp.texi (Reentrancy, Random State Initialization): Note
1127         gmp_randinit use of gmp_errno is not thread safe.  Reported by Vincent
1128         Lefèvre.
1129
1130         * doc/gmp.texi (Random State Initialization): Add index entries for
1131         gmp_errno and constants.
1132
1133         * mpn/m68k/README: Update _SHORT_LIMB -> __GMP_SHORT_LIMB.
1134
1135         * configure.in (--enable-mpbsd): Typo Berkley -> Berkeley in help msg.
1136
1137 2004-04-12  Kevin Ryde  <kevin@swox.se>
1138
1139         * demos/perl/GMP.xs (static_functable): New macro, use it for all
1140         function tables, to support mingw DLL builds.
1141         * demos/perl/INSTALL (NOTES FOR PARTICULAR SYSTEMS): Remove note on
1142         DLLs, should be ok now.
1143
1144         * demos/perl/sample.pl: Print the module and library versions in use.
1145
1146         * demos/perl/GMP.pm, Makefile.PL (VERSION): Set to '2.00'.
1147         * demos/perl/GMP.pm (COPYRIGHT): New in the doc section.
1148
1149         * Makefile.am: Note 4.1.3 libtool versioning info, and REVISION policy.
1150
1151         * tal-debug.c: Add <stdlib.h> for abort.
1152
1153 2004-04-07  Torbjorn Granlund  <tege@swox.com>
1154
1155         * tests/refmpf.c (refmpf_add_ulp): Adjust exponent when needed.
1156
1157         * mpn/generic/random2.c: Rewrite (clone mpz/rrandomb.c).
1158
1159 2004-04-07  Kevin Ryde  <kevin@swox.se>
1160
1161         * mpn/x86/k6/gcd_finda.asm: Correction jbe -> jb in initial setups.
1162         Zero flag is wrong here, it relects only the high limb of the compare,
1163         leading to n1>=n2 not satisfied and wrong results.  cp[1]==0x7FFFFFFF
1164         with cp[0]>=0x80000001 provokes this.
1165
1166         * doc/gmp.texi (BSD Compatible Functions): Note "pow" name clash under
1167         the pow function description too.
1168         (Language Bindings): Add XEmacs (betas at this stage).  Reported by
1169         Jerry James.
1170
1171         * tests/refmpn.c (refmpn_mod2): Correction to ASSERTs, r==a is allowed.
1172
1173         * gen-psqr.c (generate_mod): Cast mpz_invert_ui_2exp args, for K&R.
1174         * gen-bases.c, gen-fib.c, gen-psqr.c: For mpz_out_str, use stdout
1175         instead of 0, in case a K&R treats int and FILE* params differently.
1176
1177 2004-04-04  Kevin Ryde  <kevin@swox.se>
1178
1179         * gmp-impl.h (BSWAP_LIMB) [amd64]: New macro.
1180         (FORCE_DOUBLE): Use this for amd64 too.
1181
1182         * tests/amd64check.c, tests/amd64call.asm: New files, derived in part
1183         from x86check.c and x86call.asm.
1184         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add them.
1185         * configure.in (x86_64-*-* ABI=64): Use them.
1186
1187 2004-04-03  Kevin Ryde  <kevin@swox.se>
1188
1189         * mpn/amd64/mode1o.asm: New file.
1190         * mpn/amd64/amd64-defs.m4 (ASSERT): New macro.
1191
1192         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/pentium4/sse2/divrem_1.asm: Add
1193         note on how "dr" part of algorithm is handled.
1194
1195         * mpn/x86/k7/dive_1.asm, mpn/x86/k7/mod_34lsub1.asm,
1196         mpn/x86/k7/mode1o.asm: Note Hammer (32-bit mode) speeds.
1197
1198 2004-03-31  Kevin Ryde  <kevin@swox.se>
1199
1200         * doc/gmp.texi (Language Bindings): Add GOO, MLGMP and Numerix.
1201
1202         * mpf/mul_2exp.c, mpf/div_2exp.c: Rate u==0 as UNLIKELY.
1203
1204 2004-03-27  Torbjorn Granlund  <tege@swox.com>
1205
1206         * mpn/generic/divrem_1.c: Fix typo.
1207
1208         * mpn/generic/sqr_basecase.c: Fix typo.
1209
1210 2004-03-20  Kevin Ryde  <kevin@swox.se>
1211
1212         * longlong.h (power, powerpc): Add comments on how we select this code.
1213
1214         * gmp-h.in (mpz_get_ui): Use ?: instead of mask style, gcc treats the
1215         two identically but ?: is a bit clearer.
1216
1217         * insert-dbl.c: Remove file, no longer used, scaling is now integrated
1218         in mpn_get_d.
1219         * Makefile.am (libgmp_la_SOURCES): Remove insert-dbl.c.
1220         * gmp-impl.h (__gmp_scale2): Remove prototype.
1221
1222 2004-03-17  Kevin Ryde  <kevin@swox.se>
1223
1224         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init, fake_cpuid_table): Add x86_64.
1225
1226         * mpq/get_d.c: Use mpn_tdiv_qr, demand den>0 per canonical form.
1227
1228 2004-03-16  Torbjorn Granlund  <tege@swox.com>
1229
1230         * mpn/generic/sqr_basecase.c: Add versions using mpn_addmul_2 and
1231         mpn_addmul_2s.
1232
1233 2004-03-14  Kevin Ryde  <kevin@swox.se>
1234
1235         * mpf/mul_ui.c: Incorporate carry from low limbs, for exactness.
1236         * tests/mpf/t-mul_ui.c: New file.
1237         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1238
1239         * mpf/div.c: Use mpn_tdiv_qr.  Use just one TMP_ALLOC.  Use full
1240         divisor, since truncating can lose accuracy.
1241         * tests/mpf/t-div.c: New file.
1242         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1243
1244         * tests/mpf/t-set_q.c, tests/mpf/t-ui_div.c (check_various): Amend
1245         bogus 99/4 test.
1246         * tests/mpf/t-ui_div.c (check_rand): Exercise r==v overlap.
1247
1248         * tests/refmpf.c, tests/tests.h (refmpf_set_overlap): New function.
1249
1250         * mpf/cmp_si.c [nails]: Correction, cast vval in exp comparisons, for
1251         when vval=-0x800..00 and limb==longlong.
1252
1253         * mpf/cmp_si.c [nails]: Correction, return usign instead of 1 when
1254         uexp==2 but value bigger than an mp_limb_t.
1255         * tests/mpf/t-cmp_si.c (check_data): Add test cases.
1256
1257         * tests/trace.c (mpf_trace): Use ABS(mp_trace_base) to allow for
1258         negative bases used for upper case hex in integer traces.
1259
1260 2004-03-12  Torbjorn Granlund  <tege@swox.com>
1261
1262         * mpn/generic/sb_divrem_mn.c: Correct header comment.
1263
1264 2004-03-11  Kevin Ryde  <kevin@swox.se>
1265
1266         * aclocal.m4, configure, ltmain.sh: Downgrade to libtool 1.5, version
1267         1.5.2 doesn't remove .libs/*.a files when rebuilding, which is bad for
1268         development when changing contents or with duplicate named files like
1269         we have.
1270
1271         Revert this, ie restore AR_FLAGS=cq:
1272         * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
1273         does this itself on detecting duplicate object filenames in piecewise
1274         linking mode.
1275
1276         * randbui.c, randmui.c [longlong+nails]: Correction to conditionals
1277         for second limb.
1278
1279         * mpz/aors_ui.h, mpz/cdiv_q_ui.c, mpz/cdiv_qr_ui.c, mpz/cdiv_r_ui.c,
1280         mpz/cdiv_ui.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr_ui.c, mpz/fdiv_r_ui.c,
1281         mpz/fdiv_ui.c, mpz/gcd_ui.c, mpz/iset_ui.c, mpz/lcm_ui.c,
1282         mpz/set_ui.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr_ui.c, mpz/tdiv_r_ui.c,
1283         mpz/tdiv_ui.c, mpz/ui_sub.c, mpf/div_ui.c, mpf/mul_ui.c
1284         [longlong+nails]: Amend #if to avoid warnings about shift amount.
1285
1286 2004-03-07  Kevin Ryde  <kevin@swox.se>
1287
1288         * mpf/reldiff.c: Use rprec+ysize limbs for d, to ensure accurate
1289         result.  Inline mpf_abs(d,d) and mpf_cmp_ui(x,0), and rate the latter
1290         UNLIKELY.
1291
1292         * mpf/ui_div.c: Use mpn_tdiv_qr.  Use just one TMP_ALLOC.  Use full
1293         divisor, since truncating can lose accuracy.
1294         * tests/mpf/t-ui_div.c: New file.
1295         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1296
1297         * mpf/set_q.c: Expand TMP_ALLOC_LIMBS_2, to make conditional clearer
1298         and avoid 1 limb alloc when not wanted.
1299
1300         * gmp-impl.h (WANT_TMP_DEBUG): Define to 0 if not defined.
1301         (TMP_ALLOC_LIMBS_2): Use "if" within macro rather than "#if", for less
1302         preprocessor conditionals.
1303
1304         * mpf/mul_2exp.c, mpf/div_2exp.c: Add some comments.
1305
1306         * tests/refmpn.c (refmpn_sb_divrem_mn, refmpn_tdiv_qr): Nailify.
1307
1308 2004-03-04  Kevin Ryde  <kevin@swox.se>
1309
1310         * gen-psqr.c (print): Add CNST_LIMB in PERFSQR_MOD_TEST, for benefit
1311         of K&R.
1312         * tests/mpn/t-perfsqr.c (PERFSQR_MOD_1): Use CNST_LIMB for K&R.
1313
1314         * doc/configuration (Configure): Remove mkinstalldirs, no longer used.
1315
1316         * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
1317         does this itself on detecting duplicate object filenames in piecewise
1318         linking mode.
1319
1320         * configure.in (hppa2.0*-*-*): Test sizeof(long) == 4 or 8 to verify
1321         ABI=2.0n versus ABI=2.0w.  In particular this lets CC=cc_bundled
1322         correctly fall back to ABI=2.0n (we don't automatically add CC=+DD64
1323         to that compiler, currently).
1324
1325         * doc/gmp.texi (Reentrancy): Note C++ mpf_class constructors using
1326         global default precision.
1327         (Random State Miscellaneous): Describe gmp_urandomb_ui as giving N
1328         bits.
1329         (C++ Interface Floats): Describe operator= copying the value, not the
1330         precision, and what this can mean about copy constructor versus
1331         default constructor plus assignment.
1332
1333         * mpf/set_q.c: Use mpn_tdiv_qr rather than mpn_divrem, so no shifting.
1334         Don't truncate the divisor, it can make the result inaccurate.
1335         * tests/mpf/t-set_q.c: New file.
1336         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1337
1338         * mpf/set.c: Use MPN_COPY_INCR, in case r==u and ABSIZ(u) > PREC(r)+1.
1339         No actual bug here, because MPN_COPY has thusfar been an alias for
1340         MPN_COPY_INCR, only an ASSERT failure.
1341         * tests/mpf/t-set.c: New file.
1342         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1343
1344         * mpf/set.c, mpf/iset.c: Do MPN_COPY last, for possible tail call.
1345
1346         * mpf/set_d.c: Rate d==0 as UNLIKELY.  Store size before extract call,
1347         to shorten lifespan of "negative".
1348
1349         * mpf/init.c, mpf/init2.c, mpf/iset_d.c, mpf/iset_si.c,
1350         mpf/iset_str.c, mpf/iset_ui.c: Store prec before alloc call, for one
1351         less live quantity across that call.
1352         * mpf/init.c, mpf/init2.c, mpf/iset_str.c: Store size and exp before
1353         alloc call, to overlap with other operations.
1354
1355         * tests/refmpf.c, tests/tests.h (refmpf_fill, refmpf_normalize,
1356         refmpf_validate, refmpf_validate_division): New functions.
1357
1358         * tests/refmpn.c, tests/tests.h (refmpn_copy_extend,
1359         refmpn_lshift_or_copy_any, refmpn_rshift_or_copy_any): New functions.
1360
1361         * tal-debug.c: Add <string.h> for strcmp.
1362
1363         * tests/cxx/t-istream.cc (check_mpz, check_mpq, check_mpf): Use size_t
1364         for loop index, to quieten g++ warning.
1365
1366 2004-03-01  Torbjorn Granlund  <tege@swox.com>
1367
1368         With Karl Hasselström:
1369         * mpn/generic/dc_divrem_n.c (mpn_dc_div_2_by_1): New function, with
1370         meat from old mpn_dc_divrem_n.  Accept scratch parameter.  Rewrite to
1371         avoid a recursive call.
1372         (mpn_dc_div_3_by_2): New function, with meat from old
1373         mpn_dc_div_3_halves_by_2.  Accept scratch parameter.
1374         (mpn_dc_divrem_n): Now just allocate scratch space and call new
1375         mpn_dc_div_2_by_1.
1376
1377 2004-02-29  Kevin Ryde  <kevin@swox.se>
1378
1379         * longlong.h (count_leading_zeros) [alpha gcc]: New version, inlining
1380         mpn/alpha/cntlz.asm cmpbge technique.
1381
1382         * aclocal.m4, configure, install-sh, missing, ltmain.sh,
1383         */Makefile.in: Update to automake 1.8.2 and libtool 1.5.2.
1384
1385         * doc/gmp.texi (C++ Interface Integers): Note / and % rounding follows
1386         C99 / and %.
1387         (Exact Remainder): Index entries for divisibility testing algorithm.
1388
1389         * tune/time.c (speed_endtime): Return 0.0 for negative time measured.
1390         Revise usage comments for clarity.
1391         * tune/common.c (speed_measure): Recognise speed_endtime 0.0 for
1392         failed measurement.
1393
1394         * tests/mpn/t-get_d.c (check_rand): Correction to nhigh_mask setup.
1395
1396 2004-02-27  Torbjorn Granlund  <tege@swox.com>
1397
1398         * tune/tuneup.c (tune_dc, tune_set_str): Up param.step_factor.
1399
1400         * tests/mpz/t-gcd.c: Decrease # of tests to 50.
1401
1402 2004-02-27  Kevin Ryde  <kevin@swox.se>
1403
1404         * tests/devel/try.c: Add a comment that this is not for Cray systems.
1405
1406         * mpf/set_q.c: Don't support den(q)<0, demand canonical form in the
1407         usual way.
1408
1409 2004-02-24  Torbjorn Granlund  <tege@swox.com>
1410
1411         From Kevin:
1412         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Loop until normalization
1413         criterion met.
1414
1415 2004-02-22  Kevin Ryde  <kevin@swox.se>
1416
1417         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_OS_X86_XMM, GMP_PROG_CXX_WORKS):
1418         Remove files that might look like compiler output, so our "||"
1419         alternatives are not fooled.
1420
1421         * acinclude.m4 (GMP_PROG_CC_WORKS): Add test for lshift_com code
1422         mis-compiled by certain IA-64 HP cc at +O3.
1423
1424         * gmp-impl.h (USE_LEADING_REGPARM): Disable under prof or gprof, for
1425         the benefit of freebsd where .mcount clobbers registers.  Spotted by
1426         Torbjorn.
1427         * configure.in (WANT_PROFILING_PROF, WANT_PROFILING_GPROF): New
1428         AC_DEFINEs.
1429
1430 2004-02-21  Kevin Ryde  <kevin@swox.se>
1431
1432         * configure.in (sparc64-*-*bsd*): Amend -m32 setup for ABI=32, so it's
1433         not used in ABI=64 on the BSD systems.
1434
1435 2004-02-18  Niels Möller  <nisse@lysator.liu.se>
1436
1437         * tests/mpz/t-gcd.c (gcdext_valid_p): New function.
1438         (ref_mpz_gcd): Deleted function.
1439         (one_test): Rearranged to call mpz_gcdext first, so that the
1440         returned value can be validated.
1441         (main): Don't use ref_mpz_gcd.
1442
1443 2004-02-18  Torbjorn Granlund  <tege@swox.com>
1444
1445         * gmp-impl.h (MPN_TOOM3_MAX_N): Move to !WANT_FFT section.
1446
1447         * tests/mpz/t-mul.c: Exclude special huge operands unless WANT_FFT.
1448
1449         * mpz/rrandomb.c (gmp_rrandomb): Rewrite.
1450
1451         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Remove write-only variable c5.
1452
1453 2004-02-18  Kevin Ryde  <kevin@swox.se>
1454
1455         * mpf/iset_si.c, mpf/iset_ui.c, mpf/set_si.c, mpf/set_ui.c [nails]:
1456         Always store second limb, to avoid a conditional.
1457
1458         * tests/mpf/t-get_ui.c: New file.
1459         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1460         * tests/mpf/t-get_si.c (check_limbdata): Further tests.
1461         * gmp-impl.h (MP_EXP_T_MAX, MP_EXP_T_MIN): New defines.
1462
1463         * mpf/get_ui.c, mpf/get_si.c: Remove size==0 test, it's covered by
1464         other conditions.  Attempt greater clarity by expressing conditions as
1465         based on available data range.
1466         * mpf/get_si.c [nails]: Correction, don't bail on exp > abs_size,
1467         since may still have second limb above radix point available.
1468         * mpf/get_ui.c: Nailify.
1469
1470 2004-02-16  Kevin Ryde  <kevin@swox.se>
1471
1472         * mpz/scan0.c, mpz/scan1.c: Use count_trailing_zeros, instead of
1473         count_leading_zeros on limb&-limb.
1474
1475         * mpf/sqrt.c: Use "/ 2" for exp, avoiding C undefined behaviour on
1476         ">>" of negatives.  Correction to comment, exp is rounded upwards.
1477         SIZ(r) always prec now, no need for tsize expression.  Store EXP(r)
1478         and SIZ(r) where calculated to reduce variable lifespans.  Make tsize
1479         mp_size_t not mp_exp_t, though of course those are currently the same.
1480
1481         * gmp-h.in (GMP_ERROR_ALLOCATE, GMP_ERROR_BAD_STRING,
1482         GMP_ERROR_UNUSED_ERROR): Remove, never used or documented, and we
1483         don't want to use globals for communicating error information.
1484
1485         * mpz/gcd_ui.c [nails]: Correction, actually return a value.
1486
1487         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails==1]: Add code.
1488
1489 2004-02-15  Kevin Ryde  <kevin@swox.se>
1490
1491         * tests/mpz/t-jac.c (check_data): Remove unnecessary variable
1492         "answer".
1493
1494 2004-02-14  Kevin Ryde  <kevin@swox.se>
1495
1496         * acinclude.m4 (GMP_C_RIGHT_SHIFT): Note that it's "long"s which we're
1497         concerned about.
1498
1499         * mpn/generic/mul_n.c: Add some remarks about toom3 high zero
1500         stripping.
1501
1502         * mpn/generic/scan0.c, mpn/generic/scan1.c: Remove design issue
1503         remarks.  What to do about going outside `up' space is a problem, but
1504         anything to address it would be an incompatible change.
1505
1506 2004-02-11  Kevin Ryde  <kevin@swox.se>
1507
1508         * longlong.h (power, powerpc): Use HAVE_HOST_CPU_FAMILY_power and
1509         HAVE_HOST_CPU_FAMILY_powerpc rather than various cpp defines.
1510
1511         * gmp-impl.h: Add remarks about limits.h and Cray etc.
1512
1513         * dumbmp.c (mpz_mul): Set ALLOC(r) for new data block used.  Reported
1514         by Jason Moxham.
1515
1516         * mpn/pa32/README, mpn/pa64/README (REFERENCES): New sections.
1517
1518 2004-02-10  Torbjorn Granlund  <tege@swox.com>
1519
1520         * tests/mpz/t-gcd.c: Decrease # of tests run.
1521
1522         * mpn/*/gmp-mparam.h: Add HGCD values, update TOOM values.
1523
1524 2004-02-01  Torbjorn Granlund  <tege@swox.com>
1525
1526         From Kevin:
1527         * config.guess: Recognize AMD's hammer processors, return x86_64.
1528
1529 2004-01-24  Kevin Ryde  <kevin@swox.se>
1530
1531         * tests/mpf/t-sqrt.c (check_rand1): Further diagnostic printouts.
1532
1533         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Add ASSERT_MPN.
1534         (mpn_dc_sqrtrem): Add casts for K&R.
1535
1536         * mpf/sqrt_ui.c: Nailify.
1537
1538         * mpf/set_z.c: Do MPN_COPY last, for possible tail call.
1539
1540         * doc/gmp.texi (Miscellaneous Float Functions): For mpf_random2, note
1541         exponent is in limbs.
1542
1543 2004-01-22  Kevin Ryde  <kevin@swox.se>
1544
1545         * mpf/sqrt.c: Change tsize calculation to get prec limbs result
1546         always, previously got prec+1 when exp was odd.
1547         * tests/mpf/t-sqrt.c (check_rand1): New function, code from main.
1548         (check_rand2): New function.
1549
1550         * mpf/sqrt_ui.c: Change rsize calculation to get prec limbs result,
1551         previously got prec+1.
1552         * tests/mpf/t-sqrt_ui.c: New file.
1553         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
1554
1555         * tests/refmpf.c, tests/tests.h (refmpf_add_ulp,
1556         refmpf_set_prec_limbs): New functions.
1557
1558         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Remove x86+m68k force to double,
1559         mpn_get_d now does this.  Remove res==1.0 check for round upwards,
1560         mpn_get_d now rounds towards zero.  Move exp store to make mpn_get_d a
1561         tail call.
1562
1563         * configure.in (x86-*-*): Use ABI=32 rather than ABI=standard.
1564         Use gcc -m32 when available, to force mode on bi-arch amd64 gcc.
1565         * configure.in, acinclude.m4 (x86_64-*-*): Merge into plain x86 setups
1566         as ABI=64.  Support ABI=32, using athlon code.  Use gcc -mcpu=k8,
1567         -march=k8.
1568         (amd64-*-*): Remove pattern, config.sub only gives x86_64.
1569         * doc/gmp.texi (ABI and ISA): Add x86_64 dual ABIs.
1570
1571         * mpn/amd64/README: Add reference to ABI spec.
1572
1573 2004-01-17  Kevin Ryde  <kevin@swox.se>
1574
1575         * tune/README: Remove open/mpn versions of toom3, no longer exist.
1576         * tune/powerpc64.asm: Remove unused L(again).
1577         * tune/time.c (mftb): Note single mftb possible for powerpc64.
1578
1579         * mpn/generic/mode1o.c: Use "c<s" to do underflow detection in last
1580         step, for better parallelism.
1581
1582         * mpn/generic/get_d.c: Preserve comments about hppa fcnv,udw,dbl from
1583         previous mpz_get_d code.
1584
1585         * tune/freq.c: Add some comments about systems not covered.
1586
1587         * gmp-h.in (_GMP_H_HAVE_FILE): Add _MSL_STDIO_H for Metrowerks.
1588         Reported by Tomas Zahradnicky.
1589
1590 2004-01-16  Kevin Ryde  <kevin@swox.se>
1591
1592         * configure.in (powerpc64-*-linux*): Try gcc64.  Try -m64 with
1593         "cflags_maybe" to get it used in all probing.  Add sizeof-long-8 test
1594         to check the mode is right if -m64 is not applicable.
1595
1596 2004-01-15  Kevin Ryde  <kevin@swox.se>
1597
1598         * configure.in (--with-readline=detect): Check for readline/readline.h
1599         and readline/history.h.  Report result of detection.
1600
1601 2004-01-12  Niels Möller  <nisse@lysator.liu.se>
1602
1603         * tests/tests.h: Added refmpn_free_limbs prototype.
1604         * tests/refmpn.c (refmpn_free_limbs): New function.
1605
1606 2004-01-11  Kevin Ryde  <kevin@swox.se>
1607
1608         * mpn/alpha/ev6/slot.pl: New file, derived in part from
1609         mpn/x86/k6/cross.pl.
1610
1611         * mpn/alpha/alpha-defs.m4 (ASSERT): New macro.
1612
1613         * mpn/asm-defs.m4 (m4_ifdef): New macro, avoiding OSF 4.0 m4 bug.
1614         (m4_assert_defined): Use it.
1615
1616         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (LDGP): New macro.
1617         * mpn/alpha/ev67/gcd_1.asm: Use it to re-establish gp after jsr.
1618
1619         * configure.in, demos/calc/Makefile.am: Use -lcurses or -lncurses with
1620         readline, when available.
1621
1622         * longlong.h (sub_ddmmss) [generic]: Use al<bl for the borrow rather
1623         than __x>al, since the former can be done without waiting for __x,
1624         helping superscalar chips, in particular alpha ev5 and ev6.
1625
1626         * longlong.h (sub_ddmmss) [ia64]: New macro.
1627
1628         * tests/t-sub.c: New file.
1629         * tests/Makefile.am (check_PROGRAMS): Add it.
1630         * tests/refmpn.c, tests/tests.h (refmpn_sub_ddmmss): New function.
1631
1632 2004-01-09  Kevin Ryde  <kevin@swox.se>
1633
1634         * mpn/x86/p6/mod_34lsub1.asm: New file, derived in part from
1635         mpn/x86/mod_34lsub1.asm.
1636
1637         * configure.in (IA64_PATTERN): Use -mtune on gcc 3.4.
1638
1639 2004-01-07  Kevin Ryde  <kevin@swox.se>
1640
1641         * gmp-h.in, mp-h.in (__GMP_SHORT_LIMB): Renamed from _SHORT_LIMB, to
1642         keep in our namespace.  (Not actually used anywhere currently.)
1643         Reported by Patrick Pelissier.
1644
1645         * mp-h.in: Use "! defined (__GMP_WITHIN_CONFIGURE)" in the same style
1646         as gmp-h.in (though mp-h.in is not actually used during configure).
1647
1648         * mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
1649         Use __dllexport__ and __dllimport__ to keep out of application
1650         namespace.  Same previously done in gmp-h.in.
1651
1652 2004-01-06  Kevin Ryde  <kevin@swox.se>
1653
1654         * configfsf.sub, configfsf.guess: Update to 2004-01-05.
1655         * configure.in (amd64-*-* | x86_64-*-*): Update comments on what
1656         configfsf.sub does.
1657
1658 2004-01-04  Kevin Ryde  <kevin@swox.se>
1659
1660         * mpn/alpha/README (REFERENCES): Add tru64 assembly manuals.
1661         (ASSEMBLY RULES): Note what gcc says about !literal! etc.
1662
1663 2004-01-03  Kevin Ryde  <kevin@swox.se>
1664
1665         * mpn/alpha/ev67/gcd_1.asm: New file.
1666
1667         * mpn/x86/pentium4/sse2/rsh1add_n.asm: New file, derived in part from
1668         mpn/x86/pentium4/sse2/addlsh1_n.asm.
1669
1670         * mpn/x86/p6/p3mmx/popham.asm: Note measured speeds.
1671
1672         * mpn/x86/pentium4/sse2/addlsh1_n.asm (PARAM_CARRY): Remove macro, not
1673         used, no such parameter.
1674
1675         * mpn/generic/gcd.c: Use <stdio.h> for NULL.
1676
1677         * doc/gmp.texi (Single Limb Division): Correction to tex expression
1678         for (1/2)x1.  And minor wording tweaks elsewhere.
1679
1680         * gmp-impl.h (mpn_rsh1add_n, mpn_rsh1sub_n): Correction to comments
1681         about how carries returned.
1682
1683         * longlong.h (umul_ppmm) [generic]: Add comments about squaring
1684         (dropped from tasks list)
1685
1686 2003-12-31  Kevin Ryde  <kevin@swox.se>
1687
1688         * demos/perl/GMP.xs (scan0, scan1): Return ~0 for not-found.
1689         * demos/perl/GMP.pm: Describe this, remove the note about ULONG_MAX
1690         being the same as ~0 (which is not true in old perl).
1691         * demos/perl/test.pl: Update tests.
1692         * demos/perl/typemap (gmp_UV): New type.
1693
1694         * demos/perl/test.pl (fits_slong_p): Comment out uv_max test, it won't
1695         necessarily exceed a long.
1696
1697         * demos/perl/GMP.pm: Add a remark about get_str to the bugs section.
1698
1699         * mpn/generic/sqrtrem.c, mpz/fac_ui.c, tests/mpf/reuse.c: Add casts
1700         for K&R.
1701         * tests/mpf/t-muldiv.c: Make ulimb, vlimb into ulongs, which is how
1702         they're used, for the benefit of K&R calling.
1703
1704         * doc/gmp.texi (Square Root Algorithm): Add a summary of the algorithm.
1705         And add further index entries in various places.
1706
1707         * mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
1708
1709         * gmp-impl.h, mpn/generic/mul_n.c (mpn_addlsh1_n, mpn_sublsh1_n,
1710         mpn_rsh1add_n, mpn_rsh1sub_n): Move descriptions to gmp-impl.h with
1711         the prototypes, for ease of locating.
1712
1713 2003-12-29  Torbjorn Granlund  <tege@swox.com>
1714
1715         * tests/mpz/t-gcd.c: Rewrite, based on suggestions by Kevin.
1716
1717         * mpn/sparc64/README: Remove mpn_Xmul_2, done.
1718         Add blurb about L1 cache conflicts.
1719
1720 2003-12-29  Kevin Ryde  <kevin@swox.se>
1721
1722         * mpn/generic/mul_fft.c, mpz/root.c, mpq/cmp_ui.c: Add casts for K&R.
1723
1724 2003-12-27  Kevin Ryde  <kevin@swox.se>
1725
1726         * tests/mpz/t-mul.c (mul_kara, mul_basecase): Use __GMP_PROTO.
1727
1728         * Makefile.am (AUTOMAKE_OPTIONS): Restore this, giving no directory on
1729         ansi2knr to avoid a circular build rule.
1730         * configure.in (AM_INIT_AUTOMAKE): Note options also in Makefile.am.
1731
1732         * configure.in (cflags_maybe): Don't loop adding cflags_maybe if the
1733         user has set CFLAGS.
1734
1735 2003-12-23  Kevin Ryde  <kevin@swox.se>
1736
1737         * configure.in (*sparc*-*-*): Test sizeof(long)==4 or 8 for ABIs, to
1738         get the right mode when the user sets the CFLAGS.
1739         (testlist): Introduce "any_<abi>_testlist" to apply to all compilers.
1740
1741         * demos/perl/typemap (MPZ_ASSUME, MPQ_ASSUME, MPF_ASSUME): Remove
1742         output rules, these are only meant for inputs.
1743         (MPZ_MUTATE): Remove, not used since changes for magic.
1744
1745         * demos/perl/GMP.xs (mpz_class_hv, mpq_class_hv, mpf_class_hv): New
1746         variables, initialized in BOOT.
1747         * demos/perl/GMP.xs, demos/perl/typemap: Use them and explicit
1748         sv_bless, to save a gv_stashpv for every new object.
1749
1750 2003-12-22  Kevin Ryde  <kevin@swox.se>
1751
1752         * mpn/alpha/mode1o.c, mpn/alpha/dive_1.c: Moved from ev5/mode1o.c and
1753         ev5/dive_1.c, these are good for ev4, and would like them in a generic
1754         alpha build.
1755
1756 2003-12-21  Kevin Ryde  <kevin@swox.se>
1757
1758         * doc/gmp.texi (Integer Logic and Bit Fiddling): Say "bitwise" in
1759         mpz_and, mpz_ior and mpz_xor, to avoid any confusion with what C means
1760         by "logical".  Reported by Rüdiger Schütz.
1761
1762         * gmp-h.in (_GMP_H_HAVE_FILE): Note why defined(EOF) is not good.
1763
1764 2003-12-20  Kevin Ryde  <kevin@swox.se>
1765
1766         * tune/speed.h (SPEED_TMP_ALLOC_LIMBS): Correction to last change,
1767         don't want "- 1" on the TMP_ALLOC_LIMBS.
1768
1769         * demos/expr/expr.h: Test #ifdef MPFR_VERSION_MAJOR for when mpfr.h is
1770         included, not GMP_RNDZ which is now an enum.
1771
1772         * demos/expr/exprfra.c (e_mpfr_ulong_p): Use mpfr_integer_p and
1773         mpfr_fits_ulong_p.
1774         (e_mpfr_get_ui_fits): Use mpfr_get_ui.
1775
1776         * mpfr/*: Update to mpfr cvs head 2003-12-20.
1777
1778         * configure, config.in: Update to autoconf 2.59.
1779         * */Makefile.in, configure, aclocal.m4, ansi2knr.c, install-sh,
1780         doc/mdate-sh: Update to automake 1.8.
1781
1782         * mkinstalldirs: Remove, not required by automake 1.8.
1783         * doc/gmp.texi (Build Options): HTML is a usual target in automake 1.8.
1784
1785         * configure.in (AC_PREREQ): Require autoconf 2.59.
1786         (AM_INIT_AUTOMAKE): Require automake 1.8.
1787         (AC_C_INLINE): Use rather than GMP_C_INLINE, now has #ifndef
1788         __cplusplus we want.
1789         (gettimeofday): Use AC_CHECK_FUNCS rather than our workaround code,
1790         autoconf now ok.
1791
1792         * acinclude.m4 (GMP_C_INLINE): Remove.
1793         (GMP_H_EXTERN_INLINE): Use AC_C_INLINE.
1794         (GMP_PROG_AR): Comment on automake $ARFLAGS.
1795
1796 2003-12-19  Torbjorn Granlund  <tege@swox.com>
1797
1798         * tests/mpf/t-get_d.c: Print message before aborting.
1799
1800         * mpn/generic/get_d.c: Make ONE_LIMB case actually work for nails.
1801
1802 2003-12-18  Torbjorn Granlund  <tege@swox.com>
1803
1804         * mpz/get_d.c: Don't include longlong.h.
1805
1806         * tests/mpz/t-mul.c (ref_mpn_mul): Handle un == vn specially, to avoid
1807         a dummy r/w outside of allocated area.
1808
1809 2003-12-18  Kevin Ryde  <kevin@swox.se>
1810
1811         * mpn/alpha/unicos.m4 (ALIGN): Add comments on what GCC does.
1812
1813         * configure.in (fat setups), acinclude.m4 (GMP_INIT): Obscure
1814         include() from automake 1.8 aclocal.
1815         * acinclude.m4: Quote names in AC_DEFUN, for automake 1.8 aclocal.
1816
1817 2003-12-13  Kevin Ryde  <kevin@swox.se>
1818
1819         * mpq/get_d.c: Amend comments per mpn_get_d change.
1820         (limb2dbl): Remove, no longer used.
1821
1822         * gmp-impl.h (DIVREM_1_NORM_THRESHOLD etc) [nails]: Correction to
1823         comments, MP_SIZE_T_MAX means preinv never.
1824
1825         * gmp-impl.h (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD) [nails]:
1826         Remove overrides, divexact_1 and modexact_1 have been nailified.
1827
1828         * mpz/inp_str.c (mpz_inp_str_nowhite): Use ASSERT_ALWAYS for EOF value
1829         requirement.
1830
1831         * tests/refmpn.c (refmpn_rsh1add_n, refmpn_rsh1sub_n): Parens around
1832         GMP_NUMB_BITS - 1 with ">>", to quieten gcc -Wall.
1833         * tests/t-constants.c (main), tests/t-count_zeros.c (check_clz),
1834         tests/t-modlinv.c (one), tests/mpz/t-jac.c (try_si_zi),
1835         tests/mpq/t-get_d.c (check_onebit): : Correction to printfs.
1836         * tests/mpn/t-fat.c: Add <string.h> for memcpy.
1837         * tests/mpz/t-scan.c (check_ref): Remove unused variable "isigned".
1838         * tests/mpq/t-get_d.c (check_onebit): Remove unused variable "limit".
1839         * tests/mpf/t-set_si.c, tests/mpf/t-set_ui.c (check_data): Braces for
1840         initializers.
1841         * tests/devel/try.c (mpn_divexact_by3_fun, mpn_modexact_1_odd_fun):
1842         Correction to return values.
1843
1844         * doc/gmp.texi (Miscellaneous Integer Functions): Note mpz_sizeinbase
1845         can be used to locate the most significant bit.  Reword a bit for
1846         clarity.
1847
1848 2003-12-11  Torbjorn Granlund  <tege@swox.com>
1849
1850         * gmp-impl.h: Change asm => __asm__, tabify.
1851         * mpz/get_d_2exp.c: Likewise.
1852         * mpf/get_d_2exp.c: Likewise.
1853
1854         * tests/cxx/t-ops.cc: #if .. #endif out tests that cause ambiguities.
1855
1856 2003-12-10  Torbjorn Granlund  <tege@swox.com>
1857
1858         * tests/mpz/t-gcd.c: Generate operands with sizes as a geometric
1859         progression, to allow for larger operands and less varying timing.
1860
1861 2003-12-10  Kevin Ryde  <kevin@swox.se>
1862
1863         * demos/perl/test.pl: Should be $] for perl version in old perl.
1864
1865         * configure.in (sparc64-*-*): Single block of gcc configs for all
1866         systems, on unknown systems try both ABI 32 and 64.
1867
1868         * configure.in (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New AC_SUBSTs with
1869         options to generate .def files with windows DLLs.
1870         * Makefile.am (libgmp_la_LDFLAGS, libgmpxx_la_LDFLAGS): Use them.
1871
1872         * mpn/generic/gcd.c: Use ABOVE_THRESHOLD / BELOW_THRESHOLD, to follow
1873         convention and cooperate with tune/tuneup.c.
1874
1875         * tune/common.c, tune/speed.c, tune/speed.h, tune/speed-ext.c,
1876         tune/tuneup.c (SPEED_TMP_ALLOC_LIMBS): Take variable as parameter
1877         rather than returning a value, avoids alloca in a function call.
1878         * tune/common.c, tune/speed.h (speed_tmp_alloc_adjust): Remove, now
1879         inline in SPEED_TMP_ALLOC_LIMBS, and using ptr-NULL for alignment
1880         extraction.
1881
1882         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal,
1883         __gmp_binary_less, __gmp_binary_less_equal, __gmp_binary_greater,
1884         __gmp_binary_greater_equal, __gmp_cmp_function): Use mpfr_cmp_si and
1885         mpfr_cmp_d.
1886         * tests/cxx/t-ops.cc: Exercise this.
1887
1888         * demos/perl/Makefile.PL: Don't install sample.pl and test2.pl.
1889
1890         * demos/perl/GMP.xs (use_sv): Prefer PV over IV or NV to avoid any
1891         rounding.
1892         * demos/perl/test.pl: Exercise this.
1893
1894         * demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage.
1895         * demos/perl/test.pl: Exercise this.
1896
1897 2003-12-08  Kevin Ryde  <kevin@swox.se>
1898
1899         * demos/perl/GMP.pm: Correction to canonicalize example.
1900
1901         * demos/perl/GMP.xs: New type check scheme, support magic scalars,
1902         support UV when available.  Remove some unused local variables.
1903         (coerce_long): Check range of double.
1904         (get_d_2exp): Remove stray printf.
1905
1906         * demos/perl/test.pl: Exercise magic, rearrange to make it clearer
1907         what's being tested.
1908
1909 2003-12-07  Kevin Ryde  <kevin@swox.se>
1910
1911         * tune/tuneup.c (mul_toom3_threshold): Use MUL_TOOM3_THRESHOLD_LIMIT,
1912         for the benefit of ASSERT in mpn_mul_n.
1913
1914         * tune/tuneup.c (tune_mul): Correction to toom3 param.min_size, should
1915         use MPN_TOOM3_MUL_N_MINSIZE.
1916
1917         * tune/speed.c (check_align_option): Correction to printf format.
1918         * tune/freq.c (freq_sysctl_hw_model): Remove unused "i" variable.
1919
1920         * scanf/doscan.c: Correction to a couple of trace printfs.
1921         Add <stdlib.h> for strtol.
1922
1923         * tests/misc/t-scanf.c (test_sscanf_eof_ok): New function.
1924         (check_misc): Use it to suppress tests broken by libc.
1925         And should be EOF rather than -1 in various places.
1926
1927 2003-12-06  Torbjorn Granlund  <tege@swox.com>
1928
1929         * mpn/generic/get_str.c (mpn_get_str, POW2_P case):
1930         Don't append extra '\0' byte.
1931
1932 2003-12-05  Niels Möller  <niels@lysator.liu.se>
1933
1934         * tune/speed.h (mpn_gcd_accel): Added prototype.
1935
1936 2003-12-05  Torbjorn Granlund  <tege@swox.com>
1937
1938         * randmt.c (__gmp_mt_recalc_buffer): Put parens around "&" expressions
1939         inside "!=".
1940
1941         * mpf/get_str.c: Remove unused variable "fracn".
1942
1943 2003-12-03  Kevin Ryde  <kevin@swox.se>
1944
1945         * configure.in, Makefile.am (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New
1946         AC_SUBSTs, use them to create .def files with Windows DLLs.
1947         * doc/gmp.texi (Notes for Particular Systems): Update notes on mingw
1948         DLL with MS C.
1949
1950         * mpz/export.c: Allow NULL for countp.
1951         * doc/gmp.texi (Integer Import and Export): Describe this.
1952         Suggested by Jack Lloyd.
1953
1954         * mpn/x86/p6/aors_n.asm: New file, grabbing the K7 code.
1955         Superiority of this reported by Patrick Pelissier.
1956
1957 2003-11-30  Kevin Ryde  <kevin@swox.se>
1958
1959         * mpn/alpha/ev67/popcount.asm, mpn/alpha/ev67/hamdist.asm: New files.
1960
1961         * mpn/alpha/ev67: New directory.
1962         * configure.in (alphaev67, alphaev68, alphaev7*): Use it.
1963
1964         * doc/gmp.texi (GMPrefu, GMPpxrefu): Change back to plain ref and
1965         pxref, remove macros.
1966         (GMPreftopu, GMPpxreftopu): Remove URL parameter, rename to GMPreftop
1967         and GMPpxreftop.
1968         (Debugging): Remove debauch, seems to have disappeared.
1969         (Language Bindings): Corrections to URLs for CLN, Omni F77, Pike.
1970
1971 2003-11-29  Kevin Ryde  <kevin@swox.se>
1972
1973         * demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
1974         about $#.
1975
1976         * demos/perl/GMP.xs (fits_slong_p): Use LONG_MAX+1 to avoid possible
1977         rounding of 0x7F..FF in a double on 64-bit systems.
1978
1979         * configure.in (ppc601-*-*): Remove this case, it never matched
1980         anything, the name adopted is powerpc601.
1981         (powerpc601-*-*): Use gcc -mcpu=601, xlc -qarch=601.
1982
1983         * configure.in: Introduce ${cc}_cflags_maybe, used if they work.
1984         (*sparc*-*-*) [ABI=32]: Add gcc_cflags_maybe=-m32 to force that mode.
1985
1986         * doc/gmp.texi (Introduction to GMP): Add AMD64 to optimizations list.
1987         (Build Options): Add cpu types alphaev7 and amd64.  Update texinfo
1988         html cross reference.
1989
1990 2003-11-28  Niels Möller  <nisse@lysator.liu.se>
1991
1992         * mpn/generic/gcd.c (MPN_LEQ_P): Copied macro definition (needed
1993         for compilation with --enable-assert).
1994
1995 2003-11-27  Niels Möller  <nisse@lysator.liu.se>
1996
1997         * tests/mpz/t-gcd.c (gcd_values): Moved definition, so that we
1998         don't need to forward declare the array.
1999
2000 2003-11-26  Torbjorn Granlund  <tege@swox.com>
2001
2002         * tests/mpz/t-gcd.c: Generate random operands up to 32767 bits;
2003         decrease # of test to 1000.
2004         (gcd_values): Remove oversize test case.
2005
2006 2003-11-26  Niels Möller  <niels@lysator.liu.se>
2007
2008         * tests/mpz/t-gcd.c (main): Added some tests with non-random
2009         input.
2010
2011 2003-11-25  Niels Möller  <nisse@lysator.liu.se>
2012
2013         * gmp-impl.h (MPN_LEQ_P, MPN_EXTRACT_LIMB): New macros.
2014
2015 2003-11-25  Kevin Ryde  <kevin@swox.se>
2016
2017         * doc/gmp.texi (Language Bindings): Add Axiom.
2018
2019 2003-11-22  Kevin Ryde  <kevin@swox.se>
2020
2021         * mpn/alpha/README: More notes on assembler syntax variations.
2022
2023         * mpn/alpha/alpha-defs.m4, mpn/alpha/unicos.m4 (unop): Should be ldq_u
2024         not bis, and move to alpha-defs.m4 since it can be happily used
2025         everywhere.
2026
2027         * mpn/alpha/alpha-defs.m4, mpn/alpha/default.m4, mpn/alpha/unicos.m4
2028         (bigend): Move to alpha-defs.m4 and base it on HAVE_LIMB_BIG_ENDIAN or
2029         HAVE_LIMB_LITTLE_ENDIAN, so as not to hard code system endianness.
2030
2031         * mpn/alpha/alpha-defs.m4: New file.
2032         * configure.in (alpha*-*-*): Use it.
2033
2034 2003-11-21  Kevin Ryde  <kevin@swox.se>
2035
2036         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-21.
2037
2038         * mpn/alpha/ev5/com_n.asm: Change "not" to "ornot r31", since "not"
2039         isn't recognised by on Cray Unicos.  Add missing "gp" to PROLOGUE.
2040         * mpn/alpha/README: Add a note on "not".
2041
2042 2003-11-19  Torbjorn Granlund  <tege@swox.com>
2043
2044         * mpn/alpha/aorslsh1_n.asm: Slightly rework feed-in code, avoiding
2045         spurious reads beyond operand limits.
2046
2047         * mpn/alpha/ev5/com_n.asm: Add ASM_START/ASM_END.
2048
2049         * mpn/generic/mul_fft.c (mpn_fft_zero_p): Remove unused function.
2050         (mpn_lshift_com): Make static, nailify properly.
2051
2052 2003-11-19  Kevin Ryde  <kevin@swox.se>
2053
2054         * mpn/generic/diveby3.c: Use a "q" variable to make it clearer what
2055         the code is doing.
2056
2057         * mpn/powerpc32/750/lshift.asm, mpn/powerpc32/750/rshift.asm: New
2058         files.
2059
2060         * mpn/alpha/ev5/com_n.asm: New file.
2061
2062         * doc/gmp.texi (Assembler Functional Units, Assembler Writing Guide):
2063         New sections by Torbjorn, tweaked by me.
2064
2065 2003-11-17  Torbjorn Granlund  <tege@swox.com>
2066
2067         * mpn/powerpc32: Add power4/powerpc970 cycle counts.
2068         Use cmpwi instead of cmpi to placate darwin.
2069
2070 2003-11-15  Kevin Ryde  <kevin@swox.se>
2071
2072         * config.guess: Add comments on MacOS "machine" command.
2073
2074         * tests/devel/try.c (main): Use gmp_randinit_default explicitly on
2075         __gmp_rands, since RANDS doesn't allow seeding.
2076
2077         * doc/gmp.texi (Assigning Integers): Remove notes on possible change
2078         to disallow whitespace, this would be an incompatible change and
2079         really can't be made.
2080         (Toom 3-Way Multiplication): Updates for Paul's new code.
2081
2082         * mpn/generic/mul_n.c (toom3_interpolate, mpn_toom3_mul_n): Put
2083         if/else braces around whole of #if code, for readability.
2084
2085         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
2086         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps
2087         etc.
2088
2089         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-15.
2090
2091 2003-11-14  Torbjorn Granlund  <tege@swox.com>
2092
2093         * mpn/alpha/aorslsh1_n.asm: Use Cray-friendly syntax for "br".
2094
2095 2003-11-13  Torbjorn Granlund  <tege@swox.com>
2096
2097         * mpn/alpha/aorslsh1_n.asm: New file.
2098
2099 2003-11-12  Kevin Ryde  <kevin@swox.se>
2100
2101         * acinclude.m4 (GMP_PROG_CC_WORKS): Add case provoking AIX power2
2102         assembler, test code by Torbjorn.
2103         * configure.in (power*-*-*): Add a comment about -mcpu=rios2 fallback.
2104
2105         * tune/speed.c (main): Use gmp_randinit_default explicitly on
2106         __gmp_rands, since RANDS doesn't allow seeding.
2107
2108         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-12.
2109
2110         * gmp-impl.h, randmt.h (__gmp_randinit_mt_noseed): Move prototype to
2111         gmp-impl.h, for use by RANDS.
2112
2113         * mpn/Makeasm.am (.s, .S, .asm): Quote $< in test -f, per automake.
2114         (.obj): Use test -f and $(CYGPATH_W) as per automake.
2115
2116 2003-11-11  Kevin Ryde  <kevin@swox.se>
2117
2118         * configure.in: Make umul and udiv standard-optional objects, rather
2119         than under various extra_functions.
2120
2121         * mpn/pa32/hppa1_1/pa7100/add_n.asm,
2122         mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
2123         mpn/pa32/hppa1_1/pa7100/lshift.asm,
2124         mpn/pa32/hppa1_1/pa7100/rshift.asm,
2125         mpn/pa32/hppa1_1/pa7100/sub_n.asm,
2126         mpn/pa32/hppa1_1/pa7100/submul_1.asm: Use LDEF for labels.
2127
2128         * mpf/set_str.c: Don't use memcmp for decimal point testing, just a
2129         loop is enough and avoids any chance of memcmp reading past the end of
2130         the given string.
2131
2132         * randmts.c, randmt.h: New files.
2133         * Makefile.am (libgmp_la_SOURCES): Add them.
2134         * randmt.c: Move seeding to randmts.c, common defines in randmt.h.
2135         * gmp-impl.h (RANDS): Use __gmp_randinit_mt_noseed.
2136         * tests/misc.c (tests_rand_start): Use gmp_randinit_default
2137         explicitly, not RANDS.
2138
2139         * mpn/ia64/ia64-defs.m4 (PROLOGUE_cpu): Use 32-byte alignment, for the
2140         benefit of itanium 2.
2141         * mpn/ia64/gcd_1.asm: Remove own .align 32.
2142
2143         * mpn/ia64/ia64-defs.m4 (ALIGN): New define, using IA64_ALIGN_OK.
2144
2145         * acinclude.m4 (GMP_ASM_IA64_ALIGN_OK): New macro.
2146         * configure.in (IA64_PATTERN): Use it.
2147         * mpn/ia64/README: Add notes on gas big endian align problem.
2148
2149 2003-11-08  Torbjorn Granlund  <tege@swox.com>
2150
2151         * mpn/x86/aors_n.asm: Align loop to a multiple of 16.  Also align
2152         M4_function_n to a multiple of 16, to minimize alignment padding.
2153         Update P6 cycle counts reflecting improvements with new alignment.
2154
2155 2003-11-07  Kevin Ryde  <kevin@swox.se>
2156
2157         * gmp-impl.h (HAVE_HOST_CPU_alpha_CIX): New define.
2158         (ULONG_PARITY, popc_limb): Use it, to pick up ev7 as well as 67 and 68.
2159         * longlong.h (count_leading_zeros, count_trailing_zeros): Ditto.
2160
2161         * doc/gmp.texi (Notes for Package Builds): Add notes on multi-ABI
2162         system packaging.
2163         (ABI and ISA): Add GNU/Linux ABI=64.
2164         (Binary GCD): Add notes on 1x1 GCD algorithms.
2165
2166         * mpn/alpha/README: Add some literature references.
2167
2168         * mpn/ia64/mode1o.asm: Various corrections to initial checkin.
2169         * mpn/ia64/ia64-defs.m4 (ASSERT): Correction to arg quoting.
2170
2171 2003-11-05  Torbjorn Granlund  <tege@swox.com>
2172
2173         * mpn/powerpc64/linux64.m4: New file.
2174         * configure.in (POWERPC64_PATTERN): Handle *-*-linux*.
2175         Use linux64.m4.
2176
2177 2003-11-05  Kevin Ryde  <kevin@swox.se>
2178
2179         * tune/freq.c (freq_sysctl_hw_model): Relax to just look for "%u MHz",
2180         for the benefit of sparc cypress under netbsd 1.6.1.
2181
2182         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-05.
2183
2184         * mpn/alpha/ev5/dive_1.c: New file.
2185
2186         * configure.in (x86_64-*-*): Accept together with amd64-*-*.
2187
2188         * tune/speed.c: Check range of -x,-y,-w,-W alignment specifiers.
2189         * tune/speed.h (CACHE_LINE_SIZE): Amend comments.
2190
2191 2003-11-04  Torbjorn Granlund  <tege@swox.com>
2192
2193         * tune/speed.c: Fix typo in testing HAVE_NATIVE_mpn_modexact_1_odd.
2194
2195 2003-11-03  Kevin Ryde  <kevin@swox.se>
2196
2197         * mpn/ia64/mode1o.asm: New file.
2198         * mpn/ia64/ia64-defs.m4 (ASSERT): New macro.
2199
2200         * tests/mpz/t-set_d.c (check_2n_plus_1): New test.
2201
2202 2003-11-01  Kevin Ryde  <kevin@swox.se>
2203
2204         * mpz/fac_ui.c (BSWAP_ULONG) [limb==2*long]: Remove this case, it
2205         provokes code gen problems on HP cc.
2206         (BSWAP_ULONG) [generic]: Rename __dst variable to avoid conflicts with
2207         BITREV_ULONG.
2208         Fix by Jason Moxham.
2209
2210         * mpn/powerpc32/mode1o.asm: Use 16-bit i*i for early out, no need to
2211         truncate divisor.  Amend stated 750/7400 speeds, and note operands
2212         that give the extremes.
2213
2214         * mpz/set_d.c: Don't use a special case for d < MP_BASE_AS_DOUBLE, gcc
2215         3.3 -mpowerpc64 on darwin gets ulonglong->double casts wrong.
2216
2217         * mpn/generic/diveby3.c: Show a better style carry handling in the
2218         alternative pipelined sample code.
2219
2220         Revert this, the longlong.h macros need -mpowerpc64:
2221         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
2222         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
2223         when bad.
2224
2225 2003-10-31  Kevin Ryde  <kevin@swox.se>
2226
2227         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-31.
2228
2229         * mpn/powerpc64/README: Add subdirectory organisation notes.
2230
2231         * tests/mpn/t-get_d.c: Don't use limits.h, LONG_MIN is wrong on gcc
2232         2.95 with -mcpu=ultrasparc.
2233
2234         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
2235         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
2236         when bad.
2237
2238         * configure.in (powerpc64-*-darwin*) [ABI=mode32]: Use gcc -mcpu flags.
2239
2240         * mpn/ia64/gcd_1.asm: Use "C" for comments.
2241         * mpn/ia64/README, mpn/ia64/ia64-defs.m4: Note this.
2242
2243         * mpn/ia64/ia64-defs.m4: Renamed from default.m4, per other defs files.
2244         * configure.in (IA64_PATTERN): Update GMP_INCLUDE_MPN.
2245
2246         * doc/gmp.texi (Notes for Particular Systems): Remove m68k ABI notes
2247         for -mshort and PalmOS, now works.
2248         (References): Correction, GMP Square Root proof already there, just
2249         wanting URL from RRRR 4475.
2250
2251 2003-10-29  Kevin Ryde  <kevin@swox.se>
2252
2253         * configure.in (sparc*-*-*): Use gcc -m32 when that option works, to
2254         force 32-bit mode on dual 32/64 configurations like GNU/Linux.
2255         (sparc64-*-linux*): Add support for ABI=64.
2256
2257         * mpn/generic/pre_divrem_1.c: In fraction part, use CNST_LIMB(0) with
2258         udiv_qrnnd_preinv to avoid warning about shift > type.
2259
2260         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-29.
2261
2262         * tests/cxx/t-istream.cc: Avoid tellg() checks if putback() doesn't
2263         update that, avoids certain g++ 2.96 problems.
2264
2265         * tests/mpn/t-fat.c: New file.
2266         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
2267
2268         * configure.in (CPUVEC_INSTALL, ITERATE_FAT_THRESHOLDS): New macros
2269         for fat.h.
2270         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Use CPUVEC_INSTALL instead
2271         of memcpy.  Correction to location of "initialized" set.  Improve
2272         various comments.
2273
2274 2003-10-27  Torbjorn Granlund  <tege@swox.com>
2275
2276         * mpn/sparc64/mul_1.asm: Change addcc => add in a few places.
2277         * mpn/sparc64/addmul_1.asm: Likewise.
2278
2279         * mpn/sparc32/v9/mul_1.asm: Apply cross-jumping.
2280         * mpn/sparc32/v9/addmul_1.asm: Likewise.
2281         * mpn/sparc32/v9/submul_1.asm: Likewise.
2282         * mpn/sparc32/v9/sqr_diagonal.asm: Likewise.
2283
2284 2003-10-27  Kevin Ryde  <kevin@swox.se>
2285
2286         * tests/cxx/t-misc.cc: Don't use <climits>, on g++ 2.95.4 (debian 3.0)
2287         -mcpu=ultrasparc LONG_MIN is wrong and kills the compile.
2288
2289         * tests/cxx/t-istream.cc: Correction to tellg tests, don't assume
2290         streampos is zero based.
2291
2292         * configure.in (HAVE_HOST_CPU_FAMILY_alpha): New define for config.h.
2293         * mpn/generic/get_d.c: Use it instead of __alpha for alpha workaround,
2294         since Cray cc doesn't define __alpha.
2295
2296         * mpn/x86/README: Revise PIC coding notes a bit, add gcc visibility
2297         attribute.
2298
2299 2003-10-25  Kevin Ryde  <kevin@swox.se>
2300
2301         * mpn/ia64/gcd_1.asm: New file.
2302
2303         * tune/many.pl: Allow for PROLOGUE(fun,...), as used on alpha.
2304
2305         * doc/gmp.texi (C++ Formatted Input): Describe base indicator handling.
2306
2307         * tests/cxx/t-istream.cc: New file.
2308         * tests/cxx/Makefile.am: Add it.
2309
2310         * cxx/ismpznw.cc: New file, integer input without whitespace ...
2311         * cxx/ismpz.cc: ... from here.
2312         * gmp-impl.h (__gmpz_operator_in_nowhite): Add prototype.
2313         * cxx/ismpq.cc: Rewrite using mpz input routines.  Change to accept a
2314         separate base indicator on numerator and denominator.  Fix base
2315         indicator case where "123/0456" would stop at "123/0".
2316         * Makefile.am, cxx/Makefile.am: Add cxx/ismpznw.cc.
2317
2318         * tests/mpz/t-set_d.c: New file, derived from tests/mpz/t-set_si.c
2319         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
2320
2321         * mpn/m68k/lshift.asm, mpn/m68k/rshift.asm: Support 16-bit int and
2322         stack alignment.
2323         * mpn/m68k/README: Add notes on this.
2324         * configure.in (SIZEOF_UNSIGNED): New define in config.m4.
2325         * mpn/m68k/m68k-defs.m4 (m68k_definsn): Add cmpw, movew.
2326         Reported by Patrick Pelissier.
2327
2328         * mpn/m68k/t-m68k-defs.pl: Don't use -> with hashes, to avoid
2329         deprecation warnings from perl 5.8.
2330
2331         * configure.in (viac3-*-*): Use just x86/pentium in $path not x86/p6.
2332         If gcc is to be believed the old C3s don't have cmov.
2333
2334         * Makefile.am: Amend comments about not building from libtool
2335         convenience libraries.
2336
2337         * mpn/asm-defs.m4 (PROLOGUE): Use m4_file_seen, for correct filename
2338         in missing EPILOGUE error messages.
2339         (m4_file_seen): Amend comments about where used.
2340
2341         * Makefile.am (CXX_OBJECTS): Remove $U, C++ files are not subject to
2342         ansi2knr rules.
2343
2344         * gmp-h.in (mpn_divmod_1): Use __GMP_CAST, to avoid warnings in
2345         applications using g++ -Wold-style-cast.
2346
2347         * mpn/z8000/README: New file.
2348
2349 2003-10-22  Kevin Ryde  <kevin@swox.se>
2350
2351         * mpn/generic/get_d.c (CONST_1024, CONST_NEG_1023,
2352         CONST_NEG_1022_SUB_53): Replace ALPHA_WORKAROUND with a non-gcc-ism,
2353         and use on Cray Unicos alpha too, which has the same problem.
2354
2355         * configure.in (powerpc64-*-darwin*): Make ABI=32 available as the
2356         final fallback, remove mode64 until we know how it will work.
2357
2358         * doc/gmp.texi (Build Options): Add powerpc970 to available CPUs.
2359         (ABI and ISA): Add mode32 for Darwin.
2360
2361         * configure.in (gettimeofday): Use an explicit AC_TRY_LINK, to avoid
2362         known autoconf 2.57 problems with gettimeofday in AC_CHECK_FUNCS on
2363         HP-UX.
2364
2365         * configure.in (powerpc*-*-*): Use ABI=32 instead of ABI=standard for
2366         the default 32-bit ABI.  Fixes powerpc64-*-aix* which is documented as
2367         choices "aix64 32" but had "aix64 standard".
2368
2369         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-22.
2370
2371         * doc/gmp.texi (Notes for Particular Systems): Note m68k gcc -mshort
2372         and PalmOS calling conventions not supported.  Reported by Patrick
2373         Pelissier.
2374         (References): Add Paul Zimmermann's Inria 4475 paper.
2375
2376 2003-10-21  Kevin Ryde  <kevin@swox.se>
2377
2378         * tests/mpn/t-instrument.c: Add mpn_addlsh1_n, mpn_rsh1add_n,
2379         mpn_rsh1sub_n, mpn_sub_nc, mpn_sublsh1_n.  Typo in mpn_preinv_divrem_1
2380         conditional.
2381
2382 2003-10-20  Torbjorn Granlund  <tege@swox.com>
2383
2384         * mpn/powerpc64/mode32/add_n.asm: New file.
2385         * mpn/powerpc64/mode32/sub_n.asm: New file.
2386         * mpn/powerpc64/mode32/mul_1.asm: New file.
2387         * mpn/powerpc64/mode32/addmul_1.asm: New file.
2388         * mpn/powerpc64/mode32/submul_1.asm: New file.
2389
2390 2003-10-19  Torbjorn Granlund  <tege@swox.com>
2391
2392         * longlong.h (AMD64): __x86_64__ => __amd64__.
2393         (64-bit powerpc): Only define carry-dependent macros if
2394         !_LONG_LONG_LIMB.
2395
2396         * acinclude.m4 (POWERPC64_PATTERN): Add powerpc970-*-*.
2397
2398         * configure.in (POWERPC64_PATTERN): Handle *-*-darwin*.
2399         (POWERPC64_PATTERN, *-*-aix*): Prepend powerpc64/mode64 to path_aix64.
2400
2401         * mpn/powerpc64/mode64/mul_1.asm: Change cal => addi.
2402         * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
2403         * mpn/powerpc64/mode64/submul_1.asm: Likewise.
2404         * mpn/powerpc64/sqr_diagonal.asm: Likewise.
2405
2406         * mpn/powerpc64/mode64/mul_1.asm: Move from "..".
2407         * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
2408         * mpn/powerpc64/mode64/submul_1.asm: Likewise.
2409         * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
2410         * mpn/powerpc64/mode64/rsh1sub_n.asm: Likewise.
2411         * mpn/powerpc64/mode64/add_n.asm: Likewise.
2412         * mpn/powerpc64/mode64/addsub_n.asm: Likewise.
2413         * mpn/powerpc64/mode64/sub_n.asm: Likewise.
2414         * mpn/powerpc64/mode64/addlsh1_n.asm: Likewise.
2415         * mpn/powerpc64/mode64/diveby3.asm: Likewise.
2416         * mpn/powerpc64/mode64/rsh1add_n.asm: Likewise.
2417         * mpn/powerpc64/mode64/sublsh1_n.asm: Likewise.
2418
2419         * mpn/powerpc64/lshift.asm: Handle mode32 ABI.
2420         * mpn/powerpc64/rshift.asm: Likewise.
2421         * mpn/powerpc64/umul.asm: Likewise.
2422
2423         * tune/powerpc64.asm: Make it actually work.
2424
2425 2003-10-19  Kevin Ryde  <kevin@swox.se>
2426
2427         * mpn/generic/get_d.c: Add a workaround for alpha gcc signed constant
2428         comparison bug.
2429
2430         * gmpxx.h (gmp_randclass gmp_randinit_lc_2exp_size constructor): Throw
2431         std::length_error if size is too big.
2432         * tests/cxx/t-rand.cc (check_randinit): Exercise this.
2433
2434         * mpn/x86/pentium4/sse2/addlsh1_n.asm: New file, derived in part from
2435         mpn/x86/pentium4/sse2/add_n.asm.
2436
2437         * doc/gmp.texi (C++ Interface Integers, C++ Interface Rationals, C++
2438         Interface Floats): Note std::invalid_argument exception for invalid
2439         strings to constructors and operator=.
2440         (C++ Interface Random Numbers): Note std::length_error exception for
2441         size too big in gmp_randinit_lc_2exp_size.
2442
2443 2003-10-18  Kevin Ryde  <kevin@swox.se>
2444
2445         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-18.
2446
2447         * gmpxx.h (mpz_class, mpq_class, mpf_class, mpfr_class constructors
2448         and operator= taking string or char*): Throw std::invalid_argument if
2449         string cannot be converted.
2450         * tests/cxx/t-constr.cc, tests/cxx/t-assign.cc: Exercise this.
2451
2452         * cxx/ismpz.cc, cxx/ismpq.cc, cxx/ismpf.cc: Use istream std::locale
2453         ctype facet for isspace when available.  Only accept space at the
2454         start of the input, same as g++ libstdc++.  Use ASSERT_NOCARRY to
2455         check result of mpz_set_str etc.
2456         * cxx/ismpf.cc: Don't accept "@" for exponent indicator.
2457
2458         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Remove
2459         _open and _mpn variants of mpn_toom3_mul_n, only one style now.
2460         * tune/mul_n_open.c, tune/mul_n_mpn.c: Remove files.
2461
2462         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
2463         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
2464
2465         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use octal for character
2466         constants, hex is an ANSI-ism.
2467
2468         * mpn/alpha/ev5/mode1o.c: Corrections to ASSERTs, as per
2469         mpn/generic/mode1o.c.
2470
2471         * mpn/generic/diveby3.c: Add commented out alternative code and notes
2472         for taking the multiply off the dependent chain.  Amend/clarify some
2473         of the other comments.
2474
2475         * configure.in (powerpc970-*-*): Use gcc -mcpu=970 when available.
2476         (powerpc7400-*-*): Fallback on gcc -mcpu=750 if -mcpu=7400 not
2477         available.
2478
2479         * doc/gmp.texi (C++ Formatted Input): Note locale digit grouping not
2480         supported.
2481         (C++ Formatted Input, C++ Formatted Output): Cross reference class
2482         interface on overloading.
2483
2484         * mpn/m68k/README: Add various ideas from doc/tasks.html.
2485
2486         * mpn/m88k/README: New file.
2487
2488 2003-10-16  Torbjorn Granlund  <tege@swox.com>
2489
2490         * config.sub: Recognize powerpc970.
2491
2492 2003-10-15  Torbjorn Granlund  <tege@swox.com>
2493
2494         * config.guess: Recognize powerpc970 under MacOS.
2495
2496 2003-10-15  Kevin Ryde  <kevin@swox.se>
2497
2498         * configure.in, acinclude.m4 (GMP_C_RIGHT_SHIFT): New test.
2499         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
2500         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
2501
2502         * mpn/amd64/amd64-defs.m4: New file, with a non-aligning PROLOGUE.
2503         * configure.in (amd64-*-*): Use it.
2504
2505         * mpfr/*: Update to mpfr cvs 2003-10-15.
2506
2507         * mpn/generic/get_d.c: Rewrite, simplifying and truncating towards
2508         zero unconditionally.
2509         * tests/mpn/t-get_d.c: Add various further tests.
2510         * gmp-impl.h (FORCE_DOUBLE): New macro.
2511
2512         * gmp-h.in (__mpz_struct): Add comment on __mpz_struct getting into
2513         C++ mangled function names.
2514
2515         * doc/gmp.texi (Build Options): Update notes for new doc subdir.
2516         (Low-level Functions): Note mpn functions don't check for zero limbs
2517         etc, it's up to an application to strip.
2518
2519         * doc/configuration (Configure): mdate-sh now in doc subdir, add
2520         generated fat.h.
2521
2522 2003-10-13  Kevin Ryde  <kevin@swox.se>
2523
2524         * mpn/powerpc32/mod_34lsub1.asm: New file.
2525
2526         * mpn/powerpc32/diveby3.asm, mpn/powerpc64/diveby3.asm: src[] in
2527         second operand of mullw, to allow possible early-out, which the
2528         0xAA..AB inverse cannot give.  This improvement noticed by Torbjorn.
2529
2530         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Print to config.log whether
2531         local label is purely temporary or appears in object files, for
2532         development purposes.
2533
2534         * doc/gmp.texi, doc/fdl.texi, doc/texinfo.tex, doc/mdate-sh: Moved
2535         from top-level.
2536         * doc/Makefile.am: New file.
2537         * configure.in (AC_OUTPUT): Add doc/Makefile.
2538         * Makefile.am (SUBDIRS): Move doc subdirectory from EXTRA_DIST.
2539         (info_TEXINFOS, gmp_TEXINFOS): Moved to doc/Makefile.am.
2540         * mpfr/Makefile.am (mpfr_TEXINFOS): fdl.texi now in doc subdir.
2541         (TEXINFO_TEX): texinfo.tex now in doc subdir.
2542         (AM_MAKEINFOFLAGS): Set -I to doc subdir.
2543
2544         * mpz/and.c: For positive/positive, use mpn_and_n, rate a realloc as
2545         UNLIKELY.
2546
2547         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Don't test
2548         for high zero limbs.
2549
2550 2003-10-12  Torbjorn Granlund  <tege@swox.com>
2551
2552         * mpn/powerpc64/diveby3.asm: New file (trivial edits of
2553         powerpc32/diveby3.asm).
2554
2555         * mpn/powerpc32/diveby3.asm: Update cycle counts with more processors.
2556         * mpn/powerpc32/sqr_diagonal.asm: Likewise.
2557
2558         * mpn/pa64/add_n.asm: Correct PA8500 cycle counts.
2559         * mpn/pa64/sub_n.asm: Likewise.
2560
2561         * mpn/m68k/aors_n.asm (INPUT PARAMETERS): Fix typo.
2562         * mpn/m68k/lshift.asm: Likewise.
2563         * mpn/m68k/rshift.asm: Likewise.
2564
2565         * mpn/m68k/README: Correct an URL; add some STATUS comments.
2566
2567         * mpn/powerpc32/addlsh1_n.asm: New file.
2568         * mpn/powerpc32/sublsh1_n.asm: New file.
2569
2570 2003-10-12  Kevin Ryde  <kevin@swox.se>
2571
2572         * mpn/sparc64/divrem_1.c, mpn/sparc64/mod_1.c: New files.
2573         * mpn/sparc64/sparc64.h (HALF_ENDIAN_ADJ, count_leading_zeros_32,
2574         invert_half_limb, udiv_qrnnd_half_preinv): New macros.
2575
2576         * gmp-impl.h (udiv_qrnnd_preinv2): Use a ? : for getting the n1 bit,
2577         so as not to depend on signed right shifts being arithmetic.
2578
2579         * mpn/powerpc32/diveby3.asm: New file.
2580
2581         * mpn/generic/divrem_1.c: Use CNST_LIMB(0) to avoid warnings from
2582         udiv_qrnnd_preinv about shift count when int<long.  Do the same with
2583         udiv_qrnnd, for consistency.
2584
2585         * Makefile.am (install-data-hook): Print a warning recommending "make
2586         check" to watch out for compiler bugs.  Proposed by Torbjorn.
2587
2588 2003-10-11  Torbjorn Granlund  <tege@swox.com>
2589
2590         * mpn/asm-defs.m4: Handle rsh1aors_n.
2591
2592         * configure.in (tmp_mulfunc): Handle rsh1aors_n.
2593
2594 2003-10-11  Kevin Ryde  <kevin@swox.se>
2595
2596         * mpn/x86/pentium4/sse2/diveby3.asm: Remove non-PIC RODATA memory
2597         access for 0xAAAAAAAB constant.
2598
2599         * gmp-impl.h (popc_limb, ULONG_PARITY) [ev67, ev68]: Add gcc asm
2600         versions using ctpop.
2601
2602         * mpn/x86/k6/aorsmul_1.asm: Tweak some comments, remove M4_description
2603         and M4_desc_retval used only in comments.
2604
2605         * mpn/x86/k6/mul_basecase.asm: Add comment on using mpn_mul_1.
2606
2607 2003-10-09  Torbjorn Granlund  <tege@swox.com>
2608
2609         * mpn/powerpc64/addlsh1_n.asm: Tweak for 0.25 c/l better loop speed.
2610         * mpn/powerpc64/sublsh1_n.asm: Likewise.
2611
2612 2003-10-09  Kevin Ryde  <kevin@swox.se>
2613
2614         * mpfr/*: Update to mpfr cvs 2003-10-09.
2615
2616         * tests/devel/try.c (_SC_PAGESIZE): Define from _SC_PAGE_SIZE on
2617         systems which use that, eg. hpux 9.
2618
2619 2003-10-07  Kevin Ryde  <kevin@swox.se>
2620
2621         * tune/freq.c (freq_sysctl_hw_model): Correction to last sscanf change.
2622
2623         * configure.in: Check for psp_iticksperclktick in struct pst_processor.
2624         * tune/freq.c (freq_pstat_getprocessor): Use this.
2625
2626         * tests/devel/try.c (divisor_array): Add a couple of half-limb values.
2627
2628         * acinclude.m4 (GMP_PROG_CC_WORKS): Correction to last change, need to
2629         set result "yes" when cross compiling.
2630
2631 2003-10-06  Torbjorn Granlund  <tege@swox.com>
2632
2633         * mpn/generic/mul_n.c: Use __GMPN_ADD_1/_GMPN_SUB_1 instead of
2634         mpn_add_1 and mpn_sub_1.
2635
2636         * mpn/pa64/aorslsh1_n.asm: Schedule register save and restore code.
2637
2638 2003-10-05  Torbjorn Granlund  <tege@swox.com>
2639
2640         * mpn/pa64/mul_1.asm: Misc comment cleanups.
2641         * mpn/pa64/addmul_1.asm: Likewise.
2642         * mpn/pa64/submul_1.asm: Likewise.
2643
2644         * mpn/pa64/README: Correct cycle counts.
2645
2646         * mpn/pa64/aorslsh1_n.asm: New file.
2647
2648 2003-10-04  Kevin Ryde  <kevin@swox.se>
2649
2650         * tune/freq.c (freq_sysctl_hw_model, freq_sunos_sysinfo,
2651         freq_sco_etchw, freq_bsd_dmesg, freq_irix_hinv): Demand matching of
2652         MHz etc at end of sscanf format string.  In particular need this for
2653         freq_bsd_dmesg on i486-pc-freebsd4.7 to avoid the 486 cpu being used
2654         for the frequency.
2655
2656         * tests/misc.c, tests/tests.h (tests_setjmp_sigfpe,
2657         tests_sigfpe_handler, tests_sigfpe_done, tests_sigfpe_target,
2658         tests_dbl_mant_bits): New.
2659
2660         * configure.in (viac3*-*-*): Add gcc VIA c3 options.
2661
2662         * mpfr/*: Update to mpfr cvs 2003-10-04.
2663
2664         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
2665         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps.
2666         * tests/tests.h (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
2667         refmpn_rsh1sub_n): Add prototypes.
2668
2669         * tests/devel/try.c, tune/many.pl: Add mpn_addlsh1_n, mpn_sublsh1_n,
2670         mpn_rsh1add_n, mpn_rsh1sub_n.
2671
2672 2003-10-03  Torbjorn Granlund  <tege@swox.com>
2673
2674         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
2675         refmpn_rsh1sub_n): New functions.
2676
2677 2003-10-03  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
2678
2679         * mpn/generic/mul_n.c (toom3_interpolate): Use mpn_add_1/mpn_sub_1
2680         instead of MPN_INCR_/MPN_DECR_U.
2681
2682 2003-10-02  Torbjorn Granlund  <tege@swox.com>
2683
2684         * configure.in (ia64*-*-hpux*): Fall back to +O1, not +O.
2685
2686 2003-10-02  Kevin Ryde  <kevin@swox.se>
2687
2688         * configure.in (ia64*-*-hpux*): For cc, let +O optimization level
2689         fallback if +O3 doesn't work.
2690
2691         * acinclude.m4 (GMP_PROG_CC_WORKS): Add a test of __builtin_alloca
2692         when available, to pick up Itanium HP-UX cc internal errors in +O2.
2693         Provoking code by Torbjorn.
2694
2695 2003-10-01  Torbjorn Granlund  <tege@swox.com>
2696
2697         * mpn/asm-defs.m4: Handle aorslsh1_n.
2698
2699         * configure.in (tmp_mulfunc): Handle aorslsh1_n.
2700
2701 2003-10-01  Kevin Ryde  <kevin@swox.se>
2702
2703         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Make bad ARM last byte into a
2704         separate case and consider it non-IEEE, since it looks like this is
2705         due to some sort of restricted or incorrect software floats.
2706
2707         * demos/calc/Makefile.am: Use automake yacc/lex support, seems fine in
2708         separate objdir now.
2709
2710         * cxx/dummy.cc: Moved from top-level dummy.cc.
2711         * Makefile.am (libgmpxx_la_SOURCES): Update to cxx/dummy.cc,
2712         correction to comment about this.
2713
2714 2003-09-30  Torbjorn Granlund  <tege@swox.com>
2715
2716         * demos/pexpr.c: Correct documentation of -split.
2717         (TIME): Remove cast of result to double.
2718         (main): Change timing variables to int.
2719         (main): #ifdef LIMIT_RESOURCE_USAGE, don't convert numbers of more than
2720         100000 digits.
2721
2722 2003-09-28  Torbjorn Granlund  <tege@swox.com>
2723
2724         * mpn/*/*.asm: Clean up spacing, tabify.
2725
2726         * mpn/alpha/rshift.asm: Table cycle counts.
2727         * mpn/alpha/lshift.asm: Likewise.
2728         * mpn/alpha/ev5/rshift.asm: Likewise.
2729         * mpn/alpha/ev5/lshift.asm: Likewise.
2730         * mpn/alpha/ev6/add_n.asm: Likewise.
2731         * mpn/alpha/ev6/sub_n.asm: Likewise.
2732
2733         * mpn/pa64/mul_1.asm: Fix comment typo.
2734         * mpn/pa64/addmul_1.asm: Likewise.
2735         * mpn/pa64/submul_1.asm: Likewise.
2736
2737 2003-09-27  Torbjorn Granlund  <tege@swox.com>
2738
2739         * mpn/powerpc64/README: Update with POWER4/PPC970 pipeline info.
2740
2741         * mpn/powerpc64/rshift.asm: Rewrite.
2742         * mpn/powerpc64/lshift.asm: Rewrite.
2743
2744 2003-09-25  Torbjorn Granlund  <tege@swox.com>
2745
2746         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
2747         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): Conditionalize on
2748         corresponding HAVE_NATIVE_*.
2749
2750 2003-09-25  Kevin Ryde  <kevin@swox.se>
2751
2752         * mpz/combit.c: Use GMP_NUMB_BITS not BITS_PER_MP_LIMB.
2753
2754         * demos/expr/exprfr.c: Allow for mpfr_inf_p, mpfr_nan_p and
2755         mpfr_number_p merely returning non-zero, rather than 1 or 0.
2756
2757         * demos/expr/exprfr.c, demos/expr/t-expr.c: Add erf, integer_p, zeta.
2758
2759         * demos/expr/Makefile.am (LDADD): Update comments on $(LIBM).
2760
2761 2003-09-24  Torbjorn Granlund  <tege@swox.com>
2762
2763         * tune/speed.c (routine): Add entires for mpn_addlsh1_n, mpn_sublsh1_n,
2764         mpn_rsh1add_n, and mpn_rsh1sub_n.
2765
2766         * tune/speed.h: Declare speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
2767         speed_mpn_rsh1add_n, and speed_mpn_rsh1sub_n.
2768
2769         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
2770         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): New functions.
2771
2772         * gmp-impl.h: Declare mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsh1add_n, and
2773         mpn_rsh1sub_n.
2774
2775         * mpn/asm-defs.m4: Add define_mpn's for addlsh1_n, sublsh1_n,
2776         rsh1add_n, and rsh1sub_n.
2777
2778         * mpn/powerpc64/*.asm: Add cycle counts in consistent style.  Misc
2779         styling edits.
2780
2781         * configure.in: Add #undefs for HAVE_NATIVE_mpn_addlsh1_n,
2782         HAVE_NATIVE_mpn_sublsh1_n, HAVE_NATIVE_mpn_rsh1add_n,
2783         HAVE_NATIVE_mpn_rsh1sub_n.
2784         (gmp_mpn_functions_optional): List addlsh1_n, sublsh1_n, rsh1add_n,
2785         and rsh1sub_n.
2786
2787 2003-09-24  Kevin Ryde  <kevin@swox.se>
2788
2789         * mpfr/*: Update to mpfr cvs 2003-09-24.
2790
2791         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Remove conftest* temporary files.
2792
2793 2003-09-23  Torbjorn Granlund  <tege@swox.com>
2794
2795         * gmp-impl.h (MUL_TOOM3_THRESHOLD, SQR_TOOM3_THRESHOLD): Now 128.
2796
2797 2003-09-23  Kevin Ryde  <kevin@swox.se>
2798
2799         * gmp-h.in (gmp_randinit_set): Use __gmp_const rather than const.
2800
2801 2003-09-22  Torbjorn Granlund  <tege@swox.com>
2802
2803         * tune/mul_n_mpn.c: (__gmpn_sqr_n): New #define.
2804         * tune/mul_n_open.c (__gmpn_sqr_n): New #define.
2805
2806         * mpn/generic/mul.c (mpn_sqr_n): Move from here...
2807         * mpn/generic/mul_n.c (mpn_sqr_n): ...to here.
2808         (mpn_sqr_n): Allocate workspace for toom3 using TMP_* mechanism except
2809         for very large operands when !WANT_FFT.
2810
2811         * mpn/generic/mul_n.c: Add a missing ";". Misc comment fixes.
2812
2813         * mpn/generic/mul.c: Remove spurious #include <stdio.h>.
2814
2815         * mpn/x86/k7/gmp-mparam.h: Retune.
2816
2817         * mpn/generic/mul_n.c (mpn_mul_n): Allocate workspace for toom3 using
2818         TMP_* mechanism except for very large operands when !WANT_FFT.
2819
2820         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE):
2821         Define conditionally on WANT_FFT and HAVE_NATIVE_mpn_sublsh1_n.
2822         (MPN_TOOM3_MAX_N): New #define.
2823
2824         * mpn/generic/sqr_basecase.c: Use mpn_addlsh1_n when available.
2825
2826         * mpn/generic/mul_n.c: Use proper form for HAVE_NATIVE macros.
2827
2828 2003-09-22  Kevin Ryde  <kevin@swox.se>
2829
2830         * mpfr/*: Update to mpfr cvs 2003-09-22.
2831
2832 2003-09-21  Kevin Ryde  <kevin@swox.se>
2833
2834         * mpn/x86/pentium4/sse2/gmp-mparam.h (USE_PREINV_DIVREM_1,
2835         USE_PREINV_MOD_1): Set to 1 for new asm versions.
2836
2837         * mpfr/*: Update to mpfr cvs 2003-09-21.
2838
2839 2003-09-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
2840
2841         * mpn/generic/mul_n.c (mpn_toom3_mul_n): Conditionally use
2842         mpn_sublsh1_n, mpn_rsh1add_n and mpn_rsh1sub_n, in addition to
2843         mpn_addlsh1_n.  Avoid all copying, at the expense of some additional
2844         workspace.
2845
2846         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Accomodate
2847         latest toom3 code.
2848
2849 2003-09-19  Kevin Ryde  <kevin@swox.se>
2850
2851         * mpn/x86/pentium4/sse2/divrem_1.asm, mpn/x86/pentium4/sse2/mod_1.asm:
2852         New files.
2853
2854 2003-09-16  Kevin Ryde  <kevin@swox.se>
2855
2856         * tune/speed.c (run_one): Don't scale the -1.0 not-available return.
2857         Print "n/a" for times not-available.
2858
2859 2003-09-13  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
2860
2861         * mpn/generic/mul_n.c (toom3_interpolate): New function.
2862         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Call toom3_interpolate.
2863
2864 2003-09-12  Torbjorn Granlund  <tege@swox.com>
2865
2866         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove unused
2867         variables.
2868         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use offset `+ 1', not `+ 2' in last
2869         MPN_DECR_U calls.
2870
2871 2003-09-12  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
2872
2873         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Rewrite.
2874
2875 2003-09-12  Torbjorn Granlund  <tege@swox.com>
2876
2877         * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Reformulate
2878         to use the same form as MPN_TOOM3_MUL_N_TSIZE.
2879         (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Update for new Toom3
2880         code requirements.
2881         * mpn/generic/mul_n.c (evaluate3, interpolate3, add2Times): Remove.
2882         (USE_MORE_MPN): Remove.
2883
2884 2003-08-31  Kevin Ryde  <kevin@swox.se>
2885
2886         * mpfr/*: Update to mpfr cvs 2003-08-31.
2887
2888 2003-08-30  Kevin Ryde  <kevin@swox.se>
2889
2890         * mpfr/*: Update to mpfr cvs 2003-08-30.
2891
2892 2003-08-29  Torbjorn Granlund  <tege@swox.com>
2893
2894         * mpn/amd64/README: New file.
2895
2896 2003-08-23  Kevin Ryde  <kevin@swox.se>
2897
2898         * tune/freq.c (freq_getsysinfo): Correction to speed_cycletime value
2899         established.
2900
2901         * mpz/rootrem.c, gmp-h.in, gmp.texi (mpz_rootrem): Don't return
2902         exactness indication, can get that from testing the remainder.
2903
2904         * mpn/x86/k7/aors_n.asm, mpn/x86/k7/mmx/copyi.asm: Amend to comments
2905         about loads and stores and what speed should be possible.
2906
2907 2003-08-19  Kevin Ryde  <kevin@swox.se>
2908
2909         * longlong.h (add_ssaaaa, sub_ddmmss) [hppa 64]: Move down into main
2910         __GNUC__ block.  Exclude for _LONG_LONG_LIMB (ie. ABI=2.0n) since
2911         these forms are only for ABI=2.0w.
2912
2913         * longlong.h (count_leading_zeros) [__mcpu32__]: Check __mcpu32__ to
2914         avoid bfffo on GCC 3.4 in CPU32 mode.  Reported by Bernardo Innocenti.
2915
2916         * longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force
2917         64-bit register destination.  Pointed out by Torbjorn.
2918
2919         * mpz/combit.c: Correction to carry handling when extending a
2920         negative, and use __GMPN_ADD_1.  Correction to complement limb for a
2921         negative when there's a non-zero low limb.
2922         * tests/mpz/bit.c (check_clr_extend, check_com_negs): Exercise these.
2923
2924         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add
2925         get_d_2exp.
2926         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Rand.pm,
2927         demos/perl/test.pl: Add gmp_urandomb_ui, gmp_urandomm_ui.
2928         (GMP::Rand::randstate): Accept a randstate object to copy.
2929         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Mpz.pm,
2930         demos/perl/test.pl: Add combit, rootrem.
2931
2932 2003-08-19  Torbjorn Granlund  <tege@swox.com>
2933
2934         * tune/Makefile.am (EXTRA_DIST): Add amd64.asm.
2935
2936 2003-08-17  Kevin Ryde  <kevin@swox.se>
2937
2938         * gmpxx.h [__MPFR_H]: Include full <iostream> for inlines.
2939         * tests/cxx/t-headfr.cc: New file, exercising this.
2940         * tests/cxx/Makefile.am: Add it.
2941
2942         * tests/cxx/t-constr.cc: Include config.h for WANT_MPFR.
2943
2944         * gmpxx.h: Correction to temp variable type in mpf -> mpfr assignment.
2945         Reported by Derrick Bass.
2946         * tests/cxx/t-assign.cc (check_mpfr): Exercise this.
2947
2948         * configure.in (WANT_MPFR): AC_DEFINE this, for the benefit of
2949         tests/cxx/t-*.cc.  (Was always meant to have been defined.)
2950         * tests/cxx/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpfr.
2951
2952         * gmpxx.h: __gmp_default_rounding_mode -> __gmpfr_default_rounding_mode
2953         (struct __gmp_hypot_function): Correction to mpfr_hypot addition.
2954         * tests/cxx/t-misc.cc (check_mpfr_hypot): Corrections to mpfr/long
2955         tests.
2956
2957 2003-08-16  Torbjorn Granlund  <tege@swox.com>
2958
2959         * configure.in (amd64): New.
2960
2961         * mpn/amd64/gmp-mparam.h: New file.
2962
2963         * tune/amd64.asm: New file, derived in part from tune/pentium.asm.
2964
2965 2003-08-15  Kevin Ryde  <kevin@swox.se>
2966
2967         * tune/freq.c (freq_irix_hinv): Reinstate, for the benefit of IRIX 6.2.
2968         (freq_attr_get_invent): Conditionalize on INFO_LBL_DETAIL_INVENT too.
2969
2970 2003-08-14  Kevin Ryde  <kevin@swox.se>
2971
2972         * mpq/get_d.c: Use mpn_get_d.
2973         * tests/mpq/t-get_d.c (check_onebit): New test.
2974
2975         * gmp.texi (Notes for Particular Systems): Under x86 cpu types, note
2976         i386 is a fat binary, remove pentium4 recommendation since i386 is now
2977         quite reasonable for p4.
2978         (Notes for Particular Systems): Under Windows DLLs, remove caveat
2979         about --enable-cxx now ok, update .lib creation for new libtool,
2980         remove .exp not needed for MS C.
2981         (Notes for Package Builds): i386 is a fat binary.
2982         (Reentrancy): Remove SCO ctype.h note, don't want to list every system
2983         misfeature, and was quite possibly for non-threading mode anyway.
2984         (Autoconf): Remove notes on gmp 2 detection, too old to want to
2985         encourage anyone to use.
2986         (Karatsuba Multiplication): Correction to threshold increase/decrease
2987         for a and b terms.  Reported by Richard Brent and Paul Zimmermann.
2988         Also add various further index entries.
2989
2990         * tune/freq.c (freq_attr_get_invent): New function.
2991         (freq_irix_hinv): Remove, in favour or freq_attr_get_invent.
2992         * configure.in (AC_CHECK_FUNCS): Add attr_get.
2993         (AC_CHECK_HEADERS): Add invent.h, sys/attributes.h, sys/iograph.h.
2994
2995 2003-08-03  Kevin Ryde  <kevin@swox.se>
2996
2997         * tune/tuneup.c (tune_mul): Use MUL_KARATSUBA_THRESHOLD_LIMIT.
2998
2999 2003-08-02  Kevin Ryde  <kevin@swox.se>
3000
3001         * mpn/asm-defs.m4: Tweak some comments, add hpux11 to m4wrap 0xFF
3002         problem systems.
3003
3004         * configure.in (*-*-sco3.2v5*): Remove lt_cv_archive_cmds_need_lc=no,
3005         since libtool no longer uses it.  This was a workaround fixing ctype.h
3006         in SCO 5 shared libraries; not sure if libtool now gets it right on
3007         its own, let's hope so.
3008
3009         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Remove, libtool no
3010         longer demands HOST_CC.
3011
3012         * configure.in: When C or C++ compiler not found, refer user to
3013         config.log.
3014
3015         * configure.in (i386-*-*): Turn i386 into a fat binary build.
3016         * mpn/x86/fat/fat.c, mpn/x86/fat/fat_entry.asm,
3017         mpn/x86/fat/gmp-mparam.h, mpn/x86/fat/gcd_1.c, mpn/x86/fat/mode1o.c:
3018         New files.
3019         * gmp-impl.h (struct cpuvec_t) [x86 fat]: New structure.
3020         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB) [x86 fat]: Define.
3021         * mpn/asm-defs.m4 (foreach): New macro.
3022         * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): New define.
3023         * mpn/x86/sqr_basecase.asm: New file, primarily as a fallback for fat
3024         binaries.
3025         * mpn/x86/p6/gmp-mparam.h, mpn/x86/p6/mmx/gmp-mparam.h: Add comments
3026         about fat binary SQR_KARATSUBA_THRESHOLD for p6 and p6/mmx.
3027
3028         * configure.in: Add various supports for fat binaries, via fat_path,
3029         fat_functions and fat_thresholds variables.
3030         * acinclude.m4 (GMP_STRIP_PATH): Mung $fat_path too.
3031         (GMP_FAT_SUFFIX, GMP_REMOVE_FROM_LIST): New macros.
3032         * gmp-impl.h: Add various supports for fat binaries.
3033         (DECL_add_n etc): New macros.
3034         (mpn_mul_basecase etc): Define only if not already defined.
3035         * mpn/asm-defs.m4 (m4_config_gmp_mparam): Mention fat binary.
3036         (MPN): Use m4_unquote, for the benefit of fat binary name expansion.
3037         * doc/configuration: Notes on fat binaries.
3038         * gmp-impl.h (MUL_TOOM3_THRESHOLD_LIMIT): Define always.
3039         (MUL_KARATSUBA_THRESHOLD_LIMIT): New define.
3040         * mpn/generic/mul.c, mpn/generic/mul_n.c: Use these.
3041         * tune/divrem1div.c, tune/divrem1inv.c, tune/mod_1_div.c,
3042         tune/mod_1_inv.c: Define OPERATION_divrem_1 and OPERATION_mod_1, to
3043         tell fat.h what's being done.
3044
3045         * config.guess (alpha-*-*): Update comments on what configfsf.guess
3046         does and doesn't do for us.
3047
3048 2003-07-31  Kevin Ryde  <kevin@swox.se>
3049
3050         * config.guess: Remove $dummy.o files everywhere, in case vendor
3051         compilers produce that even when not asked.
3052
3053         * demos/perl/GMP.xs (class_or_croak): Rename "class" parameter to
3054         avoid C++ keyword.
3055         (coerce_ulong, coerce_long): Move croaks to stop g++ 3.3 complaining
3056         about uninitialized variables.
3057
3058         * demos/perl/INSTALL: Add notes on building with a DLL.
3059
3060         * longlong.h (count_trailing_zeros) [x86_64]: Ensure bsfq destination
3061         is a 64-bit register.  Diagnosed by Francois G. Dorais.
3062
3063 2003-07-31  Torbjorn Granlund  <tege@swox.com>
3064
3065         * longlong.h [ppc]: Remove nested test for vxworks.
3066
3067 2003-07-24  Kevin Ryde  <kevin@swox.se>
3068
3069         * gmpxx.h (struct __gmp_binary_multiplies): Use mpz_mul_si for
3070         mpz*long and long*mpz.
3071         * tests/cxx/t-ops.cc (check_mpz): Exercise mpz*long and mpz*ulong.
3072
3073         * cxx/ismpf.cc: Use std::locale decimal point when available.  Expect
3074         localeconv available always.
3075         * tests/cxx/t-locale.cc: Enable check_input tests.
3076
3077         * gmpxx.h (struct __gmp_hypot_function): Use mpfr_hypot.
3078         * tests/cxx/t-misc.cc (check_mpfr_hypot): New tests.
3079
3080         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-ops.cc,
3081         tests/cxx/t-prec.cc, tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc:
3082         Include config.h for WANT_MPFR.
3083
3084         * tests/mpz/bit.c (check_single): Correction to a diagnostic print.
3085
3086 2003-07-24  Niels Möller  <nisse@lysator.liu.se>
3087
3088         * mpz/combit.c: New file.
3089         * Makefile.am, mpz/Makefile.am: Add it.
3090         * gmp-h.in (mpz_combit): Add prototype.
3091         * tests/mpz/bit.c (check_single): Exercise mpz_combit.
3092
3093 2003-07-16  Kevin Ryde  <kevin@swox.se>
3094
3095         * mpn/generic/get_d.c: Correction to infinity handling for large exp.
3096
3097 2003-07-14  Kevin Ryde  <kevin@swox.se>
3098
3099         * mpz/get_d.c, mpz/get_d_2exp.c, mpf/get_d.c, mpf/get_d_2exp.c: Use
3100         mpn_get_d.
3101
3102         * mpn/generic/get_d.c: New file, based on mpz/get_d.c and insert-dbl.c.
3103         * configure.in, mpn/Makefile.am: Add it.
3104         * gmp-impl.h (mpn_get_d): Add prototype.
3105
3106         * tests/mpn/t-get_d.c: New file.
3107         * tests/mpn/Makefile.am: Add it.
3108
3109         * tests/mpz/t-get_d_2exp.c (check_onebit, check_round): Test negatives.
3110         (check_onebit): Add a few more bit sizes.
3111
3112         * tests/misc.c, tests/tests.h (tests_isinf): New function.
3113
3114 2003-07-12  Kevin Ryde  <kevin@swox.se>
3115
3116         * configure.in (GMP_PROG_CXX_WORKS): Include $CPPFLAGS, same as
3117         automake does in the actual build.
3118
3119         * acinclude.m4 (GMP_PROG_CXX_WORKS): In the namespace test, declare
3120         namespace before trying to use.  In std iostream test, provoke a
3121         failure from Compaq C++ in pre-standard mode.
3122
3123 2003-07-08  Kevin Ryde  <kevin@swox.se>
3124
3125         * acinclude.m4 (GMP_PROG_CC_WORKS): Use separate compiles for various
3126         known problems, and indicate to the user the reason for rejecting.
3127         (GMP_PROG_CXX_WORKS): Ditto, and insist on being able to execute each
3128         compiled program.
3129
3130 2003-07-05  Kevin Ryde  <kevin@swox.se>
3131
3132         * config.sub: Add comments to our alias transformations.
3133
3134         * configfsf.sub, configfsf.guess: Update to 2003-07-04.
3135
3136         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_PROG_CC_WORKS_LONGLONG): Show
3137         failing program in config.log, per other autoconf tests.
3138
3139         * configure.in (i786-*-*): Recognise as pentium4, per configfsf.sub.
3140
3141 2003-06-28  Kevin Ryde  <kevin@swox.se>
3142
3143         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Avoid res==1.0 when floats round
3144         upwards.
3145
3146         * tests/mpz/t-get_d_2exp.c: New file.
3147         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
3148         * tests/mpf/t-get_d_2exp.c: New file.
3149         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
3150         * tests/x86call.asm, test/tests.h (x86_fldcw, x86_fstcw): New
3151         functions.
3152         * tests/misc.c, tests/tests.h (tests_hardware_getround,
3153         tests_hardware_setround): New functions.
3154
3155 2003-06-25  Kevin Ryde  <kevin@swox.se>
3156
3157         * mpn/sparc64/dive_1.c: New file.
3158
3159         * mpn/sparc64/sparc64.h: New file.
3160         * mpn/sparc64/mode1o.c: Remove things now in sparc64.h.
3161
3162         * mpfr/*: Update to mpfr cvs 2003-06-25.
3163
3164         * acinclude.m4 (GMP_PROG_CC_WORKS): In last change provoking gnupro
3165         gcc, don't use ANSI style function definition.
3166
3167 2003-06-22  Kevin Ryde  <kevin@swox.se>
3168
3169         * mpn/pa32/hppa1_1/udiv.asm: Remove .proc, .entry, .exit and .procend,
3170         handled by PROLOGUE and EPILOGUE.  Comment out .callinfo, per other
3171         asm files.
3172
3173         * gmpxx.h (mpz_class __gmp_binary_divides, __gmp_binary_modulus): Fix
3174         long/mpz and long%mpz for dividend==LONG_MIN divisor==-LONG_MIN.
3175         (mpz_class __gmp_binary_modulus): Fix mpz%long for negative dividend.
3176         * tests/cxx/t-ops.cc (check_mpz): Add test cases for these, merging
3177         operator/ and operator% sections for clarity.
3178
3179 2003-06-21  Kevin Ryde  <kevin@swox.se>
3180
3181         * mpfr/*: Update to mpfr cvs 2003-06-21.
3182
3183         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code by Torbjorn provoking an
3184         ICE from gcc 2.9-gnupro-99r1 under -O2 -mcpu=ev6.
3185         * configure.in (alpha*-*-* gcc_cflags_cpu): Fallback on -mcpu=ev56 for
3186         this compiler.
3187
3188         * gmpxx.h (get_d): Remove comments about long double, double is
3189         correct for get_d, a future long double form would be get_ld.
3190
3191 2003-06-19  Kevin Ryde  <kevin@swox.se>
3192
3193         * mpfr/*: Update to mpfr cvs 2003-06-19.
3194
3195         * mpn/generic/dive_1.c: Share src[0] fetch among all cases.  No need
3196         for separate final umul_ppmm in even case, make it part of the loop.
3197
3198         * mpz/get_d_2exp.c, mpq/set_si.c, mpq/set_ui.c: Nailify.
3199
3200         * mpf/iset_si.c: Rewrite using mpf/set_si.c code, in particular this
3201         nailifies it.
3202         * tests/mpf/t-set_si.c: Nailify tests.
3203
3204         * mpf/iset_ui.c: Nailify, as per mpf/set_ui.c
3205         * tests/mpf/t-set_ui.c: New file.
3206         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
3207
3208 2003-06-15  Kevin Ryde  <kevin@swox.se>
3209
3210         * mpfr/*: Update to mpfr cvs 2003-06-15.
3211
3212         * mpn/x86/k6/mode1o.asm: Remove a bogus ASSERT.
3213
3214 2003-06-12  Kevin Ryde  <kevin@swox.se>
3215
3216         * configure.in (--enable-assert): Emit WANT_ASSERT to config.m4.
3217         * mpn/powerpc32/powerpc-defs.m4, mpn/x86/x86-defs.m4 (ASSERT): Check
3218         WANT_ASSERT is defined.
3219
3220         * mpn/sparc32/v9/udiv.asm: Amend heading, this file is for sparc v9.
3221
3222         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): In libtool openbsd hack,
3223         disard error messages from cp, for the benefit of --disable-shared or
3224         systems not using names libgmp.so.*.
3225
3226         * tests/devel/try.c (try_one): When overlapping, copy source data
3227         after filling dst.  Previously probably used only DEADVAL in
3228         overlapping cases.
3229
3230 2003-06-11  Torbjorn Granlund  <tege@swox.com>
3231
3232         * mpf/random2.c: Rewrite.  Ignore sign of exp parameter.
3233
3234 2003-06-10  Kevin Ryde  <kevin@swox.se>
3235
3236         * mpn/sparc64/mode1o.c: New file.
3237
3238 2003-06-09  Torbjorn Granlund  <tege@swox.com>
3239
3240         * mpn/powerpc32/lshift.asm: Add more cycle counts.
3241         * mpn/powerpc32/rshift.asm: Add more cycle counts.
3242
3243         * gmp-impl.h (udiv_qrnnd_preinv1): New name for udiv_qrnnd_preinv.
3244         (udiv_qrnnd_preinv2): New name for udiv_qrnnd_preinv2norm.
3245         (udiv_qrnnd_preinv): New #define, making udiv_qrnnd_preinv2
3246         the default.
3247         * tune/speed.c: Corresponding changes.
3248         * tune/speed.h: Likewise.
3249         * tune/common.c: Likewise.
3250
3251         * mpf/get_str.c: Simplify `off' computation.
3252
3253         * longlong.h: Tabify.
3254
3255 2003-06-09  Kevin Ryde  <kevin@swox.se>
3256
3257         * gmp.texi (ABI and ISA): FreeBSD has sparc64 too, just say "BSD" to
3258         cover all flavours.
3259         * configure.in: Ditto in some comments.
3260
3261         * mpfr/*: Update to mpfr cvs 2003-06-09.
3262
3263         * tests/cxx/Makefile.am (LDADD): Add -L$(top_builddir)/$(LIBS), for
3264         the benefit of gcc 3.2 on itanium2-hp-hpux11.22.
3265
3266         * tune/many.pl (mul_2): Add speed routine settings.
3267         (MAKEFILE): Close when done, for the benefit of development hackery.
3268
3269 2003-06-08  Kevin Ryde  <kevin@swox.se>
3270
3271         * mpfr/*: Update to mpfr cvs 2003-06-08.
3272
3273         * mpn/x86/x86-defs.m4 (femms): Remove fallback to emms.
3274         (cmovCC, psadbw): Remove simulated versions.
3275         (cmov_available_p, psadbw_available_p): Remove.
3276         This trickery was only ever for development purposes on machines
3277         without those instructions.  Removing it simplifies gmp and in
3278         particular avoids complications for fat binary builds.  Development
3279         can be done with a wrapper around "as" if really needed.
3280
3281         * mpn/x86/divrem_1.asm: Don't use loop_or_decljnz, now K6 has its own
3282         mpn/x86/k6/divrem_1.asm.  Amend K6 comments now moved to there.
3283         * mpn/x86/x86-defs.m4 (loop_or_decljnz): Remove, no longer used.
3284
3285         * mpn/x86/k6/divrem_1.asm: New file, derived from mpn/x86/divrem_1.asm.
3286
3287         * mpn/x86/k6/pre_mod_1.asm: Remove comments now in mpn/x86/mod_1.asm.
3288
3289         * mpn/x86/mod_1.asm: Put mpn_mod_1c after mpn_mod_1 for better branch
3290         prediction.  Put done_zero at end for less wastage in alignment.  Use
3291         decl+jnz unconditionally since in fact it's ok on k6.  Amend comments.
3292
3293 2003-06-07  Kevin Ryde  <kevin@swox.se>
3294
3295         * mpn/generic/mode1o.c: Fix ASSERTs on return value.
3296
3297         * gmp.texi (Build Options): Add viac3 and viac32 cpu types.
3298         (ABI and ISA): Note on sparcv9 ABI=32 vs ABI=64 speed.  More indexing.
3299
3300         * configfsf.guess, configfsf.sub: Update to 2003-06-06.
3301         * config.guess: Remove $RANDOM hack supporting netbsd 1.4, not needed
3302         by new configfsf.guess.
3303
3304
3305 2003-06-05  Torbjorn Granlund  <tege@swox.com>
3306
3307         * longlong.h (add_ssaaaa) [pa64]: Output zero operand as register 0.
3308         Allow more immediate operands.
3309         (sub_ddmmss) [pa64]: Likewise.
3310         (add_ssaaaa) [pa32]: Likewise.
3311         (sub_ddmmss) [pa32]: Likewise.
3312
3313         * mpn/pa64: Change ".level 2.0W" to ".level 2.0w" to please
3314         picky GNU assembler.
3315
3316 2003-06-05  Kevin Ryde  <kevin@swox.se>
3317
3318         * gmp.texi (Integer Special Functions): In mpz_array_init, fix type
3319         shown for integer_array and give an example use.
3320
3321 2003-06-04  Torbjorn Granlund  <tege@swox.com>
3322
3323         * mpf/set_str.c (mpf_set_str): Work around gcc 2 bug triggered on
3324         alpha.
3325
3326 2003-06-03  Kevin Ryde  <kevin@swox.se>
3327
3328         * mpn/x86/pentium/README: Add 7 c/l mmx mul_1, tweak wordings.
3329
3330         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Use octal char constants in test
3331         program, hex is not supported by K&R.
3332
3333 2003-06-02  Torbjorn Granlund  <tege@swox.com>
3334
3335         * mpn/mips64/divrem_1.asm: New file.
3336
3337 2003-06-01  Torbjorn Granlund  <tege@swox.com>
3338
3339         * mpn/powerpc32/lshift.asm: Reformat code.
3340         * mpn/powerpc32/rshift.asm: Reformat code.
3341
3342 2003-05-30  Kevin Ryde  <kevin@swox.se>
3343
3344         * tests/misc.c (tests_start): Set stdout and stderr to unbuffered, to
3345         avoid any chance of losing output on segv etc.
3346
3347 2003-05-28  Torbjorn Granlund  <tege@swox.com>
3348
3349         * mpf/get_str.c: Move label `done' to match TMP_MARK and TMP_FREE.
3350         Remove redundant variable prec.
3351
3352 2003-05-26  Torbjorn Granlund  <tege@swox.com>
3353
3354         * tests/mpz/convert.c: Test bases up to 62.
3355
3356         * tests/mpf/t-conv.c: Test bases up to 62.
3357
3358         * demos/pexpr.c: Don't iterate to get accurate timing.
3359
3360         * mpf/set_str.c (mpn_pow_1_highpart): Cleanup.
3361
3362         * mp_dv_tab.c: Fix typo.
3363
3364         * mpf/get_str.c: Rewrite (now sub-quadratic).
3365
3366 2003-05-22  Kevin Ryde  <kevin@swox.se>
3367
3368         * tests/mpn/t-divrem_1.c: New file.
3369         * tests/mpn/Makefile.am: Add it.
3370
3371 2003-05-22  Torbjorn Granlund  <tege@swox.com>
3372
3373         * config.sub: Recognize viac3* processors.
3374
3375 2003-05-20  Torbjorn Granlund  <tege@swox.com>
3376
3377         * mpn/sparc64/addmul_2.asm: New file.
3378
3379 2003-05-19  Torbjorn Granlund  <tege@swox.com>
3380
3381         * configure.in: Recognize alphaev7* as alphaev67.
3382
3383         * config.guess: Recognize viac3* processors.
3384         * configure.in: Set up path for viac3* processors.
3385         * acinclude.m4 (X86_PATTERN): Include viac3* processors.
3386
3387 2003-05-19  Kevin Ryde  <kevin@swox.se>
3388
3389         * tune/freq.c (freq_pstat_getprocessor): New function.
3390         (freq_all): Use it.
3391         * configure.in (AC_CHECK_HEADERS): Add sys/pstat.h.
3392         (AC_CHECK_FUNCS): Add pstat_getprocessor.
3393
3394 2003-05-15  Kevin Ryde  <kevin@swox.se>
3395
3396         * mpn/generic/mul_fft.c (mpn_mul_fft_decompose): Remove "inline",
3397         since the code is a bit too big.  gcc doesn't actually inline when
3398         alloca (TMP_ALLOC) is used anyway.
3399
3400 2003-05-13  Kevin Ryde  <kevin@swox.se>
3401
3402         * gmp.texi (Notes for Particular Systems): Libtool directory is .libs
3403         not _libs for mingw dll.  Reported by Andreas Fabri.
3404
3405 2003-05-07  Kevin Ryde  <kevin@swox.se>
3406
3407         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code to generate sse2/xmm code
3408         from gcc -march=pentium4, to check the assembler supports that.
3409         (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): New macros.
3410         * configure.in (pentium4-*-*): Use them to see if gcc -march=pentium4
3411         (with sse2) is ok.
3412
3413 2003-05-06  Kevin Ryde  <kevin@swox.se>
3414
3415         * mpz/com.c: Rate size==0 as UNLIKELY, fix comment to mpn_add_1.
3416
3417         * tune/freq.c (<sys/sysinfo.h>): Include only when needed for
3418         getsysinfo(), to avoid a problem with this file on AIX 5.1.
3419
3420 2003-05-03  Torbjorn Granlund  <tege@swox.com>
3421
3422         * mpf/set_str.c: Do not ignore supposedly superfluous digits (in part
3423         reverting last change).
3424
3425 2003-05-03  Kevin Ryde  <kevin@swox.se>
3426
3427         * gmp.texi: Use @code for files in @cindex entries, it looks nicer
3428         than @file.
3429
3430         * Makefile.am: Note gmp 4.1.1 and 4.1.2 version info.
3431
3432         * configure.in, acinclude.m4 (GMP_CRAY_OPTIONS): New macro for Cray
3433         system setups, letting AC_REQUIRE do its job instead of a hard coded
3434         AC_PROG_EGREP.
3435
3436         * config.guess: Amend fake RANDOM to avoid ". configfsf.guess" which
3437         segfaults on Debian "ash" 0.4.16.
3438
3439 2003-05-01  Kevin Ryde  <kevin@swox.se>
3440
3441         * configure.in (AC_CHECK_FUNCS): Add getsysinfo.
3442         (AC_CHECK_HEADERS): Add sys/sysinfo.h and machine/hal_sysinfo.h.
3443         * tune/freq.c (freq_getsysinfo): New function.
3444         (freq_all): Use it.
3445         (freq_sysctlbyname_i586_freq, freq_sysctlbyname_tsc_freq,
3446         freq_sysctl_hw_cpufrequency, freq_sysctl_hw_model): Set
3447         speed_cycletime before trying to print it, when verbose.
3448
3449 2003-04-28  Torbjorn Granlund  <tege@swox.com>
3450
3451         * mpf/set_str.c: Major overhaul.
3452         (mpn_pow_1_highpart): New helper function, meat extracted from
3453         mpf_set_str.
3454
3455 2003-04-24  Kevin Ryde  <kevin@swox.se>
3456
3457         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Quote result string against m4.
3458
3459         * configure, ltmain.sh, aclocal.m4: Update to libtool 1.5.
3460
3461         * longlong.h (add_ssaaaa) [all]: Remove first "%" commutative in each,
3462         since gcc only supports one per asm.
3463
3464         * printf/doprnt.c: Add M for mp_limb_t.
3465         * tests/misc/t-printf.c: Exercise this.
3466
3467         * tests/mpz/t-cmp_d.c: Test infinities.
3468         * tests/mpf/t-cmp_d.c: New file.
3469         * tests/mpf/Makefile.am: Add it.
3470
3471         * mpz/cmp_d.c, mpz/cmpabs_d.c, mpf/cmp_d.c: NaN invalid, Inf bigger
3472         than any value.
3473         * mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
3474
3475         * configure.in (AC_CHECK_FUNCS): Add raise.
3476         * invalid.c: New file.
3477         * Makefile.am: Add it.
3478         * gmp-impl.h (__gmp_invalid_operation): Add prototype.
3479         (DOUBLE_NAN_INF_ACTION): New macro.
3480
3481         * tests/trace.c, tests/tests.h (d_trace): New function.
3482         * tests/misc.c, tests/tests.h (tests_infinity_d): New function.
3483         * tests/misc.c (mpz_erandomb, mpz_errandomb): Use gmp_urandomm_ui.
3484
3485         * tune/tuneup.c, tune/common.c, tests/devel/try.c: Cast various
3486         mp_size_t values for printf %ld in case mp_size_t==int.  Use
3487         gmp_printf for mp_limb_t values.
3488
3489         * gmp.texi (Nomenclature and Types): Add mp_exp_t, mp_size_t,
3490         gmp_randstate_t.  Note ulong for bit counts and size_t for byte
3491         counts.  Don't bother with @noindent.
3492         (Debugging): New valgrind is getting MMX/SSE.
3493         (Integer Comparisons): mpz_cmp_d and mpz_cmpabs_d on NaNs and Infs.
3494         (Float Comparison): mpf_cmp_d behaviour on NaNs and Infs.
3495         (Low-level Functions): Note with mpn_hamdist what hamming distance is.
3496         (Formatted Output Strings): Add type M.
3497         (Internals): Remove remarks on ulong bits and size_t bytes.  Move int
3498         field remarks to ...
3499         (Integer Internals, Float Internals): ... here.
3500
3501 2003-04-19  Kevin Ryde  <kevin@swox.se>
3502
3503         * configure.in (*sparc*-*-* ABI=32): Add umul to extra_functions.
3504
3505         * mpn/x86/p6/mul_basecase.asm: New file.
3506
3507 2003-04-18  Kevin Ryde  <kevin@swox.se>
3508
3509         * configure.in (m68060-*-*): Fallback to gcc -m68000 when -m68060 not
3510         available, and don't use mpn/m68k/mc68020 asm routines.  (Avoids 32x32
3511         mul and 64/32 div which trap to the kernel on 68060.  Advice by
3512         Richard Zidlicky.)
3513         * mpn/m68k/README: Update notes on directory usage.
3514
3515         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Add a hack to let the
3516         test programs run with a shared libgmpxx on openbsd 3.2.
3517
3518         * gmp.texi (Language Bindings): Add Guile.
3519
3520 2003-04-12  Kevin Ryde  <kevin@swox.se>
3521
3522         * configure.in (cygwin*, mingw*, pw32*, os2*): Add
3523         -Wl,--export-all-symbols to GMP_LDFLAGS, no longer the default in
3524         latest mingw and libtool.
3525
3526         * acinclude.m4 (GMP_ASM_COFF_TYPE): New macro.
3527         * configure.in (x86s): Use it.
3528         * mpn/x86/x86-defs.m4 (COFF_TYPE): New macro.
3529         (PROLOGUE_cpu): Use it, for the benefit of mingw DLLs.
3530
3531         * gmp-impl.h (mpn_copyi, mpn_copyd): Add __GMP_DECLSPEC.
3532
3533         * gmp.texi (Known Build Problems): Remove windows test program .exe
3534         repeated built, fixed by new libtool.  Remove MacOS C++ shared library
3535         creation, fixed by new libtool.
3536         (Notes for Package Builds, Known Build Problems): Remove DESTDIR notes
3537         on libgmpxx, fixed in new libtool.
3538
3539 2003-04-10  Torbjorn Granlund  <tege@swox.com>
3540
3541         * configure.in: Match turbosparc.
3542         * config.guess: Recognize turbosparc (just for *bsd for now).
3543
3544 2003-04-09  Kevin Ryde  <kevin@swox.se>
3545
3546         * mpf/mul_ui.c [nails]: Call mpf_mul to handle v > GMP_NUMB_MAX.
3547
3548         * tests/mpz/t-mul.c (main): Don't try FFT sizes when FFT disabled via
3549         MP_SIZE_T_MAX, eg. for nails.
3550
3551         * tests/cxx/t-ternary.cc: Split up tests to help compile speed and
3552         memory usage.
3553
3554         * tests/devel/try.c: Print seed under -R, add -E to reseed, use ulong
3555         for seed not uint.
3556
3557         * gmp.texi: Add @: after various abbreviations, more index entries.
3558         (leftarrow): New macro, for non-tex.
3559         (Random State Initialization): Remove commented gmp_randinit_lc, not
3560         going to be implemented.
3561         (Random Number Algorithms): New section.
3562         (References): Add Matsumoto and Nishimura on Mersenne Twister, add
3563         Bertot, Magaud and Zimmermann on GMP Square Root.
3564
3565 2003-04-06  Kevin Ryde  <kevin@swox.se>
3566
3567         * tests/mpz/t-gcd_ui.c: New file.
3568         * tests/mpz/Makefile.am: Add it.
3569
3570         * mpz/gcd_ui.c: Correction to return value on longlong limb systems,
3571         limb might not fit a ulong.
3572
3573 2003-04-04  Kevin Ryde  <kevin@swox.se>
3574
3575         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
3576         2003-04-02.
3577
3578 2003-04-02  Kevin Ryde  <kevin@swox.se>
3579
3580         * configure.in (*-*-cygwin*): No longer force lt_cv_sys_max_cmd_len,
3581         libtool has addressed this now.
3582         (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): Remove this, libtool _LT_AC_LOCK
3583         no longer needs it.
3584
3585         * acinclude.m4 (GMP_PROG_AR): Also set ac_cv_prog_AR and
3586         ac_cv_prog_ac_ct_AR when adding flags to AR, so they're not lost by
3587         libtool's call to AC_CHECK_TOOL.
3588
3589 2003-04-01  Kevin Ryde  <kevin@swox.se>
3590
3591         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
3592         2003-03-31.
3593
3594         * configure.in (AC_PROG_F77): Add a dummy AC_PROVIDE to stop libtool
3595         running F77 probes.
3596
3597         * randlc2x.c (gmp_rand_lc_struct): Add comments about what exactly is
3598         in each field.
3599         (randseed_lc): Rename seedp to seedz to avoid confusion with seedp in
3600         the lc function.  Suggested by Pedro Gimeno.
3601         (gmp_randinit_lc_2exp): Use __GMP_ALLOCATE_FUNC_TYPE.  No need for
3602         "+1" in mpz_init2 of _mp_seed.  Don't bother with mpz_init2 for _mp_a.
3603
3604 2003-03-29  Kevin Ryde  <kevin@swox.se>
3605
3606         * configure.in (m68k-*-*): Use -O2, no longer need to fallback to -O.
3607         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): Remove macro.
3608
3609         * configure.in (AC_CHECK_TYPES): Add notes on why tested.
3610
3611         * gmp.texi (GMPrefu, GMPpxrefu, GMPreftopu, GMPpxreftopu): New macros,
3612         use them for all external references to get URLs into HTML output.
3613         (Random State Initialization): Add gmp_randinit_set.
3614         (Random State Miscellaneous): New section.
3615
3616 2003-03-29  Kevin Ryde  <kevin@swox.se>
3617
3618         * randbui.c, randmui.c: New files.
3619         * Makefile.am: Add them.
3620         * gmp-h.in (gmp_urandomb_ui, gmp_urandomm_ui): Add prototypes.
3621         * tests/rand/t-urbui.c, tests/rand/t-urmui.c: New files.
3622         * tests/rand/Makefile.am: Add them.
3623
3624         * gmp-impl.h (gmp_randstate_srcptr): New typedef.
3625         (gmp_randfnptr_t): Add randiset_fn.
3626         * randiset.c: New file.
3627         * Makefile.am: Add it.
3628         * gmp-h.in (gmp_randinit_set): Add prototype.
3629         * randlc2x.c, randmt.c: Add gmp_randinit_set support.
3630         * tests/rand/t-iset.c: New file.
3631         * tests/rand/Makefile.am: Add it.
3632
3633         * tests/misc.c, tests/tests.h (call_rand_algs): New function.
3634
3635 2003-03-27  Kevin Ryde  <kevin@swox.se>
3636
3637         * mpz/bin_uiui.c: Use plain "*" for kacc products rather than
3638         umul_ppmm since high not needed, except for an ASSERT now amended.
3639
3640 2003-03-26  Kevin Ryde  <kevin@swox.se>
3641
3642         * demos/expr/exprfr.c (cbrt, cmpabs, exp2, gamma, nextabove,
3643         nextbelow, nexttoward): New functions.
3644         * demos/expr/t-expr.c: Exercise these.
3645
3646         * mpfr/*: Update to mpfr cvs 2003-03-26.
3647
3648         * gmp-impl.h (MPZ_REALLOC): Use UNLIKELY, to expect no realloc.
3649
3650         * tune/time.c (cycles_works_p): Scope variables down to relevant part
3651         to avoid warnings about unused.
3652
3653         * configfsf.guess, configfsf.sub: Update to 2003-02-22.
3654         * config.guess: Fake a $RANDOM variable when running configfsf.guess,
3655         to workaround a problem on m68k NetBSD 1.4.1.
3656
3657         * mpz/fac_ui.c: Remove unused variable "z1".
3658
3659         * tune/freq.c (freq_irix_hinv): Allow "Processor 0" line from IRIX 6.5.
3660
3661 2003-03-24  Torbjorn Granlund  <tege@swox.com>
3662
3663         * randlc2x.c (randget_lc): Remove write-only variable rn.
3664         * mpf/eq.c: Remove write-only variable usign.
3665         * gen-psqr.c (main): Remove write-only variable numb_bits.
3666
3667 2003-03-17  Torbjorn Granlund  <tege@swox.com>
3668
3669         * Makefile.am (libgmp_la_SOURCES): Add mp_dv_tab.c.
3670         (libmp_la_SOURCES): Add mp_dv_tab.c.
3671
3672         * mpn/alpha/invert_limb.asm: Add a few comments.
3673
3674         * mp_dv_tab.c: New file, defining __gmp_digit_value_tab.
3675
3676         * mpz/set_str.c: Get rid of function digit_value_in_base and use table
3677         __gmp_digit_value_tab instead.
3678         * mpz/inp_str.c: Likewise.
3679         * mpf/set_str.c: Likewise.
3680         * mpbsd/min.c: Likewise.
3681         * mpbsd/xtom.c: Likewise.
3682
3683         * mpz/set_str.c: Allow bases <= 62.  Return error for invalid bases.
3684         * mpz/inp_str.c: Likewise.
3685         * mpf/set_str.c: Likewise.
3686         * mpz/out_str.c: Likewise.
3687         * mpz/get_str.c: Likewise.
3688         * mpf/get_str.c: Likewise.
3689
3690         * mpz/inp_str.c: Restucture to allocate more string space just
3691         before needed.
3692         * mpbsd/min.c: Likewise.
3693
3694         * longlong.h (__udiv_qrnnd_c): Remove redundant casts.
3695         (32-bit sparc): Test HAVE_HOST_CPU_supersparc in addition to various
3696         sparc_v8 spellings.
3697
3698 2003-03-17  Kevin Ryde  <kevin@swox.se>
3699
3700         * mpfr/*: Update to mpfr cvs 2003-03-17.
3701
3702 2003-03-15  Kevin Ryde  <kevin@swox.se>
3703
3704         * Makefile.am (EXTRA_libgmp_la_SOURCES): Use this for TMP_ALLOC
3705         sources, instead of a libdummy.la.
3706
3707 2003-03-16  Torbjorn Granlund  <tege@swox.com>
3708
3709         * config.guess: Recognize supersparc and microsparc for *BSD systems.
3710         Generalize some superscalar recognition patterns.
3711
3712 2003-03-14  Torbjorn Granlund  <tege@swox.com>
3713
3714         * mpn/sparc64/udiv.asm: New file.
3715
3716 2003-03-13  Torbjorn Granlund  <tege@swox.com>
3717
3718         * mpn/sparc64: Table cycle counts.  Update some comments.
3719
3720 2003-03-10  Torbjorn Granlund  <tege@swox.com>
3721
3722         * mpn/generic/mul.c (mpn_mul): Don't blindly expect
3723         MUL_KARATSUBA_THRESHOLD to be a constant.
3724
3725 2003-03-07  Torbjorn Granlund  <tege@swox.com>
3726
3727         * mpn/generic/mul.c (mpn_mul): New operand splitting code for
3728         avoiding cache misses when un >> MUL_KARATSUBA_THRESHOLD > vn.
3729         (MUL_BASECASE_MAX_UN): New #define, default to 500 for now.
3730
3731 2003-03-07  Kevin Ryde  <kevin@swox.se>
3732
3733         * Makefile.am: Put gmp.h and mp.h under $(exec_prefix)/include.
3734         * gmp.texi (Build Options): Add notes on this.
3735         Reported by Vincent Lefèvre.
3736
3737 2003-03-06  Kevin Ryde  <kevin@swox.se>
3738
3739         * configure.in (alpha*-*-* gcc): Add asm option before testing -mcpu,
3740         for the benefit of gcc 2.9-gnupro-99r1 on alphaev68-dec-osf5.1 which
3741         doesn't otherwise put the assembler in the right mode for -mcpu=ev6.
3742
3743 2003-03-05  Torbjorn Granlund  <tege@swox.com>
3744
3745         * mpn/powerpc32/powerpc-defs.m4: Set up renaming for v registers.
3746
3747         * mpz/powm.c (redc): Instead of repeated mpn_incr_u invocations,
3748         accumulate carries and add at the end.
3749         (mpz_powm): Trim tp allocation, now as redc doesn't need carry guard.
3750
3751 2003-02-25  Torbjorn Granlund  <tege@swox.com>
3752
3753         * mpn/x86/pentium4/copyd.asm: Correct header comment.
3754
3755         * mpn/arm/addmul_1.asm: Correct cycle counts.
3756         * mpn/arm/submul_1.asm: Likewise.
3757
3758 2003-02-20  Kevin Ryde  <kevin@swox.se>
3759
3760         * demos/factorize.c (factor_using_pollard_rho): Test k>0 to avoid
3761         infinite loop if k=0 and gcd!=1 reveals a factor.  Reported by John
3762         Pongsajapan.
3763
3764         * gmp.texi, fdl.texi: Update to FDL version 1.2.
3765
3766 2003-02-18  Torbjorn Granlund  <tege@swox.com>
3767
3768         * mpn/arm/mul_1.asm: Fix typo introduced in last change.
3769
3770 2003-02-17  Torbjorn Granlund  <tege@swox.com>
3771
3772         * mpn/sparc64/copyi.asm: Add some header comments.
3773         * mpn/sparc64/copyd.asm: Likewise.
3774
3775         * mpn/arm/mul_1.asm: Put vl operand last for umull/umlal.
3776         Add some header comments.
3777         * mpn/arm/addmul_1.asm: Rewrite.
3778         * mpn/arm/submul_1.asm: Rewrite.
3779         * mpn/arm/gmp-mparam.h: Retune.
3780
3781 2003-02-16  Torbjorn Granlund  <tege@swox.com>
3782
3783         * mpn/arm/copyi.asm: New file.
3784         * mpn/arm/copyd.asm: New file.
3785
3786 2003-02-16  Kevin Ryde  <kevin@swox.se>
3787
3788         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Tolerate incorrect last data
3789         byte seen on an arm system.
3790
3791 2003-02-15  Torbjorn Granlund  <tege@swox.com>
3792
3793         * mpn/arm/gmp-mparam.h: Retune.
3794
3795 2003-02-13  Torbjorn Granlund  <tege@swox.com>
3796
3797         * mpn/powerpc32/750/com_n.asm: Add more cycle counts.
3798
3799 2003-02-13  Kevin Ryde  <kevin@swox.se>
3800
3801         * configure.in (AC_PREREQ): Bump to 2.57.
3802
3803         * configure.in, acinclude.m4 (GMP_GCC_WA_OLDAS): New macro, applying
3804         -Wa,-oldas only when necessary.
3805
3806         * configure.in (powerpc*-*-*): Don't use -Wa,-mppc with gcc, it
3807         overrides options recent gcc adds for -mcpu, making generated code
3808         fail to assemble.
3809
3810         * tune/tuneup.c (mpn_fft_table): Remove definition, it's in mul_fft.c.
3811
3812 2003-02-12  Torbjorn Granlund  <tege@swox.com>
3813
3814         * mpn/x86/pentium4/sse2/gmp-mparam.h: Retune.
3815         * mpn/x86/k7/gmp-mparam.h: Retune.
3816         * mpn/x86/k6/gmp-mparam.h: Retune.
3817         * mpn/x86/p6/gmp-mparam.h: Retune.
3818         * mpn/x86/p6/mmx/gmp-mparam.h: Retune.
3819
3820         * tests/mpz/t-mul.c (main): Rewrite FFT testing code.
3821
3822 2003-02-10  Torbjorn Granlund  <tege@swox.com>
3823
3824         * config.guess: Recognize "power2" systems.
3825
3826         * mpn/powerpc64/gmp-mparam.h: Fix indentation.
3827         * mpn/power/gmp-mparam.h: Retune.
3828         * mpn/alpha/ev6/nails/gmp-mparam.h: Retune.
3829         * mpn/sparc64/gmp-mparam.h: Retune.
3830         * mpn/pa64/gmp-mparam.h: Retune.
3831         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
3832         * mpn/sparc32/v8/gmp-mparam.h: Retune.
3833         * mpn/mips64/gmp-mparam.h: Retune.
3834         * mpn/alpha/ev6/gmp-mparam.h: Retune.
3835         * mpn/powerpc32/gmp-mparam.h: Retune.
3836         * mpn/powerpc32/750/gmp-mparam.h: Retune.
3837         * mpn/alpha/ev5/gmp-mparam.h: Retune.
3838         * mpn/m68k/gmp-mparam.h: Retune.
3839         * mpn/cray/gmp-mparam.h: Set GET_STR_PRECOMPUTE_THRESHOLD.
3840
3841         * configure.in: Undo this, problem doesn't happen any more:
3842         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
3843
3844 2003-02-03  Kevin Ryde  <kevin@swox.se>
3845
3846         * gmp-impl.h (MPN_NORMALIZE, MPN_NORMALIZE_NOT_ZERO): Add parens
3847         around macro parameters.  Reported by Jason Moxham.
3848
3849 2003-02-01  Kevin Ryde  <kevin@swox.se>
3850
3851         * gmp.texi (Low-level Functions): No overlap permitted by mpn_mul_n.
3852         Reported by Jason Moxham.
3853         (Formatted Input Strings): Correction to strtoul cross reference
3854         formatting.
3855         (BSD Compatible Functions): Add index entry for MINT.
3856
3857 2003-01-29  Torbjorn Granlund  <tege@swox.com>
3858
3859         * gmp-impl.h (mpn_mul_fft): Now returns int.
3860
3861 2003-01-29  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
3862
3863         * mpn/generic/mul_fft.c: Major rewrite.
3864
3865 2003-01-25  Kevin Ryde  <kevin@swox.se>
3866
3867         * config.guess (powerpc*-*-*): Remove $dummy.core file when mfpvr
3868         fails on NetBSD.
3869         (trap): Remove $dummy.core on abnormal termination too.
3870
3871         * mpfr/*: Update to mpfr cvs 2003-01-25.
3872
3873 2003-01-18  Kevin Ryde  <kevin@swox.se>
3874
3875         * mpfr/*: Update to mpfr cvs 2003-01-18.
3876
3877 2003-01-17  Torbjorn Granlund  <tege@swox.com>
3878
3879         * gmp.texi: Canonicalize URLs.
3880
3881 2003-01-15  Kevin Ryde  <kevin@swox.se>
3882
3883         * gmp.texi (Notes for Particular Systems): Add hardware floating point
3884         precision mode.
3885
3886         * mpfr/*, configure, aclocal.m4, config.in: Update to mpfr cvs
3887         2003-01-15.
3888
3889 2003-01-11  Kevin Ryde  <kevin@swox.se>
3890
3891         * mpfr/*: Update to mpfr cvs 2003-01-11.
3892
3893 2003-01-09  Kevin Ryde  <kevin@swox.se>
3894
3895         * mpfr/get_str.c: Update to mpfr cvs 2003-01-09.
3896
3897         * doc/configuration: Various updates.
3898
3899 2003-01-06  Torbjorn Granlund  <tege@swox.com>
3900
3901         * mpn/alpha/copyi.asm: Avoid `nop' mnemonic, unsupported on Cray.
3902         * mpn/alpha/copyd.asm: Likewise.
3903
3904 2003-01-05  Kevin Ryde  <kevin@swox.se>
3905
3906         * demos/expr/t-expr.c (check_r): Tolerate mpfr_set_str new return
3907         value.
3908
3909         * configure, aclocal.m4 (*-*-osf4*, *-*-osf5*): Regenerate with
3910         libtool patch to avoid bash printf option problem when building shared
3911         libraries with cxx.
3912
3913         * configure.in (pentium4-*-*): Use "-march=pentium4 -mno-sse2" since
3914         sse2 causes buggy code from gcc 3.2.1 and is only supported on new
3915         enough kernels.
3916
3917         * acinclude.m4 (GMP_PROG_NM): Add some notes about failures, per
3918         report by Krzysztof Kozminski.
3919
3920         * gmp-h.in (mpz_mdivmod_ui, mpz_mmod_ui): Add parens around "r".
3921
3922         * gmp-h.in (__GMP_CAST): New macro, clean to g++ -Wold-style-cast.
3923         (GMP_NUMB_MASK, mpz_cmp_si, mpq_cmp_si, mpz_odd_p, mpn_divexact_by3,
3924         mpn_divmod): Use it.  Reported by Krzysztof Kozminski.
3925         (mpz_odd_p): No need for the outermost cast to "int".
3926         * tests/cxx/t-cast.cc: New file.
3927         * tests/cxx/Makefile.am: Add it.
3928
3929 2003-01-04  Kevin Ryde  <kevin@swox.se>
3930
3931         * mpfr/set_str.c: Update to mpfr cvs 2003-01-04.
3932
3933         * demos/expr/exprfra.c (e_mpfr_number): Tolerate recent mpfr_set_str
3934         returning count of characters accepted.
3935
3936 2003-01-03  Torbjorn Granlund  <tege@swox.com>
3937
3938         * mpn/alpha/copyi.asm: New file.
3939         * mpn/alpha/copyd.asm: New file.
3940
3941 2003-01-03  Kevin Ryde  <kevin@swox.se>
3942
3943         * demos/expr/t-expr.c: Use __gmpfr on some mpfr internals that have
3944         changed.
3945
3946         * mpfr/*, aclocal.m4, config.in, configure: Update to mpfr cvs
3947         2003-01-03.
3948
3949         * gmp.texi (Introduction to GMP): Mention release announcements
3950         mailing list, and put home page and ftp before mailing lists.
3951
3952 2002-12-28  Torbjorn Granlund  <tege@swox.com>
3953
3954         * mpn/generic/mul_fft.c (mpn_fft_next_size): Simplify.
3955
3956 2002-12-28  Kevin Ryde  <kevin@swox.se>
3957
3958         * acinclude.m4 (M68K_PATTERN): New macro.
3959         (GMP_GCC_M68K_OPTIMIZE): Use it to avoid m6811 and friends.
3960         * configure.in: Ditto.
3961
3962         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use '\xHH' to avoid
3963         warnings about char overflows.
3964         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Ditto.
3965
3966 2002-12-28  Pedro Gimeno  <pggimeno@wanadoo.es>
3967
3968         * randmt.c (randseed_mt, default_state): Fix off-by-one bug on padding.
3969         (randseed_mt): Add ASSERT checking result of mpz_export.
3970
3971 2002-12-24  Kevin Ryde  <kevin@swox.se>
3972
3973         * gmp.texi (Integer Import and Export): Clarify treatment of signs,
3974         reported by Kent Boortz.
3975
3976         * randmt.c: Use gmp_uint_least32_t.
3977         (randseed_mt): Add nails to mpz_export in case mt[i] more than 32 bits.
3978
3979         * gmp-impl.h (gmp_uint_least32_t): New typedef, replacing GMP_UINT32.
3980         * configure.in (AC_CHECK_TYPES): Add uint_least32_t.
3981         (AC_CHECK_SIZEOF): Add unsigned short.
3982
3983 2002-12-22  Kevin Ryde  <kevin@swox.se>
3984
3985         * gmp-impl.h (ULONG_PARITY) [generic C]: Mask result to a single bit.
3986         (ULONG_PARITY) [_CRAY, __ia64]: New macros.
3987         * tests/t-parity.c: New test.
3988         * tests/Makefile.am (check_PROGRAMS): Add it.
3989
3990         * longlong.h (count_trailing_zeros) [ia64]: New macro.
3991
3992         * tests/t-count_zeros.c (check_various): Remove unused variable "n".
3993
3994         * mpn/x86/README: Revise notes on PIC, PLT and GOT.
3995
3996         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add "mt"
3997         to GMP::Rand::randstate.
3998
3999 2002-12-22  Pedro Gimeno  <pggimeno@wanadoo.es>
4000
4001         * randmt.c (randseed_mt): Fix bug that might cause the generator to
4002         return all zeros with certain seeds.  Fix WARM_UP==0 case.
4003         (gmp_randinit_mt): Initialize to a known state by default.
4004         (randget_mt): Remove check for uninitialized buffer: no longer needed.
4005         (recalc_buffer): Use ?: instead of two-element array.
4006
4007         * tests/rand/t-mt.c: New test.
4008         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
4009
4010 2002-12-21  Kevin Ryde  <kevin@swox.se>
4011
4012         * cxx/osdoprnti.cc: Use <cstdarg> and <cstring> rather than <stdarg.h>
4013         and <string.h>.  No need for <stdio.h>.
4014
4015         * demos/expr/expr.c, demos/expr/exprfa.c, demos/expr/exprfra.c,
4016         demos/expr/exprza.c: Use mp_get_memory_functions, not
4017         __gmp_allocate_func etc.
4018         * demos/expr/t-expr.c: Don't use gmp-impl.h.
4019         (numberof): New macro.
4020
4021         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
4022         __gmp_free_func): Move declarations to gmp-impl.h
4023
4024         * mp_get_fns.c: New file.
4025         * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
4026         * gmp-h.in (mp_get_memory_functions): Add prototype.
4027         * gmp.texi (Custom Allocation): Add mp_get_memory_functions, refer to
4028         "free" not "deallocate" function.
4029         * gmpxx.h (struct __gmp_alloc_cstring): Use mp_get_memory_functions,
4030         not __gmp_free_func.
4031
4032         * gmp-impl.h [__cplusplus]: Add <cstring> for strlen.
4033         (gmp_allocated_string): Hold length in a field.
4034         * cxx/osdoprnti.cc, cxx/osmpf.cc: Use this.
4035
4036 2002-12-20  Torbjorn Granlund  <tege@swox.com>
4037
4038         * tests/mpz/t-perfsqr.c (check_sqrt): Print more variables upon
4039         failure.
4040
4041         * mpn/generic/rootrem.c: In Newton loop, pad qp with leading zero.
4042
4043 2002-12-19  Torbjorn Granlund  <tege@swox.com>
4044
4045         * mpn/generic/rootrem.c: Allocate 1.585 (log2(3)) times more space
4046         for pp temporary to allow for worst case overestimate of root.
4047         Add some asserts.
4048
4049         * tests/mpz/t-root.c: Generalize and speed up.
4050
4051 2002-12-19  Kevin Ryde  <kevin@swox.se>
4052
4053         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt test.
4054
4055         * gmp-h.in: Don't bother trying to support Compaq C++ in pre-standard
4056         I/O mode.
4057         * gmp.texi (Notes for Particular Systems): Compaq C++ must be used in
4058         "standard" iostream mode.
4059
4060 2002-12-18  Torbjorn Granlund  <tege@swox.com>
4061
4062         * mpn/alpha/mod_34lsub1.asm: Add code for big-endian, using existing
4063         little-endian code only if HAVE_LIMB_LITTLE_ENDIAN is defined.
4064
4065 2002-12-18  Kevin Ryde  <kevin@swox.se>
4066
4067         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): New
4068         defines in config.m4.
4069
4070 2002-12-17  Torbjorn Granlund  <tege@swox.com>
4071
4072         * printf/printffuns.c (gmp_fprintf_reps): Make it actually work
4073         for padding > 256.
4074
4075 2002-12-17  Kevin Ryde  <kevin@swox.se>
4076
4077         * tune/freq.c: Add <string.h> for memcmp.
4078
4079         * mpz/pprime_p.c: Use MPN_MOD_OR_MODEXACT_1_ODD.
4080
4081         * gmp.texi (Formatted Output Strings): %a and %A are C99 not glibc.
4082         (Formatted Input Strings): Type "l" is for double too.  Hex floats are
4083         accepted for mpf_t.
4084         (Formatted Input Functions): Describe tightened parse rule, clarify
4085         return value a bit.
4086
4087         * scanf/doscan.c: Add hex floats, tighten matching to follow C99, for
4088         instance "0x" is no longer acceptable to "%Zi".
4089         Rename "invalid" label to avoid "invalid" variable, SunOS cc doesn't
4090         like them the same.
4091         * tests/misc/t-scanf.c: Update tests.
4092         * tests/misc/t-locale.c (check_input): Don't let "0x" appear from fake
4093         decimal point.
4094
4095         * config.guess (sparc*-*-*): Look at BSD sysctl hw.model to recognise
4096         ultrasparcs.
4097
4098         * mpfr/tests/dummy.c: New file.
4099         * mpfr/tests/Makefile.am (libfrtests_a_SOURCES): Add it.
4100
4101 2002-12-14  Kevin Ryde  <kevin@swox.se>
4102
4103         * mpbsd/Makefile.am (nodist_libmpbsd_la_SOURCES): Move these mpz
4104         sources to libmpbsd_la_SOURCES directly, automake 1.7.2 now gets the
4105         ansi2knr setups right for sources in other directories.
4106
4107         * mpfr/tests/Makefile.am: Add libfrtests.a in preparation for new mpfr.
4108
4109 2002-12-13  Kevin Ryde  <kevin@swox.se>
4110
4111         * mpfr/Makefile.am (mpfr_TEXINFOS, AM_MAKEINFOFLAGS): Allow for
4112         fdl.texi in recent mpfr.
4113
4114         * configure.in (AC_PROG_EGREP): Ensure this is run outside the Cray
4115         conditional AC_EGREP_CPP.
4116
4117         * configure.in (alpha*-*-*): Use gcc -Wa,-oldas if it works, to avoid
4118         problems with new compaq "as" on OSF 5.1.
4119
4120         * mpn/Makefile.am (EXTRA_DIST): Remove Makeasm.am, automake 1.7.2 does
4121         it automatically.
4122
4123         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Remove this hack, fixed by
4124         autoconf 2.57.
4125
4126         * configure.in (AC_CONFIG_LIBOBJ_DIR): Set to mpfr, for the benefit of
4127         new mpfr using LIBOBJ.
4128
4129         * configure.in: (AM_INIT_AUTOMAKE): Use "gnu no-dependencies
4130         $(top_builddir)/ansi2knr".
4131         * */Makefile.am (AUTOMAKE_OPTIONS): Remove, now in configure.in.
4132
4133         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.57.
4134         * */Makefile.in, configure, aclocal.m4, install-sh, mkinstalldirs:
4135         Update to automake 1.7.2.
4136
4137         * gmp.texi (Build Options): Add hppa64 to cpu types.
4138         (ABI and ISA): Add gcc to hppa 2.0.
4139         (Debugging): Add maximum debuggability config options.
4140         (Language Bindings): Add Arithmos, reported by Johan Vervloet.
4141         (Formatted Output Strings): 128 bits is about 40 digits, ll is only
4142         for long long not long double.
4143         (Formatted Input Strings): ll is only for long long not long double.
4144
4145         * mpz/divis.c, mpz/divis_ui.c, mpz/cong.c, mpz/cong_ui.c: Allow d=0,
4146         under the rule n==c mod d iff exists q satisfying n=c+q*d.
4147         * gmp.texi (Integer Division): Describe this.
4148         Suggested by Jason Moxham.
4149
4150 2002-12-13  Pedro Gimeno  <pggimeno@wanadoo.es>
4151
4152         * randlc2x.c (lc): Remove check for seedn < an, which is now
4153         superfluous.  Add ASSERT to ensure it's correct.  Add ASSERT to check
4154         precondition of __GMPN_ADD.
4155         (gmp_randinit_lc_2exp): Avoid reallocation by allocating one extra bit
4156         for both seed and a.  Simplify seedn < p->_cn case.
4157
4158         * tests/rand/t-lc2exp.c (check_bigs): Test negative seeds.
4159
4160 2002-12-12  Torbjorn Granlund  <tege@swox.com>
4161
4162         * mpn/pa32/pa-defs.m4 (PROLOGUE_cpu): Zap spurious argument to `.proc'.
4163         Add empty `.callinfo'.
4164
4165 2002-12-11  Torbjorn Granlund  <tege@swox.com>
4166
4167         * mpn/x86/pentium4/sse2/addmul_1.asm: Don't reuse `ret' symbol for a
4168         label.
4169
4170 2002-12-11  Kevin Ryde  <kevin@swox.se>
4171
4172         * configure.in (hppa*-*-*): Don't use gcc -mpa-risc-2-0 in ABI=1.0.
4173
4174         * mpn/pa32/pa-defs.m4: New file, arranging for .proc/.procend.
4175         * configure.in (hppa*-*-*): Use it.
4176
4177         * printf/doprnt.c: Comments on "ll" versus "L".
4178
4179         * tests/mpz/t-div_2exp.c: Reduce tests, especially the random ones.
4180
4181 2002-12-11  Torbjorn Granlund  <tege@swox.com>
4182
4183         * mpz/get_d.c (limb2dbl): New macro for conversion to `double'.
4184         Define it to something non-trivial for 64-bit hppa.
4185         * mpq/get_d.c: Likewise.
4186         * mpf/get_d.c: Likewise.
4187
4188         * mpn/x86/pentium4/sse2/addmul_1.asm: Unroll to save one c/l.
4189
4190 2002-12-09  Kevin Ryde  <kevin@swox.se>
4191
4192         * tune/Makefile.am: Don't use -static under --disable-static, it tends
4193         not to work.
4194         * configure.in (ENABLE_STATIC): New AM_CONDITIONAL.
4195
4196         * gmp-h.in: Use <iostream> instead of <iosfwd> with Compaq C++ in
4197         pre-standard I/O mode.
4198
4199         * tests/mpz/t-jac.c, tests/mpz/t-scan.c: Reduce tests.
4200
4201 2002-12-08  Kevin Ryde  <kevin@swox.se>
4202
4203         * configure.in (*-*-ultrix*): Remove forcible --disable-shared,
4204         believe this was a generic problem with libtool, now gone.
4205
4206 2002-12-08  Torbjorn Granlund  <tege@swox.com>
4207
4208         * gmp-impl.h (USE_LEADING_REGPARM): Disable for PIC code generation.
4209
4210 2002-12-07  Torbjorn Granlund  <tege@swox.com>
4211
4212         * tests/cxx/t-misc.cc (check_mpq): Use 0/1 for canonical 0 in
4213         mpq_cmp_ui calls.
4214
4215         * configure.in (hppa2.0*-*-*): Pass +O2 instead of +O3 to work around
4216         compiler bug with mpfr/tests/tdiv.
4217
4218 2002-12-07  Kevin Ryde  <kevin@swox.se>
4219
4220         * configure.in (hppa2.0*-*-* ABI=2.0n): Make -mpa-risc-2-0 optional.
4221         New hppa-level-2.0 test using GMP_HPPA_LEVEL_20 to detect assembler
4222         support for 2.0n.
4223         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code that provokes an error
4224         from gcc -mpa-risc-2-0 if the assembler doesn't know 2.0 instructions.
4225         (GMP_HPPA_LEVEL_20): New macro.
4226
4227 2002-12-07  Pedro Gimeno  <pggimeno@wanadoo.es>
4228
4229         * gmp-impl.h (gmp_randfnptr_t.randseed_fn) Return void.
4230         (LIMBS_PER_ULONG, MPN_SET_UI): New macros.
4231         (MPZ_FAKE_UI): Rename couple of parameters.
4232
4233         * randlc2x.c (gmp_rand_lc_struct): _mp_c and _mp_c_limbs replaced
4234         with mpn style _cp and _cn.  All callers changed.
4235         (randseed_lc): Fix limbs(seed) > bits_to_limbs(m2exp) case.
4236         Remove return value.
4237         (gmp_randinit_lc_2exp): Attempt to avoid redundant reallocation.
4238
4239         * randmt.c (mangle_seed): New function by Kevin.
4240         (randseed_mt): Use it instead of mpz_powm, for performance.  Remove
4241         return value.  Remove commented out code (an inferior alternative to
4242         mpz_export).
4243
4244         * randsdui.c (gmp_randseed_ui): Use MPZ_FAKE_UI.
4245
4246         * tests/rand/t-lc2exp.c (check_bigm, check_bigs): New tests.
4247         * tests/rand/t-urndmm.c: Add L to constants in calls, for K&R.
4248
4249 2002-12-06  Torbjorn Granlund  <tege@swox.com>
4250
4251         * configure.in: Remove -g.
4252         (hppa*-*-*): Pass -Wl,+vnocompatwarnings with +DA2.0.
4253
4254 2002-12-05  Torbjorn Granlund  <tege@swox.com>
4255
4256         * mpn/pa64/sqr_diagonal.asm: Remove .entry, .proc, .procend.
4257         * mpn/pa64/udiv.asm: Likewise.
4258
4259 2002-12-05  Kevin Ryde  <kevin@swox.se>
4260
4261         * mpn/pa64/sub_n.asm: Remove space in "sub, db" which gas objects to.
4262         * mpn/pa64/*.asm, tune/hppa2.asm: Use ".level 2.0" for 2.0n, since gas
4263         doesn't like ".level 2.0N".
4264
4265         * configure.in (hppa*-*-*): Group path and flags choices, for clarity.
4266         (hppa1.0*-*-*): Use gcc -mpa-risc-1-0 when available.
4267         (hppa2.0*-*-*): Ditto -mpa-risc-2-0.
4268         (*-*-hpux*): Exclude ABI=2.0w for hpux[1-9] and hpux10, rather than
4269         the converse of allowing it for hpux1[1-9]; ie. list the bad systems
4270         rather than try to guess the good systems.
4271         (hppa2.0*-*-*) [ABI=2.0n ABI=2.0w]: Add gcc to likely compilers.
4272         (hppa*-*-*) [gcc]: Test sizeof(long) to differentiate a 32-bit or
4273         64-bit build of the compiler.
4274         (hppa64-*-*): Add this as equivalent to hppa2.0-*-*.
4275         * acinclude.m4 (GMP_C_TEST_SIZEOF): New macro.
4276
4277         * tests/tests.h (ostringstream::str): Must null-terminate
4278         ostrstream::str() for the string constructor.
4279
4280 2002-12-04  Torbjorn Granlund  <tege@swox.com>
4281
4282         * mpn/pa32/hppa1_1/udiv.asm: Don't wrap symbol to INT64 in L() stuff.
4283
4284         * longlong.h (mpn_udiv_qrnnd_r based udiv_qrnnd): Fix typo.
4285
4286         * mpn/powerpc32/powerpc-defs.m4: Define float registers with `f'
4287         prefix.
4288
4289 2002-12-04  Kevin Ryde  <kevin@swox.se>
4290
4291         * gmp.texi (Floating-point Functions): Note the mantissa is binary and
4292         decimal fractions cannot be represented exactly.  Suggested by Serge
4293         Winitzki.
4294         (Known Build Problems): Note libtool stripping options when linking.
4295         Reported by Vincent Lefevre.
4296
4297         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Don't make an empty result a
4298         failure, that's a valid result.
4299         (GMP_ASM_GLOBL): Establish this from the host cpu type.
4300         (IA64_PATTERN): New macro.
4301         (GMP_PROG_EXEEXT_FOR_BUILD, GMP_C_FOR_BUILD_ANSI,
4302         GMP_CHECK_LIBM_FOR_BUILD): Remove temporary files created.
4303         * configure.in: Use IA64_PATTERN.
4304
4305 2002-12-03  Torbjorn Granlund  <tege@swox.com>
4306
4307         * tune/hppa.asm: Use config.m4.
4308         * tune/hppa2.asm: Likewise.
4309         * tune/hppa2w.asm: Likewise.
4310
4311         * mpn/pa64: Use LDEF.
4312
4313 2002-12-03  Kevin Ryde  <kevin@swox.se>
4314
4315         * INSTALL: Use return rather than exit in the example programs.
4316         Suggested by Richard Dawe.
4317
4318         * gmp.texi (Build Options): Move non-unix notes to ...
4319         (Notes for Particular Systems): ... here.  Mention MS Interix,
4320         reported by Paul Leyland.
4321         (C++ Interface Random Numbers): Add gmp_randinit_mt to examples.
4322
4323         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Must test empty suffix first,
4324         for the benefit of hppa hp-ux.
4325         (GMP_ASM_UNDERSCORE): Grep the output of "nm" instead of trying to
4326         construct an asm file, and in case of failure fallback on no
4327         underscore and a warning.
4328
4329         * longlong.h (count_leading_zeros, count_trailing_zeros) [ev67, ev68]:
4330         Restrict __asm__ ctlz and cttz to __GNUC__.
4331
4332         * gen-psqr.c (HAVE_CONST, const): New macros.
4333
4334         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt.
4335
4336 2002-12-02  Torbjorn Granlund  <tege@swox.com>
4337
4338         * gmp-impl.h: Split popc_limb again, combined version gives too many
4339         compiler warnings.
4340
4341 2002-12-01  Torbjorn Granlund  <tege@swox.com>
4342
4343         * mpn/generic/gcdext.c (div1): Disable unused function.
4344
4345         * mpz/root.c: Don't include stdlib.h or longlong.h.
4346         * mpz/rootrem.c: Likewise.
4347
4348         * extract-dbl.c: abort => ASSERT_ALWAYS.
4349         * mpz/set_d.c: Likewise.
4350         * mpn/generic/tdiv_qr.c: Likewise.
4351
4352         * gen-psqr.c (f_cmp_fraction, f_cmp_divisor): Change parameter to
4353         `const void *', to match qsort spec.
4354
4355 2002-12-01  Kevin Ryde  <kevin@swox.se>
4356
4357         * gmp.texi (Integer Division): Fix a couple of @math's for tex.
4358         Use @dots in more places.
4359
4360         * tests/cxx/t-locale.cc: Test non std::locale systems too.
4361         * tests/cxx/clocale.c: New file, reinstating what was localeconv.c,
4362         and subverting nl_langinfo too.
4363         * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
4364
4365         * tests/tests.h (ostringstream, istringstream): Provide fakes of these
4366         if <sstream> not available.
4367         * tests/cxx/t-locale.cc, tests/cxx/t-ostream.cc: Remove <sstream>.
4368         * configure.in (AC_CHECK_HEADERS) [C++]: Add <sstream>.
4369
4370 2002-11-30  Torbjorn Granlund  <tege@swox.com>
4371
4372         * printf/doprnt.c (__gmp_doprnt): Comment out a `break' to shut up
4373         compiler warnings.
4374
4375         * longlong.h (umul_ppmm) [ia64]: Form both product parts in asm.
4376
4377         * mpz/bin_uiui.c: Cast umul_ppmm operands.
4378
4379         * scanf/doscan.c (gmpscan): Remove unused label store_get_digits.
4380
4381         * gmp-impl.h: #undef MIN and MAX before #defining.
4382
4383 2002-11-30  Kevin Ryde  <kevin@swox.se>
4384
4385         * configure.in (AC_CHECK_HEADERS): Add nl_types.h.
4386         * tests/misc/t-locale.c: Use this, for nl_item on netbsd 1.4.1.
4387
4388 2002-11-29  Torbjorn Granlund  <tege@swox.com>
4389
4390         * tests/devel/addmul_1.c: Provide prototype for mpn_print.
4391         (OPS): Account for function overhead.
4392         * tests/devel/{submul_1.c,mul_1.c,add_n.c,sub_n.c}: Likewise.
4393
4394 2002-11-28  Kevin Ryde  <kevin@swox.se>
4395
4396         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Use this rather
4397         than libdummy.
4398         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Use this for
4399         x86call.asm and x86check.c rather than libdummy.
4400
4401 2002-11-27  Torbjorn Granlund  <tege@swox.com>
4402
4403         * tests/mpz/t-mul.c: Implement reference Karatsuba multiplication.
4404         Rewrite testing scheme to run fewer really huge tests.
4405
4406 2002-11-26  Torbjorn Granlund  <tege@swox.com>
4407
4408         * tests: Decrease repetition count for some of the slowest tests.
4409
4410 2002-11-25  Torbjorn Granlund  <tege@swox.com>
4411
4412         * mpfr/tests/tdiv.c: Decrease number of performed tests.
4413
4414 2002-11-23  Kevin Ryde  <kevin@swox.se>
4415
4416         * mpn/ia64/README: Add some references.
4417
4418         * gmp.texi (Build Options): Add itanium and itanium2, mention DocBook
4419         and XML from makeinfo, add texinfo top level cross reference.
4420         (Integer Division): Try to clarify 2exp functions a bit.
4421         (C++ Interface Floats): Giving bad string to constructor is undefined.
4422         (C++ Interface Integers, C++ Interface Rationals): Ditto, and show
4423         default base in prototype, not the description.
4424
4425         * config.sub, config.guess, configure.in (itanium, itanium2): New cpu
4426         types.
4427
4428         * tests/misc/t-printf.c, tests/misc/t-scanf.c (check_misc): Suppress
4429         %zd test on glibc prior to 2.1, it's not supported.
4430
4431 2002-11-20  Kevin Ryde  <kevin@swox.se>
4432
4433         * tests/cxx/t-locale.cc: Test with locales imbued into stream, use
4434         <sstream>, eliminated some C-isms.  istream tests disabled, not yet
4435         locale-ized.
4436         * tests/cxx/Makefile.am (t_locale_SOURCES): Remove localeconv.c.
4437         * tests/cxx/localeconv.c: Remove file.
4438
4439         * configure.in (AC_CHECK_TYPES) [C++]: Add std::locale.
4440         * printf/doprntf.c: Add decimal point parameter, remove localeconv use.
4441         * gmp-impl.h (__gmp_doprnt_mpf): Update prototype, bump symbol to
4442         __gmp_doprnt_mpf2 to protect old libgmpxx.
4443         * cxx/osmpf.cc: Use this with ostream locale decimal_point facet.
4444         * printf/doprnt.c: Ditto, with GMP_DECIMAL_POINT.
4445
4446         * gmp-h.in: More comments on __declspec for windows DLLs.
4447
4448         * mpf/set_str.c, scanf/doscan.c: Cast through "unsigned char" for
4449         decimal point string, same as input chars.
4450
4451         * configure.in (AC_CHECK_HEADERS): Add langinfo.h.
4452         (AC_CHECK_FUNCS): Add nl_langinfo.
4453         * gmp-impl.h (GMP_DECIMAL_POINT): New macro.
4454         * mpf/out_str.c, mpf/set_str.c, scanf/doscan.c: Use it, and don't
4455         bother with special code for non-locale systems.
4456         * tests/misc/t-locale.c: Subvert nl_langinfo too.
4457
4458         * configure.in, acinclude.m4 (GMP_ASM_X86_GOT_UNDERSCORE): New macro.
4459         * mpn/x86/x86-defs.m4 (_GLOBAL_OFFSET_TABLE_): New macro, inserting
4460         extra underscore for OpenBSD.
4461         * mpn/x86/README (_GLOBAL_OFFSET_TABLE_): Update notes.
4462         Reported by Christian Weisgerber.
4463
4464         * tests/cxx/t-rand.cc (check_randinit): New function, collecting up
4465         constructor tests.
4466
4467         * tests/cxx/t-ostream.cc: Use <sstream> instead of <strstream>, use
4468         compare instead of strcmp.
4469
4470         * gmpxx.h (__gmp_randinit_lc_2exp_size_t): Return type is int.
4471
4472 2002-11-18  Kevin Ryde  <kevin@swox.se>
4473
4474         * tune/speed.c (r_string): Use CNST_LIMB with <N>bits, spotted by
4475         Torbjorn.
4476
4477 2002-11-17  Torbjorn Granlund  <tege@swox.com>
4478
4479         * mpn/generic/popham.c: New file, using new faster algorithm.
4480         * mpn/generic/popcount.c: Remove.
4481         * mpn/generic/hamdist.c: Remove.
4482
4483         * mpn/ia64/addmul_1.asm: Don't clobber callee-saves register f16.
4484         * mpn/ia64/mul_1.asm: Likewise.
4485
4486         * mpn/ia64/addmul_1.asm: Add pred.rel declarations.  Resolve RAW
4487         hazards for condition code registers, duplicating code as needed.  Add
4488         prediction to all branches.
4489         * mpn/ia64/mul_1.asm: Likewise.
4490         * mpn/ia64/add_n.asm: Likewise.
4491         * mpn/ia64/sub_n.asm: Likewise.
4492         * mpn/ia64/copyi.asm: Likewise.
4493         * mpn/ia64/copyd.asm: Likewise.
4494
4495         * mpn/generic/random2.c: Add a cast to silence some compilers.
4496
4497 2002-11-16  Torbjorn Granlund  <tege@swox.com>
4498
4499         * mpz/powm.c: Cap allocation by limiting k to 10 (512 precomputed
4500         values).
4501
4502 2002-11-16  Kevin Ryde  <kevin@swox.se>
4503
4504         * configure.in, gmp.texi: Remove powerpc64 ABI=32L, doesn't work and
4505         is unlikely to ever do so.
4506         * configure.in: Allow ABI=32 for powerpc64.
4507         Reported by David Edelsohn.
4508
4509 2002-11-14  Kevin Ryde  <kevin@swox.se>
4510
4511         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add addmul_2.c
4512         addmul_3.c addmul_4.c addmul_5.c addmul_6.c addmul_7.c addmul_8.c.
4513
4514         * gmp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
4515         Use __dllexport__ and __dllimport__ to keep out of application
4516         namespace.
4517
4518 2002-11-14  Gerardo Ballabio <gerardo.ballabio@unimib.it>
4519
4520         * gmpxx.h (__gmp_randinit_default_t, __gmp_randinit_lc_2exp_t,
4521         __gmp_randinit_lc_2exp_size_t): Use extern "C" { typedef ... }, for
4522         the benefit of g++ prior to 3.2.
4523
4524 2002-11-12  Kevin Ryde  <kevin@swox.se>
4525
4526         * gmpxx.h (gmp_randclass constructors): Patch from Roberto Bagnara to
4527         use extern "C" on C function pointer arguments.
4528
4529 2002-11-09  Kevin Ryde  <kevin@swox.se>
4530
4531         * configure.in, Makefile.am, printf/Makefile.am,
4532         printf/repl-vsnprintf.c: Handle vsnprintf replacement with C
4533         conditionals.
4534
4535         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Workaround troubles recent
4536         HP cc +O3 causes for AC_CHECK_FUNCS.
4537
4538         * gmp.texi (Notes for Particular Systems): Add Sparc app regs.
4539         (Debugging): Note gcc -fstack options to detect overflow.
4540         (Formatted Output Strings, Formatted Input Strings): Format strings
4541         are not multibyte.
4542
4543 2002-11-06  Torbjorn Granlund  <tege@swox.com>
4544
4545         * mpn/generic/tdiv_qr.c: Remove a bogus assert.
4546
4547 2002-11-05  Torbjorn Granlund  <tege@swox.com>
4548
4549         * mpn/generic/tdiv_qr.c: Remove two dead mpn_divrem_2 calls.
4550
4551 2002-11-04  Kevin Ryde  <kevin@swox.se>
4552
4553         * acinclude.m4 (GMP_C_INLINE): Don't define "inline" for C++.
4554
4555         * demos/expr/expr-impl.h (stdarg.h): Test __DECC same as gmp.h.
4556
4557         * mpbsd/mtox.c, printf/obprintf.c, printf/obvprintf.c,
4558         scanf/vsscanf.c, demos/expr/expr.c, demos/expr/exprf.c,
4559         demos/expr/exprfa.c, demos/expr/exprfr.c, demos/expr/exprq.c,
4560         demos/expr/exprz.c, demos/expr/exprza.c: Add <string.h> for strlen and
4561         memcpy.
4562
4563 2002-11-02  Kevin Ryde  <kevin@swox.se>
4564
4565         * longlong.h: Test __x86_64__ not __x86_64.  Reported by Andreas
4566         Jaeger.
4567
4568         * mpz/import.c, mpz/export.c: Use char* subtract from NULL to get
4569         pointer alignment, for the benefit of Cray vector systems.
4570
4571         * cxx/ismpf.cc: Use <clocale>.
4572         * tests/cxx/t-locale.cc: No need to conditionalize <clocale>.
4573
4574         * scanf/doscan.c: Don't use isascii, rely on C99 ctype.h.
4575
4576         * gmp.texi (Build Options): Describe CC_FOR_BUILD, cross reference
4577         texinfo manual.
4578         (ABI and ISA): Add powerpc620 and powerpc630 to powerpc64, add NetBSD
4579         and OpenBSD sparc64.
4580         (Notes for Package Builds): Cross reference libtool manual.
4581         (Notes for Particular Systems): Add OpenBSD to non-MMX versions of gas.
4582         (Known Build Problems): Add MacOS X C++ shared libraries.
4583
4584 2002-10-31  Kevin Ryde  <kevin@swox.se>
4585
4586         * gmp-impl.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
4587         tests/devel/try.c, tests/tests.h, tests/refmpn.c (mpn_addmul_5,
4588         mpn_addmul_6, mpn_addmul_7, mpn_addmul_8): Add testing and measuring.
4589         * configure.in (config.in): Add #undefs of HAVE_NATIVE_mpn_addmul_5,
4590         HAVE_NATIVE_mpn_addmul_6, HAVE_NATIVE_mpn_addmul_7,
4591         HAVE_NATIVE_mpn_addmul_8.
4592         (gmp_mpn_functions_optional): Add addmul_5 addmul_6 addmul_7 addmul_8.
4593
4594         * tests/devel/try.c (ASSERT_CARRY): Remove, now in gmp-impl.h
4595         (try_one): Do dest setups after sources, for benefit of
4596         dst0_from_src1.
4597
4598 2002-11-01  Torbjorn Granlund  <tege@swox.com>
4599
4600         * mpn/generic/tdiv_qr.c: Avoid quadratic behaviour for
4601         sub-division when numerator is more than twice the size of the
4602         denominator.  Simplify loop logic for the same case.  Clean up a
4603         few comments.
4604
4605 2002-10-29  Torbjorn Granlund  <tege@swox.com>
4606
4607         * configure.in (*-cray-unicos*): Pass -hnofastmd again.
4608
4609 2002-10-25  Torbjorn Granlund  <tege@swox.com>
4610
4611         * tests/tadd.c: Disable test of denorms.
4612
4613 2002-10-23  Linus Nordberg  <linus@swox.se>
4614
4615         * gmp.texi (Introduction to GMP): Update section about mailing
4616         lists.
4617
4618 2002-10-23  Kevin Ryde  <kevin@swox.se>
4619
4620         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Suppress this when
4621         __GMP_NO_ATTRIBUTE_CONST_PURE is defined.
4622         * gmp-impl.h (ATTRIBUTE_CONST): Ditto.
4623         * tune/common.c: Use __GMP_NO_ATTRIBUTE_CONST_PURE.
4624
4625         * tune/speed.h, tune/many.pl: Remove ATTRIBUTEs from prototypes.
4626         * tune/speed.h: Remove various "dummy" variables attempting to keep
4627         "pure" calls live, no longer necessary.  They weren't sufficient for
4628         recent MacOS cc anyway.
4629
4630 2002-10-21  Torbjorn Granlund  <tege@swox.com>
4631
4632         * mpn/cray/ieee/addmul_1.c: Handle overlap as in mul_1.c.
4633         * mpn/cray/ieee/submul_1.c: Likewise.
4634
4635 2002-10-19  Kevin Ryde  <kevin@swox.se>
4636
4637         * configure.in (sparcv9 etc -*-*bsd*): Add support for NetBSD and
4638         OpenBSD sparc64.  Reported by Christian Weisgerber.
4639         (AC_CHECK_HEADERS): Add sys/param.h for sys/sysctl.h on *BSD.
4640
4641         * demos/calc/calc.y: Change ={ to {, needed for bison 1.50.
4642
4643         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]:
4644         Should be UDItype.
4645
4646         * mpz/set_str.c, mpf/set_str.c, mpbsd/xtom.c, scanf/sscanffuns.c: Cast
4647         chars through "unsigned char" to zero extend, required by C99 ctype.h.
4648
4649 2002-10-18  Torbjorn Granlund  <tege@swox.com>
4650
4651         * tests/mpz/t-root.c: Test also mpz_rootrem.
4652
4653         * mpn/generic/rootrem.c: Avoid overflow problem when n is huge.
4654
4655         * mpz/root.c: Avoid overflow problems in allocation computation; also
4656         simplify it.  Misc cleanups.
4657
4658         * mpz/rootrem.c: New file.
4659         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
4660
4661 2002-10-17  Torbjorn Granlund  <tege@swox.com>
4662
4663         * gmp-impl.h (popc_limb): Combine variants.
4664
4665 2002-10-14  Kevin Ryde  <kevin@swox.se>
4666
4667         * configure.in (AC_CHECK_HEADERS): Add sys/time.h for sys/resource.h
4668         test, needed by SunOS, and next autoconf will insist headers actually
4669         compile.
4670
4671 2002-10-08  Kevin Ryde  <kevin@swox.se>
4672
4673         * tune/time.c (speed_time_init): Allow for Cray times() apparently
4674         being a cycle counter.
4675
4676         * dumbmp.c (mpz_get_str): Fix buf size allocation.
4677
4678         * tests/trace.c, tests/tests.h (mp_limb_trace): New function.
4679
4680         * tune/speed-ext.c (SPEED_EXTRA_PROTOS): Use __GMP_PROTO.
4681         * tests/devel/try.c (malloc_region): Add a cast for SunOS cc.
4682
4683         * configure.in (AC_CHECK_FUNCS): Add strerror.
4684         (AC_CHECK_DECLS): Add sys_errlist, sys_nerr.
4685         * tune/time.c, tests/devel/try.c: Use them.
4686
4687 2002-10-05  Kevin Ryde  <kevin@swox.se>
4688
4689         * configure.in (AC_CHECK_HEADERS): Test float.h, not in SunOS cc.
4690         * printf/repl-vsnprintf.c: Use this.
4691
4692         * configure.in (*sparc*-*-*): Collect up various options for clarity,
4693         use gcc -mcpu=supersparc and ultrasparc3, use cc -xchip, don't use
4694         -xtarget=native, use cc configs with acc, merge SunOS bundled cc and
4695         SunPRO cc configs.
4696
4697         * gmp-impl.h (gmp_randfnptr_t): Use __GMP_PROTO.
4698         (MPZ_REALLOC): Cast _mpz_realloc return value to mp_ptr, for the
4699         benefit of SunOS cc which requires pointers of the same type on the
4700         two legs of a ?:.
4701
4702         * dumbmp.c (mpz_realloc): Add a cast to avoid a warning from SunOS cc.
4703
4704         * acinclude.m4: Allow for i960 b.out default cc output.
4705
4706         * gmp.texi (Random State Initialization): Add gmp_randinit_mt.
4707         (Perfect Square Algorithm): Describe new mpn_mod_34lsub1 use.
4708         (Factorial Algorithm): Describe Jason's new code.
4709         (Binomial Coefficients Algorithm): Ideas about improvements
4710         moved to doc/projects.html.
4711         (Contributors): Add Jason Moxham and Pedro Gimeno.
4712
4713 2002-10-03  Kevin Ryde  <kevin@swox.se>
4714
4715         * gen-psqr.c: New file.
4716         * Makefile.am, mpn/Makefile.am: Use it to generate mpn/perfsqr.h.
4717         * mpn/generic/perfsqr.c: Use generated data, put mod 256 data into
4718         limbs to save space, use mpn_mod_34lsub1 when good.
4719         * tests/mpn/t-perfsqr.c: New file.
4720         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
4721         * tests/mpz/t-perfsqr.c (check_modulo): New test.
4722         (check_sqrt): New function holding current tests.
4723
4724         * configure.in (AC_INIT): Modernize to package name and version here
4725         rather than AM_INIT_AUTOMAKE, add bug report email.
4726         (AC_CONFIG_SRCDIR): New macro.
4727
4728         * gmp-impl.h (ROUND_UP_MULTIPLE): Fix for non-power-of-2 moduli (not
4729         normal in current uses), clarify the comments a bit.
4730
4731 2002-09-30  Kevin Ryde  <kevin@swox.se>
4732
4733         * mpn/Makeasm.am (.s.lo): Add --tag=CC for the benefit of CCAS!=CC,
4734         same as .S.lo and .asm.lo.
4735
4736         * Makefile.am (gen-fac_ui, gen-fib, gen-bases): Quote source files in
4737         test -f stuff to avoid Sun make rewriting them.
4738
4739 2002-09-28  Kevin Ryde  <kevin@swox.se>
4740
4741         * tests/devel/try.c, tune/speed.c: Avoid strings longer than C99
4742         guarantees.
4743
4744         * tests/refmpn.c, tests/tests.h (refmpn_zero_extend, refmpn_normalize,
4745         refmpn_sqrtrem): New functions.
4746         * tests/devel/try.c (TYPE_SQRTREM): Use refmpn_sqrtrem.
4747         (compare): Correction to tr->dst_size subscripting.
4748
4749         * dumbmp.c: Add several new functions, allow for initial n<d in
4750         mpz_tdiv_q (now in mpz_tdiv_qr actually).
4751
4752         * gen-bases.c (chars_per_limb): Get GMP_NUMB_BITS for base==2,
4753         similarly other powers of 2, which this was in the past.
4754         * tests/refmpn.c (refmpn_chars_per_limb): Ditto.
4755         * tests/mpn/t-mp_bases.c: Test chars_per_limb for power-of-2 bases too.
4756
4757         * Makefile.am, mpz/Makefile.am: Setups for gen-fac_ui.c generating
4758         mpz/fac_ui.h.
4759
4760 2002-09-28  Jason Moxham <J.L.Moxham@maths.soton.ac.uk>
4761
4762         * dumbmp.c (mpz_pow_ui, mpz_addmul_ui, mpz_root): New functions.
4763         * gen-fac_ui.c: New file.
4764         * mpz/fac_ui.c: Rewrite.
4765
4766 2002-09-26  Kevin Ryde  <kevin@swox.se>
4767
4768         * tests/cxx/localeconv.c: New file, split from t-locale.cc.
4769         * tests/cxx/t-locale.cc: Use it.
4770         * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
4771
4772         * tests/cxx/Makefile.am: Updates for Gerardo's new test programs.
4773
4774 2002-09-26  Gerardo Ballabio <gerardo.ballabio@unimib.it>
4775
4776         * gmpxx.h (__gmp_cmp_function): Bug fixes in double/mpq and
4777         double/mpfr comparisons.
4778
4779         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-constr.cc,
4780         tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: Revise and add various
4781         tests, including some for mpfr, some split from t-expr.cc.
4782         * tests/cxx/t-locale.cc: Modernize include files.
4783         * tests/cxx/t-ostream.cc: Modernize include files, use cout rather
4784         than printf for diagnostics.
4785         * tests/cxx/t-misc.cc, tests/cxx/t-rand.cc: New file, split from
4786         t-allfuns.cc.
4787         * tests/cxx/t-ops.cc: New file, some split from t-allfuns.cc.
4788         * tests/cxx/t-prec.cc: New file.
4789         * tests/cxx/t-allfuns.cc, tests/cxx/t-expr.cc: Remove files.
4790
4791 2002-09-25  Torbjorn Granlund  <tege@swox.com>
4792
4793         * configure.in (*-cray-unicos*): Remove -hscalar0, it causes too much
4794         performance loss.  Let's trust Cray to fix their compilers.
4795
4796 2002-09-24  Torbjorn Granlund  <tege@swox.com>
4797
4798         * mpn/powerpc32/add_n.asm: Rewrite.
4799         * mpn/powerpc32/sub_n.asm: Rewrite.
4800
4801 2002-09-24  Pedro Gimeno  <pggimeno@wanadoo.es>
4802
4803         * randlc2x.c: Prepare for nails by changing type of _mp_c to mpz_t,
4804         make _mp_seed fixed-size, disallow SIZ(a)==0 to optimize comparisons
4805         for mpn_mul.
4806         * gmp-impl.h (MPZ_FAKE_UI): New macro.
4807
4808         * randmt.c: Some constants made long for K&R compliance; remove UL at
4809         the end of other constants; use mp_size_t where appropriate; use
4810         mpz_export to split the seed.
4811
4812         * gmp-impl.h: Remove type cast in RNG_FNPTR and RNG_STATE, to allow
4813         them to be used as lvalues.
4814         * randclr.c, randlc2x.c, randmt.c, randsd.c: All callers changed.
4815
4816         * mpz/urandomm.c: Replace mpn_cmp with MPN_CMP.
4817
4818         * tests/rand/gen.c: Get rid of gmp_errno.
4819
4820 2002-09-24  Kevin Ryde  <kevin@swox.se>
4821
4822         * gmp.texi (Custom Allocation): Keep allocate_function etc out of the
4823         function index by using @deftypevr.
4824         More index entries.
4825
4826 2002-09-24  Gerardo Ballabio <gerardo.ballabio@unimib.it>
4827
4828         * gmpxx.h (mpfr_class constructors from strings): Precision was set
4829         incorrectly, fixed.
4830
4831 2002-09-23  Torbjorn Granlund  <tege@swox.com>
4832
4833         * mpf/urandomb.c: Don't crash for overlarge nbits argument.
4834         Let nbits==0 mean to fill number with random bits.
4835
4836 2002-09-21  Torbjorn Granlund  <tege@swox.com>
4837
4838         * mpn/alpha/mod_34lsub1.asm: Add r31 dummy operand to `br' instruction.
4839
4840 2002-09-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
4841
4842         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal): Fix broken
4843         mpq/double functions.
4844
4845 2002-09-18  Torbjorn Granlund  <tege@swox.com>
4846
4847         * randmt.c (randget_mt): Fix typo.
4848
4849 2002-09-18  Kevin Ryde  <kevin@swox.se>
4850
4851         * gmp-impl.h (_gmp_rand): Avoid evaluating "state" more than once, for
4852         the benefit places calling it with RANDS.
4853
4854         * randmt.c (randseed_mt): Use mpz_init for mod and seed1, for safety.
4855
4856         * tune/tuneup.c (sqr_karatsuba_threshold): Initialize to
4857         TUNE_SQR_KARATSUBA_MAX so mpn_sqr_n works for randmt initialization.
4858
4859         * gmp.texi (Integer Comparisons): Remove mention of non-existant
4860         mpz_cmpabs_si, reported by Conrad Curry.
4861
4862         * tune/speed.c, tune/speed.h, tune/common.c: Add gmp_randseed,
4863         gmp_randseed_ui and mpz_urandomb.
4864
4865 2002-09-18  Pedro Gimeno  <pggimeno@wanadoo.es>
4866
4867         * tests/rand/gen.c: Add mt, remove lc and bbs.
4868
4869         * Makefile.am (libgmp_la_SOURCES): Add randmt.c, remove randlc.c and
4870         randraw.c.
4871
4872         * randmt.c: New file.
4873         * gmp-h.in (gmp_randinit_mt): Add prototype.
4874         * randdef.c: Use gmp_randinit_mt.
4875
4876         * gmp-impl.h (RNG_FNPTR, RNG_STATE): New macros.
4877         (gmp_randfnptr_t): New structure.
4878         (_gmp_rand): Now a macro not a function.
4879         * gmp-h.in (__gmp_randata_lc): Remove, now internal to randlc2x.c.
4880         (__gmp_randstate_struct): Revise comments on field usage.
4881         * randsd.c, randclr.c: Use function pointer scheme.
4882         * randsdui.c: Use gmp_randseed.
4883         * randraw.c: Remove file.
4884         * randlc2x.c: Collect up lc_2exp related code from randsd.c, randclr.c
4885         and randraw.c, use function pointer scheme, integrate seed==0/a==0
4886         into main case and fix case where bits(a) < m2exp.
4887
4888         * randlc.c: Remove file, never documented and never worked.
4889         * gmp-h.in (gmp_randinit_lc): Remove prototype.
4890
4891 2002-09-16  Torbjorn Granlund  <tege@swox.com>
4892
4893         * mpn/alpha/mod_34lsub1.asm: New file.
4894
4895 2002-09-16  Kevin Ryde  <kevin@swox.se>
4896
4897         * configure.in, acinclude.m4 (GMP_C_RESTRICT): Remove this, not
4898         currently used, and #define restrict upsets Microsoft C headers on
4899         win64.  Reported by David Librik.
4900
4901         * configure.in (x86): Add gcc 3.2 -march and -mcpu flags, remove some
4902         unnecessary -march=i486 fallbacks.
4903
4904         * gmp.texi (Notes for Particular Systems): Note cl /MD is required for
4905         Microsoft C and MINGW to cooperate on I/O.  Explained by David Librik.
4906         (Language Bindings): Add linbox.
4907         * gmp.texi (Language Bindings):
4908
4909 2002-09-12  Kevin Ryde  <kevin@swox.se>
4910
4911         * mpz/aorsmul_i.c: Allow for w==x overlap with nails.  Test
4912         BITS_PER_ULONG > GMP_NUMB_BITS rather than GMP_NAIL_BITS != 0.
4913         * tests/mpz/t-aorsmul.c: Test this.
4914
4915         * tune/common.c: mpn_mod_34lsub1 only exists for GMP_NUMB_BITS%4==0
4916         * tune/speed.c: Add mpn_mod_34lsub1.
4917
4918 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
4919
4920         * rand.c: Remove old disabled BBS code.
4921         * mpf/urandomb.c: Use BITS_TO_LIMBS.
4922
4923 2002-09-10  Kevin Ryde  <kevin@swox.se>
4924
4925         * gmp.texi (Multiplication Algorithms): FFT is now enabled by default.
4926
4927 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
4928
4929         * mpz/urandomm.c: Use mpn level functions, avoid an infinite loop if
4930         _gmp_rand forever returns all "1" bits.
4931         * tests/rand/t-urndmm.c: New file
4932         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
4933
4934         * gmp-impl.h (BITS_TO_LIMBS): New macro.
4935         * mpz/urandomb.c: Use it, and use MPZ_REALLOC.
4936
4937 2002-09-08  Kevin Ryde  <kevin@swox.se>
4938
4939         * acinclude.m4 (GMP_GCC_WA_MCPU): New macro.
4940         * configure.in (alpha*-*-*): Use it to avoid -Wa,-mev67 if gas isn't
4941         new enough to know ev67.  Reported by David Bremner.
4942
4943 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
4944
4945         * gmpxx.h (__gmpz_value etc): Remove, use mpz_t etc instead.
4946         (__gmp_expr): Reorganise specializations, use __gmp_expr<T,T> not
4947         mpz_class etc.
4948         (mpfr evals): Remove mode parameter, was always
4949         __gmp_default_rounding_mode anyway.
4950
4951 2002-09-07  Kevin Ryde  <kevin@swox.se>
4952
4953         * gmp-h.in, mp-h.in: Use #ifdef for tests, for the benefit of
4954         applications using gcc -Wundef.
4955
4956         * longlong.h: Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB for all alphas,
4957         since mpn/alpha/cntlz.asm always goes into libgmp.so, even for ev67
4958         and ev68 which don't need it.  Reported by David Bremner.
4959
4960         * gmp.texi (Demonstration Programs): New section, expanding on what
4961         was under "Build Options".
4962         (Converting Floats): Don't need \ for _ in @var within @math.
4963         Add and amend various index entries.
4964
4965         * demos/qcn.c: Add -p prime limit option.
4966
4967 2002-08-30  Kevin Ryde  <kevin@swox.se>
4968
4969         * mpz/pprime_p.c: Handle small negatives with isprime, in particular
4970         must do so for n==-2.
4971         * tests/mpz/t-pprime_p.c: New file.
4972         * tests/mpz/Makefile.am: Add it.
4973
4974 2002-08-26  Torbjorn Granlund  <tege@swox.com>
4975
4976         * gmp.texi (Converting Floats): Fix typo in mpf_get_d_2exp docs,
4977         reported by Paul Zimmermann.
4978
4979 2002-08-26  Kevin Ryde  <kevin@swox.se>
4980
4981         * configure.in: Echo the ABI being tried for the compilers.
4982         (powerpc*-*-*): Use powerpc64/aix.m4 for ABI=aix64 too.
4983         (AC_CHECK_FUNCS): Add strtol, for tests/rand/gen.c.
4984
4985 2002-08-24  Kevin Ryde  <kevin@swox.se>
4986
4987         * configure.in (HAVE_HOST_CPU_, HAVE_HOST_CPU_FAMILY_, HAVE_NATIVE_):
4988         Setup templates for these using AH_VERBATIM rather than acconfig.h,
4989         preferred by latest autoconf.  Prune lists to just things used.
4990         * acconfig.h: Remove file.
4991
4992         * mpn/powerpc32/mode1o.asm: Forgot ASM_START.
4993
4994         * tune/time.c (have_cgt_id): Renamed from HAVE_CGT_ID so avoid
4995         confusion with autoconf outputs, and turn it into a "const" variable.
4996
4997 2002-08-23  Torbjorn Granlund  <tege@swox.com>
4998
4999         * configure.in: Choose powerpc32/aix.m4 or powerpc64/aix.m4 based on
5000         ABI, not configuration triple.
5001
5002         * mpz/pprime_p.c: Partially undo last change--handle small and
5003         negative numbers in the same test.
5004
5005 2002-08-22  Kevin Ryde  <kevin@swox.se>
5006
5007         * gmp-impl.h (MUL_FFT_THRESHOLD, SQR_FFT_THRESHOLD): Note
5008         mpn/generic/mul_fft.c is not nails-capable, and don't bother setting
5009         other FFT data for nails.
5010
5011         * configfsf.guess: Update to 2002-08-19.
5012         * configfsf.sub: Update to 2002-08-20.
5013
5014         * config.guess (powerpc*-*-*): Use a { } construct to suppress SIGILL
5015         message on AIX.
5016
5017 2002-08-20  Kevin Ryde  <kevin@swox.se>
5018
5019         * gmp.texi (Build Options): Add ia64 under cpu types.
5020         (ABI and ISA): Describe IRIX 6 ABI=o32.
5021         (Notes for Particular Systems): Remove -march=pentiumpro, now ok.
5022         (Known Build Problems): Binutils 2.12 is ok for libgmp.a.
5023         (Emacs): New section.
5024         (Language Bindings): Update MLton URL, reported by Stephen Weeks.
5025         (Prime Testing Algorithm): New section.
5026         Don't put a blank line after @item in @table since it can make a page
5027         break between the heading and the entry.
5028         Misc tweaks elsewhere, in particular more index entries.
5029
5030         * mpz/millerrabin.c: Need x to be size+1 for change to urandomm.
5031
5032         * gmp-impl.h: Comments on the use of __GMP_DECLSPEC.
5033
5034         * tune/time.c (freq_measure_mftb_one): Use struct_timeval, for the
5035         benefit of mingw.
5036
5037         * tests/refmpn.c, tests/tests.h (ref_addc_limb, ref_subc_limb):
5038         Renamed from add and sub, following gmp-impl.h ADDC_LIMB and SUBC_LIMB.
5039
5040 2002-08-17  Kevin Ryde  <kevin@swox.se>
5041
5042         * mpn/powerpc32/mode1o.asm: New file.
5043         * configure.in, acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): New macro.
5044         * mpn/asm-defs.m4: Use it to help setting up PIC.
5045
5046         * configure.in (AC_PREREQ): Bump to 2.53.
5047
5048         * mpn/powerpc32/powerpc-defs.m4 (ASSERT): New macro.
5049         (PROLOGUE_cpu): New macro, giving ALIGN(4) not 8.
5050
5051 2002-08-16  Torbjorn Granlund  <tege@swox.com>
5052
5053         * mpn/m68k/lshift.asm: Fix typo in !scale_available_p code.
5054         * mpn/m68k/rshift.asm: Likewise.
5055
5056 2002-08-16  Kevin Ryde  <kevin@swox.se>
5057
5058         * configure.in (--enable-profiling=instrument): New option.
5059         * gmp.texi (Profiling): Describe it.
5060         * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_instrument, ret_internal):
5061         Add support.
5062         (call_mcount): Share PIC setups with call_instrument.
5063         * mpn/x86/*.asm: Use ret_internal.
5064         * mpn/asm-defs.m4 (m4_unquote): New macro.
5065         * tests/mpn/t-instrument.c: New file.
5066         * tests/mpn/Makefile.am: Add it.
5067
5068         * mpn/alpha/umul.asm: Add ASM_END.
5069
5070 2002-08-12  Kevin Ryde  <kevin@swox.se>
5071
5072         * mpz/pprime_p.c: Fake up a local mpz_t to take abs(n), rather than
5073         using mpz_init etc.
5074
5075         * mpz/millerrabin.c: Use mpz_urandomm for uniform selection of x,
5076         reported by Jason Moxham.  Exclude x==n-1, ie. -1 mod n.  Use
5077         gmp_randinit_default.
5078
5079         * mpn/alpha/umul.asm: Use "r" registers, for the benefit of Unicos.
5080
5081         * tests/devel/try.c: Add mpn_copyi and mpn_copyd.
5082
5083 2002-08-09  Kevin Ryde  <kevin@swox.se>
5084
5085         * Makefile.am: Remove configure.lineno from DISTCLEANFILES and gmp.tmp
5086         from MOSTLYCLEANFILES, automake does these itself now.
5087
5088         * */Makefile.in, aclocal.m4, configure, install-sh, missing,
5089         mkinstalldirs: Update to automake 1.6.3.
5090
5091         * mpn/ia64/README: Some notes on assembler syntax.
5092
5093         * mpn/ia64/add_n.asm, mpn/ia64/sub_n.asm: Add .body.
5094         * mpn/ia64/add_n.asm, mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm,
5095         mpn/ia64/sub_n.asm: Position .save ar.lc just before relevant
5096         instruction.
5097         * mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm: Add .save ar.pfs and pr.
5098         * mpn/ia64/copyd.asm, mpn/ia64/copyi.asm: Correction to .body position.
5099         * mpn/ia64/lorrshift.asm: Add .prologue stuff.
5100
5101         * configure.in (*-*-unicos*): Remove forcible --disable-shared,
5102         libtool gets this right itself now.
5103
5104 2002-08-07  Kevin Ryde  <kevin@swox.se>
5105
5106         * mpn/x86/pentium/mmx/hamdist.asm: New file, adapted from
5107         mpn/x86/pentium/mmx/popham.asm.
5108         * mpn/x86/pentium/mmx/popham.asm: Remove file, not faster than plain
5109         mpn/x86/pentium/popcount.asm for the popcount.
5110
5111         * mpn/alpha/umul.asm: Use PROLOGUE/EPILOGUE, rename it mpn_umul_ppmm.
5112         * configure.in (alpha*-*-*): Add umul to extra_functions.
5113
5114         * mpz/remove.c: Make src==0 return 0, not do DIVIDE_BY_ZERO.
5115
5116 2002-08-05  Torbjorn Granlund  <tege@swox.com>
5117
5118         * acconfig.h: Remove spurious undefs for mpn_divrem_newton and
5119         mpn_divrem_classic.
5120
5121 2002-08-05  Kevin Ryde  <kevin@swox.se>
5122
5123         * tests/refmpn.c, tests/tests.h, tests/misc/t-printf.c,
5124         tests/mpf/t-trunc.c, tests/mpn/t-mp_bases.c, tests/mpn/t-scan.c,
5125         tests/mpq/t-cmp_ui.c, tests/mpz/bit.c, tests/mpz/t-aorsmul.c,
5126         tests/mpz/t-powm_ui.c tests/mpz/t-root.c, tests/mpz/t-scan.c: More
5127         care with long and mp_size_t parameters, for the benefit of K&R.
5128
5129         * demos/perl/GMP.pm, demos/perl/GMP.xs, demos/perl/GMP/Mpz.pm,
5130         demos/perl/test.pl: Add mpz_import and mpz_export.
5131         * demos/perl/GMP.pm: Remove "preliminary" warning.
5132
5133         * mpn/lisp/gmpasm-mode.el: Set add-log-current-defun-header-regexp to
5134         pick up m4 defines etc.
5135
5136         * Makefile.am (libgmpxx_la_DEPENDENCIES): libgmp.la should be here,
5137         not libgmpxx_la_LIBADD, for the benefit of "make -j2".
5138
5139         * mpn/ia64/*.asm [hpux ABI=32]: Extend 32-bit operands to 64-bits, not
5140         optimal and might not be sufficient, but seems to work.
5141
5142 2002-08-03  Kevin Ryde  <kevin@swox.se>
5143
5144         * gmp.texi (Profiling): Use a table and expand for clarity.
5145         (Integer Special Functions): New section for mpz_array_init,
5146         _mpz_realloc, mpz_getlimbn and mpz_size, to discourage their use.
5147
5148         * configure.in (*-*-msdosdjgpp*): Remove forcible --disable-shared,
5149         libtool gets this right itself now.
5150
5151 2002-07-30  Kevin Ryde  <kevin@swox.se>
5152
5153         * mpn/powerpc32/lshift.asm, mpn/powerpc32/rshift.asm: Lose final mr,
5154         and make final stwu into an stw.
5155
5156         * gmp.texi (Known Build Problems): An easier workaround for DESTDIR,
5157         using LD_LIBRARY_PATH.
5158         (C++ Interface MPFR): Remove mpfrxx.h.
5159
5160         * mpfrxx.h: Remove file.
5161         * Makefile.am: Remove mpfrxx.h.
5162         * tests/cxx/Makefile.am: Add Gerardo's new test programs.
5163
5164 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
5165
5166         * gmpxx.h: Use mpz_addmul etc for ternary a+b*c etc.  Reorganise some
5167         macros for maintainability.  Merge mpfrxx.h.
5168         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: Various updates.
5169         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc,
5170         tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: New files.
5171
5172 2002-07-27  Kevin Ryde  <kevin@swox.se>
5173
5174         * longlong.h (count_trailing_zeros) [ia64 __GNUC__]: Don't use
5175         __builtin_ffs for now, doesn't seem to work.
5176
5177         * configure.in: Establish CONFIG_SHELL to avoid a problem with
5178         AC_LIBTOOL_SYS_MAX_CMD_LEN on ia64-*-hpux*.
5179
5180         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_FINDA): Don't let calls to
5181         mpn_gcd_finda go dead.
5182
5183         * mpn/generic/tdiv_qr.c: Inline mpn_rshift and MPN_COPY of 2 limbs.
5184
5185 2002-07-24  Kevin Ryde  <kevin@swox.se>
5186
5187         * demos/primes.c: Use __GMP_PROTO and don't use signed, for the
5188         benefit of K&R.
5189
5190         * demos/calc/calclex.l: Add <string.h> for strcmp.
5191
5192         * mpn/ia64/invert_limb.asm: Use .rodata which works on ia64-*-hpux*
5193         and should be standard, rather than worrying about RODATA.
5194
5195         * gmp.texi (Function Classes): Add cross references.
5196         (Integer Import and Export): Fix return value grouping.
5197
5198         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add // for
5199         ia64.  Add notes on what the various styles are for.
5200
5201         * mpn/ia64/default.m4 (ASM_START): Define to empty, not dnl, so as not
5202         to kill text on the same line.
5203         (EPILOGUE_cpu): Force a newline after "#", so as not to suppress macro
5204         expansion in the rest of the EPILOGUE line.
5205
5206 2002-07-21  Kevin Ryde  <kevin@swox.se>
5207
5208         * tune/speed.h: Fix some missing _PROTOs.
5209
5210         * Makefile.am (DISTCLEANFILES): Add configure.lineno.
5211
5212         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Define
5213         HAVE_DOUBLE_IEEE_BIG_ENDIAN and HAVE_DOUBLE_IEEE_LITTLE_ENDIAN in
5214         config.m4 too.
5215         * mpn/ia64/invert_limb.asm: Add big-endian data.
5216
5217         * tests/mpz/t-jac.c (try_si_zi): Correction to "a" parameter type.
5218
5219 2002-07-20  Kevin Ryde  <kevin@swox.se>
5220
5221         * mpz/bin_ui.c, mpz/jacobi.c, mpz/pprime_p.c, mpn/generic/divis.c:
5222         More care with long and mp_size_t parameters, for the benefit of K&R.
5223
5224         * gmp-impl.h (invert_limb): Use parens around macro arguments.
5225         (mpn_invert_limb): Give prototype and define unconditionally.
5226
5227         * gmp-impl.h (CACHED_ABOVE_THRESHOLD, CACHED_BELOW_THRESHOLD): New
5228         macros.
5229         * mpn/generic/sb_divrem_mn.c: Use them to help gcc let preinv code go
5230         dead when not wanted.
5231
5232 2002-07-17  Kevin Ryde  <kevin@swox.se>
5233
5234         * tests/refmpz.c (refmpz_hamdist): Ensure mp_size_t parameters are
5235         that type, for the benefit of hpux ia64 bundled cc ABI=64.
5236
5237         * configure.in (ia64*-*-hpux*): Need +DD64 in cc_64_cppflags to get
5238         the right headers for ansi2knr.
5239
5240         * acinclude.m4 (GMP_TRY_ASSEMBLE, GMP_ASM_UNDERSCORE): Use $CPPFLAGS
5241         with $CCAS and when linking, as done by the makefiles.
5242         (GMP_ASM_X86_MMX, GMP_ASM_X86_SSE2): Show $CPPFLAGS in diagnostics.
5243
5244         * gmp-impl.h (ieee_double_extract): Setup using HAVE_DOUBLE_IEEE_*.
5245         (GMP_UINT32): New define, 32 bit type for ieee_double_extract.
5246         * configure.in: Add AC_CHECK_SIZEOF unsigned.
5247         * configure.in, acinclude.m4 (GMP_IMPL_H_IEEE_FLOATS): Remove.
5248         (GMP_C_DOUBLE_FORMAT): Instead warn about unknown float here.
5249
5250         * configure.in, acinclude.m4 (GMP_C_SIZES): Remove.
5251         * acinclude.m4 (GMP_INCLUDE_GMP_H_BITS_PER_MP_LIMB): Remove this
5252         scheme, not required.
5253         * configure.in (unsigned long, mp_limb_t): Run AC_CHECK_SIZEOF for
5254         these unconditionally, check mp_limb_t against gmp-mparam.h values.
5255         * gmp-impl.h (BYTES_PER_MP_LIMB, BITS_PER_MP_LIMB): Define based on
5256         SIZEOF_MP_LIMB_T if not provided by gmp-mparam.h.
5257         (BITS_PER_ULONG): Define here now.
5258
5259         * gmp.texi (ABI and ISA): Add HP-UX IA-64 choices.
5260         (Random State Initialization): Typo in m2exp described for
5261         gmp_randinit_lc_2exp_size.
5262         (Formatted Output Functions): Clarify gmp_obstack_printf a bit.
5263         (Formatted Input Strings): Typo in %n summary.
5264
5265         * mpz/inp_raw.c (NTOH_LIMB_FETCH): Use simple generic default, since
5266         endianness detection is now cross-compile friendly.
5267         * mpz/out_raw.c (HTON_LIMB_STORE): Ditto.
5268
5269         * mpz/fib_ui.c: Nailify.
5270         * mpz/random.c: Nailify.
5271
5272         * mpfr/acinclude.m4 (MPFR_CONFIGS): Patch by Vincent for an apparent
5273         float rounding gremlin on powerpc.
5274
5275 2002-07-15  Kevin Ryde  <kevin@swox.se>
5276
5277         * Makefile.am (PRINTF_OBJECTS): Avoid ending in a backslash, hpux ia64
5278         make doesn't like that.
5279
5280         * configure.in (ia64*-*-*): Use ABI=64 on non-HPUX systems, for
5281         consistency.
5282
5283         * gmp-impl.h (ieee_double_extract): Test __sparc__, used by gcc 3.1.
5284         Reported by nix@esperi.demon.co.uk.
5285         * mpfr/mpfr-math.h (_MPFR_NAN_BYTES etc): Ditto.
5286
5287 2002-07-13  Kevin Ryde  <kevin@swox.se>
5288
5289         * mpn/powerpc32/rshift.asm: Rewrite, transformed from lshift.asm.
5290
5291         * tune/tuneup.c (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD):
5292         Always zero for native mpn_divexact_1, mpn_modexact_1_odd.
5293
5294         * gmp-h.in (__GMP_EXTERN_INLINE): Don't use this during configure,
5295         ie. __GMP_WITHIN_CONFIGURE, to avoid needing dependent routines.
5296         * acinclude.m4 (GMP_H_EXTERN_INLINE): Consequent changes.
5297
5298         * gmp-impl.h, mpn/asm-defs.m4 (mpn_addmul_2, mpn_addmul_3,
5299         mpn_addmul_4): Add prototypes and defines.
5300
5301         * gmp.texi (Number Theoretic Functions): Clarify return value.
5302         Reported by Peter Keller.
5303
5304 2002-07-10  Kevin Ryde  <kevin@swox.se>
5305
5306         * configure.in, acinclude.m4 (GMP_PROG_LEX): Remove this in favour of
5307         AM_PROG_LEX, now ok when lex is missing.
5308
5309         * longlong.h (count_leading_zeros) [pentiummmx]: Don't use __clz_tab
5310         variant under LONGLONG_STANDALONE.
5311         (count_trailing_zeros) [ia64 __GNUC__]: Use __builtin_ffs.
5312
5313         * gmp-impl.h (popc_limb): Add an ia64 asm version.
5314         (DItype): Use HAVE_LONG_LONG to choose long long, avoiding _LONGLONG
5315         which is in gcc but means something unrelated in MS Visual C 7.0.
5316         Reported by David Librik.
5317
5318         * mpz/divexact.c: Add an ASSERT that den divides num.
5319
5320         * mpn/asm-defs.m4 (LDEF): New macro.
5321         (INT32, INT64): Use it.
5322         * mpn/pa32/*.asm: Use it.
5323         * mpn/pa32/README: Update notes on labels.
5324
5325         * tests/refmpn.c, tests/tests.h, tests/t-bswap.c (ref_bswap_limb):
5326         Renamed from refmpn_bswap_limb.
5327         * tests/t-bswap.c: Add tests_start/tests_end for randomization.
5328
5329         * tests/refmpn.c, tests/tests.h (ref_popc_limb): New function.
5330         * tests/t-popc.c: New file.
5331         * tests/Makefile.am: Add it.
5332
5333         * mpn/ia64/invert_limb.asm: Use RODATA since ".section .rodata" is not
5334         accepted by ia64-*-hpux*.
5335
5336         * acinclude.m4 (GMP_ASM_BYTE): New macro.
5337         (GMP_ASM_ALIGN_LOG, GMP_ASM_W32): Use it.
5338         (GMP_ASM_LABEL_SUFFIX): Use test compiles, not $host.
5339         (GMP_ASM_GLOBL): Ditto, and add .global for ia64-*-hpux*.
5340         (GMP_ASM_GLOBL_ATTR): Use GMP_ASM_GLOBL result, not $host.
5341         (GMP_ASM_LSYM_PREFIX): Allow any "a-z" nm symbol code, add ".text" to
5342         test program, required by ia64-*-hpux*.
5343         (GMP_ASM_LABEL_SUFFIX): Make LABEL_SUFFIX just the value, not a "$1:",
5344         the former being how it's currently being used in fact.
5345
5346         * configure.in, acinclude.m4 (GMP_PROG_CC_WORKS_LONGLONG): New macro.
5347         * configure.in (ia64-*-hpux*): Add 32 and 64 bit ABI modes.
5348
5349 2002-07-06  Kevin Ryde  <kevin@swox.se>
5350
5351         * tests/cxx/t-allfuns.cc: New file.
5352         * tests/cxx/Makefile.am: Add it.
5353
5354         * mpz/clrbit.c, mpz/setbit.c: Only MPN_NORMALIZE if high limb changes
5355         to zero.  Use _mpz_realloc return value.
5356
5357         * gmp.texi (Build Options, C++ Formatted Output, C++ Formatted Input):
5358         Cross reference to Headers and Libraries for libgmpxx stuff.
5359         (Low-level Functions): mpn_divexact_by3 result based on GMP_NUMB_BITS.
5360         mpn_set_str takes "unsigned char *", reported by Mark Sofroniou.
5361         (C++ Interface General): Describe linking with libgmpxx and libgmp.
5362
5363 2002-07-01  Kevin Ryde  <kevin@swox.se>
5364
5365         * tune/tuneup.c, gmp-impl.h: Eliminate the array of thresholds in
5366         one(), tune just one at a time and let the callers hand dependencies.
5367         Eliminate the second_start_min hack, handle SQR_KARATSUBA_THRESHOLD
5368         oddities in tune_sqr() instead.
5369
5370         * mpn/pa64/umul.asm, mpn/pa64/udiv.asm, mpn/asm-defs.m4, acconfig.h,
5371         longlong.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
5372         tests/devel/try.c: Introduce mpn_umul_ppmm_r and mpn_udiv_qrnnd_r
5373         rather than having variant parameter order for mpn_umul_ppmm and
5374         mpn_udiv_qrnnd on pa64.
5375
5376         * gmp-h.in (mpz_export): Remove a spurious parameter name.
5377         * gmp-impl.h (mpn_rootrem): Use __MPN.
5378
5379 2002-06-29  Kevin Ryde  <kevin@swox.se>
5380
5381         * longlong.h (udiv_qrnnd) [hppa32]: Remove mpn_udiv_qrnnd version, the
5382         general mechanism for that suffices.
5383
5384         * mpf/inp_str.c: Fix returned count of chars read, reported by Paul
5385         Zimmermann.  Also fix a memory leak for invalid input.
5386         * tests/mpf/t-inp_str.c: New file.
5387         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5388
5389         * tests/devel/try.c (mpn_mod_34lsub1): Only exists for
5390         GMP_NUMB_BITS%4==0.
5391         (SIZE2_FIRST): Respect option_firstsize2 for "fraction" case.
5392
5393         * mpn/generic/diveby3.c: Further nailifications.
5394         * gmp-impl.h (MODLIMB_INVERSE_3): Allow for GMP_NUMB_BITS odd.
5395         (GMP_NUMB_CEIL_MAX_DIV3, GMP_NUMB_CEIL_2MAX_DIV3): New constants.
5396         * tests/t-constants.c: Check them.
5397
5398         * gmp-h.in (__GMP_CRAY_Pragma): New macro.
5399         (__GMPN_COPY_REST): Use it.
5400         * gmp-impl.h (CRAY_Pragma): Use it.
5401
5402 2002-06-25  Kevin Ryde  <kevin@swox.se>
5403
5404         * mpz/import.c, mpz/export.c: Cast data pointer through "char *" in
5405         alignment tests, for the benefit of Cray vector systems.
5406
5407         * configure.in (x86-*-*): Remove -march=pentiumpro check, seems ok
5408         with current code.
5409         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO, GMP_GCC_VERSION_GE): Remove
5410         macros, no longer needed
5411
5412         * acinclude.m4 (GMP_ASM_RODATA): Remove temporary files.
5413
5414         * configure.in (GMP_ASM_GLOBL_ATTR): Reposition to avoid duplication
5415         through AC_REQUIRE.
5416
5417 2002-06-23  Kevin Ryde  <kevin@swox.se>
5418
5419         * tests/mpz/t-fib_ui.c (check_fib_table): Check table values, not just
5420         that they're non-zero.
5421
5422         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Match bad "gcc --version" output
5423         exactly, rather than parsing it with GMP_GCC_VERSION_GE.
5424         (GMP_ASM_UNDERSCORE): Use GLOBL_ATTR.
5425
5426         * mpn/pa32/udiv.asm, mpn/pa32/hppa1_1/udiv.asm, mpn/pa64/udiv.asm:
5427         Renamed from udiv_qrnnd.asm, for consistency with other udiv's.
5428         * mpn/pa64/umul.asm: Renamed from umul_ppmm.asm likewise.
5429         * configure.in (hppa*-*-*): Update extra_functions.
5430         (NAILS_SUPPORT): Remove umul_ppmm, udiv_qrnnd, udiv_fp, udiv_nfp from
5431         nails-neutral list, no longer needed.
5432
5433         * gmp-h.in (__DECC): Add notes on testing this for ANSI-ness.
5434         (__GMP_EXTERN_INLINE): Add static __inline for DEC C.
5435         (mpz_mod_ui): Move up to main section, it's still documented.
5436
5437 2002-06-22  Kevin Ryde  <kevin@swox.se>
5438
5439         * mpz/jacobi.c, mpz/kronsz.c, mpz/kronuz.c, mpz/kronzs.c,
5440         mpz/kronzu.c: Allow for odd GMP_NUMB_BITS, tweak a few variable setups.
5441         * gmp-impl.h (JACOBI_STRIP_LOW_ZEROS): New macro.
5442
5443         * mpn/generic/mod_34lsub1.c: Nailify.
5444         * tests/devel/try.c (CNST_34LSUB1): Nailify.
5445         * gmp-impl.h (ADDC_LIMB): New macro.
5446
5447         * gmpxx.h (mpf_class::get_str): Make exponent mp_exp_t&, default
5448         base=10 and ndigits=0.
5449         (mpz_class::set_str, mpq_class::set_str, mpf_class::set_str): Add
5450         versions accepting "const char *".
5451         * mpfrxx.h (mpfr_class::get_str, mpfr_class::set_str): Ditto, and
5452         uncommenting set_str and operator=.
5453         * gmp.texi (C++ Interface Integers, C++ Interface Rationals)
5454         (C++ Interface Floats): Update.
5455
5456         * gmp-impl.h (modlimb_invert): Merge the <=64bits and general versions.
5457         (const, signed): Move to near top of file, fixes --enable-alloca=debug
5458         on K&R.
5459
5460         * gen-fib.c: New file, derived from mainline in mpn/generic/fib2_ui.c.
5461         * dumbmp.c (mpz_init_set_ui): New function.
5462         * Makefile.am, mpn/Makefile.am: Generate fib_table.h, mpn/fib_table.c.
5463         * gmp-impl.h: Use fib_table.h, add __GMP_DECLSPEC to __gmp_fib_table
5464         (for the benefit of tests/mpz/t-fib_ui.c).
5465         * mpn/generic/fib2_ui.c: Remove __gmp_fib_table and generating code.
5466
5467         * Makefile.am: Add mp.h to BUILT_SOURCES, distclean all BUILT_SOURCES,
5468         use += more.
5469
5470         * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_BRANCHES):
5471         Don't let "unknown" get into the cache variables.
5472         (GMP_ASM_TEXT): See what assembles, don't hard-code hpux and aix.
5473         (GMP_PROG_EXEEXT_FOR_BUILD): Add ,ff8 for RISC OS, per autoconf cvs.
5474         (GMP_PROG_CPP_FOR_BUILD): Restructure per AC_PROG_CPP, print correct
5475         result if CPP_FOR_BUILD overrides the cache variable.
5476         (GMP_PROG_CC_FOR_BUILD_WORKS): New macro split from
5477         GMP_PROG_CC_FOR_BUILD.  Allow for "conftest" default compiler output.
5478         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Reinstate this,
5479         separating HOST_CC establishment from GMP_PROG_CC_FOR_BUILD.
5480
5481         * configure.in (mpn_objs_in_libgmp): Move mpn/mp_bases.lo ...
5482         * Makefile.am (MPN_OBJECTS): ... to here, add $U, and arrange
5483         MPN_OBJECTS to be common between libgmp and libmp.
5484
5485 2002-06-20  Torbjorn Granlund  <tege@swox.com>
5486
5487         * mpn/generic/mul_n.c (TOOM3_MUL_REC, TOOM3_SQR_REC): Don't check if
5488         basecase is to be invoked when *_TOOM3_THRESHOLD is more than 3 times
5489         the corresponding *_THRESHOLD.
5490
5491 2002-06-20  Kevin Ryde  <kevin@swox.se>
5492
5493         * mpn/ia64/submul_1.c: Add missing TMP_DECL, TMP_MARK, TMP_FREE.
5494         Reported by Paul Zimmermann.
5495
5496         * configure.in, acinclude.m4 (AC_DEFINE): Make templates read "Define
5497         to 1", for clarity as per autoconf.
5498         * acinclude.m4 (GMP_OPTION_ALLOCA): Group WANT_TMP templates.
5499
5500 2002-06-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
5501
5502         * gmpxx.h, mpfrxx.h: Remove mpz_classref, let mpq_class::get_num and
5503         mpq_class::get_den return mpz_class& as per the documentation.
5504         Reported by Roberto Bagnara.
5505
5506 2002-06-18  Kevin Ryde  <kevin@swox.se>
5507
5508         * tests/rand/t-lc2exp.c: New file.
5509         * tests/rand/Makefile.am: Add it, and use tests/libtests.la.
5510
5511         * randraw.c (lc): Pad seed==0 case with zero limbs, return same
5512         (m2exp+1)/2 bits as normal, right shift "c" result as normal.
5513
5514         * configure.in: Don't bother with line numbers in some diagnostics.
5515         (*-*-mingw*): Use -mno-cygwin if it works, suggested by delta trinity.
5516
5517         * tests/mpz/Makefile.am, tests/mpq/Makefile.am,
5518         tests/misc/Makefile.am, (CLEANFILES): Set to *.tmp for test program
5519         temporaries, to get t-scanf.tmp and reduce future maintenance.
5520
5521 2002-06-16  Torbjorn Granlund  <tege@swox.com>
5522
5523         * mpn/generic/get_str.c (mpn_dc_get_str): Pass scratch memory area in
5524         new `tmp' parameter.  Trim allocation needs by reusing input parameter.
5525
5526 2002-06-15  Torbjorn Granlund  <tege@swox.com>
5527
5528         * mpn/sparc32/v9/udiv.asm: New file.
5529
5530 2002-06-15  Kevin Ryde  <kevin@swox.se>
5531
5532         * acinclude.m4 (GMP_GCC_VERSION_GE): Correction to recognising mingw
5533         gcc 3.1 version number.  Reported by Jim Fougeron.
5534
5535         * configure.in (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): New define, to make
5536         AC_LIBTOOL_WIN32_DLL work with autoconf 2.53.
5537
5538         * acinclude.m4 (GMP_C_SIZES): Establish BITS_PER_MP_LIMB as a value,
5539         not an expression, for the benefit of the gen-bases invocation.
5540
5541         * config.guess (CC_FOR_BUILD): Try c99, same as configfsf.guess.
5542
5543 2002-06-15  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
5544
5545         * mpfr/set_q.c: Allow for 1 bit numerator or denominator.
5546
5547 2002-06-14  Kevin Ryde  <kevin@swox.se>
5548
5549         * configure.in (AC_C_BIGENDIAN): Use new style action parameters.
5550
5551         * randlc2x.c: Allow for a<0, allow for c>=2^m2exp.
5552         * randraw.c (lc): Allow for a==0.
5553
5554         * mpn/sparc32/udiv.asm: Renamed from udiv_fp.asm.  Don't know if float
5555         is the best way for v7, but it's what configure has chosen since gmp 3.
5556         * configure.in (*sparc*-*-* ABI=32): extra_functions="udiv" for all,
5557         in particular sparc32/v8/udiv.asm is faster (on ultrasparc2) than
5558         udiv_fp previously used for v9 chips.
5559
5560         * gen-bases.c: New file, derived from mpn/mp_bases.c.
5561         * dumbmp.c: New file, mostly by Torbjorn, some by me.
5562         * configure.in, acinclude.m4 (GMP_PROG_CC_FOR_BUILD,
5563         GMP_PROG_CPP_FOR_BUILD, GMP_PROG_EXEEXT_FOR_BUILD,
5564         GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): New macros.
5565         (GMP_PROG_HOST_CC): Remove, superceded by GMP_PROG_CC_FOR_BUILD.
5566         * Makefile.am: Run gen-bases to create mp_bases.h and mpn/mp_bases.c.
5567         * gmp-impl.h: Use mp_bases.h.
5568         * mpn/mp_bases.c: Remove file.
5569         * mpn/Makefile.am: mp_bases.c now in nodist_libmpn_la_SOURCES.
5570
5571         * tests/mpz/t-cmp_d.c (check_one_2exp): Use volatile to force to
5572         double, fixes gcc 3.1 with -O4.  Reported by Michael Lee.
5573         * configure.in (AC_C_VOLATILE): New macro.
5574
5575         * tests/misc/t-scanf.c: (fromstring_gmp_fscanf): Add missing va_end.
5576         Don't mix varargs and fixed args functions, not good on x86_64.
5577         Reported by Marcus Meissner.
5578
5579         * Makefile.am (EXTRA_DIST): Remove mpfr/README, now in mpfr/Makefile.in
5580
5581         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.53.
5582         * */Makefile.in, install-sh, mdate-sh, missing, aclocal.m4, configure:
5583         Update to automake 1.6.1.
5584         * configfsf.guess, configfsf.sub: Update to 2002-05-29.
5585
5586 2002-06-12  Kevin Ryde  <kevin@swox.se>
5587
5588         * acinclude.m4 (GMP_GCC_VERSION_GE): Recognise mingw gcc 3.1 version.
5589         (GMP_PROG_CC_WORKS): Allow for a_out.exe, as per autoconf.
5590         (GMP_GCC_NO_CPP_PRECOMP, GMP_ASM_UNDERSCORE): Ditto, plus a.exe.
5591
5592 2002-06-09  Torbjorn Granlund  <tege@swox.com>
5593
5594         * randraw.c (lc): Remove broken ASSERT_ALWAYS.
5595
5596         * mpn/x86: Update gmp-mparam.h files with current measures *_THRESHOLD
5597         values.
5598         * mpn/x86/p6/mmx/gmp-mparam.h: New file.
5599
5600 2002-06-09  Kevin Ryde  <kevin@swox.se>
5601
5602         * mpn/x86/*/gmp-mparam.h (USE_PREINV_DIVREM_1): Add tuned settings.
5603
5604         * acconfig.h (HAVE_NATIVE_mpn_preinv_divrem_1): New template.
5605
5606         * tests/refmpn.c, tests/tests.h (refmpn_chars_per_limb,
5607         refmpn_big_base): New functions.
5608         * tests/mpn/t-mp_bases.c: Use them, and don't test big_base_inverted
5609         unless it's being used.
5610
5611         * gmp.texi (Notes for Particular Systems): Using Microsoft C with DLLs.
5612         (Known Build Problems): Notes on MacOS and GCC.
5613         (Integer Logic and Bit Fiddling): Use ULONG_MAX for maximum ulong.
5614         (Low-level Functions): mpn_get_str accepts base==256.
5615         (Formatted Output Functions): Note output is not atomic.
5616         (Internals): Note mp_size_t for limb counts.
5617
5618         * mp-h.in, gmp-h.in (mp_ptr, mp_srcptr, mp_size_t, mp_exp_t): Remove
5619         these types from mp.h, not needed.
5620
5621         * mpfr/tests/tadd.c, mpfr/tests/tmul.c (check): Apply a hack to the
5622         parameter order to make sparc gcc 2.95.2 happy.
5623
5624         * doc/configuration: Notes on bootstrapping.
5625
5626 2002-06-08  Kevin Ryde  <kevin@swox.se>
5627
5628         * mpfr/tests/tsqrt.c, mpfr/tests/tsqrt_ui.c: Suppress tests if sqrt is
5629         not affected by mpfr_set_machine_rnd_mode.
5630
5631         * mpfr/mul_2si.c: Workaround a mips gcc 2.95.3 bug under -O2 -mabi=n32.
5632
5633         * configure.in (alphev56): Fix to use ev5 path.
5634
5635 2002-06-06  Kevin Ryde  <kevin@swox.se>
5636
5637         * gmp-h.in: Use __gmp_const not const, in a number of places.
5638
5639         * configure.in (sparc): Use ABI=32 instead of ABI=standard on v7 and
5640         v8, for consistency with v9 choices.
5641         (sparc64): Restrict GMP_ASM_SPARC_REGISTER to ABI=64.
5642         (x86): Move MMX $path munging to before printout.
5643         (CCAS): Move upward to support this.
5644
5645         * gmp-impl.h (modlimb_invert): Merge macros for specific limb sizes,
5646         add a version for arbitrary limb size, use GMP_NUMB_BITS.
5647         (modlimb_invert, MODLIMB_INVERSE_3): Fix comments to say GMP_NUMB_BITS.
5648
5649         * gmp-h.in (__GMP_LIKELY, __GMP_UNLIKELY): New macros.
5650         (mpz_getlimbn, mpz_perfect_square_p, mpz_popcount): Use them, make the
5651         fetch or mpn call likely, unconditionally calculate the alternative so
5652         as to avoid an "else" clause.
5653         * gmp-impl.h (LIKELY, UNLIKELY): Aliases.
5654
5655         * configure.in, mpfr/tests/Makefile.am: Add $LIBM to $LIBS for
5656         MPFR_CONFIGS so it detects fesetround, and let it go through to
5657         $MPFR_LIBS.
5658         * mpfr/rnd_mode.c: Use gmp-impl.h to get MPFR_HAVE_FESETROUND.
5659
5660         * tests/mpz/t-sizeinbase.c: Disable fake bits test, such pointer
5661         setups are bogus and have been seen failing on hppa.
5662
5663         * tests/misc.c, tests/refmpz.c, tests.tests.h, tests/mpz/t-cong.c:
5664         Rename mpz_flipbit to refmpz_combit and move from misc.c to refmpz.c.
5665
5666 2002-06-05  Torbjorn Granlund  <tege@swox.com>
5667
5668         * tests/mpz/t-powm_ui.c Print proper routine name in error message.
5669
5670 2002-06-03  Kevin Ryde  <kevin@swox.se>
5671
5672         * tune/time.c, tune/freq.c, tune/speed.h: Add powerpc mftb support.
5673         (FREQ_MEASURE_ONE): Move to speed.h, fix tv_sec factor.
5674         (freq_measure): Use for mftb measuring too.
5675         * tune/powerpc.asm, tune/powerpc64.asm: New files.
5676         * configure.in, tune/Makefile.am: Add them.
5677
5678         * gmp-impl.h (popc_limb): Add versions for Cray and fallback for
5679         arbitrary limb size.
5680
5681         * mpn/sparc32/sparc-defs.m4: New file.
5682         * configure.in (sparc*-*-*): Use it.
5683         * acinclude.m4 (GMP_ASM_SPARC_REGISTER): New macro.
5684         * configure.in (sparc64): Use it.  Also, use -Wc,-m64 for linking.
5685         * mpn/sparc64/add_n.asm, mpn/sparc64/addmul_1.asm,
5686         mpn/sparc64/copyd.asm, mpn/sparc64/copyi.asm, mpn/sparc64/lshift.asm,
5687         mpn/sparc64/mul_1.asm, mpn/sparc64/rshift.asm,
5688         mpn/sparc64/sqr_diagonal.asm, mpn/sparc64/sub_n.asm,
5689         mpn/sparc64/submul_1.asm: Use REGISTER for .register.
5690
5691 2002-06-01  Kevin Ryde  <kevin@swox.se>
5692
5693         * mpz/powm_ui.c: Fix for result range in certain circumstances.
5694
5695         * mpn/x86/k6/diveby3.asm: Speedup to 10 c/l, same as divexact_1.
5696         Anomaly pointed out by Alexander Kruppa.
5697
5698 2002-05-31  Torbjorn Granlund  <tege@swox.com>
5699
5700         * mpz/export.c: Cast pointer via `unsigned long' when checking
5701         alignment to avoid compiler warnings.
5702
5703 2002-05-29  Kevin Ryde  <kevin@swox.se>
5704
5705         * gmp-impl.h (BSWAP_LIMB): Versions for m68k, powerpc, and arbitrary
5706         limb size.
5707         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_m68k): New define.
5708
5709 2002-05-27  Torbjorn Granlund  <tege@swox.com>
5710
5711         * mpn/generic/mul_basecase.c: Improve MAX_LEFT handling, returning
5712         when possible.  Add code for mpn_addmul_5 and mpn_addmul_6.
5713
5714 2002-05-25  Kevin Ryde  <kevin@swox.se>
5715
5716         * tune/tuneup.c: Misc nailifications, and disable preinv thresholds
5717         with nails.
5718         * tune/speed.h: Use GMP_NUMB_HIGHBIT with mpn_sb_divrem_mn and
5719         mpn_divrem_2.
5720         * mpz/powm.c (redc): Nailify q.
5721
5722         * tests/mpn/t-scan.c: Reduce the amount of testing, to go faster.
5723
5724 2002-05-23  Torbjorn Granlund  <tege@swox.com>
5725
5726         * Version 4.1 released.
5727
5728         * mpn/alpha/ev6/nails/gmp-mparam.h: New file.
5729
5730         * tests/devel/add_n.c (refmpn_add_n): Nailify.
5731         * tests/devel/sub_n.c (refmpn_sub_n): Nailify.
5732         * tests/devel/addmul_1.c (refmpn_addmul_1): Nailify.
5733         * tests/devel/submul_1.c (refmpn_submul_1): Nailify.
5734
5735         * mpn/alpha/ev6/nails/add_n.asm: New file.
5736         * mpn/alpha/ev6/nails/sub_n.asm: New file.
5737         * mpn/alpha/ev6/nails/mul_1.asm: New file.
5738         * mpn/alpha/ev6/nails/submul_1.asm: New file.
5739
5740 2002-05-22  Torbjorn Granlund  <tege@swox.com>
5741
5742         * mpn/alpha/ev6/nails/addmul_1.asm: New file.
5743
5744         * mpz/inp_str.c (mpz_inp_str_nowhite): Nailify.
5745
5746         * mpn/generic/mul_basecase.c: Update pointers before conditional
5747         MAX_LEFT break statements.
5748
5749 2002-05-21  Torbjorn Granlund  <tege@swox.com>
5750
5751         * tests/mpz/t-gcd.c: Test mpz_gcd_ui.
5752
5753         * mpz/lcm_ui.c: Nailify.
5754
5755         * mpz/gcd_ui.c: Nailify.  Make it work as documented, allowing
5756         NULL to be passed for result parameter.  Fix gcd(0,0) case.
5757
5758         * mpz/set_str.c: Nailify.
5759
5760         * randlc2x.c (gmp_randinit_lc_2exp): Nailify.
5761
5762         From Jakub Jelinek:
5763         * longlong.h (add_ssaaaa,sub_ddmmss) [64-bit sparc]:
5764         Make it actually work.
5765
5766 2002-05-18  Torbjorn Granlund  <tege@swox.com>
5767
5768         * mpf/ui_div.c: Shut up compiler warning.
5769
5770         * mpn/generic/mul_basecase.c: Use mpn_addmul_2, mpn_addmul_3, and
5771         mpn_addmul_4, as available.
5772
5773         * mpn/alpha/ev6/nails/addmul_2.asm: Adjust NAILS_SUPPORT decls.
5774         * mpn/alpha/ev6/nails/addmul_3.asm: Likewise
5775         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
5776
5777         * configure.in (*-cray-unicos*): Back again to -hscalar0.
5778         (gmp_mpn_functions_optional): Add mul_3, mul_4, addmul_2, addmul_3,
5779         and addmul_4.
5780         * acconfig.h: Add #undefs for new optional mpn functions.
5781
5782 2002-05-18  Kevin Ryde  <kevin@swox.se>
5783
5784         * gmp.texi (Integer Import and Export): Mention Cray unfilled words.
5785
5786         * mpz/set_d.c, mpq/set_d.c: Use LIMBS_PER_DOUBLE for the output of
5787         __gmp_extract_double.  Reported by Henrik Johansson.
5788
5789 2002-05-17  Torbjorn Granlund  <tege@swox.com>
5790
5791         * mpn/alpha/ev6/nails/addmul_2.asm: New file.
5792         * mpn/alpha/ev6/nails/addmul_3.asm: New file.
5793         * mpn/alpha/ev6/nails/addmul_4.asm: New file.
5794
5795         * mpn/generic/dump.c: Rewrite and nailify.
5796
5797 2002-05-16  Kevin Ryde  <kevin@swox.se>
5798
5799         * mpfr/Makefile.am (EXTRA_DIST): Add BUGS file.
5800
5801 2002-05-15  Torbjorn Granlund  <tege@swox.com>
5802
5803         * configure.in (*-cray-unicos*): Remove -hscalar0, add -hnofastmd
5804         as workaround for compiler bug.
5805         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
5806
5807 2002-05-14  Torbjorn Granlund  <tege@swox.com>
5808
5809         * configure.in (*-cray-unicos*): Pass -hscalar0 to work around
5810         compiler bug for mpz/import.c.
5811
5812 2002-05-11  Torbjorn Granlund  <tege@swox.com>
5813
5814         * mpz/import.c: Cast pointer via `unsigned long' when checking
5815         alignment to avoid compiler warnings.
5816
5817         * mpn/generic/rootrem.c: Adjust allocation of qp temporary area.
5818
5819 2002-05-09  Kevin Ryde  <kevin@swox.se>
5820
5821         * mpz/import.c: Corrections to size store, special case tests, and
5822         general case ACCUMULATE.
5823         * tests/mpz/t-import.c, tests/mpz/t-export.c: More test data.
5824
5825 2002-05-09  Torbjorn Granlund  <tege@swox.com>
5826
5827         * mpn/generic/rootrem.c: Use temp space for root, copy value in place
5828         before returning.
5829         * mpz/root.c: Don't allocate extra limb for root value.
5830         * mpz/perfpow.c: Undo last change.
5831
5832 2002-05-08  Torbjorn Granlund  <tege@swox.com>
5833
5834         * gmp-impl.h (powerpc BSWAP_LIMB_FETCH): Rename local variable to make
5835         it not clash with caller.
5836
5837         * mpn/generic/rootrem.c: New file.
5838         * configure.in (gmp_mpn_functions): Add rootrem and pow_1.
5839         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add rootrem.c and
5840         pow_1.c
5841         * gmp-impl.h (mpn_rootrem): Add declaration.
5842         * mpz/perfpow.c: Amend allocations for mpn_rootrem requirements.
5843         * mpz/root.c: Rewrite to use mpn_rootrem.
5844
5845 2002-05-08  Kevin Ryde  <kevin@swox.se>
5846
5847         * gmp-impl.h (MUL_KARATSUBA_THRESHOLD etc): Remove forced nail values.
5848
5849         * mpf/fits_u.h, mpf/fits_s.h, tests/mpf/t-fits.c: Ignore fraction
5850         part, making the code match the documentation.
5851
5852         * gmpxx.h (struct __gmp_binary_minus): Use mpz_ui_sub.
5853
5854 2002-05-07  Kevin Ryde  <kevin@swox.se>
5855
5856         * mpn/powerpc32/README: New file.
5857
5858         * mpz/root.c: Use unsigned long with mpz_sub_ui not mp_limb_t.
5859
5860         * tune/README: Misc updates including sparc32/v9 smoothness, low res
5861         timebase, and mpn_add_n operand overlaps.
5862         * tune/many.pl: Add udiv.asm support.
5863
5864         * gmp.texi (Build Options): A couple of --build better as --host.
5865         (Known Build Problems, Notes for Package Builds): Add DESTDIR problem.
5866         (Compatibility with older versions): Compatible with 4.x versions.
5867         (Converting Integers): Remove mpz_get_ui + mpz_tdiv_q_2exp decompose.
5868         (Integer Import and Export): New section.
5869         (Miscellaneous Integer Functions): Clarify mpz_sizeinbase returns 1
5870         for operand of 0.
5871         (Language Bindings): Add GNU Pascal.
5872         (Low-level Functions): Add GMP_NUMB_MAX.
5873
5874         * tests/mpz/t-import.c, tests/mpz/t-export.c, tests/mpz/t-get_d.c:
5875         New tests.
5876         * tests/mpz/Makefile.am: Add them.
5877
5878         * mpz/import.c, mpz/export.c: New files.
5879         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
5880
5881         * gmp-h.in, gmp-impl.h (GMP_NUMB_MAX): Move to gmp.h.
5882         * gmp-impl.h (CNST_LIMB): Add cast to mp_limb_t to ensure unsigned.
5883         (CRAY_Pragma, MPN_REVERSE, MPN_BSWAP, MPN_BSWAP_REVERSE,
5884         ASSERT_ALWAYS_LIMB, ASSERT_ALWAYS_MPN): New macros.
5885         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS_MPN.
5886
5887 2002-05-07  Torbjorn Granlund  <tege@swox.com>
5888
5889         * mpz/aors_ui.h: Nailify.
5890
5891         * tests/mpz/t-addsub.c: New file.
5892         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-addsub.
5893
5894         * mpz/ui_sub.c: New file.
5895         * mpz/Makefile.am (libmpz_la_SOURCES): Add ui_sub.c.
5896         * Makefile.am (MPZ_OBJECTS): Ditto.
5897         * gmp-h.in (mpz_ui_sub): Add declaration.
5898
5899         * gmp-impl.h (MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc
5900         return value.
5901
5902         * gmp-h.in (mpn_pow_1): Add declaration.
5903
5904         * mpn/generic/pow_1.c: Handle exp <= 1.  Reverse rp/tp parity scheme
5905         for bn == 1 arm.
5906
5907         * Rename MP_LIMB_T_HIGHBIT => GMP_LIMB_HIGHBIT.
5908
5909 2002-05-06  Torbjorn Granlund  <tege@swox.com>
5910
5911         * demos/pexpr.c (main): Don't call mpz_sizeinbase with negative base.
5912
5913         * randraw.c (lc): Remove an unused variable.
5914
5915         * mpn/generic/get_str.c: Clarify an algorithm description.
5916
5917         * tests/mpf/t-trunc.c: Nailify.
5918         * tests/mpf/t-set_si.c: Disable for nails.
5919
5920         * mpf/cmp_si.c: Nailify.
5921         * mpf/cmp_ui.c: Nailify.
5922         * mpf/div.c: Nailify.
5923         * mpf/div_2exp.c: Nailify.
5924         * mpf/div_ui.c: Nailify.
5925         * mpf/eq.c: Nailify.
5926         * mpf/get_d.c: Nailify.
5927         * mpf/get_d_2exp.c: Nailify.
5928         * mpf/get_si.c: Nailify.
5929         * mpf/get_str.c: Nailify.
5930         * mpf/get_ui.c: Nailify.
5931         * mpf/mul_2exp.c: Nailify.
5932         * mpf/random2.c: Nailify.
5933         * mpf/set_q.c: Nailify.
5934         * mpf/set_si.c: Nailify.
5935         * mpf/set_str.c: Nailify.
5936         * mpf/set_ui.c: Nailify.
5937         * mpf/sub.c: Nailify.
5938         * mpf/ui_div.c: Nailify.
5939         * mpf/ui_sub.c: Nailify.
5940         * mpf/urandomb.c: Nailify.
5941
5942         * gmp-impl.h (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Nailify.
5943
5944         * mpz/get_si.c: Misc variable name changes.
5945
5946         * mpf/fits_u.h: Rewrite - nailify.
5947         * mpf/fits_s.h: Likewise.
5948
5949         * mpz/mod.c: Disambiguate if-statament with extra {}.
5950
5951         * mpf/int_p.c: Fix type of size variables.
5952         * mpf/get_ui: Likewise.
5953         * mpf/get_si: Likewise.
5954         * mpq/equal.c: Likewise.
5955         * mpq/get_d.c: Likewise.
5956         * mpz/cmp_d.c: Likewise.
5957         * mpz/cmpabs_d.c: Likewise.
5958         * mpz/divis_2exp.c: Likewise.
5959         * mpz/kronuz.c: Likewise.
5960         * mpz/kronzu.c: Likewise.
5961         * mpz/kronzs.c: Likewise.
5962         * mpz/kronsz.c: Likewise.
5963         * mpz/scan0.c: Likewise.
5964         * mpz/scan1.c: Likewise.
5965         * mpz/tstbit.c: Likewise.
5966         * mpz/cong_2exp.c: Likewise.
5967         * mpz/divis.c: Likewise.
5968
5969 2002-05-04  Torbjorn Granlund  <tege@swox.com>
5970
5971         * mpn/generic/gcd.c: Additional nailify changes.
5972
5973 2002-05-04  Kevin Ryde  <kevin@swox.se>
5974
5975         * gmp-h.in (__GNU_MP_VERSION): Set to 4.1.
5976         * Makefile.am (-version-info): Bump for new release.
5977
5978 2002-04-30  Torbjorn Granlund  <tege@swox.com>
5979
5980         * mpn/generic/divrem_1.c: Additional nailify changes.
5981         * mpn/generic/mod_1.c: Likewise.
5982
5983         * tests/mpq/t-get_d.c: Print floats with all 16 digits.
5984
5985         * mpq/get_d.c: Nailify.
5986
5987         * tests/mpq/t-set_f.c: Disable for nails.
5988
5989         * mpz/get_d.c: Nailify.
5990
5991         * gmp-impl.h (LIMBS_PER_DOUBLE, MP_BASE_AS_DOUBLE): Nailify.
5992
5993         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Cast maxval to before shifting it.
5994
5995         * extract-dbl.c: Nailify.
5996
5997 2002-04-29  Torbjorn Granlund  <tege@swox.com>
5998
5999         * mpq/md_2exp.c (mord_2exp): Nailify.
6000
6001         * mpq/cmp_ui.c: Nailify.
6002
6003         * mpq/cmp.c (mpq_cmp): Nailify.
6004
6005         * mpn/generic/gcd.c: Nailify.  GNUify code layout.
6006
6007         * mpn/generic/gcdext.c: Nailify.  Misc changes.
6008
6009         * tests/mpz/t-sqrtrem.c: Let argv[1] mean # of repetitions.
6010         * tests/mpz/t-gcd.c: Likewise.
6011
6012         * mpz/gcd.c: Nailify.
6013
6014         * mpn/generic/random.c: Nailify.
6015
6016         * gmp-impl.h (modlimb_invert): Nailify.
6017
6018 2002-04-27  Torbjorn Granlund  <tege@swox.com>
6019
6020         * mpn/generic/gcdext.c (div2): Remove qh parameter.
6021         (mpn_gcdext): Streamline double-limb code.
6022         Move GCDEXT_THRESHOLD check to after initial division.
6023
6024 2002-04-27  Kevin Ryde  <kevin@swox.se>
6025
6026         * gmp-impl.h (JACOBI_MOD_OR_MODEXACT_1_ODD): Allow for odd
6027         GMP_NUMB_BITS.
6028
6029         * tune/time.c (sgi_works_p): Allow for 64-bit counter, and fix
6030         SGI_CYCLECNTR_SIZE handling.
6031
6032         * demos/expr/exprfr.c: Add nan and inf constants.
6033         * demos/expr/t-expr.c: Exercise them.
6034
6035 2002-04-26  Torbjorn Granlund  <tege@swox.com>
6036
6037         * mpz/cmp_ui.c: Fix overflow conditions for nails.
6038
6039         * gmp-h.in (mpz_get_ui): Fix typo from last change.
6040
6041         * mpz/n_pow_ui.c: Adjust allocation for nails.
6042         (GMP_NUMB_HALFMAX): Renamed from MP_LIMB_T_HALFMAX.
6043         Fix umul_ppmm invocation for for nails.
6044
6045 2002-04-24  Torbjorn Granlund  <tege@swox.com>
6046
6047         * mpn/generic/gcdext.c: Simplify by using mpn_tdiv_qr instead of
6048         mpn_divmod.
6049
6050 2002-04-24  Kevin Ryde  <kevin@swox.se>
6051
6052         * configure.in (*-*-cygwin*): Give a sensible default command line
6053         limit, to avoid blowups reported by Jim Fougeron on windows 9x.
6054         (--enable-nails): Make the default 2, since mp_bases has data for that.
6055
6056         * mpfr/mpfr-math.h (__mpfr_nan): Use a "double" for the bytes, to
6057         avoid a mis-conversion on alpha gcc 3.0.2.
6058         (_MPFR_INFP_BYTES, _MPFR_INFM_BYTES): Should be a zero mantissa.
6059
6060 2002-04-23  Torbjorn Granlund  <tege@swox.com>
6061
6062         * mpz/dive_ui.c: Fix typo.
6063
6064         * mpz/fits_s.h: Rewrite.
6065
6066         * mpz/jacobi.c: Nailify.
6067         * mpz/kronuz.c: Additional nailify changes.
6068         * mpz/kronsz.c: Likewise.
6069
6070 2002-04-23  Kevin Ryde  <kevin@swox.se>
6071
6072         * demos/expr/Makefile.am (LDADD): Add $(LIBM) for the benefit of mpfr.
6073
6074         * mpz/divis_ui.c, mpz/cong_ui.c: Nailify.
6075         * mpn/generic/bdivmod.c, mpz/divexact.c, mpz/dive_ui.c: Nailify.
6076         * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem.c,
6077         mpn/generic/divrem_2.c: Nailify ASSERTs.
6078         * mpn/x86/k6/mmx/logops_n.asm, mpn/x86/k6/mmx/com_n.asm: Nailify.
6079         * mpz/inp_raw.c, mpz/out_raw.c: Nailify.
6080         * mpz/kronzu.c, mpz/kronuz.c, mpz/kronzs.c, mpz/kronsz.c: Nailify.
6081         * mpn/generic/divis.c, mpz/cong.c, mpz/cong_2exp.c: Nailify.
6082         * gmp-impl.h (NEG_MOD): Nailify.
6083
6084         * gmp-impl.h, mpn/mp_bases.c: Add back GMP_NUMB_BITS==30 bases data.
6085
6086         * mpfr/get_d.c: Patch from Paul to avoid problem with constant folding
6087         in gcc on OSF.
6088
6089         * mpn/lisp/gmpasm-mode.el: Remove mention of defunct LF macro.
6090
6091 2002-04-22  Torbjorn Granlund  <tege@swox.com>
6092
6093         * demos/pexpr.c: Handle "binomial" operator.
6094
6095         * mpz/cmp_ui.c: Move assignments of `up' out of conditionals.
6096
6097         * mpn/generic/gcdext.c: Fix fencepost error in STAT code.
6098
6099         * gmp-impl.h (mpn_com_n): Nailify.
6100
6101         * tests/mpz/t-cdiv_ui.c: New file.
6102         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-cdiv_ui.
6103         * mpz/cdiv_qr_ui.c: Nailify.
6104         * mpz/cdiv_q_ui.c: Nailify.
6105         * mpz/cdiv_r_ui.c: Nailify.
6106         * mpz/cdiv_ui.c: Nailify.
6107
6108         * tests/misc/t-printf.c (CHECK_N): Add cast to allow `char' to be an
6109         unsigned type.
6110         * tests/misc/t-scanf.c: Likewise.
6111
6112         * mpz/mul_i.h: Rework nails code to handle parameter overlap.
6113
6114         * tests/mpz/t-set_f.c: Disable for nails.
6115
6116 2002-04-21  Torbjorn Granlund  <tege@swox.com>
6117
6118         * mpz/set_si.c: Add cast to support LONG_LONG_LIMB.
6119         * mpz/iset_si.c: Likewise.
6120
6121         * mpz/bin_ui.c: Nailify.
6122         * mpz/bin_uiui.c: Nailify.
6123
6124         * mpz/cmpabs_ui.c: Nailify.
6125
6126         * tests/mpz/t-aorsmul.c: Nailify.
6127         * mpz/aorsmul_i.c (mpz_addmul_ui, mpz_submul_ui): Nailify better.
6128
6129 2002-04-20  Torbjorn Granlund  <tege@swox.com>
6130
6131         * tests/mpz/t-fdiv_ui.c: Check mpz_fdiv_ui.
6132         * tests/mpz/t-tdiv_ui.c: Check mpz_tdiv_ui.
6133
6134         * mpz/tdiv_ui.c: Rewrite nails code.
6135         * mpz/fdiv_ui.c: Nailify.
6136
6137         * tests/mpz/t-tdiv_ui.c: Check returned remainders.
6138         * tests/mpz/t-fdiv_ui.c: Merge in recent t-tdiv_ui changes.
6139
6140         * mpz/tdiv_q_ui.c: Remove spurious TMP_* calls.
6141
6142         * mpz/fdiv_qr_ui.c: Nailify.
6143         * mpz/fdiv_q_ui.c: Nailify.
6144         * mpz/fdiv_r_ui.c: Nailify.
6145
6146         * mpz/get_si.c: Misc nailify changes to shut up compiler warnings.
6147
6148         * mpz/ui_pow_ui.c: Fix typo in last change.
6149
6150 2002-04-20  Kevin Ryde  <kevin@swox.se>
6151
6152         * tests/misc/t-printf.c, tests/misc/t-scanf.c: Check all %n types.
6153
6154         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/p6/mmx/divrem_1.asm
6155         (mpn_preinv_divrem_1): New entrypoint.
6156         (mpn_divrem_1): Avoid a branch when testing high<divisor.
6157         * mpn/asm-defs.m4: Add define_mpn(preinv_divrem_1).
6158         * configure.in: Allow divrem_1.asm to provide mpn_preinv_divrem_1.
6159
6160         * gmp-impl.h [nails]: Add #undefs of MUL_KARATSUBA_THRESHOLD etc, to
6161         override CPU gmp-mparam.h.  Remove JACOBI_BASE_METHOD override since
6162         it's nails-neutral.
6163
6164         * tests/mpn/t-mp_bases.c: New file.
6165         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
6166         * tests/t-constants.c: Move MP_BASES constants checks to it.
6167
6168         * mpn/mp_bases.c: Fix big_base_inverted values for nails.
6169         * gmp-impl.h (MP_BASES_BIG_BASE_INVERTED_10,
6170         MP_BASES_NORMALIZATION_STEPS_10): Fix nails values.
6171         (MP_BASES_*): Remove GMP_NUMB_BITS == 30 data.
6172
6173         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm: Add
6174         NAILS_SUPPORT indicators.
6175
6176         * configure.in: Grep for NAILS_SUPPORT in cpu-specific code, and look
6177         in "nails" subdirectories, print path used.
6178         * mpn/asm-defs.m4 (NAILS_SUPPORT): New macro.
6179
6180         * mpfr/mpfr-test.h: Include config.h, for the benefit of test programs
6181         not using gmp-impl.h.
6182
6183 2002-04-19  Torbjorn Granlund  <tege@swox.com>
6184
6185         * tests/mpz/t-scan.c: Nailify.
6186
6187         * mpz/tdiv_qr_ui.c: Nailify.
6188         * mpz/tdiv_q_ui.c: Nailify.
6189         * mpz/tdiv_r_ui.c: Nailify.
6190         * mpz/tdiv_ui.c: Nailify.
6191
6192         * mpz/cmp_ui.c: Nailify.
6193
6194         * mpz/ui_pow_ui.c: Misc nailify changes to shut up compiler warnings.
6195
6196         * mpz/scan0.c: Nailify.
6197         * mpz/scan1.c: Nailify.
6198
6199         * tests/mpz/t-sizeinbase.c (mpz_fake_bits): Nailify.
6200
6201 2002-04-18  Torbjorn Granlund  <tege@swox.com>
6202
6203         * mpz/aorsmul_i.c: Nailify.
6204
6205         * mpz/cmp_si.c: Nailify (botched).
6206
6207         * mpz/ui_pow_ui.c: Nailify.
6208
6209         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Nailify.
6210
6211         * mpz/fits_s.h: Nailify.
6212
6213         * tests/mpz/bit.c (check_tstbit): Nailify.
6214
6215         From Paul Zimmermann:
6216         * mpn/generic/sqrtrem.c: Nailify.
6217
6218         * mpz/n_pow_ui.c: Nailify.
6219
6220         * mpz/cfdiv_r_2exp.c: Nailify.
6221
6222         * randraw.c (lc): Undo: Let mpn_rshift put result in place to avoid
6223         extra MPN_COPY.
6224
6225 2002-04-17  Torbjorn Granlund  <tege@swox.com>
6226
6227         * mpz/clrbit.c: Add two GMP_NUMB_MASK masks after addition.
6228
6229         * mpn/generic/random2.c (LOGBITS_PER_BLOCK): Decrease to 4.
6230
6231         * gmp-impl.h (nail DIV_DC_THRESHOLD): Decrease to 50 to allow fast
6232         division.
6233
6234         * mpn/generic/random2.c: Nailify.
6235
6236         * mpz/fac_ui.c: Nailify.
6237
6238         * mpz/mul_i.h: #if ... #endif code block to shut up gcc warnings.
6239
6240         * mpn/generic/sqrtrem.c: Adopt to GNU coding standards.
6241         (mpn_dc_sqrtrem): New name for mpn_dq_sqrtrem.
6242         Partial nailification.
6243
6244         * configure.in: As a temporary hack, clear extra_functions for nails
6245         builds.
6246
6247         * gmp-h.in (mpz_get_ui): #if ... #endif else code block to shut up gcc
6248         warnings.
6249
6250 2002-04-17  Kevin Ryde  <kevin@swox.se>
6251
6252         * texinfo.tex: Update to 2002-03-26.08 per texinfo 4.2.
6253         * gmp.texi: Must have @top in @ifnottex (or @contents doesn't come out
6254         in one run).
6255
6256         * mpn/generic/scan0.c, mpn/generic/scan1.c: Nailify.
6257
6258         * tests/mpn/t-scan.c: New file.
6259         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
6260
6261         * tests/refmpn.c, tests/tests.h (refmpn_tstbit): Use unsigned long for
6262         bit index.
6263         (refmpn_setbit, refmpn_clrbit, refmpn_scan0, refmpn_scan1): New
6264         functions.
6265
6266         * mpfr/cmp_ui.c (mpfr_cmp_si_2exp): Fix b==0 i!=0 case.
6267
6268 2002-04-17  Gerardo Ballabio <gerardo.ballabio@unimib.it>
6269
6270         * gmpxx.h, mpfrxx.h: Remove mpfr_class bool combinations, remove
6271         mpfr_class::get_str2, use mp_rnd_t for rounding modes, use
6272         8*sizeof(double) for mpfr_t's holding doubles.
6273
6274 2002-04-17  Torbjorn Granlund  <tege@swox.com>
6275
6276         * mpz/powm.c: Nailify.
6277         * mpz/powm_ui.c: Nailify.
6278
6279 2002-04-16  Torbjorn Granlund  <tege@swox.com>
6280
6281         * mpz/hamdist.c: Nailify.
6282         * tests/misc.c (urandom): Nailify.
6283
6284         * mpz/get_si.c: Nailify.
6285         * gmp-h.in (mpz_get_ui): Nailify.  Streamline (and probably upset
6286         memory checkers).
6287
6288         * gmp-impl.h (mp_bases[10] values): Add versions for GMP_NUMB_BITS
6289         being 28, 60, and 63.
6290         * mpn/mp_bases.c: Add tables for GMP_NUMB_BITS being 28, 60, and 63.
6291
6292         * mpz/iset_si.c: Nailify.
6293         * mpz/iset_ui.c: Nailify
6294
6295         * tests/mpz/convert.c (main): Print test number in error message.
6296
6297         * mpn/generic/get_str.c (mpn_sb_get_str): Shift up `frac' into nails
6298         field after bignum division.
6299
6300 2002-04-16  Kevin Ryde  <kevin@swox.se>
6301
6302         * gmp-h.in, gmp-impl.h (GMP_NAIL_MASK): Move to gmp.h.
6303
6304         * gmp.texi: Use @documentdescription and @copying, per texinfo 4.2.
6305         (Low-level Functions): Clarify mpn_gcd overlap requirements, rewrite
6306         mpn_set_str description, add nails section.
6307         (C++ Interface General): Remove bool from types that mix with classes.
6308         (Language Bindings): Add STklos, GNU Smalltalk, Regina.
6309         (Binary to Radix, Radix to Binary): Describe new code.
6310         (Assembler Cache Handling): More notes, mostly by Torbjorn.
6311
6312         * macos/configure (%vars): Remove __GMP from substitutions, per change
6313         to main configure.
6314
6315         * mpn/generic/dive_1.c: Nailify.
6316         * mpn/generic/mode1o.c: Nailify, remove bogus ASSERT in commented-out
6317         alternate implementation.
6318         * gmp-impl.h (SUBC_LIMB): New macro.
6319
6320         * tests/devel/try.c (validate_divexact_1): Correction to compare.
6321         (udiv_qrnnd): New testing.
6322         (SHIFT_LIMIT): Nailify.
6323         (-b): New option, remove spurious "H" from getopt string.
6324
6325         * mpz/clrbit.c: Nailify.
6326         * tests/mpz/t-hamdist.c: Nailify.
6327         * gmp-impl.h (MPN_FIB2_SIZE): Nailify.
6328         (PP): Nailify conditionals.
6329         * tests/mpz/t-fib_ui.c (MPZ_FIB_SIZE_FLOAT): Nailify.
6330
6331         * configure.in, acinclude.m4: Establish GMP_NAIL_BITS and
6332         GMP_LIMB_BITS for gmp-h.in configure tests.
6333
6334         * mpfr/*, configure.in: Update to final mpfr 2.0.1.
6335         * mpfr/acinclude.m4 (MPFR_CONFIGS): Use $host, not uname stuff.
6336         * mpfr/tests/tout_str.c: Patch from Paul for denorm fprintf tests.
6337
6338 2002-04-15  Torbjorn Granlund  <tege@swox.com>
6339
6340         * mpn/generic/divrem_1.c (EXTRACT): Remove.
6341
6342         * tests/mpz/t-tdiv_ui.c (dump_abort): Accept argument for error string.
6343
6344         * mpz/rrandomb.c: Nailify.  Needs further work.
6345
6346         * mpn/generic/mod_1.c: Nailify.
6347
6348         * gmp-impl.h: Set various *_THRESHOLD values to be used for nails to
6349         avoid not yet qualified algorithms.
6350         (MPZ_CHECK_FORMAT): Check that nail part is zero.
6351
6352         * tests/mpz/t-mul.c (main): Test squaring even for huge operands.
6353         (base_mul): Nailify.
6354         (dump_abort): Accept argument for error string.  Print product
6355         difference.
6356
6357         * mpn/generic/set_str.c: Nailify.
6358
6359         * gmp-h.in (__GMPN_ADD, __GMPN_SUB): Nailify.
6360
6361 2002-04-14  Torbjorn Granlund  <tege@swox.com>
6362
6363         * randraw.c (lc): Return non-nonsense return value for seed=0 case.
6364         Check for m2exp being non-zero early; remove all other tests of m2exp.
6365         Remove redundant MPN_ZERO call.
6366         Let mpn_rshift put result in place to avoid extra MPN_COPY.
6367         Remove confusing comment before function `lc' describing BBS algorithm.
6368         Misc simplification and cleanups.
6369         Nailify.  Needs further work.
6370
6371         * mpz/set_si.c: Nailify.
6372         * mpz/set_ui.c: Nailify.
6373         * mpz/mul_i.h: Nailify.
6374
6375         * tests/mpz/t-mul_i.c: Actually test _ui routines.  Add some more test
6376         values.
6377
6378         * mpn/generic/mul_n.c: Finish nailifying toom3 code.
6379
6380 2002-04-13  Kevin Ryde  <kevin@swox.se>
6381
6382         * mpfr/*: Update to another new mpfr 2.0.1.
6383         * configure.in, Makefile.am, mpfr/Makefile.am, mpfr/tests/Makefile.am:
6384         Use MPFR_CONFIGS macro, establish separate MPFR_CFLAGS for mpfr build.
6385
6386         * mpfr/tests/Makefile.am: Correction to convenience rule for libmpfr.a.
6387
6388 2002-04-11  Kevin Ryde  <kevin@swox.se>
6389
6390         * mpfr/set_q.c: gmp-impl.h before mpfr.h to avoid _PROTO redefine.
6391
6392         * mpfr/*, configure.in: Update to new mpfr 2.0.1.
6393
6394         * tests/refmpn.c (refmpn_udiv_qrnnd, refmpn_divmod_1c_workaround):
6395         Fixes for nails.
6396
6397         * tests/t-constants.c (MODLIMB_INVERSE_3): Nailify tests.
6398         (MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): Only
6399         check these under USE_PREINV_DIVREM_1.
6400         * tests/t-modlinv.c: Nailify tests.
6401
6402 2002-04-11  Gerardo Ballabio <gerardo.ballabio@unimib.it>
6403
6404         * gmpxx.h: Remove bool combinations, remove mpf_class::get_str2, only
6405         need <iosfwd> now.
6406
6407 2002-04-11  Torbjorn Granlund  <tege@swox.com>
6408
6409         * mpn/generic/diveby3.c: Nailify.
6410         * gmp-impl.h (MODLIMB_INVERSE_3): Nailify.
6411
6412         * mpn/generic/mul_n.c: Nailify Toom3 code.
6413
6414 2002-04-10  Kevin Ryde  <kevin@swox.se>
6415
6416         * gmp-impl.h (MPN_KARA_MUL_N_MINSIZE, MPN_KARA_SQR_N_MINSIZE): Set to
6417         3, as needed by nails case.
6418
6419         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails]: Fix vl
6420         assert, add rp,n and up,n asserts.
6421
6422         * mpfr/Makefile.am: Add new mpfr-math.h, install mpf2mpfr.h.
6423
6424 2002-04-10  Torbjorn Granlund  <tege@swox.com>
6425
6426         * mpn/generic/divrem_1.c: Nailify.  Update mp_size_t variables to use
6427         `n' suffix instead of `size' suffix.
6428         * mpn/generic/divrem_2.c: Likewise.
6429         * mpn/generic/sb_divrem_mn.c: Nailify.
6430         * mpn/generic/tdiv_qr.c: Nailify.
6431         (SHL): Remove silly macro.
6432
6433         * mpn/generic/mul_n.c (mpn_kara_mul_n): Replace open-coded increment by
6434         mpn_incr_u call.  Handle nails in ws[n] increment.
6435         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Likewise.
6436
6437         * gmp-h.in (GMP_NUMB_MASK): New #define.
6438         (__GMPN_AORS_1): Add version for nails.
6439
6440         * gmp-impl.h (GMP_NUMB_MASK): Comment out, now in gmp.h.
6441         (mpn_incr_u): Don't assume `incr' is non-zero.
6442         (mpn_decr_u): Similarly.
6443
6444 2002-04-09  Kevin Ryde  <kevin@swox.se>
6445
6446         * mpfr/*, configure.in: Update to mpfr 2.0.1.
6447
6448         * tests/refmpn.c (refmpn_mul_1c, lshift_make): Corrections for nails.
6449         * tssts/refmpn.c, tests/tests.h (refmpn_cmp_allowzero): New function.
6450
6451         * mpn/generic/mul_1.c [nails]: Fix vl assert, add {up,n} assert.
6452
6453         * mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
6454         mpn/pa32/hppa1_1/pa7100/submul_1.asm: Rename "size" define, to avoid
6455         ELF .size directive.  Reported by LaMont Jones.
6456
6457         * tests/mpz/t-set_si.c: Add nails support.
6458
6459 2002-04-05  Torbjorn Granlund  <tege@swox.com>
6460
6461         * gmp-impl.h: Replace nail mpn_incr_u, mpn_decr_u with faster versions.
6462         (mp_bases[10] values): Check GMP_NUMB_BITS instead of BITS_PER_MP_LIMB.
6463         Add GMP_NUMB_BITS == 30 version.
6464         (__gmp_doprnt, etc): Remove parameter names.
6465
6466         * mpn/generic/mul_n.c: Nailify Karatsuba code.
6467         * mpn/generic/get_str.c: Nailify.
6468         * mpn/generic/sqr_basecase.c: Nailify.
6469         * mpn/generic/lshift.c: Nailify.
6470         * mpn/generic/rshift.c: Likewise.
6471         * mpn/generic/add_n.c: Nailify.  Revamp non-nail code.
6472         * mpn/generic/sub_n.c: Likewise.
6473         * mpn/generic/mul_1.c: Likewise.
6474         * mpn/generic/addmul_1.c: Likewise.
6475         * mpn/generic/submul_1.c: Likewise.
6476
6477 2002-04-02  Kevin Ryde  <kevin@swox.se>
6478
6479         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE) [powerpc]:
6480         Corrections to constraints, and restrict to bigendian.
6481
6482 2002-03-31  Kevin Ryde  <kevin@swox.se>
6483
6484         * tests/mpz/dive.c: Better diagnostics.
6485
6486         * tests/devel/try.c (mpn_get_str, mpn_umul_ppmm_r): New tests.
6487
6488         * tests/misc.c, tests/tests.h (byte_diff_lowest, byte_diff_highest):
6489         New functions.
6490
6491         * tests/t-bswap.c: New file.
6492         * tests/Makefile.am (check_PROGRAMS): Add it.
6493
6494         * tests/mpn/t-aors_1.c, tests/mpn/t-iord_u.c: Add nails support.
6495
6496         * gmp-impl.h (MPN_IORD_U) [x86]: Eliminate unnecessary jiord and iord,
6497         rename "n" to incr per generic versions, restrict to nails==0.
6498         (mpn_incr_u, mpn_decr_u): Add nails support.
6499         (GMP_NAIL_LOWBIT, GMP_NUMB_MAX): New macros.
6500
6501         * tests/trace.c, tests/tests.h (byte_trace, byte_tracen): New
6502         functions.
6503         * tests/trace.c: Handle NULL operands.
6504
6505         * tests/refmpn.c, tests/devel/try.c, tune/speed.c: Add preliminary
6506         nail support.
6507
6508         * tests/refmpn.c, test/tests.h (byte_overlap_p, refmpn_equal_anynail,
6509         refmpn_umul_ppmm_r, refmpn_udiv_qrnnd_r, refmpn_get_str,
6510         refmpn_bswap_limb, refmpn_random, refmpn_random2, refmpn_bswap_limb):
6511         New functions.
6512
6513         * gmp-impl.h, tests/refmpn.c (ASSERT_LIMB): Renamed from
6514         ASSERT_MP_LIMB_T.
6515
6516         * mpn/x86/*/*.asm, mpn/powerpc32/*/*.asm, mpn/powerpc64/*/*.asm: Put
6517         speeds after the copyright notice, so as to keep that clear.
6518
6519 2002-03-29  Kevin Ryde  <kevin@swox.se>
6520
6521         * configure.in (powerpc*-*-aix*): Correction to xlc -qarch selection,
6522         for 32-bit mode.
6523
6524 2002-03-28  Torbjorn Granlund  <tege@swox.com>
6525
6526         * mpn: Fix spacing in many files.
6527
6528         * mpn/generic/aorsmul_1.c: Split into addmul_1.c and submul_1.c.
6529         * mpn/generic/aors_n.c: Split into add_n.c and sub_n.c.
6530
6531         * mpn/pa64/add_n.asm: Trim another 0.125 cycle/limb.  Fix a comment.
6532         * mpn/pa64/sub_n.asm: Likewise.
6533
6534         * mpn/pa64/mul_1.asm: Change comclr, comb to proper forms cmpclr, cmpb.
6535         * mpn/pa64/addmul_1.asm: Likewise.
6536         * mpn/pa64/submul_1.asm: Likewise.
6537
6538 2002-03-28  Kevin Ryde  <kevin@swox.se>
6539
6540         * gmp.texi (Converting Integers): Fix type of exp in mpz_get_d_2exp,
6541         reported by epl@unimelb.edu.au.
6542         (References): Update Burnikel and Ziegler URL, reported by Keith
6543         Briggs.
6544
6545         * gmp-h.in, mp-h.in, configure.in, acinclude.m4: Remove __GMP from
6546         AC_SUBSTs, since autoconf says leading "_" in makefile variables is
6547         not portable.
6548
6549         * demos/expr/run-expr.c: Declare optarg, optind, opterr if necessary.
6550         * configure.in, demos/expr/expr-config-h.in: Configs for this.
6551
6552 2002-03-27  Torbjorn Granlund  <tege@swox.com>
6553
6554         * mpn/Makefile.am (TARG_DIST): Remove pa64w and hppa, add pa32.
6555
6556         * configure.in (path_20w): Remove pa64w.
6557
6558         * mpn/pa64/udiv_qrnnd.asm: Tweak for PA8000 performance comparative to
6559         that on PA8500.
6560
6561 2002-03-26  Torbjorn Granlund  <tege@swox.com>
6562
6563         * mpn/pa32: New name for mpn/hppa.
6564         * configure.in: Corresponding changes.
6565
6566         * mpn/pa64/umul_ppmm.asm: New file, generalized for both 2.0N and 2.0W.
6567         * mpn/pa64/umul_ppmm.S: Remove.
6568
6569         * mpn/pa64/udiv_qrnnd.asm: Generalize for both 2.0N and 2.0W.
6570         * mpn/pa64w/udiv_qrnnd.asm: Remove.
6571
6572 2002-03-26  Kevin Ryde  <kevin@swox.se>
6573
6574         * mpfr/tests/tdiv.c, mpfr/tests/tui_div.c: Don't depend on nan and inf
6575         handling in "double", for the benefit of alpha.
6576
6577         * configure (hppa2.0w): Set path to "pa64w pa64".
6578
6579         * acinclude.m4, configure.in (GMP_C_INLINE): New macro.
6580         * acinclude.m4 (GMP_H_EXTERN_INLINE): Use it, and fix "yes" handling.
6581
6582 2002-03-25  Torbjorn Granlund  <tege@swox.com>
6583
6584         * mpn/pa64w/add_n.s: Remove.
6585         * mpn/pa64w/sub_n.s: Remove.
6586         * mpn/pa64w/lshift.s: Remove.
6587         * mpn/pa64w/rshift.s: Remove.
6588         * mpn/pa64w/mul_1.S: Remove.
6589         * mpn/pa64w/addmul_1.S: Remove.
6590         * mpn/pa64w/submul_1.S: Remove.
6591         * mpn/pa64w/sqr_diagonal.asm: Remove.
6592
6593         * mpn/pa64/mul_1.asm: New file with twice faster code; generalized
6594         for both 2.0N and 2.0W.
6595         * mpn/pa64/submul_1.asm: Likewise.
6596         * mpn/pa64/mul_1.S: Remove.
6597         * mpn/pa64/submul_1.S: Remove.
6598
6599         * mpn/pa64/sqr_diagonal.asm: Generalize for both 2.0N and 2.0W.
6600
6601         * mpn/pa64/add_n.asm: New file, generalized for both 2.0N and 2.0W.
6602         * mpn/pa64/sub_n.asm: Likewise.
6603         * mpn/pa64/lshift.asm: Likewise.
6604         * mpn/pa64/rshift.asm: Likewise.
6605         * mpn/pa64/add_n.s: Remove.
6606         * mpn/pa64/sub_n.s: Remove.
6607         * mpn/pa64/lshift.s: Remove.
6608         * mpn/pa64/rshift.s: Remove.
6609
6610 2002-03-24  Kevin Ryde  <kevin@swox.se>
6611
6612         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE): New macros.
6613         * mpz/inp_raw.c, mpz/out_raw.c: Use them.
6614         * acconfig.h (HAVE_HOST_CPU): Add some powerpc types.
6615
6616         * mpn/powerpc32/750/com_n.asm: New file.
6617
6618         * mpfr/tests/tout_str.c: Disable random tests, since they fail on
6619         alphaev56-unknown-freebsd4.1 and do nothing by default.
6620
6621         * mpfr/tests/tsqrt.c: Don't depend on nan, inf or -0 in "double", for
6622         the benefit of alpha.
6623         * mpfr/sqrt.c: Clear nan flag on -0.
6624
6625         * demos/factorize.c: Use mpn_random() instead of random(), to avoid
6626         portability problems.
6627
6628         * demos/isprime.c (print_usage_and_exit): Declare as "void" to avoid
6629         warnings.
6630
6631         * demos/pexpr.c (setup_error_handler): Corrections to sigstack code.
6632
6633         * demos/calc/calc.y: Add some `;'s to make bison 1.34 happy.
6634
6635 2002-03-23  Torbjorn Granlund  <tege@swox.com>
6636
6637         * mpn/pa64/addmul_1.asm: New file with twice faster code; generalized
6638         for both 2.0N and 2.0W.
6639
6640 2002-03-22  Kevin Ryde  <kevin@swox.se>
6641
6642         * tune/time.c: Add SGI hardware counter measuring method, change some
6643         abort()s into ASSERT_FAIL()s.
6644
6645         * configure.in (AC_CHECK_HEADERS): Add fcntl.h and sys/syssgi.h.
6646         (AC_CHECK_FUNCS): Add syssgi.
6647
6648         * configure.in, mpfr/Makefile.am, mpfr/tests/Makefile.am: Use
6649         -mieee-with-inexact or -ieee_with_inexact for mpfr on alpha, so
6650         denorms work.
6651
6652         * mpfr/isinteger.c: Fix a memory leak.
6653
6654 2002-03-21  Torbjorn Granlund  <tege@swox.com>
6655
6656         * tune/speed.c (struct choice_t): Make `r' an mp_limb_t.
6657
6658 2002-03-21  Kevin Ryde  <kevin@swox.se>
6659
6660         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): Use an
6661         AH_VERBATIM and better explanation.
6662         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Similarly for the HAVE_DOUBLE
6663         constants.
6664
6665         * gmp.texi (Number Theoretic Functions): Clarify sign of GCD returned
6666         by mpz_gcdext.
6667
6668         * demos/pexpr.c, demos/pexpr-config-h.in, configure.in: Use an
6669         autoconf test for stack_t.
6670
6671         * configure.in, gmp-h.in, mp-h.in, macos/configure, tests/mpz/reuse.c,
6672         tests/mpf/reuse.c: Use __GMP_LIBGMP_DLL to enable windows declspec,
6673         don't require _WIN32 (etc), remove __GMP_LIBGMP_SHARED and
6674         __GMP_LIBGMP_STATIC.
6675
6676         * gmp-impl.h (mp_bases): Add __GMP_DECLSPEC, for the benefit of
6677         tests/t-constants.c.
6678
6679         * tune/many.pl, tune/speed.h: Remove suffix hack for back.asm.
6680
6681 2002-03-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
6682
6683         * mpfr/sin_cos.c (mpfr_sin_cos): New file.
6684         * mpfr/mpfr.h, mpfr/mpfr.texi, mpfr/Makefile.am: Add it.
6685         * mpfr/tan.c: Fix sign in 2nd and 4th quadrants.
6686
6687         * mpfr/log10.c: Fix hangs on certain inputs.
6688
6689 2002-03-20  Torbjorn Granlund  <tege@swox.com>
6690
6691         * demos/pexpr.c (setup_error_handler): Declare `s', the first
6692         sigaltstack parameter, using `stack_t' just on AIX.
6693
6694 2002-03-19  Torbjorn Granlund  <tege@swox.com>
6695
6696         * mpn/powerpc32/mul_1.asm: Use free caller-saves registers instead
6697         of the callee-saves r30 and r31.
6698
6699 2002-03-19  Kevin Ryde  <kevin@swox.se>
6700
6701         * tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
6702         previously got the wrong result from "bogomips".
6703
6704         * mpn/powerpc32/add_n.asm, mpn/powerpc32/sub_n.asm: Rewrite, faster on
6705         750, and smaller too.
6706         * mpn/powerpc32/*.asm: Use L(), add some measured speeds.
6707
6708         * longlong.h (count_trailing_zeros) [vax]: Add a version using ffs,
6709         but commented out.
6710
6711 2002-03-17  Kevin Ryde  <kevin@swox.se>
6712
6713         * tune/speed.c, tune/speed.h, tune/common.c, many.pl: Use optional
6714         ".r" to specify operand overlaps for mpn_add_n, mpn_sub_n and logops.
6715         Remove mpn_add_n_inplace and mpn_add_n_self.
6716         * tune/many.pl: Fix MULFUNC_PROLOGUE parsing.
6717
6718         * gmp.texi (Known Build Problems): Note `make' problem with long
6719         libgmp.la dependencies list.
6720
6721         * printf/doprnt.c, scanf/doscan.c (%zn): Remove test of non-existent
6722         HAVE_SIZE_T, just use size_t unconditionally.
6723         * printf/doprnt.c (%zd etc): Fix 'z' type parsing.
6724         * tests/misc/t-printf.c, tests/misc/t-scanf.c: More tests.
6725
6726         * configure.in: Use AC_COPYRIGHT.
6727         Add m4_pattern_allow(GMP_MPARAM_H_SUGGEST).
6728
6729         * tune/Makefile.am (libdummy.la): Remove this, sqr_basecase.c already
6730         gets an ansi2knr rule from nodist_tuneup_SOURCES.
6731
6732         * longlong.h (count_leading_zeros) [pentiumpro gcc<3]: Test
6733         HAVE_HOST_CPU_i686 too.
6734
6735         * mpz/out_raw.c (HTON_LIMB_STORE): Fix a typo in big endian #if.
6736
6737 2002-03-14  Kevin Ryde  <kevin@swox.se>
6738
6739         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm,
6740         mpn/x86/k6/mmx/com_n.asm: Add nails support.
6741
6742         * texinfo.tex: Update to 2002-03-01.06 (per texinfo 4.1).
6743         * gmp.texi (@ma): Remove, @math does this now.
6744
6745         * mpfr/tests/reuse.c: Clear op1 and op2 flags only in their respective
6746         outer loops.
6747
6748         * configure.in (--enable-cxx): Correction to the default stated in the
6749         help string.
6750         (power*-*-aix*, not powerpc): Use aix.m4, don't run
6751         GMP_ASM_POWERPC_R_REGISTERS or use powerpc-defs.m4.
6752
6753 2002-03-13  Torbjorn Granlund  <tege@swox.com>
6754
6755         * mpn/sparc32/gmp-mparam.h: New file.
6756
6757 2002-03-13  Kevin Ryde  <kevin@swox.se>
6758
6759         * demos/expr/exprfr.c: More mpfr functions, corrections to agm, cos,
6760         sin, rename log2 constant to loge2 to make room for log2 function.
6761         * demos/expr/t-expr.c: More tests.
6762
6763         * mpz/inp_raw.c (NTOH_LIMB_FETCH) [generic 16bit]: Remove spurious "+".
6764
6765         * mpfr/acos.c: Avoid a memory leak for certain operands.
6766
6767         * acinclude.m4, configure.in (GMP_C_DOUBLE_FORMAT): New macro.
6768
6769         * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
6770         GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
6771         Change ac_objext to OBJEXT, which is the documented variable.
6772
6773         * config.guess (powerpc*-*-*): Use #ifdef on constants POWER_630 etc
6774         in the AIX test, since old versions don't have them all.
6775
6776 2002-03-11  Kevin Ryde  <kevin@swox.se>
6777
6778         * configure.in (LIBC211): New AC_DEFINE, for mpfr.
6779
6780         * configure.in (mips*-*-*): Support ABI=o32 on irix 6, allow gcc 2.7.2
6781         to fall back on it, but detect it doesn't work with gcc 2.95.  Use
6782         single mips-defs.m4 for both mips32 and mips64.
6783         * acinclude.m4 (GMP_GCC_MIPS_O32): New macro.
6784         * mpn/mips32/mips-defs.m4: Renamed from mips.m4.
6785         * mpn/mips64/mips.m4: Remove (was a copy of mips32/mips.m4).
6786
6787         * mpn/powerpc32/750: New directory.
6788         * configure.in (powerpc740, powerpc750, powerpc7400): Use it.
6789         * mpn/powerpc32/750/gmp-mparam.h: New file.
6790
6791         * config.sub, gmp.texi (ultrasparc1): Remove this, just use plain
6792         "ultrasparc".
6793
6794 2002-03-10  Kevin Ryde  <kevin@swox.se>
6795
6796         * mpfr: Update to 20020301, except internal_ceil_exp2.c,
6797         internal_ceil_log2.c, internal_floor_log2.c renamed to i_ceil_exp2.c,
6798         i_ceil_log2.c, i_floor_log2.c to be unique in DOS 8.3.  And sqrtrem.c
6799         removed since no longer required.
6800         * mpfr/mpfr.texi: Fix some formatting.
6801         * mpfr/tests/reuse.c: Patch by Paul to fix test4 variable handling.
6802         * mpfr/sinh.c: Patch by Paul to fix err calculation when t==0.
6803         * mpfr/tests/tget_d.c: Disable until portability of rnd_mode.c can be
6804         sorted out.
6805
6806         * configure.in (powerpc*-*-*): Separate gcc and xlc cpu flags setups
6807         for clarity.
6808
6809         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]: New
6810         macros.
6811
6812 2002-03-07  Kevin Ryde  <kevin@swox.se>
6813
6814         * gmp.texi (Build Options): Note all the ultrasparcs accepted.
6815         (Language Bindings): Add Math::BigInt::GMP.
6816
6817         * config.sub (ultrasparc2i): New cpu type.
6818         * config.guess (sparc-*-*, sparc64-*-*): Add some exact CPU detection.
6819
6820 2002-03-05  Kevin Ryde  <kevin@swox.se>
6821
6822         * longlong.h (count_leading_zeros, count_trailing_zeros) [alphaev67,
6823         alphaev68]: Use ctlz and cttz insns (as per gcc longlong.h).
6824         (count_leading_zeros) [sparclite]: Fix parameter order (as per gcc
6825         longlong.h).
6826         * acconfig.h (HAVE_HOST_CPU_alphaev68): New define.
6827
6828         * config.guess [i?86-*-*]: Suppress error messages if compiler not
6829         found or test program won't run.
6830         [rs6000-*-*, powerpc-*-*]: Force code alignment for mfpvr test.
6831
6832 2002-03-04  Torbjorn Granlund  <tege@swox.com>
6833
6834         * mpn/generic/pow_1.c: New file.
6835
6836 2002-03-03  Kevin Ryde  <kevin@swox.se>
6837
6838         * gmp.texi (Build Options): Note compiler must be able to fully link,
6839         add alphapca57 and alphaev68, give a clearer example of MPN_PATH
6840         (Debugging): Add notes on valgrind.
6841         (C++ Formatted Output): Clarify mpf showbase handling, in particular
6842         note "00.4" in octal.
6843
6844         * printf/doprntf.c: Do a showbase on octal float fractions, for
6845         instance "00.4" where previously it gave "0.4".
6846         * tests/cxx/t-ostream.cc: Update.
6847
6848         * gmp-h.in, mp-h.in (__GMP_DECLSPEC, __GMP_DECLSPEC_XX): Test
6849         __WIN32__ for Borland C, reported by "delta trinity".
6850
6851         * gmp-h.in, mp-h.in: Use <cstddef> for size_t under C++, suggested by
6852         Hans Aberg some time ago.
6853         * gmp-h.in (<iosfwd>): Move to top of file for clarity.
6854
6855         * Makefile.am (libgmpxx_la_SOURCES): Use dummy.cc to force C++.
6856         (CXX_OBJECTS): Add osfuns$U.lo.
6857         * dummy.cc: New file.
6858         * cxx/Makefile.am (INCLUDES): Use __GMP_WITHIN_GMPXX.
6859         (libcxx_la_SOURCES): Add osfuns.cc.
6860         * gmp-h.in (__GMP_DECLSPEC_XX): New define, use it on libgmpxx funs.
6861         * gmp-impl.h: Add __GMP_DECLSPEC to libgmp functions used by libgmpxx.
6862
6863         * longlong.h (COUNT_TRAILING_ZEROS_TIME): Remove, no longer used.
6864
6865         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): Correction to
6866         __totbits for nails.
6867
6868         * gmp-impl.h (JACOBI_LS0): Test size before limb, to pacify valgrind.
6869         (JACOBI_0LS): Ditto, and fix parens around arguments.
6870
6871         * mpn/x86/x86-defs.m4 (call_mcount): Add a counter to make data labels
6872         unique, since simplified L() scheme no longer gives that effect.
6873         (notl_or_xorl_GMP_NUMB_MASK): New macro.
6874         Add m4_assert_numargs in a few places.
6875
6876         * configure.in (*sparc*): Fix cycle counter setups for ABI=64.
6877
6878 2002-02-28  Torbjorn Granlund  <tege@swox.com>
6879
6880         * mpn/vax/gmp-mparam.h: New file.
6881
6882 2002-02-28  Kevin Ryde  <kevin@swox.se>
6883
6884         * gmp-h.in (gmp_errno, gmp_version): Move into extern "C" block,
6885         reported by librik@panix.com.
6886
6887         * gmp-h.in, mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT):
6888         Use __declspec(dllexport) and __declspec(dllimport) on Borland.
6889         * gmp-h.in (_GMP_H_HAVE_FILE): Test __STDIO_H for Borland.
6890         Reported by "delta trinity".
6891
6892         * gmp-impl.h (va_copy): Fall back on memcpy, not "=".
6893
6894         * mpn/generic/pre_mod_1.c: Add a comment about obsolescence.
6895
6896         * tune/time.c (MICROSECONDS_P): Don't trust time differences of 1
6897         microsecond.
6898
6899         * tests/cxx/t-ostream.cc: Use "const char *" not just "char *" for
6900         test data strings, avoids warnings on Sun CC.
6901
6902 2002-02-27  Torbjorn Granlund  <tege@swox.com>
6903
6904         * configure.in: For sparc under solaris2.[7-9], pass -fsimple=1 to
6905         disable some crazy -fast optimizations.
6906
6907 2002-02-25  Torbjorn Granlund  <tege@swox.com>
6908
6909         * configure.in: For sparc under solaris2.[7-9], pass -fns=no to enable
6910         denorm handling under -fast.
6911
6912 2002-02-25  Kevin Ryde  <kevin@swox.se>
6913
6914         * configure.in (alpha*-*-*): Rearrange -mcpu selection for gcc,
6915         provide an ev67 -> ev6 fallback.  Fix -arch,-tune selection for DEC C.
6916         Allow ~ for space in optional options lists.
6917
6918         * tune/tuneup.c (tune_preinv_divrem_1): Compare against an assembler
6919         mpn_divrem_1 if it exists, not the generic C mpn_divrem_1_div.
6920         (tune_preinv_mod_1): Ditto with mpn_mod_1.
6921
6922         * tune/time.c (DIFF_SECS_ROUTINE): Eliminate the unused "type"
6923         parameter, try to make the code a bit clearer.
6924
6925         * tune/freq.c: Reduce the period measured for cycles versus
6926         gettimeofday, add cycles versus microsecond getrusage.
6927
6928         * mpz/array_init.c: "i" should be mp_size_t, noticed by E. Khong.
6929
6930 2002-02-24  Torbjorn Granlund  <tege@swox.com>
6931
6932         * configure.in: For sparc under solaris2.[7-9], pass -fast instead of
6933         other optimization options.
6934
6935 2002-02-23  Kevin Ryde  <kevin@swox.se>
6936
6937         * mpn/asm-defs.m4 (GMP_NUMB_MASK): New macro.
6938         (PROLOGUE, EPILOGUE): Relax quoting for the benefit of tune/many.pl
6939         when GSYM_PREFIX non-empty.
6940
6941         * tune/time.c, tune/speed.h (speed_time_init): Include clock tick
6942         period in speed_time_string.
6943         * tune/time.c, configure.in (clock_gettime): New measuring method.
6944
6945         * tune/many.pl: Add -DHAVE_NATIVE_mpn_foo to C objects, to avoid
6946         conflicts with a macro version in gmp-impl.h, eg. mpn_com_n.
6947
6948 2002-02-22  Torbjorn Granlund  <tege@swox.com>
6949
6950         * demos/pexpr.c: Increase RLIMIT_STACK to 4Mibyte.
6951
6952 2002-02-22  Kevin Ryde  <kevin@swox.se>
6953
6954         * tune/tuneup.c: Don't confuse gcc with mipspro cc in diagnostic.
6955
6956 2002-02-20  Torbjorn Granlund  <tege@swox.com>
6957
6958         * configure.in (mips*-*-irix[6789]*]): Set `extra_functions_n32', not
6959         `extra_functions'.
6960
6961         * printf/doprnt.c: Conditionally include inttypes.h.
6962         * printf/repl-vsnprintf.c: Likewise.
6963         * scanf/doscan.c: Likewise.
6964
6965 2002-02-20  Kevin Ryde  <kevin@swox.se>
6966
6967         * mpn/x86/k7/mmx/com_n.asm: New file.
6968
6969         * mpz/n_pow_ui.c (SWAP_RP_TP): Use ASSERT_CODE on ralloc and talloc,
6970         to ensure they needn't live past the initial allocs in a normal build.
6971
6972         * mpn/generic/mod_34lsub1.c: Note this is for internal use.
6973
6974 2002-02-19  Torbjorn Granlund  <tege@swox.com>
6975
6976         * Clean up *_THRESHOLD names.  Many files affected.
6977
6978         * mpn/mips32: Asm-ify 32-bit mips code.
6979         Move files from `mips2' to `mips32' directory.
6980         * mpn/mips64: Move files from `mips3' to `mips64' directory.
6981         * configure.in: Change `mips2' => `mips32' and `mips3' => `mips64'.
6982
6983 2002-02-19  Kevin Ryde  <kevin@swox.se>
6984
6985         * acinclude.m4, configure.in (GMP_PROG_LEX): New macro.
6986
6987         * tune/tuneup.c (one): Start next threshold at a max of previous ones,
6988         in order to get a good starting point for TOOM3_SQR_THRESHOLD if
6989         KARATSUBA_SQR_THRESHOLD is 0 (ie. using mpn_mul_basecase only).
6990
6991         * configure.in, tune/tuneup.c (GMP_MPARAM_H_SUGGEST): New AC_DEFINE
6992         replacing GMP_MPARAM_H_FILENAME.  Suggest a new file in a cpu specific
6993         subdirectory rather than mpn/generic.
6994
6995         * acinclude.m4 (POWERPC64_PATTERN): New macro.
6996         * configure.in (powerpc*-*-*): Use it.
6997         (powerpc*-*-*): Use umul in 32L and aix64.
6998         (mips*-*-*): Use umul, 32 and 64 bit versions.
6999
7000 2002-02-18  Torbjorn Granlund  <tege@swox.com>
7001
7002         * longlong.h: Add basic x86-64 support.
7003
7004 2002-02-17  Torbjorn Granlund  <tege@swox.com>
7005
7006         * demos/pexpr.c: Support `-X' for upper case hex, make `-x' output
7007         lower case hex.
7008
7009         * mpn/mips2/umul.s: Make it actually work.
7010         * mpn/mips3/umul.asm: New file.
7011
7012         * mpn/mips2/gmp-mparam.h: New file.
7013
7014 2002-02-16  Torbjorn Granlund  <tege@swox.com>
7015
7016         * mpn/generic/get_str.c (mpn_sb_get_str): Round frac upwards after
7017         umul_ppmm calls.
7018
7019 2002-02-16  Kevin Ryde  <kevin@swox.se>
7020
7021         * config.guess (alpha-*-*): Do alpha exact cpu probes on any system,
7022         and only if configfsf.guess gives a plain "alpha".
7023
7024         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect a gcc 3.0.3 powerpc64
7025         linker invocation problem.
7026
7027 2002-02-15  Torbjorn Granlund  <tege@swox.com>
7028
7029         * mpn/generic/get_str.c (mpn_sb_get_str): For base 10, develop initial
7030         digits using umul_ppmm, then switch to plain multiplication.
7031
7032         * config.guess: Rewrite Alpha subtype detection code for *bsd systems.
7033
7034 2002-02-15  Kevin Ryde  <kevin@swox.se>
7035
7036         * gmp.texi (Build Options): Note powerpc exact cpu types.
7037         (Debugging): Advertise DEBUG in memory.c.
7038
7039         * config.sub, config.guess: Add some powerpc exact cpus.
7040         * configure.in: Add configs for them.
7041
7042         * memory.c [__NeXT__]: Remove unused #define of "static".
7043         (__gmp_default_allocate, __gmp_default_reallocate): Print size if
7044         allocation fails, don't use perror.
7045
7046         * gmp-h.in: g++ 3 demands __GMP_NOTHROW is before other attributes.
7047
7048 2002-02-14  Torbjorn Granlund  <tege@swox.com>
7049
7050         * mpn/alpha/mul_1.asm: Fix typo preventing build on T3E systems.
7051
7052 2002-02-14  Kevin Ryde  <kevin@swox.se>
7053
7054         * tune/tuneup.c (tune_set_str): Increase max_size, for the benefit of
7055         alpha.
7056
7057         * macos/README: Bug reports to bug-gmp@gnu.org, clarify MacOS X a bit.
7058
7059         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Add missing TMP_FREE.
7060
7061         * tune/speed.c, tune/tuneup.c: Allow for speed_cycletime of 0.0 in
7062         some diagnostic printouts.
7063         * tune/time.c (speed_cycletime): Note can be 0.0.
7064
7065 2002-02-12  Torbjorn Granlund  <tege@swox.com>
7066
7067         * mpn/alpha/mul_1.asm: Add mpn_mul_1c entry.
7068
7069         * mpn/pa64w/sqr_diagonal.asm: Use L() for labels.
7070
7071 2002-02-11  Torbjorn Granlund  <tege@swox.com>
7072
7073         * mpn/generic/get_str.c (mpn_sb_get_str): Change declaration of rp to
7074         accommodate tuneup compiles.
7075
7076 2002-02-11  Kevin Ryde  <kevin@swox.se>
7077
7078         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (PROLOGUE_cpu): Add
7079         noalign option.
7080         * mpn/alpha/default.m4 (PROLOGUE_cpu): use ALIGN instead of ".align".
7081
7082         * gmp.texi (Debugging): Notes on Checker.
7083         (Other Multiplication): Move note on float FFTs to here.
7084         (Assembler Floating Point): New text and revisions by Torbjorn,
7085         picture formatting by me.
7086         Simplify tex pictures elsewhere a bit, share heights, eliminate some
7087         gaps at line joins.
7088
7089 2002-02-11  Torbjorn Granlund  <tege@swox.com>
7090
7091         * mpn/generic/get_str.c (mpn_sb_get_str): Rewrite to generate fraction
7092         limbs and use multiplication for digit development.  Trim allocation of
7093         buf.  Get rid of code for !USE_MULTILIMB.
7094
7095 2002-02-10  Torbjorn Granlund  <tege@swox.com>
7096
7097         * mpn/generic/set_str.c (mpn_set_str): Undo this:
7098         Change invocations of mpn_add_1 to instead use mpn_incr_u.
7099
7100         * tests/mpz/convert.c: Free str only after it is used in error message.
7101
7102         * mpn/generic/get_str.c (mpn_sb_get_str): Combine tail code for base 10
7103         and generic bases.
7104
7105         * mpn/mp_bases.c: Add entries for base 256.  Remove __ prefix from
7106         table name.
7107         * gmp-impl.h (__mp_bases): Remove superflous `mp_' part of name, making
7108         it __gmpn_bases instead of __gmpn_mp_bases.
7109         (mp_bases): New #define.
7110         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Allow bases up to 256.
7111         (SPEED_ROUTINE_MPN_GET_STR): Likewise.
7112
7113 2002-02-09  Torbjorn Granlund  <tege@swox.com>
7114
7115         * mpn/generic/set_str.c (mpn_set_str): Use mpn_mul_1c if available.
7116         Change invocations of mpn_add_1 to instead use mpn_incr_u.
7117
7118 2002-02-09  Kevin Ryde  <kevin@swox.se>
7119
7120         * mpz/array_init.c, mpz/cfdiv_q_2exp.c, mpz/cfdiv_r_2exp.c,
7121         mpz/cong_2exp.c, mpz/divis_2exp.c, mpz/hamdist.c, mpz/init2.c,
7122         mpz/mul_2exp.c, mpz/realloc2.c, mpz/scan0.c, mpz/scan1.c,
7123         mpz/setbit.c, mpz/tdiv_q_2exp.c, mpz/tdiv_r_2exp.c, mpz/tstbit.c,
7124         mpz/urandomb.c: Use GMP_NUMB_BITS.
7125
7126         * mpz/iset_str.c [__CHECKER__]: Store a dummy value to the low limb to
7127         stop it appearing uninitialized.
7128
7129         * gmp-h.in (__GMP_NOTHROW): New macro.
7130         (mp_set_memory_functions, mpz_cmp, mpz_cmp_si, mpz_cmp_ui, mpz_cmpabs,
7131         mpz_cmpabs_ui, mpz_congruent_2exp_p, mpz_divisible_2exp_p,
7132         mpz_fits_sint_p, mpz_fits_slong_p, mpz_fits_sshort_p, mpz_fits_uint_p,
7133         mpz_fits_ulong_p, mpz_fits_ushort_p, mpz_get_si, mpz_get_ui,
7134         mpz_getlimbn, mpz_hamdist, mpz_popcount, mpz_scan0, mpz_scan1,
7135         mpz_size, mpz_sizeinbase, mpz_swap, mpz_tstbit, mpq_equal, mpq_swap,
7136         mpf_cmp, mpf_cmp_si, mpf_cmp_ui, mpf_fits_sint_p, mpf_fits_slong_p,
7137         mpf_fits_sshort_p, mpf_fits_uint_p, mpf_fits_ulong_p,
7138         mpf_fits_ushort_p, mpf_get_default_prec, mpf_get_prec, mpf_get_si,
7139         mpf_get_ui, mpf_integer_p, mpf_set_default_prec, mpf_set_prec_raw,
7140         mpf_size, mpf_swap, mpn_add_1, mpn_cmp, mpn_hamdist, mpn_popcount,
7141         mpn_sub_1): Use it.
7142
7143         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): New macros from
7144         mpn_sizeinbase, and use GMP_NUMB_BITS.
7145         * mpz/get_str.c, mpz/sizeinbase.c, mpbsd/mout.c, tune/speed.h: Use
7146         MPN_SIZEINBASE.
7147         * mpbsd/mtox.c: Use MPN_SIZEINBASE_16.
7148
7149         * configure.in, mpn/Makefile.am, gmp-impl.h (mpn_sizeinbase): Remove.
7150         * mpn/generic/sizeinbase.c: Remove file.
7151
7152         * gmp-impl.h (MPN_GET_STR_SIZE): Remove.
7153         * tests/mpn/t-g_str_size.c: Remove file.
7154         * tests/mpn/Makefile.am: Update.
7155
7156         * Makefile.am (dist-hook): Don't distribute cvs merge ".#" files.
7157
7158 2002-02-08  Torbjorn Granlund  <tege@swox.com>
7159
7160         * configure.in: Override extra_functions for all sparcv8 systems, not
7161         just supersparc.
7162
7163 2002-02-06  Kevin Ryde  <kevin@swox.se>
7164
7165         * tune/tuneup.c (tune_mul, tune_sqr): Disable FFTs until tuned.
7166         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix memory clobber in
7167         destination cache priming.
7168
7169         * printf/doprnt.c: Fix parsing of %s and %p conversions.
7170         * tests/misc/t-printf.c (check_misc): Add some tests.
7171
7172 2002-02-03  Torbjorn Granlund  <tege@swox.com>
7173
7174         * mpn/sparc32/v8/udiv.asm: New file, from v8/supersparc.
7175
7176         * mpn/generic/set_str.c: Rename indigits_per_limb => chars_per_limb.
7177         Remove redundant chars_per_limb.  Reverse 4 loops in basecase code for
7178         speed.  Use MP_BASES_CHARS_PER_LIMB_10.
7179
7180 2002-02-03  Kevin Ryde  <kevin@swox.se>
7181
7182         * acinclude.m4 (GMP_PROG_NM): Ensure -B or -p get used when doing a
7183         cross compile with the native nm, helps OSF for instance.
7184         (GMP_ASM_LSYM_PREFIX): Remove ".byte 0" for the benefit of irix 6,
7185         allow "N" from nm for OSF, allow for "t" for other systems, but prefer
7186         no mention of the symbol at all.
7187
7188         * tune/tuneup.c (print_define_remark): New function.
7189         Turn some "#if"s into plain "if"s.
7190
7191         * tune/tuneup.c, gmp-impl.h, tune/Makefile.am
7192         (GET_STR_BASECASE_THRESHOLD, GET_STR_PRECOMPUTE_THRESHOLD): Tune these.
7193         * mpn/generic/get_str.c [TUNE_PROGRAM_BUILD]: Cope with non-constant
7194         GET_STR_PRECOMPUTE_THRESHOLD.
7195
7196 2002-02-02  Torbjorn Granlund  <tege@swox.com>
7197
7198         * mpn/generic/get_str.c (mpn_get_str): Fix typo in a declaration.
7199
7200 2002-02-02  Kevin Ryde  <kevin@swox.se>
7201
7202         * mpn/generic/set_str.c: Use MP_PTR_SWAP and POW2_P, add __GMP_PROTO
7203         to convert_blocks prototype, disable SET_STR_BLOCK_SIZE sanity check.
7204
7205         * tune/set_strb.c, tune/set_strs.c: New files.
7206         * tune/speed.h, tune/speed.c, tune/common.c,tune/Makefile.am: Add them.
7207         * tune/tuneup.c: Tune SET_STR_THRESHOLD.
7208         (DEFAULT_MAX_SIZE): Renamed from MAX_SIZE, allow any param.max_size[].
7209
7210 2002-02-01  Torbjorn Granlund  <tege@swox.com>
7211
7212         * tests/mpz/convert.c: Increase operand size.  Add (yet disabled) code
7213         for testing with random strings.
7214
7215         * mpn/generic/get_str.c (mpn_get_str): Rewrite to become sub-quadratic.
7216         (mpn_dc_get_str, mpn_sb_get_str): New functions.
7217
7218 2002-01-31  Kevin Ryde  <kevin@swox.se>
7219
7220         * gmpxx.h (cmp): Renamed from "compare".
7221
7222         * configure.in (AC_C_BIGENDIAN): Don't abort when cross compiling.
7223         (PROLOGUE): Allow new style optional second parameter when grepping.
7224
7225         * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
7226         GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
7227         Use $ac_objext for object filenames.
7228         (GMP_ASM_UNDERSCORE): Use CCAS to assemble.
7229
7230         * demos/pexpr-config-h.in: New file.
7231         * configure.in: Generate demos/pexpr-config.h.
7232         (AC_CHECK_FUNCS): Add clock, cputime, setrlimit, sigaction,
7233         sigaltstack, sigstack.
7234         * acinclude.m4 (GMP_SUBST_CHECK_FUNCS, GMP_SUBST_CHECK_HEADERS): New
7235         macros.
7236         * demos/pexpr.c: Use pexpr-config.h, not various #ifdefs.
7237         (setup_error_handler): Use signal if sigaction not available, allow
7238         for SIGBUS missing on mingw.
7239         (main): Use time() for random seed if gettimeofday not available.
7240         (cleanup_and_exit): Move SIGFPE out of LIMIT_RESOURCE_USAGE.
7241
7242 2002-01-30  Torbjorn Granlund  <tege@swox.com>
7243
7244         * mpn/generic/set_str.c: Rewrite to become sub-quadratic.
7245         (convert_blocks): New function.
7246
7247 2002-01-30  Kevin Ryde  <kevin@swox.se>
7248
7249         * gmp-impl.h (GMP_NUMB_MASK, GMP_NAIL_MASK, GMP_NUMB_HIGHBIT,
7250         ASSERT_MPN, ASSERT_MP_LIMB_T): New macros.
7251
7252         * mpn/generic/fib2_ui.c: Use GMP_NUMB_BITS, simplify the data
7253         generator program, share __gmp_fib_table initializers between bit
7254         sizes, cope with bit sizes other than those specifically setup.
7255         * gmp-impl.h (FIB_TABLE_LIMIT, FIB_TABLE_LUCNUM_LIMIT): Corresponding
7256         rearrangement of conditionals.
7257         * tests/mpz/t-fib_ui.c (check_fib_table): New test.
7258
7259 2002-01-28  Kevin Ryde  <kevin@swox.se>
7260
7261         * mpz/set_si.c, mpz/iset_si.c: Store to _mp_d[0] unconditionally, use
7262         an expression for _mp_size.
7263
7264         * mpz/init.c, mpz/init2.c, mpz/iset.c, mpq/init.c [__CHECKER__]: Store
7265         dummy values to low limbs to stop them appearing uninitialized.
7266
7267 2002-01-26  Kevin Ryde  <kevin@swox.se>
7268
7269         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use instead a patch from Paul and
7270         Vincent.
7271
7272 2002-01-24  Kevin Ryde  <kevin@swox.se>
7273
7274         * configure.in: Extra quoting to get argument help messages right.
7275
7276         * gmp.texi (Efficiency): Suggest hex or octal for input and output.
7277         (Formatted Output Strings): Mention "*" for width and precision.
7278
7279         * mpn/generic/sizeinbase.c: New file, adapted from mpz/sizeinbase.c.
7280         Use POW2_P, use __mp_bases[base].big_base for log2(base).
7281         * configure.in, mpn/Makefile.am: Add it.
7282         * gmp-impl.h: Add prototype.
7283         * mpz/sizeinbase.c, tune/speed.h, mpn/generic/get_str.c,
7284         mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c: Use it.
7285         * mpz/get_str.c: Write directly to user buffer, skip at most one
7286         leading zero, eliminate special case for x==0.
7287         * mpbsd/mtox.c: Allocate exact result space at the start, eliminate
7288         special case for x==0.
7289         * mpbsd/mout.c: Only need to skip one high zero with mpn_sizeinbase.
7290
7291         * configure.in (--enable-nails): New option.
7292         (GMP_NAIL_BITS, GMP_LIMB_BITS, GMP_NUMB_BITS): New defines for gmp.h
7293         and config.m4.
7294         * gmp-h.in: Add templates.
7295
7296         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use #ifndef to avoid a redefine
7297         error on AIX xlc.
7298
7299 2002-01-23  Torbjorn Granlund  <tege@swox.com>
7300
7301         * mpn/generic/get_str.c: Correct type of `out_len'.
7302
7303 2002-01-22  Kevin Ryde  <kevin@swox.se>
7304
7305         * mpn/generic/pre_divrem_1.c: Corrections to some ASSERTs.
7306
7307         * mpfr/mul_ui.c: Don't call mpn_lshift with 0 shift.
7308
7309         * mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
7310
7311 2002-01-21  Torbjorn Granlund  <tege@swox.com>
7312
7313         * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
7314         declaration.
7315         (64-bit powerpc add_ssaaaa): Likewise.
7316
7317 2002-01-20  Kevin Ryde  <kevin@swox.se>
7318
7319         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Use %n to better detect sparc
7320         solaris 2.7 problems.
7321
7322 2002-01-19  Torbjorn Granlund  <tege@swox.com>
7323
7324         * demos/pexpr.c (mpz_eval_expr): Optimize s^rhs for -1 <= s <= 1.
7325         (cleanup_and_exit): Improve error message wording.
7326
7327 2002-01-19  Kevin Ryde  <kevin@swox.se>
7328
7329         * mpfr/mpfr.h (_PROTO): Use __GMP_PROTO, for compatibility with
7330         gmp-impl.h.
7331
7332 2002-01-17  Torbjorn Granlund  <tege@swox.com>
7333
7334         * mpfr/mpfr-test.h: Test "__hpux", not "hpux".  Mask off mrand48
7335         return value to 31 bits to work around sloppy mpfr #include practices.
7336
7337         * mpfr/tests/*.c: Use #include "", not <>, for gmp.h and mpfr.h.
7338         Make sure to #include mpfr-test.h from all files that use random().
7339
7340 2002-01-17  Kevin Ryde  <kevin@swox.se>
7341
7342         * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE_TYPE): New macro.
7343         * gmp-impl.h, mpz/get_str.c, mpz/out_raw.c, mpq/get_str.c,
7344         mpq/set_str.c, mpf/get_str.c, printf/asprntffuns.c, printf/doprnt.c,
7345         printf/repl-vsnprintf.c, printf/snprntffuns.c, scanf/doscan.c,
7346         mpbsd/mtox.c: Some fixes to compile as C++.
7347
7348         * mpn/generic/jacbase.c (JACOBI_BASE_METHOD): New tuned parameter,
7349         replacing COUNT_TRAILING_ZEROS_TIME test.  Add a third method too.
7350         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
7351         measuring of mpn_jacobi_base methods.
7352         * tune/jacbase1.c, tune/jacbase2.c, tune/jacbase3.c: New files.
7353         * tune/tuneup.c (JACOBI_BASE_METHOD): Tune this.
7354         * mpn/x86/*/gmp-mparam.h (COUNT_TRAILING_ZEROS_TIME): Remove macro.
7355
7356         * gmp-h.in: Use __gmp prefix on variables in inlines.
7357
7358         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Remove __i, unused.
7359
7360         * mpn/generic/mul_fft.c: Use HAVE_NATIVE_mpn_addsub_n, not ADDSUB.
7361         Use CNST_LIMB for some constants.
7362
7363 2002-01-15  Kevin Ryde  <kevin@swox.se>
7364
7365         * tests/mpbsd/Makefile.am: Add a convenience rule for ../libtests.la.
7366
7367         * printf/Makefile.am: libdummy.la should be in EXTRA_LTLIBRARIES.
7368
7369         * mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
7370         mpf_get_str give the same for ndigits==0.
7371
7372         * mpfr/exceptions.c (mpfr_set_emin, mpfr_set_emax): Work around a
7373         powerpc64 gcc 3.0 -O2 bug.
7374
7375         * tests/memory.c, tests/tests.h (tests_memory_validate): New function.
7376
7377 2002-01-14  Kevin Ryde  <kevin@swox.se>
7378
7379         * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem_1.c,
7380         mpn/generic/divrem_2.c, mpn/generic/mod_1.c: Don't use UMUL_TIME and
7381         UDIV_TIME, just default to preinv.
7382         * gmp-impl.h (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Ditto.
7383         (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD): Don't use UMUL_TIME
7384         and UDIV_TIME, make default thresholds 0.
7385         (UDIV_NORM_PREINV_TIME, UDIV_UNNORM_PREINV_TIME): Remove macros.
7386         * mpn/x86/*/gmp-mparam.h (UMUL_TIME, UDIV_TIME,
7387         UDIV_NORM_PREINV_TIME): Remove macros.
7388
7389         * gmp.texi (Headers and Libraries): New section, being the header
7390         notes from "GMP Basics" and some new stuff.
7391         (Parameter Conventions): Notes on "const" parameters.
7392         (Formatted Output Strings): Add type N, tweak some wording.
7393
7394         * tests/refmpn.c (refmpn_divmod_1c): Avoid a bug in i386 gcc 3.0.
7395
7396 2002-01-12  Kevin Ryde  <kevin@swox.se>
7397
7398         * mpz/root.c: Add <stdlib.h>, for abort().
7399
7400         * mpfr/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
7401         * mpfr/mpfr.h, mpfr/mpfr-tests.h, reuse.c, tadd.c, tadd_ui.c, tagm.c,
7402         tatan.c, tcmp2.c, tcos.c, tdiv.c, tdiv_ui.c, teq.c, texp.c,
7403         tget_str.c, thyperbolic.c, tlog.c, tmul.c, tout_str.c, tpow.c,
7404         trandom.c, tset_z.c, tsin.c, tsqrt.c, tsqrt_ui.c, tsub_ui.c, ttan.c,
7405         tui_div.c: Fixes for K&R.
7406
7407         * tests/misc/t-scanf.c (check_misc, check_misc):
7408
7409         * tests/mpz/t-inp_str.c, tests/mpq/t-inp_str.c, tests/misc/t-scanf.c:
7410         Avoid strings in ASSERT, not enjoyed by K&R.
7411         * gmp-impl.h (ASSERT): Note this.
7412
7413         * tests/tests.h (refmpn_mod_34lsub1): Add __GMP_PROTO.
7414
7415         * mpbsd/Makefile.am: Avoid an automake problem with ansi2knr and
7416         sources in a different directory.
7417
7418         * printf/repl-vsnprintf.c: Test HAVE_LONG_DOUBLE for long double.
7419
7420         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mod_34lsub1.c,
7421         mul_2.c, pre_divrem_1.c.
7422
7423         * gmp-h.in, gmp-impl.h (mpn_add_nc, mpn_addmul_1c, mpn_addsub_n,
7424         mpn_addsub_nc, mpn_divrem_1c, mpn_dump, mpn_mod_1c, mpn_mul_1c,
7425         mpn_mul_basecase, mpn_sqr_n, mpn_sqr_basecase, mpn_sub_nc,
7426         mpn_submul_1c): Move to gmp-impl.h, since they're undocumented.
7427
7428         * gmp-impl.h (mpn_reciprocal): Remove, unused.
7429
7430         * tune/many.pl (cntlz, cnttz): Use new SPEED_ROUTINE_COUNT_ZEROS.
7431
7432 2002-01-11  Kevin Ryde  <kevin@swox.se>
7433
7434         * mpn/hppa/*.asm, mpn/pa64/*.asm, mpn/pa64w/*.asm: Use L().
7435
7436 2002-01-08  Kevin Ryde  <kevin@swox.se>
7437
7438         * mpn/asm-defs.m4 (PROLOGUE, EPILOGUE): New scheme, optional function
7439         name to EPILOGUE, check for missing or wrong function name EPILOGUE.
7440         * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/m68k/m68k-defs.m4,
7441         mpn/mips3/mips.m4, mpn/ia64/default.m4, mpn/powerpc32/aix.m4,
7442         mpn/powerpc64/aix.m4, mpn/x86/x86-defs.m4: Consequent updates, add a
7443         few more asserts.
7444         * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/alpha/cntlz.asm,
7445         mpn/alpha/invert_limb.asm (PROLOGUE_GP): Change to an optional "gp"
7446         parameter on plain PROLOGUE.
7447
7448         * gmp.texi (Low-level Functions): mpn_get_str doesn't clobber an extra
7449         limb, and doesn't clobber at all for power of 2 bases.
7450         (Language Bindings): Add python gmpy.
7451
7452         * mpz/get_str.c: Determine realloc size arithmetically.
7453
7454         * mpbsd/mtox.c: Size memory block returned to actual space needed.
7455         * gmp.texi (BSD Compatible Functions): Describe this.
7456
7457         * mpz/get_str.c: Don't copy mpn_get_str input for power of 2 bases.
7458         * mpbsd/mtox.c: Ditto, and as a side effect avoid a memory leak from a
7459         missing TMP_FREE.
7460
7461         * mpz/get_str.c, mpbsd/mout.c: No longer need for +1 limb for
7462         mpn_get_str clobber.
7463
7464         * gmp-impl.h (MPN_GET_STR_SIZE): New macro.
7465         * mpn/generic/get_str.c, mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c,
7466         tune/speed.h: Use it.
7467         * tests/mpn/t-g_str_size.c: New test.
7468         * tests/mpn/Makefile.am: Add it.
7469
7470         * gmp-impl.h (POW2_P): New macro.
7471         * mpn/generic/get_str.c, tests/misc.c: Use it.
7472
7473         * printf/doprnt.c: Add "N" for mpn, share some code between N, Q and Z.
7474         * tests/misc/t-printf.c: Add tests.
7475         * gmp-impl.h (ASSERT_CODE): New macro.
7476
7477         * tests/mpbsd/t-mtox.c: New test.
7478         * tests/mpbsd/Makefile.am: Add it.
7479         (allfuns_LDADD): Don't link against libgmp when testing everything in
7480         libmp can link.
7481
7482 2002-01-07  Torbjorn Granlund  <tege@swox.com>
7483
7484         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Rewrite generic versions.
7485
7486 2002-01-06  Kevin Ryde  <kevin@swox.se>
7487
7488         * mpn/generic/pre_divrem_1.c: Don't support size==0.
7489         * tests/devel/try.c: Update.
7490
7491         * mpn/generic/get_str.c: Add special case for base==10.
7492         * gmp-impl.h (MP_BASES_CHARS_PER_LIMB_10, MP_BASES_BIG_BASE_10,
7493         MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): New
7494         constants.
7495         * tests/t-constants.c: Add checks.
7496         * mpn/mp_bases.c [GENERATE_TABLE]: Print defines for gmp-impl.h, print
7497         all standard bits-per-limb by default.
7498
7499         * demos/pexpr.c, demos/expr/expr.h, demos/expr/expr-impl.h: Use
7500         __GMP_PROTO.
7501
7502         * gmp-h.in (mpn_divexact_by3c): Remove variables from prototype, to
7503         keep out of application namespace.
7504
7505 2002-01-04  Torbjorn Granlund  <tege@swox.com>
7506
7507         * gmp-impl.h: Move _PROTO declaration to before its first usages.
7508
7509 2002-01-04  Kevin Ryde  <kevin@swox.se>
7510
7511         * gmp-h.in, mp-h.in, tests/tests.h: Rename _PROTO to __GMP_PROTO, and
7512         don't use #ifndef just define it ourselves.
7513         * gmp-impl.h: Provide _PROTO as an alias for __GMP_PROTO, to avoid big
7514         edits internally, for the moment.
7515
7516 2002-01-03  Torbjorn Granlund  <tege@swox.com>
7517
7518         * tune/speed.c (usage): Insert "\n\" into a string.
7519
7520 2001-12-30  Torbjorn Granlund  <tege@swox.com>
7521
7522         * mpn/pa64/udiv_qrnnd.c: Remove file.
7523         * mpn/pa64w/udiv_qrnnd.c: Remove file.
7524
7525         * gmp-impl.h (MPN_IORD_U): Change formatting (labels in pos 0, insns
7526         indented by tab).
7527         (MPN_INCR_U): Use "addl $1,foo; jc", not "incl foo; jz".
7528
7529         * gmp-impl.h (udiv_qrnnd_preinv): Use plain subtract, not sub_ddmmss,
7530         in one more case.
7531
7532 2001-12-30  Kevin Ryde  <kevin@swox.se>
7533
7534         * mpn/generic/get_str.c (udiv_qrnd_unnorm): New macro.
7535         Use "do while" for dig_per_u loop since it's non-zero.
7536         * acconfig.h (HAVE_HOST_CPU_m68k etc): Add templates.
7537
7538         * mpn/generic/mul_basecase.c, mpz/mul.c, mpz/n_pow_ui.c,
7539         mpn/x86/pentium/mul_2.asm, tests/devel/try.c, tests/tests.h,
7540         tests/refmpn.c, tune/speed.c, tune/speed.h, tune/common.c,
7541         tune/many.pl (mpn_mul_2): New parameter style.
7542         * gmp-impl.h (mpn_mul_2): Add prototype.
7543         * configure.in (gmp_mpn_functions_optional): Add mul_2.
7544
7545         * longlong.h (__vxworks__): Remove from powerpc tests, not correct,
7546         not on its own at least.
7547
7548         * tune/speed.c: Add "aas" to specify 0xAA..AA data.
7549
7550         * tune/tuneup.c (print_define_end): Indicate "never" and "always".
7551
7552 2001-12-29  Torbjorn Granlund  <tege@swox.com>
7553
7554         * mpq/set_d.c: ANSI-fy.
7555         * mpz/invert.c: Use PTR and SIZ (cosmetic change).
7556
7557         * mpz/cong.c: Rename `xor' to `sign' to avoid C++ reserved word.
7558
7559 2001-12-28  Torbjorn Granlund  <tege@swox.com>
7560
7561         * mpn/sparc64/sqr_diagonal.asm: New file.
7562
7563 2001-12-28  Kevin Ryde  <kevin@swox.se>
7564
7565         * mpn/generic/get_str.c: Avoid one mpn_divrem_1 by running main loop
7566         only until msize==1.
7567
7568         * tune/tuneup.c: Break up all() for clarity.
7569         (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Compare against plain
7570         division udiv_qrnnd, not the tuned and possibly preinv version.
7571
7572         * tune/freq.c: Split sysctl and sysctlbyname probes into separate
7573         functions, shorten some identifiers, put descriptions inside
7574         functions, define functions unconditionally and do nothing if
7575         requisites not available.
7576
7577         * mpz/inp_raw.c: Avoid a gcc 3.0 powerpc64 bug on AIX.
7578
7579         * acinclude.m4, configure.in (GMP_C_RESTRICT): New macro.
7580
7581         * mpfr/sin.c: Patch from Paul to fix sign of sin(3pi/2).
7582
7583         * demos/calc/calc.y: Improve some error messages.
7584
7585 2001-12-28  Torbjorn Granlund  <tege@swox.com>
7586
7587         * mpn/sparc64/mul_1.asm: Rename r72 -> r80.
7588         * mpn/sparc64/addmul_1.asm: Likewise.
7589
7590 2001-12-27  Torbjorn Granlund  <tege@swox.com>
7591
7592         * mpn/generic/tdiv_qr.c: Misc formatting cleanups.
7593         For switch case 2, replace `dn' with its value (2).
7594
7595 2001-12-25  Torbjorn Granlund  <tege@swox.com>
7596
7597         * tests/devel/mul_1.c: Add FIXED_XLIMB.
7598         * tests/devel/addmul_1.c: Likewise.
7599         * tests/devel/submul_1.c: Likewise.
7600
7601         * tests/devel/add_n.c: Improve error message.
7602         Accept command line argument for # of tests.
7603         * tests/devel/sub_n.c: Likewise.
7604
7605         * tests/devel/: Remove CLOCK settings.
7606
7607         * mpn/sparc32/v9/mul_1.asm: Rewrite.
7608         * mpn/sparc32/v9/addmul_1.asm: Rewrite.
7609         * mpn/sparc32/v9/submul_1.asm: Rewrite.
7610
7611 2001-12-24  Torbjorn Granlund  <tege@swox.com>
7612
7613         * mpn/sparc64/mul_1.asm: Get rid of global constant 0.0 (L(noll)).
7614         * mpn/sparc64/addmul_1.asm: Likewise.
7615
7616 2001-12-23  Torbjorn Granlund  <tege@swox.com>
7617
7618         * mpn/generic/get_str.c: Move final ASSERT to just before zero fill
7619         loop.
7620
7621 2001-12-22  Torbjorn Granlund  <tege@swox.com>
7622
7623         * mpn/generic/get_str.c: Move ASSERTs out of loops.  Split digit
7624         generation code into two loops, saving a test of msize in the loop.
7625
7626 2001-12-22  Kevin Ryde  <kevin@swox.se>
7627
7628         * mpn/x86/x86-defs.m4, mpn/x86/*/*.asm: Remove L / LF scheme putting
7629         function name in local labels.
7630
7631         * mpn/generic/get_str.c: Use mpn_preinv_divrem_1, add a couple of
7632         ASSERTs.
7633
7634         * mpn/generic/pre_divrem_1.c: New file.
7635         * configure.in (gmp_mpn_functions): Add it.
7636         * gmp-impl.h (mpn_preinv_divrem_1): Add prototype.
7637         (USE_PREINV_DIVREM_1, MPN_DIVREM_OR_PREINV_DIVREM_1): New macros.
7638         * tests/devel/try.c, tune/speed.c, tune/speed.h, tune/common.c,
7639         tune/many.pl, tune/Makefile.am (mpn_preinv_divrem_1): Add testing and
7640         measuring.
7641         * tune/tuneup.c: Determine USE_PREINV_DIVREM_1.
7642         * tune/pre_divrem_1.c: New file.
7643         * tests/refmpn.c, tests/tests.h (refmpn_preinv_divrem_1): New function.
7644
7645         * tests/mpz/t-io_raw.c: New file.
7646         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
7647
7648         * mpz/inp_raw.c, mpz/out_raw.c: Rewrite.
7649         * acinclude.m4, configure.in (AC_C_BIGENDIAN): New test.
7650         * gmp-impl.h (BSWAP_LIMB): New macro.
7651
7652         * acinclude.m4 (GMP_PROG_CC_WORKS): For a native compile, demand
7653         executables will run, per AC_PROG_CC.  This detects ABI=64 is unusable
7654         in a native sparc solaris 7 build with the kernel in 32-bit mode.
7655         * gmp.texi (ABI and ISA): Add notes on this, add an example configure
7656         setting an ABI.
7657
7658         * tune/tuneup.c, configure.in: Print the gmp-mparam.h filename.
7659         * tune/tuneup.c: Print the CPU frequency.
7660
7661         * tune/time.c, tune/speed.h: Add s390 "stck" method, flatten
7662         conditionals in speed_time_init a bit, use have_* variables to let
7663         some code go dead in speed_starttime and speed_endtime.
7664
7665         * tune/freq.c (speed_cpu_frequency_irix_hinv): New function.
7666
7667         * Makefile.am, configure.in: Restore mpfr.
7668
7669         * configure.in: Add --with-readline, AC_PROG_YACC and AM_PROG_LEX.
7670         * demos/calc/calc.y, demos/calc/calclex.l: Add readline support, add
7671         lucnum function.
7672         * demos/calc/Makefile.am: Add calcread.c, calc-common.h, use $(YACC),
7673         $(LEX) and $(LEXLIB).
7674         * demos/calc/calcread.c, demos/calc/calc-common.h,
7675         demos/calc/calc-config-h.in, demos/calc/README: New files.
7676
7677         * configure.in: Put demos/expr configs in expr-config.h.
7678         * demos/expr/expr-config-h.in: New file.
7679         * demos/expr/expr-impl.h: Renamed from expr-impl-h.in, get configs
7680         from expr-config.h.
7681         * demos/expr/Makefile.am: Update.
7682
7683         * demos/expr/exprfr.c: Use mpfr_sin and mpfr_cos, remove some spurious
7684         returns.
7685
7686 2001-12-20  Torbjorn Granlund  <tege@swox.com>
7687
7688         * mpn/sparc64/mul_1.asm: Trim an instruction.
7689         * mpn/sparc64/addmul_1.asm: Likewise.
7690
7691         * mpn/ia64/add_n.asm: Rewrite.
7692         * mpn/ia64/sub_n.asm: Rewrite.
7693
7694 2001-12-19  Torbjorn Granlund  <tege@swox.com>
7695
7696         * mpn/ia64/mul_1.asm: Rewrite.
7697         * mpn/ia64/addmul_1.asm: Rewrite.
7698         * mpn/ia64/submul_1.c: Use TMP_ALLOC_LIMBS.
7699
7700         * tests/devel/mul_1.c: Improve error message.
7701         Accept command line argument for # of tests.
7702         * tests/devel/addmul_1.c: Likewise.
7703         * tests/devel/submul_1.c: Likewise.
7704
7705 2001-12-18  Torbjorn Granlund  <tege@swox.com>
7706
7707         * mpn/mips3/mul_1.asm: Add NOPs to save a cycle on R1x000.
7708
7709 2001-12-18  Kevin Ryde  <kevin@swox.se>
7710
7711         * gmpxx.h (gmp_randclass): Don't allow copy constructors or "=",
7712         implementation by Gerardo.
7713
7714         * gmp-h.in (operator<<, operator>>): Remove parameter names from
7715         prototypes, to keep out of user namespace.
7716
7717         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Let the test program work as C++.
7718
7719 2001-12-16  Torbjorn Granlund  <tege@swox.com>
7720
7721         * mpn/sparc64/mul_1.asm: Rewrite.
7722         * mpn/sparc64/addmul_1.asm: Rewrite.
7723         * mpn/sparc64/submul_1.asm: Rewrite.
7724
7725         * mpn/sparc64/addmul1h.asm: Remove.
7726         * mpn/sparc64/submul1h.asm: Remove.
7727         * mpn/sparc64/mul1h.asm: Remove.
7728
7729 2001-12-15  Kevin Ryde  <kevin@swox.se>
7730
7731         * gmp-h.in (mpn_add, mpn_add_1, mpn_cmp, mpn_sub, mpn_sub_1): Follow
7732         __GMP_INLINE_PROTOTYPES for whether to give prototype with inline.
7733
7734         * configure.in (i686*-*-*, pentiumpro-*-*, pentium[23]-*-*,
7735         athlon-*-*, pentium4-*-*): Fall back on -march=pentium if
7736         -march=pentiumpro or higher is not good (eg. solaris cmov).
7737
7738 2001-12-12  Torbjorn Granlund  <tege@swox.com>
7739
7740         * gmp-impl.h (MPN_ZERO): Rewrite generic version to be similar to
7741         powerpc version.
7742
7743 2001-12-12  Kevin Ryde  <kevin@swox.se>
7744
7745         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect cmov problems with gcc
7746         -march=pentiumpro on solaris 2.8.
7747
7748         * tune/common.c, tune/speed.h: Allow for commas in count_leading_zeros
7749         and count_trailing_zeros macros.
7750
7751         * demos/expr/Makefile.am: Distribute exprfr.c and exprfra.c.
7752
7753         * tune/Makefile.am (speed_ext_SOURCES): Should be speed-ext.c.
7754
7755 2001-12-10  Torbjorn Granlund  <tege@swox.com>
7756
7757         * mpn/s390/addmul_1.asm: New file.
7758         * mpn/s390/submul_1.asm: New file.
7759         * mpn/s390/mul_1.asm: New file.
7760         * mpn/s390/gmp-mparam.h: Update.
7761
7762 2001-12-07  Kevin Ryde  <kevin@swox.se>
7763
7764         * gmp-h.in, mp-h.in, gmp-impl.h: __GMP_DECLSPEC at start of
7765         prototypes, for the benefit of Microsoft C.
7766
7767         * gmp.texi (Introduction to GMP): Mention ABI and ISA section.
7768         (Known Build Problems): Recommend GNU sed on solaris 2.6.
7769         (Assigning Integers): Direct feedback to bug-gmp.
7770         (References): Typo Knuth vol 2 is from 1998.
7771
7772         * gmpxx.h (gmp_randclass): Add initializers for gmp_randinit_default
7773         and gmp_randinit_lc_2exp_size.
7774         gmp.texi (C++ Interface Random Numbers): Describe them.
7775
7776         * tests/misc/t-locale.c, tests/cxx/t-locale.cc: Ensure mpf_clear is
7777         done when the localconv override doesn't work.  Reported by Mike
7778         Jetzer.
7779
7780         * printf/doprnti.c: Don't showbase on a zero mpq denominator.
7781         * tests/misc/t-printf.c, tests/cxx/t-ostream.c: Add test cases.
7782
7783 2001-12-04  Kevin Ryde  <kevin@swox.se>
7784
7785         * gmp.texi (Known Build Problems): Update to gmp_randinit_lc_2exp_size
7786         for the sparc solaris 2.7 problem.
7787         (Reentrancy): SCO ctype.h affects all text-based input functions.
7788         (Formatted Output Strings): Correction to the mpf example.
7789         (Single Limb Division): Correction, should be q-1 not q+1.
7790         (Extended GCD): Clarify why single-limb is inferior.
7791         (Raw Output Internals): Clarify size is twos complement, note limb
7792         order means _mp_d doesn't get directly read or written.
7793         (Contributors): Clarify mpz_jacobi.
7794         And a couple of formatting tweaks elsewhere.
7795
7796         * tests/cxx/t-headers.cc: New file.
7797         * tests/cxx/Makefile.am: Add it.
7798
7799         * gmpxx.h: Add <strstream>, needed by mpf_class::get_str2.
7800
7801         * gmp-h.in (mpq_inp_str, mpn_hamdist): Add __GMP_DECLSPEC.
7802
7803 2001-12-01  Torbjorn Granlund  <tege@swox.com>
7804
7805         * Version 4.0 released.
7806
7807         * mpfr/README: Replace contents with explanation of why mpfr is gone.
7808
7809 2001-12-01  Kevin Ryde  <kevin@swox.se>
7810
7811         * Makefile.am, configure.in: Temporarily remove mpfr, just leave a
7812         README.
7813
7814         * mpn/Makefile.am (EXTRA_DIST): Add Makeasm.am.
7815
7816 2001-11-30  Gerardo Ballabio  <ballabio@sissa.it>
7817
7818         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: New files.
7819         * tests/cxx/Makefile.am (check_PROGRAMS): Add them.
7820
7821 2001-11-30  Kevin Ryde  <kevin@swox.se>
7822
7823         * mpfr: Update to 2001-11-16.  Patch TMP handling of agm.c and sqrt.c,
7824         use plain mpn_sqrtrem in sqrt.c, separate .c files for floor and ceil,
7825         disable an expression style assert in add1.c.
7826
7827         * mpn/s370: Rename to s390.
7828         * configure.in (s3[6-9]0*-*-*): Update.
7829         * mpn/Makefile.am (TARG_DIST): Add s390.
7830
7831         * mpz/fits_s.c, mpf/fits_s.c, mpf/fits_u.c: Remove files, unused since
7832         change to .h style.
7833
7834 2001-11-29  Torbjorn Granlund  <tege@swox.com>
7835
7836         * gmp-h.in: Declare mpz_get_d_2exp and mpf_get_d_2exp.
7837         * Makefile.am: Add mpz/get_d_2exp$U.lo and mpf/get_d_2exp$U.lo.
7838         * mpf/Makefile.am: Add get_d_2exp.c.
7839         * mpz/Makefile.am: Add get_d_2exp.c.
7840
7841 2001-11-29  Kevin Ryde  <kevin@swox.se>
7842
7843         * mpn/*/gmp-mparam.h: Update measured thresholds.
7844         * mpn/s370/gmp-mparam.h: New file.
7845
7846         * mpz/millerrabin.c: Mark for internal use only, for now.
7847         * gmp.texi (Number Theoretic Functions): Remove documentation.
7848
7849 2001-11-28  Torbjorn Granlund  <tege@swox.com>
7850
7851         * mpf/get_d_2exp.c: New file.
7852         * mpz/get_d_2exp.c: New file.
7853
7854         * mpz/realloc2.c: Fix typo.  Make more similar to mpz_realloc.
7855         * mpz/realloc.c: Use __GMP_REALLOCATE_FUNC_LIMBS.
7856
7857 2001-11-27  Gerardo Ballabio  <ballabio@sissa.it>
7858
7859         * gmpxx.h, mpfrxx.h: Various updates and improvements.
7860
7861 2001-11-27  Kevin Ryde  <kevin@swox.se>
7862
7863         * gmp.texi (Useful Macros and Constants): Add gmp_version, add @findex
7864         for mp_bits_per_limb.
7865
7866         * demos/perl/GMP.pm, demos/perl/GMP.xs: Use new style gmp_randinit's.
7867         * demos/perl/test.pl: Update for this, and for mpz_perfect_power_p
7868         handling of 0 and 1.
7869
7870 2001-11-26  Torbjorn Granlund  <tege@swox.com>
7871
7872         * mpz/realloc.c: Clear variable when decreasing allocation to less than
7873         needed.  Misc updates.
7874
7875 2001-11-25  Kevin Ryde  <kevin@swox.se>
7876
7877         * tests/misc/t-locale.c: Avoid printf in the normal case, since the
7878         replacement localeconv breaks it on SunOS 4.
7879
7880         * gmp.texi (Build Options, Notes for Package Builds): Note libgmpxx
7881         depends on libgmp from same GMP version.
7882
7883         * acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
7884         test.
7885         * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is
7886         writable, if necessary.
7887
7888         * tests/misc/t-scanf.c: Ensure sscanf arguments are writable, always.
7889         * configure.in (AC_CHECK_DECLS): Remove sscanf, no longer required.
7890
7891         * configure.in (none-*-*): Fix default CFLAGS setups.
7892
7893         * doc/configuration: Misc updates.
7894
7895 2001-11-23  Kevin Ryde  <kevin@swox.se>
7896
7897         * mpz/init2.c, mpz/realloc2.c: New files.
7898         * Makefile.am, mpz/Makefile.am: Add them.
7899         * gmp-h.in: Add prototypes.
7900         * gmp.texi (Efficiency): Mention these instead of _mpz_realloc.
7901         (Initializing Integers): Add documentation, reword other parts.
7902
7903 2001-11-22  Torbjorn Granlund  <tege@swox.com>
7904
7905         * mpn/cray/ieee/addmul_1.c: Fix logic for more_carries scalar loop.
7906         * mpn/cray/ieee/submul_1.c: Likewise.
7907
7908 2001-11-20  Kevin Ryde  <kevin@swox.se>
7909
7910         * gmp.texi (Known Build Problems): Note an out of memory on DJGPP.
7911         (Function Classes): Update function counts.
7912         Misc tweaks elsewhere.
7913
7914         * configure.in (AC_CHECK_DECLS): Add sscanf.
7915         * tests/misc/t-scanf.c: Use it, for the benefit of SunOS 4.
7916
7917         * tal-debug.c, gmp-impl.h: More checks of TMP_DECL/TMP_MARK/TMP_FREE
7918         consistency.
7919
7920         * mpfr/Makefile.am (AR): Explicit AR=@AR@ to override automake
7921         default, necessary for powerpc64 ABI=aix64.
7922
7923 2001-11-18  Torbjorn Granlund  <tege@swox.com>
7924
7925         * mpz/powm.c: Move TMP_MARK to before any TMP_ALLOCs.
7926
7927 2001-11-18  Kevin Ryde  <kevin@swox.se>
7928
7929         * configure.in (--enable-fft): Make this the default.
7930         * gmp.texi (Build Options): Update.
7931
7932         * Makefile.am (libmp_la_DEPENDENCIES): Revise mpz objects needed by
7933         new mpz/powm.c.
7934
7935         * gmp.texi (Random State Initialization): Add gmp_randinit_default and
7936         gmp_randinit_lc_2exp_size, mark gmp_randinit as obsolete.
7937         (Random State Seeding): New section, taken from "Random State
7938         Initialization" and "Random Number Functions".
7939
7940         * configure.in (AC_CHECK_DECLS): Add fgetc, fscanf, ungetc.
7941         * scanf/fscanffuns.c: Use these, for the benefit of SunOS 4.
7942
7943         * gmp-impl.h, gmp-h.in (__gmp_default_fp_limb_precision): Move back to
7944         gmp-impl.h now not required for inlined mpf.
7945
7946         * randlc2s.c (gmp_randinit_lc_2exp_size): New file, the size-based LC
7947         selection from rand.c.
7948         * rand.c (gmp_randinit): Use it.
7949         * randdef.c (gmp_randinit_default): New file.
7950         * gmp-impl.h (RANDS): Use it.
7951         (ASSERT_CARRY): New macro.
7952         * gmp-h.in (gmp_randinit_default, gmp_randinit_lc_2exp_size: Add
7953         prototypes.
7954         * Makefile.am (libgmp_la_SOURCES): Add randdef.c and randlc2s.c.
7955
7956         * printf/asprntffuns.c: Include config.h before using its defines.
7957
7958         * gmp-impl.h: Move C++ <string> to top of file to avoid the memset
7959         redefine upsetting configure tests.  Remove <iostream> since <iosfwd>
7960         in gmp.h suffices.
7961
7962 2001-11-16  Kevin Ryde  <kevin@swox.se>
7963
7964         * gmp.texi (Integer Exponentiation): mpz_powm supports negative
7965         exponents.
7966         (Assigning Floats, I/O of Floats, C++ Formatted Output, C++ Formatted
7967         Input): Decimal point follows locale.
7968         (Formatted Output Strings): %n accepts any type.
7969         (Formatted Input Strings): New section.
7970         (Formatted Input Functions): New section.
7971         (C++ Class Interface): Corrections and clarifications suggested by
7972         Gerardo.
7973
7974         * scanf/doscan.c, scanf/fscanf.c, scanf/fscanffuns.c, scanf/scanf.c,
7975         scanf/sscanf.c, scanf/sscanffuns.c, scanf/vfscanf.c, scanf/vscanf.c,
7976         scanf/vsscanf.c, scanf/Makefile.am, tests/misc/t-scanf.c: New files.
7977         * gmp-h.in, gmp-impl.h, Makefile.am, configure.in: Consequent
7978         additions.
7979
7980         * tests/misc: New directory.
7981         * tests/misc/Makefile.am: New file.
7982         * tests/misc/t-locale.c: New file.
7983         * tests/misc/t-printf.c: Moved from tests/printf.
7984         * tests/printf: Remove directory.
7985         * configure.in, tests/Makefile.am: Update.
7986
7987         * tests/cxx/t-locale.cc: New file.
7988         * tests/cxx/Makefile.am: Add it.
7989
7990         * mpf/set_str.c, cxx/ismpf.cc: Use localeconv for the decimal point.
7991
7992         * acinclude.m4 (GMP_ASM_X86_MCOUNT): Update to $lt_prog_compiler_pic
7993         for current libtool, recognise non-PIC style mcount in windows DLLs.
7994
7995         * gmp-impl.h (__gmp_replacement_vsnprintf): Add prototype.
7996
7997         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized,
7998         modlimb_invert_table): Add __GMP_DECLSPEC for the benefit of test
7999         programs using them from a windows DLL.
8000         * longlong.h (__clz_tab): Ditto.
8001
8002         * mpn/x86/t-zdisp2.pl: New file.
8003
8004         * mpn/x86/pentium4/README: New file.
8005
8006 2001-11-15  Torbjorn Granlund  <tege@swox.com>
8007
8008         * mpz/powm.c (HANDLE_NEGATIVE_EXPONENT): #define to 1.
8009         * tests/mpz/reuse.c (main): Use mpz_invert to avoid undefined mpz_powm
8010         cases.
8011
8012 2001-11-14  Torbjorn Granlund  <tege@swox.com>
8013
8014         * mpz/powm_ui.c: Rewrite along the lines of mpz/powm.c (except still no
8015         redc).
8016         * mpz/powm.c: Adjust for negative b, after exponentiation done.  Add
8017         (still disabled) code for handling negative exponents.  Misc cleanups.
8018
8019 2001-11-14  Kevin Ryde  <kevin@swox.se>
8020
8021         * mpf/out_str.c: Use localeconv for the decimal point.
8022
8023         * tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
8024         available (eg. on mingw).
8025
8026 2001-11-11  Kevin Ryde  <kevin@swox.se>
8027
8028         * gmp-h.in: Remove parameter names from prototypes, to keep out of
8029         application namespace.
8030
8031 2001-11-08  Kevin Ryde  <kevin@swox.se>
8032
8033         * acinclude.m4 (GMP_GCC_VERSION_GE): Fix sed regexps to work on
8034         Solaris 8.
8035
8036         * printf/doprnt.c: Support %n of all types, per glibc.
8037
8038         * gmp-h.in, gmp-impl.h, mpf/abs.c, mpf/neg.c, mpf/get_prc.c,
8039         mpf/get_dfl_prec.c, mpf/set_dfl_prec.c, mpf/set_prc_raw.c,
8040         mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Revert mpf inlining, in order
8041         to leave open the possibility of keeping binary compatibility if mpf
8042         becomes mpfr.
8043
8044         * mpn/x86/k7/mmx/lshift.asm, mpn/x86/k7/mmx/rshift.asm: Use Zdisp to
8045         force code size for computed jumps.
8046         * mpn/x86/k6/mod_34lsub1.asm, mpn/x86/k6/k62mmx/copyd.asm: Use Zdisp
8047         to force good code alignment.
8048         * mpn/x86/x86-defs.m4 (Zdisp): More instructions.
8049
8050         * mpn/x86/pentium/sqr_basecase.asm, mpn/x86/k7/mmx/mod_1.asm,
8051         mpn/x86/k7/mmx/popham.asm: Remove some unnecessary "0" address offsets.
8052
8053         * mpq/set_si.c, mpq/set_ui.c: Set _mp_den._mp_size correctly if den==0.
8054
8055 2001-11-07  Torbjorn Granlund  <tege@swox.com>
8056
8057         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Work around gas bug.
8058
8059         * mpn/asm-defs.m4 (PROLOGUE): Change alignment to 8 (probably a good
8060         idea in general; required for hppa/hppa1_1/udiv_qrnnd.asm).
8061
8062 2001-11-06  Torbjorn Granlund  <tege@swox.com>
8063
8064         * gmp-impl.h (MPN_COPY_INCR): Prepend local variable by `__'.
8065         (MPN_COPY_DECR): Likewise.
8066
8067 2001-11-05  Torbjorn Granlund  <tege@swox.com>
8068
8069         * mpz/powm.c: Call mpn functions, not mpz functions, for computation
8070         mod m.  Streamline allocations to use a mixture of stack allocation and
8071         heap allocation.  Add currently disabled phi(m) exponent reduction
8072         code.  Misc optimizations and cleanups.
8073
8074 2001-11-05  Kevin Ryde  <kevin@swox.se>
8075
8076         * mpq/inp_str.c: Remove unused variable "ret".
8077
8078         * mpn/x86/k7/sqr_basecase.asm: Fix a 0(%edi) to use Zdisp, so the
8079         computed jumps hit the right spot on old gas.
8080
8081         * mpq/canonicalize.c: DIVIDE_BY_ZERO if denominator is zero.
8082
8083         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Correction to the way
8084         the first \( \) pair is setup.
8085         (gmpasm-font-lock-keywords): Don't fontify the space before a "#" etc.
8086         Misc tweaks to some comments.
8087
8088 2001-11-03  Torbjorn Granlund  <tege@swox.com>
8089
8090         * tests/refmpn.c (refmpn_overlap_p): Reverse return values.
8091
8092 2001-11-02  Kevin Ryde  <kevin@swox.se>
8093
8094         * tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
8095         longer done by configure.
8096
8097         * mpn/x86/pentium4/mmx/popham.asm: New file.
8098
8099         * mpn/x86/x86-defs.m4 (psadbw): New macro.
8100         * mpn/x86/k7/mmx/popham.asm: Use it.
8101
8102         * tests/refmpn.c (refmpn_overlap_p): New function, independent of
8103         MPN_OVERLAP_P.
8104
8105 2001-10-31  Torbjorn Granlund  <tege@swox.com>
8106
8107         * tests/mpz/t-powm.c: Print proper error message when finding
8108         discrepancy.
8109
8110 2001-10-31  Kevin Ryde  <kevin@swox.se>
8111
8112         * mpn/x86/pentium/mod_34lsub1.asm: New file.
8113         * mpn/x86/k7/mod_34lsub1.asm: New file.
8114         * mpn/x86/mod_34lsub1.asm: New file.
8115
8116 2001-10-30  Kevin Ryde  <kevin@swox.se>
8117
8118         * tests/printf/t-printf.c (check_misc): Add checks from the glibc docs.
8119         (check_vasprintf, check_vsnprintf): Run these unconditionally.
8120
8121         * gmp-impl.h (ASSERT_MPQ_CANONICAL): New macro.
8122         * mpq/cmp.c, mpq/cmp_si.c, mpq/cmp_ui.c, mpq/equal.c: Add ASSERTs for
8123         canonical inputs, where correctness depends on it.
8124
8125         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Add "dnl".
8126
8127 2001-10-27  Torbjorn Granlund  <tege@swox.com>
8128
8129         * demos/pexpr.c: Remove some unused variables.
8130         (main): Allocate more buffer space to accommodate minus sign.
8131
8132 2001-10-27  Kevin Ryde  <kevin@swox.se>
8133
8134         * gmp-impl.h, mpn/asm-defs.m4, configure.in, tune/speed.h,
8135         tune/speed.c, tune/common.c, tune/many.pl, tests/devel/try.c: Add
8136         mpn_mod_34lsub1.
8137         * tests/refmpn.c, tests/tests.h (refmpn_mod_34lsub1): New function.
8138
8139         * mpn/generic/mod_34lsub1.c: New file.
8140         * mpn/x86/k6/mod_34lsub1.asm: New file.
8141         * mpn/x86/pentium4/sse2/mod_34lsub1.asm: New file.
8142         * mpn/x86/x86-defs.m4 (Zdisp): Add another instruction.
8143
8144         * gmp-h.in, gmpxx.h: Use <iosfwd> not whole <iostream>.
8145
8146         * gmp.texi (Known Build Problems): Add note on test programs with
8147         Windows DLLs.
8148
8149 2001-10-26  Kevin Ryde  <kevin@swox.se>
8150
8151         * tests/mpq/t-get_d.c: Limit the size of "eps" for vax.
8152
8153         * gmp.texi (maybepagebreak): New macro, use it in a few places.
8154         (Notes for Particular Systems): C++ Windows DLLs are not supported.
8155         (Known Build Problems): Note sparc solaris 2.7 gcc 2.95.2 shared
8156         library problems.
8157         (Autoconf): Tweak version numbers shown.
8158         (Integer Roots): mpz_perfect_square_p and mpz_perfect_power_p consider
8159         0 and 1 perfect powers, mpz_perfect_power_p accepts negatives.
8160         (Number Theoretic Functions): Add mpz_millerrabin, combined with a
8161         reworded mpz_probab_prime_p.
8162         (Formatted Output Strings): Misc clarifications.
8163         (Formatted Output Functions): gmp_asprintf, gmp_vasprintf,
8164         gmp_snprintf, gmp_vsnprintf always available.
8165         (C++ Formatted Output): Misc rewordings.
8166         (Formatted Input): New chapter.
8167         (C++ Class Interface): New chapter, by Gerardo and me.
8168         (Language Bindings): Update GMP++ now in GMP.
8169         (C++ Interface Internals): New section, by Gerardo and me.
8170
8171         * printf/repl-vsnprintf.c: New file.
8172         * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am: Use it
8173         if libc vsnprintf missing or bad.
8174         * configure.in (AC_CHECK_FUNCS): Add strnlen.
8175
8176         * printf/snprntffuns.c, printf/vasprintf.c: Use
8177         __gmp_replacement_vsnprintf if libc vsnprintf not available.
8178         * printf/asprintf.c, printf/snprintf.c, printf/vasprintf.c,
8179         printf/vsnprintf.c: Provide these functions unconditionally.
8180         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Remove warning about omissions
8181         when vsnprintf not available.
8182
8183 2001-10-24  Kevin Ryde  <kevin@swox.se>
8184
8185         * configure, aclocal.m4: Regenerate with a libtool patch for a stray
8186         quote in AC_LIBTOOL_PROG_LD_SHLIBS under mingw and cygwin.
8187
8188         * gmp-impl.h (modlimb_invert): More comments.
8189
8190         * printf/doprnt.c, printf/doprnti.c: Use the precision field to print
8191         leading zeros.
8192         * tests/printf/t-printf.c: Test this.
8193         * cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
8194
8195         * tune/speed.c, tune/speed.h, tune/common.c: Add mpn_mul_1_inplace.
8196
8197 2001-10-23  Torbjorn Granlund  <tege@swox.com>
8198
8199         * mpz/pprime_p.c (mpz_millerrabin): Remove function and its descendant.
8200
8201         * mpz/millerrabin.c: New file with code from pprime.c.
8202         * mpz/Makefile.am: Compile millerrabin.c.
8203         * Makefile.am (MPZ_OBJECTS): Ditto.
8204         * gmp-h.in: Declare mpz_millerrabin.
8205
8206 2001-10-22  Torbjorn Granlund  <tege@swox.com>
8207
8208         * tests/mpz/t-perfsqr.c: New file.
8209         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
8210
8211         * demos/factorize.c (factor): Check for number to factor == 0.
8212         (main): When invoked without arguments, read from stdin.
8213
8214         * mpz/perfpow.c: Add code to handle negative perfect powers ((-b)^odd).
8215         Treat 0 and 1 as perfect powers.
8216
8217         * mpn/sparc32/v9/sqr_diagonal.asm: Jump past .align.
8218
8219 2001-10-21  Torbjorn Granlund  <tege@swox.com>
8220
8221         * mpn/generic/perfsqr.c (sq_res_0x100): Remove bogus final `,'.
8222         (mpn_perfect_square_p): Suppress superfluous `&1' in sq_res_0x100 test.
8223         (mpn_perfect_square_p, O(n) test): Improve comments.  Combine remainder
8224         tests for some small primes.  Don't share code for different limb
8225         sizes.  Use single `if' with many `||' for better code density.
8226
8227 2001-10-22  Kevin Ryde  <kevin@swox.se>
8228
8229         * demos/perl/GMP.xs (mutate_mpz, tmp_mpf_grow): Make these "static".
8230
8231         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm
8232         (mpn_popcount_table): Use GSYM_PREFIX.
8233
8234 2001-10-19  Kevin Ryde  <kevin@swox.se>
8235
8236         * mpn/x86/*.asm: Add some measured speeds on various x86s.
8237
8238         * tests/mpz/reuse.c, tests/mpf/reuse.c: Disable tests when using a
8239         windows DLL, because certain global variable usages won't compile.
8240
8241         * configure.in (AC_CHECK_FUNCS): Add alarm.
8242         * tests/spinner.c: Conditionalize alarm and SIGALRM availability, for
8243         the benefit of mingw32.
8244
8245         * acinclude.m4 (GMP_ASM_TYPE, GMP_ASM_SIZE): Suppress .type and .size
8246         on COFF.
8247
8248         * acinclude.m4 (GMP_PROG_HOST_CC): New macro.
8249         * configure.in: Use it for windows DLL cross-compiles.
8250         * aclocal.m4, configure: Regenerate with libtool patch to hold HOST_CC
8251         in the generated libtool script.
8252
8253         * aclocal.m4, configure: Regenerate with libtool patch to suppress
8254         warnings when probing command line limit on FreeBSD.
8255
8256         * demos/qcn.c (M_PI): Define if not already provided, helps mingw32.
8257
8258 2001-10-17  Kevin Ryde  <kevin@swox.se>
8259
8260         * printf/doprnt.c: Use <stdint.h> for intmax_t.
8261
8262         * longlong.h: Recognise __sparcv8 for gcc on Solaris.  Reported by
8263         Mark Mentovai <mark@mentovai.com>.
8264
8265         * gmp-impl.h (gmp_allocated_string): No need for inline on member funs.
8266
8267 2001-10-16  Kevin Ryde  <kevin@swox.se>
8268
8269         * gmp.texi (Debugging): Add mpatrol.
8270         (Integer Comparisons, Comparing Rationals, Float Comparison): Index
8271         entries for sign tests.
8272         (I/O of Floats): Clarify mpf_out_str exponent is in decimal.
8273         (C++ Formatted Output): mpf_t operator<< exponent now in decimal.
8274         (FFT Multiplication): Use an ascii art sigma.
8275         (Contributors): Add Gerardo Ballabio.
8276
8277         * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Always give mpf_t
8278         exponent in decimal, irrespective of ios::hex or ios::oct.
8279         * tests/cxx/t-ostream.cc (check_mpf): Update.
8280
8281         * printf/doprnt.c: Support %lln and %hhn.
8282
8283         * mpn/x86/pentium4/sse2/submul_1.asm: Use a psubq to negate the
8284         initial carry (helps the submul_1c case), and improve the comments.
8285
8286 2001-10-11  Kevin Ryde  <kevin@swox.se>
8287
8288         * acinclude.m4, configure.in (GMP_IMPL_H_IEEE_FLOATS): New macro.
8289
8290         * ltmain.sh: Send some rm errors to /dev/null, helps during compiles
8291         on Solaris 2.7 and HP-UX 10.
8292
8293         * tal-notreent.c: Renamed from stack-alloc.c.
8294         * Makefile.am, acinclude.m4, gmp-impl.h: Update.
8295
8296         * gmp-h.in: Don't give both prototypes and inlines, except on gcc.
8297
8298         * gmp-h.in, gmp-impl.h: Use #includes to get necessary standard
8299         classes, add std:: to prototypes.
8300         * cxx/*.cc, tests/cxx/t-ostream.cc: Add "use namespace std".
8301         * acinclude.m4 (GMP_PROG_CXX_WORKS): Ditto.
8302
8303         * tests/*/Makefile.in, mpfr/tests/Makefile.in: Regenerate with
8304         automake patch to avoid Ultrix problem with empty $(TESTS).
8305
8306         * */Makefile.in: Regenerate with automake patch to only rm *_.c in
8307         "make clean" when ansi2knr actually in use, helps DOS 8.3.
8308
8309         * Makefile.in: Regenerate with automake patch to fix stamp-h
8310         numbering, avoiding an unnecessary config.status run.
8311
8312 2001-10-09  Torbjorn Granlund  <tege@swox.com>
8313
8314         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Use L macros for labels.
8315         Quote L reloc operator.
8316
8317         * gmp-impl.h: Declare class string.
8318
8319         * mpn/asm-defs.m4 (INT32, INT64): Quote $1 to prevent further
8320         expansion.
8321
8322         * mpn/alpha/ev6/mul_1.asm: New file.
8323
8324 2001-10-09  Kevin Ryde  <kevin@swox.se>
8325
8326         * gmp.texi (Introduction to GMP): Add pentium 4 to optimized CPUs.
8327         (Build Options): Note macos directory.
8328         (Notes for Package Builds): GMP 4 series binary compatible with 3.
8329         (Known Build Problems): Remove $* and ansi2knr note, now fixed, except
8330         possibly under --host=none.
8331         (Formatted Output Strings): Remove -1 prec for all digits.
8332
8333         * mpz/add.c, mpz/sub.c: Don't use mpz path on #include (helps macos).
8334         * mpbsd/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpz.
8335
8336         * printf/doprnt.c, tests/printf/t-printf.c: Remove support for %.*Fe
8337         prec -1 meaning all digits.
8338
8339         * acinclude.m4 (GMP_PROG_AR): Override libtool, use AR_FLAGS="cq".
8340         (GMP_HPC_HPPA_2_0): Print version string to config.log.
8341
8342         * Makefile.am (AUTOMAKE_OPTIONS): Remove check-news (permission notice
8343         in NEWS file is too big).
8344         (dist-hook): Don't distribute numbered or unnumbered emacs backups.
8345
8346         * Makefile.am, cxx/Makefile.am: Updates for Gerardo's stuff.
8347
8348 2001-10-09  Gerardo Ballabio  <ballabio@sissa.it>
8349
8350         * cxx/isfuns.cc: New file.
8351         * gmp-impl.h: Add prototypes.
8352         * cxx/ismpf.cc, cxx/ismpq.cc, cxx/ismpz.cc: New files.
8353         * gmp-h.in: Add prototypes.
8354         * gmpxx.h, mpfrxx.h: New files.
8355
8356 2001-10-08  Kevin Ryde  <kevin@swox.se>
8357
8358         * configure.in (with_tags): Establish a default based on --enable-cxx.
8359
8360         * aclocal.m4: Regenerate with libtool patches for sed char range to
8361         help Cray, LTCC quotes and +Z warnings grep to help HP-UX.
8362
8363         * gmp-impl.h (doprnt_format_t, doprnt_memory_t, doprnt_reps_t,
8364         doprnt_final_t): Use _PROTO.
8365
8366 2001-10-05  Torbjorn Granlund  <tege@swox.com>
8367
8368         * mpn/asm-defs.m4 (INT32, INT64): Use LABEL_SUFFIX.
8369
8370         * mpn/hppa: Convert files to `.asm'.
8371
8372 2001-10-05  Kevin Ryde  <kevin@swox.se>
8373
8374         * mpn/Makeasm.am (.S files): Revert to separate CPP and CCAS, use
8375         cpp-ccas, and only pass CPPFLAGS to CPP, not whole CFLAGS.
8376         * mpn/cpp-ccas: New file.
8377         * mpn/Makefile.am (EXTRA_DIST): Add it.
8378
8379         * tune/common.c, tune/speed.h: Change SPEED_ROUTINE_MPN_COPY_CALL uses
8380         to SPEED_ROUTINE_MPN_COPY or new SPEED_ROUTINE_MPN_COPY_BYTES.  Avoids
8381         macro expansion problems on Cray.
8382
8383         * configure.in (AC_PROG_CXXCPP): Add this, to make libtool happier.
8384
8385 2001-10-04  Torbjorn Granlund  <tege@swox.com>
8386
8387         * mpz/rrandomb.c (gmp_rrandomb): Change bit_pos to be 0-based (was
8388         1-based); shift 2 (was 1) when making bit mask.  These two changes
8389         avoid undefined shift counts.
8390         (gmp_rrandomb): Avoid most calls to _gmp_rand by caching random values.
8391
8392         * mpn/generic/random2.c: Changes for mirroring mpz/rrandomb.c.
8393
8394 2001-10-04  Kevin Ryde  <kevin@swox.se>
8395
8396         * gmp.texi (Build Options): Add --enable-cxx.
8397         (Notes for Particular Systems): Mention pentium4 performance and SSE2.
8398         (Known Build Problems): Remove vax jsobgtr note, no longer needed.
8399         (Converting Floats): Tweak mpf_get_str description.
8400         (Low-level Functions): Correction to mpn_gcdext destination space
8401         requirements.
8402         (C++ Formatted Output): New section.
8403         (Language Bindings): Add ALP
8404         (Contributors): Add Paul Zimmermann's square root, update my things.
8405
8406         * acinclude.m4 (GMP_PROG_CC_IS_GNU, GMP_PROG_CXX_WORKS): Send compiler
8407         errors to config.log.
8408
8409         * mpq/Makefile.am (INCLUDES): Remove -DOPERATION_$*, not needed.
8410
8411         * mpn/x86/*.asm: Change references to old README.family to just README.
8412
8413         * mpz/README: Remove file, now adequately covered in the manual.
8414
8415 2001-10-03  Torbjorn Granlund  <tege@swox.com>
8416
8417         * mpn/x86/pentium4/copyi.asm: New file.
8418         * mpn/x86/pentium4/copyd.asm: New file.
8419
8420         * gmp-impl.h: Implement separate MPN_COPY_INCR and MPN_COPY_DECR
8421         macros for CRAY systems.
8422         (CRAY _MPN_COPY): Delete.
8423
8424 2001-10-02  Kevin Ryde  <kevin@swox.se>
8425
8426         * tests/mpz/t-popcount.c (check_data): Use "~ (unsigned long) 0" to
8427         avoid compiler warnings on sco.
8428
8429         * mpbsd/Makefile.am: Compile mpz files directly, no copying.
8430         Use mpz/add.c and mpz/sub.c rather than mpz/aors.c.
8431         (INCLUDES): Remove -DOPERATION_$*, no longer needed (by mpz).
8432
8433         * mpz/aors.h: Renamed from mpz/aors.c.
8434         * mpz/add.c, mpz/sub.c: New files, using mpz/aors.h.
8435         * mpz/aors_ui.h: Renamed from mpz/aors_ui.c.
8436         * mpz/add_ui.c, mpz/sub_ui.c: New files, using mpz/aors_ui.h.
8437         * mpz/fits_s.h: Renamed and adapted from mpz/fits_s.c.
8438         * mpz/fits_sshort.c, mpz/fits_sint.c, mpz/fits_slong.c: New files.
8439         * mpz/mul_i.h: Renamed from mpz/mul_siui.c.
8440         * mpz/mul_ui.c, mpz/mul_ui.c: New files, using mpz/mul_i.h.
8441         * mpz/Makefile.am: Consequent updates.
8442         (INCLUDES): Remove -DOPERATION_$*.
8443
8444         * mpf/fits_s.h: Renamed and adapted from mpf/fits_s.c.
8445         * mpf/fits_sshort.c, mpf/fits_sint.c, mpf/fits_slong.c: New files.
8446         * mpf/fits_u.h: Renamed and adapted from mpf/fits_u.c.
8447         * mpf/fits_ushort.c, mpf/fits_uint.c, mpf/fits_ulong.c: New files.
8448         * mpf/Makefile.am: Consequent updates.
8449         (INCLUDES): Remove -DOPERATION_$*.
8450
8451         * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Don't use ios::hex etc
8452         as cases in a switch, they're not constant in g++ 3.0.
8453
8454         * mpn/Makeasm.am (.s.o, .s.obj, .S.o, .S.obj, .asm.o, .asm.obj):
8455         Locate source file with test -f the same as automake.
8456         (.S): Let CCAS do the preprocessing, and run libtool for .S.lo.
8457         (.asm.lo): Run libtool via m4-ccas to get new style foo.lo right.
8458         (COMPILE_FLAGS): Add $(DEFAULT_INCLUDES), per new automake.
8459         * mpn/m4-ccas: New file.
8460         * mpn/Makefile.am (EXTRA_DIST): Add it.
8461         * mpn/asm-defs.m4: Add m4_not_for_expansion(`DLL_EXPORT').
8462         * mpn/x86/x86-defs.m4: Undefine PIC if DLL_EXPORT is set.
8463         * configure.in (CFLAGS_PIC, ASMFLAGS_PIC): Remove, no longer needed.
8464
8465         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Warn what's omitted when
8466         vsnprintf not available.
8467
8468         * mpn/underscore.h: Remove file, not used since m68k converted to asm.
8469         * mpn/Makefile.am (EXTRA_DIST): Remove it.
8470
8471         * tests/refmpz.c: Add <stdlib.h>, for free().
8472
8473 2001-10-01  Torbjorn Granlund  <tege@swox.com>
8474
8475         * mpn/x86/pentium4/sse2/submul_1.asm: Apply some algebraic
8476         simplifications.
8477         * mpn/x86/pentium4/sse2/addmul_1.asm: Comment.
8478
8479 2001-10-01  Kevin Ryde  <kevin@swox.se>
8480
8481         * configure.in (--enable-cxx): New option for C++ support.
8482         Add cxx and tests/cxx subdirectories.
8483         * ltmain.sh, aclocal.m4: Update to libtool 2001-09-30.
8484
8485         * cxx/Makefile.am, cxx/Makefile.in, cxx/osdoprnti.cc, cxx/osfuns.cc,
8486         cxx/osmpf.cc, cxx/osmpq.cc, cxx/osmpz.cc: New files.
8487         * Makefile.am: Add them, in new libgmpxx.
8488         * gmp-h.in, gmp-impl.h: Prototypes and support.
8489         * tests/cxx/Makefile.am, tests/cxx/Makefile.in,
8490         tests/cxx/t-ostream.cc: New files.
8491
8492         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL,
8493         SPEED_ROUTINE_MPN_GCDEXT_ONE): mpn_gcdext needs size+1 for
8494         destinations.  Found by Torbjorn.
8495
8496         * gmp-h.in (__GNU_MP__, __GNU_MP_VERSION): Bump to 4.0.
8497         * mp-h.in (__GNU_MP__): Ditto.
8498         * gmp.texi, Makefile.am, compat.c: Amend version 3.2 to 4.0.
8499
8500         * acinclude.m4 (GMP_PROG_CXX_WORKS): New macro.
8501         (GMP_PROG_CC_WORKS): Write "conftest" test program, not a.out.
8502
8503         * gmp-impl.h (struct gmp_asprintf_t): Moved from printf/vasprintf.c.
8504         (GMP_ASPRINTF_T_INIT): New macro.
8505         (GMP_ASPRINTF_T_NEED): New macro, adapted from vasprintf.c NEED().
8506         * printf/vasprintf.c: Use these.
8507
8508         * printf/asprntffuns.c: New file.
8509         * printf/Makefile.am, Makefile.am: Add it.
8510         * printf/asprntffuns.c, printf/vasprintf.c, gmp-impl.h
8511         (__gmp_asprintf_memory, __gmp_asprintf_reps, __gmp_asprintf_final):
8512         Move to asprntffuns.c, rename to __gmp and make global, remove
8513         spurious formal parameters from __gmp_asprintf_final.
8514
8515         * configure.in (j90-*-*, sv1-*-*): Don't duplicate $path in $add_path.
8516         (*-*-mingw*): Don't assemble with -DPIC (as per cygwin).
8517
8518         * printf/snprntffuns.c (gmp_snprintf_final): Remove spurious formal
8519         parameters.
8520
8521         * tune/tuneup.c (POWM_THRESHOLD): Reduce stop_factor to 1.1 to help
8522         Cray vector systems.
8523
8524         * tests/misc.c (tests_rand_start): Print GMP_CHECK_RANDOMIZE=NN to
8525         facilitate cut and paste when re-running.
8526         * tests/mpz/t-inp_str.c (check_data): Add more diagnostic prints.
8527
8528 2001-09-30  Kent Boortz  <kent@swox.com>
8529
8530         * macos/configure, macos/Makefile.in, macos/README: Updates for gmp 4.
8531         * gmp-h.in (_GMP_H_HAVE_FILE): Recognise Apple MPW.
8532
8533 2001-09-30  Torbjorn Granlund  <tege@swox.com>
8534
8535         * mpn/cray/ieee/submul_1.c: Rewrite.  Streamline multiplications;
8536         use `majority' logic.
8537
8538 2001-09-27  Torbjorn Granlund  <tege@swox.com>
8539
8540         * gmp-h.in (__GMPN_AORS_1): Rewrite to work around Cray compiler bug.
8541
8542 2001-09-26  Torbjorn Granlund  <tege@swox.com>
8543
8544         * mpn/x86/pentium4/sse2/gmp-mparam.h: New file.
8545
8546 2001-09-26  Kevin Ryde  <kevin@swox.se>
8547
8548         * mpn/x86/pentium4/sse2/dive_1.asm: New file.
8549         * mpn/x86/pentium4/sse2/submul_1.asm: New file.
8550         * mpn/x86/pentium4/sse2/sqr_basecase.asm: New file.
8551
8552         * mpn/x86/pentium/copyi.asm: New file, based on past work by Torbjorn.
8553         * mpn/x86/pentium/copyi.asm: New file, ditto.
8554         * mpn/x86/pentium/com_n.asm: Rewrite, ditto.
8555
8556         * printf/snprntffuns.c (gmp_snprintf_format): Copy va_list in case
8557         vsnprintf trashes it.
8558         * printf/vasprintf.c (gmp_asprintf_format): Ditto.
8559         * gmp-impl.h, doprnt.c (va_copy): Move to gmp-impl.h.
8560
8561         * tests/mpz/t-cmp_d.c (check_low_z_one): Patch by Torbjorn for vax
8562         limited float range.
8563
8564 2001-09-23  Torbjorn Granlund  <tege@swox.com>
8565
8566         * mpn/vax/lshift.s: Change `jsob*' to `sob*'.
8567         * mpn/vax/rshift.s: Likewise.
8568
8569 2001-09-23  Kevin Ryde  <kevin@swox.se>
8570
8571         * mpn/x86/pentium4/sse2/mul_basecase.asm: Some simple but real code.
8572
8573         * printf/doprnt.c: Use va_copy for va_list variables, copy function
8574         parameter in case it's call-by-reference.
8575
8576         * tune/freq.c (speed_cpu_frequency_bsd_dmesg): New function.
8577         (speed_cpu_frequency_table): Use it.
8578
8579         * tune/many.pl (popcount, hamdist): Fix declared return value.
8580         (sb_divrem_mn): Remove a spurious duplicate entry.
8581         (CLEAN): Add tmp-$objbase.c when using that for .h files.
8582         (macro_speed): Give a default for .h files.
8583         Add ATTRIBUTE_CONST or __GMP_ATTRIBUTE_PURE as appropriate.
8584
8585         * tune/speed.h (SPEED_ROUTINE_MPN_MOD_CALL,
8586         SPEED_ROUTINE_MPN_PREINV_MOD_1, SPEED_ROUTINE_MPN_POPCOUNT,
8587         SPEED_ROUTINE_MPN_HAMDIST, SPEED_ROUTINE_MPN_GCD_1N,
8588         SPEED_ROUTINE_MPN_GCD_1_CALL, SPEED_ROUTINE_MPZ_JACOBI): Use return
8589         values so gcc 3 won't discard calls to pure or const functions.
8590         (mpn_mod_1_div, mpn_mod_1_inv): Add __GMP_ATTRIBUTE_PURE.
8591
8592 2001-09-22  Torbjorn Granlund  <tege@swox.com>
8593
8594         * mpn/x86/pentium4/sse2/mul_basecase.asm: New file, placeholder
8595         for real code, hiding the default x86 mul_basecase.asm.
8596
8597 2001-09-22  Kevin Ryde  <kevin@swox.se>
8598
8599         * configure.in (AC_PREREQ): Bump to 2.52.
8600         (m4_pattern_forbid, m4_pattern_allow): New calls, forbid GMP_.
8601         (AC_CHECK_HEADERS): Remove sys/types.h, already done by autoconf.
8602         * acinclude.m4, configure.in (GMP_GCC_NO_CPP_PRECOMP): New macro.
8603
8604         * tests/devel/try.c (TYPE_PREINV_MOD_1): Don't run size==0.
8605         (malloc_region): Need fd=-1 for mmap MAP_ANON on BSD.
8606
8607 2001-09-20  Torbjorn Granlund  <tege@swox.com>
8608
8609         * mpz/cong.c (mpz_congruent_p): Fix one-limb c<d test.
8610
8611         * longlong.h: Rewrite __i370__ smul_ppmm; enable also for __s390__.
8612
8613         * configure.in: Add support for IBM 360, 370, 390 families.
8614
8615 2001-09-20  Kevin Ryde  <kevin@swox.se>
8616
8617         * mpn/x86/pentium4/sse2/diveby3.asm: New file.
8618         * mpn/x86/pentium4/sse2/mode1o.asm: New file.
8619
8620 2001-09-16  Kevin Ryde  <kevin@swox.se>
8621
8622         * printf/doprnt.c: '#' means showpoint and showtrailing for %e, %f, %g.
8623         * tests/printf/t-printf.c (check_f): More test cases.
8624
8625 2001-09-15  Torbjorn Granlund  <tege@swox.com>
8626
8627         * gmp-h.in (__GMPN_AORS_1): Remove param TEST, add OP and CB.
8628         Postpone zeroing of (cout).
8629         (__GMPN_ADD_1, __GMPN_SUB_1): Corresponding changes.
8630
8631 2001-09-14  Kevin Ryde  <kevin@swox.se>
8632
8633         * ChangeLog: Merge in tests/rand/ChangeLog.
8634         * tests/rand/ChangeLog: Remove file.
8635
8636         * printf/doprnt.c: Fix handling of a plain format after a GMP one; no
8637         need to protect against negative precision internally.
8638         * tests/printf/t-printf.c (check_misc): More checks.
8639
8640 2001-09-12  Torbjorn Granlund  <tege@swox.com>
8641
8642         * mpn/cray/ieee/invert_limb.c: Add a PROLOGUE in a comment to have
8643         HAVE_NATIVE_... defined.
8644
8645 2001-09-11  Kevin Ryde  <kevin@swox.se>
8646
8647         * configure.in, gmp-h.in (__GMP_HAVE_HOST_CPU_FAMILY_power,
8648         __GMP_HAVE_HOST_CPU_FAMILY_powerpc): New AC_SUBSTs.
8649         * gmp-h.in (__GMPN_COPY_INCR): Use them to select the power/powerpc
8650         code, rather than preprocessor defines.
8651
8652         * acinclude.m4, configure.in (GMP_H_ANSI): New macro.
8653
8654         * gmp-h.in (__GMP_EXTERN_INLINE): Add a definition for SCO 8 cc.
8655
8656         * gmp-h.in, version.c (gmp_version): Make the pointer "const" as well
8657         as the string.
8658
8659         * acinclude.m4, configure.in (GMP_PROG_CC_IS_XLC): Recognise xlc when
8660         invoked under another name (cc, xlc128, etc).
8661         * acinclude.m4 (GMP_PROG_CC_IS_GCC): Print a message when recognised.
8662
8663 2001-09-11  Torbjorn Granlund  <tege@swox.com>
8664
8665         * gmp-h.in: Let __DECC mean __GMP_HAVE_CONST, etc.
8666         * mp-h.in: Likewise.
8667
8668 2001-09-10  Torbjorn Granlund  <tege@swox.com>
8669
8670         * mpn/x86/pentium4/mmx/lshift.asm: New file.
8671         * mpn/x86/pentium4/mmx/rshift.asm: New file.
8672
8673         * tests/mpn/t-iord_u.c (check_incr_data): Work around HP compiler bug.
8674         (check_decr_data): Likewise.
8675
8676 2001-09-08  Kevin Ryde  <kevin@swox.se>
8677
8678         * gmp.texi (Integer Logic and Bit Fiddling): Update mpz_hamdist
8679         behaviour, clarify mpz_popcount a touch.
8680         (Language Bindings): Add mlton, fix alphabetical order.
8681         (Single Limb Division): Describe 2 or 1/2 limbs at a time style.
8682
8683         * configure.in (AC_CHECK_FUNCS): Add mmap.
8684         * tests/devel/try.c (malloc_region): Use mmap if available.
8685
8686         * tests/refmpz.c, tests/tests.h (refmpz_hamdist): New function.
8687         * tests/mpz/t-hamdist.c: New file.
8688         * tests/mpz/Makefile.am: Add it.
8689
8690         * mpz/hamdist.c: Support neg/neg operands.
8691
8692         * macos/Makefile.in: Remove dual compile of mpq/aors.c and
8693         mpn/generic/popham.c.
8694
8695         * gmp-impl.h (popc_limb): New macro, adapted from mpn/generic/popham.c.
8696         For 64-bits reuse 0x33...33 constant.
8697         * mpn/generic/popcount.c, mpn/generic/hamdist.c: Split from popham.c,
8698         use popc_limb macro, remove unused "i", don't bother with "register"
8699         qualifiers.
8700         * mpn/generic/popham.c: Remove file.
8701
8702         * ltmain.sh, configure, aclocal.m4: Update to libtool 1.4.1, with one
8703         ltdll.c generation patch.
8704         * doc/configuration: Misc updates, note libtool patch used.
8705
8706         * mpn/x86/pentium4/sse2/mul_1.asm: Use pointer increments not indexed
8707         addressing, to get 4.0 c/l flat.
8708
8709         * tests/mpq/t-cmp_si.c (check_data): Use ULONG_MAX for denominators.
8710
8711         * tests/misc.c (mpz_negrandom): Use given rstate, not RANDS.
8712
8713 2001-09-07  Torbjorn Granlund  <tege@swox.com>
8714
8715         * mpn/x86/pentium4/sse2/addmul_1.asm: New file.
8716
8717 2001-09-04  Kevin Ryde  <kevin@swox.se>
8718
8719         * tune/freq.c: Define a HAVE for each speed_cpu_frequency routine to
8720         avoid duplicating conditionals.
8721         (speed_cpu_frequency_sco_etchw): New function.
8722         (speed_cpu_frequency_table): Use it.
8723         * tune/README: Mention SCO openunix 8 /etc/hw.
8724
8725         * mpz/fib_ui.c: Use ?: to avoid a gcc 3 bug on powerpc64.
8726         Store back a carry for limb<long.
8727
8728         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/k7/mmx/mod_1.asm,
8729         mpn/x86/p6/mmx/divrem_1.asm: Fix a couple of comments.
8730
8731         * config.guess: Give m68020 for 68020 or better, not m68k.
8732         * configfsf.guess: Update to 2001-09-04.
8733
8734 2001-09-02  Kevin Ryde  <kevin@swox.se>
8735
8736         * configure.in (m68k-*-*): Let m68k mean 68000, not 68020.
8737         * gmp.texi (Notes for Particular Systems): Update.
8738
8739         * gmp-impl.h (union ieee_double_extract) [m68k]: Use longs, since int
8740         might be only 16 bits.
8741
8742         * tests/mpq/t-aors.c: New file.
8743         * tests/mpq/Makefile.am: Add it.
8744
8745         * tests/refmpq.c: New file.
8746         * tests/Makefile.am: Add it.
8747         * tests/tests.h: Add prototypes.
8748
8749         * mpq/aors.c: Share object code for mpq_add and mpq_sub.
8750         * Makefile.am, mpq/Makefile.am: Single mpq/aors.lo now.
8751
8752         * tests/devel/try.c (TYPE_SUBMUL_1): Use correct reference routine.
8753
8754 2001-08-30  Kevin Ryde  <kevin@swox.se>
8755
8756         * mpn/x86/x86-defs.m4 (cmov_available_p): Add pentium4.
8757
8758         * gmp-h.in: Put #define renamings with prototypes.
8759         Remove commented out #defines of gmp-impl.h things.
8760         (mpn_invert_limb): Remove #define, already in gmp-impl.h.
8761         (mpn_lshiftc, mpn_rshiftc): Remove #defines, unused.
8762         (mpn_addsub_nc): Add prototype to #define.
8763
8764 2001-08-28  Kevin Ryde  <kevin@swox.se>
8765
8766         * gmp.texi: Switch to GFDL.
8767         (Top): Arrange copyright and conditions to appear here too.  For
8768         clarity have all this before the miscellaneous macro definitions.
8769         (Copying): Refer to COPYING.LIB file, mention plain GPL2 in demo
8770         programs.
8771         (Contributors, References): Use @appendix rather than @unnumbered.
8772         (GNU Free Documentation License): New appendix.
8773         (@contents): Move to start of document, use only for tex (not html).
8774         (Debugging): Add leakbug.
8775         (Build Options): Add pentium4.
8776         (I/O of Rationals): Add mpq_inp_str.
8777
8778         * fdl.texi: New file, with two @appendix directive tweaks.
8779         * Makefile.am (gmp_TEXINFOS): Add it.
8780
8781         * tests/mpz/io.c: Check mpz_inp_str return against ftell, send error
8782         messages just to stdout.
8783
8784         * mpz/inp_str.c, gmp-impl.h (__gmpz_inp_str_nowhite): New function,
8785         and share a __gmp_free_func call.
8786         * mpq/inp_str.c: New file.
8787         * Makefile.am, mpq/Makefile.am: Add it.
8788         * tests/mpq/t-inp_str.c: New file.
8789         * tests/mpq/Makefile.am (check_PROGRAMS): Add it.
8790
8791         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_power,
8792         HAVE_HOST_CPU_FAMILY_powerpc, HAVE_HOST_CPU_FAMILY_x86): AC_DEFINEs
8793         for processor families.
8794         * gmp-impl.h: Use them, rather than cpp defines.
8795
8796         * demos/Makefile.am (primes_LDADD): Use $(LIBM), for log().
8797
8798         * tune/many.pl, tune/Makefile.am: Fix some from clean and distclean.
8799
8800 2001-08-26  Kevin Ryde  <kevin@swox.se>
8801
8802         * tests/devel/try.c (ARRAY_ITERATION): Make types match on "?:" legs.
8803         (TYPE_MPZ_JACOBI, TYPE_MPZ_KRONECKER): Remove some superseded code.
8804
8805         * tests/printf/t-printf.c (check_plain): Don't compare "all digits"
8806         precision against plain printf.
8807
8808         * tune/Makefile.am: Eliminate empty TUNE_MPZ_SRCS.
8809
8810         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.52.
8811         * */Makefile.in, mdate-sh, missing, aclocal.m4, configure: Update to
8812         automake 1.5.
8813         * configfsf.guess, configfsf.sub: Update to 2001-08-23.
8814
8815 2001-08-24  Torbjorn Granlund  <tege@swox.com>
8816
8817         * demos/primes.c: Complete rewrite.
8818
8819 2001-08-24  Kevin Ryde  <kevin@swox.se>
8820
8821         * longlong.h: Test __ppc__ for apple darwin cc, reported by Jon
8822         Becker.  Also test __POWERPC__, PPC and __vxworks__.
8823
8824         * tune/speed.h (speed_cyclecounter) [x86]: Don't clobber ebx in PIC.
8825
8826 2001-08-22  Kevin Ryde  <kevin@swox.se>
8827
8828         * configure.in (x86 mmx): Correction to mmx path stripping.
8829
8830 2001-08-17  Kevin Ryde  <kevin@swox.se>
8831
8832         * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am,
8833         tests/printf/Makefile.am, gmp-h.in, gmp-impl.h, gmp.texi: Remove C++
8834         support, for the time being.
8835         * printf/doprntfx.cc, doprntix.cc, osfuns.cc, osmpf.cc, osmpq.cc,
8836         osmpz.cc, tests/printf/t-ostream.cc: Remove files.
8837
8838         * printf/doprnt.c, printf/doprntf.c, gmp-impl.h: Use a single
8839         __gmp_doprnt_mpf, rather than a separate ndigits calculation.
8840         * printf/doprnt.c, printf/doprntf.c, gmp-impl.h, gmp.texi,
8841         tests/printf/t-printf.c: Let empty or -1 prec mean all digits for mpf.
8842         * printf/doprnt.c, tests/printf/t-printf.c: Accept h or l in %n; let
8843         negative "*" style width mean left justify.
8844
8845         * gmp-impl.h, mpf/get_str.c (MPF_SIGNIFICANT_DIGITS): New macro,
8846         extracted from mpf/get_str.c.
8847
8848         * libmp.sym: New file.
8849         * Makefile.am (libmp_la_LDFLAGS): Use it.
8850         (DISTCLEANFILES): Remove asm-syntax.h, no longer generated.
8851         Remove some comments about "make check".
8852
8853         * demos/perl/GMP.pm, GMP.xs, GMP/Mpf.pm: Add printf and sprintf,
8854         change get_str to string/exponent for floats, remove separate
8855         mpf_get_str.
8856         * demos/perl/GMP/Mpf.pm (overload_string): Use $# (default "%.g").
8857         * demos/perl/typemap: Fix some duplicate string entries.
8858         * demos/perl/test.pl: Update tests, split overloaded constants into ...
8859         * demos/perl/test2.pl: ... this new file.
8860         * demos/perl/Makefile.PL (clean): Add test.tmp.
8861
8862 2001-08-16  Kevin Ryde  <kevin@swox.se>
8863
8864         * printf/snprntffuns.c (gmp_snprintf_format): Correction to bufsize-1
8865         return value handling.
8866
8867         * demos/calc/calc.y: Reposition "%{" so copyright notice gets into
8868         generated files.
8869
8870         * INSTALL: Use gmp_printf.
8871
8872 2001-08-14  Kevin Ryde  <kevin@swox.se>
8873
8874         * mpz/inp_str.c: Fix return value (was 1 too big).
8875         * tests/mpz/t-inp_str.c: New file.
8876         * tests/mpz/Makefile.am: Add it.
8877
8878         * mpn/x86/pentium4/sse2/add_n.asm: New file.
8879         * mpn/x86/pentium4/sse2/sub_n.asm: New file.
8880         * mpn/x86/pentium4/sse2/mul_1.asm: New file.
8881
8882 2001-08-12  Kevin Ryde  <kevin@swox.se>
8883
8884         * printf/sprintffuns.c, printf/doprntf.c: Don't use sprintf return
8885         value (it's a pointer on SunOS 4).
8886
8887         * acinclude.m4 (GMP_ASM_X86_SSE2, GMP_STRIP_PATH): New macros.
8888         * configure.in: Add pentium4 support.
8889         * mpn/x86/pentium4, mpn/x86/pentium4/mmx, mpn/x86/pentium4/sse2: New
8890         directories.
8891         * mpn/x86/README: Update.
8892
8893 2001-08-10  Torbjorn Granlund  <tege@swox.com>
8894
8895         * demos/pexpr.c (setup_error_handler): Catch also SIGABRT.
8896
8897 2001-07-31  Kevin Ryde  <kevin@swox.se>
8898
8899         * tests/refmpn.c (refmpn_mul_1c): Allow low to high overlaps.
8900
8901         * gmp-h.in, gmp-impl.h (_gmp_rand): Move prototype to gmp-impl.h.
8902
8903         * tune/Makefile.am (EXTRA_DIST): Add many.pl.
8904
8905 2001-07-28  Kevin Ryde  <kevin@swox.se>
8906
8907         * gmp.texi (Random Number Functions): Old rand functions no longer use
8908         the C library.
8909
8910         * configure.in, acinclude.m4 (GMP_FUNC_VSNPRINTF): New macro.
8911
8912         * mpn/generic/get_str.c: Add an ASSERT for high limb non-zero.
8913
8914 2001-07-24  Kevin Ryde  <kevin@swox.se>
8915
8916         * gmp.texi (Build Options): Add --enable-cxx.
8917         (Converting Floats): Note mpf_get_str only generates accurately
8918         representable digits.
8919         (Low-level Functions): Note mpn_get_str requires non-zero high limb.
8920         (Formatted Output): New chapter.
8921         (Multiplication Algorithms): Use @quotation with @multitable.
8922         (Toom-Cook 3-Way Multiplication): Ditto.
8923
8924         * tests/memory.c (tests_free_nosize): New function.
8925         * tests/tests.h (tests_allocate etc): Add prototypes.
8926
8927         * tests/printf: New directory.
8928         * tests/printf/Makefile.am, t-printf.c, t-ostream.cc: New files.
8929         * configure.in, tests/Makefile.am: Add them.
8930
8931         * configure.in, acinclude.m4 (GMP_PROG_CXX): New macro.
8932         * configure.in (--enable-cxx): New option.
8933         (AC_CHECK_HEADERS): Add locale.h and sys/types.h, remove unistd.h.
8934         (AC_CHECK_TYPES): Add intmax_t, long double, long long, ptrdiff_t,
8935         quad_t.
8936         (AC_CHECK_FUNCS): Add localeconv, memset, obstack_vprintf, snprintf,
8937         strchr, vsnprintf.
8938         (AC_CHECK_DECLS): Add vfprintf.
8939
8940         * gmp-h.in, gmp-impl.h: Additions for gmp_printf etc.
8941
8942         * printf: New directory.
8943         * printf/Makefile.am, asprintf.c, doprnt.c, doprntf.c, doprntfx.cc,
8944         doprnti.c, doprntix.cc, fprintf.c, obprintf.c, obprntffuns.c,
8945         obvprintf.c, osfuns.cc, osmpf.cc, osmpq.cc, osmpz.cc, printf.c,
8946         printffuns.c, snprintf.c, snprntffuns.c, sprintf.c, sprintffuns.c,
8947         vasprintf.c, vfprintf.c, vprintf.c, vsnprintf.c, vsprintf.c: New
8948         files.
8949         * configure.in, Makefile.am: Add them.
8950
8951         * configure.in (HAVE_INLINE): Remove AC_DEFINE, unused.
8952         (AC_CHECK_TYPES): Don't test for void, assume it always exists.
8953
8954         * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE): New macro.
8955         * mpz/get_str.c, mpq/get_str.c, mpf/get_str.c: Use it.
8956
8957         * gmp-impl.h (mpn_fib2_ui): Use __MPN.
8958         (MPN_COPY_DECR): Fix an ASSERT.
8959         (CAST_TO_VOID): Remove macro.
8960
8961         * gmp-h.in (mpq_out_str): Give #define even without prototype.
8962         (mpz_cmp_d, mpz_cmpabs_d): Corrections to #defines.
8963
8964         * tests/devel/try.c: Add mpn_add and mpn_sub, don't use CAST_TO_VOID.
8965
8966 2001-07-23  Torbjorn Granlund  <tege@swox.com>
8967
8968         * config.guess: Recognize pentium4.
8969         * config.sub: Recognize pentium4.
8970
8971 2001-07-17  Kevin Ryde  <kevin@swox.se>
8972
8973         * gmp-h.in (__GMPN_AORS_1): Remove x86 and gcc versions, leave just
8974         one version.
8975         (__GMPN_ADD, __GMPN_SUB): New macros, rewrite of mpn_add and mpn_sub.
8976         (mpn_add, mpn_sub): Use them.
8977         (__GMPN_COPY_REST): New macro.
8978
8979         * gmp-h.in, gmp-impl.h, acinclude.m4: Remove __GMP_ASM_L and
8980         __GMP_LSYM_PREFIX, revert to ASM_L in gmp-impl.h and AC_DEFINE of
8981         LSYM_PREFIX.
8982
8983 2001-07-11  Kevin Ryde  <kevin@swox.se>
8984
8985         * gmp-h.in (__GMPN_ADD_1 etc) [x86]: Don't use this on egcs 2.91.
8986
8987         * mpz/fits_uint.c, fits_ulong.c, mpz/fits_ushort.c: Split up fits_u.c.
8988         * mpz/fits_u.c: Remove file.
8989         * mpz/Makefile.am, macos/Makefile.in: Update.
8990
8991         * tests/refmpn.c,tests.h (refmpn_copy): New function.
8992         * tests/devel/try.c (TYPE_ZERO): No return value from call.
8993         (TYPE_MODEXACT_1_ODD, TYPE_MODEXACT_1C_ODD): Share call with
8994         TYPE_MOD_1 and TYPE_MOD_1C.
8995         (MPN_COPY, __GMPN_COPY, __GMPN_COPY_INCR): Add testing.
8996
8997 2001-07-10  Kevin Ryde  <kevin@swox.se>
8998
8999         * gmp-h.in (__GMPN_COPY): Add form to help gcc on power and powerpc.
9000         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR, MPN_ZERO): Ditto.
9001         * mpn/powerpc64/copyi.asm, mpn/powerpc64/copyd.asm: Remove files.
9002
9003         * mpz/tdiv_ui.c: Eliminate some local variables (seems to save code on
9004         i386 gcc 2.95.x), remove a bogus comment about quotient.
9005
9006         * errno.c, gmp-impl.h (__gmp_exception, __gmp_divide_by_zero,
9007         __gmp_sqrt_of_negative): New functions.
9008         * gmp-impl.h (GMP_ERROR, DIVIDE_BY_ZERO, SQRT_OF_NEGATIVE): Use them.
9009
9010         * randclr.c, randraw.c: Use ASSERT(0) for unrecognised algorithms.
9011
9012 2001-07-07  Kevin Ryde  <kevin@swox.se>
9013
9014         * configure.in (powerpc*-*-*): Use -no-cpp-precomp for Darwin.
9015
9016         * tests/mpbsd/t-itom.c: Renamed from t-misc.c.
9017         * tests/mpbsd/t-misc.c: Remove file.
9018         * tests/mpbsd/Makefile.am: Update.
9019
9020         * tests/mpf/t-set_si.c,t-cmp_si.c,t-gsprec.c: Split from t-misc.c.
9021         * tests/mpf/t-misc.c: Remove file.
9022         * tests/mpf/Makefile.am: Update.
9023
9024         * tests/mpz/t-oddeven.c,t-set_si.c,t-cmp_si.c: Split from t-misc.c.
9025         * tests/mpz/t-misc.c: Remove file.
9026         * tests/mpz/Makefile.am: Update.
9027
9028         * stack-alloc.c: Add some alignment ASSERTs.
9029
9030         * gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
9031
9032         * tests/devel/try.c (MPN_ZERO): Add testing.
9033         * tune/speed.c,speed.h,common.c,many.pl (MPN_ZERO): Add measuring.
9034
9035         * mpn/x86/divrem_1.asm: Update a remark about gcc and "loop".
9036
9037         * tests/mpq/t-cmp_si.c: New file.
9038         * tests/mpq/Makefile.am: Add it.
9039
9040         * tests/misc.c,tests.h (mpq_set_str_or_abort): New function.
9041
9042         * mpq/cmp_si.c: New file.
9043         * Makefile.am, mpq/Makefile.am: Add it.
9044         * gmp-h.in (mpq_cmp_si): Add prototype.
9045         * gmp.texi (Comparing Rationals): Add doco.
9046
9047         * gmp-h.in (_GMP_H_HAVE_FILE): Add _FILE_DEFINED for microsoft, add
9048         notes on what symbols are for what systems.
9049
9050 2001-07-06  Torbjorn Granlund  <tege@swox.com>
9051
9052         * longlong.h (ibm032 umul_ppmm): Fix typo.
9053         * longlong.h (sparclite sdiv_qrnnd): Fix typo.
9054
9055 2001-07-03  Kevin Ryde  <kevin@swox.se>
9056
9057         * mpz/bin_ui.c (DIVIDE): Use MPN_DIVREM_OR_DIVEXACT_1.
9058         * mpz/bin_uiui.c (MULDIV): Ditto, and use local variables for size and
9059         pointer.
9060
9061         * acinclude.m4 (GMP_INCLUDE_GMP_H): New macro, use it everywhere gmp.h
9062         is wanted at configure time.
9063         * acinclude.m4, configure.in (GMP_H_EXTERN_INLINE, GMP_H_HAVE_FILE):
9064         New macros.
9065
9066         * gmp-h.in (__GMP_EXTERN_INLINE): Set to "inline" for C++.
9067         (mpn_add, mpn_sub): Use new style __GMP_EXTERN_INLINE.
9068         * gmp-h.in, mp-h.in, gmp-impl.h (_EXTERN_INLINE): Remove, unused.
9069         * mpn/generic/add.c, mpn/generic/sub.c: New files.
9070         * mpn/generic/inlines.c: Remove file.
9071         * configure.in, mpn/Makefile.am: Update.
9072
9073         * gmp.texi (GMP Basics): Note the need for stdio.h to get FILE
9074         prototypes.
9075
9076 2001-07-01  Kevin Ryde  <kevin@swox.se>
9077
9078         * gmp.texi (Build Options, Reentrancy): Updates for new
9079         --enable-alloca behaviour.
9080         (Debugging): Describe --enable-alloca=debug.
9081         (Miscellaneous Integer Functions): Note mpz_sizeinbase ignores signs.
9082         (Low-level Functions): Give a formula for mpn_gcdext cofactor.
9083         (Factorial Algorithm): New section.
9084         (Binomial Coefficients Algorithm): New section.
9085         Misc tweaks elsewhere.
9086
9087         * mpf/set_prc.c: Merge the two truncation conditionals, misc cleanups,
9088         no functional changes.
9089
9090         * mpn/*/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Add tuned values.
9091         * gmp-impl.h (DIVEXACT_1_THRESHOLD): Make the default 0 when
9092         2*UMUL_TIME < UDIV_TIME.
9093
9094         * mpn/x86/p6/dive_1.asm: New file.
9095
9096         * mpn/x86/dive_1.asm: New file.
9097         * mpn/x86/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Use it always.
9098
9099         * tests/refmpn.c, tests.h (refmpn_zero): New function.
9100         * tests/devel/try.c: Use it.
9101
9102         * tests/refmpn.c (refmpn_sb_divrem_mn): Use refmpn_cmp, not mpn_cmp.
9103
9104         * tests/mpf/t-get_d.c (main): Use || not |.
9105
9106         * tests/misc.c, tests/t-modlinv.c, tests/mpq/t-get_str.c,
9107         tests/mpf/reuse.c: Add string.h.
9108
9109 2001-06-29  Kevin Ryde  <kevin@swox.se>
9110
9111         * tune/speed.h (SPEED_ROUTINE_MPN_FIB2_UI,
9112         SPEED_ROUTINE_COUNT_ZEROS_C): Corrections to TMP block handling.
9113
9114         * gmp-impl.h (MPN_TOOM3_MUL_N_MINSIZE, MPN_TOOM3_SQR_N_MINSIZE):
9115         Corrections to these to account for adding tD into E.
9116         (MPN_INCR_U, MPN_DECR_U) [WANT_ASSERT]: Add size
9117         assertions, since mpn_add_1 and mpn_sub_1 from gmp.h don't get them.
9118         (MPN_DIVREM_OR_DIVEXACT_1): Add an assert of no remainder.
9119
9120         * assert.c: Add stdlib.h for abort prototype.
9121         * tests/spinner.c, trace.c, t-constants.c, t-count_zeros.c,
9122         t-gmpmax.c, t-modlinv.c: Ditto.
9123         * tests/mpz/t-bin.c, t-cmp.c, t-get_si.c, t-misc.c, t-popcount.c,
9124         t-set_str.c, t-sizeinbase.c: Ditto.
9125         * tests/mpq/t-equal.c, t-get_str.c, t-set_f.c, t-set_str.c: Ditto.
9126         * tests/mpf/t-fits.c, t-get_d.c, t-get_si.c, t-int_p.c, t-misc.c,
9127         t-trunc.c: Ditto.
9128         * tests/mpbsd/allfuns.c, t-misc.c: Ditto.
9129
9130         * mpn/generic/mul_n.c, mpz/cfdiv_r_2exp.c: Use MPN_INCR_U rather than
9131         mpn_incr_u.
9132
9133         * tests/devel/try.c (TYPE_SB_DIVREM_MN): More fixes for calling method.
9134
9135         * mpn/x86/k6/cross.pl: More insn exceptions.
9136
9137 2001-06-23  Kevin Ryde  <kevin@swox.se>
9138
9139         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1) [i386]: Fix some asm output
9140         constraints.
9141
9142         * gmp-impl.h (modlimb_invert): Mask after shifting, so mask constant
9143         fits a signed byte.
9144
9145         * tests/devel/try.c (TYPE_SB_DIVREM_MN): Fix initial fill of quotient
9146         with garbage.
9147
9148 2001-06-20  Kevin Ryde  <kevin@swox.se>
9149
9150         * config.guess (rs6000-*-aix4* | powerpc-*-aix4*): Suppress error
9151         messages if $CC_FOR_BUILD or program don't work.
9152
9153         * mpz/sqrt.c,sqrtrem.c: Special case for op==0, to avoid TMP_ALLOC(0).
9154         * tests/refmpf.c (refmpf_add, refmpf_sub): Avoid TMP_ALLOC(0).
9155
9156         * tests/mpn/t-aors_1.c: New file.
9157         * tests/mpn/Makefile.am: Add it.
9158
9159         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1): New macros, rewrite of
9160         mpn_add_1 and mpn_sub_1, better code for src==dst and/or n==1,
9161         separate versions for gcc x86, gcc generic, and non-gcc.
9162         (mpn_add_1, mpn_sub_1): Use them.
9163         (mpn_add, mpn_sub): Ditto, to get inlines on all compilers.
9164         (extern "C") [__cplusplus]: Let this encompass the extern inlines too.
9165         * mpn/generic/add_1.c,sub_1.c: New files, force code from gmp.h.
9166         * configure.in, mpn/Makefile.am: Add them.
9167
9168         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): AC_SUBST __GMP_LSYM_PREFIX
9169         rather than AC_DEFINE LSYM_PREFIX.
9170         * gmp-h.in (__GMP_LSYM_PREFIX): New substitution.
9171         (__GMP_ASM_L): New macro.
9172         * gmp-impl.h (ASM_L): Use it.
9173
9174         * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro.
9175         * gmp-impl.h: Use it for all the malloc based TMP_ALLOCs.
9176
9177         * stack-alloc.h: Remove file.
9178         * tal-reent.c: New file.
9179         * Makefile.am: Update.
9180
9181         * acinclude.m4, configure.in (GMP_OPTION_ALLOCA): New macro, add
9182         malloc-reentrant method, use stack-alloc.c as malloc-notreentrant,
9183         make "reentrant" the default.
9184         * gmp-impl.h (__TMP_ALIGN): Moved from stack-alloc.c, use a union to
9185         determine the value, and demand only 4 bytes align on 32-bit systems.
9186         * gmp-impl.h (WANT_TMP_NOTREENTRANT): Move global parts of
9187         stack-alloc.h to here, allow non power-of-2 __TMP_ALIGN in TMP_ALLOC.
9188         * gmp-impl.h: Extend extern "C" to TMP_ALLOC declarations.
9189         * stack-alloc.c (tmp_stack): Move private parts of stack-alloc.h to
9190         here, use gmp-impl.h.
9191
9192         * gmp-impl.h (TMP_ALLOC_LIMBS_2): New macro.
9193         * mpz/fib_ui.c, mpz/jacobi.c, mpq/cmp.c, mpn/generic/fib2_ui.c: Use it.
9194
9195         * mpfr/exp2.c: Patch by Paul to match TMP_MARK and TMP_FREE in loop.
9196         * mpfr/sqrt.c: Scope nested TMP_DECL into nested { } block, patch by
9197         Paul, tweaked by me.
9198         * mpfr/agm.c: Ditto, and add a final TMP_FREE(marker2).
9199
9200         * gmp-h.in (mpn_cmp): Add __GMP_ATTRIBUTE_PURE.
9201
9202         * INSTALL: Clarify "make install", tweak formatting a bit.
9203
9204 2001-06-17  Kevin Ryde  <kevin@swox.se>
9205
9206         * configure.in, Makefile.am, gmp-impl.h: Add a debugging TMP_ALLOC,
9207         selected with --enable-alloca=debug.
9208         * tal-debug.c: New file.
9209         * configure.in, Makefile.am: Compile stack-alloc.c only for
9210         --disable-alloca.
9211         * assert.c (__gmp_assert_header): New function, split from
9212         __gmp_assert_fail.
9213
9214         * mpz/lcm.c: Don't TMP_MARK and then just return. Remove unnecessary
9215         _mpz_realloc prototype.
9216
9217         * mpn/generic/mul.c (mpn_sqr_n): Use __gmp_allocate_func for toom3
9218         temporary workspace.
9219
9220 2001-06-15  Kevin Ryde  <kevin@swox.se>
9221
9222         * tests/mpz/t-set_f.c: New file.
9223         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
9224
9225         * mpz/set_f.c: Share MPN_COPY between pad and trunc cases, do exp<=0
9226         test earlier, store SIZ(w) earlier.
9227
9228         * tests/t-count_zeros.c: New file.
9229         * tests/t-gmpmax.c: New file.
9230         * tests/Makefile.am (check_PROGRAMS): Add them.
9231
9232         * mp_clz_tab.c: Compile the table only if longlong.h says it's needed;
9233         add an internal-use-only comment.
9234         * tune/common.c: Force a __clz_tab for convenience when testing.
9235
9236         * mpn/x86/pentium/gmp-mparam.h, mpn/x86/pentium/mmx/gmp-mparam.h: Add
9237         COUNT_LEADING_ZEROS_NEED_CLZ_TAB, for mod_1.asm.
9238
9239         * longlong.h (count_leading_zeros) [pentium]: Decide to go with float
9240         method for p54.
9241         (count_leading_zeros) [alpha]: Add COUNT_LEADING_ZEROS_NEED_CLZ_TAB.
9242         (__clz_tab): Provide a prototype only if it's needed.
9243
9244         * tests/trace.c (mpz_trace): Don't use = on structures.
9245         (mpn_trace): Set _mp_alloc when creating mpz.
9246
9247 2001-06-12  Kevin Ryde  <kevin@swox.se>
9248
9249         * mpn/x86/divrem_1.asm: Amend some comments about P5 speed.
9250
9251         * tune/README: Clarify reconfigure on gmp-mparam.h update.
9252
9253         * mpn/x86/p6/copyd.asm: New file.
9254         * mpn/x86/p6/README: Update copyd and mod_1.
9255         * mpn/x86/copyd.asm: Amend some comments.
9256
9257         * gmp-impl.h (__builtin_constant_p): Add dummy for non-gcc.
9258         (mpn_incr_u, mpn_decr_u): Recognise incr==1 at compile time in the
9259         generic code on gcc.
9260
9261         * gmp-impl.h (ASSERT_ZERO_P, ASSERT_MPN_NONZERO_P): New macros.
9262         * mpn/generic/gcd_1.c, mpn/generic/mul_fft.c: Use them.
9263         * mpz/get_d.c: Add a private mpn_zero_p.
9264         * mpfr/trunc.c: Use own mpn_zero_p.
9265         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_1N): Use refmpn_zero_p.
9266         * gmp-impl.h (mpn_zero_p): Remove, no longer needed.
9267
9268         * gmp-h.in, gmp-impl.h: Move MPN_CMP to gmp.h as __GMPN_CMP, leave an
9269         MPN_CMP alias in gmp-impl.h.
9270         * gmp-h.in (mpn_cmp): Add an inline version.
9271         * mpn/generic/cmp.c: Use __GMP_FORCE_mpn_cmp to get code from gmp.h.
9272
9273         * acinclude.m4 (GMP_C_ATTRIBUTE_MODE): New macro.
9274         * configure.in: Call it.
9275         * gmp-impl.h (SItype etc): Use it.
9276
9277         * randraw.c (lc): Change mpn_mul_basecase->mpn_mul,
9278         mpn_incr_u->MPN_INCR_U, abort->ASSERT_ALWAYS(0).
9279
9280         * longlong.h (count_leading_zeros) [pentiumpro]: Work around a partial
9281         register stall on gcc < 3.
9282
9283         * gmp.texi (Introduction to GMP): Add IA-64.
9284         (Notes for Particular Systems): i386 means generic x86.
9285
9286         * tests/t-modlinv.c: Use tests_start and tests_end.
9287
9288 2001-06-10  Kevin Ryde  <kevin@swox.se>
9289
9290         * gmp.texi (Number Theoretic Functions): mpz_jacobi only defined for b
9291         odd.  Separate the jacobi/legendre/kronecker descriptions.
9292         (Low-level Functions): Document mpn_mul_1 "incr" overlaps.
9293         (Language Bindings): New chapter.
9294
9295         * mpz/jacobi.c: Don't retaining old behaviour of mpz_jacobi on even b
9296         (it wasn't documented in 3.1.1).
9297         * mpz/jacobi.c, gmp-h.in (mpz_kronecker, mpz_legendre): Remove
9298         separate entrypoints, just #define to mpz_jacobi.
9299         * compat.c (__gmpz_legendre): Add compatibility entrypoint.
9300
9301         * mpn/generic/mul_1.c: Allow "incr" style overlaps.
9302         * tests/devel/try.c (param_init): Test this.
9303
9304         * mpf/mul_ui.c: Do size==0 test earlier.
9305
9306 2001-06-08  Kevin Ryde  <kevin@swox.se>
9307
9308         * gmp-impl.h (ULONG_HIGHBIT, UINT_HIGHBIT, USHRT_HIGHBIT): Cast
9309         ULONG_MAX etc to unsigned long etc before attempting to right shift.
9310
9311         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Add an AC_DEFINE of LSYM_PREFIX.
9312         * gmp-impl.h (ASM_L): New macro.
9313         (mpn_incr_u, mpn_decr_u, MPN_INCR_U, MPN_DECR_U): Add i386 optimized
9314         versions.
9315
9316         * mpn/hppa/*.s,S,asm: Use .label so the code works with gas on hppa
9317         GNU/Linux too, reported by LaMont Jones <lamont@smallone.fc.hp.com>.
9318         * mpn/hppa/README: Add some notes on this.
9319         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Ditto.
9320
9321         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add dive_1.c,
9322         fib2_ui.c.
9323
9324         * tests/mpn/t-iord_u.c: New file.
9325         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
9326
9327         * configure.in (mips*-*-irix[6789]*): Make ABI=n32 the default, same
9328         as in gmp 3.1.
9329         * gmp.texi (ABI and ISA): Update.
9330
9331         * gmp.texi (Build Options): Misc tweaks.
9332         (Notes for Particular Systems): Describe windows DLL handling.
9333         (Known Build Problems): DJGPP needs bash 2.04.
9334         (Number Theoretic Functions): mpz_invert returns 0<=r<modulus; add
9335         mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui.
9336         (Fibonacci Numbers Algorithm): Update for new formulas used.
9337         (Lucas Numbers Algorithm): New section.
9338
9339         * tune/speed.c,speed.h,common.c,many.pl: Add mpn_fib2_ui, mpz_fib2_ui,
9340         mpz_lucnum_ui, mpz_lucnum2_ui.
9341         * demos/expr/exprz.c,README: Add lucnum.
9342         * demos/perl/GMP.pm,GMP.xs,GMP/Mpz.pm,test.pl: Add fib2, lucnum,
9343         lucnum2.
9344
9345         * tests/mpz/t-lucnum_ui.c: New file.
9346         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
9347         * tests/mpz/t-fib_ui.c: Check mpz_fib2_ui too, updates for new style
9348         MPN_FIB2_SIZE.
9349
9350         * tune/tuneup.c, tune/Makefile.am, gmp-impl.h, mpn/*/gmp-mparam.h:
9351         Remove FIB_THRESHOLD, no longer required.
9352
9353         * mpz/fib2_ui.c, mpz/lucnum_ui.c mpz/lucnum2_ui.c: New files.
9354         * Makefile.am, mpz/Makefile.am: Add them.
9355         * gmp-h.in (mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui): Add
9356         prototypes.
9357
9358         * mpn/generic/fib2_ui.c: New file.
9359         * configure.in (gmp_mpn_functions): Add it.
9360         * gmp-impl.h (mpn_fib2_ui, FIB_TABLE, etc): Add these.
9361         * mpz/fib_ui.c: Rewrite.
9362
9363         * acinclude.m4 (GMP_C_SIZES): Fix _LONG_LONG_LIMB define for mp_limb_t
9364         size test.
9365         (GMP_FUNC_ALLOCA): Add dummy __GMP_BITS_PER_MP_LIMB for gmp-h.in work.
9366
9367         * configure.in (CPPFLAGS): Remove -D__GMP_WITHIN_GMP, don't want it
9368         everywhere.
9369         * Makefile.am, mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am,
9370         mpf/Makefile.am, mpbsd/Makefile.am (INCLUDES): Set -D__GMP_WITHIN_GMP.
9371
9372         * configure.in (*-*-msdosdjgpp*): Forcibly disable shared libraries,
9373         to make libtests.la work.
9374
9375         * acconfig.h (_LONG_LONG_LIMB, HAVE_MPFR): Remove dummy defines, no
9376         longer needed.
9377
9378         * mpz/set_ui.c: Store to _mp_d[0] unconditionally.
9379
9380 2001-05-27  Kevin Ryde  <kevin@swox.se>
9381
9382         * configure.in, gmp-h.in, mp-h.in: Add support for windows DLLs.
9383
9384 2001-05-26  Kevin Ryde  <kevin@swox.se>
9385
9386         * gmp.texi (ABI and ISA, Reentrancy): Minor tweaks
9387         (Notes for Package Builds): Note gmp.h is a generated file.
9388         (Notes for Particular Systems): -march=pentiumpro is used for gcc
9389         2.95.4 and up.
9390         (Assembler Loop Unrolling): Mention non power-of-2 unrolling.
9391         (Internals): New chapter.
9392         * mpf/README: Remove file.
9393
9394         * demos/expr/README: Miscellaneous rewordings.
9395
9396         * demos/perl: New directory.
9397         * demos/Makefile.am: Add it.
9398         * demos/perl/INSTALL, Makefile.PL, GMP.pm, GMP.xs, typemap,
9399         GMP/Mpz.pm, GMP/Mpq.pm, GMP/mpf.pm, GMP/Rand.pm, sample.pl, test.pl:
9400         New files.
9401
9402         * configure, aclocal.m4: Update to autoconf 2.50.
9403
9404         * configure, aclocal.m4, ltmain.sh: Update to libtool 1.4.
9405
9406         * configure, aclocal.m4, missing, ansi2knr.c, */Makefile.in: Update to
9407         automake 1.4f.
9408         * Makefile.am: Conditionalize mpfr in $(SUBDIRS) to handle mpfr.info.
9409         * mpfr/Makefile.am (INFO_DEPS): Remove previous mpfr.info handling.
9410         * mpn/Makefile.am (GENERIC_SOURCES): Remove this, just put mp_bases.c
9411         in libmpn_la_SOURCES.
9412         * tests/Makefile.am (tests.h): Move from EXTRA_HEADERS to
9413         libtests_la_SOURCES.
9414         * ltconfig: Remove file, no longer needed.
9415
9416         * Makefile.am (gmp-impl.h, longlong.h, stack-alloc.h): Move from
9417         EXTRA_DIST to libgmp_la_SOURCES, so they get included in TAGS.
9418         * tests/rand/Makefile.am (gmpstat.h): Move to libstat_la_SOURCES
9419         similarly.
9420
9421         * config.guess (68k-*-*): Use $SHELL not "sh", tweak some comments.
9422
9423         * mpfr/mpfr.texi (Introduction to MPFR): Tweak table formatting, note
9424         non-free programs must be able to be re-linked.
9425
9426 2001-05-20  Kevin Ryde  <kevin@swox.se>
9427
9428         * mpn/powerpc64/addmul_1.asm, mpn/powerpc64/mul_1.asm,
9429         mpn/powerpc64/submul_1.asm: Add carry-in entrypoints.
9430
9431 2001-05-17  Kevin Ryde  <kevin@swox.se>
9432
9433         * gmp.texi (ge): Fix definition for info.
9434         (Notes for Particular Systems): Mention 68k dragonball and cpu32.
9435         (Efficiency): Add static linking, more about in-place operations,
9436         describe mpq+/-integer using addmul.
9437         (Reporting Bugs): A couple of words about self-contained reports.
9438         (Floating-point Functions): Note exponent limitations of mpf_get_str
9439         and mpf_set_str.
9440         (Initializing Floats): Clarify mpf_get_prec, mpf_set_prec and
9441         mpf_set_prec_raw a bit.
9442         (Float Comparison): Note current mpf_eq deficiencies.
9443
9444         * gmp-h.in (__GMP_HAVE_CONST, __GMP_HAVE_PROTOTYPES,
9445         __GMP_HAVE_TOKEN_PASTE): Merge GNU ansidecl.h tests for ANSI compilers.
9446         * demos/expr/expr-impl-h.in: Ditto.
9447
9448         * gmp-impl.h (BITS_PER_MP_LIMB): Define from __GMP_BITS_PER_MP_LIMB if
9449         not already in gmp-mparam.h.
9450         * tests/t-constants.c (BITS_PER_MP_LIMB, __GMP_BITS_PER_MP_LIMB):
9451         Check these are the same.
9452
9453         * gmp-h.in (mpf_get_default_prec, mpf_get_prec, mpf_set_default_prec,
9454         mpf_set_prec_raw): Provide "extern inline" versions, use __GMPF on the
9455         macros.
9456         * mpf/get_dfl_prc.c, mpf/get_prc.c, mpf/set_dfl_prc.c,
9457         mpf/set_prc_raw.c: Get code from gmp.h using __GMP_FORCE.
9458
9459         * gmp-h.in, gmp-impl.h (__gmp_default_fp_limb_precision): Move from
9460         gmp-impl.h to gmp-h.in.
9461         (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Ditto, and use __GMPF
9462         prefix and add a couple of casts.
9463         * gmp-h.in (__GMP_MAX): New macro.
9464         * mpf/init2.c mpf/set_prc.c: Update for __GMPF prefix.
9465
9466         * gmp-h.in (__GMP_BITS_PER_MP_LIMB): New templated define.
9467         * acinclude.m4 (GMP_C_SIZES): Add AC_SUBST __GMP_BITS_PER_MP_LIMB,
9468         remove AC_DEFINE BITS_PER_MP_LIMB.
9469
9470 2001-05-13  Kevin Ryde  <kevin@swox.se>
9471
9472         * gmp-h.in, gmp.texi, Makefile.am, mpz/Makefile.am, tests/mpz/t-pow.c:
9473         Remove mpz_si_pow_ui, pending full si support.
9474         * mpz/si_pow_ui.c: Remove file.
9475
9476 2001-05-11  Kevin Ryde  <kevin@swox.se>
9477
9478         * mpn/x86/pentium/dive_1.asm: New file.
9479
9480         * mpn/powerpc32/umul.asm: Use r on registers.
9481         * mpn/powerpc64/umul.asm: New file.
9482         * configure.in (powerpc*-*-*): Enable umul in extra_functions.
9483
9484         * tests/refmpn.c, tests/tests.h (refmpn_umul_ppmm): Use same arguments
9485         as normal mpn_umul_ppmm.
9486         (refmpn_mul_1c): Update.
9487         * tests/devel/try.c, tune/many.pl: Add some umul_ppmm testing support.
9488
9489         * mpn/x86/k6/mmx/popham.asm, mpn/x86/k7/mmx/popham.asm: Don't support
9490         size==0.
9491         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm: Ditto,
9492         and shave a couple of cycles from the PIC entry code.
9493
9494         * mpz/mul.c: Use mpn_mul_1 for size==1 and mpn_mul_2 (if available)
9495         for size==2, to avoid copying; do vsize==0 test earlier.
9496
9497         * mpf/sub.c: Test r!=u before calling mpf_set.
9498         * mpf/add.c: Ditto, and share mpf_set between usize==0 and vsize==0.
9499
9500         * mpn/generic/tdiv_qr.c, mpq/get_d.c, mpf/div.c, mpf/set_q.c,
9501         mpf/set_str.c, mpf/ui_div.c: Test for high bit set, not for
9502         count_leading_zeros zero.
9503
9504         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Print a message if extra
9505         flags are added.
9506
9507         * tests/mpz/t-mul_i.c: New file.
9508         * tests/mpz/Makefile.am: Add it.
9509
9510         * mpz/mul_siui.c (mpz_mul_si): Fix for -0x80..00 on long long limb.
9511
9512         * gmp-h.in (mpf_set_si, mpf_set_ui): Revert last change, set exp to 0
9513         when n==0.
9514         * mpf/ceilfloor.c, mpf/trunc.c: Fix exp to 0 when setting r to 0.
9515         * gmp-impl.h (MPF_CHECK_FORMAT): Check exp==0 when size==0.
9516
9517 2001-05-07  Kevin Ryde  <kevin@swox.se>
9518
9519         * gmp-h.in (mpf_set_si, mpf_set_ui): Don't bother setting _mp_exp to 0
9520         when n==0 (use 1 unconditionally).
9521         * tests/mpf/t-misc.c (check_mpf_set_si): Don't demand anything of
9522         _mp_exp when _mp_size is zero.
9523
9524         * mpn/x86/README: Note gas _GLOBAL_OFFSET_TABLE_ with leal problem.
9525
9526         * gmp-h.in (mpz_fits_uint_p, mpz_fits_ulong_p, mpz_fits_ushort_p):
9527         Provide these as "extern inline"s.
9528         (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): New macros.
9529         (mpz_popcount): Use __GMP_ULONG_MAX.
9530         * gmp-impl.h (UINT_MAX, ULONG_MAX, USHRT_MAX): Use __GMP_U*_MAX, if
9531         not already defined.
9532         * mpz/fits_u.c: Use the code from gmp.h.
9533
9534 2001-05-06  Kevin Ryde  <kevin@swox.se>
9535
9536         * mpn/x86/k7/dive_1.asm: New file.
9537         * mpn/x86/k7/gcd_1.asm: New file.
9538         * mpn/asm-defs.m4 (m4_count_trailing_zeros): New macro.
9539
9540         * gmp-h.in (mpz_get_ui, mpz_getlimbn, mpz_set_q, mpz_perfect_square_p,
9541         mpz_popcount, mpz_size, mpf_set_ui, mpf_set_si, mpf_size): Provide
9542         these as "extern inlines".
9543         Use just one big extern "C" block.
9544         * mpz/getlimbn.c, mpz/get_ui.c, mpz/perfsqr.c, mpz/popcount.c
9545         mpz/set_q.c, mpz/size.c, mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Use
9546         __GMP_FORCE to get code from gmp.h.
9547
9548 2001-05-03  Kevin Ryde  <kevin@swox.se>
9549
9550         * extract-dbl.c: Add ASSERT d>=0.
9551
9552         * gmp.texi (Efficiency): Add mpz_addmul etc for mpz+=integer, add
9553         mpz_neg etc in-place.
9554         (Integer Arithmetic): Add mpz_addmul, mpz_submul, mpz_submul_ui.
9555         (Initializing Rationals): Add mpq_set_str.
9556         (Low-level Functions): mpn_set_str requires strsize >= 1.
9557
9558         * gmp-h.in (__GMP_EXTERN_INLINE, __GMP_ABS): New macros.
9559         (mpz_abs, mpq_abs, mpf_abs, mpz_neg, mpq_neg, mpf_neg): Provide inline
9560         versions.
9561         * mpz/abs.c, mpq/abs.c, mpf/abs.c, mpz/neg.c, mpq/neg.c, mpf/neg.c:
9562         Add suitable __GMP_FORCE to turn off inline versions.
9563
9564         * tests/mpz/t-aorsmul.c,t-cmp_d.c,t-popcount,t-set_str.c: New files.
9565         * tests/mpz/Makefile.am: Add them.
9566
9567         * mpz/aorsmul_i.c: New file, rewrite of addmul_ui.c.  Add
9568         mpz_submul_ui entrypoint, share more code between some of the
9569         conditionals, use mpn_mul_1c if available.
9570         * mpz/addmul_ui.c: Remove file.
9571         * mpz/aorsmul.c: New file.
9572         * Makefile.am, mpz/Makefile.am: Update.
9573         * gmp-h.in (mpz_addmul, mpz_submul, mpz_submul_ui): Add prototypes.
9574         * gmp-impl.h (mpz_aorsmul_1): Add prototype.
9575
9576         * tests/mpq/t-set_str.c: New file.
9577         * tests/mpq/Makefile.am: Add it.
9578
9579         * mpq/set_str.c: New file.
9580         * Makefile.am, mpq/Makefile.am: Add it.
9581         * gmp-h.in (mpq_set_str): Add prototype.
9582
9583         * mpz/set_str.c: Fix for trailing white space on zero, eg. "0 ".
9584         * mpn/generic/set_str.c: Add ASSERT str_len >= 1.
9585
9586         * gmp-h.in, gmp-impl.h (mpn_incr_u, mpn_decr_u): Move to gmp-impl.h.
9587         * gmp-impl.h (MPN_INCR_U, MPN_DECR_U): New macros.
9588
9589 2001-04-30  Kevin Ryde  <kevin@swox.se>
9590
9591         * tests/mpz/t-lcm.c: New file.
9592         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
9593
9594         * mpz/lcm.c: Add one limb special case.
9595
9596         * mpz/lcm_ui.c: New file.
9597         * Makefile.am, mpz/Makefile.am: Add it.
9598         * gmp-h.in (mpz_lcm_ui): Add prototype.
9599         * gmp.texi (Number Theoretic Functions): Add mpz_lcm_ui, document lcm
9600         now always positive.
9601
9602         * mp-h.in (mp_size_t, mp_exp_t): Fix typedefs to match gmp-h.in.
9603
9604         * gmp-h.in (mpn_add_1, mpn_add, mpn_sub_1, mpn_sub): Remove K&R
9605         function defines (ansi2knr will handle mpn/inline.c, and just ansi is
9606         enough for gcc extern inline).
9607
9608         * gmp-h.in (__GMP_HAVE_TOKEN_PASTE): New macro.
9609         (__MPN): Use it.
9610         * gmp-impl.h (CNST_LIMB): Ditto.
9611
9612         * gmp-h.in, mp-h.in (__gmp_const, __gmp_signed, _PROTO, __MPN): Use
9613         ANSI forms on Microsoft C.
9614         (__GMP_HAVE_CONST): New define.
9615         * gmp-impl.h (const, signed): Use it.
9616
9617         * demos/expr/expr-impl-h.in (<stdarg.h>): Use this with Microsoft C.
9618         (HAVE_STDARG): New define.
9619         * demos/expr/expr.c,exprz.c,exprq.c,exprf.c,exprfr.c: Use it.
9620
9621         * acinclude.m4 (GMP_C_STDARG): New macro.
9622         * configure.in: Call it.
9623         * rand.c: Use it.
9624
9625         * configure.in (AC_PROG_CC_STDC): New test.
9626
9627 2001-04-25  Kevin Ryde  <kevin@swox.se>
9628
9629         * mpn/x86/k6/mmx/dive_1.asm: New file.
9630         * mpn/x86/x86-defs.m4 (Zdisp): Two more insns.
9631
9632         * mpn/x86/pentium/mul_2.asm: New file.
9633         * mpn/asm-defs.m4: Add define_mpn(mul_2).
9634         * acconfig.h (HAVE_NATIVE_mpn_divexact_1, mul_2): Add templates.
9635
9636         * configure.in (ABI): Use AC_ARG_VAR.
9637
9638         * tests/devel/try.c: Run reference function when validate fails.
9639
9640         * mpq/get_str.c: Fixes for negative bases.
9641         * tests/mpq/t-get_str.c: Check negative bases.
9642         * tests/misc.c,tests.h (__gmp_allocate_strdup, strtoupper): New
9643         functions.
9644
9645 2001-04-24  Torbjorn Granlund  <tege@swox.com>
9646
9647         * mpz/lcm.c (mpz_lcm): Make result always positive.
9648
9649         * gmp-h.in (mpz_inp_binary, mpz_out_binary): Remove declarations.
9650
9651 2001-04-22  Kevin Ryde  <kevin@swox.se>
9652
9653         * mpn/powerpc64/addsub_n.asm: Use config.m4 not asm-syntax.m4.
9654
9655         * mpz/cmp_d.c, mpz/cmpabs_d.c: New files.
9656         * Makefile.am, mpz/Makefile.am: Add them.
9657         * mpf/cmp_d.c, mpf/get_dfl_prec.c: New files.
9658         * Makefile.am, mpf/Makefile.am: Add them.
9659         * gmp-h.in (mpz_cmp_d, mpz_cmpabs_d, mpf_cmp_d, mpf_get_default_prec):
9660         Add prototypes.
9661         * gmp.texi: Add documentation.
9662
9663         * mpf/set_prc.c: Avoid a realloc call if already the right precision.
9664
9665         * gmp-impl.h (MPF_BITS_TO_PREC, MPF_PREC_TO_BITS): New macros.
9666         * mpf/get_prc.c, init2.c, set_dfl_prec.c, set_prc.c, set_prc_raw.c:
9667         Use them.
9668
9669 2001-04-20  Kevin Ryde  <kevin@swox.se>
9670
9671         * tests/devel/try.c: Don't test size==0 on mpn_popcount and
9672         mpn_hamdist; add testing for mpn_divexact_1; print some limb values
9673         with mpn_trace not printf.
9674
9675         * mpz/popcount.c, mpz/hamdist.c: Don't pass size==0 to mpn_popcount
9676         and mpn_hamdist.
9677         * mpn/generic/popham.c: Don't support size==0.
9678
9679         * config.guess (m68k-*-*): Detect m68010, return m68360 for cpu32,
9680         cleanup the nesting a bit.
9681
9682         * gmp.texi (Integer Division): Fix mpz_congruent_2exp_p "c" type.
9683         (Integer Division): Add mpz_divexact_ui.
9684         (Number Theoretic Functions): Fix mpz_nextprime return type.
9685         (Exact Remainder): Divisibility tests now implemented.
9686         And more index entries in a few places.
9687
9688         * tests/mpz/dive_ui.c: New file.
9689         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
9690
9691         * mpz/dive_ui.c: New file.
9692         * Makefile.am, mpz/Makefile.am: Add it.
9693         * gmp-h.in (mpz_divexact_ui): Add prototype.
9694
9695         * tune/many.pl, tune/speed.h: Add special mpn_back_to_back for
9696         development.
9697
9698         * gmp-impl.h (MPN_DIVREM_OR_DIVEXACT_1): New macro.
9699         * mpz/divexact.c: Use it.
9700
9701         * gmp-impl.h (DIVEXACT_1_THRESHOLD): New threshold.
9702         * tune/tuneup.c: Tune it.
9703
9704         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
9705         mpn_divexact_1, mpn_copyi, mpn_copyd.
9706
9707         * mpn/generic/dive_1.c: New file.
9708         * configure.in (gmp_mpn_functions): Add it.
9709         * gmp-impl.h (mpn_divexact_1): Add prototype.
9710         * mpn/asm-defs.m4: Add define_mpn(divexact_1).
9711
9712         * tests/mpn: New directory.
9713         * tests/Makefile.am: Add it.
9714         * tests/mpn/Makefile.am: New file.
9715         * configure.in (AC_OUTPUT): Add it.
9716         * tests/mpn/t-asmtype.c: New file.
9717
9718         * configure, config.in: Update to autoconf 2.49d.
9719
9720         * configure.in, gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Revert
9721         to generating gmp.h, mp.h and expr-impl.h with AC_OUTPUT and AC_SUBST.
9722
9723         * configure.in (m68*-*-*): Oops, m683?2 is 68000, m68360 is cpu32.
9724         * mpn/m68k/m68k-defs.m4 (scale_available_p): Ditto.
9725
9726         * configure.in (underscore, asm_align): Remove these variables, unused.
9727         (GMP_ASM_*): Sort by AC_REQUIREs, to avoid duplication.
9728         * acinclude.m4 (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_LOG): Remove support
9729         for actions, no longer needed.
9730
9731 2001-04-17  Kevin Ryde  <kevin@swox.se>
9732
9733         * config.guess (m68k-*-*): Look for cpu in linux kernel /proc/cpuinfo.
9734
9735         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): The -mpentiumpro problem is
9736         fixed in 2.95.4, so test for that.
9737         (GMP_ASM_TYPE): Amend some comments.
9738
9739         * tune/freq.c (speed_cpu_frequency_sysctl): Avoid having unused
9740         variables on GNU/Linux.
9741
9742         * mpn/asm-defs.m4 (m4_instruction_wrapper): Fix a quoting problem if
9743         the name of the file is a macro.
9744
9745 2001-04-15  Kevin Ryde  <kevin@swox.se>
9746
9747         * mpn/powerpc64/*.asm: Add speeds on ppc630.
9748
9749         * acconfig.h: Add dummy templates for _LONG_LONG_LIMB and HAVE_MPFR.
9750         * configure.in: Ensure config.in is the last AM_CONFIG_HEADER,
9751         which autoheader requires.
9752
9753         * mpn/x86/pentium/popcount.asm: New file.
9754         * mpn/x86/pentium/hamdist.asm: New file.
9755
9756         * mpn/asm-defs.m4: (m4_popcount): New macro.
9757         Amend a few comments elsewhere.
9758
9759         * acinclude.m4 (GMP_ASM_RODATA): If possible, grep compiler output for
9760         the right directive.
9761
9762         * tune/speed.c: Print clock speed in MHz, not cycle time.
9763
9764         * configure.in (AC_CHECK_HEADERS): Check for sys/processor.h.
9765         * tune/freq.c (speed_cpu_frequency_processor_info): Require
9766         <sys/processor.h> to exist, to differentiate the different
9767         processor_info on Darwin.
9768         (speed_cpu_frequency_sysctlbyname): Remove hw.model test which is in
9769         speed_cpu_frequency_sysctl.
9770         (speed_cpu_frequency_sysctl): Add hw.cpufrequency for Darwin.
9771
9772         * gmp-impl.h (MPN_LOGOPS_N_INLINE, mpn_and_n ... mpn_xnor_n): Use a
9773         single expression argument for the different operations, necessary for
9774         the Darwin "smart" preprocessor.
9775
9776         * mpn/m68k/t-m68k-defs.pl: Allow white space in m4_definsn and
9777         m4_defbranch.
9778
9779         * tune/many.pl: Change RM_TMP_S to RM_TMP to match mpn/Makeasm.am,
9780         avoid a possibly undefined array in a diagnostic, add more renaming to
9781         hamdist.
9782
9783 2001-04-13  Kevin Ryde  <kevin@swox.se>
9784
9785         * ltmain.sh, aclocal.m4, configure, config.in: Update to libtool 1.3d.
9786         * configure.in: Change ac_ to lt_ in lt_cv_archive_cmds_need_lc and
9787         lt_cv_proc_cc_pic.
9788
9789         * config.guess (m68*-*-*): Detect exact cpu with BSD sysctl hw.model,
9790         detect 68000/68010 with trapf, detect 68302 with bfffo.
9791
9792 2001-04-11  Kevin Ryde  <kevin@swox.se>
9793
9794         * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_ADDRESSING,
9795         GMP_ASM_M68K_BRANCHES): New macros.
9796         * configure.in: Use them, remove old 68k configs, use mc68020 udiv and
9797         umul.
9798
9799         * mpn/m68k/m68k-defs.m4: New file.
9800         * mpn/m68k/t-m68k-defs.pl: New file.
9801         * mpn/m68k/*.asm: New files, converted from .S.  Merge add_n and sub_n
9802         to aors_n, ditto mc68020 addmul_1 and submul_1 to aorsmul_1.  No
9803         object code changes (except .type and .size now used on NetBSD 1.4).
9804         * mpn/m68k/README: New file.
9805         * mpn/m68k/*.S, */*.S, syntax.h: Remove files.
9806
9807         * configure.in (m68*-*-netbsd1.4*): Pretend getrusage doesn't exist.
9808         * tune/README: Update.
9809
9810         * configure.in (powerpc*-*-*): For the benefit of Darwin 1.3, add cc
9811         to cclist, make gcc_cflags -Wa,-mppc optional.
9812
9813 2001-04-06  Kevin Ryde  <kevin@swox.se>
9814
9815         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add | for 68k.
9816         (gmpasm-mode-syntax-table): Add to comments.
9817
9818         * tests/mpz/reuse.c (dsi_div_func_names): Add names for cdiv_[qr]_2exp.
9819
9820 2001-04-04  Kevin Ryde  <kevin@swox.se>
9821
9822         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): Fix test so as to actually
9823         detect the problem, add notes on m68k netbsd 1.4.1.
9824
9825         * gmp.texi (Compatibility with older versions): Note libmp
9826         compatibility.
9827
9828 2001-04-03  Kevin Ryde  <kevin@swox.se>
9829
9830         * tests/mpz/reuse.c: Add mpz_cdiv_q_2exp and mpz_cdiv_r_2exp.
9831
9832         * tests/mpz/t-pow.c: Drag in refmpn.o when testing mpz_pow_ui etc with
9833         refmpn_mul_2.
9834
9835         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of mpn_com_n
9836         and mpn_mul_2.
9837         * tests/devel/try.c: Add testing of mpn_mul_2, and a
9838         DATA_MULTIPLE_DIVISOR attribute.
9839
9840         * gmp.texi (Build Options): List more m68k's.
9841         (Build Options): Add cross reference to tex2html.
9842         (Notes for Particular Systems): Add m68k means 68020 or up.
9843         (Rational Conversions): New section, with mpq_get_d, mpq_set_d and
9844         mpq_set_f from Miscellaneous, and new mpq_set_str.
9845         (Applying Integer Functions): Move mpq_get_num, mpq_get_den,
9846         mpq_set_num and mpq_set_den from Misc.
9847         (Miscellaneous Rational Functions): Remove section.
9848         (Custom Allocation): Partial rewrite for various clarifications.
9849         (References): Improve line breaks near URLs.
9850
9851         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): New macro.
9852         * configure.in (m68*-*-*): Use it to run gcc 2.95.x at -O not -O2.
9853         (m680?0-*-*, m683?2-*-*, m68360-*-*): Add optional gcc -m options.
9854
9855         * tests/mpz/t-cmp.c: New file.
9856         * tests/mpz/t-sizeinbase.c: New file.
9857         * tests/mpz/Makefile.am: Add them.
9858
9859         * gmp-impl.h (MPN_CMP): New macro.
9860         * mpz/cmp.c,cmpabs.c: Use it, and minor cleanups too.
9861
9862         * tests/mpq/t-equal.c: New file.
9863         * tests/mpq/t-get_str.c: New file.
9864         * tests/mpq/Makefile.am: Add them.
9865
9866         * mpq/get_str.c: New file.
9867         * Makefile.am, mpq/Makefile.am: Add it.
9868         * gmp-h.in (mpq_get_str): Add prototype.
9869
9870         * mpq/equal.c: Rewrite using inline compare loops.
9871
9872         * tests/refmpn.c,tests.h (refmpn_mul_2): Fix parameter order.
9873         * mpz/n_pow_ui.c: Fix mpn_mul_2 calls parameter order.
9874
9875 2001-03-29  Kevin Ryde  <kevin@swox.se>
9876
9877         * tests/mpf/t-trunc.c: New file.
9878         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
9879         * gmp-impl.h (MPF_CHECK_FORMAT): New macro.
9880
9881         * mpf/trunc.c: New file, rewrite of integer.c, preserve prec+1 in
9882         copy, don't copy if unnecessary.
9883         * mpf/ceilfloor.c: New file likewise, and use common subroutine for
9884         ceil and floor.
9885         * mpf/integer.c: Remove file.
9886         * Makefile.am, mpf/Makefile.am, macos/Makefile.in: Update.
9887
9888         * acinclude.m4 (GMP_GCC_VERSION_GE): New macro.
9889         (GMP_GCC_MARCH_PENTIUMPRO): Use it, remove CCBASE parameter (don't
9890         bother checking it's gcc).
9891         (GMP_GCC_ARM_UMODSI): New macro.
9892         * configure.in (GMP_GCC_MARCH_PENTIUMPRO): Update parameters.
9893         (arm*-*-*): Use GMP_GCC_ARM_UMODSI.
9894         * gmp.texi (Notes for Particular Systems): Add arm gcc requirements.
9895
9896 2001-03-28  Kevin Ryde  <kevin@swox.se>
9897
9898         * gmp.texi (Converting Integers): Document mpz_getlimbn using absolute
9899         value and giving zero for N out of range, move to end of section.
9900
9901         * tests/refmpn.c (refmpn_tdiv_qr): Use refmpn_divmod_1 rather than
9902         refmpn_divrem_1.
9903         * tests/tests.h: Add some prototypes that were missing.
9904
9905         * mpz/tdiv_q_ui.c: Remove a comment that belonged to mpz_tdiv_r_ui.
9906
9907 2001-03-26  Torbjorn Granlund  <tege@swox.com>
9908
9909         * mpn/generic/gcdext.c: Handle carry overflow after m*n multiply code
9910         in both arms.  Partially combine multiply arms.
9911
9912 2001-03-24  Kevin Ryde  <kevin@swox.se>
9913
9914         * longlong.h: Add comments to P5 count_leading_zeros.
9915
9916         * demos/expr/exprz.c,t-expr.c,README: Add congruent_p and divisible_p.
9917
9918 2001-03-23  Kevin Ryde  <kevin@swox.se>
9919
9920         * gmp.texi (GMPceil, GMPfloor, ge, le): New macros.
9921         (Integer Division, mpn_cmp, mpn_sqrtrem, Algorithms): Use them.
9922         (mpn_bdivmod): Refer to mp_bits_per_limb, not BITS_PER_MP_LIMB, and
9923         improve formatting a bit.
9924         (mpn_lshift, mpn_rshift): Clarify the return values, and use {rp,n}
9925         for the destination.
9926         Miscellaneous minor rewordings in a few places.
9927
9928         * mpn/arm/arm-defs.m4: New file.
9929         * configure.in (arm*-*-*): Use it.
9930         * mpn/arm/*.asm: Use changecom and registers from arm-defs.m4, use L()
9931         for local labels.
9932
9933         * mpn/x86/k6/mmx/com_n.asm: Relax code alignment (same speed).
9934
9935         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Use __pure__ to avoid application
9936         namespace.
9937
9938         * gmp-impl.h (ABS): Add parens around argument.
9939
9940 2001-03-20  Kevin Ryde  <kevin@swox.se>
9941
9942         * acinclude.m4 (GMP_PROG_M4): Use AC_ARG_VAR on $M4.
9943
9944         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): New macro.
9945         * configure.in: Use it.
9946         * mpn/asm-defs.m4: Ditto.
9947
9948 2001-03-18  Kevin Ryde  <kevin@swox.se>
9949
9950         * mpn/x86/pentium/logops_n.asm: New file.
9951
9952         * mpn/x86/k6/k62mmx/copyd.asm: Rewrite, smaller and simpler, faster on
9953         small sizes, slower on big sizes (about half the time).
9954         * mpn/x86/k6/k62mmx/copyi.asm: Remove file, in favour of generic x86.
9955         * mpn/x86/copyi.asm: Add some comments.
9956         * mpn/x86/k6/README: Update.
9957
9958         * mpn/x86/k6/gcd_1.asm: New file.
9959
9960         * gmp-impl.h (NEG_MOD): Fix type of __dnorm.
9961
9962         * acinclude.m4 (GMP_C_SIZES): Fix use of __GMP_WITHIN_CONFIGURE.
9963
9964 2001-03-15  Kevin Ryde  <kevin@swox.se>
9965
9966         * gmp.texi (GMPabs): New macro.
9967         (Float Comparison - mpf_reldiff): Use it.
9968         (Integer Comparisons - mpz_cmpabs): Ditto, puts "abs" in info.
9969         (Reentrancy): Update notes on old random functions.
9970         (Karatsuba Multiplication): Better characterize the effect of basecase
9971         speedups on the thresholds, pointed out by Torbjorn.
9972
9973         * tune/README: Notes on the 1x1 div threshold for mpn_gcd_1.
9974
9975         * tests/misc.c (mpz_pow2abs_p, mpz_flipbit, mpz_errandomb,
9976         mpz_errandomb_nonzero, mpz_negrandom): New functions.
9977         (mpz_erandomb, mpz_erandomb_nonzero): Use urandom().
9978         * tests/spinner.c (spinner_wanted, spinner_tick): Make global.
9979         * tests/tests.h: Update prototypes.
9980
9981         * tests/mpz/t-cong.c, tests/mpz/t-cong_2exp.c: New files.
9982         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
9983
9984         * mpz/cong.c, mpz/cong_2exp.c, mpz/cong_ui.c: New files.
9985         * Makefile.am, mpz/Makefile.am: Add them.
9986         * gmp-impl.h (NEG_MOD): New macro.
9987         * gmp-h.in (mpz_congruent_p, mpz_congruent_2exp_p,
9988         mpz_congruent_ui_p): Add prototypes.
9989         * gmp.texi (Integer Division, Efficiency): Add documentation.
9990
9991         * mpq/aors.c: No need for ABS on denominator sizes.
9992
9993         * gmp-impl.h (mpn_divisible_p): Use __MPN.
9994
9995         * gmp-impl.h (LOW_ZEROS_MASK): New macro.
9996         * mpz/divis_ui.c, mpn/generic/divis.c: Use it.
9997
9998         * mpz/setbit.c: Fix normalization for case of a negative ending up
9999         with a zero high limb.
10000         * tests/mpz/bit.c (check_single): New test for this problem.
10001
10002         * configure.in (none-*-*): Fix cclist for default ABI=long.
10003
10004 2001-03-10  Kevin Ryde  <kevin@swox.se>
10005
10006         * mpz/cfdiv_q_2exp.c: Don't scan for non-zero limbs if they don't
10007         matter to the rounding.
10008
10009         * mpz/get_ui.c: Fetch _mp_d[0] unconditionally, so the code can come
10010         out branch-free.
10011
10012 2001-03-08  Kevin Ryde  <kevin@swox.se>
10013
10014         * tests/devel/try.c (param_init): Fix reference functions for and_n
10015         and nand_n.
10016
10017         * tune/speed.c, tests/devel/try.c: Seed RANDS, not srandom etc.
10018         * configure.in (AC_CHECK_FUNCS): Remove srand48 and srandom.
10019         * macos/configure (coptions): Remove random/srandom, now unnecessary.
10020
10021         * configure.in (gmp.h, mp.h, demos/expr/expr-impl.h): Generate using
10022         AM_CONFIG_HEADER.
10023         (_LONG_LONG_LIMB, HAVE_MPFR): Change to AC_DEFINEs.
10024         * gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Change to #undef's.
10025         * acinclude.m4 (GMP_FUNC_ALLOCA, GMP_C_SIZES): Use gmp-h.in, not gmp.h.
10026         * Makefile.am (EXTRA_DIST): Remove gmp-h.in and mp-h.in, now done
10027         automatically.
10028         * acinclude.m4 (GMP_FUNC_ALLOCA), gmp-impl.h: Set and use
10029         __GMP_WITHIN_CONFIGURE rather than GMP_FUNC_ALLOCA_TEST.
10030
10031         * mpf/random2.c: Use _gmp_rand and RANDS instead of random() for the
10032         exponent, ensures full range of values too.
10033
10034         * tests/mpz/t-div_2exp.c (check_various): Start with d based on i, but
10035         don't let it go negative.
10036
10037         * tune/tuneup.c (KARATSUBA_MUL_THRESHOLD): Limit probing to
10038         TOOM3_MUL_THRESHOLD_LIMIT, the size of the workspace in mul_n.c.
10039         Use a -1 with this too, so size<LIMIT not <=.
10040
10041 2001-03-07  Torbjorn Granlund  <tege@swox.com>
10042
10043         * mpn/cray/cfp/mul_1.c: Don't call mpn_add_n with size 0.
10044         * mpn/cray/cfp/addmul_1.c: Likewise.
10045         * mpn/cray/cfp/submul_1.c: Don't call mpn_sub_n with size 0.
10046
10047         * tests/mpz/t-div_2exp.c (check_various): Start 2nd d loop from 0
10048         (avoid problems with Cray compilers).
10049
10050 2001-03-06  Torbjorn Granlund  <tege@swox.com>
10051
10052         * mpn/cray/ieee/submul_1.c: Don't call mpn_sub_n with size 0.
10053
10054         * mpn/cray/ieee/mul_basecase.c: New file.
10055         * mpn/cray/ieee/sqr_basecase.c: New file, derived from mul_basecase.c.
10056
10057 2001-03-06  Kevin Ryde  <kevin@swox.se>
10058
10059         * tests/devel/try.c (pointer_setup): Allow dst_size == SIZE_SIZE2 for
10060         the benefit of mpn_tdiv_qr.
10061
10062         * tune/tuneup.c (all): Start karatsuba probing at size==4, for the
10063         benefit of cray t90 ieee which has speed oddities at size==2.
10064
10065         * gmp-impl.h (USE_LEADING_REGPARM): Use __GMP_GNUC_PREREQ.
10066         Use __GMP_ATTRIBUTE_PURE and ATTRIBUTE_CONST in a few places.
10067
10068         * gmp-h.in (__GMP_GNUC_PREREQ) New macro.
10069         (__GMP_ATTRIBUTE_PURE): New macro, use it in many places.
10070
10071         * gmp-impl.h, gmp-h.in (mpn_jacobi_base): Move prototype to
10072         gmp-impl.h, use ATTRIBUTE_CONST.
10073
10074         * tune/speed.h (speed_cyclecounter): Inline asm version for i386.
10075
10076         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Only reread "up" after second
10077         realloc, first is under w!=u.
10078
10079 2001-03-05  Torbjorn Granlund  <tege@swox.com>
10080
10081         * mpn/cray/sub_n.c: Rewrite using `majority' logic.
10082
10083         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Reread `up' after realloc of w.
10084
10085         * mpn/cray/ieee/mul_1.c: Rewrite.  Streamline multiplications;
10086         use `majority' logic.
10087         * mpn/cray/ieee/addmul_1.c: Likewise.
10088
10089         * mpn/cray/add_n.c: Rewrite using `majority' logic.
10090
10091 2001-03-04  Torbjorn Granlund  <tege@swox.com>
10092
10093         * longlong.h (CRAY udiv_qrnnd): No longer conditional on CRAYMPP.
10094         (64-bit hppa add_ssaaaa): New.
10095         (64-bit hppa sub_ddmmss): New.
10096
10097         * mpn/cray/ieee/invert_limb.c: New file.
10098
10099         * gmp-impl.h (RANDS): Add a `,0' to make it compile on more compilers.
10100
10101 2001-03-03  Kevin Ryde  <kevin@swox.se>
10102
10103         * mpz/n_pow_ui.c (ULONG_PARITY): Move to gmp-impl.h.
10104         * gmp-impl.h (ULONG_PARITY): i386 part from n_pow_ui.c, new generic
10105         form by Torbjorn.
10106
10107         * tests/mpz/t-div_2exp.c: New file, rewrite of t-2exp.c.
10108         * tests/mpz/t-2exp.c: Remove file.
10109         * tests/mpz/Makefile.am (check_PROGRAMS): Update.
10110
10111         * gmp-h.in (mpz_cdiv_q_2exp, mpz_cdiv_q_2exp): Add prototypes.
10112         * gmp.texi (Integer Division): Add mpz_cdiv_q_2exp and mpz_cdiv_q_2exp.
10113
10114         * mpz/cfdiv_q_2exp.c: New file, partial rewrite of fdiv_q_2exp.c, add
10115         mpz_cdiv_q_2exp entrypoint.
10116         * mpz/cfdiv_r_2exp.c: New file, rewrite of fdiv_r_2exp.c, use all mpn,
10117         add mpz_cdiv_r_2exp entrypoint.
10118         * mpz/fdiv_q_2exp.c, mpz/fdiv_r_2exp.c: Remove files.
10119         * mpz/Makefile.am (libmpz_la_SOURCES): Update.
10120         * Makefile.am (MPZ_OBJECTS): Ditto.
10121
10122         * gmp-impl.h (USE_LEADING_REGPARM): Use __i386__ same as longlong.h
10123         (REGPARM_2_1, REGPARM_3_1, REGPARM_ATTR): New macros.
10124         * mpz/jacobi.c (jac_or_kron): Use them.
10125
10126         * configure.in (HAVE_ABI_$ABI): Re-enable this for config.m4, with
10127         dots changed to underscores (necessary for hppa).
10128
10129         * tests/mpz/t-divis.c, tests/mpz/t-divis_2exp.c: New files.
10130         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
10131
10132         * gmp-h.in (mpz_divisible_p, mpz_divisible_ui_p,
10133         mpz_divisible_2exp_p): Add prototypes.
10134         * gmp.texi (Integer Division): Add mpz_divisible_p.
10135         (Efficiency): Add remarks about divisibility testing.
10136
10137         * mpz/divis.c, mpz/divis_ui.c, mpz/divis_2exp.c: New files.
10138         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
10139         * Makefile.am (MPZ_OBJECTS): Ditto.
10140
10141         * mpn/generic/divis.c: New file.
10142         * configure.in (gmp_mpn_functions): Add it.
10143         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Ditto.
10144         * gmp-impl.h (mpn_divisible_p): Add prototype.
10145
10146         * urandom.h: Remove file.
10147         * Makefile.am (EXTRA_DIST): Remove it.
10148
10149         * tests/mpz/convert.c, dive.c, io.c, logic.c, reuse.c, t-2exp.c,
10150         t-fdiv.c, t-fdiv_ui.c, t-gcd.c, t-jac.c, t-mul.c, t-pow.c,
10151         t-powm.c, t-powm_ui.c, t-root.c, t-sqrtrem.c, t-tdiv.c,
10152         t-tdiv_ui.c: Use RANDS, initialized by tests_rand_start.
10153
10154         * tests/mpz/t-pow.c: New file, being t-pow_ui renamed and with some
10155         further tests added.
10156         * tests/mpz/t-pow_ui.c: Remove file.
10157         * tests/mpz/Makefile.am (check_PROGRAMS): Update.
10158
10159         * tests/t-modlinv.c: Don't use urandom.h.
10160         * tests/mpz/bit.c, tests/mpz/t-scan.c: Ditto.
10161         * tests/mpq/t-cmp.c, tests/mpq/t-cmp_ui.c, tests/mpq/t-get_d.c: Ditto.
10162         * tests/mpf/reuse.c, t-add.c, t-conv.c, t-dm2exp.c, t-muldiv.c,
10163         t-sqrt.c, t-sub.c: Ditto.
10164
10165         * tests/misc.c (tests_rand_start, tests_rand_end): New functions.
10166         (tests_start, tests_end): Use them.
10167         (urandom): New function.
10168         * tests/tests.h: Add prototypes.
10169
10170         * mpz/random.c: Rewrite using mpz_urandomb and RANDS.
10171         * mpn/generic/random.c: Rewrite using _gmp_rand and RANDS.
10172         * mpn/generic/random2.c: Use RANDS not random() etc.
10173
10174         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized): Add externs.
10175         (gmp_randstate_ptr): New typedef.
10176         (RANDS, RANDS_CLEAR): New macros.
10177
10178         * rands.c: New file.
10179         * Makefile.am (libgmp_la_SOURCES): Add it.
10180
10181         * configure.in (mpn_objs_in_libmp): New AC_SUBST.
10182         * Makefile.am (libmp_la_DEPENDENCIES): Use it.
10183
10184 2001-03-02  Torbjorn Granlund  <tege@swox.com>
10185
10186         * mpn/pa64/udiv_qrnnd.asm: New file.
10187
10188 2001-03-01  Kevin Ryde  <kevin@swox.se>
10189
10190         * mpbsd/rpow.c: New file.
10191         * mpbsd/Makefile.am (libmpbsd_la_SOURCES): Add it
10192         (nodist_libmpbsd_la_SOURCES): Remove pow_ui.c.
10193         * Makefile.am (MPBSD_OBJECTS): Add rpow.lo, remove pow_ui.lo.
10194         (libmp_la_DEPENDENCIES): Add mpz/n_pow_ui.lo.
10195
10196         * mpz/ui_pow_ui.c: Rewrite using mpz_n_pow_ui.
10197         * mpz/pow_ui.c: Ditto, and no longer provide rpow for mpbsd.
10198
10199         * mpz/n_pow_ui.c: New file, rewrite of pow_ui.c and ui_pow_ui.c.  Use
10200         less temporary memory, strip factors of 2 from the base, use mpn_mul_2
10201         if available.
10202         * mpz/si_pow_ui.c: New file.
10203         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
10204         * Makefile.am (MPZ_OBJECTS): Ditto.
10205         * gmp-impl.h (mpz_n_pow_ui): Add prototype.
10206         * gmp-h.in (mpz_si_pow_ui): Add prototype.
10207         * gmp.texi (Integer Exponentiation): Add mpz_si_pow_ui.
10208
10209         * acinclude.m4 (GMP_C_SIZES): Add BITS_PER_ULONG.
10210         Correction to mp_limb_t working check.
10211         * configure.in (limb_chosen): New variable.
10212         * tests/t-constants.c (BITS_PER_ULONG): Check this value.
10213         Add some reminders about tests that fail on Cray.
10214
10215         * tests/refmpn.c (refmpn_mul_2): New function.
10216         * tests/refmpz.c (refmpz_pow_ui): Copied from tests/mpz/t-pow_ui.c
10217         * tests/tests.h: Add prototypes.
10218
10219         * configure.in (none-*-*): Add ABI=longlong.
10220         * doc/configuration (Long long limb testing): Describe it.
10221
10222         * gmp.texi (Low-level Functions): Move some commented out remarks ...
10223         * mpn/generic/mul_basecase.c: ... to here.
10224
10225         * mpn/x86/README: Note "%=" as an alternative to "1:" in __asm__.
10226
10227         * tests/trace.c (mp_trace_start): Print "bin" for binary.
10228
10229         * mpn/generic/dump.c: Add a couple of casts to keep gcc quiet.
10230
10231         * gmp-h.in (mpn_incr_u, mpn_decr_u): Add parens around arguments.
10232
10233         * mpbsd/mout.c, mpbsd/mtox.c (num_to_text): Remove unused variable.
10234
10235         * mpfr/set_d.c (mpfr_get_d2): Declare "q" for 64-bit limbs.
10236
10237 2001-02-28  Torbjorn Granlund  <tege@swox.com>
10238
10239         * mpn/pa64w/udiv_qrnnd.asm: Tune.
10240
10241 2001-02-27  Torbjorn Granlund  <tege@swox.com>
10242
10243         * mpn/pa64w/udiv_qrnnd.asm: New file.
10244
10245 2001-02-26  Torbjorn Granlund  <tege@swox.com>
10246
10247         * longlong.h (arm): Optimize sub_ddmmss by testing for constant
10248         operands.
10249         * mpn/arm/invert_limb.asm: New file.
10250
10251 2001-02-24  Torbjorn Granlund  <tege@swox.com>
10252
10253         * mpn/generic/lshift.c: Rewrite.
10254         * mpn/generic/rshift.c: Rewrite.
10255
10256         * longlong.h: Use UWtype for external interfaces that expect mp_limb_t.
10257
10258         * longlong.h (arm): #define invert_limb.
10259
10260         * mpn/arm: Make labels have local scope.
10261
10262         * configure.in (arm*-*-*): Set extra_functions.
10263         * longlong.h (arm): #define udiv_qrnnd.
10264         * mpn/arm/udiv.asm: New file.
10265
10266 2001-02-24  Kevin Ryde  <kevin@swox.se>
10267
10268         * tune/many.pl: Add mpn_count_leading_zeros, mpn_count_trailing_zeros
10269         and mpn_invert_limb.  Add count_leading_zeros, count_trailing_zeros
10270         from a .h file.  Correction to modexact_1_odd prototype.  Support
10271         ansi2knr.
10272         * tune/speed.h, tune/common.c: Consequent changes.
10273
10274         * demos/expr/*: Make a few more functions available in expressions,
10275         create only libexpr.a, misc minor updates.
10276
10277         * mpn/Makeasm.am: Add some comments about suffix ordering.
10278
10279         * tests/refmpn.c (rshift_make, lshift_make): No need to compare
10280         unsigned to zero.
10281
10282         * mpq/mul.c: Detect and optimize squaring.
10283
10284 2001-02-23  Torbjorn Granlund  <tege@swox.com>
10285
10286         * mpn/mips3: Convert files to `.asm'.
10287
10288         * mpn/arm: Convert files to `.asm'.  Misc cleanups.
10289         * mpn/arm/submul_1.asm: New file.
10290
10291 2001-02-21  Kevin Ryde  <kevin@swox.se>
10292
10293         * tune/tuneup.c (all): Only one compiler print should match, no need
10294         for #undef PRINTED_COMPILER.
10295
10296         * mpfr/mpfr.h (mpfr_sgn): Use mpfr_cmp_ui (patch from Paul).
10297
10298         * mpz/fib_ui.c: Update some remarks about alternative algorithms.
10299         * gmp.texi (Fibonacci Numbers Algorithm): Ditto.
10300         (Assigning Floats): Clarify mpf_swap swaps the precisions too.
10301         (Low-level Functions): Try to be clearer about negative cofactors.
10302
10303 2001-02-21  Torbjorn Granlund  <tege@swox.com>
10304
10305         * mpn/sparc64/copyi.asm: Streamline for small operands.
10306         * mpn/sparc64/add_n.asm: Likewise.
10307         * mpn/sparc64/sub_n.asm: Likewise.
10308
10309         * mpn/sparc64/copyd.asm: New file.
10310
10311 2001-02-20  Torbjorn Granlund  <tege@swox.com>
10312
10313         * mpn/sparc64/lshift.asm: Rewrite.
10314         * mpn/sparc64/rshift.asm: Rewrite.
10315
10316 2001-02-19  Torbjorn Granlund  <tege@swox.com>
10317
10318         * mpn/sparc64/add_n.asm: Rewrite using `majority' logic.
10319         * mpn/sparc64/sub_n.asm: Likewise.
10320
10321         * tune/tuneup.c (all): Recognise DECC and MIPSpro compilers.
10322
10323         * mpn/pa64/sqr_diagonal.asm: Use PROLOGUE/EPILOGUE.
10324         * mpn/pa642/sqr_diagonal.asm: Likewise.
10325
10326         * configure.in (HAVE_ABI_$abi): Disable for now.
10327
10328         * mpn/asm-defs.m4 (PROLOGUE): Use LABEL_SUFFIX.
10329
10330         * acinclude.m4 (GMP_ASM_ATTR): New check, for hppa oddities.
10331
10332 2001-02-18  Torbjorn Granlund  <tege@swox.com>
10333
10334         * mpn/hppa/hppa1_1/gmp-mparam.h: New file.
10335         * mpn/hppa/hppa2_0/gmp-mparam.h: New file.
10336
10337         * mpn/pa64/sqr_diagonal.asm: New file.
10338         * mpn/pa64w/sqr_diagonal.asm: New file.
10339         * mpn/hppa/hppa1_1/sqr_diagonal.asm: New file.
10340         * mpn/hppa/hppa2_0/sqr_diagonal.asm: New file.
10341
10342         * mpn/sparc32/v9/add_n.asm: Use `fitod' instead of `fxtod' for dummy
10343         FA-pipeline insns.
10344         * mpn/sparc32/v9/sub_n.asm: Likewise.
10345
10346 2001-02-18  Kevin Ryde  <kevin@swox.se>
10347
10348         * gmp.texi (Known Build Problems): Notes on make, $* and K&R, misc
10349         tweaks elsewhere.
10350         (Low-level Functions): Use {} notation in mpn_sqrtrem.
10351         (Basecase Multiplication): Mention BASECASE_SQR_THRESHOLD.
10352
10353         * mpfr/isnan.c (mpfr_number_p): Infinity is not a number.
10354         * mpfr/out_str.c: Pass strlen+1 for the block size to free.
10355         * mpfr/get_str.c: Correction for realloc to strlen+1.
10356
10357         * acinclude.m4 (GMP_C_SIZES): Generate an error if mp_limb_t doesn't
10358         seem to work for some reason.
10359
10360 2001-02-16  Torbjorn Granlund  <tege@swox.com>
10361
10362         * mpn/sparc32/v9/gmp-mparam.h: Retune.
10363
10364         * mpn/sparc32/v9/add_n.asm: New file.
10365         * mpn/sparc32/v9/sub_n.asm: New file.
10366
10367         * mpn/sparc32/v9/mul_1.asm: Tune function entry.
10368         * mpn/sparc32/v9/addmul_1.asm: Likewise.
10369         * mpn/sparc32/v9/submul_1.asm: Likewise.
10370
10371         * mpn/sparc32/v9/sqr_diagonal.asm: New file.
10372
10373 2001-02-16  Kevin Ryde  <kevin@swox.se>
10374
10375         * configure.in: Fix flags selection when $CC is a compiler known to us.
10376
10377         * demos/expr/exprfr.c (e_mpfr_cos, e_mpfr_sin): mpfr_sin_cos now
10378         allows NULL for one parameter.
10379
10380         * mpfr/*: Update to 20010215.
10381         * mpfr/trunc.c: Use -DOPERATION scheme, and gmp mpn_zero_p.
10382         * mpfr/sqrt.c: Use plain mpn_sqrtrem, not mpn_sqrtrem_new.
10383         * mpfr/sqrtrem.c: Remove file.
10384         * mpfr/Makefile.am (libmpfr_a_SOURCES): Add isnan.c and set_ui.c,
10385         remove sqrtrem.c and srandom.h.
10386
10387         * configfsf.guess: Update to 2001-02-13.
10388         * configfsf.sub: Update to 2001-02-16.
10389         * config.sub (j90, t90): Remove special handing, configfsf.sub now ok.
10390
10391         * Makefile.am (MPF_OBJECTS): Add a couple of missing $U's.
10392
10393         * tune/tuneup.c: Identify compiler used (GCC and Sun C so far).
10394
10395 2001-02-15  Torbjorn Granlund  <tege@swox.com>
10396
10397         * mpn/sparc32/v9/mul_1.asm: Change `ld' to `lduw' and `st' to `stw'.
10398         * mpn/sparc32/v9/addmul_1.asm: Likewise.
10399         * mpn/sparc32/v9/submul_1.asm: Likewise.
10400
10401 2001-02-14  Torbjorn Granlund  <tege@swox.com>
10402
10403         * mpn/mips3/mips.m4: New file.
10404         * configure.in (mips*-*-irix[6789]*): Use mips3/mips.m4.
10405
10406         * mpn/powerpc64/sqr_diagonal.asm: New file.
10407
10408         * mpn/mips3/sqr_diagonal.asm: New file.
10409
10410 2001-02-12  Torbjorn Granlund  <tege@swox.com>
10411
10412         * mpn/powerpc32/sqr_diagonal.asm: New file.
10413
10414         * mpn/generic/sqr_basecase.c: Remove declaration of mpn_sqr_diagonal.
10415         Fix typo in header comment.
10416
10417 2001-02-12  Kevin Ryde  <kevin@swox.se>
10418
10419         * mpn/generic/mul.c, mpn/generic/mul_n.c, gmp-impl.h: Use
10420         mpn_mul_basecase for squaring below new BASECASE_SQR_THRESHOLD.
10421         * tune/tuneup.c gmp-impl.h: Tune BASECASE_SQR_THRESHOLD.
10422
10423         * Makefile.am (libgmp.la, libmp.la): Revert change to build from
10424         mpn/libmpn.la etc, go back to explicitly listed objects.
10425
10426         * configure.in: Recognise sparc64-*-*, not just sparc64-*-linux*.
10427
10428 2001-02-11  Torbjorn Granlund  <tege@swox.com>
10429
10430         * mpn/asm-defs.m4 (sqr_diagonal): New define_mpn.
10431
10432         * mpn/alpha/sqr_diagonal.asm: New file.
10433
10434 2001-02-11  Kevin Ryde  <kevin@swox.se>
10435
10436         * gmp.texi (Low-level Functions): Note mpn_get_str clobbers its input
10437         plus 1 extra limb.
10438
10439         * mpfr/add.c,agm.c,exp2.c,exp3.c,generic.c,log2.c,pi.c,print_raw.c,
10440         set_d.c,sin_cos.c,sqrtrem.c,sub.c: Apply some tweaks for K&R.
10441         * tests/mpz/reuse.c, tests/mpq/t-md_2exp.c, demos/pexpr.c,
10442         demos/expr/t-expr.c: Ditto.
10443
10444         * configure.in (HAVE_ABI_$abi): New define in config.m4.
10445
10446         * gmp-impl.h (mpn_sqr_diagonal): Add prototype and define.
10447         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
10448         mpn_sqr_diagonal.
10449
10450         * gmp.texi, acinclude.m4: Mention x86 solaris 2.7 has the reg->reg
10451         movq bug the same as 2.6.
10452
10453         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr-test.h and mpf2mpfr.h.
10454
10455         * mpn/x86/README: Merge contents of README.family.
10456         * mpn/x86/README.family: Remove file.
10457
10458         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mode1o, gcd_finda,
10459         invert_limb, sqr_diagonal; remove mod_1_rs; sort alphabetically.
10460
10461 2001-02-10  Torbjorn Granlund  <tege@swox.com>
10462
10463         * configure.in (gmp_mpn_functions_optional): List sqr_diagonal.
10464
10465         * mpn/powerpc32/aix.m4: Use unnamed csects.
10466         * mpn/powerpc64/aix.m4: Likewise.
10467
10468         * acconfig.h: Add #undef of mpn_sqr_diagonal.
10469         Remove lots of spacing.
10470
10471         * configure.in (syntax testing section): Match power* instead of
10472         powerpc*.
10473         * mpn/power: Convert files to `.asm'.
10474         Prefix umul_ppmm and sdiv_qrnnd.
10475         Update some comments.
10476
10477 2001-02-09  Kevin Ryde  <kevin@swox.se>
10478
10479         * acconfig.h: Add HAVE_NATIVE_mpn_modexact_1_odd and
10480         HAVE_NATIVE_mpn_modexact_1c_odd.
10481
10482         * configure.in (CCAS): Don't override a user selection.
10483
10484         * mpq/cmp_ui.c: DIVIDE_BY_ZERO if den2==0.
10485
10486 2001-02-08  Torbjorn Granlund  <tege@swox.com>
10487
10488         * mpn/generic/sqr_basecase.c: Use mpn_sqr_diagonal when appropriate.
10489
10490 2001-02-07  Kevin Ryde  <kevin@swox.se>
10491
10492         * gmp.texi (Low-level Functions): mpn_preinv_mod_1 now undocumented.
10493
10494         * mpn/generic/random2.c (myrandom): Use rand() on mingw.
10495
10496         * mpn/alpha/gmp-mparam.h: Update tuned parameters.
10497
10498 2001-02-05  Torbjorn Granlund  <tege@swox.com>
10499
10500         * mpn/alpha/ev6/gmp-mparam.h: Retune.
10501
10502 2001-02-05  Kevin Ryde  <kevin@swox.se>
10503
10504         * Makefile.am (libgmp, libmp): Construct from mpn/libmpn.la etc rather
10505         than explicitly listed objects.
10506
10507         * urandom.h: Use rand() on mingw.
10508
10509         * mpn/powerpc64/lshift.asm,addsub_n.asm: Use r1 not 1.
10510
10511 2001-02-04  Torbjorn Granlund  <tege@swox.com>
10512
10513         * mpn/ia64/copyi.asm: New file.
10514         * mpn/ia64/copyd.asm: New file.
10515
10516 2001-02-04  Kevin Ryde  <kevin@swox.se>
10517
10518         * mpn/alpha/ev5/gmp-mparam.h, mpn/mips3/gmp-mparam.h,
10519         mpn/powerpc32/gmp-mparam.h, mpn/powerpc64/gmp-mparam.h,
10520         mpn/sparc64/gmp-mparam.h, mpn/x86/*/gmp-mparam.h:
10521         Update tuned parameters.
10522
10523         * mpn/x86/i486: New directory.
10524         * configure.in (i486-*-*): Use it.
10525         * mpn/x86/i486/gmp-mparam.h: New file.
10526
10527         * mpn/x86/pentium/mode1o.asm: New file.
10528         * mpn/x86/p6/mode1o.asm: New file.
10529
10530         * tune/many.pl: Use $(ASMFLAGS_PIC) and $(CFLAGS_PIC).
10531
10532         * gmp.texi (Integer Division): Another rewording of 2exp divisions.
10533
10534 2001-02-03  Torbjorn Granlund  <tege@swox.com>
10535
10536         * mpn/arm/gmp-mparam.h: Tune.
10537
10538         * mpn/ia64/popcount.asm: Put a `;;' break at end of main loop.
10539
10540         * configure.in (arm*-*-*): Set gcc_cflags in order to pass
10541         $fomit_frame_pointer.
10542
10543         * tests/mpz/t-mul.c (base_mul): Remove an unused variable.
10544
10545 2001-02-02  Torbjorn Granlund  <tege@swox.com>
10546
10547         * demos/pexpr.c (TIME): New macro.
10548         (main): Use TIME--print timing more accurately.
10549         (setup_error_handler): Increase RLIMIT_DATA to 16 Mibyte.
10550
10551         * longlong.h (arm): Add __CLOBBER_CC to add_ssaaaa and sub_ddmmss.
10552
10553 2001-02-02  Kevin Ryde  <kevin@swox.se>
10554
10555         * configure.in: Don't remove gmp-mparam.h and mpn source links under
10556         --no-create since in that case they're not re-created.
10557
10558         * demos/expr: New directory.
10559         * Makefile.am (SUBDIRS, allprogs): Add it.
10560         * demos/expr/README, Makefile.am, expr.c, exprv.c, exprz.c, exprza.c,
10561         exprq.c, exprqa.c, exprfa.c, exprf.c, exprfr.c, exprfra.c, expr.h,
10562         expr-impl-h.in, run-expr.c, t-expr.c: New files.
10563         * configure.in: Generate demos/expr/Makefile & demos/expr/expr-impl.h.
10564
10565         * Makefile.am: Remove mpfr from main libgmp.
10566         * mpfr/Makefile.am: Build and install separate libmpfr.a.
10567         * mpfr/*: Update to mpfr 2001.
10568
10569         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 2.
10570         * Makefile.am (libtool -version-info): Bump appropriately.
10571         * NEWS: Updates.
10572
10573         * tune/divrem1div.c, tune/divrem1inv.c, tune/divrem2div.c,
10574         tune/divrem2inv.c: Renamed from divrem_1_div.c, divrem_1_inv.c,
10575         divrem_2_div.c, divrem_2_inv.c, to be unique in DOS 8.3 filenames.
10576         * tune/Makefile.am (libspeed_la_SOURCES): Update.
10577
10578         * mpn/x86/*/README, mpn/x86/README.family: Misc updates.
10579         * tune/README: Misc updates.
10580         * doc/configuration: Misc updates.
10581
10582         * mpn/x86/pentium/mmx/gmp-mparam.h: Change UDIV_PREINV_TIME to
10583         UDIV_NORM_PREINV_TIME.
10584
10585         * mpz/pprime_p.c: Use ASSERT_ALWAYS instead of abort.
10586
10587         * rand.c (__gmp_rand_lc_scheme): Add "const".
10588         (struct __gmp_rand_lc_scheme_struct): Make astr "const char *".
10589
10590         * demos/calc/calc.y, demos/calc/calclex.l: Add kron function.
10591
10592         * tests/devel/try.c: Partial rewrite, new scheme of function types,
10593         allow result validation functions, add sqrtrem and jacobi testing.
10594         * tune/many.pl: Corresponding updates.
10595         * tests/devel/Makefile.am: Add a convenience rule for libtests.la.
10596
10597         * tests/refmpz.c: New file.
10598         * tests/Makefile.am: Add it.
10599         * tests/misc.c (mpz_erandomb, mpz_erandomb_nonzero): New functions.
10600         * tests/tests.h: Add prototypes.
10601
10602         * mpn/x86/k6/cross.pl: Add a couple more exceptions.
10603
10604         * gmp.texi: Don't use @nicode{'\0'}, it doesn't come out right in tex.
10605         (Introduction to GMP): Mention Cray vector systems.
10606         (Build Options): Describe --enable-mpfr, refer to its manual.  Add
10607         Crays under supported CPUs.
10608         (Debugging): Add notes on source file paths.
10609         (Autoconf): New section.
10610         (Assigning Integers): Note truncation by mpz_set_d, mpz_set_q and
10611         mpz_set_f.
10612         (Converting Integers): Note the size mpz_get_str allocates.
10613         (Floating-point Functions): Rewrite introduction, clarifying some
10614         points about precision handling.
10615         (Converting Floats): Note the size mpf_get_str allocates, and that it
10616         gives an empty string for zero.  Add mpf_get_si and mpf_get_ui.
10617         (Float Comparison): Give the formula mpf_reldiff calculates.
10618         (Miscellaneous Float Functions): Add mpf_integer_p and mpf_fits_*_p.
10619         (Random Number Functions): Misc rewordings for clarity.
10620         (Random State Initialization): Ditto.
10621         (Custom Allocation): Remove note on deallocate_function called with 0,
10622         misc rewording and clarifications.
10623         (Exact Remainder): New section.
10624         (Binary GCD): A few words on initial reduction using division.
10625         (Accelerated GCD): Refer to exact remainder section.
10626         (Extended GCD): Extra remarks on single versus double selection.
10627         (Jacobi Symbol): Update for mpz/jacobi.c rewrite and modexact_1_odd.
10628         (Modular Powering Algorithm): Refer to exact remainder section.
10629         (Assembler SIMD Instructions): Update remarks on MMX.
10630         (Contributors): Amend to "Divide and Conquer" division.
10631         (References): Tweak some formatting.  Add "Proof of GMP Fast Division
10632         and Square Root Implementations" by Paul Zimmermann.
10633
10634 2001-01-31  Torbjorn Granlund  <tege@swox.com>
10635
10636         * configure.in: Don't ever pass -mips3; let ABI flags imply ISA.
10637
10638 2001-01-31  Kevin Ryde  <kevin@swox.se>
10639
10640         * tune/time.c: Remove unnecessary longlong.h.
10641         (speed_endtime): Add some extra diagnostics.
10642
10643         * tests/mpz/t-fdiv_ui.c, tests/mpz/t-tdiv_ui.c: Use unsigned long for
10644         the divisor, not mp_limb_t.
10645         * tests/mpz/t-jac.c (try_base): Use %llu for long long limb.
10646         * tests/trace.c: Add <string.h> for strlen.
10647
10648         * tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
10649         frequency" of 0, allow "BogoMIPS" as well as "bogomips".
10650
10651         * macos/Makefile.in: Add mpf/fits_s.c and mpf/fits_u.c objects.
10652
10653 2001-01-30  Torbjorn Granlund  <tege@swox.com>
10654
10655         * longlong.h: Add add_ssaaaa and sub_ddmmss for 64-bit sparc.
10656
10657 2001-01-29  Torbjorn Granlund  <tege@swox.com>
10658
10659         * mpn/powerpc64/addmul_1.asm: Prefix registers with an `r'.
10660         * mpn/powerpc64/submul_1.asm: Likewise.
10661         * mpn/powerpc64/mul_1.asm: Likewise.
10662
10663         * configure.in (alpha*-*-*): Amend last change to handle pca*.
10664
10665 2001-01-29  Kevin Ryde  <kevin@swox.se>
10666
10667         * tune/speed.h (SPEED_ROUTINE_INVERT_LIMB_CALL): Don't let the
10668         compiler optimize everything away.
10669
10670         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Measure
10671         operator_div, operator_mod, mpn_divrem_2_div, mpn_divrem_2_inv,
10672         mpn_sb_divrem_m3, mpn_sb_divrem_m3_div, mpn_sb_divrem_m3_inv,
10673         mpn_dc_divrem_sb_div, mpn_dc_divrem_sb_inv.
10674         * tune/divrem_2_div.c, tune/divrem_2_inv.c, tune/sb_div.c,
10675         tune/sb_inv.c: New files.
10676
10677         * tune/tuneup.c, gmp-impl.h, tune/speed.h, tune/common.c,
10678         tune/Makefile.am: Tune SB_PREINV_THRESHOLD and DIVREM_2_THRESHOLD.
10679
10680         * mpn/generic/divrem_2.c: Use new DIVREM_2_THRESHOLD.
10681         * mpn/generic/sb_divrem_mn.c: Use new SB_PREINV_THRESHOLD.
10682
10683         * mpn/x86/p6/mmx/lshift.asm, mpn/x86/p6/mmx/rshift.asm: New files,
10684         just m4 include()ing the P55 code.
10685         * configure.in (pentium[23]-*-*): Remove x86/pentium/mmx from path.
10686
10687 2001-01-27  Kevin Ryde  <kevin@swox.se>
10688
10689         * configure.in (AC_CHECK_FUNCS): Add srand48.
10690         * tune/speed.c: Use this test.
10691
10692         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): Allow "egcs-" prefix on gcc
10693         --version, warn if the format is unrecognised.
10694         (GMP_COMPARE_GE): Guard against empty $1 not only on last arg.
10695         (GMP_INIT, GMP_FINISH, GMP_PROG_M4): Obscure or eliminate literal
10696         "dnl"s since autoconf thinks they indicate faulty macros.
10697
10698         * mpz/get_str.c, mpf/get_str.c: Make allocated string block exactly
10699         strlen(str)+1 bytes.
10700         * mpz/dump.c, mpf/dump.c, tests/mpz/convert.c: Use this size when
10701         freeing.
10702         * tests/mpf/t-conv.c: Ditto, and ensure x==0 is exercised.
10703
10704         * tests/mpz/t-fits.c: New file.
10705         * tests/mpz/Makefile.am: Add it.
10706
10707         * tests/mpf/t-fits.c: New file.
10708         * tests/mpf/t-get_si.c: New file.
10709         * tests/mpf/t-int.c: New file.
10710         * tests/mpf/Makefile.am: Add them.
10711
10712         * mpf/fits_s.c: New file.
10713         * mpf/fits_u.c: New file.
10714         * mpf/get_si.c: New file.
10715         * mpf/get_ui.c: New file.
10716         * mpf/int_p.c: New file.
10717         * Makefile.am, mpf/Makefile.am: Add them.
10718         * gmp-h.in (mpf_fits_*_p, mpf_get_si, mpf_get_ui, mpf_integer_p): Add
10719         prototypes.
10720
10721         * tests/memory.c (tests_allocate, tests_reallocate): Guard against
10722         size==0.
10723
10724         * tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
10725         tests_end.
10726
10727         * gmp-impl.h (USE_LEADING_REGPARM): Fix conditionals.
10728
10729 2001-01-23  Kevin Ryde  <kevin@swox.se>
10730
10731         * configure.in, mpn/Makeasm.am (ASMFLAGS_PIC): New substitution,
10732         allowing -DPIC to be suppressed on cygwin.
10733         (CFLAGS_PIC): New substitution, use it and $(CCAS) directly, rather
10734         than $(LIBTOOL), avoiding a problem with FreeBSD 2.2.8.
10735
10736         * mpn/x86/k6/mode1o.asm, mpn/x86/k7/mode1o.asm: Remove an unnecessary
10737         +[.-L(here)] from _GLOBAL_OFFSET_TABLE_, avoids a segv from gas 1.92.3.
10738         * mpn/x86/README.family: Add notes on the problem.
10739
10740 2001-01-20  Torbjorn Granlund  <tege@swox.com>
10741
10742         * configure.in (alpha*-*-*): Default `flavour' to ev4.
10743
10744 2001-01-19  Kevin Ryde  <kevin@swox.se>
10745
10746         * assert.c, gmp-impl.h (__gmp_assert_fail): Change return type to
10747         void, since it's no longer used in expressions.
10748
10749         * mpn/x86/addsub_n.S: Remove file, since it doesn't work and it upsets
10750         tune/many.pl.
10751
10752         * mpz/jacobi.c: Rewrite, but still binary algorithm; accept zero and
10753         negative denominators; merge mpz_jacobi and mpz_legendre, add
10754         mpz_kronecker; use mpn directly, add special cases for size==1.
10755         * gmp.texi (Number Theoretic Functions): Update.
10756         * gmp-h.in (mpz_kronecker): Add prototype.
10757         * gmp-impl.h (USE_LEADING_REGPARM): New macro.
10758         * tests/mpz/t-jac.c: Test mpz_kronecker.
10759         * mpz/legendre.c: Remove file.
10760         * Makefile.am, mpz/Makefile.am: Update.
10761
10762         * longlong.h (alpha count_leading_zeros): Use __attribute__ ((const))
10763         when possible, add parameter to prototype.
10764         (ia64 udiv_qrnnd): Use for all compilers, not just gcc.
10765         (pentium count_trailing_zeros): Use count_leading_zeros.
10766
10767         * acinclude.m4 (GMP_C_ATTRIBUTE_CONST, GMP_C_ATTRIBUTE_NORETURN): New
10768         macros.
10769         * configure.in: Use them.
10770         * gmp-impl.h (ATTRIBUTE_CONST, ATTRIBUTE_NORETURN): New macros.
10771         (mpn_invert_limb): Add ATTRIBUTE_CONST.
10772         (__gmp_assert_fail): Add ATTRIBUTE_NORETURN.
10773
10774 2001-01-18  Kevin Ryde  <kevin@swox.se>
10775
10776         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
10777         __gmp_free_func): Move prototypes from gmp-impl.h to gmp-h.in, for the
10778         benefit of gmp++.h.
10779
10780         * gmp-impl.h, tests/misc.c, tests/tests.h: Move MPZ_SET_STR_OR_ABORT
10781         and MPF_SET_STR_OR_ABORT to mpz_set_str_or_abort and
10782         mpf_set_str_or_abort in libtests.
10783         * tests/mpz/convert.c, tests/mpz/t-bin.c, tests/mpz/t-get_si.c,
10784         tests/mpz/t-jac.c, tests/mpz/t-misc.c, tests/mpq/t-md_2exp.c,
10785         tests/mpq/t-set_f.c, tests/mpf/t-conv.c, tests/mpf/t-misc.c: Update.
10786
10787         * mpn/generic/sqrtrem.c: Use MPN_COPY_INCR (for when rp==NULL).
10788
10789         * tests/mpz/reuse.c: Only run mpz_divexact_gcd on positive divisors.
10790
10791 2001-01-18  Torbjorn Granlund  <tege@swox.com>
10792
10793         * demos/pexpr.c (main): Accept -vml option.
10794         (fns): List `hamdist', `pow', `nextprime'.
10795         (mpz_eval_expr): Return -1 for `popc' of negative.
10796         (mpz_eval_expr): Handle `hamdist', `pow', `nextprime'.
10797
10798 2001-01-15  Kevin Ryde  <kevin@swox.se>
10799
10800         * mpn/alpha/ev5/mode1o.c: New file.
10801
10802         * tune/freq.c (speed_cpu_frequency_measure): Check cycles_works_p
10803         before running speed_cyclecounter.
10804         * tune/speed.h (cycles_works_p): Add prototype.
10805
10806 2001-01-13  Torbjorn Granlund  <tege@swox.com>
10807
10808         * tests/rand/t-rand.c (farr): Fix typo.
10809         (zarr): Fix typo.
10810
10811 2001-01-12  Kevin Ryde  <kevin@swox.se>
10812
10813         * mpz/kronsz.c: Don't depend on right shifting a negative.
10814
10815         * mpn/x86/gmp-mparam.h: New file.
10816
10817         * mpn/x86/pentium/mmx/mul_1.asm: New file.
10818
10819 2001-01-11  Torbjorn Granlund  <tege@swox.com>
10820
10821         * mpz/kronsz.c: Temporary workaround for Cray right shift oddities.
10822         Explicitly compare against zero in tests.
10823
10824 2001-01-10  Kevin Ryde  <kevin@swox.se>
10825
10826         * mpz/kronzs.c: Don't depend on right shifting a negative.
10827
10828 2001-01-09  Torbjorn Granlund  <tege@swox.com>
10829
10830         * tests/t-constants.c: Disable some undefined tests.
10831         (CHECK_MAX_S): Remove workaround for gcc 2.95.2 bug recently added.
10832
10833 2001-01-09  Kevin Ryde  <kevin@swox.se>
10834
10835         * tests/t-constants.c: Add more diagnostics.
10836         (CHECK_MAX_S): Fix for gcc 2.95.2 -mpowerpc64 -maix64.
10837
10838         * mpn/x86/k6/mode1o.asm: New file.
10839         * mpn/x86/k7/mode1o.asm: New file.
10840
10841         * mpn/asm-defs.m4 (modexact_1_odd, modexact_1c_odd): New define_mpn's.
10842         (__clz_tab, modlimb_invert_table, PROLOGUE, EPILOGUE): Add asserts for
10843         GSYM_PREFIX.
10844         * mpn/x86/x86-defs.m4 (Zdisp): Add a movzbl.
10845
10846         * tests/mpz/t-jac.c (check_a_zero): New test.
10847         (check_squares_zi): Fix to use (a^2/b), not (a*b/b); revert last
10848         change avoiding a,b=0, both are fine.
10849         (try_2den): Don't use mpz_kronecker_ui for the expected answer.
10850         (try_*): Call abort rather than exit.
10851
10852         * mpz/kronzu.c, mpz/kronzs.c: Fix for a=0.
10853
10854         * tune/tuneup.c (USE_PREINV_MOD_1): Fix to use new DATA_HIGH_LT_R.
10855
10856 2001-01-08  Torbjorn Granlund  <tege@swox.com>
10857
10858         * urandom.h: Amend 2000-11-21 change to also handle cygwin.
10859
10860 2001-01-08  Kevin Ryde  <kevin@swox.se>
10861
10862         * tune/many.pl: Updates for move to tests/devel, add modexact_1_odd,
10863         don't assume C files can't have carry-in entrypoints, remove
10864         $(TRY_TESTS_OBJS) now in libtests.
10865
10866         * tests/devel/try.c, tests/refmpn.c, tests/tests.h: Remove
10867         mpn_mod_1_rshift testing.
10868
10869         * tune/tuneup.c (fft_step_size): Test for overflow using the actual
10870         mp_size_t, don't use BITS_PER_INT.
10871
10872         * tune/speed.c (r_string): "r" is a limb, use BITS_PER_MP_LIMB and
10873         change LONG_ONES to LIMB_ONES.
10874         * tune/time.c (M_2POWU): Use INT_MAX rather than BITS_PER_INT.
10875
10876         * extract-dbl.c (BITS_PER_PART): Use BITS_PER_MP_LIMB not
10877         BITS_PER_LONGINT.
10878
10879         * mpz/inp_raw.c, mpz/out_raw.c: Add private defines of BITS_PER_CHAR.
10880         * mpz/fac_ui.c, tests/mpz/t-fac_ui.c: Don't use BITS_PER_LONGINT.
10881         * tests/mpz/t-get_si.c: Don't use BITS_PER_LONGINT, do the LONG_MAX
10882         tests with some explicit code.
10883
10884         * mpn/*/gmp-mparam.h, acinclude.m4, tests/t-constants.c
10885         (BITS_PER_LONGINT, BITS_PER_INT, BITS_PER_SHORTINT, BITS_PER_CHAR):
10886         Remove defines, remove probings, remove tests.
10887
10888         * tune/tuneup.c (MODEXACT_1_ODD_THRESHOLD): Add tuning.
10889
10890         * tune/speed.c,speed.h,common.c: Add measuring of mpn_modexact_1_odd,
10891         mpn_gcd_finda, and an "N" form for mpn_gcd_1.
10892
10893         * tests/mpz/t-jac.c (check_squares_zi): Ensure random a,b != 0.
10894
10895 2001-01-07  Kevin Ryde  <kevin@swox.se>
10896
10897         * configure.in (gmp_mpn_functions): Add mode1o, remove mod_1_rs.
10898
10899         * mpn/generic/mod_1_rs.c: Remove file, no longer needed.
10900         * gmp-h.in (mpn_mod_1_rshift): Remove prototype and define.
10901
10902         * mpq/set_f.c: Use MPN_STRIP_LOW_ZEROS_NOT_ZERO.
10903
10904         * mpz/kronzu.c, mpz/kronzs.c, mpz/kronuz.c, mpz/kronsz.c: Use
10905         mpn_modexact_1_odd, new style MPN_STRIP_LOW_ZEROS_NOT_ZERO, and new
10906         JACOBI macros.  Various rearrangements supporting all this.
10907
10908         * mpn/generic/gcd_1.c: Use mpn_modexact_1_odd, reduce u%v if u much
10909         bigger than v when size==1, some rearrangements supporting this.
10910
10911         * gmp-impl.h (JACOBI_*): More macros, add some casts to "int".
10912         (MPN_STRIP_LOW_ZEROS_NOT_ZERO): Add a "low" parameter.
10913         (mpn_modexact_1_odd, mpn_modexact_1c_odd): Add prototype and defines.
10914         (MODEXACT_1_ODD_THRESHOLD): New threshold.
10915         (MPN_MOD_OR_MODEXACT_1_ODD, JACOBI_MOD_OR_MODEXACT_1_ODD): New macros.
10916
10917         * mpn/generic/mode1o.c: New file.
10918
10919         * tests/mpz/reuse.c: Add testing of mpz_divexact_gcd.
10920         * tests/mpz/t-fac_ui.c: Use libtests for memory leak checking.
10921         * tests/mpz/t-fib_ui.c: Add a usage comment.
10922
10923         * tests/mpz/bit.c: Use libtests.
10924         * tests/mpz/t-scan.c: Remove unused subroutines.
10925         * tests/devel/try.c: Use libtests, define PROT_NONE if the system
10926         doesn't.
10927
10928         * tests/spinner.c, tests/x86check.c: Use tests.h.
10929         * tests/trace.c: Use tests.h, add mpf_trace.
10930         * tests/refmpn.c: Use tests.h, add refmpn_malloc_limbs_aligned,
10931         refmpn_tstbit, refmpn_neg.
10932
10933         * tune/common.c, tune/speed.h: Update for functions moved to
10934         tests/misc.c.
10935
10936         * tune/Makefile.am, tests/mpz/Makefile.am, tests/mpq/Makefile.am,
10937         tests/mpf/Makefile.am: Use tests/libtests.la.
10938
10939         * configure.in (AC_OUTPUT): Update for new directories.
10940         (x86 CALLING_CONVENTIONS_OBJS): Use .lo for libtests.la, allow
10941         ansi2knr on x86check.c.
10942
10943         * tests/Makefile.am: Establish new libtests.la convenience library,
10944         add mpz, mpq, mpf, mpbsd subdirectories.
10945         * tests/tests.h: New file.
10946         * mpn/tests/ref.h,try.h: Remove files, now in tests.h.
10947
10948         * tests/mpf/ref.c: Move to tests/refmpf.c, rename functions to refmpf.
10949         * tests/mpf/t-add.c, tests/mpf/t-sub.c: Use libtests.
10950         * tests/mpf/Makefile.am: Update.
10951
10952         * tests/memory.c: New file.
10953         * tests/misc.c: New file, a few subroutines from the test programs.
10954
10955         * mpz/tests, mpq/tests, mpf/tests, mpbsd/tests: Move directories to
10956         tests/mpz etc.
10957         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpbsd/Makefile.am
10958         (SUBDIRS): Remove.
10959
10960         * tests/devel: New directory.
10961         * mpn/tests/*.c: Move programs to tests/devel.
10962         * mpn/tests/Makefile.am, mpn/tests/README: Move to tests/devel, update.
10963
10964         * mpn/tests/ref.c: Move to tests/refmpn.c.
10965         * mpn/tests/spinner.c,trace.c,x86call.asm,x86check.c: Move to tests
10966         directory.
10967
10968         * tests/t-constants.c: Add checks of HIGHBIT, MAX and MIN constants,
10969         simplify ANSI vs K&R stringizing, use correct printf format types, do
10970         all tests before aborting.
10971
10972 2001-01-05  Torbjorn Granlund  <tege@swox.com>
10973
10974         * mpn/cray/ieee/gmp-mparam.h: Retune.
10975
10976 2001-01-05  Kevin Ryde  <kevin@swox.se>
10977
10978         * configure.in (mp.h): Only create this under --enable-mpbsd.
10979
10980         * demos/calc: New subdirectory, move demos/calc* to it.
10981         * demos/calc/Makefile.am: New file, split from demos/Makefile.am.
10982         * demos/Makefile.am: Update.
10983         * configure.in (AC_OUTPUT): Add demos/calc/Makefile.
10984
10985         * tests/t-constants.c (CALC_BITS_PER_TYPE etc): Use a run-time test
10986         for how many bits work in a give type, don't assume bits==8*sizeof.
10987
10988 2001-01-04  Kevin Ryde  <kevin@swox.se>
10989
10990         * mpz/fits_s.c, mpz/fits_u.c: New files, split from fits.c, use plain
10991         UINT_MAX etc, not MPZ_FITS_UTYPE_SDT etc.
10992         * mpz/fits.c: Remove file.
10993         * mpz/Makefile.am, macos/Makefile.in: Update.
10994
10995         * gmp-impl.h (UNSIGNED_TYPE_MAX etc): Remove these generic forms.
10996         (MPZ_FITS_[SU]TYPE_SDT): Remove these.
10997         (UINT_MAX etc): Provide a full set of defaults.
10998         * gmp-h.in (__GMP_MP_SIZE_T_INT): New define.
10999
11000         * mpz/tests/t-scan.c: New file.
11001         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
11002
11003         * mpz/scan0.c, mpz/scan1.c: Rewrite, don't read beyond allocated
11004         memory, support negatives, return ULONG_MAX for no bit found.
11005         * gmp.texi (Integer Logic and Bit Fiddling): Update.
11006
11007 2001-01-03  Torbjorn Granlund  <tege@swox.com>
11008
11009         * mpz/tests/dive.c: Generate test operands using new random functions.
11010         * mpz/tests/io.c: Likewise.
11011         * mpz/tests/logic.c: Likewise.
11012         * mpz/tests/t-2exp.c: Likewise.
11013
11014         * stack-alloc.c (__gmp_tmp_alloc): Round `now' to required alignment.
11015
11016         * stack-alloc.h (__TMP_ALIGN): Append `L'.
11017
11018         * gmp-impl.h: For Cray, #include limits.h.
11019         (LONG_MIN): New #define.
11020         (ULONG_HIGHBIT): #define in terms of ULONG_MAX.
11021         (LONG_HIGHBIT): #define as LONG_MIN.
11022         (USHRT_MAX): New name for USHORT_MAX.
11023         (SHRT_MAX): New name for SHORT_MAX.
11024         (SHRT_MIN): New #define.
11025         (USHORT_HIGHBIT,SHORT_HIGHBIT): Removed.
11026
11027         * mpbsd/tests/t-misc.c (check_itom [data]): *SHORT* => *SHRT*;
11028         remove code disabling a test for Cray.
11029
11030         * tests/t-constants.c (CHECK_CONSTANT): Cast parameters to long.
11031
11032         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove unused variable `t'.
11033         (mpn_kara_mul_n): Likewise.
11034
11035         * mpz/fac_ui.c (MPZ_SET_1_NZ): Actually use `__z'.
11036
11037         * mpz/tests/t-jac.c
11038         (main, check_squares_zi): Generate test operands using new random
11039         functions.
11040
11041         All changes below on this date for enabling `make; make check'
11042         with C++ compilers:
11043
11044         * mpz/tests/t-pow_ui.c (debug_mp, ref_mpz_pow_ui): Provide prototypes.
11045
11046         * mpz/tests/t-mul.c (debug_mp, base_mul, ref_mpz_mul):
11047         Provide prototypes.
11048         (dump_abort): Provide prototype and declare properly for C++.
11049
11050         * mpz/tests/t-jac.c: #include stdlib.h and sys/time.h.
11051
11052         * mpz/tests/t-fdiv.c
11053         (dump_abort): Provide prototype and declare properly for C++.
11054         (debug_mp): Provide prototype.
11055         * mpz/tests/t-fdiv_ui.c: Likewise.
11056         * mpz/tests/t-gcd.c: Likewise.
11057         * mpz/tests/t-powm.c: Likewise.
11058         * mpz/tests/t-powm_ui.c: Likewise.
11059         * mpz/tests/t-sqrtrem.c: Likewise.
11060         * mpz/tests/t-tdiv_ui.c: Likewise.
11061         * mpz/tests/t-tdiv.c: Likewise.
11062
11063         * mpz/tests/t-2exp.c: #include stdlib.h and sys/time.h.
11064         Remove #include of longlong.h.
11065
11066         * mpz/tests/io.c: #include config.h, stdlib.h, sys/time.h, and
11067         conditionally unistd.h.
11068
11069         * mpz/tests/dive.c: #include stdlib.h and sys/time.h.
11070         (dump_abort): Provide prototype and declare properly for C++.
11071         (debug_mp): Provide prototype.
11072         * mpz/tests/logic.c: Likewise.
11073
11074         * mpz/tests/convert.c (debug_mp): Provide prototype.
11075         * mpz/tests/t-root.c (debug_mp): Likewise.
11076
11077         * mpz/tests/bit.c: #include stdlib.h and sys/time.h.
11078
11079         * mpq/tests/t-get_d.c: #include stdlib.h and sys/time.h.
11080         (dump): Provide prototype and declare properly for C++.
11081
11082         * mpq/tests/t-cmp_ui.c: #include stdio.h, stdlib.h and sys/time.h.
11083         (ref_mpq_cmp_ui): Declare properly for C++.
11084
11085         * mpq/tests/t-cmp.c: #include stdlib.h and sys/time.h.
11086         (ref_mpq_cmp): Declare properly for C++.
11087         (dump): Delete unused function.
11088
11089         * mpf/random2.c (myrandom): New function.
11090         (mpf_random2): Use it.
11091
11092         * mpn/generic/random2.c: #include stdlib.h (for random/mrand48).
11093         (myrandom): New function.
11094         (mpn_random2): Use it.
11095
11096         * mpf/tests/t-add.c: #include stdlib.h and sys/time.h.
11097         (oo): Remove unused function.
11098         * mpf/tests/t-conv.c: Likewise.
11099         * mpf/tests/t-sub.c: Likewise.
11100         * mpf/tests/t-dm2exp.c: Likewise.
11101         * mpf/tests/t-muldiv.c: Likewise.
11102         * mpf/tests/t-sqrt.c: Likewise.
11103
11104         * mpf/tests/reuse.c: #include stdlib.h and sys/time.h.
11105         Use PROTO on some typedefs.
11106         (oo): Remove function.
11107         (dump_abort): Call mpf_dump instead of oo.
11108
11109         * mpf/set_str.c: #include stdlib.h (for strtol).
11110
11111         * mpf/random2.c: #include stdlib.h (for random/mrand48).
11112         * mpn/alpha/udiv_arnnd: File deleted.
11113
11114         * Remove K&R function headers.
11115
11116 2001-01-02  Torbjorn Granlund  <tege@swox.com>
11117
11118         * mpn/generic/mul.c: Clean up spacing and indentation.
11119
11120         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Use mpn_decr_u.
11121         Clean up spacing and indentation.
11122
11123         * extract-dbl.c: Generalize to handle smaller limb sizes.
11124
11125 2001-01-01  Torbjorn Granlund  <tege@swox.com>
11126
11127         * mpbsd/mout.c: Output newline after "0".
11128
11129 2000-12-31  Torbjorn Granlund  <tege@swox.com>
11130
11131         * ltmain.sh: Remove space between `#!' and `$SHELL' when generating
11132         `libtool'.
11133
11134         * mpbsd/tests/t-misc.c (check_itom): Exclude test for all Cray
11135         vector systems.  Correct comment.
11136
11137 2000-12-31  Kevin Ryde  <kevin@swox.se>
11138
11139         * gmp.texi (ABI and ISA): New enough gcc needed for mips n32 etc, gcc
11140         2.95 needed for sparc 64-bit ABI, gcc 2.8 needed for -mv8plus.
11141
11142         * configure.in ([cjt]90,sv1-cray-unicos*): Preserve user specified
11143         MPN_PATH, amend test program indenting.
11144         (none-*-*): Add -DNO_ASM to gcc to disable longlong.h asm macros in
11145         generic C.
11146
11147         * config.sub (j90, t90): Preserve these, don't let configfsf.sub turn
11148         them into c90.
11149
11150         * config.guess (m68k-*-nextstep*,m68k-*-openstep*): Don't transform
11151         m68k to m68020, since m68k is already interpreted as 68020.
11152
11153 2000-12-30  Kevin Ryde  <kevin@swox.se>
11154
11155         * mpq/neg.c: Rewrite, use mpn, avoid denominator copy if unnecessary.
11156
11157         * mpz/tstbit.c: Rewrite, slightly simplified.
11158         * mpz/tests/bit.c (check_tstbit): New test, and add a couple more
11159         diagnostics elsewhere.
11160
11161         * configure.in (x86 gcc_cflags_cpu): Add -m486 for gcc 2.7.2.
11162         (ccbase): Only use a known compiler in eval statements (avoids
11163         problems with non-symbol characters).
11164         (ccbase): Use GMP_PROG_CC_IS_GNU to identify gcc installed under a
11165         different name.
11166         (cclist): Use same style $abi as other variables.
11167
11168         * acinclude.m4 (GMP_PROG_CC_IS_GNU): New macro.
11169         (GMP_GCC_MARCH_PENTIUMPRO): Use $ccbase to identify gcc.
11170         (GMP_ASM_TYPE): Define TYPE to empty, not "dnl", when no .type needed.
11171         (GMP_ASM_SIZE): Ditto for SIZE, which ensures EPILOGUE on the last
11172         line of a file doesn't leave a tab and no newline.
11173         (GMP_ASM_UNDERSCORE): Add a prototype for C++.
11174
11175         * configure.in (sys/mman.h, mprotect): New tests.
11176         * mpn/tests/try.c: Use them, and HAVE_UNISTD_H too.
11177
11178         * configure.in (getopt.h): Remove test.
11179         * tune/speed.c, mpn/tests/try.c (getopt.h): Remove include, since
11180         plain getopt() is in <unistd.h>.
11181
11182         * configure.in, gmp-h.in (mips*-*-irix6*): Set limb_n32=longlong
11183         rather than using _ABIN32.
11184
11185 2000-12-29  Torbjorn Granlund  <tege@swox.com>
11186
11187         * mpz/tests/reuse.c: Rename dump_abort => dump.
11188         * mpz/tests/reuse.c: Generate operands using gmp_rand*.
11189         * mpz/tests/convert.c: Likewise.
11190
11191         * configure.in: Detect T90-ieee systems; move Cray path
11192         selection to after AC_PROG_CC.  Invoke AC_PROG_CPP.
11193         * mpn/cray/cfp: New directory.  Move cfp specific files here.
11194         * mpn/cray/cfp/mulwwc90.s: New file.
11195         * mpn/cray/cfp/mulwwj90.s: New file.
11196         * mpn/cray/mulww.s: Delete.
11197
11198 2000-12-27  Torbjorn Granlund  <tege@swox.com>
11199
11200         * mpn/cray/ieee/mul_1.c: New file.
11201         * mpn/cray/ieee/addmul_1.c: New file.
11202         * mpn/cray/ieee/submul_1.c: New file.
11203         * mpn/cray/ieee/gmp-mparam.h: New file.
11204
11205         * mpn/cray/gmp-mparam.h: Disable UMUL_TIME and UDIV_TIME.
11206
11207         * mpn/cray/hamdist.c: New file.
11208         * mpn/cray/popcount.c: New file.
11209         * mpn/cray/rshift.c: New file.
11210         * mpn/cray/lshift.c: New file.
11211
11212         * longlong.h: Add count_leading_zeros for _CRAY.
11213         Reorganize _CRAY stuff.
11214
11215 2000-12-24  Kevin Ryde  <kevin@swox.se>
11216
11217         * configure.in (alpha*-cray-unicos*): Disable SPEED_CYCLECOUNTER_OBJ,
11218         as tune/alpha.asm doesn't suit.
11219
11220         * mpn/generic/sqrtrem.c, mpz/pow_ui.c, mpz/powm_ui.c, mpf/get_str.c,
11221         mpf/set_str.c: Use mpn_sqr_n when applicable, not mpn_mul_n.
11222
11223 2000-12-23  Torbjorn Granlund  <tege@swox.com>
11224
11225         * mpn/generic/mul_fft.c: Reformat.
11226         (mpn_fft_neg_modF): Remove.
11227         (mpn_fft_mul_2exp_modF): Inline mpn_fft_neg_modF.
11228
11229         * mpn/cray/gmp-mparam.h: Retune.
11230
11231         * configure.in (*-cray-unicos*): Pass `-O3 -htask0'.
11232         (vax*-*-*): Fix typo.
11233
11234         * mpn/cray/mul_1.c: Use dynamic arrays, get rid of TMP_*.
11235         * mpn/cray/addmul_1.c: Likewise.
11236         * mpn/cray/submul_1.c: Likewise.
11237         * mpn/cray/add_n.c: Likewise.
11238         * mpn/cray/sub_n.c: Likewise.
11239
11240         * configure.in (default cc_cflags,cc_64_cflags): Remove -g/add -O.
11241         (mips*-*-irix[6789]*]): Remove -g from cc_*_cflags.
11242
11243 2000-12-22  Torbjorn Granlund  <tege@swox.com>
11244
11245         * mpn/generic/mul_n.c: Delete K&R function headers.
11246
11247         * mpn/generic/mul_n.c (mpn_kara_mul_n): Clean up type confusion
11248         between mp_limb_t and mp_size_t.
11249         (mpn_kara_sqr_n): Likewise.
11250
11251         * mpn/generic/mul_n.c (mpn_kara_mul_n): Use mpn_incr_u.
11252         (mpn_kara_sqr_n): Likewise.
11253
11254         * mpn/generic/mul_n.c (mpn_kara_mul_n): Change handling of `sign'
11255         to work around GCC 2.8.1 MIPS bug.
11256
11257         * configure.in (implied alpha*-cray-unicos*): Remove -g from cc_cflags.
11258
11259 2000-12-21  Torbjorn Granlund  <tege@swox.com>
11260
11261         * mpn/alpha/invert_limb.asm: Simplify a bit.
11262         Add handling of bigend systems.
11263         * mpn/alpha/unicos.m4: Define `bigend'.
11264         * mpn/alpha/default.m4: Define `bigend' (to expand to nothing).
11265
11266         * tests/t-constants.c (CHECK_CONSTANT): Print using %lx.
11267
11268         * mpn/alpha/gmp-mparam.h: Remove sizes for plain C types.
11269         * mpn/alpha/ev5/gmp-mparam.h: Likewise.
11270         * mpn/alpha/ev6/gmp-mparam.h: Likewise.
11271
11272         * mpn/alpha/unicos.m4: Define LEA.
11273         * mpn/alpha/default.m4: Likewise.
11274         * mpn/alpha/invert_limb.asm: Use LEA for loading symbolic addresses.
11275         * mpn/alpha/cntlz.asm: Likewise.
11276
11277         * mpn/alpha/cntlz.asm: Don't use `ldbu', use slightly slower
11278         `ldq_u' + `extbl' instead.
11279
11280         * mpn/alpha/unicos.m4: Define EXTERN.
11281         * mpn/alpha/default.m4: Define EXTERN (to expand to nothing).
11282         * mpn/alpha/cntlz.asm: Declare __clz_tab usign `EXTERN' (for the
11283         benefit of Unicos).
11284
11285 2000-12-21  Kevin Ryde  <kevin@swox.se>
11286
11287         * mpn/alpha/unicos.m4 (GSYM_PREFIX): Define for the benefit of
11288         __clz_tab.
11289
11290 2000-12-20  Torbjorn Granlund  <tege@swox.com>
11291
11292         * longlong.h: Add udiv_qrnnd and count_leading_zeros for _CRAYMPP
11293         systems.
11294
11295 2000-12-19  Torbjorn Granlund  <tege@swox.com>
11296
11297         * configure.in (*sparc*-*-*): Remove -g from cc_cflags and acc_cflags.
11298
11299         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Separate `limb' values from
11300         `size' values.
11301
11302         * configure.in (*-cray-unicos*): Add `-Wa,-B' to cc_cflags.
11303
11304         * demos/pexpr.c (rstate): New variable.
11305         (main): Initialize rstate.
11306         (enum op_t): Add RANDOM.
11307         (fns): Add field for RANDOM.
11308         (mpz_eval_expr): Handle RANDOM.
11309
11310 2000-12-19  Kevin Ryde  <kevin@swox.se>
11311
11312         * mpn/generic/sqrtrem.c: Rewrite by Paul Zimmermann, based on his
11313         Karatsuba Square Root algorithm.
11314         * gmp.texi (Square Root Algorithm): Update.
11315
11316         * tune/many.pl: New file.
11317
11318         * mpn/tests/try.c,ref.[ch] (mpn_preinv_mod_1, mpn_sb_divrem_mn,
11319         mpn_tdiv_qr, mpn_gcd_finda, mpn_kara_mul_n, mpn_kara_sqr_n,
11320         mpn_toom3_mul_n, mpn_toom3_sqr_n): Add testing.
11321         * mpn/tests/ref.c: Cast some "0"s in function calls.
11322
11323         * mpn/x86/k7/mmx/mod_1.asm: Add preinv_mod_1 entrypoint, remove extra
11324         variable for loop termination.
11325
11326         * mpn/x86/p6/mmx/mod_1.asm: Remove file, in favour of the following.
11327         * mpn/x86/p6/mod_1.asm: New file.
11328
11329         * mpn/x86/pentium/mod_1.asm: New file.
11330
11331 2000-12-18  Torbjorn Granlund  <tege@swox.com>
11332
11333         * configure.in (mips*-*-irix[6789]*): Pass options to compiler using
11334         `-Wc'.
11335
11336 2000-12-18  Kevin Ryde  <kevin@swox.se>
11337
11338         * mpn/x86/k6/pre_mod_1.asm: New file.
11339
11340         * tune/tuneup.c (USE_PREINV_MOD_1): Tune this, rearrange mpn_divrem_1
11341         and mpn_mod_1 handling in support of it.
11342         * tune/Makefile.am: Consequent changes to divrem_1.c and mod_1.c.
11343
11344         * gmp-impl.h (USE_PREINV_MOD_1, MPN_MOD_OR_PREINV_MOD_1): New macros.
11345         * mpn/generic/perfsqr.c, mpz/pprime_p.c: Use MPN_MOD_OR_PREINV_MOD_1.
11346
11347         * configure.in: Let an asm mod_1 provide a preinv_mod_1 entrypoint.
11348
11349         * mpn/alpha/default.m4: Remove some newlines, add some asserts.
11350         (r0 etc, f0 etc): Use defreg and deflit.
11351         (PROLOGUE, PROLOGUE_GP, EPILOGUE): Use GSYM_PREFIX.
11352         * mpn/alpha/unicos.m4: Remove some newlines, add some asserts.
11353         * mpn/alpha/invert_limb.asm: Remove unused second DATASTART parameter.
11354         * mpn/alpha/cntlz.asm: Use mpn_count_leading_zeros and __clz_tab.
11355
11356         * mpn/asm-defs.m4 (changecom): Comments on portability.
11357         (__clz_tab, modlimb_invert_table): New macros, matching gmp-impl.h.
11358         (count_leading_zeros, count_trailing_zeros): New define_mpn's.
11359         (PROLOGUE etc): Comments on usage, add some asserts.
11360         (OPERATION_[lr]shift): Use m4_not_for_expansion, for the benefit of
11361         lorrshift multifunc.
11362
11363         * mpn/Makeasm.am (RM_TMP): New variable controlling tmp-*.s
11364         removal, for development purposes.
11365
11366         * mpz/fac_ui.c: Fix for long long limb by using mpn_mul_1 not
11367         mpz_mul_ui, and note some possible enhancements.
11368
11369         * mpz/tests/t-fac_ui.c: New test.
11370         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
11371         * macos/Makefile.in: Ditto, and add t-fib_ui too.
11372
11373         * mpn/generic/[lr]shift.c: Remove some DEBUG code adequately covered
11374         by new parameter ASSERTs.
11375
11376         * longlong.h (count_trailing_zeros): Assert x!=0.
11377
11378         * doc/configuration: Updates for new configure things, add some notes
11379         on test setups.
11380
11381 2000-12-16  Torbjorn Granlund  <tege@swox.com>
11382
11383         * configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc also for 64-bit
11384         compiles.
11385         * configure.in: Disable shared libs for *-*-ultrix*.
11386
11387 2000-12-15  Torbjorn Granlund  <tege@swox.com>
11388
11389         * configure.in (powerpc*-*-*): Pass -Wa,-mppc when using gcc.
11390
11391         * gmp-impl.h (_EXTERN_INLINE): #define different for GCC and other
11392         compilers.
11393
11394         * gmp-h.in (__gmp_inline): Remove.
11395         * mp-h.in: Likewise.
11396         * mpn/generic/gcd.c: Use `inline' instead of `__gmp_inline'.
11397
11398         * configure.in (mips*-*-irix[6789]*): Define *_ldflags.
11399
11400 2000-12-14  Torbjorn Granlund  <tege@swox.com>
11401
11402         * mpn/generic/pre_mod_1.c: Use proper type for udiv_qrnnd
11403         parameter `dummy'.
11404
11405         * mpn/generic/divrem_1.c: Use explicit `!= 0' in if statement.
11406         * mpn/generic/mod_1.c: Likewise.
11407
11408 2000-12-14  Kevin Ryde  <kevin@swox.se>
11409
11410         * config.guess (mips-*-irix[6789]*): Transform to mips64.
11411         (m68k-*-nextstep* | m68k-*-openstep*): Transform to m68020.
11412
11413 2000-12-13  Torbjorn Granlund  <tege@swox.com>
11414
11415         * tests/t-constants.c (main): Conditionalize use of PP_INVERTED.
11416
11417         * mpn/mp_bases.c: Handle 4-bit limbs.
11418         (main): Add code for generating tables.
11419
11420         * mpn/generic/popham.c: Handle limb bitsizes of 4, 8, 16.
11421         Suffix all 32-bit constant with `L'.
11422         Use CNST_LIMB for 64-bit constants.
11423
11424 2000-12-13  Kevin Ryde  <kevin@swox.se>
11425
11426         * gmp-impl.h (FIB_THRESHOLD): Defaults for 4,8,16 bits per limb, and
11427         an arbitrary fallback default.
11428         (modlimb_invert): Add efficient code for 8,16 (or 4) bits per limb.
11429
11430         * configure.in (mips3, mips64): Don't bother with o32 (mips2 32-bit
11431         limb) on IRIX 6.
11432
11433         * Makefile.am (SUBDIRS): Put "tests" first so tests/t-constants.c is
11434         run first, to pick up any limb size mismatch.
11435
11436         * tune/tuneup.c (DIVREM_1, MOD_1): Fix result values, were off by 1.
11437
11438         * mpz/fib_ui.c (table1, table2): Add data for 4,8,16 bits per limb.
11439
11440 2000-12-12  Torbjorn Granlund  <tege@swox.com>
11441
11442         * gmp-impl.h (LIMBS_PER_DOUBLE): Define for any limb bitsize.
11443
11444 2000-12-11  Torbjorn Granlund  <tege@swox.com>
11445
11446         * mpn/mp_bases.c: Add tables for 8-bit and 16-bit limbs.
11447         Round existing `double' values properly.
11448
11449         * gmp-h.in (__gmp_randstate_struct): Prefix field names with _mp_
11450         to keep out of user name space.
11451         (__gmp_randata_lc): Likewise.
11452         * randclr.c, randlc.c, randlc2x.c, randraw.c, randsd.c, randsdui.c:
11453         Corresponding changes.
11454
11455         * gmp-impl.h (PP): #define for machines with BITS_PER_MP_LIMB
11456         of 2, 4, 8, and 16.
11457         (PP_FIRST_OMITTED): New, define for various BITS_PER_MP_LIMB.
11458         (PP_MASK): Remove.
11459         (PP_MAXPRIME): Remove.
11460
11461         * mpn/generic/perfsqr.c: Generalize PP handling for machines with
11462         limbs of < 32 bits.  Allow PP_INVERTED to be undefined.
11463         * mpz/pprime_p.c: Likewise.
11464
11465 2000-12-10  Torbjorn Granlund  <tege@swox.com>
11466
11467         * mpn/generic/mul_1.c: Declare parameters in C89 style.
11468
11469 2000-12-10  Kevin Ryde  <kevin@swox.se>
11470
11471         * tune/Makefile.am (speed_LDFLAGS, speed_ext_LDFLAGS, tune_LDFLAGS):
11472         Don't use -all-static, as gcc 2.95.2 on i386 solaris 8 doesn't like
11473         it.
11474
11475         * configure.in (mips3,mips64): Add ABI=64, name the others ABI=n32 and
11476         ABI=o32.
11477         * mpn/mips3/gmp-mparam.h (BITS_PER_LONGINT): Remove #define and let
11478         configure determine it, since it varies with ABI=64 or ABI=n32.
11479         * gmp.texi (ABI and ISA): Update.
11480         (mpz_mod_ui): Remark that it's identical to mpz_fdiv_r_ui.
11481         (mpn_divexact_by3): Qualify a statement needing mp_bits_per_limb even.
11482
11483         * mul_fft.c (mpn_fft_mul_modF_K etc): Patch by Paul Zimmermann to fix
11484         results in certain cases of recursing into a further FFT.
11485
11486 2000-12-09  Torbjorn Granlund  <tege@swox.com>
11487
11488         * mpz/cmpabs.c: Remove unused variable.
11489         * mpz/rrandomb.c: Likewise.
11490         * mpz/xor.c: Likewise.
11491
11492 2000-12-07  Torbjorn Granlund  <tege@swox.com>
11493
11494         * mpn/generic/gcdext.c: Handle double carry when computing s1.
11495         Merge two code blocks for computing s0 and s1.
11496
11497 2000-12-07  Kevin Ryde  <kevin@swox.se>
11498
11499         * configure.in (hppa*-*-*): Remove -Aa -D_HPUX_SOURCE from
11500         cc_cflags/cppflags, and instead let AM_C_PROTOTYPES add it, or -Ae,
11501         whichever works.
11502
11503         * configure.in (*-*-aix[34]*): Disable shared by default, but let
11504         the user override that, if desired.
11505         * gmp.texi (Notes for Particular Systems): Update.
11506
11507 2000-12-06  Torbjorn Granlund  <tege@swox.com>
11508
11509         * mpq/cmp_ui.c: Streamline.
11510
11511 2000-12-06  Kevin Ryde  <kevin@swox.se>
11512
11513         * tune/divrem_1_div.c,divrem_1_inv.c,mod_1_div.c,mod_1_inv.c,
11514         gcdext_double.c: New files for measuring.
11515         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
11516         * tune/speed.c,speed.h,common.c: Add measuring of them.
11517         (mpn_preinv_mod_1, mpz_jacobi, mpz_powm_ui): Add measuring.
11518
11519         * speed.c (getopt_long): Don't use this, just plain getopt.
11520         * configure.in (getopt_long): Remove test.
11521
11522         * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_MUL_N_MINSIZE,
11523         MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_MUL_N_MINSIZE): New macros, and
11524         assume toom3 square tsize was meant to be the same as the mul (both
11525         are overestimates).
11526         * tune/tuneup.c, mpn/generic/mul.c, mpn/generic/mul_n.c: Use them.
11527         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Fix an ASSERT to use
11528         TOOM3_SQR_THRESHOLD not TOOM3_MUL_THRESHOLD, add a few that might
11529         be more realistic size checks.
11530         * tune/speed.h (SPEED_ROUTINE_MPN_MUL_N_TSPACE etc): Use minsize.
11531
11532         * mpn/generic/divrem_1.c: Partial rewrite, merge fractional part
11533         calculation, skip a divide step in more cases, introduce
11534         DIVREM_1_NORM_THRESHOLD and DIVREM_1_UNNORM_THRESHOLD.
11535         * mpn/generic/mod_1.c: Partial rewrite, skip a divide step in more
11536         cases, introduce MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD.
11537         * longlong.h (UDIV_PREINV_ALWAYS): New define, set for alpha and ia64.
11538         * tune/tuneup.c (DIVREM_1_NORM_THRESHOLD, DIVREM_1_UNNORM_THRESHOLD,
11539         MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD): Tune these.
11540         * gmp-impl.h [TUNE_PROGRAM_BUILD]: Support for this.
11541         * tune/Makefile.am (TUNE_MPN_SRCS): Add divrem_1.c and mod_1.c.
11542
11543         * gmp-impl.h (UDIV_NORM_PREINV_TIME): Renamed from UDIV_PREINV_TIME.
11544         * mpn/generic/perfsqr.c, mpn/generic/sb_divrem_mn.c,
11545         mpn/x86/*/gmp-mparam.h: Ditto.
11546         * gmp-impl.h (UDIV_UNNORM_PREINV_TIME): New define.
11547
11548         * configure.in (AC_C_INLINE, HAVE_INLINE): New test and define.
11549         * gmp-impl.h (inline): Remove, use config.h.
11550         (_EXTERN_INLINE): Redefine based on HAVE_INLINE.
11551         (mpn_zero_p): Use HAVE_INLINE.
11552
11553         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Don't add flags to a user
11554         selected $AR or $NM.
11555
11556         * tune/tuneup.c (all): Print how long the tuning took.
11557
11558         * configure.in (AM_C_PROTOTYPES): Use this, not GMP_ANSI2KNR.
11559         * acinclude.m4 (GMP_ANSI2KNR): Remove.
11560
11561         * Makefile.am (gmp.h, mp.h): In DISTCLEANFILES not CLEANFILES.
11562
11563         * gmp-h.in (mpn_divmod, mpn_divmod_1, mpn_divexact_by3): Cast some
11564         zeros, for the benefit of K&R if long!=int.
11565
11566         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add "*" for
11567         the benefit of cray.
11568
11569         * compat.c (mpn_divexact_by3, mpn_divmod_1): Return types should be
11570         mp_limb_t, not int, and need an actual "return".
11571
11572 2000-12-05  Torbjorn Granlund  <tege@swox.com>
11573
11574         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
11575         * mpn/alpha/gmp-mparam.h: Tune for 21064.
11576
11577         * longlong.h: Reformat to avoid newlines within strings.
11578
11579         * gmp-impl.h (inline): Disable if GCC has defined __STRICT_ANSI__.
11580
11581         * configure.in: Do a `mkdir tune' before creating tune/sqr_basecase.c.
11582
11583         * Makefile.am: Treat mp.h analogously to gmp.h.
11584
11585         configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc.
11586
11587         * mp-h.in: Renamed from mp.h.
11588         Add #define for _LONG_LONG_LIMB.
11589         Move some other fixes from gmp-h.in.
11590         * mp.h: Removed.
11591         * configure.in: Generate mp.h from mp-h.in like we handle
11592         gmp-h.in/gmp.h.
11593
11594 2000-12-04  Torbjorn Granlund  <tege@swox.com>
11595
11596         * acinclude.m4: Fix typo testing for bad HP compiler.
11597
11598 2000-12-03  Torbjorn Granlund  <tege@swox.com>
11599
11600         * mpbsd/tests/t-misc.c (check_itom): Exclude some tests for Cray
11601         CFP systems.
11602
11603         * longlong.h (CRAYIEEE umul_ppmm): New.
11604
11605         * mpn/cray/gmp-mparam.h (BITS_PER_SHORTINT): 32 => 64.
11606         (*_THRESHOLD): Tune.
11607
11608         * configure.in: Disable shared libs for *-*-unicos*.
11609
11610 2000-12-03  Kevin Ryde  <kevin@swox.se>
11611
11612         * configure.in, tune/Makefile.am: Create tune/sqr_basecase.c during
11613         configure, and use it unconditionally in $(nodist_tuneup_SOURCES).
11614         Fixes a problem with sqr_basecase.lo under --disable-static.
11615
11616 2000-12-01  Torbjorn Granlund  <tege@swox.com>
11617
11618         * mpf/tests/t-get_d.c (LOW_BOUND,HIGH_BOUND): #define for non-IEEE
11619         Cray systems.
11620
11621         * gmp-impl.h (union ieee_double_extract): Test for _CRAYIEEE.
11622
11623 2000-11-30  Torbjorn Granlund  <tege@swox.com>
11624
11625         * mpz/tests/t-mul.c (base_mul): Fix re-evaluation problems in macro
11626         invocations.
11627         (ref_mpz_mul): New name from mpz_refmul.  Make static.
11628         (base_mul): New name for _mpn_mul_classic.
11629
11630 2000-11-30  Kevin Ryde  <kevin@swox.se>
11631
11632         * configure.in: Rewrite of CC/CFLAGS selection scheme, introduce a
11633         notion of ABI, merge compiler and mpn path selection, add flags
11634         selection for AR and NM, let CC without CFLAGS work.
11635         (AC_PROG_CC): Use this, not GMP_SELECT_CC.
11636         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't use AC_TRY_COMPILE, combine
11637         cc/cflags parameter.
11638         (GMP_PROG_CC_FIND, GMP_CHECK_CC_64BIT, GMP_PROG_CC_SELECT): Remove.
11639         * gmp.texi (Installing GMP): Updates for new scheme.
11640
11641         * configure.in (AC_CANONICAL_HOST): Use this and $host, not $target.
11642         * acinclude.m4, acconfig.h, longlong.h, mpn/x86/x86-defs.m4,
11643         mpn/x86/k7/mmx/popham.asm: Ditto, renaming HAVE_TARGET_CPU to
11644         HAVE_HOST_CPU.
11645         * gmp.texi (Build Options, and elsewhere): Update.
11646
11647         * acinclude.m4 (GMP_COMPARE_GE): New macro.
11648         (GMP_GCC_MARCH_PENTIUMPRO): Use it, add CC parameter, check for GCC.
11649         (GMP_HPC_HPPA_2_0): New macro, adapted from GMP_CHECK_CC_64BIT.
11650
11651         * acinclude.m4 (GMP_PROG_AR): New macro, using AC_CHECK_TOOL, adding
11652         GMP flags.
11653         * configure.in: Use it
11654
11655         * gmp-h.in: Renamed from gmp.h.
11656         (@define_LONG_LONG_LIMB@): Placeholder for instantiation.
11657         (__GNU_MP__): Bump to 3.
11658         * acinclude.m4 (GMP_VERSION): Get version from gmp-h.in.
11659         * configure.in: Create gmp.h from gmp-h.in to set _LONG_LONG_LIMB.
11660         * gmp.texi.h (ABI and ISA): Mention this.
11661         * acconfig.h (_LONG_LONG_LIMB): Remove undef.
11662         * Makefile.am: Distribute gmp-h.in, not gmp.h.
11663
11664         * configure.in (AC_PROG_CPP, AC_PROG_INSTALL, AC_PROG_LN_S): Remove,
11665         dragged in by other macros.
11666         (gmp_asm_syntax_testing): Renamed from gmp_no_asm_syntax_testing.
11667         (AC_EXEEXT, AC_OBJEXT): Remove, done automatically by libtool.
11668         * configure.in, acinclude.m4: Remove "" from "`foo`", being
11669         unnecessary and not portable.
11670
11671         * configure.in (GMP_LDFLAGS): New AC_SUBST flags for libtool link.
11672         (powerpc64*-*-aix*): Use for -Wc,-maix to fix shared library creation,
11673         but can't build shared and static at the same time.
11674         * Makefile.am (libgmp_la_LDFLAGS, libmp_la_LDFLAGS): Use
11675         $(GMP_LDFLAGS).
11676         * gmp.texi (Notes for Particular Systems): Update AIX problem
11677
11678         * configure.in (AC_CONFIG_LINKS): Use where needed, not via gmp_links.
11679         (gmp_srclinks): Build up as needed, not via gmp_links.
11680
11681         * acinclude.m4 (GMP_INIT): Do CONFIG_TOP_SRCDIR and asm-defs.m4 here.
11682         * configure.in (asm-defs.m4): Consequent changes.
11683
11684         * acinclude.m4 (GMP_INCLUDE_MPN): Using include_mpn(), replacing
11685         GMP_INCLUDE and GMP_SINCLUDE.
11686         * configure.in (gmp_m4postinc): Remove this scheme, use
11687         GMP_INCLUDE_MPN instead.
11688
11689         * configure.in (*-*-sco3.2v5*): Force ac_cv_archive_cmds_need_lc=no,
11690         until libtool does this itself.
11691         * gmp.texi (Known Build Problems): Remove SCO -lc problem.
11692
11693         * configure, INSTALL.autoconf, etc: Update to autoconf 2000-11-29.
11694         * acinclude.m4 (GMP_C_SIZES): Use AC_CHECK_SIZEOF.
11695         * gmp.texi (Known Build Problems): Remove version.c sed/config.h
11696         problem, fixed.
11697
11698         * ltmain.sh, aclocal.m4: Update to libtool 2000-11-25.
11699         * ltconfig: No longer required, but leave an empty dummy for automake.
11700         * gmp.texi (Known Build Problems): Remove SunOS native ar ranlib
11701         problem, fixed.
11702
11703         * */Makefile.in, aclocal.m4: Update to automake 2000-11-25.
11704         * mpbsd/tests/Makefile.am, mpfr/tests/Makefile.am (check_PROGRAMS):
11705         Remove dummy, no longer required.
11706         * mpbsd/tests/dummy.c, mpfr/tests/dummy.c: Remove files.
11707         * depcomp: Remove file, no longer required (with no-dependencies).
11708
11709         * texinfo.tex: Update to 2000-11-09.
11710         * gmp.texi (Build Options): Mention PDF from gmp.texi.
11711         * Makefile.am (MOSTLYCLEANFILES): Add gmp.tmp, from new texinfo.tex.
11712
11713         * gmp.texi (Build Options): List alphaev56, alphapca56, alphaev67,
11714         hppa2.0n and power among supported CPUs.
11715
11716 2000-11-30  Torbjorn Granlund  <tege@swox.com>
11717
11718         * mpz/tests/t-mul.c: Increase max operand size from 2^17 bits
11719         to 2^19 bits.  Misc cleanups.
11720
11721 2000-11-26  Kevin Ryde  <kevin@swox.se>
11722
11723         * tune/tuneup.c (FIB_THRESHOLD): Cope better with different speeds of
11724         odd and even sizes.
11725
11726         * longlong.h (alpha): Use udiv_qrnnd and count_leading_zeros on all
11727         compilers, not just gcc.
11728
11729         * pre_mod_1.c: Use conditional subtract to always skip a division.
11730         (UMUL_TIME, UDIV_TIME): Remove defaults, now in longlong.h.
11731
11732 2000-11-22  Torbjorn Granlund  <tege@swox.com>
11733
11734         * mpn/pa64w/gmp-mparam.h: Retune.
11735         * mpn/pa64/gmp-mparam.h: Retune.
11736         * mpn/sparc64/gmp-mparam.h: Retune.
11737
11738 2000-11-22  Kevin Ryde  <kevin@swox.se>
11739
11740         * gmp-impl.h (ABOVE_THRESHOLD, BELOW_THRESHOLD): New macros.
11741         * mpn/generic/gcdext.c: Use them.
11742
11743         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Force only one step.
11744         * tune/gcdextos.c, tune/gcdextod.c: New files, one step gcdext, single
11745         and double.
11746         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
11747         (TUNE_MPN_SRCS): Remove gcdext.c.
11748         * tune/speed.h, tune/common.c, tune/speed.c: Add measuring.
11749         * tune/tuneup.c: Use for GCDEXT_THRESHOLD, plus check if double limb
11750         is ever better.  Should be more accurate, and hopefully faster.
11751
11752         * tune/gcdext_single.c: New file, gcdext forced to single limbs.
11753         * tune/Makefile.am: Add it.
11754         * tune/speed.h, tune/common.c, tune/speed.c: Add measuring, and of
11755         invert_limb.
11756
11757         * tune/speed.h (speed_params r): Use mp_limb_t, not long.
11758         * tune/speed.h, tune/common.c: Don't "switch" on "r".
11759         * tune/speed.c (r_string): Accept limb sized constants.
11760         (choice scale): Add a scale factor (eg. "2.33*mpn_add_n").
11761         * tune/common.c (SPEED_ROUTINE_UDIV_QRNND_A): Default r to
11762         __mp_bases[10].big_base, being a full limb value.
11763
11764         * configure.in (alphapca56*-*-*): Use ev5 mpn path.
11765         (am29000*-*-*): Remove this, leave the canonical a29k.
11766         (z8k*-*-*, z8kx*-*-*): Changed from z8000, since z8k is canonical.
11767         (gmp_mpn_functions_optional): Add invert_limb, use for alpha and ia64.
11768
11769         * configure.in (alloca): Accept yes/no/detect, generate an error if
11770         "yes" but not available.
11771         * gmp.texi (Build Options): Update.
11772
11773         * acinclude.m4 (GMP_TRY_ASSEMBLE): Make conftest.out available.
11774         (GMP_ASM_ALIGN_FILL_0x90): Use it.
11775
11776         * acinclude.m4 (GMP_ASM_X86_MMX) [*-*-solaris*]: Check for solaris
11777         2.6 "as" movq bug.
11778         * gmp.texi (Notes for Particular Systems): Update x86 MMX note.
11779
11780 2000-11-21  Torbjorn Granlund  <tege@swox.com>
11781
11782         * tune/Makefile.am (EXTRA_DIST): List hppa2w.asm.
11783
11784         * tune/hppa2.asm: Change level directive to "2.0n".
11785         * tune/hppa2w.asm: New file.
11786         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Separate out hppa2.0w.
11787
11788         * mpn/pa64/gmp-mparam.h (BITS_PER_LONGINT): 64 => 32.
11789
11790 2000-11-21  Kevin Ryde  <kevin@swox.se>
11791
11792         * urandom.h (random): No prototype if glibc stdlib.h has already
11793         provided it (avoids an int32_t/long conflict).
11794
11795         * tune/Makefile.am (LDFLAGS): Use -all-static.
11796         (speed-dynamic): Dynamic linked version of speed.c.
11797         * tune/README: Update.
11798
11799         * mpn/generic/gcd.c (find_a): Use native version if available.
11800         * acconfig.h (HAVE_NATIVE_mpn_gcd_finda): Add #undef.
11801         * gmp-impl.h (mpn_gcd_finda): Add prototype and define.
11802         * mpn/asm-defs.m4 (mpn_gcd_finda): New define_mpn.
11803         * tune/gcd_finda_gen.c: #undef any HAVE_NATIVE_mpn_gcd_finda.
11804         * configure.in (gmp_mpn_functions_optional): Add gcd_finda.
11805         * mpn/x86/k6/gcd_finda.asm: New file.
11806
11807         * tune/tuneup.c (POWM_THRESHOLD): Slightly bigger size steps.
11808
11809         * gmp-impl.h (__GMP_IMPL_H__): Protect against multiple inclusion.
11810         * tune/gcd_bin.c, tune/powm_mod.c, tune/powm_redc.c: Use #undef after
11811         gmp-impl.h to force thresholds.
11812         * tune/tuneup.c (print_define, fft): No need for #ifndefs on
11813         thresholds any more.
11814
11815 2000-11-20  Torbjorn Granlund  <tege@swox.com>
11816
11817         * mpz/tests/t-powm.c: Analogous changes as made 2000-11-12 to t-mul.c.
11818         * mpz/tests/t-powm_ui.c: Likewise.
11819         * mpz/tests/t-pow_ui.c: Likewise.
11820         * mpz/tests/t-root.c: Likewise.
11821
11822         * configure.in [compiler switch]: Pass "-Aa -D_HPUX_SOURCE" to cc for
11823         all hppa versions.
11824
11825         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Reference data using PC relative
11826         addressing (was r19 relative addressing).
11827
11828 2000-11-18  Torbjorn Granlund  <tege@swox.com>
11829
11830         * rand.c: (__gmp_rand_lc_scheme): Convert strings to hexadecimal.
11831         (gmp_randinit): Expect strings in hexadecimal.
11832
11833 2000-11-18  Kevin Ryde  <kevin@swox.se>
11834
11835         * configfsf.guess, configfsf.sub: Update to 2000-11-16.
11836         * config.guess (alpha*-*-openbsd*): Do exact cpu detection.
11837
11838 2000-11-14  Torbjorn Granlund  <tege@swox.com>
11839
11840         * mpz/tests/t-fdiv.c: Analogous changes as made 2000-11-12 to t-mul.c.
11841         * mpz/tests/t-tdiv_ui.c: Likewise.
11842         * mpz/tests/t-fdiv_ui.c: Likewise.
11843         * mpz/tests/t-sqrtrem.c: Likewise.
11844         * mpz/tests/t-gcd.c: Likewise.
11845
11846 2000-11-13  Kevin Ryde  <kevin@swox.se>
11847
11848         * mpn/Makeasm.am: New file, splitting out assembler rules.
11849         * mpn/Makefile.am, tune/Makefile.am: Use it.
11850
11851         * mpn/Makefile.am (@CPP@): Remove this, automake already gives it.
11852
11853         * configure.in (AC_CHECK_LIBM): New test, and AC_SUBST it.
11854         * Makefile.am (MPFR_LIBADD_OPTION): Use it.
11855         * demos/Makefile.am (qcn_LDADD): Ditto.
11856         * tune/Makefile.am (libspeed_la_LIBADD): Ditto.
11857         * tests/rand/Makefile.am (libstat_la_LIBADD): Ditto.
11858
11859         * tune/time.c (timeval_diff_secs): Better calculation.
11860         (read_real_time): New measuring method for AIX power/powerpc.
11861         (speed_endtime): Protect against negative times.
11862         * tune/common.c (speed_measure): Protect against big reps.
11863         * tune/freq.c (speed_cpu_frequency_measure_one): Better timeval diff.
11864         * tune/speed.h (TIMEVAL_DIFF_SEC,USEC): Remove macros.
11865         * configure.in: (sys/systemcfg.h, read_real_time): New tests.
11866
11867 2000-11-13  Torbjorn Granlund  <tege@swox.com>
11868
11869         * mpz/tests/t-mul.c: Remove #include urandom.h.
11870         * mpz/tests/t-tdiv.c: Likewise.
11871
11872         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]:
11873         Declare hppa.asm as just 32 bits (cyclecounter_size=1).
11874
11875 2000-11-12  Torbjorn Granlund  <tege@swox.com>
11876
11877         * mpz/tests/t-mul.c
11878         (main): Generate random numbers using gmp_rand* functions.
11879         (main): Distribute random numbers non-uniformly.
11880         (main): Seed by current time if GMP_CHECK_RANDOMIZE is set.
11881         (_mpn_mul_classic): Streamline.
11882         * mpz/tests/t-tdiv.c: Analogous changes.
11883
11884         * demos/pexpr.c (HAVE_sigaltstack): Fix typo in testing for _UNICOS.
11885         Also test for __hpux.
11886
11887 2000-11-11  Torbjorn Granlund  <tege@swox.com>
11888
11889         * mpn/alpha/ev5/gmp-mparam.h: Retune.
11890
11891         * mpn/alpha/ev6/gmp-mparam.h: Retune.
11892
11893         * mpn/alpha/ev6/add_n.asm: Misc cleanups.
11894
11895         * mpn/alpha/ev6/sub_n.asm: New file.
11896
11897 2000-11-10  Torbjorn Granlund  <tege@swox.com>
11898
11899         * configure.in [path switch] (alphaev6*-*-*): Add alpha/ev5 to path.
11900
11901         * mpn/alpha/ev6/add_n.asm: New file.
11902
11903 2000-11-10  Kevin Ryde  <kevin@swox.se>
11904
11905         * mpz/powm.c (redc): Make global under WANT_REDC_GLOBAL.
11906         * tune/powm_mod.c, tune/powm_redc.c: New files.
11907         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
11908         * tune/*: Add measuring of redc, mpz_mod, mpz_powm_mod, mpz_powm_redc.
11909
11910         * tune/tuneup.c (POWM_THRESHOLD): Determine from redc and mpz_mod.
11911         * tune/Makefile.am (TUNE_MPZ_SRCS): Remove powm.
11912
11913 2000-11-10  Torbjorn Granlund  <tege@swox.com>
11914
11915         * mpn/mips3/gmp-mparam.h: Retune.
11916
11917         * configure.in (os_64bit): Rename to check_64bit_compiler.
11918
11919 2000-11-09  Torbjorn Granlund  <tege@swox.com>
11920
11921         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Choose hppa/hppa2 code
11922         depending on $CC64.
11923
11924 2000-11-09  Kevin Ryde  <kevin@swox.se>
11925
11926         * mpn/x86/pentium/mul_1.asm: Unroll 2x, saving 1 c/l when in L1.
11927         Add 1c entrypoint.
11928         * mpn/x86/pentium/aorsmul_1.asm: Add 1c entrypoints, shave a couple
11929         of cycles at entry and exit.
11930
11931         * configure.in (power1,2,2sc): Support these as synonyms for plain
11932         power.
11933
11934         * acinclude.m4 (GMP_ASM_X86_SHLDL_CL): GMP_DEFINE WANT_SHLDL_CL here.
11935         (GMP_ASM_X86_MMX, GMP_ASM_X86_SHLDL_CL): Add X86 into the names.
11936         * configure.in: Consequent changes.
11937
11938         * gmp.texi (Notes for Particular Systems): Remarks about power/powerpc.
11939         (Reentrancy): Remarks about simultaneous writing.
11940         (Reporting Bugs): Ask for configfsf.guess.
11941
11942 2000-11-08  Kevin Ryde  <kevin@swox.se>
11943
11944         * acinclude.m4 (GMP_FUNC_ALLOCA): New macro.
11945         * configure.in: Use it.
11946         * gmp-impl.h (alloca): Conditionals and setups as per autoconf
11947         (should make alloca available on more non-gcc compilers).
11948
11949         * acinclude.m4: Misc reformatting, simplify some quoting.
11950         (GMP_ASM_UNDERSCORE, GMP_ASM_X86_MCOUNT): Use $CC $CFLAGS $CPPFLAGS.
11951         (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_FILL_0x90, GMP_ASM_RODATA): Put
11952         AC_REQUIREs outside AC_CACHE_CHECK.
11953         (GMP_C_SIZES): Use $srcdir/gmp.h, not -I; use $CPPFLAGS.
11954         (GMP_ASM_UNDERSCORE): Use "gmp_compile" variable, and only rm
11955         conftes1* conftes2*.
11956         (GMP_PROG_NM): New macro, require it in appropriate GMP_ASM_*.
11957         (GMP_TRY_ASSEMBLE): New macro, use it in various GMP_ASM_*.
11958         * configure.in: Use GMP_PROG_NM.
11959
11960         * mpn/tests/spinner.c (spinner_signal): Use RETSIGTYPE.
11961         (spinner_init): Force output to unbuffered.
11962
11963         * mpn/x86/README.family: Notes about GOT table and imul, misc updates.
11964         * mpn/x86/k7/diveby3.asm: Change to 3 operands for immediate imul.
11965         * mpn/x86/k6/diveby3.asm: Ditto.
11966
11967 2000-11-06  Torbjorn Granlund  <tege@swox.com>
11968
11969         * urandom.h: Simplify and make it work properly for 64-bit
11970         machines also in environments without `random'.
11971
11972 2000-11-04  Torbjorn Granlund  <tege@swox.com>
11973
11974         * configure.in [path switch]: Don't match rs6000-*-*, in
11975         particular don't assume POWER.
11976
11977         * tune/tuneup.c (fft): Remove usleep calls.
11978
11979         * config.guess: Don't pass "$@" when it is known to be empty.
11980
11981         * Makefile.am (EXTRA_DIST): List configfsf.guess and configfsf.sub.
11982
11983 2000-11-04  Kevin Ryde  <kevin@swox.se>
11984
11985         * configfsf.guess, configfsf.sub: Moved from config.guess and
11986         config.sub.
11987         * config.guess, config.sub: New files, wrappers around around
11988         configfsf versions.
11989         * configfsf.guess: Update to FSF 2000-10-23.
11990         * configfsf.sub: Update to FSF 2000-10-25.
11991
11992         * acinclude.m4 (GMP_ASM_POWERPC_R_REGISTERS): New macro.
11993         * mpn/powerpc32/powerpc-defs.m4: New file, regmap.m4 r0 etc macros
11994         conditionalized by GMP_ASM_POWERPC_R_REGISTERS.
11995         * mpn/powerpc32/regmap.m4: Remove file.
11996         * configure.in (powerpc*-*-*): Use all this.
11997
11998         * mpz/divegcd.c: New file, providing mpz_divexact_gcd.
11999         * Makefile.am, mpz/Makefile.am: Add it.
12000         * gmp-impl.h (mpz_divexact_gcd): Add prototype.
12001         * mpq/aors.c,canonicalize.c,div.c,mul.c: Use it.
12002
12003         * longlong.h [pentium] (count_leading_zeros): New macro.
12004         (__clz_tab): Always provide prototype.
12005         * acconfig.h (HAVE_TARGET_CPU_): Add x86s.
12006
12007         * tune/speed.[ch],common.c (count_leading_zeros,
12008         count_trailing_zeros, __udiv_qrnnd_c): Add measuring.
12009
12010         * configure.in (X86_PATTERN): Move from here ...
12011         * acinclude.m4 (X86_PATTERN): ... to here.
12012         (GMP_ASM_RODATA): Use it.
12013
12014         * configure.in (srandom): New test.
12015         * mpn/tests/try.c: Use it.
12016         * tune/speed.c: Ditto, and conditionalize getrusage and headers.
12017
12018 2000-11-02  Kevin Ryde  <kevin@swox.se>
12019
12020         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add udiv_qrnnd.c
12021         and udiv_w_sdiv.c.
12022
12023         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove a duplicate
12024         subtract at the evaluate stage.
12025
12026 2000-11-01  Torbjorn Granlund  <tege@swox.com>
12027
12028         * configure.in [compiler switch] (sparc64-*-linux*): Spell
12029         gmp_xoptcflags_gcc properly, and pass same options as for other
12030         sparcv9 configs.
12031
12032         * tune/speed.h (SPEED_ROUTINE_MPN_GET_STR): Fix type of wsize.
12033
12034 2000-10-31  Torbjorn Granlund  <tege@swox.com>
12035
12036         * configure.in [compiler switch] (sparc64-*-linux*): Remove -mvis
12037         from gmp_xoptflags_gcc, this might not be an ultrasparc.
12038         Remove -m32 from gmp_cflags_gcc; add -Wa,-xarch=v8plus.
12039
12040 2000-10-29  Torbjorn Granlund  <tege@swox.com>
12041
12042         * mpn/ia64/lorrshift.asm: New file.
12043
12044         * configure.in: New mulfunc `lorrshift' for lshift and rshift.
12045
12046 2000-10-29  Kevin Ryde  <kevin@swox.se>
12047
12048         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Delete code performing
12049         superfluous mpn_sub_n calls.
12050
12051         * configure.in (found_asm, M4): Account for SPEED_CYCLECOUNTER_OBJ,
12052         for the benefit of targets whose only .asm is a cycle counter.
12053
12054         * tune/tuneup.c (fft): Remove bogus usleep calls.
12055
12056 2000-10-28  Torbjorn Granlund  <tege@swox.com>
12057
12058         * mpn/ia64/invert_limb.asm: Get return value for 0x800...00 right.
12059
12060         * tune/Makefile.am (EXTRA_DIST): Add ia64.asm.
12061
12062         * tune/ia64.asm: Fix typo.
12063
12064         * add_n.asm addmul_1.asm mul_1.asm popcount.asm sub_n.asm:
12065         Preserve ar.lc as required by ABI.
12066         * longlong.h (ia64 udiv_qrnnd): New.
12067
12068         * configure.in [path switch] (ia64*-*-*): Set extra_functions.
12069         * mpn/ia64/invert_limb.asm: New file.
12070
12071 2000-10-27  Torbjorn Granlund  <tege@swox.com>
12072
12073         * configure.in [compiler switch]:
12074         Get rid of c89 for all hppa flavours--it is an evil compiler!
12075
12076         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix type of xp.
12077         (SPEED_ROUTINE_MPN_GET_STR): Fix type of wp.
12078
12079 2000-10-27  Kevin Ryde  <kevin@swox.se>
12080
12081         * gmp.texi (Fibonacci Number Algorithm): New section.
12082
12083         * mpz/tests/t-fib_ui.c: New file.
12084         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
12085
12086         * mpz/fib_ui.c: Rewrite, same formulas but using mpn functions and
12087         some lookup tables, much faster at small to moderate sizes.
12088         * gmp-impl.h (MPZ_FIB_SIZE): New macro.
12089         (FIB_THRESHOLD): Establish default here.
12090         * tune/tuneup.c (FIB_THRESHOLD): Start search after the new table
12091         data.
12092
12093         * mpn/x86/x86-defs.m4 (mcount_movl_GOT_ebx): Rename from movl_GOT_ebx,
12094         and don't use GSYM_PREFIX with _GLOBAL_OFFSET_TABLE_.
12095
12096         * tune/freq.c (speed_cpu_frequency_measure): New test comparing
12097         gettimeofday and speed_cyclecounter, should cover many systems.
12098
12099 2000-10-27  Torbjorn Granlund  <tege@swox.com>
12100
12101         * mpn/ia64/gmp-mparam.h: Retune.
12102
12103 2000-10-26  Torbjorn Granlund  <tege@swox.com>
12104
12105         * longlong.h (ia64): Set UMUL_TIME and UDIV_TIME.
12106
12107         * mpn/ia64/submul_1.c: Fix typo.
12108
12109 2000-10-25  Kevin Ryde  <kevin@swox.se>
12110
12111         * tune/freq.c (speed_cpu_frequency_sysctl): New test, supporting
12112         hw.model for BSD flavours.
12113         * configure.in (sysctl, sys/param.h): New tests.
12114
12115 2000-10-24  Torbjorn Granlund  <tege@swox.com>
12116
12117         * tune/freq.c: Explicitly #include config.h before other include files.
12118
12119         * mpz/tests/reuse.c (FAIL2): New #define.
12120         (main): Use FAIL2.  Now this test properly returns non-zero exit
12121         status when it fails.
12122
12123         * mpn/powerpc32/gmp-mparam.h: Retune.
12124         * mpn/powerpc64/gmp-mparam.h: Retune.
12125
12126 2000-10-24  Kevin Ryde  <kevin@swox.se>
12127
12128         * mpn/x86/k6/cross.pl: Support 8 and 16 byte code alignment.
12129
12130         * mpq/aors.c, mpq/canonicalize.c: Skip two mpz_divexact calls if
12131         gcd gives 1, which should be 60% of the time.
12132         * gmp-impl.h (MPZ_EQUAL_1_P): New macro.
12133         * mpq/mul.c, mpq/div.c: Use it, and a new DIV_OR_SET.
12134
12135         * tune/tuneup.c (xp_block, yp_block): Initialize these with random
12136         data.  Fixes GCD_ACCEL and GCDEXT thresholds, and latest POWM.
12137
12138 2000-10-23  Torbjorn Granlund  <tege@swox.com>
12139
12140         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Add ia64 case.
12141
12142         * mpn/ia64/gmp-mparam.h: Fill in some parameters.
12143
12144         * mpn/ia64/submul_1.c: New file.
12145
12146         * tune/ia64.asm: New file.
12147
12148         * gmp-impl.h (union ieee_double_extract): Handle ia64.
12149
12150         * mpn/mp_bases.c: Decrease chars_per_bit_exactly for entry 1 to
12151         work around buggy ia64-linux.
12152
12153         * longlong.h (ia64 umul_ppmm): Update register flags to match new GCC.
12154
12155 2000-10-22  Torbjorn Granlund  <tege@swox.com>
12156
12157         * mpn/alpha/ev6/gmp-mparam.h (DC_THRESHOLD): Update.
12158         * mpn/alpha/ev6/submul_1.asm: New file.
12159
12160 2000-10-22  Kevin Ryde  <kevin@swox.se>
12161
12162         * tune/gcd_bin.c: New file.
12163         * tune/gcd_finda_gen.c: New file.
12164         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
12165         * tune/speed.[ch],common.c (mpn_gcd_binary, find_a): Add measuring.
12166
12167         * * (__gmp_allocate_func etc): Rename from _mp_allocate_func etc.
12168         (__gmp_default_allocate etc): Rename from _mp_default_allocate etc.
12169         * gmp-impl.h (__GMP_REALLOCATE_FUNC_TYPE,
12170         __GMP_REALLOCATE_FUNC_LIMBS): New macros.
12171
12172         * gmp-impl.h (DC_THRESHOLD): Establish default here, set to 3*KARA
12173         since that's the measured average.
12174         * mpn/generic/dc_divrem_n.c, mpn/generic/tdiv_qr.c (DC_THRESHOLD):
12175         Remove default.
12176
12177 2000-10-21  Torbjorn Granlund  <tege@swox.com>
12178
12179         * mpn/Makefile.am (TARG_DIST): Add ia64.
12180
12181 2000-10-21  Kevin Ryde  <kevin@swox.se>
12182
12183         * *: Change BZ -> DC.
12184         * mpn/generic/dc_divrem_n.c: Renamed from bz_divrem_n.c.
12185
12186         * doc/multiplication: Remove file, now in the manual.
12187         * doc/assembly_code: Ditto.
12188         * tune/README: Remove some parts now in the manual.
12189
12190         * gmp.texi (@m etc): Add and use some new macros.
12191         (Integer Division - mpz_[cft]div_*): Merge descriptions, for brevity
12192         and to emphasise similarities.
12193         (Low-Level Functions - mpn_[lr]shift): Specify count as 1 to
12194         mp_bits_per_limb-1.
12195         (Algorithms): New chapter.
12196         (References): Add some papers.
12197
12198         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove some
12199         unused variables.
12200         * mpn/generic/mul_fft.c (mpn_fft_best_k): Ditto.
12201
12202         * tune/freq.c: New file, split from time.c.
12203         * tune/time.c: Rewrite, now more automated.
12204         * configure.in, tune/*: Consequent changes.
12205
12206 2000-10-20  Torbjorn Granlund  <tege@swox.com>
12207
12208         * mpn/ia64/default.m4: New file.
12209         * configure.in [config.m4 switch] (ia64*-*-*): Use ia64/default.m4.
12210
12211         * mpn/ia64/mul_1.asm: New file.
12212         * mpn/ia64/addmul_1.asm: New file.
12213         * mpn/ia64/add_n.asm: New file.
12214         * mpn/ia64/sub_n.asm: New file.
12215         * mpn/ia64/popcount.asm: New file.
12216         * mpn/ia64/README: New file.
12217
12218         * mpn/alpha/cntlz.asm: Override `.set noat' from ASM_START.
12219
12220         * configure.in (HAVE_TARGET_CPU_*): Support hppa1.0, hppa1.1, hppa2.0
12221         by sed'ing the period into `_'.
12222
12223         * acconfig.h: Add #undefs for hppa targets.
12224
12225         * longlong.h (udiv_qrnnd): Fix typo in last change.
12226
12227         * mpz/tstbit.c: Rewrite (partly to work around GCC 2.95.2 HPPA bug).
12228
12229         * configure.in [path switch]:
12230         (hppa2.0*-*-*): For non-CC64 case, update path.
12231
12232         * configure.in [compiler switch]:
12233         (hppa2.0w-*-*): Match with same regexp in both places.
12234         (hppa*-*-*): New case.
12235         (all hppa alternatives): Don't inherit default gmp_cflags_cc,
12236         gmp_cflags_c89.
12237
12238 2000-10-18  Torbjorn Granlund  <tege@swox.com>
12239
12240         * configure.in (alpha*-*-*): Define gmp_xoptcflags_gcc like for
12241         alpha*-*-osf*.
12242
12243         * longlong.h (x86 udiv_qrnnd): Change `d' => `dx' to avoid K&R C
12244         stringification.
12245
12246 2000-10-15  Kevin Ryde  <kevin@swox.se>
12247
12248         * doc/configuration: Updates.
12249
12250         * demos/calc.y: Remove some comments.
12251
12252 2000-10-14  Kevin Ryde  <kevin@swox.se>
12253
12254         * gmp.texi (Parameter Conventions, Memory Management): New sections
12255         split from "Variable Conventions".
12256         (Efficiency, Debugging, Profiling): New sections in "GMP Basics".
12257         (Reentrancy): Some rewording, add note on standard I/O.
12258         (Build options): Add --enable-assert and --enable-profiling.
12259
12260         * configure.in (--enable-profiling): New option.
12261         * acinclude.m4 (GMP_ASM_X86_MCOUNT): New macro, finding how to profile.
12262         * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_mcount): Profiling support.
12263
12264         * acinclude.m4, configure.in (GMP_ASM_*): Rename from GMP_CHECK_ASM_*,
12265         to follow autoconf conventions.
12266
12267         * configure.in: Run GMP_CHECK_ASM tests only if needed.
12268         * acinclude.m4 (GMP_CHECK_ASM_MMX): Don't use GMP_CHECK_ASM_TEXT.
12269
12270         * mpn/x86/x86-defs.m4 (ASSERT): Allow no condition, to just emit code.
12271
12272 2000-10-13  Kevin Ryde  <kevin@swox.se>
12273
12274         * mpq/md_2exp.c: New file.
12275         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
12276         * Makefile.am (MPQ_OBJECTS): Ditto.
12277         * gmp.h (mpq_mul_2exp, mpq_div_2exp): Add prototypes.
12278         * gmp.texi (Rational Arithmetic): Add documentation.
12279
12280         * mpq/tests/t-md_2exp.c: New file.
12281         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
12282
12283         * mpn/generic/perfsqr.c: Add/amend some comments.
12284
12285         * gmp.texi (Known Build Problems): Note VERSION problem with old
12286         sed, do some minor rewording.
12287         (Build Options): Add cygwin and djgpp URLs, mention INSTALL.autoconf,
12288         mention HTML.
12289         (Getting the Latest Version of GMP): Move this ...
12290         (Introduction to GMP): ... to here.
12291         (Compatibility with older versions): Just refer to 2.x and 3.x, not
12292         every minor version.
12293         (Initializing Integers): Note restrictions on mpz_array_init'ed
12294         variables.
12295         (Integer Logic and Bit Fiddling): Note bits are numbered from 0.
12296
12297         * INSTALL.autoconf: New file.
12298         * Makefile.am (EXTRA_DIST): Add it.
12299
12300         * tune/Makefile.am, tune/tuneup.c, configure.in, gmp-impl.h: New
12301         scheme for recompiled objects used by tune program.  Don't use
12302         libgmptune.a, make better use of libtool, work with ansi2knr.
12303
12304         * tune/speed.h,common.c (SPEED_ROUTINE_MPZ_POWM): Use s->yp and
12305         s->xp_block, make exponent a fixed size.
12306
12307 2000-10-07  Torbjorn Granlund  <tege@swox.com>
12308
12309         * mpn/mips3/gmp-mparam.h: Retune.
12310
12311         * mpn/generic/mul_n.c (USE_MORE_MPN): Revert last change.
12312
12313 2000-10-06  Torbjorn Granlund  <tege@swox.com>
12314
12315         * mpn/mips3/add_n.s: Decrease carry recurrence from 4 to 3 cycles.
12316         * mpn/mips3/sub_n.s: Likewise.
12317
12318 2000-10-04  Torbjorn Granlund  <tege@swox.com>
12319
12320         * configure.in (sparc64-*-linux*): Set path according to CC64.
12321
12322 2000-10-04  Kevin Ryde  <kevin@swox.se>
12323
12324         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Use LABEL_SUFFIX, not a
12325         hard-coded ":".
12326
12327         * config.sub: Don't demand "86" in CPU name for SCO.
12328
12329         * configure.in (supersparc-*-*): Remove -DSUPERSPARC.
12330         * longlong.h: Use HAVE_TARGET_CPU_supersparc.
12331
12332         * configure.in (HAVE_TARGET_CPU_*): AC_DEFINE from $target_cpu.
12333         * acconfig.h: Add #undefs, but only for targets of interest.
12334
12335 2000-10-03  Torbjorn Granlund  <tege@swox.com>
12336
12337         * mpn/alpha/cntlz.asm: Rewrite.
12338
12339         * mp_clz_tab.c (__clz_tab): Half table size to 128 entires.
12340         * longlong.h (count_leading_zeros): Demand just 128 entries from
12341         __clz_tab.
12342
12343         * configure.in (mips-sgi-irix6.*): Pass -mips3 in addition to options
12344         for n32 ABI.
12345
12346         * longlong.h: Move NO_ASM test around all assembly code.
12347         From gcc:
12348         * longlong.h (count_leading_zeros): Sparclite scan instruction was
12349         being invoked incorrectly.
12350         Replace __mc68332__ with __mcpu32__.
12351         Add ARC support.
12352
12353 2000-10-02  Torbjorn Granlund  <tege@swox.com>
12354
12355         * mpn/mips3/gmp-mparam.h: Retune for both gcc and cc.
12356
12357         * mpn/generic/mul_n.c (USE_MORE_MPN): Remove exception for __mips.
12358         (interpolate3): Cast mp_limb_t variables to mp_limb_signed_t
12359         when testing sign bit.
12360
12361         * mpn/alpha/ev6/gmp-mparam.h: Retune.
12362         * mpn/powerpc32/gmp-mparam.h: Retune.
12363         * mpn/powerpc64/gmp-mparam.h: Retune.
12364         * mpn/x86/pentium/gmp-mparam.h: Retune.
12365         * mpn/x86/pentium/mmx/gmp-mparam.h: Retune.
12366         * mpn/sparc32/v9/gmp-mparam.h: Retune.
12367         * mpn/x86/k6/gmp-mparam.h: Retune.
12368         * mpn/x86/p6/gmp-mparam.h: Retune.
12369         * mpn/x86/k7/gmp-mparam.h: Retune.
12370         * mpn/sparc64/gmp-mparam.h: Retune.
12371
12372         * mpn/m68k/gmp-mparam.h: New file.
12373         * mpn/alpha/ev5/gmp-mparam.h: New file.
12374
12375         * gmp-impl.h (default MPN_COPY): Remove final `;'.
12376
12377         * tune/time.c (speed_endtime): Rewrite.
12378
12379         * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Set base to a large value,
12380         not 2.
12381
12382         * demos/pexpr.c (setup_error_handler): Fix typo.
12383
12384         * mpz/powm.c (redc): New function, based on old mpz_redc.  Don't
12385         multiply here.
12386         (mpz_redc): Remove.
12387         (mpz_powm): Major changes, partially reverting to mpn calls.
12388         Multiply before calling redc.
12389         (mpz_powm): Use TMP_ allocation.
12390         (mpz_powm): Refine calculation of k (width of exponent window).
12391         (mpz_powm): Cast constants to mp_limb_t before left shifting.
12392
12393         * longlong.h: Use ia64 count_leading_zeros just when __GNUC__.
12394
12395 2000-09-29  Kevin Ryde  <kevin@swox.se>
12396
12397         * acinclude.m4 (GMP_C_SIZES): New macro.
12398         * configure.in: Use it.
12399         * acconfig.in (BYTES_PER_MP_LIMB etc): Add #undefs.
12400         * mpn/generic/gmp-mparam.h (BYTES_PER_MP_LIMB etc): Remove #defines.
12401         * gmp.texi (Known Build Problems): Remove 64-bit generic C
12402         gmp-mparam.h problem, now fixed.
12403
12404         * configure.in: Only run GMP_PROG_M4 if it's actually needed.
12405
12406 2000-09-27  Torbjorn Granlund  <tege@swox.com>
12407
12408         * demos/pexpr.c: Clean up code for systems not supporting
12409         sigaltstack.  Handle old Linux without sigaltstack.  Properly
12410         disable all stuff related to sigaltstack under Unicos.
12411
12412         * mpn/alpha/ev6/addmul_1.asm: Use explicit offset for all load and
12413         store insns.  Helps old gas.
12414
12415         * longlong.h (count_leading_zeros): Define for ia64.
12416
12417 2000-09-27  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
12418
12419         * mpn/generic/bz_divrem_n.c: Fix qhl handling, simplify.
12420
12421 2000-09-27  Kevin Ryde  <kevin@swox.se>
12422
12423         * mpn/Makefile.in (.SUFFIXES): Regenerate with patched automake to
12424         get .s before .c, which is needed to override ansi2knr .c rules.
12425
12426         * gmp.texi (mpn_sqrtrem): Fix r2p==NULL return value description
12427         to match the code (change by Torbjorn).
12428         (mpn_gcd, mpn_gcdext, mpn_sqrtrem, mpn_tdiv_qr): Note most
12429         significant limbs must be non-zero.
12430         (mpn_gcd, mpn_gcdext, mpn_sqrtrem): Clarify destination size
12431         requirements.
12432         (mpn_gcd_1): Clarify value must be non-zero, not just size.
12433
12434         * gmp-impl.h (mpn_zero_p): New inline function.
12435         * mpn/generic/inlines.c: Add gmp-impl.h.
12436         * mpf/integer.c, mpz/get_d.c, mpn/generic/mul_fft.c: Use it.
12437
12438         * mpn/generic/gcd.c: Use MPN_COPY_INCR not MPN_COPY.
12439         * mpf/add_ui.c: Ditto.
12440         * mpf/add.c: Ditto, and fix test to skip copy.
12441
12442 2000-09-26  Kevin Ryde  <kevin@swox.se>
12443
12444         * gmp-impl.h, longlong.h, mpn/generic/*.c: Add ASSERTs for various
12445         parameter restrictions.
12446
12447         * gmp-impl.h (UDIV_PREINV_TIME): New macro.
12448         * mpn/generic/sb_divrem_mn.c: Use it.
12449         * mpn/generic/perfsqr.c: Ditto.
12450         * mpn/x86/*/gmp-mparam.h (UDIV_PREINV_TIME): Add values.
12451
12452         * macos/Makefile.in: Add mpz/tests/t-get_si.c, mpf/tests/t-set_f.c,
12453         and new multi-function mpz and mpq files.
12454
12455 2000-09-25  Kevin Ryde  <kevin@swox.se>
12456
12457         * randlc.c, randlc2x.c, randsd.c, mpz/urandomb.c, mpz/urandomm.c:
12458         Use mpz_ptr and mpz_srcptr for parameters.
12459         * gmp.h (gmp_randinit_lc, gmp_randinit_lc_2exp, gmp_randseed,
12460         mpz_urandomb, mpz_urandomm): Corresponding change to prototypes.
12461         * randsdui.c: Remove wrong K&R parameters part.
12462
12463 2000-09-12  Kevin Ryde  <kevin@swox.se>
12464
12465         * gmp-impl.h (mpn_tdiv_qr): Move prototype from here ...
12466         * gmp.h (mpn_tdiv_qr): ... to here.
12467
12468         * gmp.texi (Miscellaneous Rational Functions): Comment-out and
12469         move version 1 compatibility note to "Compatibility" section.
12470         (Rational Number Functions): Ditto for canonicalization note.
12471
12472 2000-09-10  Kevin Ryde  <kevin@swox.se>
12473
12474         * mpn/x86/pentium/com_n.asm: New file.
12475
12476         * gmp.texi (Rational Arithmetic): Add mpq_abs.
12477         (Miscellaneous Rational Functions): Merge and simplify descriptions of
12478         mpq_get_num, mpq_get_den, mpq_set_num, mpq_set_den.
12479
12480         * mpq/abs.c: New file.
12481         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
12482         * Makefile.am (MPQ_OBJECTS): Add it.
12483         * gmp.h (mpq_abs): Add prototype.
12484
12485         * mpq/set_den.c: Don't discard sign when copying, this makes the
12486         code match the manual.
12487
12488 2000-09-07  Torbjorn Granlund  <tege@swox.com>
12489
12490         * tune/alpha.asm: Rewrite to actually work right.
12491
12492 2000-09-07  Kevin Ryde  <kevin@swox.se>
12493
12494         * tune/common.c,speed.[ch]: Add measuring of mpn_sqrtrem,
12495         mpn_get_str, mpn_set_str.
12496         * tune/README: Various updates.
12497
12498 2000-09-06  Torbjorn Granlund  <tege@swox.com>
12499
12500         * mpz/fits.c: Correct type of `data'.
12501
12502 2000-09-06  Kevin Ryde  <kevin@swox.se>
12503
12504         * gmp.texi (Build Options): Clarify where to find CFLAGS.
12505         (Known Build Problems): Note SCO -lc problem.
12506
12507         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Fix for sizes > 512 limbs.
12508
12509         * doc/multiplication: Corrections and additions suggested by Paul.
12510
12511         * tune/modlinv.c: New file with alternate modlimb_inverts.
12512         * tune/Makefile.am, tune/speed.[ch]: Add measuring of them.
12513         * tune/speed.c (FLAG_NODATA): New attribute, use for mpz_bin_uiui,
12514         mpz_fib_ui, mpz_fac_ui.
12515
12516         * mpn/x86/t-zdisp.sh: New file.
12517
12518         * tests/t-modlinv.c: New file.
12519         * tests/Makefile.am (check_PROGRAMS): Add it.
12520
12521         * mpq/tests/t-set_f.c: New file.
12522         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
12523
12524         * gmp-impl.h (MPQ_CHECK_FORMAT): New macro.
12525         * mpq/tests/t-get_d.c: Use it.
12526
12527         * mpq/set_f.c: New file.
12528         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
12529         * Makefile.am (MPQ_OBJECTS): Ditto.
12530         * gmp.h: Add prototype.
12531         * gmp.texi (Miscellaneous Rational Functions): Document mpq_set_f,
12532         correct return type of mpq_set_d.
12533
12534 2000-09-03  Kevin Ryde  <kevin@swox.se>
12535
12536         * mpz/aors_ui.c: New file merging add_ui.c and sub_ui.c, no object
12537         code changes.
12538         * mpz/add_ui.c, mpz/sub_ui.c: Remove files.
12539         * mpz/Makefile.am: Update.
12540
12541         * gmp-impl.h (MPZ_FITS_STYPE_SDT, MPZ_FITS_UTYPE_SDT): New macros.
12542         * mpz/fits.c: New file merging six separate fits*.c.
12543         * mpz/fits_sshort_p.c, fits_sint_p.c, fits_slong_p.c, fits_ushort_p.c,
12544         fits_uint_p.c, fits_ulong_p.c: Remove files
12545         * mpz/Makefile.am: Use new fits.c, change object names from
12546         fits_*_p.lo to fits_*.lo to avoid SunOS 4 native "ar" warnings.
12547         * Makefile.am (MPZ_OBJECTS): Change from fits_*_p.lo to fits_*.lo.
12548
12549         * acinclude.m4 (GMP_CHECK_ASM_RODATA): New macro, defining RODATA.
12550         * configure.in: Use it.
12551         * mpn/x86/k[67]/mmx/popham.asm: Use it.
12552
12553         * mpn/x86/*/*.asm: Use "TEXT" not ".text".
12554
12555 2000-09-02  Kevin Ryde  <kevin@swox.se>
12556
12557         * mpq/aors.c: New file merging add.c and sub.c, no object code changes.
12558         * mpq/add.c, mpq/sub.c: Remove files.
12559         * mpq/Makefile.am: Update.
12560
12561         * mpz/aors.c: New file merging add.c and sub.c, no object code changes.
12562         * mpz/add.c, mpz/sub.c: Remove files.
12563         * mpz/Makefile.am, mpbsd/Makefile.am: Update.
12564
12565         * configure.in: Re-apply "PROLOGUE.*" regexp change for the
12566         benefit of alpha PROLOGUE_GP, lost in path search reorganisation.
12567
12568         * mpn/x86/x86-defs.m4 (jadcl0, cmov_simulate, ASSERT,
12569         movl_text_address): Don't use "1:" style labels.
12570         (Zdisp): Rearrange a bit, switch to all hex.
12571         * mpn/x86/README.family: Note SCO "as" doesn't support "1:" style
12572         local labels, misc rewordings.
12573
12574 2000-08-29  Torbjorn Granlund  <tege@swox.com>
12575
12576         * demos/primes.c: Include string.h.
12577
12578         * config.guess (x86 variant recog code): Remove dummy*.o files
12579         generated by some compilers.
12580
12581 2000-08-28  Kevin Ryde  <kevin@swox.se>
12582
12583         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix Solaris 2.8
12584         warning message suppression, add notes about SCO.
12585
12586         * Makefile.am (MPZ_OBJECTS etc): Move some comments.
12587
12588 2000-08-25  Kevin Ryde  <kevin@swox.se>
12589
12590         * mpz/pprime_p.c (mpz_millerrabin): Fix a TMP_FREE.
12591
12592         * gmp.texi (Copying): Refer to Lesser not Library GPL.
12593         (GMP and Reentrancy): Note stack-alloc.c is not reentrant, and
12594         that SCO <ctype.h> is potentially not reentrant.
12595
12596         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Test by attempting to
12597         link with or without an underscore.
12598         * gmp.texi (Known Build Problems): Remove SunOS 4 native grep
12599         GSYM_PREFIX problem, now fixed.
12600
12601         * gmp-impl.h (MODLIMB_INVERSE_3): New constant.
12602         * mpn/generic/diveby3.c: Use it instead of own INVERSE_3.
12603         * mpn/generic/mul_n.c: Ditto.
12604         * tests/t-constants.c: Check it, and PP_INVERTED too.
12605
12606         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): New macro.
12607         * configure.in [p6 and athlon] (gmp_optcflags_gcc): Use it to
12608         possibly add -march=pentiumpro.
12609
12610         * gmp-impl.h (MPZ_SET_STR_OR_ABORT, MPF_SET_STR_OR_ABORT): New macros.
12611         * mpz/tests/t-bin.c, mpz/tests/t-get_si.c, mpz/tests/t-jac.c,
12612         mpz/tests/t-misc.c: Use them.
12613         * mpf/tests/t-conv.c, mpf/tests/t-misc.c: Ditto.
12614         * mpz/tests/convert.c: Ditto and amend diagnostics slightly.
12615         * mpz/tests/t-misc.c (check_mpz_set_si): Remove a superfluous init.
12616         * mpz/tests/io.c: Differentiate between I/O and data conversion errors.
12617
12618         * mpn/generic/aors_n.c: New file merging add_n and sub_n, no
12619         object code changes.
12620         * mpn/generic/add_n.c: Remove file.
12621         * mpn/generic/sub_n.c: Remove file.
12622
12623         * mpn/generic/aorsmul_1.c: New file merging addmul_1 and submul_1,
12624         no object code changes.
12625         * mpn/generic/addmul_1.c: Remove file.
12626         * mpn/generic/submul_1.c: Remove file.
12627
12628         * mpn/generic/popham.c: New file merging popcount and hamdist, no
12629         object code changes.
12630         * mpn/generic/popcount.c: Remove file.
12631         * mpn/generic/hamdist.c: Remove file.
12632
12633 2000-08-24  Torbjorn Granlund  <tege@swox.com>
12634
12635         * gmp-impl.h (mpn_com_n): Fix typo.
12636
12637 2000-08-23  Torbjorn Granlund  <tege@swox.com>
12638
12639         * demos/primes.c (main): Don't call mpz_probab_prime_p for numbers
12640         that are known to be prime after sieving.
12641         (main): Declare and initialize max_s_prime_squared.
12642         (MAX_S_PRIME): Increase.
12643         (ST_SIZE): Increase.
12644
12645 2000-08-23  Kevin Ryde  <kevin@swox.se>
12646
12647         * gmp-impl.h (ASSERT_ALWAYS): Change to statement style.
12648         (JACOBI_TWO_U_BIT1): Remove ASSERT.
12649         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS as a statement.
12650
12651 2000-08-21  Torbjorn Granlund  <tege@swox.com>
12652
12653         * gmp-impl.h (ASSERT): Use do..while for dummy version.
12654
12655         * mpf/get_str.c: Don't set n_digits from digits_computed_so_far
12656         when the converted operand becomes zero.  Misc cleanups.
12657
12658 2000-08-21  Kevin Ryde  <kevin@swox.se>
12659
12660         * mpz/fdiv_r_2exp.c, mpz/lcm.c, mpz/urandomm.c: Add missing
12661         TMP_MARK/FREE, avoiding memory leak when using stack-alloc.c.
12662
12663 2000-08-20  Kevin Ryde  <kevin@swox.se>
12664
12665         * mpz/set.c [BERKELEY_MP] (move): Add conditionals to build as
12666         "move" for libmp.
12667         * mpbsd/Makefile.am: Use mpz/set.c, not move.c.
12668         * Makefile.am (MPBSD_OBJECTS): Corresponding change.
12669         * mpbsd/move.c: Remove file.
12670
12671         * mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am,
12672         mpbsd/Makefile.am (-DOPERATION_foo): Use "foo" even for ansi2knr
12673         "foo_" objects.  Do this with the makefiles to keep the sources
12674         cleaner.
12675         * mpz/mul_siui.c, mpf/integer.c: Revert to plain OPERATION_* forms.
12676
12677         * mpn/lisp/gmpasm-mode.el (gmpasm-remove-from-list): Renamed from
12678         gmpasm-delete-from-list, because it's non-destructive.
12679         (gmpasm-font-lock-keywords): Add some more keywords.
12680
12681 2000-08-16  Kevin Ryde  <kevin@swox.se>
12682
12683         * tune/mul_n_mpn.c, tune/mul_n_open.c: New files, being forced
12684         open-coded and mpn #includes of mpn/generic/mul_n.c.
12685         * tune/*: Add measuring of them.
12686         * tune/speed.c: Print command line into *.gnuplot file.
12687
12688         * mpn/generic/mul_n.c (USE_MORE_MPN): Change to #if not #ifdef for
12689         using the value, add #ifndef for providing the default.
12690         * mpn/sparc64/gmp-mparam.h (USE_MORE_MPN): Add #ifndef.
12691
12692         * tests/t-constants.c: New file.
12693         * tests/Makefile.am (check_PROGRAMS): Add it.
12694
12695         * mpz/get_si.c: Use LONG_MAX, not BITS_PER_MP_LIMB, so the result
12696         doesn't depend on limb size when outside the range of a long
12697         (though such results are not actually documented).
12698         * mpz/tests/t-get_si.c: New file.
12699         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
12700
12701         * mpn/tests/try.c (call): Cast popcount and hamdist calls,
12702         for the benefit of long long limb.
12703
12704 2000-08-15  Kevin Ryde  <kevin@swox.se>
12705
12706         * mp.h (mp_set_memory_functions): Add missing #define.
12707         * mpbsd/tests/allfuns.c (mp_set_memory_functions): Verify its
12708         existance.
12709
12710         * mpf/tests/t-misc.c (check_mpf_getset_prec): New test, verifying
12711         reverted behaviour of mpf_get_prec.
12712
12713         * mpn/tests/ref.c (refmpn_strip_twos): Use refmpn_copyi, not
12714         MPN_COPY_INCR.
12715
12716         * mpz/mul_siui.c, mpf/integer.c: Recognise OPERATION_*_ forms
12717         produced under ansi2knr.
12718
12719         * configure.in (mpn_objects, mpn_objs_in_libgmp): Add $U to .c
12720         objects when ansi2knr in use.
12721
12722         * mpn/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
12723         (libdummy.la): Add this, not built, to create ansi2knr style rules
12724         for all potential .c files.
12725         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpfr/Makefile.am,
12726         mpbsd/Makefile.am, mpq/tests/Makefile.am, tests/Makefile.am
12727         (AUTOMAKE_OPTIONS): Enable ansi2knr (now everywhere).
12728         * Makefile.am (MPZ_OBJECTS, MPQ_OBJECTS, MPF_OBJECTS, MPFR_OBJECTS,
12729         MPBSD_OBJECTS, libmp_la_DEPENDENCIES): Add $U to all .lo filenames.
12730
12731 2000-08-03  Torbjorn Granlund  <tege@swox.com>
12732
12733         * mpn/alpha/ev6/addmul_1.asm: Correct number of cycles to 3.5/28.
12734
12735 2000-08-02  Torbjorn Granlund  <tege@swox.com>
12736
12737         * Version 3.1 released.
12738
12739         * gmp.texi: Rephrase mpf_urandomb documentation.
12740
12741         * mpn/alpha/ev6: New directory with ev6/21264 optimized code.
12742         * mpn/alpha/ev6/addmul_1.asm: New file.
12743         * mpn/alpha/ev6/gmp-mparam.h: New file.
12744
12745 2000-08-02  Kevin Ryde  <kevin@swox.se>
12746
12747         * demos/factorize.c (random): Don't use "inline".
12748
12749         * mpfr/log.c, mpfr/mul_ui.c, mpfr/round.c, mpfr/set.c, mpfr/set_d.c:
12750         Corrections to K&R parts.
12751
12752         * Makefile.am (EXTRA_HEADERS): Omit $(MPFR_HEADERS_OPTION).
12753         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr.h.
12754
12755         * gmp.texi (Known Build Problems): Note problem stripping libgmp.a.
12756
12757 2000-08-02  Kent Boortz  <kent@swox.com>
12758
12759         * mpfr: Integrated experimental version of mpfr-0.4.
12760         * configure.in: Changes for option --enable-mpfr.
12761         * Makefile.am: Changes for option --enable-mpfr.
12762
12763 2000-08-01  Torbjorn Granlund  <tege@swox.com>
12764
12765         * mpn/generic/popcount.c: Disable SPARC v9 popc_limb pattern.
12766         * mpn/generic/hamdist.c: Likewise.
12767
12768 2000-08-01  Kevin Ryde  <kevin@swox.se>
12769
12770         * mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
12771         source and dest regions.
12772
12773 2000-07-31  Torbjorn Granlund  <tege@swox.com>
12774
12775         * mpf/get_str.c: Develop three extra digits, not just one.
12776
12777 2000-07-31  Kevin Ryde  <kevin@swox.se>
12778
12779         * gmp.texi (References): Add URL for invariant division.
12780
12781 2000-07-30  Kevin Ryde  <kevin@swox.se>
12782
12783         * tune/time.c (speed_cpu_frequency_proc_cpuinfo): Add support for
12784         alpha linux "cycle frequency".
12785
12786         * mpn/sparc64/gmp-mparam.h: Re-run tune program for FFT thresholds.
12787
12788 2000-07-29  Kevin Ryde  <kevin@swox.se>
12789
12790         * gmp.texi (ABI and ISA): Add sparc64-*-linux*.
12791         * configure.in [sparc64-*-linux*] (gmp_cflags64_gcc): Same flags
12792         as under solaris.
12793
12794         * configure.in (--enable-fft): New option, default "no".
12795         * gmp.texi (Build Options): Describe it.
12796         * mpn/generic/mul.c, mpn/generic/mul_n.c [WANT_FFT]: Use it.
12797         * tune/tuneup.c [WANT_FFT]: By default don't probe FFTs if not enabled.
12798         * NEWS: Multiplication optionally using FFT.
12799
12800         * tune/README: Notes on FFT and GCD thresholds, other minor updates.
12801
12802         * Makefile.am: Expunge the macos generated files update stuff.
12803
12804 2000-07-28  Kevin Ryde  <kevin@swox.se>
12805
12806         * mpn/x86/*/gmp-mparam.h: Add some FFT thresholds.
12807
12808 2000-07-28  Kent Boortz  <kent@swox.se>
12809
12810         * macos/Asm*, macos/CmnObj, macos/Mp*: Delete directories.
12811         * macos/Makefile: Delete file.
12812         * macos/Makefile.cw: Delete file.
12813         * macos/config.h: Delete file.
12814         * macos/Asm/*.s: Delete files.
12815         * macos/configure: Create target directories. Don't transform
12816         '(C)' to '(;)' in a 'dnl' line comment in .asm file.
12817         * Makefile.am: Delete macos targets.
12818         * macos/README: Reflect that we reverted back to a build
12819         process that require ""macos/configure" to run on MacOS.
12820         This imply that MacPerl is needed for a build in MacOS.
12821
12822 2000-07-27  Kevin Ryde  <kevin@swox.se>
12823
12824         * mpn/generic/mul_fft.c: New file, by Paul Zimmermann, minor mods
12825         applied.
12826         * configure.in (gmp_mpn_functions): Add it.
12827         * mpn/generic/mul.c, mpn/generic/mul_n.c: Use it.
12828         * doc/multiplication: Describe it (briefly).
12829
12830         * gmp-impl.h (FFT_MUL_THRESHOLD etc): New thresholds.
12831         (mpn_fft_best_k, mpn_fft_next_size, mpn_mul_fft, mpn_mul_fft_full):
12832         New functions.
12833         (numberof, TMP_ALLOC_TYPE etc, _MP_ALLOCATE_FUNC_TYPE etc,
12834         UNSIGNED_TYPE_MAX etc): New macros.
12835
12836         * tune/*: Add FFT threshold tuning and speed measuring.
12837         * tune/common.c: Avoid huge macro expansions for umul and udiv.
12838
12839         * mpz/tests/t-bin.c, mpz/tests/t-jac.c, mpz/tests/t-misc.c,
12840         mpbsd/tests/t-misc.c, mpf/tests/t-misc.c, mpn/tests/try.c,
12841         mpn/tests/spinner.c: Use new gmp-impl.h macros.
12842
12843         * demos/Makefile.am (BUILT_SOURCES): Don't need calc.c etc under this.
12844
12845 2000-07-27  Torbjorn Granlund  <tege@swox.com>
12846
12847         * mpn/ia64/gmp-mparam.h: New file.
12848
12849 2000-07-26  Torbjorn Granlund  <tege@swox.com>
12850
12851         * demos/isprime.c: Handle any number of arguments and print
12852         classification for each.  Add `-q' option for old behaviour.
12853
12854 2000-07-26  Kevin Ryde  <kevin@swox.se>
12855
12856         * gmp.texi (Build Options): Mention djgpp stack size.
12857         (Notes for Package Builds): New section.
12858         (Compatibility with older versions): Update for 3.1, add mpf_get_prec.
12859
12860         * demos/factorize.c [__GLIBC__]: Don't declare random() under glibc.
12861
12862         * gmp.h (gmp_version): Add prototype and define.
12863
12864         * Makefile.am: Keep macos directory generated files up-to-date
12865         during development and on a "make dist".
12866
12867 2000-07-25  Torbjorn Granlund  <tege@swox.com>
12868
12869         * mpn/hppa/gmp-mparam.h: Update threshold values from new `tune' run.
12870
12871         * mpn/pa64/gmp-mparam.h: Fill in values from `make tune' run.
12872         * mpn/pa64w/gmp-mparam.h: Likewise.
12873         * mpn/mips3/gmp-mparam.h: Likewise.
12874
12875         * tune/hppa2.asm: Fix typo in .level directive.
12876
12877         * configure.in: Add sparc64-*-linux* support (from Jakub Jelinek).
12878         * configure: Regenerate.
12879
12880         * mpn/sparc64/rshift.asm: Use %g5 instead of volatile stack frame area
12881         for return value (from Jakub Jelinek).
12882         * mpn/sparc64/lshift.asm: Likewise.
12883
12884         * mpf/get_prc.c: Revert Aug 8, 1996 change.
12885
12886         * version.c: No longer static.
12887
12888         * mpn/pa64/gmp-mparam.h: Only #define *_THRESHOLD if not already
12889         defined.
12890         * mpn/pa64w/gmp-mparam.h: Likewise.
12891         * mpn/arm/gmp-mparam.h: Likewise.
12892         * mpn/mips3/gmp-mparam.h: Likewise.
12893
12894 2000-07-25  Kevin Ryde  <kevin@swox.se>
12895
12896         * INSTALL: It's "info -f ./gmp.info" to be sure of hitting the
12897         gmp.info in the current directory.
12898
12899         * Makefile.am (libmp_la_DEPENDENCIES): Add mpz/cmp.lo, for last
12900         mpz/powm.c fix.
12901
12902         * mpn/sparc64/addmul1h.asm, mpn/sparc64/submul1h.asm: Renamed from
12903         addmul_1h.asm, submul_1h.asm to avoid name conflicts on an 8.3
12904         filesystem.
12905         * mpn/sparc64/addmul_1.asm, mpn/sparc64/submul_1.asm,
12906         mpn/sparc64/mul_1.asm: Update include_mpn()s.
12907
12908 2000-07-24  Torbjorn Granlund  <tege@swox.com>
12909
12910         * Update header of all files previously under the Library GPL
12911         to instead be under the Lesser GPL.
12912
12913         * COPYING.LIB: Now Lesser GPL.
12914         * demos/primes.c: Change license to GPL (was Library GPL).
12915         * demos/isprime.c: Change license to GPL (was Library GPL).
12916
12917         * gmp.h (error code enum): Add GMP_ERROR_BAD_STRING (currently unused).
12918
12919         * mpz/tests/t-mul.c: Default SIZE to a function of TOOM3_MUL_THRESHOLD.
12920         Improve error messages.  Decrease reps.
12921
12922 2000-07-22  Kevin Ryde  <kevin@swox.se>
12923
12924         * tune/speed.h: Decrease the amount of data used for gcd and powm
12925         measuring, to make the tune go a bit faster.
12926
12927 2000-07-21  Kent Boortz  <kent@swox.se>
12928
12929         * macos/Asm*, macos/CmnObj, macos/Mp*: Directories no longer created
12930         from configure script, now part of dist.
12931         * macos/Makefile
12932         * macos/Makefile.cw
12933         * macos/config.h
12934         * macos/Asm/*.s
12935         New files and directories that is the output from configure. This way
12936         no Perl installation is required to build on MacOS, just MPW.
12937         * macos/configure: Added prefix '__g' to exported assembler labels.
12938         Changed to handle new m4 syntax instead of the old cpp syntax in asm.
12939         * macos/Makefile.in: Corrected 'clean' target, added 'distclean'
12940         and 'maintainer_clean'. Added "mpn/mp_bases.c" to build.
12941         * macos/README: Reflect the new build process without configure.
12942         Corrected the file structure for Apple MPW installation.
12943
12944 2000-07-21  Torbjorn Granlund  <tege@swox.com>
12945
12946         * mpf/tests/t-muldiv.c: Relax error limit.  Make precision depend
12947         on SIZE.  Misc changes.
12948
12949         * configure: Regenerate.
12950
12951 2000-07-20  Kent Boortz  <kent@swox.com>
12952
12953         * macos/Makefile.in: Removed hard coded targets, added special
12954         targets found in Makefile.am files.
12955         * macos/configure: Generate targets from top configure script and
12956         Makefile.am files. Made script runnable from Unix for testing.
12957         * macos/README: Notes about search paths for includes, contributed
12958         by Marco Bambini.
12959         * configure.in: Added comment about lines that the "macos/configure"
12960         script depend on.
12961
12962 2000-07-20  Torbjorn Granlund  <tege@swox.com>
12963
12964         * mpz/powm.c (mpz_powm): After final mpz_redc call, subtract `mod'
12965         from result if it is greater than `mod'.
12966
12967 2000-07-19  Torbjorn Granlund  <tege@swox.com>
12968
12969         * mpn/hppa/gmp-mparam.h: Fill in values from `make tune' run.
12970         * mpn/alpha/gmp-mparam.h: Likewise.
12971         * mpn/powerpc32/gmp-mparam.h: Likewise.
12972
12973         * tune/hppa.asm: New file.
12974         * tune/hppa2.asm: New file.
12975         * configure.in (SPEED_CYCLECOUNTER_OBJS): Set for hppa2*-*-* and
12976         hppa*-*-*.
12977         * tune/Makefile.am (EXTRA_DIST): Add hppa.asm and hppa2.asm.
12978
12979         * tune/speed.h (SPEED_ROUTINE_MPN_BZ_DIVREM_CALL): Declare `marker';
12980         invoke TMP_FREE.
12981
12982         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Use "%" instead of "'" for
12983         reloc/symbol delimiter.
12984
12985 2000-07-16  Torbjorn Granlund  <tege@swox.com>
12986
12987         * mpn/powerpc64/gmp-mparam.h: Update with output from tune utility.
12988         * mpn/powerpc64/copyi.asm: New file.
12989         * mpn/powerpc64/copyd.asm: New file.
12990
12991 2000-07-16  Kevin Ryde  <kevin@swox.se>
12992
12993         * tune/*: Add measuring for umul_ppmm and udiv_qrnnd.
12994
12995 2000-07-14  Kevin Ryde  <kevin@swox.se>
12996
12997         * mpn/x86/k6/k62mmx: New directory.
12998         * configure.in (k6[23]*-*-*): Use it.
12999         * mpn/x86/k6/k62mmx/copyi.asm, mpn/x86/k6/k62mmx/copyd.asm: Move from
13000         mmx directory, improve code alignment a bit.
13001         * mpn/x86/k6/k62mmx/lshift.asm, mpn/x86/k6/k62mmx/rshift.asm: Ditto,
13002         and improve addressing modes for pre-CXT cores.
13003         * mpn/x86/x86-defs.m4 (Zdisp): Add an instruction.
13004         * mpn/x86/k6/mmx/lshift.asm, mpn/x86/k6/mmx/rshift.asm: New files,
13005         suiting plain K6.
13006         * mpn/x86/README, mpn/x86/k6/README: Updates.
13007         * mpn/x86/k6/mmx/*.asm: Update some comments.
13008
13009         * mpn/tests/Makefile.am: Use $(MAKE) in .asm rules, not "m".
13010         * tune/Makefile.am: Use $(EXEEXT) and libtool --config objdir, for
13011         the benefit of djgpp.
13012
13013         * */Makefile.in: Regenerate with patched automake that adds
13014         $(EXEEXT) to EXTRA_PROGRAMS.
13015
13016         * mpn/tests/try.c: Add #ifdef to SIGBUS, for the benefit of djgpp.
13017         * config.guess: Recognise pc:*:*:* as an x86, for djgpp.
13018
13019         * configure: Regenerate with patched autoconf to fix temp file
13020         ".hdr" which is invalid on a DOS 8.3 filesystem, and to fix two
13021         sed substitutes that clobbered a ":" in $srcdir (eg. a DOS drive
13022         spec).
13023
13024         * mpz/tests/io.c: Use one fp opened "w+", since separately opened
13025         input and output doesn't work on MS-DOS 6.21.
13026
13027         * tests/rand/Makefile.am (allprogs): Pseudo-target to build everything.
13028         (CLEANFILES): Add EXTRA_PROGRAMS and EXTRA_LTLIBRARIES.
13029         (manual-test, manual-bigtest): Add $(EXEEXT) to dependencies.
13030
13031         * tests/rand/*/Makefile.in: Regenerate with patched automake that adds
13032         $(EXEEXT) to EXTRA_PROGRAMS.
13033
13034 2000-07-13  Torbjorn Granlund  <tege@swox.com>
13035
13036         * mpz/tests/t-root.c: Also test mpz_perfect_power_p.
13037         Generate `nth' so that there will be fewer trivial values.
13038
13039         * mpz/root.c: Reverse return value in tests for detecting root of +1
13040         and -1.
13041
13042         * mpz/perfpow.c: Use TMP_ALLOC interface.
13043
13044 2000-07-12  Torbjorn Granlund  <tege@swox.com>
13045
13046         * mpz/perfpow.c (primes): Make it const.
13047
13048 2000-07-06  Kevin Ryde  <kevin@swox.se>
13049
13050         * mpn/x86/k6/cross.pl: New file.
13051
13052         * mpn/x86/*/gmp-mparam.h: Updates to thresholds, conditionalize
13053         all _TIME defines.
13054         * mpn/x86/pentium/mmx/gmp-mparam.h: New file.
13055         * mpn/sparc64/gmp-mparam.h: Update thresholds.
13056         * mpn/sparc32/v9/gmp-mparam.h: Ditto.
13057
13058 2000-07-04  Kevin Ryde  <kevin@swox.se>
13059
13060         * NEWS: Updates.
13061         * mpn/x86/*/README: Miscellaneous updates.
13062
13063         * tune/speed-ext.c: New file.
13064         * tune/Makefile.am: Add it.
13065         * tune/README: Updates.
13066         * tune/speed.h (SPEED_ROUTINE_MPN_DIVREM_2): Bug fixes.
13067
13068         * demos/calc.y,calclex.l: New files.
13069         * demos/calc.c,calc.h,calclex.c: New files, generated from .y and .l.
13070         * demos/Makefile.am: Add them.
13071
13072         * gmp.h (mpq_swap, mpf_swap): Add prototypes and defines.
13073
13074 2000-07-01  Kevin Ryde  <kevin@swox.se>
13075
13076         * gmp.texi (ABI and ISA): New section, bringing together ABI notes.
13077         (Build Options): Add MPN_PATH, various updates.
13078         (Build Options): Add note on setting CFLAGS when setting CC.
13079         (Notes for Particular Systems): Add -march=pentiumpro problem.
13080         (Known Build Problems): Note on gmp-mparam.h for 64-bit generic C.
13081         (GMP Variable Conventions): Add some info on user defined functions.
13082         (Reporting Bugs): Minor rewording.
13083
13084         * configure.in (MPN_PATH): Renamed from mpn_path.
13085
13086         * gmp-impl.h (ULONG_MAX,ULONG_HIGHBIT,...,SHORT_MAX): New defines.
13087         * mp[zf]/tests/t-misc.c: Use them.
13088
13089         * mpbsd/tests/t-misc.c: New file.
13090         * mpbsd/tests/Makefile.am: Add it.
13091
13092         * Makefile.am (LIBGMP_LT_*, LIBMP_LT_*): Bump version info.
13093         * gmp.h (__GNU_MP_VERSION_*): Bump to 3.1.
13094
13095         * mpf/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
13096
13097         * Makefile.am (libmp_la_SOURCES): Add mp_set_fns.c, accidentally
13098         omitted in gmp 3.0.x.
13099         * gmp.texi (Custom Allocation): Note this is available in mpbsd,
13100         and some minor rewording.
13101
13102 2000-06-30  Torbjorn Granlund  <tege@swox.com>
13103
13104         * demos/factorize.c (random): New function, defined conditionally.
13105         (factor_using_pollard_rho): Use it, not mrand48.
13106
13107         * mpn/cray/README: New file.
13108
13109 2000-06-30  Kevin Ryde  <kevin@swox.se>
13110
13111         * mpn/x86/pentium/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
13112
13113         * mpz/tests/t-jac.c: Test limbs on mpn_jacobi_base, not just ulongs.
13114
13115         * gmp-impl.h, mpn/tests/try.c, mpn/tests/spinner.c, tune/speed.c:
13116         Use config.h unconditionally, not under HAVE_CONFIG_H.
13117
13118         * demos/pexpr.c [__DJGPP__]: Patch by Richard Dawe to not use
13119         setup_error_handler on djgpp.
13120
13121         * tune/*: Locate data to help direct-mapped caches, add measuring
13122         of mpz_init/clear, mpz_add and mpz_bin_uiui, various cleanups.
13123         * configure.in (AC_CHECK_FUNCS): Add popen.
13124
13125 2000-06-29  Torbjorn Granlund  <tege@swox.com>
13126
13127         * mpf/mul_2exp.c: Streamline criterion for whether to use mpn_lshift or
13128         mpn_rshift.  Increase precision when exp is a multiple of
13129         BITS_PER_MP_LIMB primarily to make exp==0 be a noop.
13130         * mpf/div_2exp.c: Analogous changes.
13131
13132         * mpf/tests/t-dm2exp.c: Set u randomly in loop.  Perform more
13133         mpf_mul_2exp testing.
13134
13135         * configure.in: Recognize cray vector processors with a broad `*';
13136         move after alpha* not to match that.
13137
13138 2000-06-28  Kevin Ryde  <kevin@swox.se>
13139
13140         * mpz/tests/io.c: Use a disk file, not a pipe, switch to ansi2knr
13141         style, switch from MP_INT to mpz_t, add a couple of error checks.
13142         * mpz/tests/Makefile.am (CLEANFILES): Add io.tmp, in case io.c fails.
13143
13144 2000-06-27  Torbjorn Granlund  <tege@swox.com>
13145
13146         * mpf/tests/t-get_d.c: Be more lax about relative error, to handle Cray
13147         floating point format.
13148
13149         * mpq/tests/t-get_d.c: Decrease default reps to 1000.
13150
13151         * mpf/tests/t-conv.c: Correct type of `bexp'.
13152
13153         * configure.in (cray vector machines): Don't inherit gmp_cflags_cc.
13154
13155         * tune/Makefile.am (EXTRA_DIST): Delete sparc64.asm.
13156
13157         * configure.in (cray vector machines): Set extra_functions.
13158
13159         * mpn/cray/mulww.f: New file with vectorizing cray code.
13160         * mpn/cray/mulww.s: Generated from mulww.f.
13161         * mpn/cray/mul_1.c: New file.
13162         * mpn/cray/addmul_1.c: New file.
13163         * mpn/cray/submul_1.c: New file.
13164         * mpn/cray/add_n.c: New file.
13165         * mpn/cray/sub_n.c: New file.
13166
13167 2000-06-26  Kevin Ryde  <kevin@swox.se>
13168
13169         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix so it actually
13170         detects solaris 2.6, and also suppress warning on solaris 2.8.
13171         * configure.in (SPEED_CYCLECOUNTER): Remove spurious "athlon" from
13172         sparc case.
13173
13174         * mpn/lisp/gmpasm-mode.el: Move keymap to the top of the docstring.
13175
13176 2000-06-21  Kevin Ryde  <kevin@swox.se>
13177
13178         * mpn/generic/mul_n.c (mpn_kara_mul_n, mpn_kara_sqr_n): Use
13179         mp_size_t for n2.
13180         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use mp_size_t for size
13181         parameters and "l" variables.
13182         * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Update prototypes.
13183
13184         * mpbsd/itom.c, mpbsd/sdiv.c: Add casts for correct handling of
13185         -0x80...00 on systems with sizeof(short)==sizeof(int).
13186
13187         * mpz/tests/t-misc.c: Move "bin" test from here ...
13188         * mpz/tests/t-bin.c: ... to here, and add a new (2k,k) test too.
13189         * mpz/tests/Makefile.am (check_PROGRAMS): Add t-bin.
13190
13191         * mpz/bin_ui.c [_LONG_LONG_LIMB]: Use mpn_divrem_1, since kacc is
13192         a limb not a ulong.
13193         * mpz/bin_uiui.c [_LONG_LONG_LIMB]: Ditto, and use mpn_mul_1 too,
13194         since nacc is a limb.
13195
13196         * mpf/tests/t-misc.c (check_mpf_set_si, check_mpf_cmp_si):
13197         New file, testing mpf_set_si, mpf_init_set_si, and mpf_cmp_si.
13198         * mpf/tests/Makefile.am (check_PROGRAMS): Add it.
13199
13200         * mpz/tests/t-misc.c (check_mpz_set_si, check_mpz_cmp_si):
13201         New tests, for mpz_set_si, mpz_init_set_si, and mpz_cmp_si.
13202
13203         * mpz/set_si.c, mpz/iset_si.c, mpz/cmp_si.c [_LONG_LONG_LIMB]: Fix
13204         handling of -0x80..00.
13205         * mpf/set_si.c, mpf/iset_si.c, mpf/cmp_si.c [_LONG_LONG_LIMB]: Ditto.
13206
13207 2000-06-19  Torbjorn Granlund  <tege@swox.com>
13208
13209         * demos/primes.c: Properly handle arguments `m +n'.
13210
13211 2000-06-17  Torbjorn Granlund  <tege@swox.com>
13212
13213         * config.sub: Recognize k5 and k6 with common pattern.
13214
13215         * mpq/tests/t-get_d.c: Also test mpq_set_d.  Misc improvements.
13216
13217         * mpq/set_d.c: Special case 0.0.  Don't call mpn_rshift with 0 count.
13218         Allocate correct amount of memory for numerator.  Delete spurious
13219         ASSERT_ALWAYS(1).
13220
13221 2000-06-17  Kevin Ryde  <kevin@swox.se>
13222
13223         * mpz/perfsqr.c: Fix so that zero is considered a perfect square.
13224         (Was wrongly calling mpn_perfect_square_p with size==0.)
13225
13226 2000-06-16  Kevin Ryde  <kevin@swox.se>
13227
13228         * configure.in: Set k5*-*-* to use basic i386 code until there's
13229         something specific.  Add path=x86 as a default for x86s.
13230
13231         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_LOG): Generate
13232         ALIGN_LOGARITHMIC setting, not a full ALIGN definition.
13233         (GMP_CHECK_ASM_ALIGN_FILL_0x90): New test.
13234         * configure.in [x86-*-*]: Use GMP_CHECK_ASM_ALIGN_FILL_0x90.
13235         * mpn/asm-defs.m4 (ALIGN): New macro.
13236         * mpn/x86/x86-defs.m4 (ALIGN): Remove supplementary definition.
13237
13238         * tune/*: Plain "unsigned" for speed_cyclecounter.
13239         * configure.in: Use tune/sparcv9.asm for 32 and 64 bit modes.
13240         * tune/sparc64.asm: Remove file.
13241
13242 2000-06-15  Torbjorn Granlund  <tege@swox.com>
13243
13244         * mpn/x86/k7/mmx/copyi.asm: Use `testb' instead of `test'.
13245         * mpn/x86/k7/mmx/copyd.asm: Likewise.
13246
13247         * mpn/x86/k7/mmx/lshift.asm: Avoid using `~' (Solaris as problems).
13248         * mpn/x86/k7/mmx/rshift.asm: Likewise.
13249         * mpn/x86/k6/aors_n.asm: Likewise.
13250         * mpn/x86/k7/aors_n.asm: Likewise.
13251         * mpn/x86/k7/mul_basecase.asm: Likewise.
13252
13253 2000-06-13  Torbjorn Granlund  <tege@swox.com>
13254
13255         * tune/sparcv9.asm: Tune, deleting two instructions.
13256
13257         * tune/alpha.asm: Update to unified speed_cyclecounter.
13258
13259 2000-06-11  Kevin Ryde  <kevin@swox.se>
13260
13261         * mpz/tests/reuse.c (FAIL): Add a K&R version.
13262         Use _PROTO on some typedefs.
13263         * mpz/tests/t-misc.c: Add gmp-impl.h for "const".
13264
13265         * configure.in: Rework mpn multi-function and optional files.
13266         Names standardized, no need for explicit declarations, all picked
13267         up in one $path traversal.
13268         * doc/configuration: Updates.
13269
13270         * tests/rand/t-rand.c (main): Change "usage" to work with K&R.
13271
13272 2000-06-10  Kevin Ryde  <kevin@swox.se>
13273
13274         * mpn/x86/pentium/mmx/popham.asm, mpn/x86/p6/mmx/popham.asm,
13275         mpn/x86/p6/p3mmx/popham.asm, mpn/x86/p6/diveby3.asm: Add
13276         MULFUNC_PROLOGUE for correct HAVE_NATIVE_* matching.
13277
13278         * mpn/x86/x86-defs.m4 (cmov_bytes_tttn): Use eval() on expressions.
13279         (cmov_available_p): Switch to list CPUs which do have cmov.
13280         * mpn/x86/p6/sqr_basecase.asm, mpn/x86/k6/sqr_basecase.asm,
13281         mpn/x86/k7/sqr_basecase.asm: Use eval() for multiplication.
13282         * mpn/x86/README.family: Various updates.
13283
13284 2000-06-09  Kevin Ryde  <kevin@swox.se>
13285
13286         * mpbsd/tests/allfuns.c (main): Call exit() instead of doing return.
13287
13288         * doc/tasks.html, doc/projects.html: Moved from projects directory.
13289         * doc/multiplication: New file.
13290         * Makefile.am (EXTRA_DIST): Remove projects, add doc.
13291
13292         * Makefile.am (libgmp_la_LIBADD, libmp_la_LIBADD): Remove
13293         unnecessary -lm.
13294         * INSTALL: Remove -lm from instructions.
13295         * demos/Makefile.am (qcn_LDADD): Add -lm.
13296
13297         * tune/*: Add measuring for mpn_divrem_2 and modlimb_invert,
13298         improve addsub_n.  Switch to unified speed_cyclecounter.
13299         * configure.in: Update configs for speed_cyclecounter.
13300
13301         * gmp-impl.h (MP_LIMB_T_MAX, MP_LIMB_T_HIGHBIT): New macros.
13302         * mpn/generic/diveby3.c, mpn/generic/mul_n.c, mpn/generic/gcd.c,
13303         tune/speed.c, mpn/tests/ref.c: Use them.
13304
13305         * mpn/tests/spinner.c: Remove setitimer, just alarm is enough.
13306         * configure.in (AC_CHECK_FUNCS): Remove setitimer.
13307         * mpn/tests/x86call.asm: Start with junk in %eax, %ecx, %edx.
13308         * mpn/tests/ref.[ch] (refmpn_addsub_nc): New function.
13309         * mpn/tests/try.c: Add some support for mpn_addsub_nc.
13310         * mpn/tests/Makefile.am (EXTRA_PROGRAMS): Remove addsub_n and
13311         addsub_n_2 which don't currently build.
13312         * mpn/tests/copy.c: Test MPN_COPY_INCR, not __gmpn_copy.
13313
13314         * tests/rand/Makefile.am (libstat_la_LIBADD): Add -lm, no longer on
13315         libgmp.la.
13316         (findlc_LDADD): Use libstat.la.
13317         (AUTOMAKE_OPTIONS): Use ansi2knr.
13318
13319 2000-06-08  Torbjorn Granlund  <tege@swox.com>
13320
13321         * configure.in (alpha*-*-osf*): Default `flavour' to ev6 for ev6 and
13322         higher.
13323         (alpha*-*-*): Likewise.
13324         (alpha*-*-osf*: gmp_optcflags_cc): Move -arch/-tune flags from
13325         gmp_xoptcflags_gcc.
13326
13327         * mpn/Makefile.am (TARG_DIST): Add pa64w.
13328
13329         * longlong.h: Wrap 64-bit hppa code in #ifndef LONGLONG_STANDALONE.
13330
13331 2000-06-07  Torbjorn Granlund  <tege@swox.com>
13332
13333         * mpz/remove.c: Fail for `src' being zero.
13334
13335         * mpz/tests/reuse.c: Test more functions.
13336         (FAIL): New define.
13337
13338         * mpz/tests/t-powm.c: Loop during operand generation while they
13339         are mathematically ill-defined (used to just skip such tests).
13340
13341         * mpz/powm.c (mpz_redc): Clean up argument declarations.
13342
13343         * configure.in (gmp_cflags64_gcc): Don't add bogus -mWHAT option.
13344         (sparcv9-*-solaris2.[7-9]], gmp_cflags64_gcc):
13345         Inherit from previous gmp_cflags64_gcc; pass `-m64 -mptr64'.
13346         (ia64*-*-*): New.
13347
13348         * mpn/generic/dump.c: Make it work when an mp_limb_t is not `long'.
13349
13350         * mpf/set_prc.c: MPN_COPY => MPN_COPY_INCR.
13351
13352 2000-06-06  Torbjorn Granlund  <tege@swox.com>
13353
13354         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n):
13355         Use mpn_incr_u for final carry propagation.
13356
13357         * mpz/tests/t-gcd.c: Add calls to mpz_gcdext with argument t == NULL.
13358
13359         * mpz/tests/reuse.c: Major rewrite; test many more functions.
13360
13361         * mpz/powm_ui.c: When exp is 0, change res assign order in order
13362         to handle argument overlap.
13363         * mpz/powm.c: When exp is 0, change res assign order in order
13364         to handle argument overlap.  Handle negative exp and mod arguments.
13365
13366         * mpz/gcdext.c: Rework code after mpn_gcdext call to handle
13367         argument overlap.
13368
13369         * mpz/fdiv_qr.c: Read dividend->_mp_size before calling mpz_tdiv_qr
13370         in order to handle argument overlap.
13371         * mpz/cdiv_qr.c: Likewise.
13372
13373         * mpf/tests/reuse.c: Fix typo that effectively disabled `dis_funcs'
13374         tests.  Clean up test for mpf_ui_div.
13375
13376 2000-06-06  Kevin Ryde  <kevin@swox.se>
13377
13378         * mpn/x86/p6/sqr_basecase.asm: New file.
13379         * mpn/x86/mod_1.asm: Avoid one conditional jump.
13380         * mpn/x86/p6/gmp-mparam.h: Update thresholds, #ifndef UMUL_TIME
13381         and UDIV_TIME, add COUNT_TRAILING_ZEROS_TIME.
13382
13383         * mp_minv_tab.c: New file.
13384         * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
13385         * gmp-impl.h (modlimb_invert): New macro.
13386         * mpz/powm.c: Remove mpz_dmprepare, use modlimb_invert instead.
13387         * mpn/generic/bdivmod.c: Use modlimb_invert instead of a loop.
13388         * mpn/generic/gcd.c: Inline two small mpn_bdivmod calls, use
13389         MPN_COPY_INCR not MPN_COPY in one place.
13390
13391 2000-06-05  Torbjorn Granlund  <tege@swox.com>
13392
13393         * mpf/tests/reuse.c (dsi_funcs): Add mpf_mul_2exp and mpf_div_2exp.
13394         (main): Clean up test for mpf_div_ui.
13395
13396         * mpf/mul_2exp.c: Correct criterion for whether to use mpn_lshift or
13397         mpn_rshift.  MPN_COPY => MPN_COPY_INCR.  Coerce the two assignments to
13398         r->_mp_size.
13399
13400         * mpf/div_2exp.c: Use mpn_rshift instead of mpn_lshift when overlap
13401         so requires.  MPN_COPY => MPN_COPY_INCR.
13402
13403         * mpf/tests/t-dm2exp.c: Correct type of res_prec.
13404
13405 2000-06-04  Kevin Ryde  <kevin@swox.se>
13406
13407         * mpz/bin_uiui.c: Fix result for n==0 and n==k.
13408         * mpz/bin_ui.c: Fix result for k>n, add support for n<0.
13409         * gmp.texi (Number Theoretic Functions): Update mpz_bin_ui to
13410         note n<0 is supported.
13411
13412         * mpz/tests/t-misc.c: New file.
13413         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
13414
13415 2000-05-31  Kevin Ryde  <kevin@swox.se>
13416
13417         * tune/speed.* (FLAG_R_OPTIONAL): New option for routines, use on
13418         mpn_gcd_1 and mpn_mul_basecase.
13419         * tune/README: Update.
13420
13421         * tune/alpha.asm: New file, by Torbjorn.
13422         * tune/Makefile.am (EXTRA_DIST): Add it.
13423         * configure.in (alpha*-*-*): Use it.
13424
13425 2000-05-31  Linus Nordberg  <linus@swox.se>
13426
13427         * doc/configuration: New file.
13428
13429 2000-05-30  Torbjorn Granlund  <tege@swox.com>
13430
13431         * mpn/generic/mul_basecase.c: Call mpn_mul_2 and mpn_addmul_2
13432         if available.  Don't include longlong.h.
13433
13434         * doc/isa_abi_headache: New file.
13435
13436 2000-05-30  Linus Nordberg  <linus@swox.se>
13437
13438         * configure.in (NM): Use AC_PROG_NM rather than AC_CHECK_TOOL to
13439         find `nm'.  (AC_PROG_NM comes with Libtool and is needed to get
13440         the `-B' option (BSD compatible output) included in $NM.)
13441         (AR): Use AC_CHECK_PROG rather than AC_CHECK_TOOL to find `ar'.
13442         (Now that NM isn't a cross compilation tool, don't give the
13443         impression that we know how to cross compile.)
13444         (CCAS): Remove spurious comment.
13445
13446         * gmp.texi (Notes for Particular Systems): Remove comment about
13447         using GNU `nm' on AIX since system nm now works.
13448
13449 2000-05-29  Torbjorn Granlund  <tege@swox.com>
13450
13451         * mpn/power/mul_1.s: Remove [PR] from first word in function
13452         descriptor.
13453         * mpn/power/addmul_1.s: Likewise.
13454         * mpn/power/submul_1.s: Likewise.
13455
13456 2000-05-28  Kevin Ryde  <kevin@swox.se>
13457
13458         * configure.in, tune/*: Change pentium rdtsc cycle scheme to
13459         HAVE_SPEED_CYCLECOUNTER and SPEED_CYCLECOUNTER_OBJS.
13460         * tune/pentium.asm: Renamed and converted from rdtsc.asm.
13461         * tune/sparcv9.asm: New file, by Torbjorn.
13462         * tune/sparc64.asm: New file.
13463         * tune/tuneup.c: Put a limit on gcdext search.
13464
13465         * gmp.h (mp_set_memory_functions): Add extern "C".
13466         * mp.h (__GNU_MP__): Bump to "3".
13467         * mpz/add.c,mul.c,powm.c,sub.c,sqrtrem.c,tdiv_qr.c [BERKELEY_MP]:
13468         Include mp.h for mpbsd compile.
13469         * mpz/gcd.c: Ditto, and remove _mpz_realloc declaration.
13470
13471         * gmp.texi (Integer Functions): Flatten @subsections into @sections.
13472         (Floating-point Functions): Ditto.
13473         (Integer Random Numbers): Split from miscellaneous as a sep section.
13474         (Installing GMP): Make nodes for the sections.
13475         Add more "@cindex"s.
13476         (Known Build Problems): Remove SunOS get_d problem, believed fixed.
13477         (Notes for Particular Systems): Remove HPPA note since now PIC.
13478         (References): URL for Jebelean.
13479
13480 2000-05-27  Torbjorn Granlund  <tege@swox.com>
13481
13482         * mpn/pa64w: New directory, contents based on corresponding mpn/pa64
13483         files.
13484         * configure.in (hppa2.0w-*-*): New.
13485         * mpz/tests/io.c (_INCLUDE_POSIX_SOURCE): Define when __hpux before
13486         including stdio.h.
13487         * gmp-impl.h: Always define DItype and UDItype.
13488
13489 2000-05-27  Kevin Ryde  <kevin@swox.se>
13490
13491         * tune/common.c (speed_measure): Correction to array sorting,
13492         better diagnostic when measuring fails.
13493         * tune/time.c: Add microsecond accurate getrusage method.
13494
13495         * tune/time.c (speed_cpu_frequency_processor_info): New function.
13496         * configure.in (AC_CHECK_FUNCS): Add processor_info.
13497
13498 2000-05-26  Linus Nordberg  <linus@swox.se>
13499
13500         * gmp.texi (Installing GMP): Shared libraries work for AIX < 4.3
13501         if using GNU nm.
13502
13503 2000-05-26  Torbjorn Granlund  <tege@swox.com>
13504
13505         * tune/tuneup.c (SIGNED_TYPE_MAX): Shift `-1' instead of `1' to
13506         avoid signed overflow.
13507
13508         * demos/pexpr.c (setup_error_handler): Don't call sigaltstack on
13509         Unicos.
13510
13511 2000-05-25  Torbjorn Granlund  <tege@swox.com>
13512
13513         * insert-dbl.c: Work around GCC 2.8 bug.
13514         * extract-dbl.c: Likewise.
13515
13516         * config.sub: Allow i586, i686, i786 again.
13517
13518         * config.guess: Use X86CPU for lots more systems.
13519
13520 2000-05-25  Linus Nordberg  <linus@swox.se>
13521
13522         * mpbsd/tests/dummy.c (main): Call exit() instead of doing return
13523         (some old SysV machines don't get this correct, I've heard.)
13524
13525 2000-05-25  Kevin Ryde  <kevin@swox.se>
13526
13527         * mpf/iset_str.c: Initialize _mp_size and _mp_exp to 0, in case no
13528         digits in string, so it's the same as a separate init and set_str.
13529
13530 2000-05-24  Torbjorn Granlund  <tege@swox.com>
13531
13532         * mpz/tests/reuse.c: Use mpz_random2 instead of mpz_random.
13533
13534         * mpz/divexact.c: Read pointers after reallocation.
13535         Compare `quot' and `den' instead of `qp' and `dp' in overlap check.
13536         Use MPN_COPY_INCR for copying from `np'.
13537
13538         (*-*-aix4.[3-9]*): Disable shared libs just for problematic AIX
13539         versions.
13540         * configure.in (*-cray-unicos*): Disable asm syntax checking; set
13541         compiler explicitly.
13542         * configure.in (hppa*-*-*): Remove code disabling shared libs.
13543
13544 2000-05-24  Linus Nordberg  <linus@swox.se>
13545
13546         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't report progress to user
13547         when doing the AIX specific test to avoid "nested output".
13548
13549 2000-05-22  Kevin Ryde  <kevin@swox.se>
13550
13551         * mp.h (_PROTO): Copy from gmp.h, use on prototypes.
13552         Add extern "C" too.
13553         * mpbsd/tests/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
13554         * mpbsd/tests/allfuns.c: Don't execute mout, just link to it.
13555         (main): ANSI style definition.
13556
13557         * gmp-impl.h (MP_BASE_AS_DOUBLE): Change the expression to
13558         something that works on SunOS native cc.  Seems to fix the
13559         mp*_get_d problems.
13560
13561         * mpn/tests/ref.c (refmpn_strip_twos): Use MPN_COPY_INCR.
13562         * mpn/tests/Makefile.am: Let .asm.o rules work with absolute $srcdir.
13563
13564 2000-05-21  Kevin Ryde  <kevin@swox.se>
13565
13566         * mpn/x86/k7/sqr_basecase.asm: Replace file with K7 specific code.
13567         * mpn/x86/k7/README: Update.
13568         * mpn/x86/k7/gmp-mparam.h: Tune thresholds.
13569         (COUNT_TRAILING_ZEROS_TIME): New define.
13570         * mpn/x86/k6/gmp-mparam.h: Ditto.
13571
13572         * mpn/x86/pentium/mmx/popham.asm: New file (include_mpn of K6 version).
13573         * mpn/x86/p6/diveby3.asm: New file (include_mpn of P5 version).
13574         * mpn/x86/p6/mmx/popham.asm: New file (include_mpn of K6 version).
13575         * mpn/x86/p6/p3mmx/popham.asm: New file (include_mpn of K7 version).
13576         * configure.in (pentium3-*-*): Add p3mmx to $path.
13577
13578         * gmp.texi (Integer Arithmetic): Clarify mpz_jacobi op2; add
13579         mpz_*_kronecker_*.
13580         (Miscellaneous Integer Functions): Add mpz_odd_p and mpz_even_p.
13581         (Low-level Functions): Put mpn_divmod_1 with mpn_divrem_1 and note
13582         it's now a macro.
13583         (References): Add Henri Cohen.
13584
13585         * gmp.h (mpn_addmul_1c, mpn_divrem_1c, mpn_mod_1c, mpn_mul_1c,
13586         mpn_submul_1c): Add prototypes.
13587         (mpz_odd_p, mpz_even_p): New macros.
13588
13589         * mpn/asm-defs.m4 (m4wrap_prepend): New macro.
13590         (m4_error): Use it.
13591         (m4_not_for_expansion): Corrections to OPERATION symbols.
13592         More comments about variations between m4 versions.
13593         * mpn/x86/x86-defs.m4 (PROLOGUE): Use m4wrap_prepend (fixes error
13594         exit under BSD m4, previously m4_error printed the message but the
13595         exit code was 0).
13596
13597         * gmp.h (mpn_divmod_1): Change to a macro calling mpn_divrem_1.
13598         * mpn/generic/divrem_1.c: Move divmod_1.c code to here, make it
13599         static and call it __gmpn_divmod_1_internal.
13600         * mpn/generic/divmod_1.c: Remove file.
13601         * configure.in (gmp_mpn_functions): Remove divmod_1.
13602         * mpn/asm-defs.m4 (define_mpn): Remove divmod_1 and divmod_1c.
13603         * compat.c (mpn_divmod_1): Add compatibility function.
13604         * tune/*: Remove mpn_divmod_1 measuring (leave just divrem_1).
13605
13606         * acconfig.h (HAVE_NATIVE_mpn_*): Add some missing carry-in
13607         variants, remove divmod_1.
13608
13609         * mpn/x86/diveby3.asm: Use imul, update comments.
13610
13611         * demos/qcn.c: New file.
13612         * demos/Makefile.am (EXTRA_PROGRAMS): Add it.
13613
13614         * mpz/tests/t-jac.c: New file.
13615         * mpz/tests/Makefile.am (check_PROGRAMS): Add it. Enable ansi2knr.
13616
13617         * mpz/kronsz.c: New file.
13618         * mpz/kronuz.c: New file.
13619         * mpz/kronzs.c: New file.
13620         * mpz/kronzu.c: New file.
13621         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
13622         * Makefile.am (MPZ_OBJECTS): Add them.
13623         * gmp-impl.h (JACOBI_*, MPN_STRIP_LOW_ZEROS_NOT_ZERO): New macros.
13624         * gmp.h (mpz_*_kronecker_*): New defines and prototypes.
13625
13626         * mpn/generic/jacbase.c: New file.
13627         * mpn/generic/mod_1_rs.c: New file.
13628         * configure.in (gmp_mpn_functions): Add them.
13629         * gmp.h (mpn_jacobi_base, mpn_mod_1_rshift): New defines and
13630         prototypes.
13631         * longlong.h (COUNT_TRAILING_ZEROS_TIME): New define.
13632         * mpn/tests/ref.c (refmpn_mod_1_rshift): New function.
13633         * mpn/tests/try.c: Add mpn_mod_1_rshift.
13634         * tune/*: Add measuring for mpn_jacobi_base.
13635
13636         * acinclude.m4 (GMP_FINISH): Add ifdefs to allow multiple
13637         inclusion of config.m4.
13638         (GMP_PROG_M4): Put "good" message through to config.log.
13639
13640         * mpz/powm.c: Use a POWM_THRESHOLD for where redc stops.
13641         * tune/*: Add mpz_powm measuring, and tune POWM_THRESHOLD.
13642         * gmp-impl.h [TUNE_PROGRAM_BUILD] (POWM_THRESHOLD): Conditional
13643         redefinition for use when tuning.
13644
13645         * mpz/powm_ui.c: Use DIVIDE_BY_ZERO.
13646
13647         * mpz/iset_str.c: Initialize _mp_size to 0, in case no digits in
13648         string; this makes it the same as a separate init and set_str.
13649
13650 2000-05-20  Kevin Ryde  <kevin@swox.se>
13651
13652         * mpn/asm-defs.m4: Note &,|,^ aren't bitwise in BSD m4 eval().
13653         * mpn/x86/k6/sqr_basecase.asm: Use "%" not "&" in m4 eval()s.
13654
13655         * mpn/x86/x86-defs.m4 (Zdisp): Yet more instruction forms.
13656
13657 2000-05-19  Linus Nordberg  <linus@swox.se>
13658
13659         * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't use shell variable
13660         `ac_compile' for our own compile command string since other
13661         Autoconf macros may depend on it.
13662
13663 2000-05-19  Kevin Ryde  <kevin@swox.se>
13664
13665         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Fix
13666         carry propagation in final coefficient additions.
13667
13668 2000-05-18  Linus Nordberg  <linus@swox.se>
13669
13670         * configure.in: Set NM before looking for compiler since
13671         GMP_CHECK_CC_64BIT needs it.
13672
13673         * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't execute on target.
13674         (GMP_PROG_CC_FIND): Before checking if the compiler knows how to
13675         produce 64-bit code, verify that it works at all.  The background
13676         is that /usr/ucb/cc on Solaris 7 successfully compiles in 64-bit
13677         mode but fails when doing final link.
13678         (GMP_PROG_CC_WORKS): Report to user what's happening.
13679
13680 2000-05-17  Linus Nordberg  <linus@swox.se>
13681
13682         * config.guess: Use X86CPU for x86 Cygwin.
13683
13684 2000-05-16  Kevin Ryde  <kevin@swox.se>
13685
13686         * mpn/x86/p6/mmx/divrem_1.asm: New file.
13687         * mpn/x86/p6/mmx/mod_1.asm: New file.
13688         * mpn/x86/p6/README: Update.
13689         * mpn/x86/divrem_1.asm: Update comments.
13690         * mpn/x86/mod_1.asm: Ditto.
13691
13692 2000-05-14  Kevin Ryde  <kevin@swox.se>
13693
13694         * tune/speed.h: Run gcd functions on a set of data.
13695
13696         * mpn/tests/try.c: New file.
13697         * mpn/tests/try.h: New file.
13698         * mpn/tests/spinner.c: New file.
13699         * mpn/tests/trace.c: New file.
13700         * mpn/tests/x86call.asm: New file.
13701         * mpn/tests/x86check.c: New file.
13702         * mpn/tests/ref.c (refmpn_hamdist): Allow size==0.
13703         (refmpn_gcd): New function, and other additions supporting it.
13704         * mpn/tests/ref.h: More prototypes.
13705         * mpn/tests/Makefile.am: Add try program, use ansi2knr.
13706
13707         * mpn/x86/k7/mmx/popham.asm: New file.
13708         * mpn/x86/k6/mmx/popham.asm: New file.
13709         * mpn/x86/k6/sqr_basecase.asm: Unroll the addmul, for approx 1.3x
13710         speedup above 15 limbs.
13711         * mpn/x86/k7/README: Update.
13712         * mpn/x86/k6/README: Update, and add notes on plain K6 and pre-CXT
13713         K6-2 problems.
13714         * configure.in (k6*-*-*, athlon-*-*): Add popham.
13715
13716         * mpn/x86/pentium/diveby3.asm: New file.
13717         * mpn/x86/pentium/README: Update.
13718
13719         * gmp.texi (Installing GMP): Add note on bad OpenBSD 2.6 m4.
13720         (Reporting Bugs): Ask for config.m4 if asm file related.
13721         (I/O of Rationals): New section, add mpq_out_str.
13722         (References): Add url for on-line gcc manuals.
13723         A few node and menu updates.
13724
13725         * INSTALL: Better command line argument checking for test progs.
13726         Change MP -> GMP.
13727
13728         * configure.in (WANT_ASSERT, USE_STACK_ALLOC, HAVE_PENTIUM_RDTSC):
13729         Put descriptions here, not in acconfig.h.
13730         (CALLING_CONVENTIONS_OBJS): New AC_SUBST (for mpn/tests/try).
13731         (HAVE_CALLING_CONVENTIONS): New AC_DEFINE.
13732         (AC_CHECK_HEADERS): Add sys/time.h.
13733         (AC_CHECK_FUNCS): Add getpagesize, setitimer.
13734         (KARATSUBA_SQR_THRESHOLD): Strip trailing comments from the
13735         #define when passing through to config.m4.
13736         * acconfig.h (PACKAGE, VERSION, WANT_ASSERT, USE_STACK_ALLOC,
13737         HAVE_PENTIUM_RDTSC): No need for #undefs, autoheader gets them
13738         from configure.in.
13739
13740         * acinclude.m4 (GMP_PROG_M4): Check for broken OpenBSD 2.6 m4
13741         eval(), put messages into config.log.
13742         * mpn/asm-defs.m4: Add notes and test for OpenBSD 2.6 m4.
13743
13744         * mpq/out_str.c: New file.
13745         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
13746         * Makefile.am (MPQ_OBJECTS): Ditto.
13747         * gmp.h (mpq_out_str): New define and prototype.
13748
13749 2000-05-12  Kevin Ryde  <kevin@swox.se>
13750
13751         * configure.in (CONFIG_TOP_SRCDIR): Fix to use $srcdir not
13752         $top_srcdir (which doesn't exist).
13753         * acinclude.m4 (GMP_C_ANSI2KNR): Fix setting U=_.
13754         * gmp-impl.h (mpn_com_n, MPN_LOGOPS_N_INLINE): Fix missing "do"
13755         (not currently used, probably no ill effect anyway).
13756
13757 2000-05-11  Torbjorn Granlund  <tege@swox.com>
13758
13759         * randraw.c (lc): Major overhaul (pending rewrite).
13760         (_gmp_rand): Rewrite.
13761
13762 2000-05-08  Torbjorn Granlund  <tege@swox.com>
13763
13764         * mpz/tests/convert.c: Call free via _mp_free_func.
13765         * mpf/tests/t-conv.c: Likewise.
13766
13767         * memory.c: Add code enabled for DEBUG that adds special patterns
13768         around allocated blocks.
13769
13770 2000-05-05  Linus Nordberg  <linus@swox.se>
13771
13772         * gmp.texi (Miscellaneous Float Functions): Correct parameter list
13773         for mpf_urandomb().
13774
13775         * configure.in: Invoke AC_REVISION.
13776
13777 2000-05-05  Kevin Ryde  <kevin@swox.se>
13778
13779         * gmp.texi: Use @dircategory and @direntry.
13780         (Installing GMP): Clarification for --target, updates on SunOS
13781         problems.
13782         (Integer Arithmetic): Add mpz_mul_si.
13783         (Initializing Rationals): Add mpq_swap.
13784         (Assigning Floats): Add mpf_swap.
13785         (Low-level Functions): Add mpn_divexact_by3c, and details of what
13786         the calculation actually gives.
13787         (Low-level Functions): Note extra space needed by mpn_gcdext,
13788         clarify the details a bit.
13789
13790         * compat.c: New file, entry points for upward binary compatibility.
13791         (mpn_divexact_by3): Compatibility function.
13792         * Makefile.am (libgmp_la_SOURCES): Add compat.c.
13793
13794         * mpn/tests/ref.c: Rearrange macros for ansi2knr.
13795         (div1): Renamed from div to avoid library function.
13796         (refmpn_divexact_by3c, refmpn_gcd_1, refmpn_popcount,
13797         refmpn_hamdist): New functions.
13798         * mpn/tests/ref.h: Add extern "C", add new prototypes.
13799
13800         * gmp.h (gmp_randinit, etc): Add extern "C".
13801         (_mpq_cmp_ui): Fix prototype name from mpq_cmp_ui.
13802         (mpn_divexact_by3): Now a macro calling mpn_divexact_by3c.
13803         (mpn_divexact_by3c): New prototype and define.
13804
13805         * mpn/x86/diveby3.asm: Change to mpn_divexact_by3c.
13806         * mpn/x86/k6/diveby3.asm: Ditto.
13807         * mpn/generic/diveby3.c: Ditto.
13808         * mpn/asm-defs.m4: Ditto on the define_mpn.
13809         * acconfig.h (HAVE_NATIVE_mpn_divexact_by3c): New define.
13810
13811         * mpq/swap.c: New file, derived from mpz/swap.c.
13812         * mpf/swap.c: Ditto.
13813         * mpq/Makefile.am: Add swap.c.
13814         * mpf/Makefile.am: Ditto.
13815         * Makefile.am: Add two new "swap.lo"s.
13816
13817         * mpn/x86/k6/mmx/com_n.asm: Fix an addressing bug (fortunately
13818         this code hasn't been used anywhere yet).
13819
13820         * mpn/x86/k7/mmx/divrem_1.asm: New file.
13821         * mpn/x86/k7/mmx/mod_1.asm: New file.
13822         * mpn/x86/k7/diveby3.asm: New file.
13823         * mpn/x86/k7/README: Update.
13824
13825         * mpn/x86/k7/aorsmul_1.asm: Use new cmovCC, no object code change.
13826         * mpn/x86/k7/mul_basecase.asm: Ditto.
13827         * mpn/x86/p6/aorsmul_1.asm: Ditto.
13828
13829         * mpn/x86/x86-defs.m4 (defframe_empty_if_zero): Eval the argument.
13830         (cmovCC): New macros, replacing individual cmovCC_reg_reg forms.
13831         (Zdisp): Recognise more instructions.
13832         (shldl,etc): Use m4_instruction_wrapper().
13833         (ASSERT, movl_text_address): New macros.
13834
13835         * mpn/asm-defs.m4: Add remarks on SunOS /usr/bin/m4 and new
13836         OpenBSD m4.
13837         (m4_assert_numargs_internal_check): Remove a spurious parameter.
13838         (m4_empty_if_zero): Eval the argument.
13839         (m4_assert, m4_assert_numargs_range, m4_config_gmp_mparam,
13840         m4_instruction_wrapper): New macros.
13841
13842 2000-05-04  Linus Nordberg  <linus@swox.se>
13843
13844         * gmp.texi (Reporting Bugs): Be explicit about output from running
13845         a command.
13846
13847 2000-05-02  Torbjorn Granlund  <tege@swox.com>
13848
13849         * mpn/generic/bz_divrem_n.c (mpn_bz_divrem_n): Handle non-zero return
13850         from first mpn_bz_div_3_halves_by_2 call.
13851         (mpn_bz_divrem_aux): Likewise.
13852
13853 2000-04-30  Kevin Ryde  <kevin@swox.se>
13854
13855         * tune/* (GCD_ACCEL_THRESHOLD, GCDEXT_THRESHOLD): Tune these.
13856
13857         * mpn/generic/gcdext.c (GCDEXT_THRESHOLD): Rename from THRESHOLD,
13858         use with >=, adjust default to 17 accordingly.
13859         Use new *_SWAP macros.
13860
13861         * mpn/generic/gcd.c (GCD_ACCEL_THRESHOLD): Rename from
13862         ACCEL_THRESHOLD, use with >=, adjust default to 5 accordingly.
13863         Use new *_SWAP macros.
13864
13865         * mpf/get_str.c, mpf/set_str.c, mpf/sub.c, mpz/add.c, mpz/ior.c,
13866         mpz/and.c, mpz/sub.c, mpz/xor.c, mpz/ui_pow_ui.c,
13867         mpn/generic/mul.c: Use new *_SWAP macros.
13868
13869         * stack-alloc.h: Add extern "C" around prototypes.
13870
13871         * gmp-impl.h: (MP_PTR_SWAP, etc): New macros.
13872         (_mp_allocate_func, etc): Use _PROTO.
13873         [TUNE_PROGRAM_BUILD]: More changes in tune program build part.
13874
13875 2000-04-28  Torbjorn Granlund  <tege@swox.com>
13876
13877         * mpn/pa64/add_n.s: Add `,entry' to export directive.
13878         * mpn/pa64/addmul_1.S, mpn/pa64/lshift.s, mpn/pa64/mul_1.S,
13879         mpn/pa64/rshift.s, mpn/pa64/sub_n.s, mpn/pa64/submul_1.S,
13880         mpn/pa64/umul_ppmm.S: Likewise.
13881         * mpn/hppa/hppa1_1/udiv_qrnnd.S: New name for udiv_qrnnd.s.
13882         Add PIC support.
13883
13884 2000-04-29  Kevin Ryde  <kevin@swox.se>
13885
13886         * gmp-impl.h [TUNE_PROGRAM_BUILD] (TOOM3_MUL_THRESHOLD_LIMIT): New
13887         define.
13888         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Use
13889         TOOM3_MUL_THRESHOLD_LIMIT, not a hard coded 500.
13890
13891         * memory.c: Use <stdlib.h> for malloc etc, and use _PROTO.
13892         * stack-alloc.c: Don't use C++ reserved word "this".
13893         * urandom.h: Put extern "C" around prototypes.
13894         * mpz/powm.c: Switch a couple of parameters to "const", which they
13895         are, to satisfy g++.
13896
13897         * randraw.c, stack-alloc.c, mpbsd/mout.c, mpbsd/mtox.c: Add casts to
13898         help g++.
13899
13900         * stack-alloc.c: Provide dual ANSI/K&R function definitions.
13901         * mpz/addmul_ui.c,get_d.c,inp_str.c,perfpow.c,powm.c,pprime_p.c,
13902         rrandomb.c,set_str.c,ui_pow_ui.c: Ditto.
13903         * mpf/integer.c,set_str.c: Ditto.
13904         * mpbsd/min.c,xtom.c: Ditto.
13905         * mpn/generic/bz_divrem_n.c,dump.c,gcd_1.c,get_str.c,hamdist.c,
13906         popcount.c,random.c,random2.c,set_str.c: Ditto.
13907
13908         * rand.c: Use <stdio.h> for NULL.
13909         * mpz/gcd_ui.c,gcdext.c,mul.c,perfpow.c,powm_ui.c,root.c,sqrt.c,
13910         sqrtrem.c: Ditto
13911         * mpf/sqrt.c,sqrt_ui.c: Ditto.
13912         * mpn/generic/perfsqr.c,sqrtrem.c: Ditto.
13913
13914         * gmp-impl.h (NULL, malloc, realloc, free): Don't define/declare.
13915         (extern "C"): Add around function prototypes.
13916         (mpn_kara_mul_n, mpn_kara_sqr_n, mpn_toom3_mul_n, mpn_toom3_sqr_n):
13917         Add prototypes.
13918         [TUNE_PROGRAM_BUILD] (FIB_THRESHOLD): Add necessary redefinitions for
13919         use by tune program.
13920         * mpn/generic/mul_n.c: Remove mpn_toom3_mul_n prototype.
13921
13922         * acinclude.m4 (GMP_C_ANSI2KNR): New macro.
13923         (GMP_CHECK_ASM_MMX, GMP_CHECK_ASM_SHLDL_CL): Fix to use
13924         $gmp_cv_check_asm_text which is what GMP_CHECK_ASM_TEXT sets.
13925         * configure.in (GMP_C_ANSI2KNR): Use this instead of AM_C_PROTOTYPES,
13926         for reasons described with its definition.
13927
13928         * demos/Makefile.am (ansi2knr): Use $(top_builddir) nor $(top_srcdir).
13929
13930         * mpz/fib_ui.c (FIB_THRESHOLD): Rename from FIB_THRES, for consistency.
13931         (FIB_THRESHOLD): Conditionalize so gmp-mparam.h can define a value.
13932         (mpz_fib_bigcase): Use >= FIB_THRESHOLD, same as main mpz_fib_ui.
13933         * tune/tuneup.c,Makefile.am (FIB_THRESHOLD): Tune this.
13934
13935         * configure.in (*-*-aix* gmp_m4postinc): Fix setting (don't overwrite
13936         a value just stored).
13937
13938 2000-04-26  Kevin Ryde  <kevin@swox.se>
13939
13940         * mpn/sparc32/udiv_fp.asm: Use mpn_udiv_qrnnd macro.
13941         * mpn/sparc32/udiv_nfp.asm: Ditto.
13942         * mpn/sparc32/v8/supersparc/udiv.asm: Ditto.
13943         * mpn/sparc32/umul.asm: Name the function mpn_umul_ppmm.
13944         * mpn/sparc32/v8/umul.asm: Ditto.
13945         * mpn/powerpc32/umul.asm: Ditto.
13946
13947         * mpn/x86/syntax.h: Remove file, since now unused.
13948
13949         * configure.in (x86): Remove -DBROKEN_ALIGN and -DOLD_GAS
13950         previously used by .S files.
13951         (x86 extra_functions): Add udiv and umul.
13952         (GMP_PROG_M4): Use this instead of AC_CHECK_PROG(M4,m4,...)
13953         (HAVE_NATIVE_*): Loosen up the regexp to "PROLOGUE.*" so as to
13954         accept PROLOGUE_GP on alpha.
13955
13956         * acconfig.h (HAVE_NATIVE_mpn_umul_ppmm, udiv_qrnnd, invert_limb):
13957         New template defines.
13958         * mpn/asm-defs.m4 (mpn_umul_ppmm, mpn_udiv_qrnnd): New define_mpn()s.
13959         * longlong.h (umul_ppmm, udiv_qrnnd): Use a library version if
13960         it's available and an asm macro isn't.
13961         * gmp-impl.h (invert_limb): Ditto.
13962
13963         * gmp-impl.h (ASSERT_NOREALLOC): Not a good idea, remove it.
13964
13965         * acinclude.m4 (GMP_PROG_M4): New macro.
13966
13967 2000-04-25  Linus Nordberg  <linus@swox.se>
13968
13969         * gmp.texi (Random State Initialization): Correct arguments to
13970         `gmp_randinit'.
13971
13972         * acinclude.m4 (GMP_VERSION): Change `eval' --> `m4_eval'.  Fix
13973         from Kevin.
13974         * aclocal.m4: Regenerate.
13975
13976 2000-04-25  Kevin Ryde  <kevin@swox.se>
13977
13978         * mpn/x86/aors_n.asm: Remove parentheses around an immediate that
13979         Solaris "as" doesn't like, change by Torbjorn.
13980
13981 2000-04-24  Kevin Ryde  <kevin@swox.se>
13982
13983         * configure.in (AC_CHECK_FUNCS): Add strtoul.
13984
13985         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Bigger
13986         array for karatsuba temporary space for tune program build.
13987         (mpn_toom3_sqr_n) Remove an unused variable.
13988
13989         * demos/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
13990         Add "allprogs:" pseudo-target.
13991         * demos/factorize.c, demos/isprime.c: Switch to ANSI functions,
13992         rely on ansi2knr.
13993
13994         * gmp.texi (Getting the Latest Version of GMP): Add reference to
13995         ftp.gnu.org mirrors list.
13996         * INSTALL: Add arg count check to example programs.
13997
13998         * mpn/x86/*/*.asm: Convert to FORTRAN ... or rather to
13999         FORTRAN-style "C" commenting to support Solaris "as".
14000         * mpn/x86/x86-defs.m4: Ditto, and add another Zdisp insn.
14001         * mpn/asm-defs.m4 (C): Update comments.
14002         * mpn/x86/README.family: Add a note on commenting, remove
14003         description of .S files.
14004
14005         * mpn/sparc64/addmul_1.asm, mul_1.asm, submul_1.asm: Use
14006         include_mpn().
14007
14008 2000-04-23  Torbjorn Granlund  <tege@swox.com>
14009
14010         * config.sub: Merge with FSF version of April 23.
14011
14012         * mpn/powerpc32: Use dnl/C instead of `#' for comments.
14013
14014         * config.guess: Get "model" limit between pentium 2 and pentium3 right.
14015         Get rid of code determining `_' prefix; use double labels instead.
14016         * config.guess: Partially merge with FSF version of April 22.
14017         (Don't bring over NetBSD changes for now.)
14018
14019 2000-04-23  Kevin Ryde  <kevin@swox.se>
14020
14021         * tune/Makefile.am, tune/README, tune/common.c, tune/rdtsc.asm,
14022         tune/speed.c, tune/speed.h, tune/time.c, tune/tuneup.c: New files.
14023         * tune/Makefile.in: New file, generated from Makefile.am.
14024
14025         * gmp-impl.h (ASSERT_NOREALLOC,TMP_ALLOC_LIMBS): New macros.
14026         [TUNE_PROGRAM_BUILD] Further mods for tune program builds.
14027
14028         * mpz/Makefile.am: Add -DOPERATION_$* for new mul_siui.c.
14029         Add rules to build mul_si and mul_ui from a common mul_siui.c.
14030         * mpz/mul_siui.c: New file, derived from and replacing mul_ui.c.
14031         * gmp.h (mpz_mul_si): New prototype and define.
14032
14033         * mpn/tests/*.c [__i386__] (CLOCK): Don't use floating point in
14034         CLOCK because cpp can't handle floats in #if's (TIMES is derived
14035         from CLOCK by default).
14036
14037         * mpn/asm-defs.m4 (include_mpn): New macro.
14038         (m4_assert_numargs) Changes to implementation.
14039
14040         * mpf/Makefile.am: Add -DOPERATION_$* for new integer.c.
14041         Remove explicit rules for floor.o etc.
14042         * mpf/integer.c: Use OPERATION_$* for floor/ceil/trunc.
14043
14044         * mpn/Makefile.am: Put "tests" in SUBDIRS.
14045         * mpn/tests/Makefile.am: New file providing rules to build test
14046         programs, nothing done in a "make all" or "make check" though.
14047         * mpn/tests/README: New file.
14048
14049         * acconfig.h (HAVE_PENTIUM_RDTSC): New define.
14050
14051         * configure.in (x86): Rearrange target cases.
14052         Add mulfunc aors_n and aorsmul_1 for x86 and pentium (now all x86s).
14053         Remove asm-syntax.h generation not needed.
14054         Remove now unused family=x86.
14055         (sparc) Remove unused family=sparc.
14056         (HAVE_PENTIUM_RDTSC) New AC_DEFINE and AM_CONDITIONAL.
14057         (AM_C_PROTOTYPES) New test, supporting ansi2knr.
14058         (AC_CHECK_HEADERS) Add getopt.h, unistd.h and sys/sysctl.h for
14059         tune progs.
14060         (AC_CHECK_FUNCS) Add getopt_long, sysconf and sysctlbyname for
14061         tune progs.
14062         (config.m4 CONFIG_TOP_SRCDIR) Renamed from CONFIG_SRCDIR.
14063         (config.m4 asm-defs.m4) Use CONFIG_TOP_SRCDIR and include().
14064         (gmp_m4postinc) Use include_mpn().
14065         (gmp_links) Omit asm-defs.m4/asm.m4 and gmp_m4postinc's.
14066         (MULFUNC_PROLOGUE) Fix regexps so all functions get AC_DEFINE'd.
14067         (PROLOGUE) Ditto (native copyi and copyd were unused in gmp 3).
14068         (KARATSUBA_SQR_THRESHOLD) Copy from gmp-mparam.h into config.m4.
14069         (AC_OUTPUT) Add tune/Makefile, mpn/tests/Makefile.
14070
14071         * Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
14072         (SUBDIRS): Add tune, reorder directories.
14073         (MPZ_OBJECTS): Add mpz/mul_si.lo.
14074         (libmp_la_SOURCES): Use this for top-level objects, not .lo's.
14075         * ansi2knr.c, ansi2knr.1: New files, provided by automake.
14076
14077         * mpn/x86/aors_n.asm: Convert add_n.S and sub_n.S to a
14078         multi-function aors_n.asm, no object code change.
14079         * mpn/x86/pentium/aors_n.asm: Ditto.
14080         * mpn/x86/aorsmul_1.asm: Ditto for addmul/submul.
14081         * mpn/x86/pentium/aorsmul_1.asm: Ditto.
14082
14083         * mpn/x86/lshift.asm, mpn/x86/mul_1.asm, mpn/x86/mul_basecase.asm,
14084         mpn/x86/rshift.asm: Convert from .S, no object code change.
14085         * mpn/x86/pentium/lshift.asm, mpn/x86/pentium/mul_1.asm,
14086         mpn/x86/pentium/mul_basecase.asm, mpn/x86/pentium/rshift.asm: Ditto.
14087
14088         * gmp.texi (Reporting Bugs): Itemize the list of things to include.
14089         (Miscellaneous Float Functions): Correct typo in mpf_ceil etc
14090         argument types.
14091         Change @ifinfo -> @ifnottex for benefit of makeinfo --html.
14092         Remove unnecessary @iftex's around @tex.
14093
14094 2000-04-22  Torbjorn Granlund  <tege@swox.com>
14095
14096         * config.guess: Generalize x86 cpu determination code.
14097         Now works on Solaris.
14098
14099         * mpz/nextprime.c: Rewrite still disabled code.
14100
14101         * configure.in: Specifically match freebsd[3-9].
14102
14103 2000-04-21  Torbjorn Granlund  <tege@swox.com>
14104
14105         * rand.c: Call mpz_clear for otherwise leaking mpz_t.
14106
14107         * mpz/pprime_p.c (mpz_probab_prime_p): Merge handling of negative
14108         n into code for handling small positive n.  Merge variables m and n.
14109         After dividing, simply call mpz_millerrabin.
14110         (isprime): Local variables now use attribute `long'.
14111         (mpz_millerrabin): New static function, based on code from
14112         mpz_probab_prime_p.
14113         (millerrabin): Now simple workhorse for mpz_millerrabin.
14114
14115 2000-04-19  Torbjorn Granlund  <tege@swox.com>
14116
14117         * gmp-impl.h: Fix parenthesis error in test for __APPLE_CC__.
14118
14119 2000-04-18  Linus Nordberg  <linus@swox.se>
14120
14121         * NEWS: Add info about shared libraries.  Remove reference to
14122         gmp_randinit_lc.
14123
14124 2000-04-17  Torbjorn Granlund  <tege@swox.com>
14125
14126         * Version 3.0 released.
14127
14128         * mpn/arm/add_n.S: New version from Robert Harley.
14129         * mpn/arm/addmul_1.S: Likewise.
14130         * mpn/arm/mul_1.S: Likewise.
14131         * mpn/arm/sub_n.S: Likewise.
14132
14133         * gmp.h (__GNU_MP_VERSION_PATCHLEVEL): Now 0.
14134
14135 2000-04-17  Linus Nordberg  <linus@swox.se>
14136
14137         * configure.in (hppa2.0*-*-*): Pass `+O3' to cc/c89 in 64-bit mode
14138         to avoid compiler bug.
14139         (ns32k*-*-*): Fix typo in path.  Change by Kevin.
14140         (alpha*-*-osf*): New case.  Pass assembly flags for architecture
14141         to gcc.
14142         (alpha*-*-*): Don't bother searching for cc.
14143         * configure: Regenerate.
14144
14145         * Makefile.am (EXTRA_DIST): Add `macos', `.gdbinit'.
14146         * Makefile.in: Regenerate.
14147         * mpn/Makefile.am (EXTRA_DIST): Add `m88k', `lisp'.
14148         * mpn/Makefile.in: Regenerate.
14149
14150 2000-04-16  Kevin Ryde  <kevin@swox.se>
14151
14152         * README: Updates, and don't duplicate the example in INSTALL.
14153         * INSTALL: Minor updates.
14154         * gmp.texi (Installing MP): Minor edits, restore CC/CFLAGS description.
14155
14156 2000-04-16  Linus Nordberg  <linus@swox.se>
14157
14158         * configure.in (*-*-cygwin*): Select BSD_SYNTAX to avoid
14159         .type/.size in PROLOGUE for ELF_SYNTAX.  Override ALIGN definition
14160         from x86/syntax.h.
14161         (gmp_xoptcflags_${CC}): New set of variables, indicating
14162         ``exclusive optional cflags''.
14163         (most sparcs): Use gmp_xoptcflags instead of gmp_optcflags to
14164         ensure that we pass CPU type to older gcc.
14165         (CFLAGS): CFLAGS on the command line was spoiled.
14166         * configure: Regenerate.
14167
14168 2000-04-16  Linus Nordberg  <linus@swox.se>
14169
14170         * configure.in: Invoke AC_PROG_LIBTOOL directly.
14171
14172         * acinclude.m4 (GMP_PROG_CC_FIND): Quote source variable when
14173         setting CC64 and CFLAGS64.
14174         (GMP_PROG_CC_SELECT): Cache result.
14175         (GMP_PROG_LIBTOOL): Remove.
14176
14177         * aclocal.m4: Regenerate.
14178         * configure: Regenerate.
14179
14180 2000-04-16  Linus Nordberg  <linus@swox.se>
14181
14182         * tests/rand/t-rand.c (main): Add non-ANSI function declaration.
14183         Don't use `const'.
14184
14185 2000-04-16  Torbjorn Granlund  <tege@swox.com>
14186
14187         * mpn/generic/dump.c: Suppress output of leadign zeros.
14188
14189         * mpz/inp_str.c: Fix memory leakage.
14190
14191         * mpz/tests/reuse.c (dss_func_division): Add a final 1.
14192
14193         * longlong.h (alpha count_leading_zeros): Wrap in __MPN.
14194         * mpn/alpha/cntlz.asm: Use __gmpn prefix (by means of __MPN).
14195
14196         * longlong.h (__umul_ppmm, __udiv_qrnnd): Wrap in __MPN.
14197         * mpn/alpha/udiv_qrnnd.S: Use __gmpn prefix.
14198         * mpn/hppa/udiv_qrnnd.s: Likewise.
14199         * mpn/hppa/hppa1_1/udiv_qrnnd.s: Likewise.
14200         * mpn/pa64/udiv_qrnnd.c: Likewise (by means of __MPN).
14201         * mpn/pa64/umul_ppmm.S: Likewise.
14202         * mpn/sparc32/udiv_fp.asm: Likewise (by means of MPN).
14203         * mpn/sparc32/udiv_nfp.asm: Likewise (by means of MPN).
14204         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise (by means of MPN).
14205
14206         * mpn/generic/tdiv_qr.c: Work around gcc 2.7.2.3 i386 register handling
14207         bug.
14208
14209         * mpn/generic/tdiv_qr.c: Use udiv_qrnnd instead of mpn_divrem_1
14210         when computing appropriate quotient; mpn_divrem_1 writes too
14211         many quotient limbs.
14212
14213         * mpn/asm-defs.m4: invert_normalized_limb => invert_limb.
14214         * mpn/alpha/invert_limb.asm: mpn_invert_normalized_limb =>
14215         mpn_invert_limb.
14216         * gmp.h: Likewise.
14217         * gmp-impl.h (alpha specific): invert_normalized_limb => invert_limb;
14218         wrap with __MPN.
14219         * longlong.h (alpha udiv_qrnnd): Likewise.
14220
14221 2000-04-16  Kevin Ryde  <kevin@swox.se>
14222
14223         * gmp.h (mp_set_memory_functions,mp_bits_per_limb,gmp_errno): Add
14224         #defines so the library symbols are __gmp_*.
14225         * errno.c: Include gmp.h.
14226         * gmp-impl.h (_mp_allocate_func,etc): Add #defines to __gmp_*.
14227         (__clz_tab): New #define to __MPN(clz_tab).
14228         * stack-alloc.c (__gmp_allocate_func,etc): Change from _mp_*.
14229
14230         * Makefile.am (libmp_la_DEPENDENCIES): Add some mpz files needed
14231         for new mpz_powm (pow in libmp).
14232         (EXTRA_DIST): Add projects directory.
14233
14234         * mpn/*: Change __mpn to __gmpn.
14235         * gmp.h (__MPN): Ditto.
14236         * stack_alloc.c,stack-alloc.h: Change __tmp to __gmp_tmp.
14237
14238         * mpn/generic/sb_divrem_mn.c (mpn_sb_divrem_mn): Avoid gcc 2.7.2.3
14239         i386 register handling bug (same as previously in mpn_divrem_classic).
14240
14241         * mpn/generic/divrem.c: Now contains mpn_divrem, which is not an
14242         internal function, so remove warning comment.
14243
14244         * gmp.texi (Compatibility with Version 2.0.x): Source level only.
14245
14246 2000-04-16  Linus Nordberg  <linus@swox.se>
14247
14248         * configure.in (hppa1.0*): Prefer c89 to cc.
14249         * configure: Regenerate.
14250
14251 2000-04-15  Linus Nordberg  <linus@swox.se>
14252
14253         * configure.in: If `mpn_path' is set by user on configure command
14254         line, use that as path.
14255         * configure: Regenerate.
14256
14257 2000-04-15  Linus Nordberg  <linus@swox.se>
14258
14259         * configure.in (hppa2.0*): Use path "hppa/hppa1_1 hppa" if no
14260         64-bit compiler was found.
14261         * configure: Regenerate.
14262
14263 2000-04-15  Linus Nordberg  <linus@swox.se>
14264
14265         * configure.in: Honor `CC' and `CFLAGS' set by user on configure
14266         command line.
14267         * acinclude.m4: (GMP_PROG_CC_SELECT): Set CFLAGS if not set already.
14268         * aclocal.m4: Regenerate.
14269         * configure: Regenerate.
14270
14271 2000-04-15  Linus Nordberg  <linus@swox.se>
14272
14273         * acinclude.m4 (GMP_PROG_CC_FIND): Remove debug output.  Remove
14274         commented out code.
14275         * aclocal.m4: Regenerate.
14276         * configure: Regenerate.
14277
14278         * configure.in: Make all `-mcpu' options to gcc optional.
14279         * configure: Regenerate.
14280
14281         * tests/rand/Makefile.am: Don't do anything for target 'all'.
14282         * tests/rand/Makefile.in: Regenerate.
14283
14284 2000-04-15  Kevin Ryde  <kevin@swox.se>
14285
14286         * README: Small updates.
14287         * NEWS: Add some things about 3.0.
14288
14289         * mpz/Makefile.am (EXTRA_DIST): Remove dmincl.c.
14290
14291         * Makefile.am: Use -version-info on libraries, not -release.
14292
14293         * mpz/tdiv_qr.c: Add mdiv function header #ifdef BERKELEY_MP.
14294         * mpbsd/Makefile.am: Use mpz/tdiv_qr.c, not mdiv.c.
14295         * Makefile.am (MPBSD_OBJECTS): Change mdiv.lo to tdiv_qr.lo.
14296         (libmp_la_DEPENDENCIES): Add mp_clz_tab.lo.
14297         * mpbsd/mdiv.c: Remove file.
14298
14299         * config/mt-linux,mt-m68k,mt-m88110,mt-ppc,mt-ppc64-aix,mt-pwr,
14300         mt-sprc8-gcc,mt-sprc9-gcc,mt-supspc-gcc,mt-vax,mt-x86,
14301         mpn/config/mt-pa2hpux,mt-sprc9,t-oldgas,t-ppc-aix,t-pwr-aix:
14302         Remove configure fragments not used since change to autoconf.
14303
14304         * mpn/generic/bz_divrem_n.c,sb_divrem_mn.c: Add comment that
14305         internal functions are changeable and shouldn't be used directly.
14306
14307 2000-04-15  Linus Nordberg  <linus@swox.se>
14308
14309         * configure.in: Remove debug output.
14310         * configure: Regenerate.
14311
14312 2000-04-15  Torbjorn Granlund  <tege@swox.com>
14313
14314         * mpn/generic/tdiv_qr.c: Don't use alloca directly.
14315
14316         * mpz/tdiv_qr.c: Fix typo.
14317         * mpz/tdiv_r.c: Fix typo.
14318         * mpz/tdiv_q.c: Fix typo.
14319
14320         * configure.in: Disable -march=pentiumpro due to apparent compiler
14321         problems.
14322
14323         * mpz/powm.c: Replace with new code from Paul Zimmermann.
14324
14325         * mpz/tdiv_q.c: Remove debug code.
14326
14327         * mpn/generic/divrem.c: Remove C++ style `//' commented-out code.
14328         * mpn/generic/sb_divrem_mn.c: Likewise.
14329
14330 2000-04-14  Torbjorn Granlund  <tege@swox.com>
14331
14332         * mpz/cdiv_q.c: Change temp allocation for new requirements of
14333         mpz_tdiv_qr.
14334         * mpz/fdiv_q.c: Likewise.
14335
14336         * mpn/sparc64/gmp-mparam.h: Set up parameters for TOOM3.
14337
14338         * mpz/dmincl.c: Delete file.
14339         * mpz/tdiv_qr.c: Rewrite using mpn_tdiv_qr.
14340         * mpz/tdiv_r.c: Likewise.
14341         * mpz/tdiv_q.c: Likewise.
14342
14343         * mpn/generic/tdiv_qr.c: New file.
14344         * mpn/generic/bz_divrem_n.c: New file.
14345         * mpn/generic/sb_divrem_mn.c: New file.
14346
14347         * gmp-impl.h (MPZ_REALLOC): New macro.
14348         (mpn_sb_divrem_mn): Declare.
14349         (mpn_bz_divrem_n): Declare.
14350         (mpn_tdiv_qr): Declare.
14351
14352         * configure.in (gmp_mpn_functions): Delete divrem_newt and divrem_1n;
14353         add tdiv_qr, bz_divrem_n, and sb_divrem_mn.
14354         * mpn/generic/divrem_newt.c: Delete file.
14355         * mpn/generic/divrem_1n.c: Delete file.
14356
14357         * gmp.h (mpn_divrem_newton): Remove declaration.
14358         (mpn_divrem_classic): Remove declaration.
14359
14360         * gmp.h (mpn_divrem): Remove function definition.
14361         * mpn/generic/divrem.c: Replace mpn_divrem_classic with a
14362         mpn_divrem wrapper.
14363
14364 2000-04-14  Kevin Ryde  <kevin@swox.se>
14365
14366         * mpf/dump.c, mpz/dump.c, mpn/generic/dump.c,
14367         mpn/generic/divrem.c, mpn/generic/divrem_1n.c,
14368         mpn/generic/divrem_2.c, mpn/generic/divrem_newt.c,
14369         mpn/generic/mul.c, mpn/generic/mul_basecase.c,
14370         mpn/generic/mul_n.c, mpn/generic/sqr_basecase.c,
14371         mpn/generic/udiv_w_sdiv.c: Add comment that internal functions are
14372         changeable and shouldn't be used directly.
14373
14374         * mpq/div.c: Use DIVIDE_BY_ZERO (previously didn't get an
14375         exception on zero divisor).
14376
14377         * mpf/tests/t-get_d.c, mpz/tests/reuse.c: Add K&R function
14378         definitions.
14379         * mpz/tests/t-2exp.c: Don't use ANSI-ism 2ul.
14380
14381         * gmp.texi (Installing MP): Build problem notes for GSYM_PREFIX
14382         and ranlib on native SunOS.
14383         Particular systems notes about AIX and HPPA shared libraries
14384         disabled.
14385         (MP Basics): Add that undocumented things shouldn't be used.
14386         (Introduction to MP): Add to CPUs listed.
14387
14388         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Don't depend on C
14389         having "void".
14390
14391 2000-04-13  Linus Nordberg  <linus@swox.se>
14392
14393         * mpn/pa64/udiv_qrnnd.c (__udiv_qrnnd64): Add K&R function
14394         definition.
14395
14396         * configure.in: Disable shared libraries for hppa*.
14397         (mips-sgi-irix6.*): Fix flags for 64-bit gcc.
14398         (hppa2.0*-*-*): Prefer c89 to cc.
14399         * configure: Regenerate.
14400
14401         * gmp.h (gmp_randalg_t): Remove comma after last element.
14402
14403         * tests/rand/t-rand.c: Add copyright notice.
14404
14405 2000-04-13  Kevin Ryde  <kevin@swox.se>
14406
14407         * mpn/generic/mul_n.c, mpn/generic/gcdext.c, mpz/nextprime.c,
14408         mpz/remove.c, mpz/root.c: Add K&R function definitions.
14409         * mpz/rrandomb.c: Fix typo in K&R part.
14410         * stack-alloc.c: Add K&R style function pointer declarations.
14411
14412         * mpz/root.c: Use SQRT_OF_NEGATIVE on even roots of negatives.
14413         Use DIVIDE_BY_ZERO on a "zero'th" root.
14414
14415         * configure: Regenerate with autoconf backpatched to fix --srcdir
14416         absolute path wildcards that bash doesn't like, change by Linus.
14417
14418         * gmp.texi (Integer Arithmetic): Document mpz_nextprime.
14419         (Miscellaneous Integer Functions): Fix mpz_fits_* formatting.
14420         (Installing MP): Comment-out CC and CFLAGS description.
14421
14422 2000-04-13  Linus Nordberg  <linus@swox.se>
14423
14424         * rand.c (gmp_randinit): Don't combine va_alist with ordinary
14425         arguments for non STDC.
14426
14427 2000-04-13  Torbjorn Granlund  <tege@swox.com>
14428
14429         * mpz/nextprime.c: Use proper names of new random types and functions.
14430
14431         * mpz/rrandomb.c: New file.
14432         * mpz/Makefile.am: List it.
14433         * mpz/Makefile.in: Regenerate.
14434         * Makefile.am: Here too.
14435         * Makefile.in: Regenerate.
14436         * gmp.h: Declare mpz_rrandomb.
14437
14438 2000-04-12  Linus Nordberg  <linus@swox.se>
14439
14440         * Makefile.am, demos/Makefile.am, mpbsd/Makefile.am,
14441         mpbsd/tests/Makefile.am, mpf/Makefile.am, mpf/tests/Makefile.am,
14442         mpn/Makefile.am, mpq/Makefile.am, mpq/tests/Makefile.am,
14443         mpz/Makefile.am, mpz/tests/Makefile.am, tests/Makefile.am,
14444         tests/rand/Makefile.am (AUTOMAKE_OPTIONS): Add 'no-dependencies'.
14445
14446         * Makefile.in, demos/Makefile.in, mpbsd/Makefile.in,
14447         mpbsd/tests/Makefile.in, mpf/Makefile.in, mpf/tests/Makefile.in,
14448         mpn/Makefile.in, mpq/Makefile.in, mpq/tests/Makefile.in,
14449         mpz/Makefile.in, mpz/tests/Makefile.in, tests/Makefile.in,
14450         tests/rand/Makefile.in: Regenerate.
14451
14452 2000-04-12  Linus Nordberg  <linus@swox.se>
14453
14454         * randlc.c (gmp_randinit_lc): Disable function.
14455         * gmp.texi (Random State Initialization): Remove gmp_randinit_lc.
14456
14457         * acinclude.m4 (GMP_CHECK_CC_64BIT): Compiling an empty main
14458         successfully with `-n32' will have to suffice on irix6.
14459         * aclocal.m4: Regenerate.
14460
14461         * configure.in (sparc): Don't pass -D_LONG_LONG_LIMB to compiler.
14462         (mips-sgi-irix6.*): Use compiler option `-n32' rather than `-64'
14463         for 64-bit `cc'.  Add options for gcc.
14464         * configure: Regenerate.
14465
14466         * mpf/urandomb.c (mpf_urandomb): Add third parameter 'nbits'.  If
14467         'nbits' doesn't make even limbs, shift up result before
14468         normalizing.
14469
14470         * gmp.h (mpf_urandomb): Add parameter to prototype.
14471
14472         * mpf/urandom.c: Rename file to ...
14473         * mpf/urandomb.c: ... this.
14474         * Makefile.am (MPF_OBJECTS): Change urandom.lo --> urandomb.lo.
14475         * Makefile.in: Regenerate.
14476         * mpf/Makefile.am (libmpf_la_SOURCES): Change urandom.c --> urandomb.c.
14477         * mpf/Makefile.in: Regenerate.
14478
14479         * config.in: Regenerate for HAVE_DECL_OPTARG.
14480
14481         * randraw.c (_gmp_rand): Fix bug with _LONG_LONG_LIMB.
14482         (lc): Change return type.
14483         Use one temporary storage instead of two.
14484         Handle seed of size 0.
14485         Avoid modulus operation in some cases.
14486         Abort if M is not a power of 2.
14487         Fix bug with 64-bit limbs.
14488         Fix bug with small seed, small A and large M.
14489
14490         * tests/rand/gen.c (main): Include gmp.h.  Remove macros MIN, MAX.  Add
14491         option '-q'.  Don't demand argument N.  Change parameters in call
14492         to mpf_urandomb.
14493
14494         * tests/rand/t-rand.c: New file for testing random number generation.
14495
14496         * tests/rand/Makefile.am: Run t-rand for 'make check'.
14497         (test, bigtest): Rename to manual-test, manual-bigtest.
14498         * tests/rand/Makefile.in: Regenerate.
14499
14500 2000-04-12  Kevin Ryde  <kevin@swox.se>
14501
14502         * gmp-impl.h: Include config.h before TMP_ALLOC, so
14503         --disable-alloca works.
14504
14505         * mpbsd/Makefile.am: Don't recompile top-level sources here.
14506         * Makefile.am (libmp_la_DEPENDENCIES): Put objects here instead,
14507         add errno.lo and stack-alloc.lo.
14508
14509         * mpn/asm-defs.m4: Add a test and message for the unsuitable SunOS m4.
14510         * gmp.texi (Installing MP): Update note on SunOS m4 failure.
14511
14512         * acconfig.h: Add copyright notice using @TOP@.
14513
14514         * stack-alloc.c: Use _mp_allocate_func, not malloc.
14515         * gmp.texi (Installing MP): Note this under --disable-alloca.
14516
14517         * gmp.texi (Comparison Functions): mpz_cmp_abs => mpz_cmpabs.
14518         (Integer Arithmetic): mpz_prime_p not yet implemented, comment out.
14519         (Float Arithmetic): mpf_pow_ui now implemented, uncomment-out.
14520         (Miscellaneous Float Functions): Add mpf_ceil, mpf_floor, mpf_trunc.
14521         (Low-level Functions): Add mpn_random2, with mpn_random.
14522
14523         * mpn/m68k/mc68020/udiv.S: Rename from udiv.s.
14524         * mpn/m68k/mc68020/umul.S: Ditto.
14525
14526         * mpn/alpha/umul.asm: Rename from umul.s, remove .file and
14527         compiler identifiers.
14528
14529         * mpn/powerpc32/syntax.h: Removed, no longer used.
14530
14531         * mpn/a29k/udiv.s: Remove .file and compiler identifiers.
14532         * mpn/a29k/umul.s: Ditto.
14533
14534         * mpn/tests/ref.c: Use WANT_ASSERT.
14535         * mpn/tests/ref.h: Use _PROTO.
14536
14537         * mpbsd/configure.in: Removed, no longer required.
14538
14539         * mpf/div.c: Use DIVIDE_BY_ZERO.
14540         * mpf/div_ui.c: Ditto.
14541         * mpf/ui_div.c: Ditto.
14542         * mpq/inv.c: Ditto.
14543         * mpf/sqrt.c: Use SQRT_OF_NEGATIVE.
14544         * mpz/sqrt.c: Ditto.
14545         * mpz/sqrtrem.c: Ditto.
14546
14547         * gmp-impl.h (GMP_ERROR,SQRT_OF_NEGATIVE): New macros.
14548         (DIVIDE_BY_ZERO): Use GMP_ERROR.
14549         (__mp_bases): #define to __MPN(mp_bases).
14550
14551 2000-04-11  Linus Nordberg  <linus@swox.se>
14552
14553         * tests/rand/stat.c (main): Initialize `l1runs' at declaration.
14554
14555 2000-04-11  Kevin Ryde  <kevin@swox.se>
14556
14557         * mpz/fib_ui.c: Add K&R function definitions.
14558
14559         * mpbsd/tests/Makefile.am (TESTS): Add a dummy test to avoid a
14560         shell problem with an empty "for tst in $(TESTS) ; ...".
14561         * mpbsd/tests/dummy.c: New file.
14562
14563 2000-04-10  Torbjorn Granlund  <tege@swox.com>
14564
14565         * mpz/bin_uiui.c: Delete several unused variables.
14566         Add copyright notice.
14567         * mpz/bin_ui.c: Add copyright notice.
14568
14569         * longlong.h: Declare __count_leading_zeros for alpha.
14570
14571 2000-04-10  Linus Nordberg  <linus@swox.se>
14572
14573         * rand.c (gmp_randinit): Change parameter list to (rstate, alg, ...).
14574         * gmp.h: Change prototype accordingly.
14575         * mpz/pprime_p.c (millerrabin): Change call accordingly.
14576
14577         * configure.in: Check for `optarg'.
14578         * configure: Regenerate.
14579
14580         * mpn/Makefile.am: Remove incorrect comment.
14581         * mpn/Makefile.in: Regenerate.
14582
14583         * gmp.h: Rename most of the random number functions, structs and
14584           some of the struct members.
14585         * rand.c (gmp_randinit): Likewise.
14586         * randclr.c (gmp_randclear): Likewise.
14587         * randlc.c (gmp_randinit_lc): Likewise.
14588         * randlc2x.c (gmp_randinit_lc_2exp): Likewise.
14589         * randraw.c (lc): Likewise.
14590         (_gmp_rand_getraw): Likewise.
14591         * randsd.c (gmp_randseed): Likewise.
14592         * randsdui.c (gmp_randseed_ui): Likewise.
14593         * gmp.texi: Likewise.
14594
14595         * gmp.texi: Use three hyphens for a dash.
14596         (Low-level Functions): Remove documentation for gmp_rand_getraw.
14597         (Random Number Functions): Add info on where to find documentation
14598         on the random number functions.
14599
14600         * tests/rand/Makefile.am (test, bigtest): Quote argument to grep.
14601         * tests/rand/Makefile.in: Regenerate.
14602
14603         * tests/rand/gen.c: Declare optarg, optind, opterr if not already
14604         declared.
14605         (main): Use new names for the random stuff.
14606         (main): Don't use strtoul() if we don't have it.  Use strtol()
14607         instead, if we have it.  Otherwise, use atoi().
14608         (main): Use srandom/srandomdev for __FreeBSD__ only.
14609         (main): Use new parameter order to gmp_randinit().
14610
14611         * tests/rand/stat.c: Declare optarg, optind, opterr if not already
14612         declared.
14613
14614 2000-04-10  Torbjorn Granlund  <tege@swox.com>
14615
14616         * mpz/pprime_p.c: Pass 0L for mpz_scan1.  mpz_mmod => mpz_mod.
14617         (millerrabin): Use new random interface.
14618         (millerrabin): ... and don't forget to call gmp_randclear.
14619
14620         * mpz/nextprime.c: New file.
14621         * gmp.h: Declare mpz_nextprime.
14622         * mpz/Makefile.am: List nextprime.c.
14623         * mpz/Makefile.in: Regenerate.
14624         * Makefile.am: List mpz/nextprime.lo.
14625         * Makefile.in: Regenerate.
14626
14627 2000-04-10  Kevin Ryde  <kevin@swox.se>
14628
14629         * move-if-change, mpz/tests/move-if-change, mpq/tests/move-if-change,
14630         mpf/tests/move-if-change: Remove, no longer used.
14631
14632         * Makefile.am (SUBDIRS): Add tests, demos, mpbsd.
14633         (libmp.la): New target, conditional on WANT_MPBSD.
14634         (libgmp_la_LIBADD): Add -lm.
14635         (AUTOMAKE_OPTIONS): Add check-news.
14636         (include_HEADERS): Setup to install gmp.h and possibly mp.h.
14637         (DISTCLEANFILES): Add generated files.
14638         (check): Remove explicit target (now uses check-recursive).
14639
14640         * configure.in: Use AM_CONFIG_HEADER.
14641         Add --enable-mpbsd setting automake conditional WANT_MPBSD.
14642         Output demos/Makefile, mpbsd/Makefile and mpbsd/tests/Makefile.
14643
14644         * mpz/Makefile.am: Add SUBDIRS=tests, shorten INCLUDES since now
14645         using AM_CONFIG_HEADER.
14646         * mpq/Makefile.am: Ditto.
14647         * mpf/Makefile.am: Ditto, and add DISTCLEANFILES.
14648         * mpn/Makefile.am: Shorten INCLUDES, amend some comments.
14649         * mpz/tests/Makefile.am: Use TESTS and $(top_builddir).
14650         * mpf/tests/Makefile.am: Ditto.
14651         * mpq/tests/Makefile.am: Ditto.
14652         * demos/Makefile.am: New file.
14653
14654         * mpbsd/Makefile.am: New file, derived from old mpbsd/Makefile.in.
14655         * mpbsd/Makefile.in: Now generated from Makefile.am.
14656         * mpbsd/realloc.c: Removed, use mpz/realloc.c instead.
14657         * mpbsd/tests/Makefile.am: New file.
14658         * mpbsd/tests/Makefile.in: New file, generated from Makefile.am.
14659         * mpbsd/tests/allfuns.c: New file.
14660
14661         * gmp.texi (Top): Use @ifnottex, to help makeinfo --html.
14662         (Installing MP): Describe --enable-mpbsd and demo programs.
14663
14664         * tests/rand/statlib.c: mpz_cmp_abs => mpz_cmpabs.
14665
14666         * tests/rand/Makefile.am (LDADD): Don't need -lm (now in libgmp.la).
14667         (EXTRA_PROGRAMS): Not noinst_PROGRAMS.
14668         (INCLUDES): Shorten to -I$(top_srcdir) now using AM_CONFIG_HEADER.
14669
14670 2000-04-09  Torbjorn Granlund  <tege@swox.com>
14671
14672         * mpz/urandomm.c: Get type of count right.
14673         Simplify computation of nbits.
14674
14675 2000-04-08  Torbjorn Granlund  <tege@swox.com>
14676
14677         * mpz/urandomb.c: Fix reallocation condition.
14678         Simplify size computation.
14679
14680 2000-04-08  Linus Nordberg  <linus@swox.se>
14681
14682         * acinclude.m4 (GMP_CHECK_CC_64BIT): Add special handling for
14683         HPUX.
14684         (GMP_CHECK_ASM_W32): Ditto.
14685         * aclocal.m4: Regenerate.
14686
14687         * mpn/Makefile.am: Use $(CCAS) for assembling.
14688         (.asm.obj): Add rule.
14689         * mpn/Makefile.in: Regenerate.
14690
14691         * gmp.texi (Miscellaneous Integer Functions): Fix typos.
14692
14693         * configure.in: Never pass `-h' to grep.
14694         (mips-sgi-irix6.[2-9]*): Try to find 64-bit compiler.
14695         (hppa1.0*-*-*): New flag for cc.
14696         (hppa2.0*-*-*): Try to find 64-bit compiler.  Chose path, set
14697         CCAS.
14698         * configure: Regenerate.
14699
14700 2000-04-08  Torbjorn Granlund  <tege@swox.com>
14701
14702         * mpz/bin_ui.c: Don't depend on ANSI C features.
14703         * mpz/bin_uiui.c: Likewise.
14704
14705         * Makefile.am (MPZ_OBJECTS): mpz/cmp_abs* => mpz/cmpabs*.
14706         (MPQ_OBJECTS): Add mpq/set_d.lo.
14707         (MPZ_OBJECTS): Add mpz/fits*.lo.
14708         * Makefile.in: Regenerate.
14709
14710         * mpz/cmpabs.c: New name for mpz/cmp_abs.c.
14711         * mpz/cmpabs_ui.c: New name for mpz/cmp_abs_ui.c.
14712         * mpz/Makefile.am: Corresponding changes.
14713         * mpz/Makefile.in: Regenerate.
14714         * gmp.h: mpz_cmp_abs* => mpz_cmpabs*.
14715
14716         * mpz/addmul_ui.c (mpn_neg1): Don't depend on ANSI C features.
14717
14718         * mpz/invert.c: Use TMP_MARK since we invoke MPZ_TMP_INIT.
14719
14720         * gmp.h (mpq_set_d): Declare correctly.
14721         (mpz_root): Use _PROTO.
14722         (mpz_remove): Use _PROTO.
14723         (mpf_pow_iu): Use _PROTO.
14724
14725         * mpn/asm-defs.m4 (MPN_PREFIX): Revert previous change.
14726         * gmp.h (__MPN): Revert previous change.
14727
14728         * mpz/perfpow.c: De-ANSI-fy.  Add copyright notice.
14729
14730         * mpz/set_d.c: Misc cleanups.
14731
14732         * mpq/set_d: New file.
14733         * gmp.h: Declare mpq_set_d.
14734         * mpq/Makefile.am: List set_d.c.
14735         * mpq/Makefile.in: Regenerate.
14736
14737 2000-04-07  Torbjorn Granlund  <tege@swox.com>
14738
14739         * mpz/fits_sint_p.c: New file.
14740         * mpz/fits_slong_p.c: New file.
14741         * mpz/fits_sshort_p.c: New file.
14742         * mpz/fits_uint_p.c: New file.
14743         * mpz/fits_ulong_p.c: New file.
14744         * mpz/fits_ushort_p.c: New file.
14745         * gmp.h: Declare mpz_fits_*.
14746         * mpz/Makefile.am: List fits_* files.
14747         * mpz/Makefile.in: Regenerate.
14748
14749 2000-04-06  Kevin Ryde  <kevin@swox.se>
14750
14751         * gmp.texi (Installing MP): Add known build problem SunOS 4.1.4 m4
14752         failure.
14753
14754         * mpn/x86/pentium/gmp-mparam.h: Tune thresholds.
14755         * mpn/x86/p6/gmp-mparam.h: Ditto.
14756         * mpn/x86/k6/gmp-mparam.h: Tune thresholds, add UMUL_TIME, UDIV_TIME.
14757         * mpn/x86/k7/gmp-mparam.h: Tune thresholds, amend UMUL_TIME.
14758
14759         * mpn/generic/mul_n.c (mpn_kara_mul_n): Add an ASSERT.
14760         (mpn_kara_sqr_n): Add an ASSERT, use KARATSUBA_SQR_THRESHOLD.
14761         (mpn_toom3_sqr_n): Eliminate second evaluate3.
14762
14763         * gmp-impl.h (mpn_com_n,MPN_LOGOPS_N_INLINE): Don't allow size==0.
14764         (tune_mul_threshold,tune_sqr_threshold): Conditionalize
14765         declarations on TUNE_PROGRAM_BUILD.
14766
14767         * mpn/generic/sqr_basecase.c: Add an assert.
14768
14769 2000-04-05  Torbjorn Granlund  <tege@swox.com>
14770
14771         * gmp.h, mpn/asm-defs.m4: List the same functions for __MPN, but
14772         leave some commented out.
14773
14774         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Optimize.
14775         (mpn_com_n): Optimize.
14776
14777         * gmp.h (__MPN): Make it use __gmpn instead of __mpn for consistency.
14778         * mpn/asm-defs.m4 (MPN_PREFIX): Likewise.
14779
14780         * gmp.h (GMP_ERROR_ALLOCATE): New errcode.
14781
14782         * gmp-impl.h (MPN_MUL_N_RECURSE): Delete.
14783         (MPN_SQR_RECURSE): Delete.
14784
14785         * gmp-impl.h (TARGET_REGISTER_STARVED): New define.
14786
14787         * gmp-impl.h (mpn_kara_sqr_n): Remap with __MPN.
14788         (mpn_toom3_sqr_n): Likewise.
14789         (mpn_kara_mul_n): Likewise.
14790         (mpn_toom3_mul_n): Likewise.
14791         (mpn_reciprocal): Likewise.
14792
14793         * gmp-impl.h (__gmpn_mul_n): Remove declaration.
14794         (__gmpn_sqr): Likewise.
14795         * gmp.h (mpn_sqr_n): Declare/remap.
14796         * mpn/generic/mul.c (mpn_sqr_n): New name for mpn_sqr.
14797
14798         * gmp.h (mpn_udiv_w_sdiv): Move __MPN remap from here...
14799         * gmp-impl.h: ...to here.
14800
14801 2000-04-05  Linus Nordberg  <linus@swox.se>
14802
14803         * gmp.texi (Top): Add `Random Number Functions' to menu.
14804         (Introduction to MP): Fix typo.
14805         (MP Basics): Create menu for all sections.  Move `Random Number
14806         Functions' to its own chapter.  Add nodes for all sections.
14807         (Function Classes): Mention random generation functions under
14808         miscellaneous.
14809         (Miscellaneous Integer Functions): Update mpz_urandomb,
14810         mpz_urandomm.
14811         (Low-level Functions): Remove mpn_rawrandom.
14812         (Random State Initialization): Update.
14813
14814         * mpf/urandom.c (mpf_urandomb): Remove SIZE parameter.  Normalize
14815         result correctly.
14816
14817         * gmp.h (mpf_urandomb): Remove SIZE parameter.
14818
14819         * randraw.c (gmp_rand_getraw): Handle the case where (1) the LC
14820         scheme doesn't generate even limbs and (2) more than one LC
14821         invokation is necessary to produce the requested number of bits.
14822
14823 2000-04-05  Torbjorn Granlund  <tege@swox.com>
14824
14825         * mpn/generic/mul_n.c (INVERSE_3): New name for THIRD, define for
14826         any BITS_PER_MP_LIMB.
14827         (MP_LIMB_T_MAX): New.
14828         (mpn_divexact3_n): Remove.
14829         (interpolate3): Use mpn_divexact_by3 instead of mpn_divexact3_n.
14830
14831 2000-04-05  Kevin Ryde  <kevin@swox.se>
14832
14833         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD<2): Remove cpp test.
14834         (tune_mul_threshold,tune_sqr_threshold): Add declarations, used in
14835         development only.
14836
14837         * mpn/x86/k7/sqr_basecase.asm: New file, only a copy of k6 for now.
14838
14839 2000-04-04  Torbjorn Granlund  <tege@swox.com>
14840
14841         * gmp-impl.h (TOOM3_MUL_THRESHOLD): Provide default.
14842         (TOOM3_SQR_THRESHOLD): Provide default.
14843
14844         * mpn/generic/mul_n.c: Rewrite (mostly by Robert Harley).
14845         * mpn/generic/mul.c: Rewrite (mostly by Robert Harley).
14846
14847         * configure.in (sparcv9 64-bit OS): Set extra_functions.
14848
14849 2000-04-04  Linus Nordberg  <linus@swox.se>
14850
14851         * mpn/generic/rawrandom.c: Remove file and replace with randraw.c
14852         on top level.
14853         (mpn_rawrandom): Rename to gmp_rand_getraw.
14854
14855         * randraw.c: New file; essentially a copy of
14856         mpn/generic/rawrandom.c.
14857         (gmp_rand_getraw): New function (formerly known as mpn_rawrandom).
14858
14859         * mpz/urandomb.c (mpz_urandomb): Change mpn_rawrandom -->
14860         gmp_rand_getraw.
14861         * mpz/urandomm.c (mpz_urandomb): Ditto.
14862         * mpf/urandom.c (mpf_urandomb): Ditto.
14863
14864         * gmp.h (gmp_rand_getraw): Add function prototype.
14865         (mpn_rawrandom): Remove function prototype.
14866
14867         * Makefile.am (libgmp_la_SOURCES): Add randraw.c.
14868         * Makefile.in: Regenerate.
14869
14870         * configure.in (gmp_mpn_functions): Remove rawrandom.
14871         * configure: Regenerate.
14872
14873 2000-04-04  Linus Nordberg  <linus@swox.se>
14874
14875         * gmp.h (GMP_ERROR enum): Remove comma after last enumeration
14876         since the AIX compiler (xlc) doesn't like that.
14877
14878         * randlc.c (gmp_rand_init_lc): Allocate enough space for seed to
14879         hold any upcoming seed.
14880         * randlc2x.c (gmp_rand_init_lc_2exp): Likewise.
14881
14882         * mpn/generic/rawrandom.c: Remove debugging code.
14883         (mpn_lc): Don't reallocate seed.
14884
14885         * mpz/urandomm.c (mpz_urandomm): Implement function.
14886
14887         * mpz/urandomb.c (mpz_urandomb): Fix typo in function definition.
14888
14889 2000-04-04  Kevin Ryde  <kevin@swox.se>
14890
14891         * make.bat: Removed (no longer works, no longer supported).
14892         * mpn/msdos/asm-syntax.h: Removed (was used only by make.bat).
14893
14894 2000-04-03  Torbjorn Granlund  <tege@swox.com>
14895
14896         * mpn/generic/brandom.c: New file, replacing random2.
14897
14898 2000-04-02  Torbjorn Granlund  <tege@swox.com>
14899
14900         * mpn/sparc32/v9/submul_1.asm: Change some carry-form instructions
14901         into their plain counterparts.
14902
14903         * mpn/sparc64/copyi.asm: Avoid executing ALIGN.
14904
14905         * mpn/sparc64/mul_1.asm: Handle overlap of rp/sp.
14906         * mpn/sparc64/addmul_1.asm: Likewise.
14907         * mpn/sparc64/submul_1.asm: Likewise.
14908
14909 2000-04-01  Linus Nordberg  <linus@swox.se>
14910
14911         * gmp.h: Fix function prototypes for randomization functions.
14912         (__gmp_rand_lc_scheme_struct): Replace `m' with `m2exp'. Remove
14913         unused `bits'.
14914         (__gmp_rand_data_lc): Add `m2exp' as another way of representing
14915         the modulus.
14916         (__gmp_rand_state_struct): Remove unused `size'.
14917
14918         * rand.c (__gmp_rand_scheme): Use better multipliers.  Remove test
14919         schemes.  Replace `m' with `m2exp'.
14920         (gmp_rand_init): Change parameters and return type.  Use `m2exp'
14921         instead of `m'.  Set `gmp_errno' on error.  Disable BBS algorithm.
14922
14923         * randlc.c (gmp_rand_init_lc): Don't use malloc().  Change
14924         parameters.
14925
14926         * randclr.c (gmp_rand_clear): Don't use free().  Disable BBS
14927         algorithm.  Set `gmp_errno' on error.
14928
14929         * randlc2x.c (gmp_rand_init_lc_2exp): New function.
14930         * randsd.c (gmp_rand_seed): New function.
14931         * randsdui.c (gmp_rand_seed_ui): New function.
14932         * randlcui.c: Remove unused file.
14933
14934         * mpn/generic/rawrandom.c (mpn_rawrandom): Rewrite.
14935         (mpn_lc): New static function.
14936
14937         * mpz/urandomb.c (mpz_urandomb): Use ABSIZ() instead of SIZ() for
14938         determining size of ROP.
14939
14940         * mpf/urandom.c (mpf_urandomb): Add third parameter, nbits.  (Not
14941         used yet!)
14942         Change parameter order to mpn_rawrandom().
14943
14944         * Makefile.am (libgmp_la_SOURCES): Add errno.c, randlc2x.c,
14945         randsd.c, randsdui.c.  Remove randui.c.
14946         (MPZ_OBJECTS): Rename urandom.lo --> urandomb.lo.  Add urandomm.lo.
14947         * Makefile.in: Regenerate.
14948
14949         * mpz/Makefile.am (libmpz_la_SOURCES): Change urandom.c -->
14950         urandomb.c.  Add urandomm.c.
14951         * mpz/Makefile.in: Regenerate.
14952
14953         * tests/rand/Makefile.am (noinst_PROGRAMS): Change findcl --> findlc.
14954         Add gen.static.
14955         * tests/rand/Makefile.in: Regenerate.
14956
14957         * tests/rand/gen.c (main): Add mpz_urandomm.  Add command line options
14958         `-C', `-m', extend `-a'.  Use *mp*_*rand*() with new parameters.  Call
14959         gmp_rand_seed().
14960
14961 2000-04-01  Kevin Ryde  <kevin@swox.se>
14962
14963         * acinclude.m4 (GMP_CHECK_ASM_DATA): Plain .data for hpux.
14964         * configure.in (CCAS): No CFLAGS, they're added when it's used.
14965         (CONFIG_SRCDIR): New define for config.m4.
14966         * mpn/sparc64/addmul_1.asm: Use it for an include().
14967         * mpn/sparc64/submul_1.asm: Ditto.
14968         * mpn/sparc64/mul_1.asm: Ditto.
14969
14970 2000-03-31  Linus Nordberg  <linus@swox.se>
14971
14972         * mpz/urandom.c: Rename to...
14973         * mpz/urandomb.c: ...this.
14974
14975         * mpz/urandomb.c (mpz_urandomb): Change operand order in call to
14976         mpn_rawrandom().  Use ABSIZ() instead of SIZ() when checking size
14977         of ROP.
14978
14979         * mpz/urandomm.c: New file.
14980
14981 2000-03-31  Kevin Ryde  <kevin@swox.se>
14982
14983         * acinclude.m4 (GMP_CHECK_ASM_MMX): Give a warning when mmx code
14984         will be omitted.
14985
14986 2000-03-30  Torbjorn Granlund  <tege@swox.com>
14987
14988         * mpn/sparc64/mul_1h.asm: New file.
14989         * mpn/sparc64/addmul_1h.asm: New file.
14990         * mpn/sparc64/submul_1h.asm: New file.
14991         * mpn/sparc64/mul_1.asm: Rewrite.
14992         * mpn/sparc64/addmul_1.asm: Rewrite.
14993         * mpn/sparc64/submul_1.asm: Rewrite.
14994
14995 2000-03-28  Torbjorn Granlund  <tege@swox.com>
14996
14997         * mpn/sparc32/v9/mul_1.asm: Fix typo in branch prediction.
14998         * mpn/sparc32/v9/addmul_1.asm: Likewise.
14999         * mpn/sparc32/v9/submul_1.asm: Likewise.
15000
15001 2000-03-25  Kevin Ryde  <kevin@swox.se>
15002
15003         * mpn/lisp/gmpasm-mode.el: Fix some comment detection, use custom,
15004         fontify more keywords, turn into a standalone mode.
15005
15006         * stamp-vti: New file, generated together with version.texi.
15007
15008         * acinclude.m4 (GMP_VERSION,GMP_HEADER_GETVAL): New macros.
15009         * configure.in (AM_INIT_AUTOMAKE): Use GMP_VERSION.
15010
15011 2000-03-24  Kevin Ryde  <kevin@swox.se>
15012
15013         * INSTALL: Updates for new configure system.
15014
15015         * configure.in: Add gmp_optcflags_gcc for the x86s, setting -mcpu
15016         and -march.
15017
15018 2000-03-23  Torbjorn Granlund  <tege@swox.com>
15019
15020         * demos/pexpr.c (mpz_eval_expr): Properly initialize rhs/lhs
15021         for ROOT.
15022
15023 2000-03-23  Kevin Ryde  <kevin@swox.se>
15024
15025         * config.guess (i?86:*:*:*): Use uname -m if detection program fails.
15026
15027         * mpn/x86/README: Remove remarks on the now implemented MMX shifts.
15028         * mpn/x86/k6/README: Add speed of mpn_divexact_by3, update mpn_mul_1.
15029
15030         * gmp.texi (Installing MP): Corrections to target CPUs.
15031
15032         * version.c: Use VERSION from config.h, add copyright comment,
15033         restore "const" somehow lost.
15034
15035         * configure.in (a29k*-*-*): Fix directory name.
15036
15037 2000-03-22  Torbjorn Granlund  <tege@swox.com>
15038
15039         * demos/pexpr.c (op_t): Add ROOT.
15040         (fns): Add ROOT.
15041         (mpz_eval_expr): Add ROOT.
15042
15043         * mpz/root.c: Handle roots of negative numbers.
15044         Fix other border cases.
15045         Fix rare memory leakage.
15046
15047         * errno.c: New file.
15048
15049 2000-03-21  Torbjorn Granlund  <tege@swox.com>
15050
15051         * gmp.h (error number enum): New anonymous enum.
15052         (gmp_errno): New.
15053
15054         * gmp.h (__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR): Bump for GMP 3.0.
15055
15056 2000-03-20  Torbjorn Granlund  <tege@swox.com>
15057
15058         * mpn/alpha/unicos.m4 (FLOAT64): New define.
15059         * mpn/alpha/default.m4 (FLOAT64): New define.
15060         * mpn/alpha/invert_limb.asm (C36): Use FLOAT64.
15061
15062 2000-03-21  Kevin Ryde  <kevin@swox.se>
15063
15064         * mpn/x86/k6/diveby3.asm: Tiny speedup.
15065
15066         * acinclude.m4 (GMP_CHECK_ASM_SHLDL_CL): New macro.
15067         * configure.in: Use it, set WANT_SHLDL_CL in config.m4.
15068         * mpn/x86/x86-defs.m4 (shldl,shrdl,shldw,shrdw): New macros, using
15069         WANT_SHLDL_CL.
15070         * mpn/x86/k6/mmx/lshift.asm: Use shldl macro.
15071         * mpn/x86/k7/mmx/lshift.asm: Ditto.
15072         * mpn/x86/pentium/mmx/lshift.asm: Ditto.
15073         * mpn/x86/k6/mmx/rshift.asm: Use shrdl macro.
15074         * mpn/x86/k7/mmx/rshift.asm: Ditto.
15075         * mpn/x86/pentium/mmx/rshift.asm: Ditto.
15076         * mpn/x86/README.family: Add a note about this.
15077
15078 2000-03-20  Linus Nordberg  <linus@swox.se>
15079
15080         * mpn/generic/rawrandom.c (mpn_rawrandom): Handle seed value of 0
15081         correctly.
15082
15083         * configure.in: Fix detection of alpha flavour.
15084         Set compiler options for `sparcv8'.
15085         * configure: Regenerate.
15086
15087         * rand.c (__gmp_rand_scheme): Clean up some.  Use slightly better
15088         multipliers.
15089
15090         * configure.in (AC_OUTPUT): Add tests/Makefile and
15091         tests/rand/Makefile.
15092
15093         * acinclude.m4 (AC_CANONICAL_BUILD): Define to
15094         `_AC_CANONICAL_BUILD' to deal with incompabilities between
15095         Autoconf and Libtool.
15096         (AC_CHECK_TOOL_PREFIX): Likewise.
15097
15098         * Makefile.am (EXTRA_DIST): Add directory `tests'.
15099
15100         * mkinstalldirs: Update (Automake 2000-03-17).
15101         * ltconfig: Update (Libtool 2000-03-17).
15102         * ltmain.sh: Ditto.
15103
15104         * configure: Regenerate with new autoconf/-make/libtool suite.
15105         * aclocal.m4: Ditto.
15106         * config.in: Ditto.
15107         * all Makefile.in's: Ditto.
15108
15109 2000-03-20  Torbjorn Granlund  <tege@swox.com>
15110
15111         * demos/pexpr.c (main): Don't allow `-N' for base, require `-bN'.
15112
15113         * mpn/alpha/unicos.m4 (cvttqc): New define.
15114         * mpn/alpha/invert_limb.asm: Use new define for cvttqc.
15115
15116 2000-03-19  Kevin Ryde  <kevin@swox.se>
15117
15118         * mpn/x86/k6/sqr_basecase.asm: Tiny amendments for 3x3 case.
15119
15120         * gmp.texi: Use @include version.texi.
15121         Use @email and @uref.
15122         (Installing MP): Rewrite for new configure.
15123         (Low-level Functions): Add mpn_divexact_by3.
15124
15125         * configure.in (--enable-alloca): New option.
15126         * acconfig.h (USE_STACK_ALLOC): For --disable-alloca.
15127
15128 2000-03-18  Kent Boortz  <kent@swox.com>
15129
15130         * macos: New directory with macos port files.
15131
15132 2000-03-17  Torbjorn Granlund  <tege@swox.com>
15133
15134         * gmp-impl.h (union ieee_double_extract): Check _CRAYMPP.
15135
15136         * mpn/asm-defs.m4 (invert_normalized_limb): Define.
15137
15138         * mpn/alpha: Translate `.s' files to `.asm'.
15139
15140         * configure: Regenerate.
15141
15142         * mpn/alpha/invert_limb.asm: Replace dash in file name with underscore.
15143         * configure.in: Corresponding change.
15144
15145         * configure.in: Assign special "path" for alphaev6.
15146
15147         * mpn/alpha/unicos.m4: New file.
15148         * configure.in (alpha*-cray-unicos*): [This part of the change
15149         commited 2000-03-13 by linus]
15150         * mpn/alpha/default.m4: New file.
15151         * configure.in (alpha*-*-*): Use it.
15152
15153 2000-03-17  Kevin Ryde  <kevin@swox.se>
15154
15155         * mpn/x86/pentium/rshift.S: Use plain rcrl (not rcrl $1) for
15156         shift-by-1 case, significant speedup.
15157         * mpn/x86/pentium/README: Add shift-by-1 speed.
15158
15159 2000-03-16  Torbjorn Granlund  <tege@swox.com>
15160
15161         * config.guess: Handle Cray T3D/E.
15162
15163 2000-03-15  Kevin Ryde  <kevin@swox.se>
15164
15165         * mpn/generic/diveby3.c: New file.
15166         * mpn/x86/diveby3.asm: New file.
15167         * mpn/x86/k6/diveby3.asm: New file.
15168         * gmp.h (mpn_divexact_by3): Prototype and define.
15169         * mpn/asm-defs.m4: define_mpn(divexact_by3).
15170         * configure.in (gmp_mpn_functions): Add diveby3.
15171
15172         * mpn/x86/pentium/sqr_basecase.asm: A few better addressing modes.
15173
15174         * configure.in: Add AC_C_STRINGIZE and AC_CHECK_TYPES((void)).
15175         * gmp-impl.h (ASSERT): Use them.
15176
15177         * mpn/x86/k7/mmx/lshift.asm: New file.
15178         * mpn/x86/k7/mmx/rshift.asm: Rewrite simple loop and return value
15179         handling, add some pictures.
15180
15181 2000-03-14  Torbjorn Granlund  <tege@swox.com>
15182
15183         * mpn/sparc32/v8/mul_1.asm: Make PIC actually work.
15184         * mpn/sparc32/v8/addmul_1.asm: Likewise.
15185
15186         * mpn/sparc32/v8/mul_1.asm: Use m4 ifdef, not cpp #if.
15187         * mpn/sparc32/v8/addmul_1.asm: Likewise.
15188
15189         * mpn/asm-defs.m4 (C): New define for comments.
15190         * mpn/sparc32: Start comments with `C'.
15191
15192         * config.guess: Remove `SunOS 6' handling.
15193         Recognize sun4m and sun4d architectures under old SunOS.
15194
15195 2000-03-14  Linus Nordberg  <linus@swox.se>
15196
15197         * configure.in (gmp_srclinks): Set to list of links created by
15198         configure.
15199         * configure: Regenerate.
15200
15201         * Makefile.am (libgmp_la_LDFLAGS): Set version info.
15202         (DISTCLEANFILES): Include @gmp_srclinks@.
15203         * Makefile.in: Regenerate.
15204
15205 2000-03-13  Linus Nordberg  <linus@swox.se>
15206
15207         * configure.in: Remove some changequote's by quoting the strings
15208         containing `[]'.
15209         Add support for `alpha*-cray-unicos*'.
15210         AC_DEFINE `_LONG_LONG_LIMB' instead of passing it in CFLAGS.
15211         Conditionalize the assembler syntax checks.
15212         * configure: Regenerate.
15213         * config.in: Regenerate.
15214
15215         * acinclude.m4 (GMP_PROG_CCAS): Remove macro.
15216         * aclocal.m4: Regenerate.
15217
15218 2000-03-13  Kevin Ryde  <kevin@swox.se>
15219
15220         * mpn/x86/p6/README: New file.
15221
15222         * mpn/x86/k6/mul_1.asm: Rewrite, smaller and slightly faster.
15223
15224         * mpn/lisp/gmpasm-mode.el: Rewrite assembler comment detection and
15225         handling.
15226
15227         * configure.in: Separate mmx directories for each x86 flavour.
15228         * configure: Regenerate.
15229
15230 2000-03-12  Kevin Ryde  <kevin@swox.se>
15231
15232         * mpn/x86/x86-defs.m4 (ALIGN): Supplement definition from
15233         config.m4 so as to pad with nops not zeros on old gas.
15234
15235         * mpn/x86/k7/mmx/copyd.asm: Use plain emms (femms is just an alias
15236         for emms now).
15237         * mpn/x86/k7/mmx/copyi.asm: Ditto.
15238         * mpn/x86/k7/mmx/rshift.asm: Ditto.
15239         * mpn/x86/x86-defs.m4: Amend comments.
15240
15241         * mpn/x86/mod_1.asm: Add comments on speeds.
15242
15243         * mpn/x86/pentium/mmx/lshift.asm: New file.
15244         * mpn/x86/pentium/mmx/rshift.asm: New file.
15245         * mpn/x86/pentium/README: Add speeds of various routines.
15246
15247 2000-03-10  Linus Nordberg  <linus@swox.se>
15248
15249         * configure.in: Reorganize.
15250         Use AC_CHECK_TOOL to find `ar'.
15251         Add post-includes `regmap.m4' and `aix.m4' for AIX targets.
15252         asm-syntax.h is not needed for PPC or sparc anymore.
15253         (powerpc64-*-aix*): Compiler is always 64-bit. Use `-q64
15254         -qtune=pwr3' to xlc and `-maix64 -mpowerpc64' to gcc.  Pass `-X
15255         64' to `ar' and `nm'.
15256         (pentiummmx): Use GMP_CHECK_ASM_MMX and avoid MMX assembly path if
15257         assembler is not MMX capable.
15258         (pentium[23]): Likewise.
15259         (athlon): Likewise.
15260         (k6*): Likewise.
15261         * configure: Regenerate.
15262
15263         * acinclude.m4 (GMP_PROG_CC_WORKS): New macro.
15264         (GMP_PROG_CC_FIND): Use GMP_PROG_CC_WORKS instead of
15265         AC_TRY_COMPILER.  Make sure that the *first* working 32-bit
15266         compiler is used if no 64-bit compiler is found.
15267         (GMP_CHECK_ASM_MMX): New macro.
15268         * aclocal.m4: Regenerate.
15269
15270         * Makefile.in: Regenerate.  (CC_TEST removed.)
15271         * mpf/Makefile.in: Likewise.
15272         * mpn/Makefile.in: Likewise.
15273         * mpq/Makefile.in: Likewise.
15274         * mpz/Makefile.in: Likewise.
15275         * mpf/tests/Makefile.in: Likewise.
15276         * mpq/tests/Makefile.in: Likewise.
15277         * mpz/tests/Makefile.in: Likewise.
15278
15279         * acconfig.h (_LONG_LONG_LIMB): Add.
15280
15281         * gmp-impl.h: Include config.h only if HAVE_CONFIG_H is defined.
15282
15283 2000-03-09  Kevin Ryde  <kevin@swox.se>
15284
15285         * mpn/x86/pentium/mul_basecase.S: Small speedup by avoiding an AGI.
15286
15287         * mpn/x86/k7/mmx/copyd.asm: Tiny speedup by avoiding popl.
15288         * mpn/x86/k7/mmx/copyi.asm: Ditto.
15289         * mpn/x86/k7/mul_basecase.asm: Ditto.
15290
15291 2000-03-07  Torbjorn Granlund  <tege@swox.com>
15292
15293         * config.guess: Better recognize POWER/PowerPC processor type.
15294
15295 2000-03-07  Kevin Ryde  <kevin@swox.se>
15296
15297         * mpn/generic/addsub_n.c: Use HAVE_NATIVE_* now in config.h.
15298
15299         * mpn/asm-defs.m4: Add comments about SysV m4.
15300         (m4_log2): Don't use <<.
15301         (m4_lshift,m4_rshift): New macros.
15302
15303 2000-03-06  Torbjorn Granlund  <tege@swox.com>
15304
15305         * mpn/powerpc32/regmap.m4: Map cr0 => `0', etc.
15306
15307 2000-03-06  Kevin Ryde  <kevin@swox.se>
15308
15309         * mpn/tests/ref.c (refmpn_divexact_by3): New function.
15310         * mpn/tests/ref.h: Prototype.
15311
15312         * acconfig.h (WANT_ASSERT): New define.
15313         * configure.in (--enable-assert): Turn on WANT_ASSERT.
15314         * assert.c: New file.
15315         * Makefile.am: Add to build.
15316         * gmp-impl.h (ASSERT): New macro.
15317         (ASSERT_NOCARRY) Renamed from assert_nocarry.
15318         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS.
15319         * mpn/tests/ref.c: Use ASSERT.
15320         * mpf/get_str.c: Use ASSERT_ALWAYS.
15321         * mpf/set_str.c: Remove old assert macro.
15322
15323         * mpn/x86/x86-defs.m4 (cmovnz_ebx_ecx): New macro.
15324         * mpn/x86/p6/aorsmul_1.asm: Use cmov.
15325
15326         * mpn/x86/lshift.S: Use %dl with testb, not %edx. No object code
15327         change, testb was still getting generated.
15328         * mpn/x86/rshift.S: Ditto.
15329
15330 2000-03-03  Torbjorn Granlund  <tege@swox.com>
15331
15332         * longlong.h: Add IA-64 support.
15333
15334         * mpn/powerpc32: Misc cleanups.
15335         * mpn/powerpc32/aix.m4: New file (mainly by Linus).
15336         * mpn/powerpc64/aix.m4: New file (mainly by Linus).
15337         * mpn/powerpc64: Translate `.S' files to `.asm'.
15338
15339         * configure.in: Fix tyops.
15340         * configure: Regenerate.
15341
15342 2000-03-02  Torbjorn Granlund  <tege@swox.com>
15343
15344         * mpn/powerpc32/regmap.m4: New file.
15345         * mpn/powerpc32: Translate `.S' files to `.asm'.
15346         * configure.in: Use mpn/powerpc32/regmap.m4 for powerpc targets
15347         except some weird ones.
15348
15349 2000-03-03  Kevin Ryde  <kevin@swox.se>
15350
15351         * mpn/lisp/gmpasm-mode.el: Suppress postscript comment prefixes in
15352         filladapt.
15353
15354         * mpn/x86/pentium/sqr_basecase.asm: New file.
15355         * mpn/x86/pentium/gmp-mparam.h (KARATSUBA_SQR_THRESHOLD): Update.
15356
15357         * configure.in: Add --enable-assert, enable k6 logops functions.
15358
15359         * mpn/x86/k6/mmx/copyi.asm: Use m4 for divide, not as.
15360         * mpn/x86/k6/mmx/copyd.asm: Ditto.
15361         * mpn/x86/README.family: Add a note on this.
15362
15363 2000-03-02  Kevin Ryde  <kevin@swox.se>
15364
15365         * mpn/x86/k6/aors_n.asm: Don't use stosl.
15366         * mpn/x86/copyi.asm: Use cld to clear direction flag.
15367         * mpn/x86/divrem_1.asm: Ditto.
15368         * mpn/x86/README.family: Add a note on this.
15369
15370         * mpn/x86/k6/mmx/copyi.asm: Rewrite.
15371         * mpn/x86/k6/mmx/copyd.asm: New file.
15372         * mpn/x86/k6/README: Update, and small amendments.
15373
15374         * mpn/x86/x86-defs.m4 (Zdisp): New macro.
15375         * mpn/asm-defs.m4 (m4_stringequal_p): New macro.
15376
15377         * mpn/x86/p6/aorsmul_1.asm: Use Zdisp to force zero displacements.
15378         * mpn/x86/k6/aorsmul_1.asm: Ditto.
15379         * mpn/x86/k6/mul_1.asm: Ditto.
15380         * mpn/x86/k6/mul_basecase.asm: Ditto.
15381         * mpn/x86/k7/aors_n.asm: Ditto.
15382         * mpn/x86/k7/aorsmul_1.asm: Ditto.
15383         * mpn/x86/k7/mul_1.asm: Ditto.
15384         * mpn/x86/k7/mul_basecase.asm: Ditto.
15385         * mpn/x86/README.family: Add a note on this.
15386
15387 2000-02-27  Kevin Ryde  <kevin@swox.se>
15388
15389         * mpn/generic/divrem.c (mpn_divrem_classic): Patch to avoid gcc
15390         2.7.2.3 i386 register handling bug.
15391
15392         * mpn/x86/k6/aors_n.asm: Rewrite.
15393         * mpn/x86/k6/mmx/lshift.asm: Rewrite.
15394         * mpn/x86/k6/mmx/rshift.asm: Rewrite.
15395         * mpn/x86/k6/README: Update.
15396
15397         * mpn/x86/k7/mmx/copyd.asm: Support size==0.
15398         * mpn/x86/k7/mmx/copyi.asm: Ditto.
15399         * mpn/x86/k6/mmx/copyi.asm: Ditto.
15400         * gmp-impl.h: Comment size==0 allowed in MPN_COPY_INCR and
15401         MPN_COPY_DECR.
15402         * configure.in: Enable x86 copyi, copyd; add k6 com_n.
15403
15404 2000-02-25  Torbjorn Granlund  <tege@swox.com>
15405
15406         * demos/pexpr.c (power): Move factorial handing code from `factor'
15407         to `power'.
15408
15409         * demos/factorize.c (factor_using_pollard_rho): Move resetting of `c'
15410         to before checking for a non-zero gcd.
15411
15412 2000-02-25  Kevin Ryde  <kevin@swox.se>
15413
15414         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro by Linus.
15415         * mpn/x86/k6/aors_n.asm: Use MULFUNC_PROLOGUE.
15416         * mpn/x86/k6/aorsmul_1.asm: Ditto.
15417         * mpn/x86/k7/aors_n.asm: Ditto.
15418         * mpn/x86/k7/aorsmul_1.asm: Ditto.
15419         * mpn/x86/p6/aorsmul_1.asm: Ditto.
15420
15421         * mpn/tests/ref.c (refmpn_copyi,refmpn_copyd): Allow size==0.
15422
15423         * gmp-impl.h: Move mpn_and_n, mpn_andn_n, mpn_com_n, mpn_ior_n,
15424         mpn_iorn_n, mpn_nand_n, mpn_nior_n, mpn_xor_n and mpn_xorn_n here
15425         from gmp.h.  Use HAVE_NATIVE_mpn_* to make these functions or
15426         inlines.
15427
15428         * gmp-impl.h: Move mpn_copyd, mpn_copyi here from gmp.h.
15429         * gmp-impl.h (MPN_COPY_INCR): Use mpn_copyi if available.
15430         * gmp-impl.h (MPN_COPY_DECR): Use mpn_copyd if available.
15431
15432         * mpn/x86/k6/mmx/com_n.asm: Moved into mmx subdirectory.
15433         * mpn/x86/k6/mmx/copyi.asm: Ditto.
15434         * mpn/x86/k6/mmx/lshift.asm: Ditto.
15435         * mpn/x86/k6/mmx/rshift.asm: Ditto.
15436         * mpn/x86/k7/mmx/rshift.asm: Ditto.
15437         * mpn/x86/k6/mmx/logops_n.asm: New file.
15438         * configure.in (k6*-*-*): Add logops_n.asm.
15439         * mpn/x86/k6/README: Update.
15440
15441         * mpn/x86/k7/mmx/copyi.asm: New file.
15442         * mpn/x86/k7/mmx/copyd.asm: New file.
15443         * mpn/x86/k7/README: Update.
15444
15445 2000-02-24  Kevin Ryde  <kevin@swox.se>
15446
15447         * mpn/x86/x86-defs.m4 (femms): Generate emms if 3dnow not available.
15448         * mpn/x86/x86-defs.m4 (FRAME_popl): New macro.
15449
15450         * Makefile.am: Add info_TEXINFOS = gmp.texi
15451
15452         * mpn/x86/divrem_1.asm: Moved from mpn/x86/k6, allow size==0,
15453         conditionalize loop versus decl/jnz.
15454         * mpn/x86/mod_1.asm: Ditto.
15455         * mpn/x86/divmod_1.asm: Removed.
15456         * gmp.texi (mpn_divrem_1,mpn_mod_1): Add that size==0 is allowed.
15457         * mpn/tests/ref.c (refmpn_divrem_1c,etc): Allow size==0.
15458
15459         * mpn/x86/k6/aors_n.asm: Avoid gas 1.92.3 leal displacement
15460         expression problem.
15461         * mpn/x86/k6/aorsmul_1.asm: Ditto.
15462         * mpn/x86/k6/mul_1.asm: Ditto.
15463         * mpn/x86/k6/mul_basecase.asm: Ditto
15464         * mpn/x86/k7/aors_n.asm: Ditto.
15465         * mpn/x86/k7/aorsmul_1.asm: Ditto.
15466         * mpn/x86/k7/mul_1.asm: Ditto.
15467         * mpn/x86/k7/mul_basecase.asm: Ditto.
15468         * mpn/x86/k7/rshift.asm: Ditto.
15469         * mpn/x86/p6/aorsmul_1.asm: Ditto.
15470         * mpn/x86/README.family: Describe problem.
15471
15472 2000-02-24  Linus Nordberg  <linus@swox.se>
15473
15474         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Add dummy symbol to
15475         testcase to avoid nm failure.  Try nm before piping to grep.
15476
15477         * acconfig.h: Undef HAVE_NATIVE_func for every mpn function found
15478         in gmp.h.
15479
15480         * configure.in: Invoke AC_CONFIG_HEADERS.
15481         Don't invoke AM_CONFIG_HEADER; it makes autoconf confused.
15482         Dig out entry points declared in assembly code and AC_DEFINE proper
15483         HAVE_NATIVE_func.
15484
15485         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro.
15486
15487         * mpn/x86/p6/aorsmul_1.asm: Use MULFUNC_PROLOGUE.
15488         * mpn/x86/k6/aors_n.asm: Likewise.
15489
15490         * Makefile.am (EXTRA_DIST): Add config.in; needed when we don't
15491         use AM_CONFIG_HEADER in configure.in.
15492
15493         * mpn/Makefile.am (INCLUDES): Add `-I..' for config.h and
15494         gmp-mparam.h.
15495         * mpf/Makefile.am: Likewise.
15496         * mpq/Makefile.am: Likewise.
15497         * mpz/Makefile.am: Likewise.
15498
15499         * mpf/tests/Makefile.am (INCLUDES): Add `-I../..' for config.h and
15500         gmp-mparam.h.
15501         * mpq/tests/Makefile.am: Likewise.
15502         * mpz/tests/Makefile.am: Likewise.
15503
15504         * configure: Regenerate.
15505         * aclocal.m4: Regenerate.
15506         * config.in: Regenerate.
15507         * Makefile.in: Regenerate.
15508         * mpf/Makefile.in: Regenerate.
15509         * mpn/Makefile.in: Regenerate.
15510         * mpq/Makefile.in: Regenerate.
15511         * mpz/Makefile.in: Regenerate.
15512         * mpf/tests/Makefile.in: Regenerate.
15513         * mpq/tests/Makefile.in: Regenerate.
15514         * mpz/tests/Makefile.in: Regenerate.
15515
15516 2000-02-23  Kevin Ryde  <kevin@swox.se>
15517
15518         * mpn/x86/addmul_1.S: Amend comments, this code no longer used by
15519         PentiumPro.
15520         * mpn/x86/submul_1.S: Ditto.
15521
15522         * mpn/x86/k6/com_n.asm: Rewrite, smaller but same speed.
15523
15524         * mpn/x86/addmul_1.S: Add PROLOGUE and EPILOGUE to get .type and
15525         .size for ELF.  Rename #define size to n to avoid .size.
15526         * mpn/x86/lshift.S: Ditto.
15527         * mpn/x86/mul_1.S: Ditto.
15528         * mpn/x86/mul_basecase.S: Ditto.
15529         * mpn/x86/rshift.S: Ditto.
15530         * mpn/x86/submul_1.S: Ditto.
15531         * mpn/x86/udiv.S: Ditto.
15532         * mpn/x86/umul.S: Ditto.
15533         * mpn/x86/pentium/add_n.S: Ditto.
15534         * mpn/x86/pentium/addmul_1.S: Ditto.
15535         * mpn/x86/pentium/lshift.S: Ditto.
15536         * mpn/x86/pentium/mul_1.S: Ditto.
15537         * mpn/x86/pentium/mul_basecase.S: Ditto.
15538         * mpn/x86/pentium/rshift.S: Ditto.
15539         * mpn/x86/pentium/sub_n.S: Ditto.
15540         * mpn/x86/pentium/submul_1.S: Ditto.
15541
15542 2000-02-22  Linus Nordberg  <linus@swox.se>
15543
15544         * acinclude.m4 (GMP_INIT): Use temporary file cnfm4p.tmp for
15545         post-defines.
15546         (GMP_FINISH): Ditto.
15547         (GMP_DEFINE): Add third optional argument specifying location in
15548         outfile.
15549         (GMP_DEFINE_RAW): New macro.
15550         * aclocal.m4: Regenerate.
15551
15552         * configure.in: Add `HAVE_TARGET_CPU_$target_cpu' using
15553         GMP_DEFINE_RAW.
15554         * configure: Regenerate.
15555
15556         * mpz/tests/Makefile.am: New test t-root.
15557         * mpz/tests/Makefile.in: Regenerate.
15558
15559 2000-02-22  Torbjorn Granlund  <tege@swox.com>
15560
15561         * mpz/root.c: Complete rewrite; still primitive, but at least correct.
15562         * mpz/tests/t-root.c: New test.
15563
15564 2000-02-22  Kevin Ryde  <kevin@swox.se>
15565
15566         * mpn/x86/k7/mul_basecase.asm: New file.
15567         * mpn/x86/k7/README: Add mpn_mul_basecase speed.
15568         * mpn/x86/k7/gmp-mparam.h: New file.
15569
15570         * mpn/x86/x86-defs.m4 (loop_or_decljnz,cmov_bytes): New macros.
15571         * mpn/asm-defs.m4 (m4_ifdef_anyof_p): New macro.
15572
15573         * mpn/x86/k6/aorsmul_1.asm: New file.
15574         * mpn/x86/k6/addmul_1.S: Removed (was a copy of pentium version).
15575         * mpn/x86/k6/submul_1.S: Removed (was a copy of pentium version).
15576
15577         * mpn/x86/p6/aorsmul_1.asm: Use OPERATION_addmul_1 and
15578         OPERATION_submul_1.
15579         * mpn/x86/k6/aors_n.asm: Use OPERATION_add_n and OPERATION_sub_n.
15580         * configure.in: Declare multi-function files for k6 and p6.
15581
15582         * configure.in: Add HAVE_TARGET_CPU_$target_cpu for config.m4.
15583         * mpn/asm-defs.m4 (define_not_for_expansion): New macro.
15584
15585         * mpn/generic/divrem_1n.c (__gmpn_divrem_1n): New file, split from
15586         mpn/generic/divrem_1.c.
15587         * mpn/generic/divrem_1.c: Ditto.
15588         * configure.in (gmp_mpn_functions): Ditto.
15589
15590 2000-02-21  Torbjorn Granlund  <tege@swox.com>
15591
15592         * gmp.h: Undo 1996-10-06 NeXT change, it was clearly improperly
15593         written.
15594
15595 2000-02-21  Linus Nordberg  <linus@swox.se>
15596
15597         * configure.in: Link <src>/mpn/asm-defs.m4 to <build>mpn/asm.m4.
15598         * configure: Regenerate.
15599
15600 2000-02-21  Linus Nordberg  <linus@swox.se>
15601
15602         * mpn/x86/k7/aorsmul_1.asm: Change OPERATION_ADDMUL -->
15603         OPERATION_addmul_1.  Change OPERATION_SUBMUL -->
15604         OPERATION_submul_1.
15605
15606         * mpn/x86/k7/aors_n.asm: Change OPERATION_ADD --> OPERATION_add_n.
15607         Change OPERATION_SUB --> OPERATION_sub_n.
15608
15609         * mpn/Makefile.am: Pass -DOPERATION_$* to preprocessors.
15610         * mpn/Makefile.in: Regenerate.
15611
15612         * configure.in: Symlink mpn/asm-defs.m4 to build-dir/mpn.  Link
15613         multi-function files to mpn/<function>.asm and remove function
15614         name from `gmp_mpn_functions'.
15615         * configure: Regenerate.
15616
15617         * acinclude.m4 (GMP_FINISH): Tell user what we're doing.
15618         * aclocal.m4: Regenerate.
15619
15620 2000-02-21  Kevin Ryde  <kevin@swox.se>
15621
15622         * gmp-impl.h: Rename __gmpn_mul_basecase to mpn_mul_basecase and
15623         __gmpn_sqr_basecase to mpn_sqr_basecase, remove __gmpn prototypes.
15624         * mpn/x86/mul_basecase.S: Ditto.
15625         * mpn/x86/pentium/mul_basecase.S: Ditto.
15626
15627         * configure.in (gmp_m4postinc): Use x86-defs.m4 on athlon-*-* too.
15628
15629 2000-02-20  Kevin Ryde  <kevin@swox.se>
15630
15631         * acinclude.m4 (GSYM_PREFIX): Drop $1, change by Linus.
15632         * mpn/asm-defs.m4 (PROLOGUE,EPILOGUE): Use GSYM_PREFIX as a
15633         string, change by Linus.
15634         * mpn/x86/x86-defs.m4: Use GSYM_PREFIX as a string.
15635
15636         * mpn/x86/k6/gmp-mparam.h: New file.
15637         * mpn/asm-defs.m4 (m4_warning): New macro.
15638
15639         * mpn/x86/README: Amendments per new code and directories.
15640         * mpn/x86/README.family: New file.
15641         * mpn/x86/k6/README: New file.
15642         * mpn/x86/k7/README: New file.
15643
15644         * mpn/generic/mul_n.c: Rename __gmpn_mul_basecase to
15645         mpn_mul_basecase and __gmpn_sqr_basecase to mpn_sqr_basecase.
15646         * mpn/generic/mul_basecase.c: Ditto.
15647         * mpn/generic/sqr_basecase.c: Ditto.
15648         * mpn/generic/mul.c: Ditto.
15649
15650 2000-02-19  Linus Nordberg  <linus@swox.se>
15651
15652         * configure.in: Don't try to symlink more than one multi-func
15653         file.
15654         * configure: Regenerate.
15655
15656 2000-02-18  Linus Nordberg  <linus@swox.se>
15657
15658         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): GMP_DEFINE
15659         `GSYM_PREFIX'.  Run ACTIONs even when value is found in cache.
15660         (GMP_CHECK_ASM_ALIGN_LOG): GMP_DEFINE `ALIGN'.  Run ACTIONs even
15661         when value is found in cache.
15662         * aclocal.m4: Regenerate.
15663
15664         * configure.in: Don't define GSYM_PREFIX or ALIGN.
15665         Add mechanism for multi-function files.
15666         * configure: Regenerate.
15667
15668 2000-02-18  Kevin Ryde  <kevin@swox.se>
15669
15670         * configure.in (gmp_m4postinc): Enable x86-defs.m4.
15671         * mpn/x86/k7/mul_1.asm: Fix include.
15672         * mpn/x86/k6/mul_basecase.S: Removed (copy of the pentium version).
15673         * mpn/x86/k6/mul_basecase.asm: New file.
15674         * mpn/x86/k6/sqr_basecase.asm: New file.
15675         * mpn/x86/k6/com_n.asm: New file.
15676         * mpn/x86/k6/copyi.asm: New file.
15677         * gmp.texi (Low-level Functions): Clarify mpn overlaps permitted.
15678         * gmp-impl.h (MPN_OVERLAP_P): New macro.
15679         * gmp-impl.h (assert_nocarry): New macro.
15680         * mpn/tests/ref.c: New file, based in part on other mpn/tests/*.c.
15681         * mpn/tests/ref.h: New file.
15682
15683 2000-02-17  Linus Nordberg  <linus@swox.se>
15684
15685         * Makefile.am (dist-hook): Don't include any emacs backup files
15686         (*.~*) in dist.
15687         * Makefile.in: Regenerate.
15688
15689 2000-02-17  Torbjorn Granlund  <tege@swox.com>
15690
15691         * mpn/sparc32/v9/mul_1.asm: Use `rd' to get current PC; get rid of
15692         getpc function.
15693         * mpn/sparc32/v9/addmul_1.asm: Likewise.
15694         * mpn/sparc32/v9/submul_1.asm: Likewise.
15695
15696 2000-02-17  Kevin Ryde  <kevin@swox.se>
15697
15698         * gmp.h: Add prototypes and defines for mpn_and_n, mpn_andn_n,
15699         mpn_com_n, mpn_copyd, mpn_copyi, mpn_ior_n, mpn_iorn_n,
15700         mpn_mul_basecase, mpn_nand_n, mpn_nior_n, mpn_sqr_basecase,
15701         mpn_xor_n, mpn_xorn_n.
15702
15703         * mpn/asm-defs.m4: Many additions making up initial version.
15704         * mpn/asm-defs.m4 (L): Use defn(`LSYM_PREFIX').
15705         * mpn/x86/x86-defs.m4: New file.
15706         * mpn/x86/k6/aors_n.asm: New file.
15707         * mpn/x86/k6/divmod_1.asm: New file.
15708         * mpn/x86/k6/divrem_1.asm: New file.
15709         * mpn/x86/k6/lshift.S: Removed (was a copy of the pentium version).
15710         * mpn/x86/k6/lshift.asm: New file.
15711         * mpn/x86/k6/mod_1.asm: New file.
15712         * mpn/x86/k6/mul_1.S: Removed (was a copy of the pentium version).
15713         * mpn/x86/k6/mul_1.asm: New file.
15714         * mpn/x86/k6/rshift.S: Removed (was a copy of the pentium version).
15715         * mpn/x86/k6/rshift.asm: New file.
15716         * mpn/x86/k7/aors_n.asm: New file.
15717         * mpn/x86/k7/aorsmul_1.asm: New file.
15718         * mpn/x86/k7/mul_1.asm: New file.
15719         * mpn/x86/k7/rshift.asm: New file.
15720         * mpn/x86/p6/aorsmul_1.asm: New file.
15721         * mpn/x86/copyi.asm: New file.
15722         * mpn/x86/copyd.asm: New file.
15723         * mpn/lisp/gmpasm-mode.el: New file.
15724
15725 2000-02-16  Torbjorn Granlund  <tege@swox.com>
15726
15727         * mpn/sparc32/v9/mul_1.asm: Conditionalize for PIC.
15728         * mpn/sparc32/v9/addmul_1.asm: Likewise.
15729         * mpn/sparc32/v9/submul_1.asm: Likewise.
15730         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
15731         * mpn/sparc32/udiv_fp.asm: Likewise.
15732
15733 2000-02-16  Linus Nordberg  <linus@swox.se>
15734
15735         * configure.in: Add mechanism for including target specific
15736         m4-files in config.m4.
15737         * configure: Regenerate.
15738
15739         * acinclude.m4 (GMP_PROG_CCAS): Begin assembly lines (except
15740         labels) with a tab character.  HP-UX demands it.
15741         (GMP_CHECK_ASM_SIZE): Ditto.
15742         (GMP_CHECK_ASM_LSYM_PREFIX): Ditto.
15743         (GMP_CHECK_ASM_LABEL_SUFFIX): Set to empty string for HP-UX.
15744         (GMP_CHECK_ASM_GLOBL): Change `.xport' --> `.export'.
15745         * aclocal.m4: Regenerate.
15746
15747 2000-02-16  Linus Nordberg  <linus@swox.se>
15748
15749         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Define LSYM_PREFIX as
15750         the prefix only, no argument.
15751         * aclocal.m4: Regenerate.
15752         * configure: Regenerate.
15753
15754         * mpn/asm-defs.m4 (L): No argument to LSYM_PREFIX.
15755
15756 2000-02-15  Linus Nordberg  <linus@swox.se>
15757
15758         * acinclude.m4: Prefix all temporary shell variables with
15759         `gmp_tmp_'.
15760         (GMP_PROG_CC_FIND): Use defaults if no arguments are passed.
15761         Quote use of arguments.
15762         (GMP_PROG_CCAS): New macro.
15763         (GMP_INIT): New macro.
15764         (GMP_FINISH): New macro.
15765         (GMP_INCLUDE): New macro.
15766         (GMP_SINCLUDE): New macro.
15767         (GMP_DEFINE): New macro.
15768         (GMP_CHECK_ASM_LABEL_SUFFIX): New macro.
15769         (GMP_CHECK_ASM_TEXT): New macro.
15770         (GMP_CHECK_ASM_DATA): New macro.
15771         (GMP_CHECK_ASM_GLOBL): New macro.
15772         (GMP_CHECK_ASM_TYPE): New macro.
15773         (GMP_CHECK_ASM_SIZE): New macro.
15774         (GMP_CHECK_ASM_LSYM_PREFIX): New macro.
15775         (GMP_CHECK_ASM_W32): New macro.
15776         * aclocal.m4: Regenerate.
15777
15778         * configure.in: Find m4 and nm for target.
15779         Use new macros to create config.m4.
15780         Prefix all temporary shell variables with `tmp_'.
15781         Pass `-X 64' to nm for 64-bit PPC target with 64-bit compiler.
15782         * configure: Regenerate.
15783
15784         * Makefile.am (dist-hook): *Really* remove all CVS dirs in
15785         dist.
15786         * Makefile.in: Regenerate.
15787
15788         * mpn/Makefile.am: Add target for building .lo and .o from
15789         .asm.
15790         Pass -DPIC to preprocessor (CPP/m4) when building .lo.
15791         Build .o a second time for target .lo, without -DPIC to
15792         preprocessor.
15793         (SUFFIX): Add `.asm'.
15794         (EXTRA_DIST): Add asm-defs.m4.
15795         * mpn/Makefile.in: Regenerate.
15796
15797         * mpf/Makefile.in: Regenerate.
15798         * mpf/tests/Makefile.in: Regenerate.
15799         * mpq/Makefile.in: Regenerate.
15800         * mpq/tests/Makefile.in: Regenerate.
15801         * mpz/Makefile.in: Regenerate.
15802         * mpz/tests/Makefile.in: Regenerate.
15803
15804 2000-02-15  Torbjorn Granlund  <tege@swox.com>
15805
15806         * mpn/sparc32/udiv_fp.asm: Change `RODATA' to `DATA'.
15807         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
15808         * mpn/sparc32/v9/addmul_1.asm: Likewise.
15809         * mpn/sparc32/v9/submul_1.asm: Likewise.
15810         * mpn/sparc32/v9/mul_1.asm: Likewise.
15811
15812         * mpn/sparc32/add_n.asm: Rename `size' -> `n'.
15813         * mpn/sparc32/sub_n.asm: Likewise.
15814
15815         * sparc32: Rename `.s' and `.S' files to `.asm'.
15816         * sparc64: Rename `.s' and `.S' files to `.asm'.
15817
15818 2000-02-11  Torbjorn Granlund  <tege@swox.com>
15819
15820         * config.sub: Adopt to new config.guess sparc naming conventions.
15821
15822         * config.guess (sun4u:SunOS:5.*:*): Change `sparc9' to `sparcv9'.
15823         * config.guess (sun4m:SunOS:5.*:*): Change to sun4[md]:SunOS:5.*:* and
15824         change `sparc8' to `sparcv8'.
15825
15826         * mpn/x86/add_n.S: Use PROLOGUE/EPILOGUE.
15827         * mpn/x86/sub_n.S: Likewise.
15828
15829         * mpn/x86/syntax.h (PROLOGUE): New name for PROLOG.
15830         * mpn/x86/syntax.h (EPILOGUE): New name for EPILOG.
15831
15832 2000-02-11  Linus Nordberg  <linus@swox.se>
15833
15834         * configure.in: Better path for 64-bit sparc without 64-bit cc.
15835         Change sparc8 --> sparcv8.
15836         Change sparc9 --> sparcv9.
15837         * configure: Regenerate.
15838
15839 2000-02-10  Linus Nordberg  <linus@swox.se>
15840
15841         * configure.in: Use Autoconf.
15842         * Makefile.am: New file.
15843
15844         * AUTHORS: New file.
15845         * COPYING: New file.
15846         * acinclude.m4: New file.
15847         * acconfig.h: New file.
15848
15849         * configure: Generate.
15850         * Makefile.in: Generate.
15851         * aclocal.m4: Generate.
15852         * config.in: Generate.
15853
15854         * install.sh: Remove.
15855         * install-sh: New file from Automake.
15856         * missing: New file from Automake.
15857         * ltconfig: New file from Libtool.
15858         * ltmain.sh: New file from Libtool.
15859
15860         * mpf/Makefile.am: New file.
15861         * mpf/Makefile.in: Generate.
15862         * mpf/configure.in: Remove.
15863         * mpf/tests/Makefile.am: New file.
15864         * mpf/tests/Makefile.in: Generate.
15865         * mpf/tests/configure.in: Remove.
15866
15867         * mpn/Makefile.am: New file.
15868         * mpn/Makefile.in: Generate.
15869         * mpn/configure.in: Remove.
15870
15871         * mpq/Makefile.am: New file.
15872         * mpq/Makefile.in: Generate.
15873         * mpq/configure.in: Remove.
15874         * mpq/tests/Makefile.am: New file.
15875         * mpq/tests/Makefile.in: Generate.
15876         * mpq/tests/configure.in: Remove.
15877
15878         * mpz/Makefile.am: New file.
15879         * mpz/Makefile.in: Generate.
15880         * mpz/configure.in: Remove.
15881         * mpz/tests/Makefile.am: New file.
15882         * mpz/tests/Makefile.in: Generate.
15883         * mpz/tests/configure.in: Remove.
15884
15885 2000-02-10  Torbjorn Granlund  <tege@swox.com>
15886
15887         * mpn/x86/add_n.S: Don't use label L0 twice.
15888         * mpn/x86/sub_n.S: Likewise.
15889
15890 2000-01-20  Linus Nordberg  <linus@swox.se>
15891
15892         * demos/pexpr.c: Don't use setup_error_handler() in windoze.
15893
15894 2000-01-19  Torbjorn Granlund  <tege@swox.com>
15895
15896         * demos/pexpr.c (sigaltstack): #define to sigstack for AIX.
15897         (setup_error_handler): Don't write to ss_size and ss_flags
15898         on AIX.
15899
15900 2000-01-11  Torbjorn Granlund  <tege@swox.com>
15901
15902         * mpn/configure.in (hppa2.0*-*-*): Move assignment of
15903         target_makefile_frag to where it belongs.
15904
15905 1999-12-21  Torbjorn Granlund  <tege@swox.com>
15906
15907         * longlong.h (v9 umul_ppmm): New #define.
15908         (v9 udiv_qrnnd): New #define.
15909
15910 1999-12-14  Torbjorn Granlund  <tege@swox.com>
15911
15912         * mpn/generic/divmod_1.c: Use invert_limb.
15913         * mpn/generic/mod_1.c: Use invert_limb.
15914
15915         * gmp-impl.h (invert_limb): Put definition here.
15916         * mpn/generic/divrem.c (invert_limb): Delete definition.
15917         * mpn/generic/divrem_2.c (invert_limb): Delete definition.
15918
15919         * gmp.h (mpn_divrem): Inhibit for non-gcc.
15920         But declare (undo 1999-11-22 change).
15921
15922         * gmp-impl.h (DItype,UDItype): Do these also if _LONG_LONG_LIMB.
15923
15924         * longlong.h: Move 64-bit hppa code out of __GNUC__ conditional.
15925
15926         * stack-alloc.c (HSIZ): New #define.
15927         (__tmp_alloc): Use HSIZ instead of sizeof(tmp_stack).
15928
15929 1999-12-10  Torbjorn Granlund  <tege@swox.com>
15930
15931         * config.sub: Clean up handling of x86 CPUs: Properly recognize
15932         Amd CPUs as unique entities.  Use manufacturer's names of
15933         processors ("pentium", etc); still match ambiguous names like
15934         "i586", "i686", "p6" but be conservative in interpreting them.
15935
15936         * configure.in: Recognize x86 CPU types known by config.guess.
15937         * mpn/configure.in: Likewise.  Add x86/mmx path component as
15938         appropriate.
15939         (athlon-*-*): Fix typo.
15940
15941         * config.guess: Update x86 recog code to intiallly match
15942         more than just i386.
15943         Call K6-2 and K6-III for "k62" and "k63" respectively.
15944
15945         * config.guess: Recognize x86 CPU types.
15946         Update code for FreeBSD, NetBSD, OpenBSD, Linux.
15947
15948 1999-12-08  Torbjorn Granlund  <tege@swox.com>
15949
15950         * mpf/pow_ui.c: Avoid final squaring in loop.
15951
15952 1999-12-07  Torbjorn Granlund  <tege@swox.com>
15953
15954         * gmp-impl.h (udiv_qrnnd_preinv2gen): Prefix local variables with `_'.
15955         (udiv_qrnnd_preinv2norm): Likewise.
15956         From Kevin Ryde:
15957         (HAVE_ALLOCA): #define also if defined (alloca).
15958
15959 1999-12-04  Torbjorn Granlund  <tege@swox.com>
15960
15961         * mpn/tests/add_n.c: Set OPS from CLOCK.
15962         * mpn/tests/sub_n.c: Likewise.
15963         * mpn/tests/mul_1.c: Likewise.
15964         * mpn/tests/addmul_1.c: Likewise.
15965         * mpn/tests/submul_1.c: Likewise.
15966
15967         * mpn/tests/lshift.c: Update from add_n.c.
15968         * mpn/tests/rshift.c: Likewise.
15969
15970 1999-12-03  Torbjorn Granlund  <tege@swox.com>
15971
15972         * mpn/powerpc64/copy.S: New file.
15973
15974 1999-12-02  Torbjorn Granlund  <tege@swox.com>
15975
15976         * mpn/sparc64/copy.s: New file.
15977
15978         * mpn/tests/copy.c: New file.
15979
15980         * mpn/configure.in: Recognize more Amd CPUs; Set special paths for
15981         k7 CPU.
15982
15983         * configure.in: Recognize Amd x86 CPUs.
15984
15985         * mpz/fdiv_r_2exp.c: In rounding code, read in->_mp_size before
15986         writing to res->_mp_size.
15987
15988         * mpn/powerpc64/*.S: Clean up assembly syntax, add function headers.
15989         * mpn/powerpc64/gmp-mparam.h: (KARATSUBA_MUL_THRESHOLD): #define.
15990         (KARATSUBA_SQR_THRESHOLD): #define.
15991
15992         * mpn/tests/add_n.c (main): Only print test number if TIMES==1
15993         and not printing.
15994         (main): Don't run reference code if NOCHECK.
15995         * mpn/tests/sub_n.c: Likewise.
15996         * mpn/tests/mul_1.c: Likewise.
15997         * mpn/tests/addmul_1.c: Likewise.
15998         * mpn/tests/submul_1.c: Likewise.
15999
16000         * mpn/tests/lshift.c: (main): Only print test number if TIMES==1
16001         and not printing.
16002         * mpn/tests/rshift.c: Likewise.
16003
16004 1999-11-22  Torbjorn Granlund  <tege@swox.com>
16005
16006         * gmp.h (mpz_init_set_str): Declare using __gmp_const.
16007         (mpz_set_str): Likewise.
16008         (mpf_init_set_str): Likewise.
16009         (mpf_set_str): Likewise.
16010         (mpn_set_str): Likewise.
16011         (__gmp_0): Likewise.
16012         (mpn_divrem): Remove separate declaration; it's defined later in
16013         this file.
16014
16015         * gmp.h: Replace "defined (__STD__)' by (__STDC__-0) in
16016         expressions involving more than one term, to handle Sun's compiler
16017         that most helpfully sets __STDC__ to 0.
16018         * gmp-impl.h: Likewise.
16019         * longlong.h: Likewise.
16020
16021 1999-11-21  Torbjorn Granlund  <tege@swox.com>
16022
16023         * mpn/sparc64/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
16024         (KARATSUBA_SQR_THRESHOLD): #define.
16025
16026         * mpn/sparc64/lshift.s: Compensate stack references for odd stack ptr.
16027         * mpn/sparc64/rshift.s: Likewise.
16028
16029         * mpn/sparc64/addmul_1.s: Propagate carry properly.
16030         * mpn/sparc64/submul_1.s: Likewise.
16031
16032         * mpn/sparc64/sub_n.s: Rewrite.
16033
16034         * mpn/sparc64/sub_n.s: Get operand order for main subcc right
16035         (before scrapping this code for new code).
16036
16037 1999-11-20  Torbjorn Granlund  <tege@swox.com>
16038
16039         * mpn/sparc64/add_n.s: Rewrite.
16040
16041 1999-11-17  Torbjorn Granlund  <tege@swox.com>
16042
16043         * mpn/x86/syntax.h (PROLOG): New #define.
16044         (EPILOG): New #define.
16045
16046         * gmp.h (mpn_addsub_n): Declare.
16047         * gmp.h (mpn_add_nc): Declare.
16048         * gmp.h (mpn_sub_nc): Declare.
16049         * mpn/powerpc64/addsub_n.S: New file.
16050
16051 1999-11-17  Torbjorn Granlund  <tege@swox.com>
16052
16053         * mpn/alpha/gmp-mparam.h
16054         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
16055         (KARATSUBA_SQR_THRESHOLD): Likewise.
16056
16057 1999-11-14  Torbjorn Granlund  <tege@swox.com>
16058
16059         * mpn/x86/mul_1.S: Unroll and optimize for P6 and K7.
16060
16061 1999-11-09  Torbjorn Granlund  <tege@swox.com>
16062
16063         * mpn/x86/p6/gmp-mparam.h
16064         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
16065         (KARATSUBA_SQR_THRESHOLD): Likewise.
16066
16067 1999-11-05  Torbjorn Granlund  <tege@swox.com>
16068
16069         * mpn/generic/addsub_n.c: New file.
16070
16071 1999-11-02  Torbjorn Granlund  <tege@swox.com>
16072
16073         * config.guess: Handle alpha:FreeBSD with alpha:NetBSD.
16074
16075         * configure.in (vax*-*-*): New case.
16076         * config/mt-vax: New file.
16077         * mpn/vax/add_n.s: Rewrite.
16078         * mpn/vax/sub_n.s: Rewrite.
16079
16080 1999-10-31  Torbjorn Granlund  <tege@swox.com>
16081
16082         * mpn/vax/rshift.s: New file.
16083         * mpn/vax/lshift.s: New file.
16084
16085 1999-10-29  Torbjorn Granlund  <tege@swox.com>
16086
16087         * config.sub: Handle k5 and k6.
16088         * mpn/configure.in: Recognize k6.
16089
16090         * mpf/tests/t-get_d.c (LOW_BOUND, HIGH_BOUND): New #defines.
16091         (main): Tighten error bounds to 14 digits.
16092
16093         * longlong.h (default umul_ppmm, when smul_ppmm exists):
16094         Rename __m0 => __xm0, __m1 => __xm1.
16095         (default smul_ppmm): Likewise.
16096
16097 1999-10-11  Torbjorn Granlund  <tege@swox.com>
16098
16099         * config.guess: Reverse the test for POWER vs PowerPC.
16100         * config.guess (sun4m:SunOS:5.*:*): New case.
16101         * config.guess (sun4u:SunOS:5.*:*): New case.
16102
16103 1999-09-29  Torbjorn Granlund  <tege@swox.com>
16104
16105         * mpn/generic/divrem_2.c: Clean up comments.
16106
16107 1999-09-23  Torbjorn Granlund  <tege@swox.com>
16108
16109         * mpz/tests/Makefile.in: Use move-if-change when generating binaries.
16110         * mpf/tests/Makefile.in: Likewise.
16111         * mpq/tests/Makefile.in: Likewise.
16112         * mpz/tests/move-if-change: New file.
16113         * mpf/tests/move-if-change: New file.
16114         * mpq/tests/move-if-change: New file.
16115
16116         * gmp.h (mpn_incr_u): New macro (from mpn/generic/mul_n.c).
16117         (mpn_decr_u): New macro.
16118
16119         * mpn/generic/mul_n.c (mpn_incr): Delete.
16120         * mpn/generic/mul_n.c: Update usages mpn_incr => mpn_incr_u.
16121         * mpn/generic/divrem_newt.c: Use mpn_incr_u and mpn_decr_u instead of
16122         mpn_add_1 and mpn_sub_1.
16123         * mpn/generic/sqrtrem.c: Likewise.
16124         * mpz/cdiv_q_ui.c: Likewise.
16125         * mpz/cdiv_qr_ui.c: Likewise.
16126         * mpz/fdiv_q_ui.c: Likewise.
16127         * mpz/fdiv_qr_ui.c: Likewise.
16128
16129         * mpn/generic/sqrtrem.c: Start single-limb Newton iteration from 18
16130         bits.
16131
16132 1999-07-27  Torbjorn Granlund  <tege@swox.com>
16133
16134         * mpn/generic/divrem_1.c (__gmpn_divrem_1n): New function.
16135
16136         * mpn/generic/divrem_2.c: New file, code from divrem.c, `case 2:'.
16137         * mpn/Makefile.in: Compile divrem_2.c.
16138         * make.bat: Compile divrem_2.c.
16139         * mpn/configure.in (functions): Add divrem_2.
16140         * gmp.h: Declare mpn_divrem_2.
16141
16142         * mpn/generic/divrem.c: Delete special cases, handle just divisors
16143         of more than 2 limbs.
16144         * gmp.h (mpn_divrem): Call mpn_divrem_1, mpn_divrem_2, as appropriate.
16145
16146         * mpn/generic/divrem.c: Rework variable usage for better register
16147         allocation.
16148
16149 1999-07-26  Torbjorn Granlund  <tege@swox.com>
16150
16151         * mpn/alpha/ev5/add_n.s: Rewrite for better ev6 speed.
16152         * mpn/alpha/ev5/sub_n.s: Likewise.
16153
16154 1999-07-21  Torbjorn Granlund  <tege@swox.com>
16155
16156         * longlong.h (alpha): Define umul_ppmm for cc.
16157
16158         * gmp-impl.h (DItype, UDItype): Define for non-gcc if _LONGLONG is
16159         defined.
16160
16161 1999-07-15  Torbjorn Granlund  <tege@swox.com>
16162
16163         * longlong.h (powerpc64 count_leading_zeros): Fix typo.
16164         (powerpc64 add_ssaaaa): Fix typos.
16165         (powerpc64 sub_ddmmss): Fix typos.
16166
16167 1999-07-14  Torbjorn Granlund  <tege@swox.com>
16168
16169         * mpz/tests/Makefile.in: Pass XCFLAGS when linking.
16170         * mpf/tests/Makefile.in: Likewise.
16171         * mpq/tests/Makefile.in: Likewise.
16172         * mpn/Makefile.in (.S.o): Pass XCFLAGS.
16173
16174         * longlong.h: Add support for 64-bit PowerPC.
16175         * config.sub: Handle "powerpc64".
16176         * configure.in: Likewise.
16177         * mpn/configure.in: Suppress use of config/t-ppc-aix for now,
16178         it seems compiler passes proper options.
16179         * mpn/powerpc64/*.S: New files.
16180
16181         * Makefile.in (FLAGS_TO_PASS): Pass "AR=$(AR)".
16182
16183 1999-07-07  Torbjorn Granlund  <tege@swox.com>
16184
16185         * demos/pexpr.c (factor): Change alloca call to a malloc/free pair.
16186
16187         * mpn/powerpc32/syntax.h: Add #define's for crN.
16188
16189         * gmp.h (gmp_rand_algorithm): Remove spurious `,'.
16190
16191 1999-07-05  Torbjorn Granlund  <tege@swox.com>
16192
16193         * mpn/generic/divrem_1.c: Normalize divisor when needed.
16194
16195 1999-07-02  Torbjorn Granlund  <tege@swox.com>
16196
16197         * mpn/configure.in (powerpc*-apple-mach): New configuration.
16198         * mpn/powerpc32/*: Add support for apple-macho syntax.
16199         * mpn/powerpc32/syntax.h: New file.
16200         * gmp-impl.h: Don't use `__attribute__' syntax for Apple's perversion
16201         of GCC.
16202
16203 1999-05-26  Linus Nordberg  <linus@swox.se>
16204
16205         * rand.c (gmp_rand_init): Fix typo.
16206
16207         * mpn/generic/rawrandom.c (mpn_rawrandom): Count bits, not limbs,
16208         to keep track of how many rounds to do in loop.  Clean up
16209         temporary allocation.  Update `seedsize' inside loop.  Mask off
16210         the correct number of bits from final result.  Init `mcopyp' even
16211         when not normalizing `m'.
16212
16213         * randlc.c (gmp_rand_init_lc): Fix typo (don't call
16214         mpz_init_set_ui()).
16215
16216         * mpn/generic/rawrandom.c (mpn_rawrandom): Set SIZ(s->seed) when
16217         reallocating.
16218
16219         * tests/rand/Makefile (test, bigtest): Add 33-bit tests.
16220
16221         * tests/rand/gen.c (main): Set precision of variable passed to
16222         mpf_urandomb().  Add option `-p'.
16223
16224 1999-05-25  Linus Nordberg  <linus@swox.se>
16225
16226         * randcm.c: Remove.
16227         * randcmui.c: Remove.
16228         * Makefile.in: Remove randcm and randcmui.
16229         * make.bat: Ditto.
16230         * gmp-impl.h: Remove prototypes for __gmp_rand_init_common() and
16231         __gmp_rand_init_common_ui().
16232         * randlc.c (gmp_rand_init_lc): Don't call
16233         __gmp_rand_init_common().
16234
16235         * randlcui.c (gmp_rand_init_lc_ui): Don't call
16236         __gmp_rand_init_common_ui().
16237
16238         * gmp.h (__gmp_rand_state_struct): Remove unused member `maxval'.
16239         * randclr.c (gmp_rand_clear): Remove reference to s->maxval.
16240         * randcm.c (__gmp_rand_init_common): Ditto
16241
16242         * mpn/generic/rawrandom.c (mpn_rawrandom): Don't calculate nlimbs
16243         twice.
16244
16245         * gmp.h (__gmp_rand_dist): Remove.
16246
16247 1999-05-24  Linus Nordberg  <linus@swox.se>
16248
16249         * mpn/generic/rawrandom.c: Clean up comments.
16250
16251         * gmp.texi: Add documentation for random number generation.
16252
16253 1999-05-21  Linus Nordberg  <linus@swox.se>
16254
16255         * gmp.h: Typedef `gmp_rand_state' as an array with one element.
16256         Change prototypes accordingly.
16257         * gmp-impl.h: Change prototypes using `gmp_rand_state'.
16258         * rand.c (gmp_rand_init): Take `gmp_rand_state' as argument
16259         instead of a pointer to a `gmp_rand_state'.
16260         * mpf/urandom.c (mpf_urandomb): Ditto.
16261         * mpz/urandom.c (mpz_urandomb): Ditto.
16262         * mpn/generic/rawrandom.c (mpn_rawrandom): Ditto.
16263         * randcmui.c (__gmp_rand_init_common_ui): Ditto.
16264         * randlc.c (gmp_rand_init_lc): Ditto.
16265         * randlcui.c (gmp_rand_init_lc_ui): Ditto.
16266         * randui.c (gmp_rand_init_ui): Ditto.
16267         * randcm.c (__gmp_rand_init_common): Ditto.
16268         * randclr.c (gmp_rand_clear): Ditto.
16269
16270         * tests/rand/gen.c (main): Pass `s' to rand-funcs instead of address
16271         of `s'.
16272
16273 1999-05-20  Linus Nordberg  <linus@swox.se>
16274
16275         * Makefile.in: Rename randi.c --> rand.c, randi_lc.c --> randlc.c,
16276         randicom.c --> randcm.c.  Add randui.c, randcmui.c, randlcui.c.
16277         * make.bat: Ditto.
16278
16279         * gmp.h: Add prototypes for gmp_rand_init_ui() and
16280         gmp_rand_init_lc_ui().
16281         * gmp-impl.h: Add prototypes for __gmp_rand_init_common() and
16282         __gmp_rand_init_common_ui().
16283
16284         * randlc.c, randcm.c, randclr.c, rand.c: Change #include of
16285         <gmp.h> to "gmp.h".
16286         * randclr.c: Include stdlib.h for free().
16287         * rand.c: Include gmp-impl.h.
16288
16289 1999-05-12  Torbjorn Granlund  <tege@swox.com>
16290
16291         * mpn/configure.in: Put generic m68k alternative last.
16292
16293 1999-05-04  Torbjorn Granlund  <tege@swox.com>
16294
16295         * demos/pexpr.c (setup_error_handler): Use sigemptyset to create
16296         empty set (for portability).
16297         (fns): Fix typo '#if #if'.
16298         (mpz_eval_expr): Implement FERMAT and MERSENNE.
16299
16300         * demos/pexpr.c: Cast longjmp argument via long to silent warnings on
16301         64-bit hosts.
16302
16303 1999-05-03  Torbjorn Granlund  <tege@swox.com>
16304
16305         * demos/pexpr.c: Add #defines for GMP 1.x and 2.0 compatibility.
16306
16307         * demos/pexpr.c (setup_error_handler): New function; take signal
16308         handler setup code from main(), with major modifications to use modern
16309         signal interface.
16310         (main): Remove signal handler setup code; call setup_error_handler.
16311
16312 1999-04-29  Linus Nordberg  <linus@swox.se>
16313
16314         * tests/rand/findcl.c (main): Add option '-i' for interval factor.
16315         Separate v and merit lose figures.  Add '-v' for version.
16316
16317 1999-04-28  Linus Nordberg  <linus@swox.se>
16318
16319         * tests/rand/statlib.c: Change debugging stuff.
16320
16321         * tests/rand/gmpstat.h: Add debug values definitions.
16322
16323         * tests/rand/findcl.c (main): Print low and high merit on startup.
16324         Print version string on startup.  Catch SEGV and HUP.  Add option -d
16325         for debug.  Fix bug making test for v too hard.
16326         (sh_status): New function.
16327         (sh_status): Flush stdout.  Add RCSID.
16328
16329 1999-04-27  Linus Nordberg  <linus@swox.se>
16330
16331         * tests/rand/Makefile (clean): Add target.
16332
16333 1999-04-27  Linus Nordberg  <linus.nordberg@canit.se>
16334
16335         * tests/rand/stat.c: Include gmpstat.h.
16336         Add global int g_debug.
16337
16338         * tests/rand/spect.c: Include <unistd.h>.
16339
16340         * tests/rand/findcl.c (main): Input is `m', not all factors of `m'.
16341         Print only the very first matching multiplier.  Include <unistd.h>.
16342         Flush stdout.  Print "done." when done.
16343
16344         * tests/rand/spect.c: Move everything but main() to statlib.c.
16345
16346         * tests/rand/findcl.c: New file.
16347
16348         * tests/rand/gmpstat.h: New file.
16349
16350         * tests/rand/statlib.c (merit, merit_u, f_floor, vz_dot,
16351         spectral_test): New functions.
16352
16353 1999-04-27  Torbjorn Granlund  <tege@swox.com>
16354
16355         * mpn/configure.in: Fix typo, "sparc-*)" was "sparc)".
16356
16357 1999-04-21  Torbjorn Granlund  <tege@swox.com>
16358
16359         * config.sub: Recognize ev6.
16360
16361 1999-04-12  Linus Nordberg  <linus.nordberg@canit.se>
16362
16363         * urandom.c: Split up into randclr.c, randi.c, randi_lc.c,
16364         randicom.c.
16365         * randclr.c, randi.c, randi_lc.c, randicom.c: New files.
16366         * Makefile.in: Remove urandom.  Add randclr, randi, randi_lc,
16367         randicom.
16368         * make.bat: Ditto
16369
16370 1999-03-31  Torbjorn Granlund  <tege@matematik.su.se>
16371
16372         * configure.in (sparc9-*-solaris2.[789]*, etc): New alternative.
16373         * mpn/configure.in: Use mt-sprc9 also for ultrasparc*-*-solaris2*.
16374
16375 1999-03-30  Linus Nordberg  <linus.nordberg@canit.se>
16376
16377         * urandom.c (__gmp_rand_scheme): Change NULL->0.
16378         Include "gmp.h" instead of <gmp.h>.
16379
16380 1999-03-29  Linus Nordberg  <linus.nordberg@canit.se>
16381
16382         * gmp.h (__gmp_rand_data_lc): Now holds a, c, m instead of scheme
16383         struct.
16384         (__gmp_rand_lc_scheme_struct): Remove mpz_t's `a' and `m'.
16385
16386         * tests/rand/stat.c (f_freq): Don't print 2nd level results if doing
16387         1st level.
16388
16389         * tests/rand/gen.c (main): Set default algorithm to mpz_urandomb.
16390         (main): Add option -c.
16391
16392 1999-03-24  Linus Nordberg  <linus.nordberg@canit.se>
16393
16394         * tests/rand/Makefile (GMPINC): Rename to GMPH.
16395         (GMPH): Add gmp-mparam.h.
16396         (CFLAGS): Add -I$(GMPLIBDIR)/mpn
16397
16398 1999-03-23  Linus Nordberg  <linus.nordberg@canit.se>
16399
16400         * Makefile.in: Compile top-dir/urandom.c.
16401         * make.bat: Ditto.
16402
16403         * mpn/Makefile.in: Compile rawrandom.c.
16404         * make.bat: Ditto.
16405
16406         * mpn/configure.in (functions): Add rawrandom.
16407
16408         * gmp.h (__gmp_rand_scheme_struct): Rename to
16409         __gmp_rand_lc_scheme_struct.
16410         (__gmp_rand_data_lc): Remove member 'n'.  Allocate a
16411         __gmp_rand_lc_scheme_struct instead of a pointer to one.
16412         Add prototype for gmp_rand_init_lc(), mpn_rawrandom().
16413         New prototype for mpz_urandomb().
16414
16415         * urandom.c: New file.
16416         (__gmp_rand_init_common): New function.
16417         (gmp_rand_init_lc): New function.
16418         (gmp_rand_init): Don't init data_lc->n.  Call gmp_rand_init_lc()
16419         and __gmp_rand_init_common().
16420         (gmp_rand_clear): Remove reference to data_lc->n.
16421
16422         * mpz/urandom.c (gmp_rand_init, gmp_rand_clear): Move to new file
16423         urandom.c in top-dir.
16424         (mpz_urandomb): Add function parameter nbits.  Call mpn_rawrandom().
16425
16426         * mpf/urandom.c (mpf_urandomb): Call mpn_rawrandom().
16427
16428         * mpn/generic/rawrandom.c: New file.
16429         (mpn_rawrandom): New function.
16430
16431 1999-03-17  Torbjorn Granlund  <tege@matematik.su.se>
16432
16433         * extract-dbl.c: When packing result, adjust exp when sc == 0.
16434
16435         * mpf/tests/t-get_d.c: New file.
16436         * mpf/tests/Makefile.in: Compile t-get_d.c.
16437
16438 1999-03-16  Linus Nordberg  <linus.nordberg@canit.se>
16439
16440         * mpz/urandom.c (__gmp_rand_scheme): Add extra braces around the
16441         mpz_t members.
16442
16443         * make.bat: Compile mpz/urandom.c and mpf/urandom.c
16444
16445         * tests/rand/statlib.c (ks_table): Use mpf_pow_ui() and exp().
16446
16447         * tests/rand/gen.c: Include unistd.h for getopt.
16448
16449 1999-03-15  Linus Nordberg  <linus.nordberg@canit.se>
16450
16451         * mpz/urandom.c (gmp_rand_init): New function.
16452         (gmp_rand_clear): New function.
16453         (mpz_urandomb): New function.
16454
16455         * mpz/Makefile.in: Compile urandom.c
16456
16457         * mpf/urandom.c (mpf_urandomb): New function.
16458
16459         * mpf/Makefile.in: Compile urandom.c.
16460
16461         * gmp.h (__gmp_rand_state_struct, __gmp_rand_scheme_struct): New
16462         structs for randomization functions.
16463         (gmp_rand_dist, gmp_rand_alogrithm): New enums for randomization
16464         functions.
16465         (mpz_urandomb, mpf_urandomb): Add prototype.
16466         (gmp_rand_init, gmp_rand_clear): Add prototype.
16467
16468         * tests/rand/gen.c, stat.c, statlib.c, statlib.h: New files.
16469         * tests/rand/Makefile, tests/rand/ChangeLog: New files.
16470
16471 1999-03-15  Torbjorn Granlund  <tege@matematik.su.se>
16472
16473         * .gdbinit: New file.
16474
16475         * mpz/dump.c: New file.
16476         * mpz/Makefile.in: Compile dump.c.
16477         * make.bat: Likewise.
16478         * gmp.h (mpz_dump): Declare.
16479
16480 1999-03-14  Torbjorn Granlund  <tege@matematik.su.se>
16481
16482         * mpz/tests/reuse.c: Also test mpz_invert and mpz_divexact.
16483
16484         * mpz/tests/convert.c: Update to GMP 2 variable syntax.
16485
16486 1999-03-13  Torbjorn Granlund  <tege@matematik.su.se>
16487
16488         * mpf/README: New file.
16489         * mpz/README: New file.
16490
16491         * mpf/pow_ui.c: New file.
16492         * mpf/Makefile.in: Compile pow_ui.c.
16493         * make.bat: Likewise.
16494         * gmp.h (mpf_pow_ui): Declare.
16495
16496 1999-03-12  Torbjorn Granlund  <tege@matematik.su.se>
16497
16498         * mpn/configure.in: Stage 1 of rewrite.
16499         * mpn/underscore.h: New name for bsd.h.
16500         * mpn/sysv.h: Deleted.
16501
16502         * mpn/m68k/*: Don't include sysdep.h.
16503
16504         * mpn/pa64/README: New file.
16505
16506 1999-03-11  Torbjorn Granlund  <tege@matematik.su.se>
16507
16508         * mpn/powerpc32/add_n.S: Add support for both AIX and ELF syntax.
16509         Renamed from `.s'.
16510         * mpn/powerpc32/sub_n.S: Likewise.
16511         * mpn/powerpc32/lshift.S: Likewise.
16512         * mpn/powerpc32/rshift.S: Likewise.
16513         * mpn/powerpc32/mul_1.S: Likewise.
16514         * mpn/powerpc32/addmul_1.S: Likewise.
16515         * mpn/powerpc32/submul_1.S: Likewise.
16516
16517         * mpn/powerpc32/umul.S: New file.
16518         * mpn/sparc32/v8/umul.S: New file.
16519         * mpn/sparc32/umul.S: New file.
16520         * mpn/x86/umul.S: New file.
16521         * mpn/x86/udiv.S: New file.
16522
16523         * mpn/Makefile.in (mul_basecase.o): Delete rule.
16524
16525 1999-02-22  Torbjorn Granlund  <tege@matematik.su.se>
16526
16527         * configure.in (hppa2.0*-*-*): Force use of GCC.
16528
16529         * extract-dbl.c: Handle IEEE denormalized numbrs.  Clean up.
16530
16531 1998-12-02  Torbjorn Granlund  <tege@matematik.su.se>
16532
16533         * mpn/Makefile.in (CCAS): New macro.
16534         (.s.o): Use CCAS.
16535         (.S.o): Likewise.
16536
16537         * mpn/Makefile.in (mul_basecase.o): Add dependency.
16538         (sqr_basecase.o): Likewise.
16539         (mod_1.o): Likewise.
16540
16541         * demos/pexpr.c (cputime): Test also __hpux.
16542         (cleanup_and_exit): Check SIGXCPU only #ifdef LIMIT_RESOURCE_USAGE.
16543
16544         * mpz/tests/t-2exp.c: Use urandom, not random.
16545
16546         * mpn/configure.in (arm*-*-*): New alternative.
16547
16548 1998-11-30  Torbjorn Granlund  <tege@matematik.su.se>
16549
16550         * gmp-impl.h (union ieee_double_extract): Special case for
16551         little-endian arm.
16552         (LIMBS): Alias for PTR.
16553
16554 1998-11-26  Torbjorn Granlund  <tege@matematik.su.se>
16555
16556         * longlong.h (m68000 umul_ppmm): Use `muluw', not `mulu'.
16557         (m68k stuff): Clean up; add coldfire support.
16558
16559 1998-11-23  Torbjorn Granlund  <tege@matematik.su.se>
16560
16561         * mpn/mips3/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
16562         (KARATSUBA_SQR_THRESHOLD): #define.
16563
16564         * mpn/sparc32/v9/README: New file.
16565
16566 1998-11-20  Torbjorn Granlund  <tege@matematik.su.se>
16567
16568         * mpn/x86/README: New file.
16569
16570         * mpn/arm/gmp-mparam.h: New file.
16571         * mpn/pa64/gmp-mparam.h: New file.
16572         * mpn/hppa/gmp-mparam.h: New file.
16573         * mpn/x86/pentium/gmp-mparam.h: New file.
16574         * mpn/sparc32/v9/gmp-mparam.h: New file.
16575         * mpn/powerpc32/gmp-mparam.h: New file.
16576         * mpn/x86/p6/gmp-mparam.h: New file.
16577
16578         * mpn/alpha/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
16579         (KARATSUBA_SQR_THRESHOLD): #define.
16580
16581         * mpn/configure.in: Point to x86/p6 when appropriate.
16582
16583         * mpn/power/umul.s: New file.
16584         * mpn/power/sdiv.s: New file.
16585         * mpn/pa64/addmul_1.S: New file.
16586         * mpn/pa64/submul_1.S: New file.
16587         * mpn/pa64/mul_1.S: New file.
16588         * mpn/pa64/udiv_qrnnd.c: New file.
16589         * mpn/pa64/umul_ppmm.S: New file.
16590         * mpn/mips2/umul.s: New file.
16591         * mpn/m68k/mc68020/umul.s: New file.
16592         * mpn/m68k/mc68020/udiv.s: New file.
16593         * mpn/hppa/hppa1_1/umul.s: New file.
16594         * mpn/alpha/umul.s: New file.
16595         * mpn/a29k/udiv.s: New file.
16596         * mpn/a29k/umul.s: New file.
16597
16598 1998-11-17  Torbjorn Granlund  <tege@matematik.su.se>
16599
16600         * mpn/x86/mul_basecase.S: New file for non-pentiums.
16601         * mpn/x86/mul_basecase.S: Move to mpn/x86/pentium.
16602
16603 1998-11-16  Torbjorn Granlund  <tege@matematik.su.se>
16604
16605         * make.bat: Compile mul_basecase.c and sqr_basecase.c.
16606
16607 1998-11-10  Torbjorn Granlund  <tege@matematik.su.se>
16608
16609         * mpz/invert.c: Defer writing to parameter `invert' until
16610         end.
16611
16612 1998-11-03  Torbjorn Granlund  <tege@matematik.su.se>
16613
16614         * mpn/pa64/udiv_qrnnd.c: Handle more border cases.
16615
16616 1998-10-29  Torbjorn Granlund  <tege@matematik.su.se>
16617
16618         * insert-dbl.c: Special case biased exponents < 1; Get boundary for
16619         Inf right.
16620
16621         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB): New #define.
16622
16623 1998-10-28  Torbjorn Granlund  <tege@matematik.su.se>
16624
16625         * mpn/powerpc32/submul_1.s: Rewrite, optimizing for PPC604.
16626         * mpn/powerpc32/addmul_1.s: Likewise.
16627         * mpn/powerpc32/lshift.s: Likewise.
16628
16629 1998-10-23  Torbjorn Granlund  <tege@matematik.su.se>
16630
16631         * config/mt-sprc9-gcc (XCFLAGS): Add -Wa,-xarch=v8plus.
16632
16633         * mpn/sparc32/v9/submul_1.s: New file.
16634
16635 1998-10-21  Torbjorn Granlund  <tege@matematik.su.se>
16636
16637         * mpn/config/mt-pa2hpux: New file.
16638         * mpn/configure.in (hppa2.0*-*-*): Use new 64-bit code.
16639
16640         * config.sub: Recognize hppa2.0 as CPU type.
16641
16642         * longlong.h (64-bit hppa): Add umul_ppmm and udiv_qrnnd.
16643         * mpn/pa64/mul_1.S: New file.
16644         * mpn/pa64/addmul_1.S: New file.
16645         * mpn/pa64/submul_1.S: New file.
16646         * mpn/pa64/umul_ppmm.S: New file.
16647         * mpn/pa64/udiv_qrnnd.c: New file.
16648
16649 1998-10-20  Torbjorn Granlund  <tege@matematik.su.se>
16650
16651         * mpz/pprime_p.c: Pass 1L, not 1, to mpz_cmp_ui.
16652
16653         * mpz/fdiv_q_2exp.c: Cast `long' argument to `mp_limb_t' for mpn calls.
16654         * mpz/gcd_ui.c: Likewise.
16655         * mpz/add_ui.c: Likewise.
16656         * mpz/sub_ui.c: Likewise.
16657
16658 1998-10-19  Torbjorn Granlund  <tege@matematik.su.se>
16659
16660         * mpn/generic/bdivmod.c: Avoid using switch statement with mp_limb_t
16661         index.
16662
16663 1998-10-17  Torbjorn Granlund  <tege@matematik.su.se>
16664
16665         * mpn/sparc32/v9/mul_1.s: Misc cleanups.
16666         * mpn/sparc32/v9/addmul_1.s: Misc cleanups.
16667
16668 1998-10-16  Torbjorn Granlund  <tege@matematik.su.se>
16669
16670         * mpn/tests/{add,sub,}mul_1.c: Print xlimb using mpn_print.
16671
16672         * mpz/tests/t-powm.c (SIZE): Increase to 50.
16673         (EXP_SIZE): New parameter; use it for computing exp_size.
16674
16675 1998-10-15  Torbjorn Granlund  <tege@matematik.su.se>
16676
16677         * mpn/generic/divrem_newt.c: Use TMP_ALLOC interface.
16678
16679         * mpn/generic/sqrtrem.c: Check BITS_PER_MP_LIMB before defining
16680         assembly variants of SQRT.
16681
16682 1998-10-14  Torbjorn Granlund  <tege@matematik.su.se>
16683
16684         * mpn/tests: Clean up timing routines.  Don't include longlong.h
16685         where it is not needed.
16686         (mpn_print): Handle printing when _LONG_LONG_LIMB.
16687         * mpn/tests/{add,sub,}mul_1.c: Generate xlimb with mpn_random2
16688         and do it whether TIMES != 1 or not.
16689
16690         * mpn/generic/mul_n.c: Delay assignment of `sign' for lower
16691         register pressure.
16692
16693         * mpn/sparc32/v9/mul_1.s: New file.
16694
16695         * config/mt-sprc9-gcc: New file.
16696         * configure.in: Use it.
16697
16698         * mpn/configure.in: Use sparc64 for Solaris 2.7 and later with a
16699         sparc v9 CPU.
16700         * mpn/configure.in: Use sparc32/v9 for Solaris 2.6 or earlier with
16701         a sparc v9 CPU.
16702
16703         * mpf/sub.c: In initial code for ediff == 0, limit precision
16704         before jumping to `normalize'.
16705
16706 1998-10-13  Torbjorn Granlund  <tege@matematik.su.se>
16707
16708         * mpn/hppa/hppa2_0/add_n.s: New file.
16709         * mpn/hppa/hppa2_0/sub_n.s: New file.
16710         * mpn/configure.in: Handle hppa2.0 (32-bit code for now).
16711
16712         * config.guess: Update from egcs 1.1.
16713         (9000/[3478]??:HP-UX:*:*): Properly return 2.0 for all known 2.0
16714         machines.
16715
16716 1998-10-07  Torbjorn Granlund  <tege@matematik.su.se>
16717
16718         * mpz/root.c (mpz_root): New file.
16719         * mpz/Makefile.in: Compile it.
16720         * make.bat: Likewise.
16721         * gmp.h (mpz_root): Declare.
16722
16723         * mpz/perfpow.c: New file.
16724         * mpz/Makefile.in: Compile it.
16725         * make.bat: Likewise.
16726         * gmp.h (mpz_perfect_power_p): Declare.
16727
16728         * mpz/remove.c: New file.
16729         * mpz/Makefile.in: Compile it.
16730         * make.bat: Likewise.
16731         * gmp.h (mpz_remove): Declare.
16732
16733         * mpz/bin_ui.c: New file.
16734         * mpz/Makefile.in: Compile it.
16735         * make.bat: Likewise.
16736         * gmp.h (mpz_bin_ui): Declare.
16737
16738         * mpz/bin_uiui.c: New file.
16739         * mpz/Makefile.in: Compile it.
16740         * make.bat: Likewise.
16741         * gmp.h (mpz_bin_uiui): Declare.
16742
16743 1998-09-16  Torbjorn Granlund  <tege@matematik.su.se>
16744
16745         * longlong.h: Test for __powerpc__ in addition to _ARCH_PPC.
16746
16747 Sat Sep  5 17:22:28 1998  Torbjorn Granlund  <tege@matematik.su.se>
16748
16749         * mpf/cmp_si.c: Compare most significant mantissa limb before
16750         trying to deduce anything from the limb count.
16751         * mpf/cmp_ui.c: Likewise.
16752
16753 Tue Aug 18 10:24:39 1998  Torbjorn Granlund  <tege@matematik.su.se>
16754
16755         * mpz/pprime_p.c (mpz_probab_prime_p): Add new code block
16756         for doing more dividing.
16757
16758 Sat Aug 15 18:43:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
16759
16760         * mpn/generic/divrem_newt.c: New name for divrem_newton.c.
16761         * mpn/Makefile.in: Corresponding changes.
16762         * mpn/configure.in: Likewise.
16763
16764 Wed Aug 12 23:07:09 1998  Torbjorn Granlund  <tege@matematik.su.se>
16765
16766         * config.guess: Handle powerpc for NetBSD.
16767
16768 Tue Jul 28 23:10:55 1998  Torbjorn Granlund  <tege@matematik.su.se>
16769
16770         * mpz/fib_ui.c: New file.
16771         * mpz/Makefile.in: Compile it.
16772         * make.bat: Likewise.
16773         * gmp.h (mpz_fib_ui): Declare.
16774
16775 Wed Jun 17 22:52:58 1998  Torbjorn Granlund  <tege@matematik.su.se>
16776
16777         * make.bat: Fix typo, `asm-synt.h' => `asm-syntax.h'.
16778
16779 Wed Jun  3 11:27:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
16780
16781         * config/mt-pwr: New file.
16782         * config/mt-ppc: New file.
16783         * configure.in: Use the new files.
16784
16785 Tue Jun  2 13:04:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
16786
16787         * mpn/sparc32/v9/addmul_1.s: New file.
16788         * mpn/config/mt-sprc9: New file.
16789         * mpn/configure.in: Use mt-sprc9.
16790
16791 Tue May 26 11:24:18 1998  Torbjorn Granlund  <tege@matematik.su.se>
16792
16793         * demos/factorize.c (factor_using_pollard_rho): Pass correct
16794         parameters in recursive calls; join the two recursion arms.
16795
16796         * mpf/set_q.c: Set result sign.
16797         When normalizing the numerator, don't allow it to increase in size
16798         beyond prec.
16799
16800 Tue May 19 17:28:14 1998  Torbjorn Granlund  <tege@matematik.su.se>
16801
16802         * demos/factorize.c (factor_using_division): Call fflush
16803         also for the factor 2.
16804
16805 Mon May 18 15:51:01 1998  Torbjorn Granlund  <tege@matematik.su.se>
16806
16807         * make.bat: Pass -fomit-frame-pointer.  Do not pass -g.
16808
16809 Tue May  5 01:42:50 1998  Torbjorn Granlund  <tege@matematik.su.se>
16810
16811         * mpz/Makefile.in (LOCAL_CC): Remove definition.
16812
16813         * gmp.h: Get rid of GMP_SMALL stuff.
16814         * mpz/Makefile.in: Likewise.
16815         * mpq/Makefile.in: Likewise.
16816         * mpf/Makefile.in: Likewise.
16817
16818         * mpz/invert.c: Fix typo in comment.
16819
16820 Mon May  4 23:05:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
16821
16822         * mpn/generic/sqrtrem.c: Check that __arch64__ is not defined
16823         before defining sparc SQRT.
16824
16825 Mon Apr 20 19:16:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
16826
16827         * mpn/generic/gcdext.c: Allow gp to be NULL.
16828
16829 1998-04-03  Torbjorn Granlund  <tege@matematik.su.se>
16830
16831         * mpn/configure.in: Recognize `alphaev5*', not `alphaev5'.
16832
16833         * config.guess: Handle CPU variants for NetBSD.
16834
16835 Mon Mar 16 13:07:54 1998  Torbjorn Granlund  <tege@matematik.su.se>
16836
16837         * mpz/pprime_p.c: Use mpn_mod_1/mpn_preinv_mod_1 for computing mod PP,
16838         not mpz_tdiv_r_ui (which expects an `unsigned long').
16839         (mpz_probab_prime_p): Change type of `r' to mp_limb_t.
16840
16841 Thu Mar 12 17:19:04 1998  Torbjorn Granlund  <tege@matematik.su.se>
16842
16843         * gmp.h (mpf_ceil, mpf_floor, mpf_trunc): Add declarations.
16844
16845         * config.guess: Update from FSF version.
16846         * config.sub: Likewise.
16847
16848         * config.guess: Add special handling of alpha-*-NetBSD.
16849
16850 Wed Mar 11 00:55:34 1998  Torbjorn Granlund  <tege@matematik.su.se>
16851
16852         * mpz/inp_str.c: Update from set_str.c.
16853         Properly increment `nread' when skipping minus sign.
16854
16855         * mpz/set_str.c: Check for empty string after having skipped
16856         leading zeros.
16857
16858 Mon Mar  9 19:28:00 1998  Torbjorn Granlund  <tege@matematik.su.se>
16859
16860         * mpz/set_str.c: Skip leading zeros.
16861
16862 Wed Mar  4 19:29:16 1998  Torbjorn Granlund  <tege@matematik.su.se>
16863
16864         * gmp.h (mpz_cmp_si): Cast argument before calling mpz_cmp_ui.
16865
16866         * demos/factorize.c: Rewrite.
16867
16868 1998-02-04  Torbjorn Granlund  <tege@matematik.su.se>
16869
16870         * configure.in (i[3456]86* etc): Check if using gcc before
16871         choosing mt-x86.
16872
16873         * configure.in (m68*-*-*): New alterantive.
16874         * config/mt-m68k: New file.
16875
16876         * mpn/alpha/invert-limb.s: Put tables in text segment,
16877         since not all systems support "rdata".
16878
16879 Wed Feb  4 02:20:57 1998  Torbjorn Granlund  <tege@matematik.su.se>
16880
16881         * gmp.h (__GNU_MP_VERSION_SNAP): New #define.
16882         (__GNU_MP_VERSION_MINOR): Now 1.
16883
16884 Wed Jan 28 22:29:36 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
16885
16886         * longlong.h (alpha udiv_qrnnd): #define UDIV_NEEDS_NORMALIZATION.
16887
16888 Wed Jan 28 20:28:19 1998  Torbjorn Granlund  <tege@sophie.matematik.su.se>
16889
16890         * mpz/pprime_p.c (mpz_probab_prime_p): Delete 59 from tried divisors.
16891
16892 Mon Jan 26 01:39:02 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
16893
16894         * mpz/pprime_p.c (mpz_probab_prime_p): Major overhaul: Check small
16895         numers specifically; check small factors, then perform a fermat test.
16896
16897 Tue Jan 13 14:58:28 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
16898
16899         * longlong.h (alpha udiv_qrnnd): Call __mpn_invert_normalized_limb
16900         and udiv_qrnnd_preinv.
16901
16902 Wed Jan  7 01:52:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
16903
16904         * mpn/configure.in (alpha*, extra_functions): Add invert-limb and
16905         remove udiv_qrnnd.
16906
16907         * mpn/tests/divrem.c: Get allocations right.
16908
16909         * mpn/generic/divrem.c: Conditionally pre-invert most significant
16910         divisor limb.
16911
16912 Tue Jan  6 23:08:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
16913
16914         * mpn/generic/divrem_1.c: Rename variables to comply to conventions.
16915         Make `i' have type `mp_size_t'.
16916
16917 Tue Dec 30 22:21:42 1997  Torbjorn Granlund  <tege@matematik.su.se>
16918
16919         * mpz/tdiv_qr_ui.c: Return the remainder.
16920         * mpz/tdiv_r_ui.c: Likewise.
16921         * mpz/tdiv_q_ui.c: Likewise.
16922         * gmp.h: Change return type of mpz_tdiv_qr_ui, mpz_tdiv_r_ui,
16923         mpz_tdiv_q_ui.
16924
16925         * mpz/tdiv_ui.c: New file.
16926         * mpz/Makefile.in: Compile it.
16927         * make.bat: Likewise.
16928         * gmp.h (mpz_tdiv_ui): Declare.
16929
16930 Fri Nov  7 04:21:15 1997  Torbjorn Granlund  <tege@matematik.su.se>
16931
16932         * mpf/integer.c (FUNC_NAME): Fix bogus test for mpf_trunc.
16933
16934         * demos/isprime.c: New file.
16935
16936         Sat Nov  1 19:32:25 1997  Torbjorn Granlund  <tege@matematik.su.se>
16937
16938         * mpz/cmp_abs.c: New file.
16939         * mpz/Makefile.in: Compile it.
16940         * make.bat: Likewise.
16941         * gmp.h (mpz_cmp_abs): Declare.
16942
16943         * mpz/cmp_abs_ui.c: New file.
16944         * mpz/Makefile.in: Compile it.
16945         * make.bat: Likewise.
16946         * gmp.h (mpz_cmp_abs_ui): Declare.
16947
16948 Sat Sep 27 04:49:52 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
16949
16950         * mpz/fdiv_r_2exp.c: Get allocation for `tmp' right.
16951
16952         * mpz/fdiv_q_2exp.c: In final result adjustment code, handle
16953         that intermediate result is zero.
16954
16955         * mpz/tests/t-2exp.c: New file.
16956         * mpz/tests/Makefile.in: Handle t-2exp.c.
16957
16958 Fri Sep 26 16:29:21 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
16959
16960         * mpz/divexact.c: Fix typo in test for whether to copy numerator to
16961         quotient and move that statement to after handling quotient and
16962         denominator overlap.  Misc cleanups.
16963
16964         * mpn/generic/gcd.c: Change count argument of mpn_lshift/mpn_rshift
16965         calls to `unsigned int'.
16966         * mpz/divexact.c: Likewise.
16967
16968 Mon Sep 22 02:19:52 1997  Torbjorn Granlund  <tege@pro.tmg.se>
16969
16970         * mpz/tests/t-powm.c: Decrease `reps' to 2500.
16971
16972         * mpz/tests/t-pow_ui.c: New file.
16973         * mpz/tests/Makefile.in: Handle t-pow_ui.c.
16974
16975         * mpz/ui_pow_ui.c: Get special cases for exponent and base right.
16976
16977         * mpz/pow_ui.c: Increase temp space allocation by 1 limb.
16978         Split `rsize' into two variables; compute space allocation into
16979         `ralloc'.
16980
16981 Sun Sep  7 04:15:12 1997  Torbjorn Granlund  <tege@pro.tmg.se>
16982
16983         * mpn/pa64/lshift.s: New file.
16984         * mpn/pa64/rshift.s: New file.
16985         * mpn/pa64/sub_n.s: New file.
16986
16987 Sat Sep  6 19:14:13 1997  Torbjorn Granlund  <tege@gmp.tmg.se>
16988
16989         * mpn/pa64/add_n.s: New file.
16990         * mpn/pa64: New directory.
16991
16992 Tue Aug 19 16:17:09 1997  Torbjorn Granlund  <tege@pro.tmg.se>
16993
16994         * mpz/swap.c: New file.
16995         * mpz/Makefile.in: Compile it.
16996         * make.bat: Likewise.
16997         * gmp.h (mpz_swap): Declare.
16998
16999         * mpn/generic/mul_n.c: Push assignment of x and y pointers into the
17000         if/else clauses in several places.  (Decreases register pressure.)
17001
17002 Mon Aug 18 03:29:50 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17003
17004         * mpn/thumb/add_n.s: New file.
17005         * mpn/thumb/sub_n.s: New file.
17006         * mpn/arm/add_n.s: New file.
17007         * mpn/arm/sub_n.s: New file.
17008
17009         * mpz/powm.c: After mpn_mul_n and mpn_mul calls, adjust product size
17010         if most significant limb is zero.
17011         * mpz/powm_ui.c: Likewise.
17012
17013 Fri Aug 15 02:13:57 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17014
17015         * mpn/arm/m/mul_1.s: New file.
17016         * mpn/arm/m/addmul_1.s: New file.
17017
17018         * mpn/powerpc32/mul_1.s: Rewrite.
17019
17020         * mpn/alpha/mul_1.s: Prefix labels with `.'.
17021
17022 Mon Aug 11 02:37:16 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17023
17024         * mpn/powerpc32/add_n.s: Rewrite.
17025         * mpn/powerpc32/sub_n.s: Rewrite.
17026
17027 Sun Aug 10 17:07:15 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17028
17029         * mpn/powerpc32/addmul_1.s: Delete obsolete comments.
17030         * mpn/powerpc32/submul_1.s: Likewise.
17031
17032 Fri Jul 25 20:07:54 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17033
17034         * mpz/addmul_ui.c: New file.
17035         * mpz/Makefile.in: Compile it.
17036         * make.bat: Likewise.
17037         * gmp.h (mpz_addmul_ui): Declare.
17038
17039         * mpz/setbit.c: Add missing code after final `else'.
17040
17041 Tue Jul 22 17:45:01 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
17042
17043         * mpn/sh/add_n.s: Fix typo.
17044         * mpn/sh/sub_n.s: Likewise.
17045
17046         * longlong.h (ns32k count_trailing_zeros): Fix typo.
17047
17048         * insert-dbl.c: Check for exponent overflow and return Inf.
17049
17050         * mpz/get_d.c: Rewrite to avoid rounding errors.
17051
17052 Thu May 29 11:51:07 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17053
17054         * mpq/add.c: Swap some usages of tmp1 and tmp2 to make sure
17055         their allocation suffices.
17056         * mpq/sub.c: Likewise.
17057
17058 Wed Apr 16 02:24:25 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17059
17060         * demos/pexpr.c: New file.
17061
17062         * mpn/generic/mul_n.c: Misc optimizations from Robert Harley.
17063
17064         * gmp-impl.h (MPZ_PROVOKE_REALLOC): New #define.
17065
17066 Sat Apr 12 17:54:04 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17067
17068         * mpz/tstbit.c: New file.
17069         * mpz/Makefile.in: Compile it.
17070         * make.bat: Likewise.
17071         * gmp.h (mpz_tstbit): Declare.
17072
17073         * mpz/tests/logic.c: Use MPZ_CHECK_FORMAT.
17074         * mpz/tests/bit.c: New test.
17075         * mpz/tests/Makefile.in: Handle bit.c.
17076
17077         * mpz/ior.c: In -OP2,+OP1 case, normalize OP2 after call to mpn_sub_1.
17078
17079         * gmp-impl.h (MPZ_CHECK_FORMAT): New #define.
17080
17081 Thu Apr 10 00:30:14 1997  Torbjorn Granlund  <tege@tmg.se>
17082
17083         * longlong.h (POWER/PowerPC): Test _ARCH_PWR instead of _IBMR2.
17084
17085 Wed Apr  9 18:23:31 1997  Torbjorn Granlund  <tege@pro.tmg.se>
17086
17087         * gmp-impl.h: Move defaulting of UMUL_TIME and UDIV_TIME from here...
17088         * longlong.h: ...to here.
17089
17090 Sun Mar 30 12:16:23 1997  Torbjorn Granlund  <tege@matematik.su.se>
17091
17092         * mpn/generic/next_prime.c: New file.
17093
17094         * mpn/generic/perfsqr.c: Remove definitions of PP and PP_INVERTED.
17095         * gmp-impl.h: Put them here.
17096
17097 Fri Mar 28 08:18:05 1997  Torbjorn Granlund  <tege@matematik.su.se>
17098
17099         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Define as inline asm for
17100         for x86, but leave disabled for now.
17101
17102 Fri Feb 28 02:39:47 1997  Torbjorn Granlund  <tege@matematik.su.se>
17103
17104         * mpn/Makefile.in (.S.o): Pass SFLAGS and CFLAGS also to compiler
17105         for assembly phase.
17106         (.s.o): Pass SFLAGS.
17107
17108 Wed Feb 26 06:46:08 1997  Torbjorn Granlund  <tege@matematik.su.se>
17109
17110         * mpn/configure.in: For Pentium Pro, use default code, not Pentium
17111         optimized code.
17112
17113         * mpn/x86/addmul_1.S: Unroll and optimize for Pentium Pro.
17114         * mpn/x86/submul_1.S: Likewise.
17115
17116 Thu Feb 13 08:26:09 1997  Torbjorn Granlund  <tege@matematik.su.se>
17117
17118         * mpf/Makefile.in: Compile floor.o, ceil.o and trunc.o (from
17119         integer.c).
17120         * make.bat: Likewise.
17121
17122 Wed Feb  5 05:58:44 1997  Torbjorn Granlund  <tege@matematik.su.se>
17123
17124         * mpn/configure.in (alpha*): Add cntlz to extra_functions.
17125
17126 Wed Feb  4 03:30:45 1997  Torbjorn Granlund  <tege@matematik.su.se>
17127
17128         * mpf/integer.c: New file (supporting mpf_floor, mpf_ceil, mpf_trunc).
17129
17130 Mon Feb  3 14:21:36 1997  Torbjorn Granlund  <tege@matematik.su.se>
17131
17132         * make.bat: Fix typo, set_dfl_prc => set_dfl_prec.
17133
17134 Sun Feb  2 02:34:33 1997  Torbjorn Granlund  <tege@matematik.su.se>
17135
17136         * mpf/out_str.c: After outputting `-', decrement n_digits.
17137
17138 Wed Jan  8 02:50:20 1997  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17139
17140         * mpn/generic/divrem.c: qextra_limbs => qxn.
17141
17142 Wed Dec 18 07:50:46 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17143
17144         * mpz/tests/t-tdiv.c (SIZE): Increase to 200.
17145
17146 Tue Dec 17 19:32:48 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17147
17148         * mpn/generic/divrem.c (mpn_divrem_classic): New name for mpn_divrem.
17149         * gmp.h (mpn_divrem): New function.
17150         * mpn/generic/divrem_newton.c: New file.
17151         * mpn/configure.in (functions): Add divrem_newton.
17152         * make.bat: Likewise.
17153
17154 Thu Dec 12 17:55:13 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17155
17156         * gmp.h (_GMP_H_HAVE_FILE): Test also __dj_include_stdio_h_.
17157
17158 Sat Dec  7 09:40:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17159
17160         * mpn/alpha/invert-limb.s: New file.
17161
17162 Thu Dec  5 01:25:31 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17163
17164         * mpz/ui_pow_ui.c (mpz_pow2): New (static) function.
17165         (mpz_ui_pow_ui): Rewrite.
17166
17167         * make.bat: `pre_mod_1.c' => `pre_mod_.c'.  Fix typo in path to
17168         gmp-mpar.h.
17169
17170 Fri Nov 15 00:49:55 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17171
17172         * mpz/ui_pow_ui.c: Rewrite for better speed.
17173
17174 Fri Nov  1 16:36:56 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17175
17176         * Makefile.in (recursive make rules): Use `&&' instead of `;' as
17177         delimiter.
17178
17179 Fri Oct 25 17:12:36 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17180
17181         * gmp-impl.h (Cray/uxp MPN_COPY): Really declare as inline.
17182
17183 Thu Oct 24 15:08:19 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17184
17185         * mpn/fujitsu/rshift.c: Fix typo in loop boundaries.
17186
17187 Fri Oct 18 03:13:54 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17188
17189         * mpn/configure.in: Recognize `nextstep' for m68k variants; likewise
17190         for x86 variants.
17191
17192         * mpn/x86/syntax.h (INSND): New macro.
17193         * mpn/x86/[lr]shift.S: Use INSND.
17194         * mpn/x86/pentium/[lr]shift.S: Likewise.
17195         * mpn/config/t-oldgas (SFLAGS): Pass -DOLD_GAS.
17196
17197         * gmp-impl.h: In code for determining endianess, test also
17198         __BIG_ENDIAN__ and __hppa__.  Remove test of __NeXT__.
17199
17200 Wed Oct 16 03:50:34 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17201
17202         * mpf/set_str.c: Let `prec' determine precision used in
17203         exponentiation code; decrease allocation accordingly.
17204
17205         * mpn/vax: Change `jsob*' to `sob*' in all files.
17206
17207 Tue Oct 15 03:54:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17208
17209         * longlong.h (m88110 udiv_qrnnd): Change type of intermediate quotient
17210         to DImode (divu.d generates a 64-bit quotient).
17211
17212         * configure.in (m88110*): Fix typo.
17213
17214         * mpf/get_str.c: Compute exp_in_base using `double' to avoid overflow.
17215
17216         * gmp-impl.h (struct bases): Change type of chars_per_bit_exactly from
17217         float to double.
17218         * mpn/mp_bases.c (__mp_bases): Give 17 digits for chars_per_bit_exactly
17219         field.
17220
17221         * mpf/get_str.c: Let `prec' determine precision used in
17222         exponentiation code; decrease allocation accordingly.
17223
17224 Sun Oct 13 03:31:53 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17225
17226         * longlong.h: Major cleanup.
17227         (__udiv_qrnnd_c): Compute remainders using multiply and subtract,
17228         not explicit `%' operator.
17229         (C umul_ppmm): Get rid of a redundant __ll_lowpart.
17230
17231         * mpz/invert.c: Properly detect all operands that would yield an
17232         undefined inverse; make sure the inverse is always positive.
17233
17234         * mpz/xor.c: New file.
17235         * mpz/Makefile.in: Compile it.
17236         * make.bat: Likewise.
17237         * gmp.h (mpz_xor): Declare.
17238
17239         * mpz/tests/logic.c: Also test mpz_xor.
17240
17241         * mpz/lcm.c: Special case for when either operand equals 0.
17242
17243 Sat Oct 12 01:57:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17244
17245         * mpn/generic/gcd.c (find_a): Don't inline on x86.
17246
17247         * Makefile.in (CFLAGS): Default to just `-g'.
17248
17249         * configure.in: Recognize 386 and 486 wherever other x86 cpus are
17250         recognized.
17251         * configure.in: Use mt-x86 for all x86 cpus.
17252         * config/mt-x86: New file.
17253
17254         * mpn/alpha/cntlz.s: New file.
17255
17256 Tue Oct  8 00:16:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17257
17258         * longlong.h: Define smul_ppmm for Fujitsu vpp/uxp.
17259         Rewrite umul_ppmm to actually work on the hardware.
17260
17261         * mpn/x86/sub_n.S: Avoid parens around displacement of `leal'.
17262         * mpn/x86/add_n.S: Likewise.
17263
17264         * mpn/x86/syntax.h (R): Define differently depending on __STDC__.
17265
17266 Mon Oct  7 16:48:08 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17267
17268         * longlong.h: Don't test for __NeXT__ in outer 68k conditional;
17269         add test for __m68k__.
17270
17271 Sun Oct  6 00:59:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17272
17273         * gmp.h: Declare mpn_random.
17274         * make.bat: Compile mpn/generic/random.c.
17275
17276         * longlong.h: Define umul_ppmm for Fujitsu vpp/uxp.
17277
17278         * gmp-impl.h: Protect definitions using `__attribute__ ((mode (...)))'
17279         with test also for __GNUC_MINOR__.
17280
17281         * gmp.h: Don't define macros using __builtin_constant_p when using
17282         NeXT's compiler.
17283
17284 Fri Oct  4 16:53:50 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17285
17286         * mpz/lcm.c: New file.
17287         * mpz/Makefile.in: Compile it.
17288         * make.bat: Likewise.
17289         * gmp.h (mpz_lcm): Declare.
17290
17291 Wed Sep 25 00:06:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17292
17293         * mpq/tests/t-cmp_ui.c: Make sure numerator and denominator of `b' is
17294         within limits of an `unsigned long int'.
17295
17296         * mpz/tests/t-powm_ui.c: Change type of exp2 to `unsigned long int'.
17297
17298 Tue Sep 24 18:58:20 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17299
17300         * mpz/powm_ui.c: Make result always positive.
17301
17302         * urandom.h (urandom): Make it return mp_limb_t.
17303
17304         * gmp-impl.h (CNST_LIMB): New macro.
17305         * mpn/mp_bases.c: Use CNST_LIMB.
17306         * mpn/generic/hamdist.c (popc_limb): Likewise.
17307         * mpn/generic/popcount.c (popc_limb): Likewise.
17308         * mpn/generic/perfsqr.c: Likewise.
17309
17310 Fri Sep 20 03:08:10 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17311
17312         * mpz/pprime_p.c: When n <= 3, don't clear out n before using it.
17313
17314 Wed Sep 18 11:22:45 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17315
17316         * mpn/fujitsu/mul_1.c: New file.
17317         * mpn/fujitsu/addmul_1.c: New file.
17318         * mpn/fujitsu/sub_n.c: New file.
17319         * mpn/fujitsu/add_n.c: Mew file.
17320
17321 Sun Sep 15 03:13:02 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17322
17323         * mpn/generic/random.c: New file.
17324         * mpn/configure.in (functions): Add `random'.
17325
17326         * gmp-impl.h (MPN_COPY): Define as annotated inline function for
17327         Crays and Fujitsu VPPs.
17328
17329         * gmp.h (mp_size_t): Define as `int' for non-MPP Cray.
17330         (mp_exp_t): Likewise.
17331
17332         * configure.in: Add support for Fujitsu VPP machines.
17333         * mpn/configure.in: Likewise.
17334         * config.guess: Likewise.
17335         * config.sub: Likewise.
17336
17337         * mpn/fujitsu/rshift.c: New file.
17338         * mpn/fujitsu/lshift.c: New file.
17339         * mpn/fujitsu: New directory, for Fujitsu VPP machines.
17340
17341 Wed Sep 11 11:34:38 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17342
17343         * mpn/generic/mul_n.c (__gmpn_mul_n): New name for impn_mul_n.
17344         Call __gmpn_mul_basecase, not impn_mul_n_basecase; update parameter
17345         list to work with __gmpn_mul_basecase.
17346         (__gmpn_sqr): New name for impn_sqr_n.
17347         Call __gmpn_sqr_basecase, not impn_sqr_n_basecase; update parameter
17348         list to work with __gmpn_sqr_basecase.
17349         (mpn_mul_n): Update calls to match new names and parameter conventions.
17350         * gmp-impl.h (MPN_MUL_N_RECURSE): Likewise.
17351         (MPN_SQR_RECURSE): New name for MPN_SQR_N_RECURSE.
17352         Update calls to match new names and parameter conventions.
17353         * mpn/generic/mul.c: Never perform multiply explicitly here, call
17354         __gmpn_mul_basecase instead.
17355         Update calls to match new names and parameter conventions.
17356
17357         * mpn/x86/mul_basecase.S: New file.
17358         * mpn/generic/mul_basecase.c: New file.
17359         * mpn/generic/sqr_basecase.c: New file.
17360
17361 Wed Sep  4 02:59:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17362
17363         * mpz/set_str.c: Let `0b' and `0B' mean base 2.
17364
17365 Fri Aug 30 00:44:00 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17366
17367         * longlong.h (x86 umul_ppmm): Work around GCC bug that was
17368         triggered by Aug 28 change.
17369
17370         * mpbsd/min.c (digit_value_in_base): New function.
17371
17372         * mpz/set_str.c: Refine allocation size computation, use
17373         chars_per_bit_exactly instead of chars_per_limb.
17374
17375         * mpbsd/Makefile.in (.c.o): Add -D_mpz_realloc=_mp_realloc.
17376
17377 Wed Aug 28 02:52:14 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17378
17379         * longlong.h (x86 umul_ppmm): Don't cast result operands.
17380         (x86 udiv_qrnnd): Likewise.
17381         (default smul_ppmm): Fix typo, umul_ppmm => smul_ppmm.
17382         (default umul_ppmm): New #define using smul_ppmm.
17383         (vax smul_ppmm): New #define.
17384         (vax umul_ppmm): Delete.
17385         (POWER umul_ppmm): Delete.
17386         (IBM 370 smul_ppmm): New #define.
17387         (IBM 370 umul_ppmm): Delete.
17388         (IBM RT/ROMP smul_ppmm): New #define.
17389         (IBM RT/ROMP umul_ppmm): Delete.
17390
17391 Tue Aug 27 01:03:25 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17392
17393         * gmp-impl.h (__gmp_0): Make it `const'.
17394
17395         * mpn/Makefile.in (clean mostlyclean): Comment out recursive clean
17396         of `tests'.
17397
17398         * mpn/generic/mul.c: Identify when we do squaring, and call
17399         impn_sqr_n_basecase/impn_sqr_n as appropriate.  Use
17400         KARATSUBA_MUL_THRESHOLD and KARATSUBA_SQR_THRESHOLD.
17401         Don't #define KARATSUBA_THRESHOLD.
17402
17403         * mpn/generic/mul_n.c: Don't #define KARATSUBA_THRESHOLD.
17404         (impn_mul_n, impn_sqr_n): Rewrite, based on code contributed by
17405         Robert Harley.
17406         (impn_sqr_n_basecase): Rewrite.
17407
17408         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD): New #define.
17409         (KARATSUBA_SQR_THRESHOLD): Likewise.
17410         (MPN_SQR_N_RECURSE): Use KARATSUBA_SQR_THRESHOLD.
17411         (MPN_MUL_N_RECURSE): Use KARATSUBA_MUL_THRESHOLD.
17412
17413         * configure.in: Fix typo in last change.
17414
17415 Mon Aug 26 22:25:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17416
17417         * mpn/generic/random2.c: Fix typo, `alpha__' => `__alpha'.
17418         * mpf/random2.c: Likewise.
17419
17420 Sun Aug 25 00:07:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
17421
17422         * mpz/tests/t-mul.c: Also test squaring.
17423
17424 Fri Aug 16 05:12:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17425
17426         * mp_clz_tab.c (__clz_tab): Declare as `const'.
17427         * version.c (gmp_version): Likewise.
17428         * mpn/generic/sqrtrem.c (even_approx_tab, odd_approx_tab): Likewise.
17429
17430 Thu Aug 15 02:34:47 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17431
17432         * gmp.h: Fix typo, `mips__' => `__mips'.
17433
17434         * mpf/set_str.c: Allow a number to start with a period, if next
17435         position contains a digit.
17436
17437 Tue Aug 13 18:41:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17438
17439         * mpz/gcdext.c: Get cofactor sign right for negative input operands.
17440         Clean up code for computing tt.
17441
17442         * mpz/invert.c: Get rid of variable `rv'.
17443
17444         * mpz/divexact.c: Test for zero divisor in special case for zero
17445         dividend.
17446
17447 Mon Aug 12 18:04:07 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17448
17449         * mpz/?div_*_ui.c: Special case for division by 0.
17450         * mpz/tdiv_q.c: Likewise.
17451
17452 Sat Aug 10 14:45:26 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17453
17454         * mpz/dmincl.c: Special case for division by 0.
17455
17456         * mpz/tdiv_*_ui.c: Delete special case for dividend being 0; handle
17457         it when computing size after mpn_divmod_1 call.
17458
17459         * mp_bpl.c: (__gmp_junk): New variable.
17460         (__gmp_0): New constant.
17461
17462         * gmp-impl.h (DIVIDE_BY_ZERO): New #define.
17463
17464 Fri Aug  9 20:03:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17465
17466         * mpz/divexact.c: Test for dividend being zero before testing
17467         for small divisors.
17468
17469 Thu Aug  8 13:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17470
17471         * configure.in: Require operating system specification for cpus
17472         where assembly syntax differs between system.
17473
17474         * Makefile.in (many targets): Change `-' action prefix to `@'.
17475
17476         * mpn/Makefile.in: (distclean): Fix typo.
17477
17478         * mpq/cmp_ui.c: Rename function to _mpq_cmp_ui.
17479         (mpq_cmp_ui): #undef deleted.
17480         * mpz/cmp_si.c: Rename function to _mpz_cmp_si.
17481         (mpz_cmp_si): #undef deleted.
17482         * mpz/cmp_ui.c: Rename function to _mpz_cmp_ui.
17483         (mpz_cmp_ui): #undef deleted.
17484         * Makefile.in: Corresponding changes.
17485
17486         * mpf/get_prc.c: Return the *highest* precision achievable.
17487
17488         * mpf/get_str.c: Complete rewrite.
17489
17490         * mpf/set_str.c (swapptr): New #define.
17491         (assert): New #define.
17492         * mpf/set_str.c: Set prec to one more than the saved _mp_prec.
17493         Misc cleanups.
17494
17495         * mpz/set_str.c: #include string.h.
17496         * mpf/out_str.c: #include string.h.
17497         * mpbsd/xtom.c: #include string.h and ctype.h.
17498         * mpbsd/mout.c: #include string.h.
17499
17500 Wed Aug  7 11:46:04 EDT 1996  Ken Weber <kweber@mcs.kent.edu>
17501
17502         * mpn/generic/gcd.c: Reorder mpn_gcd argument list.
17503         * mpz/gcd.c: Change call to mpn_gcd.
17504         * gmp.texi: Update manual entry on mpn_gcd.
17505         * mpn/generic/bdivmod.c: Delete limb cache to make mpn_bdivmod
17506         reentrant.
17507
17508 Wed Aug  7 02:15:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17509
17510         * mpf/get_str.c: Rewrite code for converting integral part of a
17511         number with both an integral and fractional part.
17512
17513         * mpf/set_str.c: Get rid of variable xxx.  New variables madj and radj.
17514         In exp_in_base==0 case, add madj to msize for EXP field.
17515
17516         * mpz/tests/t-gcd.c: Test deleted.  Rename t-gcd2.c to t-gcd.c.
17517         Increase reps to 2000.
17518         * mpz/tests/t-gcd2.c: Get rid of mpz_refgcd.
17519
17520         * mpf/set_str.c: Ignore excess limbs in MP,MSIZE.
17521
17522 Thu Jul 25 04:39:10 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17523
17524         * mpn/configure.in: Fix typo in setting path, "sparc" => "sparc32".
17525
17526 Wed Jul 24 02:27:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17527
17528         * mpn/generic/gcdext.c: Reorganize and clean up.  Get rid of all
17529         signed limb arithmetic.
17530
17531 Mon Jul 22 02:39:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17532
17533         * mpn/generic/gcdext.c (mpn_gcdext): For large enough operands,
17534         work with most significant *two* limbs.
17535         (div2): New function (two variants).
17536         (THRESHOLD): New #define.
17537
17538         * mpz/gcdext.c: Fix typo in MPZ_TMP_INIT call.
17539
17540         * longlong.h (alpha UMUL_TIME): Now 30.
17541         (alpha UDIV_TIME): Now 350.
17542         (x86 UMUL_TIME): Now 10 (let Pentium decide).
17543         (SuperSPARC UDIV_TIME): Override default.
17544
17545         * extract-dbl.c (MP_BASE_AS_DOUBLE): Don't redefine here.
17546
17547         * extract-dbl.c: New name for extract-double.c.
17548         * insert-dbl.c: New name for insert-double.c.
17549         * Makefile.in: Corresponding changes.
17550         * make.bat: Likewise.
17551
17552         * mpz/Makefile.in (.c.o): Don't pass non-portable `-f' to cp.
17553         * mpq/Makefile.in: Likewise.
17554         * mpf/Makefile.in: Likewise.
17555
17556 Sat Jul 20 01:35:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17557
17558         * mpz/getlimbn.c: Take ABS of integer->_mp_size.
17559
17560         * mpz/divexact.c: Use mpn_divmod_1 if divisor is a single limb.
17561
17562 Thu Jul 18 00:31:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17563
17564         * mpn/generic/popcount.c (popc_limb): Use different masking trick
17565         for first step (due to David Seal).
17566         * mpn/generic/hamdist.c (popc_limb): Likewise.
17567
17568 Wed Jul 17 23:21:48 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17569
17570         * mpn/generic/divrem.c: In MPN_COPY_DECR call, copy dsize - 1 limbs.
17571
17572 Sun Jul 14 17:47:46 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17573
17574         * configure.in: Handle sparc9, sparc64, and ultrasparc like sparc8.
17575
17576 Thu Jul 11 14:05:54 1996  J.T. Conklin  <jtc@rtl.cygnus.com>
17577
17578         * longlong.h (mc680x0): Define umul_ppmm, udiv_qrnnd, sdiv_qrnnd
17579         for the '020, '030, '040, and '332.  Define count_leading_zeros
17580         for the '020, '030, '040, and '060.
17581
17582 Sun Jul 14 15:24:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17583
17584         From Joe Keane:
17585         * mpq/equal.c: Take ABS of num1_size before passing it to mpn_cmp.
17586
17587 Fri Jul 12 17:11:17 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17588
17589         * mpn/generic/sqrtrem.c (SQRT): New asm for x86, but leave it
17590         disabled for now.
17591
17592         * mpn/generic/sqrtrem.c: Use MP_BASE_AS_DOUBLE.
17593
17594 Wed Jul 10 03:17:45 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17595
17596         * cre-mparam.c: Delete obsolete file.
17597
17598         * gmp.h: #define _LONG_LONG_LIMB if __mips && _ABIN32.
17599         * longlong.h: Test __mips instead of __mips__.
17600
17601 Sun Jul  7 23:19:13 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17602
17603         * longlong.h (_PROTO): Define, unless already defined.
17604         (alpha __udiv_qrnnd): Declare using _PROTO.
17605         (hppa __udiv_qrnnd): Likewise.
17606         (sparc __udiv_qrnnd): Likewise.
17607
17608 Mon Jul  1 01:44:30 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17609
17610         * config.guess: Update from master version; add Cray x90 handling.
17611
17612 Wed Jun 26 05:35:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17613
17614         * mpn/power/add_n.s (__mpn_add_n): Work around GAS bug.
17615         * mpn/power/sub_n.s (__mpn_sub_n): Likewise.
17616
17617         * insert-double.c: Rework loop to avoid potential overflow.
17618
17619         * mpq/get_d.c: For vax, if qsize > N_QLIMBS, ignore excess limbs.
17620
17621         * mpq/tests/t-get_d.c (SIZE): Special case for vax.
17622
17623         * gmp.h (mpX_cmp_ui): #define also when ! __GNUC__.
17624
17625 Mon Jun 24 17:13:21 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17626
17627         * longlong.h (vax sdiv_qrnnd): Fix typo.
17628
17629 Sat Jun 15 01:33:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17630
17631         * gmp.h: Support `small' and `large' type and function variants,
17632         controlled by GMP_SMALL.
17633
17634         * mpz/Makefile.in (.c.o): Compile each function twice, for small and
17635         large variant.
17636         (MPZS_OBJS): New variable.
17637         (libmpz.a): Include MPZS_OBJS in archive.
17638         * mpf/Makefile.in: Analogous changes.
17639         * mpq/Makefile.in: Analogous changes.
17640
17641         * gmp.h: Prefix all functions with __gmp, to allow namespace-clean
17642         internal calls.
17643
17644         * mp.h: Rip out __MP_SMALL__ stuff.
17645         (__mpz_struct): mp_size_t => int.
17646
17647         * mpz/invert.c: #include "gmp-impl.h".
17648         Use MPZ_TMP_INIT, not mpz_init.
17649
17650         * mpz/gcdext.c: Rewrite to call mpn_gcdext.
17651
17652 Fri Jun 14 18:05:29 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17653
17654         * mpn/generic/gcdext.c (s0size): New parameter.
17655         * gmp.h (mpn_gcdext): Update prototype.
17656
17657         * mpn/generic/gcdext.c: Major rewrite.
17658
17659 Mon Jun 10 00:14:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17660
17661         * mpn/generic/dump.c: Add missing `else'.
17662
17663 Fri Jun  7 03:35:12 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17664
17665         * Makefile.in (gmp_toc.html): Pass -expandinfo to texi2html.
17666
17667 Thu Jun  6 19:00:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17668
17669         * Version 2.0.2 released.
17670
17671         * install.sh: New file.
17672         * Makefile.in (INSTALL): Use install.sh.
17673         (install-normal): New name for target `install'.
17674         (install): New dummy target.
17675
17676         * mpz/pow_ui.c: Swap tests for (e == 0) and (bsize == 0).
17677         * mpz/ui_pow_ui.c: Swap tests for (e == 0) and (blimb == 0).
17678
17679         * config/mt-linux (AR_FLAGS): New file.
17680         * configure.in: Use config/mt-linux for all linux systems.
17681
17682 Tue Jun  4 03:42:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17683
17684         * Version 2.0.1 released.
17685
17686         * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
17687
17688         * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
17689
17690         * insert-double.c: Don't #include stdlib.h.
17691
17692         * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
17693         Do not test __sparc__.
17694
17695         * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
17696         * mpq/equal.c: Likewise.
17697
17698         * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
17699
17700         * mpn/generic/gcdext.c: Add K&R declaration syntax.
17701         * stack-alloc.h: Likewise.
17702         * insert-double.c: Likewise.
17703         * extract-double.c: Likewise.
17704         * mpf/tests/reuse.c: Likewise.
17705         * mpz/tests/reuse.c: Likewise.
17706         * mpf/tests/t-sub.c: Likewise.
17707         * mpf/tests/t-add.c: Likewise.
17708         * mpf/tests/t-muldiv.c: Likewise.
17709         * mpf/tests/t-conv.c: Likewise.
17710         * mpf/tests/ref.c: Likewise.
17711
17712         * mpn/config/t-oldgas: Renamed from t-freebsd.
17713         * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
17714         configurations.
17715
17716         * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
17717         * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
17718
17719         * mpn/config/t-ppc-aix: New file.
17720         * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
17721
17722 Wed May 29 02:07:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17723
17724         * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
17725         __gmp_const.
17726
17727         * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
17728         * mpf/iset_str.c: Likewise.
17729
17730 Mon May 27 00:15:58 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17731
17732         * gmp-impl.h: Declare __gmp_extract_double.
17733
17734         * mpz/set_q.c: Delete unused variables.
17735
17736         * gmp.h (mpq_equal): Declare.
17737
17738         * mpf/eq.c: mpf_cmp2 -> mpf_eq.
17739
17740 Fri May 24 03:20:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17741
17742         * mpz/iset_d.c: Don't include <math.h>.
17743
17744         * insert-double.c (__gmp_scale2): New name for scal2.
17745         * mpz/get_d.c: Corresponding change.
17746         * mpf/get_d.c: Likewise.
17747         * mpq/get_d.c: Likewise.
17748         * gmp-impl.h: Declare __gmp_scale2.
17749
17750         * mpn/generic/scan0.c: Clarify comment.
17751
17752         * mpz/set_q.c: New file.
17753         * Makefile.in: Compile it.
17754         * make.bat: Likewise.
17755         * gmp.h: Declare mpz_set_q.
17756
17757         * insert-double.c: New file.
17758         * Makefile.in: Compile it.
17759         * make.bat: Likewise.
17760
17761         * mpz/get_d.c: New file.
17762         * mpz/Makefile.in: Compile it.
17763         * make.bat: Likewise.
17764         * gmp.h: Declare mpz_get_d.
17765
17766         * mpf/get_d.c: New file.
17767         * mpf/Makefile.in: Compile it.
17768         * make.bat: Likewise.
17769         * gmp.h: Declare mpf_get_d.
17770
17771         * make.bat: Compile things in alphabetical order.
17772
17773         * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
17774         (LIMBS_PER_DOUBLE): New #define.
17775
17776         * extract-double.c: New file.
17777         * Makefile.in: Compile it.
17778         * make.bat: Likewise.
17779         * mpz/set_d.c: Rewrite to use __gmp_extract_double.
17780         * mpf/set_d.c: Likewise.
17781
17782         * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
17783
17784 Wed May 22 02:48:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17785
17786         * gmp-impl.h: Rework code for defining ieee_double_extract.
17787         (IEEE_DOUBLE_BIG_ENDIAN): Macro removed.
17788         (_GMP_IEEE_FLOATS): New macro.
17789         * mpn/vax/gmp-mparam.h: Delete.
17790
17791         * mpn/config/t-pwr-aix: New file.
17792         * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
17793
17794 Mon May 20 16:30:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17795
17796         * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
17797
17798         * mpf/tests/t-add.c (oo): Add some `l' printf modifiers.
17799         * mpf/tests/t-sub.c (oo): Likewise.
17800         * mpf/tests/t-conv.c (oo): Likewise.
17801         * mpf/tests/t-sqrt.c (oo): Likewise.
17802
17803         * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
17804
17805         * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
17806
17807 Fri May 17 02:24:43 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17808
17809         * mpz/set_d.c: Call _mpz_realloc.
17810
17811         * mpq/set_z.c: New file.
17812         * mpq/Makefile.in: Compile it.
17813         * make.bat: Likewise.
17814         * gmp.h: Declare mpq_set_z.
17815
17816         * mp?/Makefile.in (libmp?.a): Depend on Makefile, not Makefile.in.
17817         * mpf/Makefile.in (test): Delete spurious target.
17818         * mpq/Makefile.in (test): Likewise.
17819
17820         * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
17821
17822         * mpn/configure.in: Treat ultrasparc just like sparc v8,
17823         until 64-bit compilers are ready.
17824
17825         * mpf/set_d.c: Make it work for 64-bit machines.
17826
17827 Thu May 16 20:53:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17828
17829         * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
17830         machines.
17831         * mpn/x86/gmp-mparam.h: Delete file.
17832
17833         * configure.in: Treat microsparc like sparc8.
17834
17835         * urandom.h: Test __alpha instead of __alpha__, since the former
17836         is the standard symbol.
17837         * mpn/generic/random2.c: Likewise.
17838         * mpf/random2.c: Likewise.
17839
17840 Tue May 14 13:42:39 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
17841
17842         * mpz/set_f.c: New file.
17843         * mpz/Makefile.in: Compile it.
17844         * gmp.h: Declare mpz_set_f.
17845
17846         * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
17847
17848 Tue May 14 13:03:07 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
17849
17850         * make.bat: Add all new files.
17851
17852 Sun May 12 22:24:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17853
17854         * mpf/set_z.c: New file.
17855         * mpf/Makefile.in: Compile it.
17856         * gmp.h: Declare mpf_set_z.
17857
17858 Sat May 11 19:26:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17859
17860         * gmp.h: Declare mpf_set_q.
17861
17862         * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
17863
17864 Fri May 10 17:37:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17865
17866         * mpf/set_q.c: New file.
17867         * mpf/Makefile.in: Compile it.
17868
17869         * config.sub: Recognize sparc8.
17870
17871 Wed May  8 09:19:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17872
17873         * mpf/tests/t-dm2exp.c: New file.
17874
17875         * mpf/tests/t-add.c: Correct header comment.
17876         * mpf/tests/t-sub.c: Likewise.
17877         * mpf/tests/t-sqrt.c: Likewise.
17878
17879         * mpf/div.c: Misc variable name cleanups.
17880         * mpf/div_ui.c: Base more closely on mpf/div.c.
17881         * mpf/ui_div.c: Likewise.
17882
17883         * mpz/tests/Makefile.in (check): Depend on Makefile.
17884         * mpq/tests/Makefile.in (check): Likewise.
17885         * mpf/tests/Makefile.in (check): Likewise.
17886
17887         * mpf/tests/t-muldiv.c: New file.
17888         * mpf/tests/Makefile.in: Compile and run `t-muldiv'.
17889         (t-ref.o): Delete spurious rule.
17890
17891         * mpf/sqrt.c: Properly detect negative input operand.
17892
17893         * mpf/sqrt_ui.c: Delete spurious header comment.
17894         * mpf/sqrt.c: Likewise.
17895         * mpz/sqrt.c: Likewise.
17896
17897         * mpz/tests/reuse.c (main): Read `reps' from command line.
17898
17899         * mpf/tests/reuse.c: New file.
17900         * mpf/tests/Makefile.in: Compile and run `reuse'.
17901
17902         * mpf/mul_ui.c: Disable code for removing low zero limbs.
17903
17904         * mpf/div.c: Fix condition for when vp and qp overlaps.
17905
17906         * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
17907
17908         * mpf/out_str.c: Don't output '\n' after exponent.
17909
17910         * mpf/add_ui.c: New special case for when U is completely cancelled.
17911
17912 Wed Apr 24 05:33:28 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17913
17914         * Version 2.0 released.
17915
17916         * All files: Update FSF's address.
17917
17918         * Makefile.in (gmp_toc.html): New name for gmp.html.
17919         (TAGS): Depend on force.
17920
17921         * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
17922
17923 Sat Apr 20 03:54:06 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17924
17925         * Makefile.in (ps): New target, depend on gmp.ps.
17926
17927 Fri Apr 19 14:03:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17928
17929         * mpf/out_str.c: Print `@' before exponent, not `e'.
17930
17931         * make.bat: Update from Makefiles.
17932
17933 Thu Apr 18 01:22:05 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17934
17935         * mpf/set_str.c: If parameter `base' is negative, expect exponent
17936         to be decimal, otherwise in the same base as the mantissa.
17937
17938 Wed Apr 17 17:28:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17939
17940         * mpf/set_dfl_prec.c: Don't return anything.
17941         * gmp.h: Corresponding changes.
17942
17943         * mpf/set_dfl_prec.c: Use `unsigned long int' for bit counts.
17944         * mpf/init2.c: Likewise.
17945         * mpf/get_prc.c: Likewise.
17946         * mpf/set_prc.c: Likewise.
17947         * mpf/set_prc_raw.c: Likewise.
17948         * mpz/popcount.c: Likewise.
17949         * mpz/hamdist.c: Likewise.
17950         * mpz/scan1.c: Likewise.
17951         * mpz/scan0.c: Likewise.
17952         * mpn/generic/popcount.c: Likewise.
17953         * mpn/generic/hamdist.c: Likewise.
17954         * mpn/generic/scan1.c: Likewise.
17955         * mpn/generic/scan0.c: Likewise.
17956         * gmp.h: Likewise.
17957
17958         * mpf/eq.c: New file, based on mpf/diff.c.
17959         * mpf/diff.c: Delete.
17960         * mpf/Makefile.in: Corresponding changes.
17961         * gmp.h: Likewise.
17962
17963         * mpf/reldiff.c: New file.
17964         * mpf/Makefile.in: Compile it.
17965         * gmp.h: Declare mpf_reldiff.
17966
17967         * mpz/iset_d.c: New file.
17968         * mpz/Makefile.in: Compile it.
17969         * gmp.h: Declare mpz_init_set_d.
17970
17971 Tue Apr 16 16:28:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17972
17973         * Makefile.in (gmp.html): Pass -acc to texi2html.
17974
17975 Mon Apr 15 16:20:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17976
17977         * mpf/set_str.c: Switch off code for defaulting the base from the
17978         leading characters.
17979
17980         * gmp.h (mp?_sign): Delete.
17981         (mp?_sgn): New macros.
17982
17983 Fri Apr 12 17:23:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17984
17985         * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
17986
17987 Wed Apr 10 22:52:02 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
17988
17989         * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
17990         * gmp.h: Corresponding change.
17991
17992         * gmp.h (mp_bits_per_limb): Make it const.
17993
17994 Sat Mar 30 01:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
17995
17996         * configure.in: Re-enable recognition of with_gcc.
17997
17998         * mpf/Makefile.in (.c.o): Pass XCFLAGS.
17999         * mpn/Makefile.in (.c.o): Likewise.
18000         * mpz/Makefile.in (.c.o): Likewise.
18001         * mpq/Makefile.in (.c.o): Likewise.
18002         * mpbsd/Makefile.in (.c.o): Likewise.
18003         * mpf/tests/Makefile.in (.c.o): Likewise.
18004         * mpz/tests/Makefile.in (.c.o): Likewise.
18005         * mpq/tests/Makefile.in (.c.o): Likewise.
18006
18007         * Makefile.in (XCFLAGS): Default to empty.
18008         (FLAGS_TO_PASS): Pass on XCFLAGS.
18009         (.c.o): Pass XCFLAGS.
18010
18011         * config/mt-m88110 (XCFLAGS): Define instead of CC.
18012         * config/mt-sprc8-gcc (XCFLAGS): Likewise.
18013         * config/mt-supspc-gcc (XCFLAGS): Likewise.
18014
18015         * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
18016         specified.
18017
18018 Mon Mar 25 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18019
18020         * urandom.h: Test for __SVR4 in addition to __svr4__.
18021
18022         * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
18023
18024         * Makefile.in (CFLAGS): `-O2' => `-O'.
18025         * mpn/Makefile.in (CFLAGS): Likewise.
18026
18027         * gmp-impl.h: Get rid of obsolete field access macros.
18028
18029         * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
18030         cc compiler bug.
18031
18032         * gmp.h (__MPN): Make it work also for non-ANSI compilers.
18033
18034 Thu Mar 21 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18035
18036         * mpf/sub.c: New special case for ediff <= 1 before generic code.
18037         Simplify generic code for ediff == 0.
18038         Rename uexp => exp.
18039
18040 Mon Mar 11 18:24:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18041
18042         * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
18043         * mpf/tests/Makefile.in: Link ref.o to all executables.
18044
18045         * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
18046
18047 Sun Mar 10 21:03:17 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
18048
18049         * mpf/get_str.c: In digit development loop for fractions, change
18050         loop condition from `<' to `<='.
18051
18052 Thu Mar  7 04:58:11 1996  Torbjorn Granlund  <tege@tiny.matematik.su.se>
18053
18054         * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
18055
18056 Wed Mar  6 01:10:42 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18057
18058         * mpf/tests/t-sqrt.c: New file.
18059         * mpf/tests/Makefile.in: Corresponding changes.
18060
18061         * mpf/sqrt.c: Special case for square root of zero.
18062
18063         * mpq/add.c: Clean up variable names.
18064         * mpq/sub.c: Update from mpq/add.c.
18065
18066         * mpz/divexact.c: abs => ABS.
18067         * mpz/gcd.c: Likewise.  Rewrite final fixup code, to decrease
18068         allocation.  Misc cleanups.
18069
18070 Tue Mar  5 22:24:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
18071
18072         * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
18073
18074         * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
18075
18076         * mpn/configure.in: Use t-freebsd also for netbsd.
18077
18078 Mon Mar  4 15:13:28 1996  Torbjorn Granlund  <tege@matematik.su.se>
18079
18080         * mpq/Makefile.in (cmp.o): Depend on longlong.h.
18081
18082         * mpq/equal.c: New file.
18083         * mpq/Makefile.in: Corresponding changes.
18084
18085         * mpf/tests/t-add.c: New file.
18086         * mpf/tests/t-sub.c: Renamed from t-addsub.c.
18087         * mpf/tests/ref.c: New file.
18088         * mpf/tests/Makefile.in: Corresponding changes.
18089
18090         * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
18091
18092 Sun Mar  3 07:45:46 1996  Torbjorn Granlund  <tege@matematik.su.se>
18093
18094         * mpf/set_str.c: In exponentiation code, allocate 3 extra
18095         limbs, not just 2.
18096
18097         * mpf/get_str.c: Allocate sufficient space for tstr.
18098         When calculating exp_in_base, round result down.
18099
18100         * mpf/tests/t-conv.c: New file.
18101         * mpf/tests/Makefile.in: Corresponding changes.
18102
18103         * mp_bpl.c: New file.
18104         * gmp.h: Declare it.
18105         * Makefile.in: Corresponding changes.
18106
18107 Sat Mar  2 06:27:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
18108
18109         * mpf/set_prc_raw.c: New file.
18110         * mpf/set_prc.c: Renamed from set_prec.c.
18111         * mpf/get_prc.c: New file.
18112         * mpf/Makefile.in: Corresponding changes.
18113         * gmp.h: Declare new functions.
18114
18115         * mpn/generic/gcdext.c: Add copyright header.
18116
18117 Fri Mar  1 01:22:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
18118
18119         * mpn/configure.in: For ppc601, search "power" before "powerpc32".
18120
18121         * mp?/Makefile.in (AR_FLAGS): New variable.
18122         (libmp?.a): Use it.
18123
18124         * make.bat: New file.
18125         * mpn/msdos: New directory.
18126         * mpn/msdos/asm-syntax.h: New file.
18127
18128         * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
18129
18130         * config.sub: Recognize [ctj]90-cray.
18131
18132         * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
18133
18134         * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
18135
18136         * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
18137         undefined behaviour.
18138
18139 Thu Feb 29 04:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
18140
18141         * Makefile.in (install-info-files): Update for new install-info
18142         behaviour.
18143
18144         * mpn/power/add_n.s: Rewrite.
18145         * mpn/power/sub_n.s: Rewrite.
18146
18147 Wed Feb 28 01:34:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
18148
18149         * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
18150         * mpz/ui_pow_ui.c: Likewise.
18151
18152         * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
18153
18154         * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
18155         * mpn/generic/gcd.c: Likewise.
18156         (SIGN_BIT): Compute differently.
18157
18158 Mon Feb 26 00:07:36 1996  Torbjorn Granlund  <tege@matematik.su.se>
18159
18160         * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
18161
18162         * Makefile.in (install, install-bsdmp, install-info-files): Depend
18163         on installdirs.  chmod all installed files.
18164
18165 Sun Feb 25 01:47:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
18166
18167         * mpbsd/configure.in: Delete debugging code.
18168
18169         * All Makefile.in: Update clean targets.
18170
18171         * Makefile.in (AR_FLAGS): New variable.
18172         (libgmp.a): Use it.
18173         (libmp.a): Likewise.
18174
18175         * VERSION: Delete file.
18176
18177         * Makefile.in (installdirs): New target.
18178         * mkinstalldirs: New file (from the texinfo package).
18179
18180         * Makefile.in (INSTALL, INSTALL_DATA, INSTALL_PROGRAM): New variables.
18181         (MAKEINFO, MAKEINFOFLAGS, TEXI2DVI): New variables.
18182         (install-info): New target.
18183         (install, install-bsdmp): Depend on install-info.
18184         ($(srcdir)/gmp.info): Changed from plain gmp.info; put info files
18185         into source directory.
18186         (distclean, mostlyclean): New targets.
18187         (maintainer-clean): New name for realclean.
18188         (uninstall): New target.
18189         (TAGS): New target.
18190         (info, dvi): New targets.
18191         (.PHONY): Assign.
18192
18193         * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
18194
18195         * mp{n,z,f,bsd}/move-if-change: Delete.
18196
18197         * mpbsd/Makefile.in (stamp-stddefh): Delete target.
18198
18199         * Makefile.in (.c.o): Pass CFLAGS last.
18200         * mpbsd/Makefile.in (.c.o): Likewise.
18201         * mpf/Makefile.in (.c.o): Likewise.
18202         * mpq/Makefile.in (.c.o): Likewise.
18203         * mpz/Makefile.in (.c.o): Likewise.
18204         * mpn/Makefile.in (.c.o): Likewise.
18205         (.S.o): Likewise.
18206
18207         * memory.c: Change allocation error message.
18208
18209         * Makefile.in (install): Prefix gmp.h with $(srcdir).
18210         (install-bsdmp): Prefix mp.h with $(srcdir).
18211
18212         * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
18213
18214         * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
18215         (install targets): Install gmp.info-N.
18216
18217 Sat Feb 24 03:36:52 1996  Torbjorn Granlund  <tege@matematik.su.se>
18218
18219         * mpf/get_str.c: Fix typo.
18220
18221         * mpz/legendre.c: Clarify expression with extra parens.
18222
18223         * version.c (gmp_version): Not static.
18224
18225         * mpf/iset_str.c: Properly return error code.
18226
18227         * mpf/add.c: Delete unused variables.
18228         * mpf/inp_str.c: Likewise.
18229         * mpq/get_d.c: Likewise.
18230
18231         * mpn/generic/dump.c: #include <stdio.h>.
18232         * mpf/dump.c: Likewise.
18233         * mpf/set_str.c: #include <ctype.h>.
18234         (strtol): Declare.
18235
18236         * gmp.h: mpn_sqrt => mpn_sqrtrem.
18237
18238         * Makefile.in (clean, realclean): Clean in mpbsd.
18239         (check): Test in mpf.
18240
18241         * mpf/Makefile.in (clean): Clean in tests.
18242         * mpq/Makefile.in (clean): Clean in tests.
18243
18244         * mpf/tests/Makefile.in: New file.
18245         * mpf/tests/configure.in: New file.
18246         * mpf/tests/t-addsub.c: New file.
18247
18248         * mpf/sub_ui.c: Simply call mpf_sub for now.
18249
18250         * mpf/sub.c: Increase prec by 1.
18251         * mpf/ui_sub.c: Likewise.
18252
18253 Fri Feb 23 00:59:54 1996  Torbjorn Granlund  <tege@matematik.su.se>
18254
18255         * mpf/ui_sub.c: Fix typos.
18256
18257         * mpf/get_str.c: When allocating space for tmp, allow for an extra
18258         limb.  In code for fraction conversion, add special case for bases
18259         that are a power of 2.
18260
18261         * mpf/out_str.c: Output leading "0.".
18262         Default base to 10, before computing string allocation.
18263
18264         * mpf/get_str.c: Make variables for string size have type size_t.
18265         * gmp.h: Corresponding change.
18266
18267         * mpf/random2.c: Allow creation of prec+1 large mantissas.
18268
18269         * mpf/add_ui.c: Don't abort if u < 0; special case for u <= 0.
18270         Fix typo in MPN_COPY offset.
18271         * mpf/sub_ui.c: Analogous changes.
18272
18273         * mpf/set_prec.c: Rewrite.
18274
18275         * mpf/init2.c: Compute precision as in set_prec.c.
18276
18277         * mpf/div_2exp.c: Special case for u == 0.
18278         * mpf/mul_2exp.c: Likewise.  Write r->_mp_size always.
18279
18280         * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
18281         * mpf/sqrt.c: Likewise.  When computing new exponent, round quotient
18282         towards -infinity.
18283
18284         * mpf/add.c: Fix typos.
18285         * mpf/sub.c: Fix typos.
18286
18287 Thu Feb 22 00:24:48 1996  Torbjorn Granlund  <tege@matematik.su.se>
18288
18289         * mpz/Makefile.in (stamp-stddefh): Delete target.
18290         (test): Delete target.
18291         * Makefile.in (stamp-stddefh): Delete target.
18292         (cre-stddefh.o): Delete target.
18293         (gmp.dvi): Set TEXINPUTS before invoking tex.
18294
18295         * cre-stddefh.c: Delete.
18296
18297         * mpz/sqrt.c: Fix typo.
18298
18299         * mpz/powm.c: Special case for mod == 0.
18300         * mpz/powm_ui.c: Likewise.
18301
18302         * mpz/get_si.c: Handle -0x80000000 correctly.
18303
18304         * mpz/inp_str.c: Now returns size_t.
18305         Make it return number of bytes read or error indication.
18306         * mpf/inp_str.c: Likewise.
18307
18308         * mpz/out_raw.c: Replace by mpz/out_binary.c, with modifications.
18309         * mpz/inp_raw.c: Rewrite, using mpz/inp_binary as a base.
18310         * mpz/inp_binary.c: Delete.
18311
18312         * mpn/Makefile.in (XCFLAGS): Remove variable.
18313         (.c.o): Don't pass XCFLAGS.
18314         (SFLAGS): Set to nothing.
18315         (.S.o): Pass SFLAGS, not XCFLAGS.
18316
18317         * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
18318
18319         * mpf/out_str.c: Make return number of bytes written or error
18320         indication.
18321         * mpz/out_str.c: Likewise.
18322         * gmp.h: Corresponding changes.
18323
18324         * gmp.h (__mpz_struct): mp_size_t => int.
18325         (__mpq_struct): Likewise.
18326         (__mpf_struct): Likewise.
18327         (mp_size_t): int => long int.
18328
18329         * mpn/cray: New directory.
18330         * mpn/cray/gmp-mparam.h: New file.
18331         * mpn/configure.in: Recognize cray variants.
18332
18333         * Makefile.in: Set defaults for prefix, libdir, etc.
18334         (install): New target.
18335         (install-bsdmp): New target.
18336         (gmp.html): New target.
18337
18338         * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
18339
18340 Wed Feb 21 04:35:02 1996  Torbjorn Granlund  <tege@matematik.su.se>
18341
18342         * gmp.h: Sort mpn declarations.
18343         (mpn_gcdext): Add declaration.
18344
18345         * mpn/generic/divrem_1.c: New file.
18346         * mpn/Makefile.in (divrem_1.o): New rule.
18347         * configure.in (functions): Add divrem_1.
18348
18349         * mpn/generic/divmod.c: Delete file.
18350         * mpn/configure.in (functions): Delete divmod.
18351         * Makefile.in (divmod.o): Delete rule.
18352         * gmp.h (mpn_divmod): New #define.
18353
18354         * gmp.h (mpn_next_bit_set): Delete spurious declaration.
18355
18356         * mpn/generic/divrem.c (default case): In code assigning
18357         most_significant_q_limb, move reassignment of n0 into if statement.
18358
18359         * gmp.h (mpf_inp_str): Fix typo.
18360         (mpf_out_str): Make prototype match reality.
18361         * mpf/inp_str.c: New file.
18362         * mpf/out_str.c: New file.
18363         * mpf/Makefile.in: Compile new files.
18364
18365         * mpn/Makefile.in (dump.o): Fix dependency path.
18366         (inlines.o): Likewise.
18367
18368         * mpn/configure.in: Make m68060 be the same as m68000.  Clean up
18369         m68k configs.
18370
18371 Tue Feb 20 01:35:11 1996  Torbjorn Granlund  <tege@matematik.su.se>
18372
18373         * mpn/generic/sqrtrem.c: Renamed from sqrt.
18374         * mpn/configure.in (functions): Corresponding change.
18375         * mpn/Makefile.in: Likewise.
18376         * mpz/sqrtrem.c: Likewise.
18377         * mpz/sqrt.c: Likewise.
18378         * mpn/generic/perfsqr.c: Likewise.
18379
18380         * Makefile.in (clean): Also remove libmp.a.
18381         Don't compile cre-conv-tab.c or mp_bases.c.
18382         cre-conv-tab.c: Delete file.
18383         (gmp.ps): New rule.
18384
18385         * mpn/mp_bases.c: New file.
18386         * mpn/Makefile.in: Compile mp_bases.c.
18387
18388         * mpz/set_str.c: Skip initial whitespace.
18389         * mpf/set_str.c: Likewise.
18390         * mpbsd/xtom.c: Likewise.
18391
18392         * gmp.h: Add missing mpz declarations.
18393         Delete all formal parameter names from declarations.
18394
18395         * mpn/Makefile.in: Add dependencies for .c files.
18396
18397         * Makefile.in (check): Write recursive make calls separately, not as
18398         a loop.
18399         (FLAGS_TO_PASS): New variable.  Use it for most recursive makes.
18400
18401 Mon Feb 19 01:02:20 1996  Torbjorn Granlund  <tege@matematik.su.se>
18402
18403         * mpn/Makefile.in (.S.o): Pipe cpp output to grep in order to delete
18404         lines starting with #.
18405         (CPP): Set to $(CC) -E to avoid gcc dependency.
18406
18407         * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
18408
18409         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
18410         code.
18411         * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
18412
18413         * gmp.h: Fix typos in #defines of recently added mpn functions.
18414
18415         * mpz/inp_str.c: Skip all whitespace, not just plain space.
18416         * mpbsd/min.c: Likewise.
18417
18418         * mpn/configure.in (functions): Add gcdext.
18419         * mpn/generic/gcdext.c: New file.
18420
18421         * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
18422
18423         * gmp.h: Surround mpn declarations with extern "C" { ... }.
18424
18425         * Makefile.in (check): New target.
18426
18427         * mpq/get_d.c: Update comments.  Use rsize instead of dsize + N_QLIMBS
18428         when possible.  Add special case for nsize == 0.
18429
18430         * gmp.h (mpq_get_d): Add declaration.
18431         (mpq_canonicalize): Likewise.
18432         (mpq_cmp_ui): Likewise.
18433         (mpf_diff): Likewise.
18434         (mpf_ui_sub): Likewise.
18435         (mpf_set_prec): Likewise.
18436         (mpf_random2): Likewise.
18437
18438         * gmp.h (mpz_cmp_ui): New #define.
18439         (mpz_cmp_si): New #define.
18440         (mpq_cmp_ui): New #define.
18441         (mpz_sign): New #define.
18442         (mpq_sign): New #define.
18443         (mpf_sign): New #define.
18444         (mpq_numref): New #define.
18445         (mpq_denref): New #define.
18446
18447         * mpq/set_z.c: File deleted.
18448         * mpq/Makefile.in: Corresponding changes.
18449
18450 Sun Feb 18 01:34:47 1996  Torbjorn Granlund  <tege@matematik.su.se>
18451
18452         * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
18453
18454         * mpz/inp_binary.c: Default stream to stdin.
18455         * mpz/inp_str.c: Likewise.
18456         * mpz/inp_raw.c: Likewise.
18457         * mpz/out_binary.c: Default stream to stdout.
18458         * mpz/out_raw.c: Likewise.
18459         * mpz/out_str.c: Likewise.
18460
18461         * mpbsd/realloc.c: New file.
18462         * mpbsd/Makefile.in: Corresponding changes.
18463
18464         * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
18465         * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
18466
18467         * mpbsd/mout.c: Rewrite (base on mpz/out_str) but make it output
18468         spaces in each 10th position.
18469         * mpbsd/xtom.c: Rewrite (base on mpz/set_str).
18470
18471         * mpq/tests/Makefile.in (st-cmp): New file.
18472         * mpq/tests/configure.in (srcname): New file.
18473
18474         * mpz/tests/configure.in (srcname): Fix typo.
18475
18476         * mpq/cmp.c: Add check using number of significant bits, to avoid
18477         general multiplication.
18478
18479 Sat Feb 17 11:58:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
18480
18481         * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
18482
18483         * mpq/tests: New directory.
18484         * mpq/tests/t-cmp.c: New file.
18485         * mpq/tests/t-cmp_ui.c: New file.
18486
18487         * mpz/tests/dive.c (main): Generate zero numerator.
18488         (get_random_size) : Delete.
18489
18490         * mpz/divexact.c: Add special case for 0/x.
18491
18492         * gmp.h (mpz_mod): Add declaration.
18493
18494 Fri Feb 16 18:18:39 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
18495
18496         * mpn/m68k/*: Rewrite code not to use the INSN macros.
18497         (L): New macro to properly prefix local labels for ELF.
18498
18499 Fri Feb 16 00:20:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
18500
18501         * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
18502         fields.
18503         * mpn/generic/inlines.c (_FORCE_INLINES): New #define.  Delete
18504         conditional __GNUC__.
18505         * gmp.h (mpn_add, mpn_sub, mpn_add_1, mpn_sub_1):
18506         Only define these if __GNUC__ || _FORCE_INLINES.
18507         * mpf/random2.c: Add missing parameter in non-ANSI header.
18508         * mpn/generic/gcd.c (SIGN_BIT): Do as #define to work around bug
18509         in AIX compilers.
18510         * mpq/get_d.c: #define N_QLIMBS.
18511         * mpz/divexact.c: Obscure division by 0 to silent compiler warnings.
18512         * stack-alloc.c: Cast void* pointer to char* before doing arithmetic
18513         on it.
18514
18515         * Makefile.in (mpbsd/libmpbsd.a): New rule.
18516         * configure.in (configdirs): Add mpbsd.
18517
18518         * gmp.h: Add declarations for a few missing mpn functions.
18519
18520         * Makefile.in (libmp.a): New rule.
18521
18522         * mpbsd/mdiv.c: #include "dmincl.c", not "mpz_dmincl.c"
18523         * gmp.h: Move #define of __GNU_MP__ into the `#if __GNU_MP__' block.
18524         * mp.h: Likewise.  Update typedefs from gmp.h.
18525         * mpbsd/configure.in: New file.
18526         * mpbsd/Makefile.in: New file.
18527         * mpbsd/configure: Link to master configure.
18528         * mpbsd/config.sub: Link to master config.sub.
18529
18530         * Makefile.in: Set RANLIB_TEST.
18531         * (libgmp.a): Use it.
18532         * (libgmp.a): Do ranlib before moving the libgmp.a to the build
18533         directory.
18534         * mp?/Makefile.in: Don't use or set RANLIB.
18535
18536 Thu Feb 15 16:38:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
18537
18538         * mpz/add_ui.c: MP_INT => mpz_t.
18539         * mpz/cmp_ui.c: Likewise.
18540         * mpz/fac_ui.c: Likewise.
18541         * mpz/inp_binary.c: Likewise.
18542         * mpz/inp_raw.c: Likewise.
18543         * mpz/legendre.c: Likewise.
18544         * mpz/jacobi.c: Likewise.
18545         * mpz/out_binary.c: Likewise.
18546         * mpz/out_raw.c: Likewise.
18547         * mpz/random2.c: Likewise.
18548         * mpz/random.c: Likewise.
18549         * mpz/realloc.c: Likewise.
18550
18551         * mpz/legendre.c: __mpz_2factor(X) => mpz_scan1(X,0),
18552         __mpz_odd_less1_2factor => mpz_scan1(X,1).
18553         * mpz/ntsup.c: File deleted.
18554         * mpz/Makefile.in: Corresponding changes.
18555
18556         * mpz/pprime_p: Use mpz_scan1 to avoid looping.
18557
18558         * mpz/fac_ui.c: Type of `k' and `p' is `unsigned long'.
18559         * mpz/pprime_p.c: Pass long to *_ui functions.
18560         * mpz/gcdext.c: Likewise.
18561         * mpz/fdiv_r_2exp.c: Likewise.
18562         * mpz/fac_ui.c: Likewise.
18563
18564         * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
18565
18566         * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
18567
18568         * mpz/cmp_ui.c: #undef mpz_cmp_ui.
18569         * mpz/cmp_si.c: #undef mpz_cmp_si.
18570         * gmp.h (mpz_cmp_ui): New #define.
18571         (mpz_cmp_si): New #define.
18572
18573 Wed Feb 14 22:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
18574
18575         * gmp.h: Test __cplusplus in addition to __STDC__.
18576         * gmp-impl.h: Likewise.
18577
18578         * gmp.h: Surround declarations with extern "C" { ... }.
18579
18580 Tue Feb 13 15:20:45 1996  Torbjorn Granlund  <tege@matematik.su.se>
18581
18582         * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
18583         * mpz/tdiv_r_2exp.c: Likewise.
18584
18585         * mpz/fdiv_r_2exp.c: New file.
18586         * mpz/fdiv_q_2exp.c: New file.
18587         * mpz/tdiv_r_2exp.c: Renamed from mpz/mod_2exp.c.
18588         * mpz/tdiv_q_2exp.c: Renamed from mpz/div_2exp.c
18589         * mpz/Makefile.in: Corresponding changes.
18590
18591         * mpz/scan0.c,scan1.c: New files.
18592         * mpz/Makefile.in: Compile them.
18593
18594         * gmp.h (mpn_normal_size): Delete.
18595
18596         * config.guess: Update from Cygnus version.
18597
18598         * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
18599         * mpn/m68k/lshift.S: Likewise.
18600
18601         * mpn/configure.in: Fix configuration for plain 68000.
18602
18603 Mon Feb 12 01:06:06 1996  Torbjorn Granlund  <tege@matematik.su.se>
18604
18605         * mpz/tests/t-powm.c: Generate negative BASE operand.
18606
18607         * mpz/powm.c: Make result always positive.
18608
18609 Sun Feb 11 01:44:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18610
18611         * mpz/tests/*.c: Add t- prefix.
18612         * mpz/tests/Makefile.in: Corresponding changes.
18613         * mpz/tests/configure.in: Update srctrigger.
18614
18615         * mpz/tests/gcd.c: Generate negative operands.
18616         * mpz/tests/gcd2.c: Likewise.
18617
18618         * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
18619
18620 Thu Feb  8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
18621
18622         * mp{z,n}/gcd.c: Change mpn_gcd interface.
18623         * gmp.h: Ditto.
18624         * gmp.texi: update documentation.
18625
18626 Mon Feb  7 23:58:43 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
18627
18628         * mpn/m68k/{lshift,rshift}.S: New files.
18629         * mpn/m68k/syntax.h: New ELF_SYNTAX macros.
18630         (MEM_INDX, R, PROLOG, EPILOG): New macros.
18631         * mpn/m68k/*.S: Use R macro with register name.  Use PROLOG and EPILOG
18632         macros.  Rename `size' to `s_size' or s1_size to avoid clash with ELF
18633         .size directive.
18634         * mpn/configure.in: New target m68k-*-linux*.
18635
18636 Wed Feb  7 07:41:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18637
18638         * Makefile.in (cre-conv-tab): Workaround for SunOS make.
18639
18640         * mpz/tests/reuse.c: New file.
18641         * mpz/tests/Makefile.in: Handle reuse.c.
18642
18643 Tue Feb  6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
18644
18645         * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
18646
18647 Tue Feb  6 01:36:39 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18648
18649         * gmp.h (mpz_divexact): Delete parameter names.
18650         (mpz_lcm): Delete spurious declaration.
18651
18652         * mpz/dmincl.c: Fix typo.
18653
18654 Mon Feb  5 01:11:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18655
18656         * mpn/generic/gcd.c (gcd_2): Declare consistently.
18657
18658         * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
18659         * mpz/dmincl.c: Likewise.
18660
18661         * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
18662         * mpz/sub.c: Likewise.
18663         * mpn/generic/sqrt.c: Likewise.
18664
18665         * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
18666         destination arrays.
18667
18668 Fri Feb  2 02:21:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18669
18670         * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
18671         * mpz/Makefile.in: Compile them.
18672
18673         * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
18674
18675 Thu Feb  1 02:15:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18676
18677         Change from Ken Weber:
18678         * mpz/divexact.c: Make it work when quot is identical to either input.
18679
18680         * mpf/ui_sub.c: New file.
18681         * mpf/Makefile.in: Compile it.
18682
18683         * gmp-impl.h (MPZ_TMP_INIT): alloca -> TMP_ALLOC.
18684         * mpz/{c,f}div_{q,qr,r}.c: Use TMP_DECL/TMP_MARK/TMP_FREE since
18685         these use MPZ_TMP_INIT.
18686         * mpz/mod.c: Likewise.
18687         * mpq/{add,sub}.c: Likewise.
18688         * mpq/canonicalize: Likewise.
18689
18690         * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
18691         * mpq/canonicalize.c: Likewise.
18692
18693 Wed Jan 31 01:45:00 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18694
18695         * mpn/generic/gcd.c: Misc changes from Ken.
18696
18697         * mpz/tests/gcd2.c: New file.
18698         * mpz/tests/Makefile.in: Handle gcd2.c.
18699
18700         * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
18701         not orig_vsize.  Fix parameter declaration.
18702
18703         * mpz/mod_ui.c: Delete file.
18704         * mpz/Makefile.in: Don't try to compile mod_ui.
18705
18706         * mpz/cdiv_*_ui.c): Make them work right.
18707         * gmp.h: Declare cdiv*.
18708
18709 Tue Jan 30 02:22:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18710
18711         * mpz/{cdiv_q.c,cdiv_q_ui.c,cdiv_qr.c,cdiv_qr_ui.c,cdiv_r.c,
18712         cdiv_r_ui.c,cdiv_ui.c}: New files.
18713         * mpz/Makefile.in: Compile them.
18714
18715         * All files: Make file permissions right.
18716
18717         Changes from Ken Weber:
18718         * mpn/generic/accelgcd.c: Delete.
18719         * mpn/generic/bingcd.c: Delete.
18720         * mpn/generic/numbits.c: Delete.
18721         * mpn/generic/gcd.c: New file.
18722         * mpn/configure.in (functions): Update accordingly.
18723         * mpz/divexact.c: New file.
18724         * mpz/Makefile.in: Compile divexact.c.
18725         * mpz/gcd.c: Rewrite to accommodate for gcd changes in mpn.
18726         * gmp.h: declare new functions, delete obsolete declarations.
18727         * mpz/tests/dive.c: New file.
18728         * mpz/tests/Makefile.in: Handle dive.c.
18729
18730 Mon Jan 29 03:53:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18731
18732         * mpz/random.c: Handle negative SIZE parameter.
18733
18734         * mpz/tests/tdiv(_ui).c: New name for tst-dm(_ui).c.
18735         * mpz/tests/tst-mdm(_ui).c: Delete.
18736         * mpz/tests/fdiv(_ui).c: New test based in tst-mdm(_ui).
18737         * mpz/tests/*.c: Get rid of tst- prefix for DOS 8+3 naming.
18738         * mpz/tests/Makefile.in: Corresponding changes.
18739         * mpz/tests/configure.in: Update srctrigger.
18740
18741         * mpn/generic/divmod.c: Update from divrem.
18742         * mpn/generic/divrem.c: Misc cleanups.
18743
18744 Sun Jan 28 03:25:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18745
18746         * All files: Use new TMP_ALLOC interface.
18747
18748         * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
18749
18750         * mpz/tests/powm_ui.c: New file.
18751         * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
18752
18753         * Makefile.in: Update dependency list.
18754         * mpf/Makefile.in: Likewise.
18755         * mpz/Makefile.in: Likewise.
18756         * mpq/Makefile.in: Likewise.
18757         * Makefile.in: Set RANLIB simply to ranlib, and allow configure
18758         to override it.
18759
18760         * mpz/Makefile.in (conf): Delete spurious target.
18761         (mp_bases.c): Delete.
18762         (cre-conv-tab rules): Delete.
18763
18764         * Makefile.in (cre-conv-tab): Greatly simplify.
18765
18766 Sat Jan 27 13:38:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18767
18768         * stack-alloc.c: New file.
18769         * stack-alloc.h: New file.
18770
18771         * gmp.h (__gmp_inline): Define using __inline__.
18772
18773 Thu Jan 25 00:28:37 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18774
18775         * mpn/generic/scan0.c: New file.
18776         * mpn/generic/scan1.c: Renamed from next_bit.c.
18777         * mpn/configure.in (functions): Include scan0 and scan1.
18778
18779         * mpn/m68k/*: #include sysdep.h.  Use C_GLOBAL_NAME.
18780
18781         * configure: Update from Cygnus version.
18782         * config.guess: Likewise.
18783         * config.sub: Likewise.
18784         * configure: Pass --nfp to recursive configures.
18785
18786         * mpz/tests/tst-*.c: Adjust SIZE and reps.
18787
18788         * mpz/powm.c: Move esize==0 test earlier.
18789         In final reduction of rp,rsize, don't call mpn_divmod unless
18790         reduction is really needed.
18791
18792         * mpz/tests/tst-powm.c: Fix thinko in checking code.
18793
18794         * All files: Get rid of `__' prefix from mpn_* calls and declarations.
18795         * gmp.h: #define __MPN.
18796         * gmp.h: Use __MPN in #defines for mpn calls.
18797
18798         * mpn/generic/mul_n.c: Prepend `i' to internal routines.
18799         * gmp-impl.h: Add #defines using __MPN for those internal routines.
18800
18801         * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
18802
18803 Wed Jan 24 13:28:19 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18804
18805         * mpn/sparc32/udiv_fp.S: New name for udiv_qrnnd.S.
18806         * mpn/sparc32/udiv_nfp.S: New name for v8/udiv_qrnnd.S.
18807         * mpn/sparc32/v8/supersparc: New directory.
18808         * mpn/sparc32/v8/supersparc/udiv.S: New file.
18809
18810 Tue Jan 23 01:10:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18811
18812         This major contribution is from Ken Weber:
18813         * mpn/generic/accelgcd.c: New file.
18814         * mpn/generic/bdivmod.c: New file.
18815         * mpn/generic/bingcd.c: New file.
18816         * mpn/generic/gcd_1.c: Rewrite.
18817         * mpn/generic/numbits.c: New file (to go away soon).
18818         * mpz/gcd.c: Rewrite.
18819         * mpz/tests/tst-gcd.c (SIZE): Now 128.
18820         * gmp.h: Declare new functions.
18821         * mpn/configure.in (functions): List new files.
18822         * gmp-impl.h (MPN_SWAP): Delete.
18823         (MPN_LESS_BITS_LIMB, MPN_LESS_BITS, MPN_MORE_BITS): Delete.
18824         (MPN_COMPL_INCR, MPN_COMPL): Delete.
18825
18826 Mon Jan 22 02:04:59 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18827
18828         * gmp.h (mpn_name): New #define.
18829
18830         * mpn/m88k/mc88110/addmul_1.s: New file.
18831         * mpn/m88k/mc88110/add_n.S: New file.
18832         * mpn/m88k/mc88110/sub_n.S: New file.
18833
18834         * mpn/m88k/sub_n.s: Correctly initialize carry.
18835
18836         * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
18837
18838 Sun Jan 21 00:04:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18839
18840         * mpn/sparc64/addmul_1.s: New file.
18841         * mpn/sparc64/submul_1.s: New file.
18842         * mpn/sparc64/rshift.s: New file.
18843
18844 Sat Jan 20 00:32:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18845
18846         * mpz/iset.c: Fix typo introduced Dec 25.
18847
18848 Wed Jan 17 13:16:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18849
18850         * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
18851         * config/mt-sparcv8-gcc: Delete.
18852         * configure.in: Corresponding changes.
18853
18854 Tue Jan 16 16:31:01 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18855
18856         * gmp-impl.h: #include alloca.h when necessary.
18857
18858         * longlong.h: Test __alpha instead of __alpha__, since the former
18859         is the standard symbol.
18860
18861 Mon Jan 15 18:06:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18862
18863         * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
18864         * mpn/sparc64/lshift.s: New file.
18865
18866 Fri Dec 29 17:34:03 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18867
18868         * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
18869         * mpn/x86/pentium/sub_n.S: Likewise.
18870
18871 Thu Dec 28 03:16:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18872
18873         * mpn/x86/pentium/mul_1.S: Rework loop to avoid AGI between update
18874         of loop induction variable and load insn at beginning of loop.
18875         * mpn/x86/pentium/addmul_1.S: Likewise.
18876         * mpn/x86/pentium/submul_1.S: Likewise.
18877
18878 Mon Dec 25 23:22:55 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18879
18880         * All files: Prefix user-visible structure fields with _mp_.
18881
18882 Fri Dec 22 20:42:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18883
18884         * mpn/configure.in (m68k configs): Terminate path variable with
18885         plain "m68k".
18886
18887 Fri Dec 22 03:29:33 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18888
18889         * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
18890         clean things up.
18891
18892         * mpn/configure.in (m68k configs): Update #include path for new
18893         mpn directory organization.
18894
18895 Tue Dec 12 02:53:02 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18896
18897         * gmp.h: Prefix all structure field with _mp_.
18898         * gmp-impl.h: Define access macros for these fields.
18899
18900 Sun Dec 10 00:47:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18901
18902         * mpn/alpha/addmul_1.s: Prefix labels with `.'.
18903         * mpn/alpha/submul_1.s: Likewise.
18904         * mpn/alpha/[lr]shift.s: Likewise.
18905         * mpn/alpha/udiv_qrnnd.S: Likewise.
18906         * mpn/alpha/ev5/[lr]shift.s: Likewise.
18907
18908         * mpn/alpha/ev5/lshift.s: Fix typos.
18909
18910 Fri Dec  1 14:28:20 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18911
18912         * mpn/Makefile.in (.SUFFIXES): Define.
18913
18914 Wed Nov 29 23:11:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18915
18916         * mpn/sparc64/{add_n.s, sub_n.s}: New files.
18917
18918 Tue Nov 28 06:03:13 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18919
18920         * mpn/x86/syntax.h: Handle ELF_SYNTAX.
18921         Rename GAS_SYNTAX => BSD_SYNTAX.
18922
18923         * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
18924
18925 Mon Nov 27 01:32:12 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18926
18927         * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
18928
18929 Sun Nov 26 04:30:47 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
18930
18931         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
18932
18933         * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
18934         * mpn/sparc32/sub_n.S: Likewise.
18935
18936 Fri Nov 17 00:18:46 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18937
18938         * mpn/configure.in: Handle m68k on NextStep.
18939
18940 Thu Nov 16 02:30:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18941
18942         * mpn: Reorganize machine-specific directories.
18943         * mpn/configure.in: Corresponding changes.
18944         (sh, sh2): Handle these.
18945         (m68k targets): Create asm-syntax.h.
18946
18947 Thu Nov  9 02:20:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18948
18949         * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
18950         (____mpn_mul_n): Likewise.
18951
18952 Tue Nov  7 03:25:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18953
18954         * mpf/get_str.c: In exponentiation code (two places), don't swap
18955         input and output areas when calling mpn_mul_1.
18956         * mpf/set_str.c: Likewise.
18957
18958 Fri Nov  3 02:35:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18959
18960         * mpf/Makefile.in: Make sure all objects are listed in dependency list;
18961         delete spurious entries.
18962
18963         * mpf/mul.c: Handle U or V being 0.  Allow prec+1 for result precision.
18964
18965         * mpf/set_prec.c: New computation of limb precision.
18966         * mpf/set_dfl_prec.c: Likewise.
18967
18968         * mpf/random2.c: Fix typo computing exp.
18969         * mpf/get_str.c: In (uexp > usize) case, set n_limbs as a function of
18970         the user-requested number of digits, n_digits.
18971
18972 Thu Nov  2 16:25:07 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18973
18974         * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
18975         never read.
18976         (default case): Put most significant limb from np in new variable n2;
18977         decrease size argument for MPN_COPY_DECR; use n2 instead of np[dsize].
18978
18979 Wed Nov  1 02:59:53 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18980
18981         * mpn/sparc/[lr]shift.S: New files.
18982
18983 Tue Oct 31 00:08:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18984
18985         * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
18986
18987         * gmp-impl.h (assert): Delete definition.
18988
18989         * mpf/sub.c: Delete all assert calls.  Delete variable `cy'.
18990
18991         * mpf/neg.c: Use prec+1 as precision.  Optimize for when arguments
18992         are the same.
18993         * mpf/abs.c: Likewise.
18994         * mpf/{set,neg,abs}.c: Make structure and variable names similar.
18995
18996 Mon Oct 30 12:45:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
18997
18998         * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
18999         * mpn/generic/random2.c (random): Likewise.
19000
19001 Sun Oct 29 01:54:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19002
19003         * mpf/div.c: Special handle U or V being 0.
19004
19005         * mpf/random2.c: New file.
19006
19007         * longlong.h (i860 rshift_rhlc): Define.
19008         (i960 udiv_qrnnd): Define.
19009         (i960 count_leading_zeros): Define.
19010         (i960 add_ssaaaa): Define.
19011         (i960 sub_ddmmss): Define.
19012         (i960 rshift_rhlc): Define.
19013
19014 Sat Oct 28 19:09:15 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19015
19016         * mpn/pentium/rshift.S: Fix and generalize condition for when to use
19017         special code for shift by 1.
19018         * mpn/pentium/lshift.S: Likewise.
19019
19020 Thu Oct 26 00:02:56 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19021
19022         * gmp.h: #undef __need_size_t.
19023         * mp.h: Update from gmp.h.
19024
19025 Wed Oct 25 00:17:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19026
19027         * mpf/Makefile.in: Compile set_prec.c.
19028         * mpf/realloc.c: Delete this file.
19029         * mpf/Makefile.in: Delete mentions of realloc.c.
19030
19031         * gmp.h (__mpf_struct): Get rid of `alloc' field.
19032         * mpf/clear.c: Likewise.
19033         * mpf/init*.c: Likewise.
19034         * mpf/set_prec.c: Likewise.
19035         * mpf/iset*.c: Likewise.
19036
19037         * mpf/iset_str.c: New file.
19038
19039         * mpn/configure.in: Handle pyramid.
19040
19041         * mpf/set.c: Use prec+1 as precision.
19042
19043         * mpf/set_prec.c: New file.
19044
19045 Tue Oct 24 00:56:41 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19046
19047         * mpn/generic/divrem.c: New file.  Will replace mpn/generic/divmod.c
19048         when rest of source is converted.
19049         * mpn/configure.in (functions): Add `divrem'
19050         * mpn/generic/set_str.c: Never call __mpn_mul_1 with zero size.
19051
19052         * mpf/get_str.c: Completely rewritten.
19053         * mpf/add.c: Fix several problems.
19054         * mpf/sub.c: Compare operands from most significant end until
19055         first difference, exclude skipped limbs from computation.
19056         Accordingly simplify normalization code.
19057         * mpf/set_str.c: Fix several problems.
19058         * mpf/dump.c: New file.
19059         * mpf/Makefile.in: Compile dump.c.
19060         * mpf/init2.c: Set prec field correctly.
19061
19062 Sun Oct 22 03:02:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19063
19064         * cre-conv-tab.c: #include math.h; don't declare log and floor.
19065
19066 Sat Oct 21 23:04:10 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19067
19068         * mpf/mul_ui.c: Handle U being 0.
19069
19070 Wed Oct 18 19:39:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19071
19072         * mpn/generic/set_str.c: Correctly handle input like "000000000000".
19073         Misc cleanups.
19074
19075 Tue Oct 17 15:14:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19076
19077         * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
19078         appropriate.
19079
19080 Mon Oct 16 19:14:43 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19081
19082         * mpf/add.c: Rewrite.
19083         * mpf/set_str.c: New file.  Needs more work.
19084
19085 Sat Oct 14 00:14:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19086
19087         * mpf/div_2exp.c: Vastly simplify.
19088         * mpf/mul_2exp.c: Likewise.
19089
19090         * mpf/sub.c: Rewrite.
19091
19092         * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
19093
19094         * mpf/dump.c: Free allocated memory.
19095
19096         * gmp-impl.h (assert): Define.
19097
19098 Wed Oct 11 13:31:00 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19099
19100         * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
19101
19102 Tue Oct 10 00:37:21 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19103
19104         * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
19105
19106         * mpn/powerpc32/{lshift.s,rshift.s}: New files.
19107
19108         * configure.in: Fix typo.
19109
19110 Sat Oct  7 08:17:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19111
19112         * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
19113
19114 Wed Oct  4 16:31:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19115
19116         * mpn/configure.in: Handle alphaev5.
19117         * mpn/ev4: New name for alpha subdir.
19118         * mpn/ev5: New subdir.
19119         * mpn/ev5/lshift.s: New file.
19120
19121 Tue Oct  3 15:06:45 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19122
19123         * mpn/alpha/mul_1.s: Avoid static increments of pointers; use
19124         corresponding offsets in ldq and stq instructions instead.
19125         (Loop): Swap cmpult and stq to save one cycle on EV5.
19126
19127         * mpn/tests/{add_n.s,sub_n.s,lshift.s,rshift.s,mul_1.s,addmul_1.s,
19128         submul_1.s}: Don't check results if NOCHECK is defined.
19129
19130 Mon Oct  2 11:40:18 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19131
19132         * longlong.h (mips umul_ppmm [32 and 64 bit versions]):
19133         Make new variants, based on GCC version number, that use `l' and `h'
19134         constraints instead of explicit mflo and mfhi instructions
19135
19136 Sun Oct  1 00:17:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19137
19138         * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
19139         * mpn/mc88100/sub_n.s: Likewise.
19140
19141         * config/mt-m88110: New file.
19142         * configure.in: Use it.
19143
19144         * mpn/mc88110/mul_1.s: Fix thinko.
19145
19146 Sat Sep 30 21:28:19 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19147
19148         * mpz/set_d.c: Declare `size' at function start.
19149
19150         * experimental: New directory for mpx and mpz2.
19151
19152         * mpz/tdiv_q.c: Clarify comments.
19153         * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
19154
19155         * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
19156
19157         * mpn/sh/{add_n.s,sub_n.s}: New files.
19158
19159         * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
19160
19161         * mpn/i960/{add_n.s,sub_n.s}: New files.
19162
19163         * mpn/alpha/addmul_1.s (Loop): Move decrement of r18 to before umulh,
19164         to save cycles on EV5.
19165         * mpn/alpha/submul_1.s: Ditto.
19166         * mpn/alpha/mul_1.s: Ditto.
19167
19168 Thu Sep 28 02:48:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19169
19170         * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
19171         _LONG_LONG_LIMB is defined.
19172
19173         * longlong.h (m88110): Test __m88110__, not __mc88110__
19174
19175         * mpn/mc88110/mul_1.s: Rewrite.
19176
19177 Tue Sep 26 23:29:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19178
19179         * config.sub: Update from current Cygnus version.
19180
19181         * mpn/configure.in: Recognize canonical m88*, not mc88*.
19182
19183 Fri Sep 22 14:58:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19184
19185         * mpz/set_d.c: New file.
19186         * mpz/Makefile.in: Build new files.
19187
19188         * mpq/get_d.c: Replace usage of scalbn with ldexp.
19189
19190         * mpn/{vax,i386}/gmp-mparam.h: New files.
19191         * gmp-impl.h (ieee_double_extract): Define here.
19192         * mpf/set_d.c (ieee_double_extract): Not here.
19193
19194 Thu Sep 21 00:56:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19195
19196         * longlong.h (C umul_ppmm): Use UWtype, not USItype for temps.
19197         (udiv_qrnnd): For cases implemented with call to __udiv_qrnnd,
19198         protect with new symbol LONGLONG_STANDALONE.
19199         (68000 umul_ppmm): Use %# prefix for immediate constants.
19200
19201 Wed Sep 20 15:36:23 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19202
19203         * mpn/generic/divmod_1.c: Handle
19204         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
19205         specifically also when normalization_steps != 0.
19206
19207 Mon Sep 18 15:42:30 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19208
19209         * mpq/get_d.c: New file.
19210
19211 Sun Sep 17 02:04:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19212
19213         * longlong.h (pyr): Botch up for now.
19214
19215 Sat Sep 16 00:11:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19216
19217         * mpn/clipper/mul_1.s: New file.
19218         * mpn/clipper/add_n.s: New file.
19219         * mpn/clipper/sub_n.s: New file.
19220         * mpn/configure.in: Handle clipper*-*-*.
19221
19222         * mpn/configure.in: Recognize rs6000-*-*.
19223
19224 Fri Sep 15 00:41:34 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19225
19226         * mpn/alpha/add_n.s: New file.
19227         * mpn/alpha/sub_n.s: New file.
19228
19229         * mpn/mips3: New name for mpn/r4000.
19230         * mpn/mips2: New name for mpn/r3000.
19231         * mpn/configure.in: Corresponding changes.
19232
19233         * mpn/generic/perfsqr.c (primes): Delete.
19234         (residue_map): Delete.
19235
19236 Thu Sep 14 00:07:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19237
19238         * mpn/r3000/sub_n.s: Fix typo.
19239
19240         * dm_trunc.c: Delete spurious file.
19241
19242         * mpz/out_binary.c: Fix typo.
19243
19244         * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
19245
19246         * gmp-impl.h: For sparc and sgi, include alloca.h.
19247
19248         * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'.  Replace
19249         `ldk r,#0' with `xor r,r'.
19250
19251 Wed Sep  6 00:58:38 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19252
19253         * mpz/inp_binary.c: New file.
19254         * mpz/out_binary.c: New file.
19255         * mpz/Makefile.in: Build new files.
19256
19257 Tue Sep  5 22:53:51 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19258
19259         * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
19260         and size fields.
19261
19262 Sat Sep  2 17:47:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19263
19264         * mpn/r4000/{add_n.s,sub_n.s}: Optimize away some pointer arithmetic.
19265         * mpn/r3000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files,
19266         derived from r4000 code.
19267
19268 Fri Sep  1 05:35:52 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19269
19270         * mpn/r3000/mul_1.s: Fix typo.
19271
19272         * mpn/powerpc32: Fix some old vs new mnemonic issues.
19273
19274         * mpn/powerpc32/{add_n.s,sub_n.s}: New files.
19275         * mpn/r4000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files.
19276
19277 Wed Aug 30 10:43:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19278
19279         * mpn/r3000/mul_1.s ($LC1): Use addiu for immediate add.
19280         * mpn/r4000/{mul_1.s,addmul_1.s,submul_1.s}: New files.
19281
19282         * config.guess: Update to latest FSF revision.
19283
19284 Mon Aug 28 02:18:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19285
19286         * mpz/out_str.c: Cast str to char * in fputs call.
19287
19288         * gmp-impl.h: Define UQItype, SItype, and USItype also
19289         when not __GNUC__.
19290
19291 Fri Aug 25 01:45:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19292
19293         * mpn/i386/syntax.h: Renamed from asm-syntax.h.
19294         * mpn/mc68020/syntax.h: Renamed from asm-syntax.h.
19295         * mpn/configure.in: Corresponding changes.
19296
19297 Sun Aug 13 19:20:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
19298
19299         * mpn/generic/random2.c: Test __hpux, not hpux.
19300
19301 Sat Apr 15 20:50:33 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19302
19303         * mpn/sparc/add_n.S: Make it work for PIC.
19304         * mpn/sparc/sub_n.s: Likewise.
19305         * mpn/sparc8/addmul_1.S: Likewise.
19306         * mpn/sparc8/mul_1.S: Likewise.
19307         * mpn/i386/add_n.S: Likewise.
19308         * mpn/i386/sub_n.S: Likewise.
19309
19310 Thu Apr 13 23:15:03 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19311
19312         * mpn/configure.in: Don't search power subdir for generic ppc configs.
19313         Add some ppc cpu-specific configs.  Misc clean up.
19314
19315 Mon Apr 10 00:16:35 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19316
19317         * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
19318
19319 Sun Apr  9 12:38:11 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19320
19321         * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
19322         not in asm.
19323
19324         * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
19325
19326 Tue Mar 28 00:19:52 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19327
19328         * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
19329
19330 Fri Mar 17 23:29:22 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19331
19332         * longlong.h (SH umul_ppmm): Define.
19333
19334 Thu Mar 16 16:40:44 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19335
19336         * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
19337         to help CSE.
19338
19339 Fri Mar 10 20:03:49 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19340
19341         * mpn/powerpc32/mul_1.s: Clear cy before entering loop.
19342         Rearrange loop to save a cycle.
19343         * mpn/powerpc32/addmul_1.s: New file.
19344         * mpn/powerpc32/submul_1.s: New file.
19345
19346 Fri Feb 17 22:44:45 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19347
19348         * mpn/configure.in: Set target_makefile_frag for freebsd
19349         in new case stmt.
19350         * mpn/config/t-freebsd: New file.
19351         * mpn/Makefile.in: Add #### for frag insertion.
19352         (XCFLAGS): Clear by default.
19353         (.c.o, .S.o rules): Pass XCFLAGS.
19354
19355 Tue Feb  7 16:27:50 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19356
19357         * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
19358
19359 Tue Jan 24 04:23:20 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
19360
19361         * longlong.h (default umul_ppmm): Store input parameters in temporaries
19362         to avoid reading them twice.
19363         (default smul_ppmm): New definition.
19364
19365 Thu Dec 29 04:20:07 1994  Jim Meyering  (meyering@comco.com)
19366
19367         * generic/perfsqr.c (__mpn_perfect_square_p): Remove declaration
19368         of unused variable.
19369         * generic/pre_mod_1.c (__mpn_preinv_mod_1): Likewise.
19370         * mpz/powm.c (pow): Likewise.
19371
19372         * mpz/and.c (mpz_and): Use {} instead of `;' for empty else clause
19373         to placate `gcc -Wall'.
19374         * mpz/ior.c (mpz_ior): Likewise.
19375
19376 Wed Dec 28 13:31:40 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19377
19378         * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
19379
19380 Mon Dec 26 17:15:36 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19381
19382         * longlong.h: Test for more symbols, in __mc68000__ case.
19383
19384         * mpn/mpn/config.sub: Recognize m68060.
19385         * mpn/configure.in: Change mc* to m* for 68k targets.
19386         * mpn/Makefile.in (.S.o): Delete spurious creation of temp .c file.
19387
19388 Mon Dec 19 01:56:30 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19389
19390         * config.sub: Recognize pentium as a valid CPU.
19391         * mpn/configure.in: Handle pentium specifically, to use new assembly
19392         code.
19393
19394 Mon Dec 19 00:13:01 1994  Jim Meyering  (meyering@comco.com)
19395
19396         * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
19397         is defined.
19398         * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
19399
19400 Mon Dec 19 00:04:54 1994  Kent Boortz  (boortz@sics.se)
19401
19402         * Makefile.in (recursive makes): Pass CFLAGS.
19403
19404 Sun Dec 18 22:34:49 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19405
19406         * mpn/pentium: New directory.
19407
19408         * mpz/pprime.c: Make sure to mpz_clear all temporaries.
19409
19410         * longlong.h: Don't use udiv instruction when SUPERSPARC is defined.
19411         * configure.in: Handle supersparc*-.
19412         * config/mt-supspc-gcc: New file.
19413         * config/mt-sparc8-gcc: New name for mt-sparcv8-gcc.
19414
19415 Mon Dec 12 22:22:10 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19416
19417         * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
19418         #include sysdep.h before asm-syntax.h.
19419
19420         * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
19421         * mpn/i386/asm-syntax.h: Likewise.
19422
19423         * mpn/mc68020/asm-syntax.h: New name for asm.h.
19424         * mpn/i386/asm-syntax.h: New name for asm.h.
19425
19426 Tue Dec  6 21:55:25 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19427
19428         * mpz/array_init.c: Fix typo in declaration.
19429
19430 Fri Nov 18 19:50:52 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19431
19432         * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
19433
19434 Mon Nov 14 00:34:12 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19435
19436         * mpn/generic/random2.c (random): Test for __svr4__.
19437
19438 Wed Oct 12 23:28:16 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19439
19440         * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
19441
19442 Tue Aug 23 17:16:35 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19443
19444         * mpz/perfsqr.c: Use mpn_perfect_square_p.
19445         * mpn/generic/perfsqr.c: New file.
19446
19447 Wed Jul  6 13:46:51 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19448
19449         * mpz/array_init.c: New file.
19450         * mpz/Makefile.in: Compile array_init.
19451         * gmp.h: Declare mpz_array_init.
19452
19453 Mon Jul  4 01:10:03 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19454
19455         * mpz/add.c: Fix bogus comment.
19456         * mpz/sub.c: Likewise.
19457
19458 Sat Jul  2 02:14:56 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19459
19460         * mpn/generic/pre_mod_1.c: New file.
19461         * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
19462
19463 Fri Jul 01 22:10:19 1994  Richard Earnshaw (rwe11@cl.cam.ac.uk)
19464
19465         * longlong.h (arm umul_ppmm): Fix typos in last change.  Mark
19466         hard-coded registers with "%|"
19467
19468 Thu Jun 30 03:59:33 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19469
19470         * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
19471         Use __mpn_mod_1.
19472         * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
19473
19474 Wed Jun 29 18:45:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19475
19476         * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
19477
19478         * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
19479
19480         * gmp.h: Use "defined (__STDC__)" consistently.
19481
19482 Tue Jun 28 18:44:58 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19483
19484         * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
19485
19486         * mpz/tests/Makefile.in: Use CFLAGS for linking.
19487
19488         * Makefile.in (CFLAGS): Use -O2 here.
19489         * mpn/Makefile (CFLAGS): Not here.
19490
19491         * mpq/cmp_ui.c: Fix typo.
19492         * mpq/canonicalize.c: Fix typo.
19493         * mpz/gcd_ui.c: Handle gcd(0,v) and gcd(u,0) correctly.
19494         * mpn/generic/gcd_1.c: Fix braino in last change.
19495
19496 Mon Jun 27 16:10:27 1994  Torbjorn Granlund  (tege@rtl.cygnus.com)
19497
19498         * mpz/gcd_ui.c: Change return type and return result.
19499         Allow destination param to be NULL.
19500         * gmp.h: Corresponding change.
19501         * mpn/generic/gcd_1.c: Handle zero return from mpn_mod_1.
19502
19503 Tue Jun 14 02:17:43 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
19504
19505         * mpn/i386/asm.h (ALIGN): Make it take a parameter.
19506         * mpn/i386/*.S: Use ALIGN to align all loops.
19507
19508         * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
19509         (Makes old versions of GAS happy.)
19510
19511 Sat May 28 01:43:54 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19512
19513         * Many files: Delete unused variables and labels.
19514         * mpn/generic/dump.c: cast printf width argument to int.
19515
19516 Wed May 25 00:42:37 1994  Torbjorn Granlund  (tege@thepub.cygnus.com)
19517
19518         * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
19519         (xmod): Ignore return value of __mpn_divmod.
19520         (xmod): Improve normalization code.
19521
19522 Sat May 21 01:30:09 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19523
19524         * mpz/gcdext.c: Cosmetic changes.
19525
19526         * mpz/fdiv_ui.c: New file.
19527
19528 Fri May 20 00:24:53 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19529
19530         * mpz/tests/Makefile.in: Use explicit rules for running tests,
19531         not a shell loop.
19532         (clean): Delete stmp-*.
19533
19534         * mpz/Makefile.in: Update.
19535
19536         * mpz/div_ui.c: Don't include longlong.h.
19537         * mpz/dm_ui.c: Likewise.
19538
19539         * mpz/fdiv_q.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr.c, mpz/fdiv_qr_ui.c,
19540         mpz/fdiv_r.c, mpz/fdiv_r_ui.c: New files.  Code partly from deleted
19541         mdm.c, mdm_ui.c, etc, partly rewritten.
19542         * mpz/dm_floor_ui.c, mpz/dm_floor.c: Delete.
19543         * mpz/mdm.c, mpz/mdm_ui.c, mpz/mdiv.c, mpz/mdiv_ui.c, mpz/mmod.c,
19544         mpz/mmod_ui.c: Delete.
19545
19546         * mpz/tdiv_q.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr.c, mpz/tdiv_qr_ui.c,
19547         mpz/tdiv_r.c, mpz/tdiv_r_ui.c:
19548         New names for files implementing truncating division.
19549         * mpz/div_ui.c, mpz/dm_ui.c, mpz/mod_ui.c: Simplify.
19550
19551         * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
19552         instead.
19553         (clean): Delete tmp-*.
19554
19555 Thu May 19 01:37:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19556
19557         * mpz/cmp.c: Call __mpn_cmp.
19558
19559         * mpz/popcount.c: Fix typo.
19560
19561         * mpz/powm_ui.c: Simplify main loop.  Keep principal operand size
19562         smaller than MSIZE when possible.
19563         * mpz/powm.c: Likewise.
19564
19565         * mpn/generic/sqrt.c: Move alloca calls into where the memory is
19566         needed.  Simplify.
19567
19568         * gmp.h: (_PROTO): New macro.
19569         Add many function declarations; use _PROTO macro in all declarations.
19570
19571         * mpf/*.c: Prepend mpn calls with __.
19572
19573 Wed May 18 20:57:06 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19574
19575         * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
19576         functions.
19577
19578         * mpf/div_ui.c: Simplify.
19579
19580 Tue May 17 01:05:14 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19581
19582         * mpz/*.c: Prepend mpn calls with __.
19583
19584         * mpz/mul_ui.c: Use mpn_mul_1.
19585
19586 Mon May 16 17:19:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19587
19588         * mpn/i386/mul_1.S: Use C_GLOBAL_NAME.
19589         * mpn/i386/mul_1.S, mpn/i386/addmul_1.S, mpn/i386/submul_1.S:
19590         Nuke use of LAB.
19591
19592 Sat May 14 14:21:02 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19593
19594         * gmp-impl.h: Don't define abort here.
19595
19596         * mpz/pow_ui.c: Increase temporary allocation.
19597         * mpz/ui_pow_ui.c: Likewise.
19598
19599         * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
19600
19601         * All Makefile.in: Delete spurious -I arguments.
19602         Update dependencies.
19603
19604         * mpz/popcount.c: New file.
19605         * mpz/hamdist.c: New file.
19606
19607         * All configure: Latest version from Cygnus.
19608
19609         * mpq/Makefile.in: New file.
19610         * mpq/configure.in: New file.
19611         * Makefile.in, configure.in: Enable compilation of mpq.
19612
19613         * mpq/set_z.c: Fix typos.
19614         * mpq/canonicalize.c: Fix typos.
19615         * mpq/cmp_ui.c: Fix typos.
19616
19617         * mpf/add_ui.c: Read U->D into UP always.  Delete spurious MPN_COPY.
19618         * mpf/sub_ui.c: Likewise.
19619
19620         * gmp-impl.h: Don't redefine alloca.
19621
19622         * COPYING.LIB: Renamed from COPYING.
19623
19624 Wed May 11 01:45:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
19625
19626         * mpz/powm_ui.c: When shifting E left by C+1, handle out-of-range
19627         shift counts.  Fix typo when testing negative_result.
19628         * mpz/powm.c: Likewise.
19629
19630         * mpz/ui_pow_ui.c: New file.
19631         * mpz/Makefile.in: Update.
19632
19633         * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
19634
19635         * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
19636         * mpz/gcd.c: Declare mpn_xmod.
19637
19638         * mpz/powm.c: Major changes to accommodate changed mpn semantics.
19639         * mpz/powm_ui.c: Update from mpz/powm.c.
19640
19641         * mpz/tests/tst-io.c: New file.
19642         * mpz/tests/tst-logic: New file.
19643         * mpz/tests/Makefile.in: Update.
19644
19645         * mpz/inp_str.c: Get base right when checking for first digit.
19646         * mpz/inp_str.c: Allocate more space for DEST when needed.
19647
19648         * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
19649         * mpz/and.c, mpz/ior.c: Likewise.  Simplify somewhat.
19650
19651         * mpz/add_ui.c: Use mpn_add_1 and mpn_sub_1.
19652         Rename parameters to be consistent with mpz/sub_ui.
19653         General simplifications.
19654         * mpz/sub_ui.x: Likewise.
19655
19656 Tue Aug 10 19:41:16 1993  Torbjorn Granlund  (tege@prudens.matematik.su.se)
19657
19658         * mpf: New directory.
19659         * mpf/*.c: Merge basic set of mpf functions.
19660
19661         * Many logs missing...
19662
19663 Sun Apr 25 18:40:26 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
19664
19665         * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
19666         * bsd/xtom.c: Likewise.
19667
19668         * mpz/div.c: Remove free_me and free_me_size and their usage.
19669         Use mpn_divmod for division; corresponding changes in return value
19670         convention.
19671         * mpz/powm.c: `carry_digit' => `carry_limb'.
19672         * bsd/sdiv.c: Clearify comment.
19673
19674 Sun Apr 25 00:31:28 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
19675
19676         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
19677
19678 Sat Apr 24 16:23:33 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
19679
19680         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
19681
19682         * gmp-impl.h: #define ABS.
19683         * (Many files): Use ABS instead of abs.
19684
19685         * mpn/generic/sqrt.c, mpz/clrbit.c, mpz/get_si.c, mpz/mod_2exp.c,
19686         mpz/pow_ui.c: Cast 1 to mp_limb before shifting.
19687
19688         * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
19689         non-32-bit machines.
19690
19691 Tue Apr 20 13:13:58 1993  Torbjorn Granlund  (tege@du.nada.kth.se)
19692
19693         * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
19694         rounding them down to fit.
19695
19696         * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
19697
19698         * mpz/inp_str.c (char_ok_for_base): New function.
19699         (mpz_inp_str): Use it.
19700
19701 Sun Mar 28 21:54:06 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
19702
19703         * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
19704
19705 Mon Mar 15 11:44:06 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
19706
19707         * mpz/pprime.c: Declare param `const'.
19708         * gmp.h: Add declarations for mpz_com.
19709
19710 Thu Feb 18 14:10:34 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
19711
19712         * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
19713
19714 Fri Feb 12 20:27:34 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
19715
19716         * mpz/inp_str.c: Recog minus sign as first character.
19717
19718 Wed Feb  3 01:36:02 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
19719
19720         * mpz/iset.c: Handle 0 size.
19721
19722 Tue Feb  2 13:03:33 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
19723
19724         * mpz/mod_ui.c: Initialize dividend_size before it's used.
19725
19726 Mon Jan  4 09:11:15 1993  Torbjorn Granlund  (tege@sics.se)
19727
19728         * bsd/itom.c: Declare param explicitly 'signed'.
19729         * bsd/sdiv.c: Likewise.
19730
19731         * mpq/cmp.c: Remove unused variable tmp_size.
19732         * mpz/powm_ui.c: Fix typo in esize==0 if stmt.
19733         * mpz/powm.c: Likewise.
19734
19735 Sun Nov 29 01:16:11 1992  Torbjorn Granlund  (tege@sics.se)
19736
19737         * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
19738         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
19739         specifically.
19740
19741         * Reorganize sources.  New directories mpn, mpn/MACH, mpn/generic,
19742         mpz, mpq, bsd.  Use full file name for change logs hereafter.
19743
19744 Wed Oct 28 17:40:04 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
19745
19746         * longlong.h (__hppa umul_ppmm): Fix typos.
19747         (__hppa sub_ddmmss): Swap input arguments.
19748
19749         * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
19750         initializator.
19751
19752 Sun Oct 25 20:30:06 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
19753
19754         * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
19755         specifically (used to consider all negative numbers prime).
19756
19757         * mpz_powm_ui: `carry_digit' => `carry_limb'.
19758
19759         * sdiv: Handle zero dividend specifically.  Replace most code in
19760         this function with a call to mpn_divmod_1.
19761
19762 Fri Sep 11 22:15:55 1992  Torbjorn Granlund  (tege@tarrega.sics.se)
19763
19764         * mpq_clear: Don't free the MP_RAT!
19765
19766         * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
19767
19768 Thu Sep  3 01:47:07 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
19769
19770         * All files: Remove leading _ from mpn function names.
19771
19772 Wed Sep  2 22:21:16 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
19773
19774         Fix from Jan-Hein Buhrman:
19775         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
19776
19777         * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
19778         life.
19779
19780 Sun Aug 30 18:37:15 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
19781
19782         * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
19783         * _mpz_get_str: Don't remove leading zeros.  Abort if there are some.
19784
19785 Wed Mar  4 17:56:56 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19786
19787         * gmp.h: Change definition of MP_INT to make the & before params
19788         optional.  Use typedef to define it.
19789         * mp.h: Use typedef to define MINT.
19790
19791 Tue Feb 18 14:38:39 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19792
19793         longlong.h (hppa umul_ppmm): Add missing semicolon.  Declare type
19794         of __w1 and __w0.
19795
19796 Fri Feb 14 21:33:21 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19797
19798         * longlong.h: Make default count_leading_zeros work for machines >
19799         32 bits.  Prepend `__' before local variables to avoid conflicts
19800         with users' variables.
19801
19802         * mpn_dm_1.c: Remove udiv_qrnnd_preinv ...
19803         * gmp-impl.h: ... and put it here.
19804         * mpn_mod_1: Use udiv_qrnnd_preinv if it is faster than udiv_qrnnd.
19805
19806 Tue Feb 11 17:20:12 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19807
19808         * mpn_mul: Enhance base case by handling small multiplicands.
19809         * mpn_dm_1.c: Revert last change.
19810
19811 Mon Feb 10 11:55:15 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19812
19813         * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
19814
19815 Fri Feb  7 16:26:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19816
19817         * mpn_mul: Replace code for base case.
19818
19819 Thu Feb  6 15:10:42 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19820
19821         * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
19822         pre-inverting divisor.
19823
19824 Sun Feb  2 11:10:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19825
19826         * longlong.h: Make __LLDEBUG__ work differently.
19827         (_IBMR2): Reinsert old code.
19828
19829 Sat Feb  1 16:43:00 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19830
19831         * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
19832         using floating point operations.  Don't define
19833         UDIV_NEEDS_NORMALIZATION any longer.
19834
19835 Fri Jan 31 15:09:13 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19836
19837         * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
19838         * longlong.h (#ifdef __hppa): Define umul_ppmm.
19839
19840 Wed Jan 29 16:41:36 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19841
19842         * mpn_cmp: Only one length parameter, assume operand lengths are
19843         the same.  Don't require normalization.
19844         * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
19845         new mpn_cmp definition.
19846
19847 Tue Jan 28 11:18:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19848
19849         * _mpz_get_str: Fix typo in comment.
19850
19851 Mon Jan 27 09:44:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19852
19853         * Makefile.in: Add new files.
19854
19855         * mpn_dm_1.c: New file with function _mpn_divmod_1.
19856         * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
19857         * mpz_div_ui: Likewise.
19858
19859         * mpn_mod_1.c: New file with function _mpn_mod_1.
19860         * mpz_mod_ui: Use _mpn_mod_1.
19861
19862 Thu Jan 23 18:54:09 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19863
19864         Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
19865         * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
19866         Handle dividend == 0.
19867
19868 Wed Jan 22 12:02:26 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19869
19870         * mpz_pprime.c: Use "" for #include.
19871
19872 Sun Jan 19 13:36:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19873
19874         * mpn_rshiftci.c (header): Correct comment.
19875
19876 Wed Jan 15 18:56:04 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19877
19878         * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
19879         to make space for ignored quotient at the end.  (The quotient might
19880         always be an extra limb.)
19881
19882 Tue Jan 14 21:28:48 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19883
19884         * mpz_powm_ui: Fix comment.
19885         * mpz_powm: Likewise.
19886
19887 Mon Jan 13 18:16:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19888
19889         * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
19890
19891 Sun Jan 12 13:54:28 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19892
19893         Fixes from Kazumaro Aoki:
19894         * mpz_out_raw: Take abs of size to handle negative values.
19895         * mpz_inp_raw: Reallocate before reading ptr from X.
19896         * mpz_inp_raw: Store, don't read, size to x->size.
19897
19898 Tue Jan  7 17:50:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
19899
19900         * gmp.h, mp.h: Remove parameter names from prototypes.
19901
19902 Sun Dec 15 00:09:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19903
19904         * tests/Makefile.in: Prepend "./" to file names when executing
19905         tests.
19906
19907         * Makefile.in: Fix many problems.
19908
19909 Sat Dec 14 01:00:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19910
19911         * mpn_sqrt.c: New file with _mpn_sqrt.
19912         * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
19913         * msqrt.c: Delete.  Create from mpz_sqrtrem.c in Makefile.in.
19914         * mpz_do_sqrt.c: Delete.
19915         * Makefile.in: Update to reflect these changes.
19916
19917         * Makefile.in, configure, configure.subr: New files
19918         (from bothner@cygnus.com).
19919         * dist-Makefile: Delete.
19920
19921         * mpz_fac_ui: Fix comment.
19922
19923         * mpz_random2: Rewrite a bit to make it possible for the most
19924         significant limb to be == 1.
19925
19926         * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
19927
19928 Fri Dec 13 23:10:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19929
19930         * mpz_do_sqrt: Simplify special case for U == 0.
19931         * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
19932           Rename _mpz_impl_sqrt to _mpz_do_sqrt.
19933
19934 Fri Dec 13 12:52:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19935
19936         * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
19937
19938 Thu Dec 12 22:17:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19939
19940         * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
19941         variables to mp_size.
19942
19943 Wed Dec 11 22:00:34 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19944
19945         * mpn_rshift.c: Fix header comments.
19946
19947 Mon Dec  9 17:46:10 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19948
19949         Released 1.2.
19950
19951         * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
19952
19953         * dist-Makefile: Add missing dependency for cre-mparam.
19954
19955         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
19956           mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
19957
19958         * dist-Makefile (clean): clean in tests subdir too.
19959         * tests/Makefile: Define default values for ROOT and SUB.
19960
19961         * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
19962         2 constraint.
19963
19964 Mon Nov 11 00:06:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19965
19966         * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
19967
19968 Sat Nov  9 23:47:38 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19969
19970         Released 1.1.94.
19971
19972         * dist-Makefile, Makefile, tests/Makefile: Merge tests into
19973         distribution.
19974
19975 Fri Nov  8 22:57:19 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19976
19977         * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
19978
19979 Thu Nov  7 22:06:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19980
19981         * longlong.h: Cosmetic changes to keep it identical to gcc2 version
19982         of longlong.h.
19983         * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
19984         sub_ddmmss.
19985
19986 Mon Nov  4 00:36:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19987
19988         * mpn_mul: Fix indentation.
19989
19990         * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
19991         4294967296.0).
19992         * mpz_do_sqrt: Handle overflow in conversion from double returned
19993         by SQRT to mp_limb.
19994
19995         * gmp.h: Add missing function definitions.
19996
19997 Sun Nov  3 18:25:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
19998
19999         * mpz_pow_ui: Change type of `i' to int.
20000
20001         * ChangeLog: Add change log entry.
20002         * ChangeLog: Add change log entry.
20003         * ChangeLog: Add change log entry.
20004         * ChangeLog: Add change log entry.
20005         * ChangeLog: Add change log entry.
20006         * ChangeLog: Add change log entry.
20007         * ChangeLog: Add change log entry.
20008         * ChangeLog: Add change log entry.
20009 Stack overflow.
20010
20011         * mpz_pow_ui.c: Fix typo in comment.
20012
20013         * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
20014         * mpz_powm_ui.c: Add code for rpow.
20015         * rpow.c: Delete this file.  The rpow function is now implemented
20016         in mpz_powm_ui.c.
20017
20018         * mpz_fac_ui.c: New file.
20019         * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
20020
20021         Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
20022         * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
20023         the first argument not smaller than the second.
20024
20025 Tue Oct 29 13:56:55 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20026
20027         * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
20028         header text.
20029
20030 Mon Oct 28 00:35:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20031
20032         * mpz_random2: Handle size == 0.
20033
20034         * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
20035         chars_per_bit_exactly, and change its definition.
20036         * cre-conv-tab.c (main): Output field according to its new
20037         definition.
20038         * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
20039         Use chars_per_bit_exactly.
20040
20041         * mpz_random2: Change the loop termination condition in order to
20042         get a large most significant limb with higher probability.
20043
20044         * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
20045         * mpz_get_si.c: New file.
20046         * dist-Makefile: Add mpz_random2 and mpz_get_si.
20047
20048         * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
20049         power of 2, giving exact result.
20050
20051         * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
20052         * mpn_mul: New macro KARATSUBA_THRESHOLD.
20053         * mpn_mul (karatsuba's algorithm): Don't write intermediate results
20054         to prodp, use temporary pp instead.  (Intermediate results can be
20055         larger than the final result, possibly writing into hyperspace.)
20056         * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
20057         shortcut algorithm.
20058         * mpn_mul: Fix typo, cy instead of xcy.  Unify carry handling code.
20059
20060 Sun Oct 27 19:57:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20061
20062         * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
20063         when usize > 1.5 vsize.
20064
20065         * mpn_mul: Break between classical and Karatsuba's algorithm at
20066         KARATSUBA_THRESHOLD, if defined.  Default to 8.
20067
20068         * mpn_div: Kludge to fix stray memory read.
20069
20070 Sat Oct 26 20:06:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20071
20072         * mpz_gcdext: Handle a = b = 0.  Remove memory leakage by calling
20073         mpz_clear for all temporary variables.
20074
20075         * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
20076         function's argument constraints.  Compute wsize correctly.
20077
20078         * mpz_gcd: Fix typo in comment.
20079
20080         * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
20081         abort if allocation fails, don't just exit.
20082
20083 Fri Oct 25 22:17:20 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20084
20085         * mpz_random2.c: New file.
20086
20087 Thu Oct 17 18:06:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20088
20089         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
20090         * mpq_cmp: Take sign into account, don't just compare the
20091         magnitudes.
20092         * mpq_cmp: Call _mpn_mul in the right way, with the first argument
20093         not smaller than the second.
20094
20095 Wed Oct 16 19:27:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20096
20097         * mpz_random: Ensure the result is normalized.
20098
20099 Tue Oct 15 14:55:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20100
20101         * mpz_clrbit: Support non-ANSI compilers.
20102
20103 Wed Oct  9 18:03:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20104
20105         * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
20106
20107 Tue Oct  8 17:42:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20108
20109         * mpz_mdm_ui: Add comments.
20110
20111         * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
20112         * mpz_init_ui: Change spacing and header comment.
20113
20114 Thu Oct  3 18:36:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20115
20116         * dist-Makefile: Prepend `./' before some filenames.
20117
20118 Sun Sep 29 14:02:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20119
20120         Released 1.1 (public).
20121
20122         * mpz_com: New name of mpz_not.
20123         * dist-Makefile: Change mpz_not to mpz_com.
20124
20125 Tue Sep 24 12:44:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20126
20127         * longlong.h: Fix header comment.
20128
20129 Mon Sep  9 15:16:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20130
20131         Released 1.0.92.
20132
20133         * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
20134         case.
20135
20136         * longlong.h (m68000 umul_ppmm): Clobber one register less by
20137         slightly rearranging the code.
20138
20139 Sun Sep  1 18:53:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20140
20141         * dist-Makefile (stamp-stddefh): Fix typo.
20142
20143 Sat Aug 31 20:41:31 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20144
20145         Released 1.0.91.
20146
20147         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
20148           mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
20149         * gmp.h, gmp.texi: Define the new functions.
20150
20151 Fri Aug 30 08:32:56 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20152
20153         * mpz_gcdext: Compute t argument from the other quantities at the
20154           end, of the function, not in the loop.  New feature: Allow t to be
20155           NULL.
20156
20157         * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
20158           include "mp.h".  Use type name `MP_INT' always.
20159
20160         * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
20161
20162 Wed Aug 28 00:45:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20163
20164         * dist-Makefile (documentation): Go via tmp.texi to avoid the
20165           creation of gmp.dvi if any errors occur.  Make tex read input
20166           from /dev/null.
20167
20168 Fri Aug 23 15:58:52 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20169
20170         * longlong.h (68020, i386): Don't define machine-dependent
20171           __umulsidi3 (so the default definition is used).
20172         * longlong.h (all machines): Cast all operands, sources and
20173           destinations, to `unsigned long int'.
20174         * longlong.h: Add gmicro support.
20175
20176 Thu Aug 22 00:28:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20177
20178         * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
20179         * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
20180         * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
20181         * _mpz_get_str.c: Add code to do division by big_base using only
20182           umul_qrnnd, if that is faster.  Use UMUL_TIME and UDIV_TIME to
20183           decide which variant to use.
20184
20185 Wed Aug 21 15:45:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20186
20187         * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
20188           nops.  (Saves two insn.)
20189
20190         * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
20191           branch, and to permit input/output register overlap.
20192
20193         * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
20194         * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
20195           asm statements (gives better code if either the upper or lower
20196           part of the product is unused.
20197
20198 Tue Aug 20 17:57:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20199
20200         * _mpz_get_str.c (outside of functions): Remove
20201           num_to_ascii_lower_case and num_to_ascii_upper_case.  Use string
20202           constants in the function instead.
20203
20204 Mon Aug 19 00:37:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20205
20206         * cre-conv-tab.c (main): Output table in hex.  Output 4 fields, not
20207           3, for components 0 and 1.
20208
20209         * gmp.h: Add declaration of mpq_neg.
20210
20211         Released 1.0beta.13.
20212
20213         * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
20214           comparing to enum literals SPC and EOF.  This makes the code work
20215           for compilers where `char' is unsigned.  (Bug found by Brian
20216           Beuning).
20217
20218         Released 1.0beta.12.
20219
20220         * mpz_mod_ui: Remove references to quot.  Remove quot_ptr, quot_size
20221           declarations and assignment code.
20222
20223 Sun Aug 18 14:44:26 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20224
20225         * mpz_mod_ui: Handle dividend < 0.
20226
20227         Released 1.0beta.11.
20228
20229         * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
20230           general structure, variable names, etc.
20231
20232         * sdiv: Un-normalize the remainder in n1 before it is negated.
20233
20234         * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
20235           udiv_qrnnd.
20236
20237         * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
20238           the quotient size if the dividend size is incremented.  (Bug found
20239           by Brian Beuning.)
20240
20241         * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
20242           (Bug found by Brian Beuning.)
20243
20244         * mpz_mod_ui: Replace "digit" by "limb".
20245
20246         * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
20247           for non-32-bit machines (PP is hardwired for such machines).
20248         * mpz_perfsqr.c (outside of functions): Define PP value with an L.
20249
20250         * mpn_mul.c (_mpn_mul): Add verification code that is activated if
20251           DEBUG is defined.  Replace "digit" by "limb".
20252         * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
20253           after the addition.
20254         * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
20255           and v0_size, and according to the result, swap arguments in
20256           recursive call.  (Don't violate mpn_mul's own argument
20257           constraints.)
20258
20259 Fri Aug 16 13:47:12 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20260
20261         Released 1.0beta.10.
20262
20263         * longlong.h (IBMR2): Add udiv_qrnnd.
20264
20265         * mpz_perfsqr: Remove unused variables.
20266
20267         * mpz_and (case for different signs): Initialize loop variable i!
20268
20269         * dist-Makefile: Update automatically generated dependencies.
20270         * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
20271           etc to dependency file lists.
20272
20273         * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
20274           `unsigned long int'.
20275         * longlong.h: Add `int' after `unsigned' and `long' everywhere.
20276
20277 Wed Aug 14 18:06:48 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20278
20279         * longlong.h: Add ARM, i860 support.
20280
20281         * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
20282
20283 Tue Aug 13 21:57:43 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20284
20285         * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
20286           mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
20287         * gmp-impl.h: Put it here, and make it `const'.
20288         * cre-conv-tab.c (main): Make struct __mp_bases `const'.
20289
20290 Mon Aug 12 17:11:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20291
20292         * cre-conv-tab.c (main): Use %lu in printf for long ints.
20293
20294         * dist-Makefile: Fix cre-* dependencies.
20295
20296         * cre-conv-tab.c (main): Output field big_base_inverted.
20297
20298         * gmp-impl.h (struct bases): New field big_base_inverted.
20299         * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
20300           to float (in order to keep the structure smaller).
20301
20302         * mp.h, gmp.h: Change names of macros for avoiding multiple
20303           includes.
20304
20305 Fri Aug  9 18:01:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20306
20307         * _mpz_get_str: Only shift limb array if normalization_steps != 0
20308           (optimization).
20309
20310         * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
20311         * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
20312           and m1 (overlap between output and input operands did not work).
20313         * longlong.h: Add VAX, ROMP and HP-PA support.
20314         * longlong.h: Sort the machine dependent code in alphabetical order
20315           on the CPU name.
20316         * longlong.h: Hack comments.
20317
20318 Thu Aug  8 14:13:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20319
20320         Released 1.0beta.9.
20321
20322         * longlong.h: Define BITS_PER_LONG to 32 if it's not already
20323           defined.
20324         * Define __BITS4 to BITS_PER_LONG / 4.
20325         * Don't assume 32 bit word size in "count_leading_zeros" C macro.
20326           Use __BITS4 and BITS_PER_LONG instead.
20327
20328         * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
20329
20330         * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
20331           even for plain mc68000.
20332
20333         * mpq_div: Flip the sign of the numerator *and* denominator of the
20334           result if the intermediate denominator is negative.
20335
20336         * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
20337
20338         * mpz_and.c: Compute the result size more conservatively.
20339         * mpz_ior.c: Likewise.
20340
20341         * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
20342
20343         * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
20344           BSDMP_SRCS.
20345
20346         * dist-Makefile: Create mult.c from mpz_mul.c.
20347         * mult.c: Delete this file.
20348
20349         * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
20350           not done properly if the input string had many leading zeros).
20351
20352 Sun Aug  4 16:54:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20353
20354         * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
20355           work with VPATH and GNU MP.
20356
20357         * mpz_gcd: Don't call mpz_set; inline its functionality.
20358
20359         * mpq_mul, mpq_div: Fix several serious typos.
20360
20361         * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
20362           zero.
20363
20364         * mpq_neg.c: New file.
20365
20366         * dist-Makefile: Remove obsolete dependencies.
20367
20368         * mpz_sub: Fix typo.
20369
20370         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
20371         * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
20372           is just 1.
20373         * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
20374
20375 Sat Aug  3 23:45:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20376
20377         * longlong.h: Clean up comments.
20378         * longlong.h: #undef internal macros.
20379
20380 Fri Aug  2 18:29:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20381
20382         * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
20383         * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
20384
20385         * mpz_dmincl.c: Normalize the remainder before shifting it back.
20386
20387         * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
20388
20389         * mpn_div.c: Fix comment.
20390
20391         * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
20392           type, in order to work for both GNU and Berkeley functions.
20393
20394         * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
20395           madd.c from mpz_add.c, msub.c from mpz_sub.c.
20396           respectively.
20397         * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
20398         * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
20399           Berkeley function name variants.
20400         * dist-Makefile: Add created files to "clean" target.
20401
20402 Tue Jul 16 15:19:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20403
20404         * mpq_get_den: No need for absolute value of the size, the
20405           denominator is always positive.
20406
20407         * mpz_get_ui: If the operand is zero, return zero.  Don't read the
20408           limb array!
20409
20410         * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
20411           is the size of the remainder.
20412
20413 Mon Jul 15 11:08:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20414
20415         * Several files: Remove unused variables and functions.
20416
20417         * gmp-impl.h: Declare _mpz_impl_sqrt.
20418
20419         * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
20420           UDIV_NEEDS_NORMALIZATION.  (Fix from Brian Beuning.)
20421
20422         * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
20423
20424         * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
20425         * mpz_ior: Add missing else statement in OP1 | -OP2 case.
20426         * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
20427         * mpz_ior: Duplicate _mpz_realloc code.
20428
20429         * mpz_and: Add missing else statement in -OP1 & -OP2 case.
20430         * mpz_and: Rewrite OP1 & -OP2 case.
20431         * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
20432
20433         * mpz_gcdext: Loop in d1.size (not b->size).  (Fix from Brian
20434           Beuning.)
20435
20436         * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call.  (Fix from
20437           Brian Beuning.)
20438
20439 Fri Jul 12 17:10:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20440
20441         * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
20442           mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
20443           New files.
20444
20445         * mpz_dmincl.c: Remove second re-allocation of rem->d.  It
20446           was never executed.
20447
20448         * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
20449           some unixes' test doesn't have the -r option).
20450
20451         * *.*: Cast allocated pointers to the appropriate type (makes old C
20452           compilers happier).
20453
20454         * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
20455           after conversion to double.  (Kludge for broken C compilers.)
20456
20457         * dist-Makefile (stamp-stddefh): New target.  Test if "stddef.h"
20458           exists in the system and creates a minimal one if it does not
20459           exist.
20460         * cre-stddefh.c: New file.
20461         * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
20462         * dist-Makefile (clean): Add some more.
20463         * gmp.h, mp.h: Unconditionally include "stddef.h".
20464
20465 Thu Jul 11 10:08:21 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20466
20467         * min: Do ungetc of last read character.
20468         * min.c: include stdio.h.
20469
20470         * dist-Makefile: Go via tmp- files for cre* redirection.
20471         * dist-Makefile: Add tmp* to "clean" target.
20472
20473         * dist-Makefile: Use LOCAL_CC for cre*, to simplyfy cross
20474           compilation.
20475
20476         * gmp.h, mp.h: Don't define NULL here.
20477         * gmp-impl.h: Define it here.
20478
20479 Wed Jul 10 14:13:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20480
20481         * mpz_mod_2exp: Don't copy too much, overwriting most significant
20482           limb.
20483
20484         * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
20485           reallocating res, if op[12]_ptr got their value from alloca.
20486
20487         * mpz_and, mpz_ior: Clear up comments.
20488
20489         * cre-mparam.c: Output parameters for `short int' and `int'.
20490
20491         * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
20492
20493 Tue Jul  9 18:40:30 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20494
20495         * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
20496           (Fix for Sun lossage.)
20497
20498         * gmp.h: Add declaration of mpq_clear.
20499
20500         * dist-Makefile: Chack if "ranlib" exists, before using it.
20501         * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
20502         * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
20503
20504 Fri Jul  5 19:08:09 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20505
20506         * move: Remove incorrect comment.
20507
20508         * mpz_free, mpq_free: Rename to *_clear.
20509         * dist-Makefile: Likewise.
20510         * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
20511
20512         * mpz_dmincl.c: Don't call "move", inline its functionality.
20513
20514 Thu Jul  4 00:06:39 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20515
20516         * Makefile: Include dist-Makefile.  Fix dist target to include
20517           dist-Makefile (with the name "Makefile" in the archive).
20518
20519         * dist-Makefile: New file made from Makefile.  Add new mpz_...
20520           functions.
20521
20522         * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
20523           functionality.  Avoids code duplication.
20524         * pow.c, mpz_powm.c: Include mpz_powincl.c
20525
20526         * mpz_dmincl.c: New file containing general division code.  Avoids
20527           code duplication.
20528         * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
20529           mpz_dmincl.c.
20530
20531         * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
20532           Instead, write the overlapping memory copying inline.
20533
20534         * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
20535
20536         * longlong.h: Don't use #elif.
20537         * mpz_do_sqrt.c: Likewise.
20538
20539         * longlong.h: Use __asm__ instead of asm.
20540         * longlong.h (sparc udiv_qrnnd): Make it to one string over several
20541           lines.
20542
20543         * longlong.h: Preend __ll_ to B, highpart, and lowpart.
20544
20545         * longlong.h: Move array t in count_leading_zeros to the new file
20546           mp_clz_tab.c.  Rename the array __clz_tab.
20547         * All files: #ifdef for traditional C compatibility.
20548
20549 Wed Jul  3 11:42:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20550
20551         * mpz_and: Initialize res_ptr always (used to be initialized only
20552           when reallocating).
20553
20554         * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
20555           `unsigned int', and cast the multiplications.  This way
20556           compilers more easily can choose cheaper multiplication
20557           instructions.
20558
20559         * mpz_mod_2exp: Handle input argument < modulo argument.
20560         * mpz_many: Make sure mp_size is the type for sizes, not int.
20561
20562         * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
20563           mpq_div: Change mpz_init* interface.  Structure pointer as first
20564           arg to initialization function, no longer *return* struct.
20565
20566 Sun Jun 30 19:21:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20567
20568         * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
20569           character file name length limit.
20570
20571         * Most files: Rename MINT to MP_INT.  Rename MRAT to MP_RAT.
20572         * mpz_sizeinb.c: New file with function mpz_sizeinbase.
20573         * mp_bases.c: New file, with array __mp_bases.
20574         * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
20575           __mp_bases instead.
20576         * mout, mpz_out_str: Use array __mp_bases instead of function
20577           _mpz_get_cvtlen.
20578         * mpz_get_cvtlen.c: Remove.
20579         * Makefile: Update.
20580
20581 Sat Jun 29 21:57:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20582
20583         * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
20584         * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
20585         * longlong.h (__sparc__): Don't call .umul; expand asm instead.
20586           Don't define __umulsidi3 (i.e. use default definition).
20587
20588 Mon Jun 24 17:37:23 1991  Torbjorn Granlund  (tege@amon.sics.se)
20589
20590         * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
20591           Swap 't' and 's'.
20592
20593 Sat Jun 22 13:54:01 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20594
20595         * mpz_gcdext.c: New file.
20596
20597         * mpn_mul: Handle carry and unexpected operand sizes in last
20598           additions/subtractions.  (Bug trigged when v1_size == 1.)
20599
20600         * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
20601         * mpq_*: Call mpz_init*.
20602
20603         * mpz_pow_ui, rpow: Use _mpn_mul instead of mult.  Restructure.
20604
20605 Wed May 29 20:32:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20606
20607         * mpz_get_cvtlen: multiply by size.
20608
20609 Sun May 26 15:01:15 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
20610
20611         Alpha-release 0.95.
20612
20613         Fixes from Doug Lea (dl@g.oswego.edu):
20614         * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE).  Adjust PROD_SIZE
20615           correctly.
20616         * mpz_div: Prepend _ to mpz_realloc.
20617         * mpz_set_xs, mpz_set_ds: Fix typos in function name.
20618
20619 Sat May 25 22:51:16 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
20620
20621         * mpz_divmod_ui: New function.
20622
20623         * sdiv: Make the sign of the remainder correct.
20624
20625 Thu May 23 15:28:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20626
20627         * Alpha-release 0.94.
20628
20629         * mpz_mul_ui: Include longlong.h.
20630
20631         * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
20632           of msqrt.
20633
20634         * mpz_impl_sqrt: Don't call "move", inline its functionality.
20635
20636         * mdiv: Use MPN_COPY instead of memcpy.
20637         * rpow, mpz_mul, mpz_mod_2exp: Likewise.
20638         * pow.c: Likewise, and fix bug in the size arg.
20639
20640         * xtom: Don't use mpz_alloc, inline needed code instead.  Call
20641           _mpz_set_str instead of mpz_set_str.
20642
20643         * Makefile: Make two libraries, libmp.a and libgmp.a.
20644
20645 Thu May 22 20:25:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20646
20647         * Add manual to distribution.
20648         * Fold in many missing routines descibed in the manual.
20649         * Update Makefile.
20650
20651 Wed May 22 13:48:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20652
20653         * mpz_set_str: Make it handle 0x prefix OK.
20654
20655 Sat May 18 18:31:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20656
20657         * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
20658           arguments.
20659         * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
20660         * min: Likewise.
20661
20662 Thu May 16 20:43:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20663
20664         * memory.c: Make the default allocations functions global.
20665         * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
20666           default memory function.
20667
20668 Wed May  8 20:02:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20669
20670         * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
20671           even if no normalization is needed.
20672         * mpz_div: Rework reallocation scheme, to avoid excess copying.
20673
20674         * mpz_sub_ui.c, mpz_add_ui.c: New files.
20675
20676         * mpz_cmp.c, mpz_cmp_ui.c: New files.
20677
20678         * mpz_mul_2exp: Handle zero input MINT correctly.
20679
20680         * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
20681
20682         * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
20683
20684 Tue May  7 15:44:58 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20685
20686         * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
20687         * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
20688         * gcd, mpz_gcd: Likewise.
20689
20690         * gcd, mpz_gcd: Handle common 2 factors correctly.
20691
20692 Mon May  6 20:22:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20693
20694         * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
20695
20696         * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
20697
20698 Sun May  5 15:16:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20699
20700         * mpz_div: Remove test for QUOT == 0.
20701
20702 Sun Apr 28 20:21:04 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20703
20704         * pow: Don't make MOD normalization in place, as it's a bad idea to
20705           write on an input parameter.
20706         * pow: Reduce BASE if it's > MOD.
20707         * pow, mult, mpz_mul: Simplify realloc code.
20708
20709 Sat Apr 27 21:03:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20710
20711         * Install multplication using Karatsuba's algorithm as default.
20712
20713 Fri Apr 26 01:03:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20714
20715         * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
20716
20717         * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
20718           left, respectively.
20719         * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
20720
20721         * mlshift.c, mrshift.c: Remove.
20722
20723 Wed Apr 24 21:39:22 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20724
20725         * mpn_mul: Check only for m2_size == 0 in function header.
20726
20727 Mon Apr 22 01:31:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20728
20729         * karatsuba.c: New file for Karatsuba's multplication algorithm.
20730
20731         * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
20732
20733         * mpn_cmp: Fix header comment.
20734
20735 Sun Apr 21 00:10:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20736
20737         * pow: Switch off initial base reduction.
20738
20739 Sat Apr 20 22:06:05 1991  Torbjorn Granlund  (tege@echnaton.sics.se)
20740
20741         * mpz_get_str: Don't generate initial zeros for initial word.
20742           Used to write outside of allocated storage.
20743
20744 Mon Apr 15 15:48:08 1991  Torbjorn Granlund  (tege@zevs.sics.se)
20745
20746         * _mpz_realloc: Make it accept size in number of mp_digits.
20747         * Most functions: Use new _mpz_realloc definition.
20748
20749         * mpz_set_str: Remove calls _mp_free_func.
20750
20751         * Most functions: Rename mpn_* to _mpn_*.  Rename mpz_realloc to
20752           _mpz_realloc.
20753         * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
20754         * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
20755         * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
20756
20757 Sat Apr  6 14:05:16 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
20758
20759         * mpn_mul: Multiply by the first digit in M2 in a special
20760           loop instead of zeroing the product area.
20761
20762         * mpz_abs.c: New file.
20763
20764         * sdiv: Implement as mpz_div_si for speed.
20765
20766         * mpn_add: Make it work for second source operand == 0.
20767
20768         * msub: Negate the correct operand, i.e. V before swapping, not
20769           the smaller of U and V!
20770         * madd, msub: Update abs_* when swapping operands, and not after
20771           (optimization).
20772
20773 Fri Apr  5 00:19:36 1991  Torbjorn Granlund  (tege@black.nada.kth.se)
20774
20775         * mpn_sub: Make it work for subtrahend == 0.
20776
20777         * madd, msub: Rewrite to minimize mpn_cmp calls.  Ensure
20778           mpn_cmp is called with positive sizes (used to be called
20779           incorrectly with negative sizes sometimes).
20780
20781         * msqrt: Make it divide by zero if fed with a negative number.
20782         * Remove if statement at end of precision calculation that was
20783           never true.
20784
20785         * itom, mp.h: The argument is of type short, not int.
20786
20787         * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
20788
20789         * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
20790
20791         * Add COPYING to distribution.
20792
20793         * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
20794
20795 Fri Mar 15 00:26:29 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
20796
20797         * Add Copyleft headers to all files.
20798
20799         * mpn_mul.c, mpn_div.c: Add header comments.
20800         * mult.c, mdiv.c: Update header comments.
20801
20802         * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
20803           mpq_free.c: New files for rational arithmetics.
20804
20805         * mpn_lshift.c: Avoid writing the most significant word if it is 0.
20806
20807         * mdiv.c: Call mpn_lshift for the normalization.
20808         * mdiv.c: Remove #ifdefs.
20809
20810         * Makefile: Add ChangeLog to DISTFILES.
20811
20812         * mpn_div.c: Make the add_back code work (by removing abort()).
20813         * mpn_div.c: Make it return if the quotient is size as compared
20814           with the difference NSIZE - DSIZE.  If the stored quotient is
20815           larger than that, return 1, otherwise 0.
20816         * gmp.h: Fix mpn_div declaration.
20817         * mdiv.c: Adopt call to mpn_div.
20818         * mpz_div.c: New file (developed from mdiv.c).
20819
20820         * README: Update routine names.
20821
20822 Thu Mar 14 18:45:28 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
20823
20824         * mpq_mul.c: New file for rational multplication.
20825
20826         * gmp.h: Add definitions for rational arithmetics.
20827
20828         * mpn_div: Kludge the case where the high numerator digit > the
20829           high denominator digit.  (This code is going to be optimized later.)
20830
20831         * New files: gmp.h for GNU specific functions, gmp-common.h for
20832           definitions common for mp.h and gmp.h.
20833
20834         * Ensure mp.h just defines what BSD mp.h defines.
20835
20836         * pow.c: Fix typo for bp allocation.
20837
20838         * Rename natural number functions to mpn_*, integer functions to
20839           mpz_*.
20840
20841 Tue Mar  5 18:47:04 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
20842
20843         * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
20844           "n0 >= r" to "n0 > r".
20845
20846         * msqrt: Tune the increasing precision scheme, to do fewer steps.
20847
20848 Tue Mar  3 18:50:10 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
20849
20850         * msqrt: Use the low level routines.  Use low precision in the
20851         beginning, and increase the precision as the result converges.
20852         (This optimization gave a 6-fold speedup.)
20853
20854
20855 \f
20856 Local Variables:
20857 mode: indented-text
20858 left-margin: 8
20859 fill-column: 79
20860 version-control: never
20861 eval: (unless (string-match "GNU Emacs \\(21\.[4-9]\\|22\.\\)" (emacs-version))
20862         (save-excursion
20863           (goto-char (point-min))
20864           (when (looking-at "Copyright")
20865             (search-forward "\n\n")
20866             (skip-chars-forward "\n")
20867             (narrow-to-region (point) (point-max))
20868             (message "Note! narrowed to hide copyright notice"))))
20869 End: