Upload Tizen:Base source
[external/gmp.git] / ChangeLog
1 2010-02-05  Torbjorn Granlund  <tege@gmplib.org>
2
3         * Version 5.0.1 released.
4
5         * mpn/generic/powm.c: Use rp target area for power table computation in
6         order to use less scratch.
7
8         * mpn/generic/binvert.c (mpn_binvert_itch): Enable more economical
9         mpn_mulmod_bnm1_itch call.
10
11         * mpn/generic/mu_div_qr.c: Remove always true #if.
12         * mpn/generic/mu_divappr_q.c: Likewise.
13         * mpn/generic/mu_bdiv_q.c: Likewise.
14         * mpn/generic/mu_bdiv_qr.c: Likewise.
15
16 2010-02-01  Torbjorn Granlund  <tege@gmplib.org>
17
18         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
19         Bump version info.
20
21         * mpn/powerpc64/mode64/gmp-mparam.h: Remove {MUL,SQR}_FFT_TABLE2.
22         * mpn/x86/p6/gmp-mparam.h: Likewise.
23         * mpn/x86/p6/mmx/gmp-mparam.h: Likewise.
24         * mpn/generic/mul_fft.c: Don't depend on FFT_TABLE2, it was broken.
25
26 2010-01-29  Torbjorn Granlund  <tege@gmplib.org>
27
28         * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Remove arguments n, m,
29         k and rec; add argument sqr.  Don't call mpn_mul_fft_decompose here,
30         instead do that in all callers.
31         (mpn_mul_fft): Trim allocation when squaring, and use TMP_ALLOC*, not
32         explicit alloc/free.
33         (mpn_fft_div_2exp_modF): Avoid a scalar division.
34         (mpn_fft_mul_modF_K): Replace some multiplies by K with shifting by k.
35         (mpn_fft_mul_2exp_modF): Make function more symmetrical.
36
37 2010-01-27  Torbjorn Granlund  <tege@gmplib.org>
38
39         * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): Rewrite.
40         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Re-enable
41         better mulmod itch estimate.
42         * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
43         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
44         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
45
46 2010-01-27 Marco Bodrato <bodrato@mail.dm.unipi.it>
47
48         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Disabled guessed
49         estimate, enabled a conservative one.
50         * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
51         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
52         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
53
54 2010-01-26 Marco Bodrato <bodrato@mail.dm.unipi.it>
55
56         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Partial rewrite to
57         reduce memory usage.
58         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
59         (mpn_sqrmod_bnm1_next_size): New function.
60
61         * gmp-impl.h (mpn_mulmod_bnm1_itch): Accepts 3 parameters now.
62         (mpn_sqrmod_bnm1_itch): New inline function.
63         (mpn_sqrmod_bnm1_next_size): Declaration and mangling.
64         * mpn/generic/nussbaumer_mul.c: Use the new functions.
65
66         * mpn/generic/invertappr.c (mpn_ni_invertappr): Use new syntax for
67         mpn_mulmod_bnm1_itch.
68         * mpn/generic/mu_divappr_q.c (mpn_mu_divappr_q_itch): Likewise.
69         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Likewise.
70         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Likewise.
71         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_itch): Likewise.
72         * mpn/generic/binvert.c (mpn_binvert_itch): Likewise.
73         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): Likewise.
74         (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Likewise.
75
76         * tests/mpn/t-sqrmod_bnm1.c, tests/mpn/t-mulmod_bnm1.c: Test
77         reduced memory usage.
78
79 2010-01-25  Torbjorn Granlund  <tege@gmplib.org>
80
81         * tune/tuneup.c (INSERT_FFTTAB): New macro, like old insertion code but
82         also inserting a sentinel.
83         (fftmes): Use INSERT_FFTTAB for inserting new measurements.
84         Limit k range to best_k - 4 ... best_k + 4.
85
86 2010-01-23  Torbjorn Granlund  <tege@gmplib.org>
87
88         * gmp-h.in (__GNU_MP_VERSION_PATCHLEVEL): Bump.
89         (__GMP_MP_RELEASE): New macro.
90
91         * mpf/div.c: Rewrite to use mpn_div_q.
92
93 2010-01-21  Torbjorn Granlund  <tege@gmplib.org>
94
95         * Add FFT_TABLE3 tables for a basic set of machines.
96
97         * configure.in: Use -mtune=nocona for 64-bit pentium4.
98
99         * config.guess: Recognise many more Intel processors.
100
101         * tune/common.c: Whitespace cleanup.
102         (speed_mpn_matrix22_mul): Rewrite.
103
104 2010-01-21  Niels Möller  <nisse@lysator.liu.se>
105
106         * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Take
107         advantage of new mpn_mulmod_bnm1 interface, to reduce allocation.
108
109         * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1, main): Adapted to
110         mpn_mulmod_bnm1 interface change.
111
112         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Interface change,
113         in case an + bn < rn, only write an + bn output limbs. New input
114         requirement, an + bn > rn/2.
115         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Corresponding
116         changes.
117
118 2010-01-19  Torbjorn Granlund  <tege@gmplib.org>
119
120         * tune/tuneup.c (fftmes): Round up initial n according to initial k.
121         Limit k to 24 in loop.  Remove an obsolete always-true condition.
122         Remove a redundant trace printout.
123
124 2010-01-18  Torbjorn Granlund  <tege@gmplib.org>
125
126         * tune/tuneup.c (fftmes): New function
127         (fft): Rewrite.
128         (mpn_mul_fft_lcm): New function, copied from mpn/generic/mul_fft.c.
129         (fftfill): New function, code taken from mul_fft.c (mpn_mul_fft).
130         (cached_measure): New function.
131
132         * gmp-impl.h (struct fft_table_nk): Moved from mul_fft.c.
133         (MUL_FFT_TABLE3, SQR_FFT_TABLE3): Provide dummy versions for tuneup
134         builds.
135         (FFT_TABLE3_SIZE): Increase value for tuneup builds.
136
137         * mpn/generic/mul_fft.c: Handle a new FFT threshold table type ("3").
138         Misc cleanups to old table type code.
139
140 2010-01-16  Torbjorn Granlund  <tege@gmplib.org>
141
142         * mpn/x86_64/darwin.m4: Fix typo in last change.
143
144 2010-01-15  Torbjorn Granlund  <tege@gmplib.org>
145
146         * gmp-h.in (__GMP_EXTERN_INLINE): Remove "extern" for newer Sun C.
147
148         * gmp-impl.h (GMP_LIMB_BYTES): New define.
149
150         * mpn/x86_64/darwin.m4 (LEA): New define.
151
152         * mpn/x86/invert_limb.asm (approx_tab): Use DEF_OBJECT.
153         Rename and globalise it to work around Mac OS bug.
154
155         With Philip McLaughlin:
156         * mpn/x86_64/gcd_1.asm (ctz_table): Don't use local prefix, but
157         use DEF_OBJECT...END_OBJECT.
158         Keep stack pointer at ABI mandated alignment over call.
159
160 2010-01-12  Torbjorn Granlund  <tege@gmplib.org>
161
162         * tune/speed.c (routine): Remove obsolete mpn_dc_tdiv_qr and
163         mpn_dc_div_qr_n.
164         * tune/common.c (speed_mpn_dc_tdiv_qr, speed_mpn_dcpi1_div_qr_n):
165         Remove now unused functions.
166         * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_N,
167         SPEED_ROUTINE_MPN_DC_DIVREM_SB, SPEED_ROUTINE_MPN_DC_TDIV_QR): Remove
168         now unused macros.
169
170         * mpn/x86_64/fat/fat_entry.asm (mpn_cpuid_available): Remove function.
171
172         * ltmain.sh: Upgrade from 1.5.24 to 2.2.6b.
173         * ylwrap: New file.
174         * .bootstrap: Remove explicit versions.
175
176         * doc/gmp.texi (Block-wise Barrett Division): New node.
177
178         * mpn/generic/powm.c: Change some #if to plain 'if' to avoid fat build
179         problems.
180
181 2010-01-11  Torbjorn Granlund  <tege@gmplib.org>
182
183         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): Accept arguments for size
184         restrictions.
185         * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
186         (speed_mpn_sbpi1_divappr_q, speed_mpn_dcpi1_divappr_q): Pass size
187         limits for SPEED_ROUTINE_MPN_PI1_DIV.
188
189         * tune/speed.c (routine): Allow .r argument for mpn_sbpi1_divappr_q and
190         mpn_dcpi1_divappr_q.
191
192 2010-01-08  Torbjorn Granlund  <tege@gmplib.org>
193
194         * Version 5.0.0 released.
195
196         * mpn/generic/div_q.c: Handle mpn_*_divappr_q returning high limb
197         everywhere.
198
199 2010-01-07  Torbjorn Granlund  <tege@gmplib.org>
200
201         * Update MUL_FFT_TABLE2 and SQR_FFT_TABLE2 for many machines.
202
203         * mpn/generic/mu_div_q.c: Account for divisor truncation error as well
204         as mpn_mu_divappr_q's error.
205
206         * mpn/generic/mu_div_q.c: Handle mpn_preinv_mu_divappr_q returning a
207         high limb.
208
209         * tests/mpn/t-bdiv.c: Move a random call for debugability.
210         * tests/mpn/t-div.c: Likewise.
211
212         * mpn/generic/mu_divappr_q.c: Rewrite quotient round-up code.
213
214         * mpn/generic/mu_div_qr.c: Handle carry-out from a carry propagation
215         subtract.
216         * mpn/generic/mu_divappr_q.c: Likewise.
217
218         * mpn/generic/mu_divappr_q.c
219         (mpn_preinv_mu_divappr_q, mpn_mu_divappr_q): Declare dividend constant.
220         * gmp-impl.h: Likewise.
221
222         * perfpow.c (mpn_perfect_power_p): Call mpn_divexact instead of
223         mpn_bdiv_q (with too little scratch space!).
224
225         From Niels Möller:
226         * tests/mpn/t-div.c (check_one): Get rid of the poorly managed variable
227         tn.
228
229         * mpn/minithres/gmp-mparam.h: Add all lately defined thresholds.
230
231         * mpn/generic/div_q.c: Use SB division for small quotients as well as
232         small divisors.  Fix typo in itch call.
233
234 2010-01-06  Niels Möller  <nisse@lysator.liu.se>
235
236         * tests/mpn/t-div.c (check_one): Checking based on multiplication,
237         refmpn_mul, rather than refmpn_tdiv_qr.
238
239 2010-01-06 Marco Bodrato <bodrato@mail.dm.unipi.it>
240
241         * mpn/generic/toom8h_mul.c: Avoid overflows of mp_size_t.
242
243 2010-01-06  Torbjorn Granlund  <tege@gmplib.org>
244
245         * gmp-h.in (__GNU_MP__): Bump.
246         (__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
247         Bump version info.
248         * mp-h.in (__GNU_MP__): Bump.
249         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
250         Bump version info.
251
252         * doc/gmp.texi: Rewrite mpn_gcdext text.  Remove some out-of-date
253         text in Algorithms chapter.
254
255         * mpn/generic/div_q.c: Properly handle np=scratch.  Fix critical typo
256         in final adjustment code.  Misc cleanups.
257
258         * mpn/generic/rootrem.c: Use mpn_div_q.
259         * mpz/tdiv_q.c: Likewise.
260
261         * tests/mpn/t-div.c: Test mpn_div_q.
262         (SIZE_LOG): Up to 17.
263
264         * mpn/generic/div_q.c: New file.
265         * configure.in (gmp_mpn_functions): Add div_q.
266
267         * mpn/generic/mu_div_q.c: Actually declare dividend constant.
268
269 2010-01-04  Torbjorn Granlund  <tege@gmplib.org>
270
271         * tune/tuneup.c (fft): Separate tuning of modf and full products.
272         (struct fft_param_t): New field, mul_modf_function.
273         (tune_fft_sqr): Fix typo.
274         (tune_fft_mul, tune_fft_sqr): Initialise mul_modf_function field.
275         * tune/common.c (speed_mpn_fft_mul, speed_mpn_fft_sqr): New functions.
276
277         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): Clean up.
278
279         * mpn/generic/mul.c: Simplify rational expression.
280
281         * gmp-impl.h: Cleanup threshold variables; remove obsolete ones and
282         make all possibly needed definitions for existing ones.
283         * tune/tuneup.c (tune_mul): Write fractions-compensated values to
284         threshold variables.
285
286 2010-01-03 Marco Bodrato <bodrato@mail.dm.unipi.it>
287
288         * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
289         mpn_toom43_mul.
290
291         * mpn/generic/toom_interpolate_6pts.c: Small reorganisation.
292
293 2010-01-03  Torbjorn Granlund  <tege@gmplib.org>
294
295         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
296         INV_MULMOD_BNM1_THRESHOLD/2 instead.
297
298         * gmp-impl.h (INV_APPR_THRESHOLD, INV_MULMOD_BNM1_THRESHOLD): Default
299         here...
300         * mpn/generic/invert.c, mpn/generic/invertappr.c: ...not here.
301
302         * tests/mpn/t-div.c: Rewrite operand generation code.
303
304 2010-01-02  Torbjorn Granlund  <tege@gmplib.org>
305
306         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
307         INV_MULMOD_BNM1_THRESHOLD.
308
309 2010-01-02  Marco Bodrato <bodrato@mail.dm.unipi.it>
310
311         * mpn/generic/dcpi1_div_q.c: Handle divappr approximation problem more
312         efficiently.
313         * mpn/generic/mu_div_q.c: Likewise.
314
315         * mpn/generic/invert.c: Remove duplicated code.
316
317 2010-01-01  Torbjorn Granlund  <tege@gmplib.org>
318
319         * gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to 0.
320
321         * mpn/generic/mu_div_qr.c: Rewrite to use mpn_mulmod_bnm1.  Clean up
322         scratch usage.  Improve itch functions.
323         * mpn/generic/mu_divappr_q.c: Likewise.
324         * mpn/generic/mu_bdiv_qr.c: Likewise.
325         * mpn/generic/mu_div_q.c: Likewise.
326
327         * mpn/generic/dcpi1_bdiv_qr.c: Add parameter ASSERTs.
328         * mpn/generic/dcpi1_bdiv_q.c: Likewise.
329
330         * tests/mpn/t-bdiv.c: Replace with unit testing code, based on t-div.c.
331         Increase COUNT to 500.
332
333         * tests/mpn/t-div.c: Avoid generating too small test operands.
334         Move SB suppression limit downwards.  Increase COUNT to 200.
335
336 2009-12-31  Torbjorn Granlund  <tege@gmplib.org>
337
338         * mpn/generic/tdiv_qr.c: Handle numerator/remainder overlap in MU case.
339
340         * tests/tests.h (TESTS_REPS): New macro.
341         * tests/mpz/dive.c: Use larger operands, decrease default reps, use
342         TESTS_REPS.
343         * tests/mpz/convert.c: Likewise.
344         * tests/mpz/t-sqrtrem.c: Likewise.
345         * tests/mpz/reuse: Likewise.
346         * tests/mpz/t-root.c: Likewise.
347         * tests/mpz/t-tdiv.c: Likewise.
348         * tests/mpz/t-gcd.c: Likewise.
349         * tests/mpz/t-powm.c: Likewise.
350
351 2009-12-31  Marco Bodrato <bodrato@mail.dm.unipi.it>
352
353         * mpn/generic/toom8_sqr.c (SQR_TOOM8_MAX): Avoid overflow.
354         * mpn/generic/toom6_sqr.c (SQR_TOOM6_MAX): Likewise.
355
356         * mpn/generic/mulmod_bnm1.c: Don't mention MISUSE any more,
357         simply consider UNLIKELY any unexpected size.
358
359 2009-12-31  Torbjorn Granlund  <tege@gmplib.org>
360
361         * tune/tuneup.c (speed_mpn_sbordcpi1_div_qr): New function.
362         (tune_mu_div): Use it.
363
364 2009-12-30  Torbjorn Granlund  <tege@gmplib.org>
365
366         * tune/tuneup.c (tune_mu_bdiv, tune_dc_bdiv, tune_mu_div)
367         (tune_dc_div): Clear global s.r to make speed functions do 2n/n.
368
369         * tune/speed.c (routine): New entries for mpn_mu_div_qr and
370         mpn_mupi_div_qr.  Allow .r parameter for mpn_sbpi1_div_qr,
371         mpn_dcpi1_div_qr.
372         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV, SPEED_ROUTINE_MPN_MU_DIV_QR)
373         (SPEED_ROUTINE_MPN_MUPI_DIV_QR): Handle .r parameter.
374
375         * tests/mpz/t-tdiv.c: Increase operands size again.
376
377         * mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
378
379         * mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
380         alloc.
381
382 2009-12-29  Torbjorn Granlund  <tege@gmplib.org>
383
384         * tune/tuneup.c (tune_mu_div): Tune MUPI_DIV_QR_THRESHOLD.
385         * tune/speed.h (struct speed_params): Allow 3 source operands.
386         (SPEED_ROUTINE_MPN_MUPI_DIV_QR): New macro.
387         * tune/common.c (speed_mpn_mupi_div_qr): New function.
388
389         * mpn/generic/tdiv_qr.c: Call mpn_mu_div_qr.
390
391         * tests/mpz/t-tdiv.c: Use larger test operands.
392
393         * mpn/generic/mu_div_qr.c (mpn_mu_div_qr2): Remove code for dn==1.
394
395         * mpz/mul.c: Call mpn_sqr directly.  Use PTR,SIZ,ALLOC.
396
397         * tune/tuneup.c (tune_mu_div): Set min_size to 6, DC functions require
398         this.
399
400         * tests/mpn/t-div.c: Call mu_div functions with operands that generate
401         a high quotient limb.
402
403         * mpn/generic/mu_div_qr.c: Rewrite to return a high quotient limb,
404         to let dividend argument be constant, and as a general cleanup.
405         * mpn/generic/mu_divappr_q.c: Likewise.
406         * mpn/generic/mu_div_q.c: Likewise.
407         * gmp-impl.h: Update declarations of changed functions.
408
409         * mpn/generic/invertappr.c (mpn_invertappr): Allocate scratch space
410         when caller passed NULL.
411
412 2009-12-28  Torbjorn Granlund  <tege@gmplib.org>
413
414         * mpn/generic/toom_couple_handling.c: Prefix name with mpn_.
415         * gmp-impl.h: Likewise.
416         * mpn/generic/toom63_mul.c: Likewise.
417         * mpn/generic/toom6_sqr.c: Likewise.
418         * mpn/generic/toom6h_mul.c: Likewise.
419         * mpn/generic/toom8_sqr.c: Likewise.
420         * mpn/generic/toom8h_mul.c: Likewise.
421
422         * configure.in (gmp_mpn_functions_optional) Move "com" from here...
423         (gmp_mpn_functions): ...to here.
424         * mpn/generic/com.c: New file.
425         * (mpn_com): New name for mpn_com_n.  Make public.
426         * (mpn_neg): Analogous changes.
427
428         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv): Set step_factor.
429
430         * tune/common.c, tune/speed.c, tune/speed.h: Support measuring
431         mpn_lshiftc.
432
433         * tests/devel/try.c: Test mpn_lshiftc.
434         * tests/refmpn.c (refmpn_com): New function.
435         (refmpn_lshiftc): Likewise.
436
437         * configure.in (gmp_mpn_functions_optional) Move lshiftc from here...
438         (gmp_mpn_functions): ...to here.
439         * mpn/generic/lshiftc.c: New file.
440         * mpn/x86_64/lshiftc.asm: New file.
441         * mpn/x86_64/core2/lshiftc.asm: New file.
442         * mpn/generic/mul_fft.c (mpn_lshiftc): Remove.
443
444         * mpn/x86_64/core2/lshift.asm: Tweak for better Core iN performance.
445         * mpn/x86_64/core2/rshift.asm: Likewise.
446
447 2009-12-27  Marco Bodrato <bodrato@mail.dm.unipi.it>
448
449         * mpn/generic/mul.c: Use toom6h and toom8h for almost balanced.
450
451         * mpn/generic/mullo_n.c (mpn_dc_mullo_n): New ratio, to be used in
452         Toom-8 range.
453
454 2009-12-27  Torbjorn Granlund  <tege@gmplib.org>
455
456         * (mpn_sqr): New name for mpn_sqr_n.  Many files affected.
457
458         * tune/tuneup.c (tune_mullo): Up step_factor for MULLO_MUL_N_THRESHOLD.
459         (tune_invertappr, tune_invert, tune_binvert): Let max_size default.
460
461         * tune/tuneup.c (tune_mu_div, tune_mu_bdiv) New functions.
462         * tune/speed.h (SPEED_ROUTINE_MPN_MU_DIV_Q): New macro.
463         (SPEED_ROUTINE_MPN_MU_DIV_QR): Likewise.
464         (SPEED_ROUTINE_MPN_MU_BDIV_Q): Likewise.
465         (SPEED_ROUTINE_MPN_MU_BDIV_QR): Likewise.
466         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add bdiv_q.c and bdiv_qr.c.
467         * tune/common.c (speed_mpn_mu_div_qr): New function.
468         (speed_mpn_mu_divappr_q): Likewise.
469         (speed_mpn_mu_div_q): Likewise.
470         (speed_mpn_mu_bdiv_q): Likewise.
471         (speed_mpn_mu_bdiv_qr): Likewise.
472
473         * mpn/*/gmp-mparam.h: Fix incorrect MOD_1U_TO_MOD_1_1_THRESHOLD 0
474         values.
475
476         * gmp-impl.h (MODEXACT_1_ODD_THRESHOLD): Remove.
477         (BMOD_1_TO_MOD_1_THRESHOLD): New parameter, with the reverse meaning of
478         MODEXACT_1_ODD_THRESHOLD.
479         (MPN_MOD_OR_MODEXACT_1_ODD): Use BMOD_1_TO_MOD_1_THRESHOLD.
480         * mpn/generic/divis.c, mpz/{cong.c,cong_ui.c,divis_ui.c}: Likewise.
481         * tune/tuneup.c (tune_modexact_1_odd): Tune BMOD_1_TO_MOD_1_THRESHOLD;
482         Do not assume native mpn_modexact_1_odd is faster than mpn_mod_1.
483         (tuned_speed_mpn_mod_1): Remove variable.
484         (tune_mod_1): Fix thinkos.  Suppress printing of "always" etc.
485         (all): Measure for divrem_1, mod_1, divexact_1, etc first, since Toom
486         depends on some of them.
487
488         * mpn/generic/toom22_mul.c (TOOM22_MUL_REC): New name for
489         TOOM22_MUL_MN_REC.
490
491 2009-12-26  Niels Möller  <nisse@lysator.liu.se>
492
493         * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Relax
494         requirements a bit.
495
496         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Relax requirement on
497         input sizes, to support s+t>=n (used to be s+t>=n+2). Keep high
498         limbs of the evaluated values in scalar variables.
499
500         * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Remove
501         unused variables.
502
503         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Fixed left-over use
504         of mpn_addsub_n which should be mpn_add_n_sub_n.
505
506 2009-12-26  Marco Bodrato <bodrato@mail.dm.unipi.it>
507
508         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add new toom files (spotted by Torbjorn).
509
510         * gmp-impl.h (mpn_toom6_sqr_itch): Rename to mpn_toom6_mul_n_itch and redefine.
511         (mpn_toom8_sqr_itch): Rename to mpn_toom8_mul_n_itch and redefine.
512         * mpn/generic/mul_n.c: Use renamed _itch macros.
513
514 2009-12-25  Niels Möller  <nisse@lysator.liu.se>
515
516         * tests/mpn/t-toom32.c (MIN_AN, MIN_BN, MAX_BN): Tightened requirements.
517         * gmp-impl.h (mpn_toom32_mul_itch): Updated. Less scratch needed
518         by toom32 itself, and also the pointwise multiplications are
519         currently mpn_mul_n with no supplied scratch.
520         * mpn/generic/toom32_mul.c (mpn_toom32_mul): Reorganized
521         interpolation to use less scratch space. No longer supports the
522         most extreme size ratios.
523
524 2009-12-25  Torbjorn Granlund  <tege@gmplib.org>
525
526         * tune/tuneup.c (tune_preinv_mod_1): Purge.
527         (tune_mod_1): Use speed_mpn_mod_1_tune for
528         PREINV_MOD_1_TO_MOD_1_THRESHOLD
529
530         * mpn/generic/dcpi1_divappr_q.c: Handle 2n/n properly.  Don't use full
531         precision in mpn_sbpi1_divappr_q call.  Misc cleanup.
532
533         * tune/tuneup.c (tune_mod_1): Add a check_size for
534         PREINV_MOD_1_TO_MOD_1_THRESHOLD.
535
536 2009-12-24  Torbjorn Granlund  <tege@gmplib.org>
537
538         * tune/mod_1_div.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
539         (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
540         * tune/mod_1_inv.c (MOD_1N_TO_MOD_1_1_THRESHOLD,
541         (MOD_1U_TO_MOD_1_1_THRESHOLD): Set.
542
543         * gmp-impl.h (USE_PREINV_MOD_1): Remove.
544         (MPN_MOD_OR_PREINV_MOD_1): Define to choose functions dynamically in
545         terms of PREINV_MOD_1_TO_MOD_1_THRESHOLD (used to choose statically
546         using USE_PREINV_MOD_1).
547         * mpn/generic/perfsqr.c (PERFSQR_MOD_PP): Corresponding updates.
548
549         * tune/tuneup.c (tune_mod_1): Rewrite.
550         * gmp-impl.h (MOD_1N_TO_MOD_1_1_THRESHOLD): New.
551         (MOD_1U_TO_MOD_1_1_THRESHOLD): New name for MOD_1_1_THRESHOLD.
552         (MOD_1_1_TO_MOD_1_2_THRESHOLD): Mew name for MOD_1_2_THRESHOLD.
553         (MOD_1_2_TO_MOD_1_4_THRESHOLD): New name for MOD_1_4_THRESHOLD.
554         * mpn/generic/mod_1.c: Corresponding updates.
555
556 2009-12-24  Marco Bodrato <bodrato@mail.dm.unipi.it>
557
558         * mpn/generic/mul_n.c: Use also toom6h and toom8h.
559         * mpn/generic/sqr_n.c: Use also toom6 and toom8.
560         * gmp-impl.h: Initial support for tuning of Toom-6half and Toom-8half.
561         * tune/tuneup.c: Tune Toom-6half and Toom-8half thresholds.
562
563 2009-12-24  Torbjorn Granlund  <tege@gmplib.org>
564
565         * mpn/generic/mod_1_4.c: Get ASSERT right.
566         * mpn/generic/mod_1_3.c: Likewise.
567         * mpn/generic/mod_1_2.c: Likewise.
568
569         * mpn/generic/powm_sec.c: Use SQR_TOOM2_THRESHOLD as limit for a native
570         mpn_sqr_basecase, not TUNE_SQR_TOOM2_MAX.
571
572 2009-12-23  Marco Bodrato <bodrato@mail.dm.unipi.it>
573
574         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
575         mpn_toom8h_mul and mpn_toom8_sqr speed.
576
577         * mpn/generic/toom_eval_pm2exp.c: Fix ASSERTs.
578
579         * mpn/generic/toom8h_mul.c: New file.
580         * mpn/generic/toom8_sqr.c: New file.
581         * mpn/generic/toom_interpolate_16pts.c: New file.
582         * gmp-impl.h: Provide corresponding declarations.
583         * configure.in (gmp_mpn_functions): List toom_interpolate_16pts,
584         toom8h_mul, and toom8h_sqr.
585         * tests/mpn/t-toom8h.c: New test program.
586
587         * mpn/generic/toom6_sqr.c: New file, was part of toom6h_mul.
588         * mpn/generic/toom6h_mul.c: Removed _sqr.
589
590         * mpn/generic/mulmod_bnm1.c: Nailify CRT.
591         * mpn/generic/sqrmod_bnm1.c: Likewise.
592
593         * mpn/generic/mullo_n.c: Split dc_mullo_n function;
594         ALLOC memory at once.
595
596         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Update.
597
598         * mpn/generic/toom6h_mul.c: Add prefix to toom_interpolate_12pts.
599         * mpn/generic/toom_interpolate_12pts.c: Likewise.
600
601         * mpn/generic/invertappr.c (mpn_bc_invertappr): Use mpn_divrem_2.
602         * mpn/generic/invert.c: Faster basecase, use mpn_sbpi1_div_q.
603
604         * mpn/generic/toom_eval_pm2exp.c: Assert support for degree 3.
605         * mpn/generic/toom6h_mul.c: Avoid obsolete _itch function.
606
607 2009-12-23  Torbjorn Granlund  <tege@gmplib.org>
608
609         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
610         mpn_mod_1_1p, mpn_mod_1s_2p, mpn_mod_1s_3p, mpn_mod_1s_4p.
611
612         * tests/mpz/t-powm.c: Test mpz_powm_sec.
613
614         * mpz/powm_sec.c: New file.
615         * gmp-h.in: Declare it.
616         * Makefile.am, mpz/Makefile.am: Compile it.
617         * doc/gmp.texi: Document it.
618
619         * mpn/generic/powm_sec.c (mpn_powm_sec_itch): New function.
620         (mpn_powm_sec): Use passed scratch, no local allocation.
621         Allow exp argument = 1.
622         (win_size): Start loop from 1.
623
624         * mpn/generic/powm.c (win_size): Start loop from 1.
625
626 2009-12-22  Torbjorn Granlund  <tege@gmplib.org>
627
628         * tests/mpn/t-div.c: New file.
629         * tests/mpn/Makefile.am: Compile it.
630
631         * mpn/generic/mu_divappr_q.c: Handle quotient overflow.
632
633         * mpn/generic/mu_div_q.c (mpn_mu_div_q_itch): New function.
634
635 2009-12-22  Niels Möller  <<nisse@lysator.liu.se>>
636
637         * mpn/generic/sbpi1_div_q.c: Use udiv_qr_3by2.  Intended to change
638         nothing after preprocessing.
639
640         * mpn/generic/sbpi1_divappr_q.c: For the last call to udiv_qr_3by2,
641         avoid using memory locations as output parameters, and revert to
642         explicitly copying n1 and n0 to memory.
643
644         * gmp-impl.h (udiv_qr_3by2): Tweaked to expand to precisely the
645         same code as was used before the introduction of this macro.
646         Eliminated some local variables, instead do multiple updates to
647         the output parameters.
648
649 2009-12-22  Torbjorn Granlund  <tege@gmplib.org>
650
651         * tests/mpn/t-toom6h.c (MIN_AN): Set to MUL_TOOM6H_THRESHOLD to avoid
652         invalid recursive sizes.
653
654         * tests/mpn/t-bdiv.c: Get itch function calls right.
655
656         * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q_itch): Rewrite.
657         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Simplify.
658
659         * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Simplify, don't allocate.
660         (mpn_bdiv_qr_itch): Conditionalise on MU_BDIV_QR_THRESHOLD.
661
662 2009-12-18  Niels Möller  <nisse@lysator.liu.se>
663
664         * tests/mpn/t-bdiv.c: Add red-zones.
665
666 2009-12-21  Torbjorn Granlund  <tege@gmplib.org>
667
668         * mpn/generic/sbpi1_div_q.c: Fix fixup code to work for qn = 0.
669
670         * mpn/generic/dcpi1_divappr_q.c: Handle qn = 1 and qn = 2 for initial
671         quotient block (code block copied from dcpi1_div_qr.c).
672
673         * mpn/generic/dcpi1_div_qr.c: Rewrite singular case giving q limb of
674         GMP_NUMB_MAX.  Remove an impossible qn = 0 case.
675
676         * mpn/generic/dcpi1_bdiv_q.c: Remove a spurious mpn_sub_1.
677
678         * mpn/generic/mul.c: Put back call to mpn_mul_n.
679
680         * tune/tuneup.c (all): Call tune_mulmod_bnm1 before tuning fft due to
681         dependency on mulmod_bnm1 from both mul_fft_mul and from mullo_n.
682
683         * mpn/generic/dcpi1_divappr_q.c: ASSERT that dn >= 6 and nn > dn.
684         * mpn/generic/dcpi1_div_q.c: ASSERT that dn >= 6 and nn-dn >= 3.
685         * mpn/generic/dcpi1_div_qr.c: ASSERT that dn >= 6 and nn-dn >= 3.
686
687         * mpn/generic/bdiv_q_1.c (mpn_pi1_bdiv_q_1): Renamed from
688         mpn_bdiv_q_1_pi1.
689         * All references changed.
690
691         * configure.in: Add --enable-old-fft-full.
692         * tune/speed.c (routine): Conditionalise mpn_mul_fft_full references on
693         WANT_OLD_FFT_FULL.
694         * tune/common.c (speed_mpn_mul_fft_full)
695         (speed_mpn_mul_fft_full_sqr): Likewise.
696         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Include iff
697         WANT_OLD_FFT_FULL.
698
699 2009-12-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
700
701         * gmp-impl.h (mpn_toom6h_mul_itch): New inline function.
702         (MUL_TOOM6H_THRESHOLD): Default value.
703         (SQR_TOOM6_THRESHOLD): Default value.
704         * mpn/generic/toom6h_mul.c: Remove definitions moved to gmp-impl.h.
705         * tune/common.c, tune/speed.c, tune/speed.h: Support for measuring
706         mpn_toom6h_mul and mpn_toom6_sqr speed.
707
708         * mpn/generic/toom63_mul.c: Remove unused TMP_*.
709
710         * mpn/generic/toom_eval_pm2rexp.c: New file.
711         * gmp-impl.h: Provide corresponding declaration.
712         * configure.in (gmp_mpn_functions): List toom_eval_pm2rexp.
713         * mpn/generic/toom6h_mul.c: Use shared toom_eval_pm2rexp.
714
715         * mpn/generic/toom_couple_handling.c: New file, helper function
716         for high degree Toom.
717         * gmp-impl.h: Provide corresponding declaration.
718         * configure.in (gmp_mpn_functions): List toom_couple_handling.
719         * mpn/generic/toom6h_mul.c: Use shared toom_couple_handling.
720         * mpn/generic/toom63_mul.c: Likewise.
721
722         * mpn/generic/toom6h_mul.c: New file.
723         * mpn/generic/toom_interpolate_12pts.c: New file.
724         * gmp-impl.h: Provide corresponding declarations.
725         * configure.in (gmp_mpn_functions): List toom_interpolate_12pts,
726         toom6h_mul.
727         * tests/mpn/t-toom6h.c: New test program.
728
729         * tests/mpn/t-mulmod_bnm1.c (ref_mulmod_bnm1): Use ref_mul.
730         * tests/mpn/t-sqrmod_bnm1.c (ref_sqrmod_bnm1): Likewise.
731
732 2009-12-20  Marco Bodrato <bodrato@mail.dm.unipi.it>
733
734         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): New CRT.
735         * mpn/generic/sqrmod_bnm1.c (mpn_sqrmod_bnm1): Likewise.
736
737 2009-12-20  Torbjorn Granlund  <tege@gmplib.org>
738
739         * Change all bit counts for bignums to use mp_bitcnt_t.
740
741         * mpn/generic/bdivmod.c: File removed.  All references purged.
742
743         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Disable.
744
745         * gmp-impl.h: Define mpn_fft_mul as an alias for mpn_nussbaumer_mul.
746         * mpn/generic/mul.c: Refer mpn_fft_mul.
747         * mpn/generic/mul_n.c: Likewise.
748         * mpn/generic/sqr_n.c: Likewise.
749         * mpn/generic/mullo_n.c: Likewise.
750
751         * mpn/generic/mul.c: Loop also over mpn_nussbaumer_mul, as suggested by
752         Marco.  Use TMP_SALLOC_LIMBS in more places.  Clean up ws allocation.
753
754 2009-12-19  Marco Bodrato <bodrato@mail.dm.unipi.it>
755
756         * mpn/generic/toom_interpolate_8pts.c: Nailify.
757
758 2009-12-19  Torbjorn Granlund  <tege@gmplib.org>
759
760         * mpn/generic/mul.c: Major rewrite.  Use toom43, toom53, toom63.
761         Call mpn_nussbaumer_mul for largest operands.
762
763         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM43_MUL): New macro.
764         (SPEED_ROUTINE_MPN_TOOM43_FOR_TOOM32_MUL): New macro.
765         (SPEED_ROUTINE_MPN_TOOM32_FOR_TOOM53_MUL): New macro.
766         (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM32_MUL): New macro.
767         (SPEED_ROUTINE_MPN_TOOM42_FOR_TOOM53_MUL): New macro.
768         (SPEED_ROUTINE_MPN_TOOM53_FOR_TOOM42_MUL): New macro.
769         * tune/common.c (speed_mpn_toom63_mul): New function.
770         (speed_mpn_toom32_for_toom43_mul): New function.
771         (speed_mpn_toom43_for_toom32_mul): New function.
772         (speed_mpn_toom32_for_toom53_mul): New function.
773         (speed_mpn_toom53_for_toom32_mul): New function.
774         (speed_mpn_toom42_for_toom53_mul): New function.
775         (speed_mpn_toom53_for_toom42_mul): New function.
776         * tune/tuneup.c (tune_mul_n): New name for old tune_mul.
777         (tune_sqr_n): New name for old tune_sqr.
778         (tune_mul): New function, for unbalanced multiplication.
779         * gmp-impl.h: Provide declarations for corresponding threshold vars.
780
781         * gmp-impl.h (mpn_rsh1add_nc, mpn_rsh1sub_nc): Declare.
782         * mpn/asm-defs.m4: Likewise.
783         * configure.in: Add corresponding HAVE_NATIVEs.
784         * mpn/x86_64/rsh1aors_n.asm: Add _nc entry point.
785
786 2009-12-18  Niels Möller  <nisse@lysator.liu.se>
787
788         * mpz/divexact.c: Rewrite to use mpn_divexact.
789
790         * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Deleted some unused
791         variables.
792
793         * mpn/generic/toom52_mul.c (mpn_toom52_mul)
794         [HAVE_NATIVE_mpn_add_n_sub_n]: Moved declaration of cy to avoid a
795         compiler warning.
796
797         * gmp-impl.h (gmp_pi1_t): Eliminated inv21 member.
798         (invert_pi1): ...and don't store it here.
799
800         * mpn/generic/toom63_mul.c (mpn_toom63_mul): Simplified
801         calculation of block size n.
802         * gmp-impl.h (mpn_toom63_mul_itch): Likewise.
803
804         * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
805         output asserts.
806
807 2009-12-18  Torbjorn Granlund  <tege@gmplib.org>
808
809         * tests/mpn/t-toom63.c: New test program.
810
811 2009-12-18  Marco Bodrato <bodrato@mail.dm.unipi.it>
812
813         * mpn/generic/invert.c: Nailify.
814         * mpn/generic/invertappr.c: Nailify.
815         * mpn/generic/mulmod_bnm1.c: Nailify.
816         * mpn/generic/sqrmod_bnm1.c: Nailify.
817
818         * tests/mpn/t-invert.c: New test program.
819
820         * mpn/generic/toom63_mul.c: New file.
821         * mpn/generic/toom_interpolate_8pts.c: New file.
822         * gmp-impl.h: Provide corresponding declarations.
823         * configure.in (gmp_mpn_functions): List toom_interpolate_8pts and
824         toom63_mul.
825
826 2009-12-17  Torbjorn Granlund  <tege@gmplib.org>
827
828         * mpn/generic/mul.c: Move allocation of ws to where it is used.
829         Identify toom22, 32, 42, in that order (in two places).  Use midline
830         between toom22, 32, 42.
831         * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): Call also
832         mpn_toom32_mul.
833
834         * doc/gmp.texi: Update References section.  Update Contributors
835         section.  Misc updates.
836
837         * gmp-impl.h: Renew default values for all THRESHOLDs.
838
839 2009-12-17  Niels Möller  <nisse@lysator.liu.se>
840
841         * mpn/generic/divexact.c (mpn_divexact): Don't require that the
842         dividend is normalized. Use MPN_DIVREM_OR_PREINV_DIVREM_1. When
843         shifting, allocate and process only the low qn+1 limbs. Eliminated
844         code for the impossible case nn < qn.
845
846         * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): Added some input
847         asserts.
848
849         * mpn/generic/dcpi1_div_qr.c (mpn_dcpi1_div_qr): In the case that
850         the initial quotient block is a single limb, use 3/2 division,
851         thereby eliminating the only use of gmp_pi1_t->inv21.
852
853 2009-12-17  Marco Bodrato <bodrato@mail.dm.unipi.it>
854
855         * mpn/generic/invert.c: Added some comment.
856         * mpn/generic/invertappr.c: Slightly better threshold handling.
857         * gmp-impl.h (INV_NEWTON_THRESHOLD): Default to 200.
858
859         * mpn/generic/nussbaumer_mul.c: New file.
860         * configure.in (gmp_mpn_functions): Add nussbaumer_mul.
861         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add nussbaumer_mul.
862         * gmp-impl.h (mpn_nussbaumer_mul): Added prototype and name-mangling.
863         * tune/speed.h (speed_mpn_nussbaumer_mul): Declare function.
864         * tune/common.c (speed_mpn_nussbaumer_mul): New function.
865         * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul.
866
867         * mpn/generic/sqrmod_bnm1.c: New file.
868         * configure.in (gmp_mpn_functions): Add sqrmod_bnm1.
869         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqrmod_bnm1.
870         * gmp-impl.h (mpn_sqrmod_bnm1): Added prototype and name-mangling.
871         (SQRMOD_BNM1_THRESHOLD): support for the new threshold.
872         * tune/speed.h (speed_mpn_sqrmod_bnm1): Declare function.
873         * tune/common.c (speed_mpn_sqrmod_bnm1): New function.
874         * tune/speed.c (routine): Add speed_mpn_sqrmod_bnm1.
875         * tests/mpn/t-mulmod_bnm1.c: Attribution.
876         * tests/mpn/t-sqrmod_bnm1.c: New test file.
877         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-sqrmod_bnm1.
878
879         * tune/tuneup.c: Tune SQRMOD_BNM1_THRESHOLD.
880
881         * mpn/generic/nussbaumer_mul.c (mpn_nussbaumer_mul): Mimic fft_mul,
882         use squaring if operands coincide.
883         * tune/speed.h (speed_mpn_nussbaumer_mul_sqr): Declare function.
884         * tune/common.c (speed_mpn_nussbaumer_mul_sqr): New function.
885         * tune/speed.c (routine): Add speed_mpn_nussbaumer_mul_sqr.
886
887 2009-12-17  Torbjorn Granlund  <tege@gmplib.org>
888
889         * mpn/generic/bdiv_q.c (mpn_bdiv_q_itch): Rewrite.
890
891 2009-12-16  Torbjorn Granlund  <tege@gmplib.org>
892
893         * tests/mpn/t-bdiv.c (bdiv_q_valid_p, bdiv_qr_valid_p): Call refmpn_mul
894         instead of refmpn_mul_basecase.
895         * tests/mpn/toom-shared.h: Likewise.
896         * tests/refmpn.c (refmpn_mullo_n,refmpn_sqr,refmpn_mul_any): Likewise.
897
898         * minithres/gmp-mparam.h: Add new thresholds, trim old values.
899
900         * mpn/generic/powm.c: Use mp_bitcnt_t for bit counts.
901         Handle REDC_1_TO_REDC_N_THRESHOLD < MUL_TOOM22_THRESHOLD in
902         non-WANT_REDC_2 INNERLOOP expansion code.
903         * mpn/generic/powm_sec.c: Use mp_bitcnt_t for bit counts.
904
905 2009-12-16  Niels Möller  <nisse@lysator.liu.se>
906
907         * tests/mpz/t-gcd.c (main): Added test case to exercise the
908         unlikely u0 == u1 case in mpn_gcdext_lehmer_n.
909
910         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Get ASSERT
911         right.
912
913 2009-12-16  Torbjorn Granlund  <tege@gmplib.org>
914
915         * tests/mpz/t-mul.c: Misc cleanups.
916         (mul_basecase): Remove.
917         (ref_mpn_mul): Remove.
918         * tests/refmpn.c (refmpn_mul): New function, mainly from t-mul.c's
919         ref_mpn_mul.
920         (refmpn_mullo_n): Add a missing free.
921
922         * tune/speed.c (routine): Measure speed_mpn_{sb,dc}pi1_div_qr,
923         mpn_{sb,dc}pi1_divappr_q, mpn_{sb,dc}pi1_bdiv_qr, and
924         mpn_{sb,dc}pi1_bdiv_q.
925
926         * mpn/generic/invertappr.c: New file, meat from invert.c.
927         * mpn/generic/invert.c: Leave just mpn_invert.c.
928         * configure.in (gmp_mpn_functions): Add invertappr.
929         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invertappr.c.
930         * gmp-impl.h (mpn_invert_itch, mpn_invertappr_itch): New macros.
931
932 2009-12-15  Torbjorn Granlund  <tege@gmplib.org>
933
934         * mpn/generic/gcdext_subdiv_step.c: Get an ASSERT right.
935
936 2009-12-15  Niels Möller  <nisse@lysator.liu.se>
937
938         * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): A very small step
939         towards nail support.
940
941 2009-12-15  Marco Bodrato <bodrato@mail.dm.unipi.it>
942
943         * gmp-impl.h (mpn_ni_invertappr): Added prototype and name-mangling.
944         * mpn/generic/mulmod_bnm1.c: Comment representation of class [0].
945
946 2009-12-14  Niels Möller  <nisse@lysator.liu.se>
947
948         * mpn/generic/sbpi1_divappr_q.c (mpn_sbpi1_divappr_q): Use
949         udiv_qr_3by2.
950
951 2009-12-14  Torbjorn Granlund  <tege@gmplib.org>
952
953         * tune/tuneup.c (tune_binvert): Remove BINV_MULMOD_BNM1_THRESHOLD
954         tuning, it was always zero and caused BINV_NEWTON_THRESHOLD to be
955         wrong (as pointed out by Marco).
956         * (BINV_MULMOD_BNM1_THRESHOLD): Clean from other files too.
957
958 2009-12-14  Marco Bodrato <bodrato@mail.dm.unipi.it>
959
960         * mpn/generic/invert.c: Improved comments.
961         (mpn_bc_invertappr): Conditionally re-enable mpn_dcpi1_divappr_q.
962
963 2009-12-14  Niels Möller  <nisse@lysator.liu.se>
964
965         * gmp-impl.h (udiv_qr_3by2): Fix typo in argument list.
966
967 2009-12-13  Niels Möller  <nisse@lysator.liu.se>
968
969         * gmp-impl.h (udiv_qr_3by2): New macro.
970         * mpn/generic/sbpi1_div_qr.c (mpn_sbpi1_div_qr): Use udiv_qr_3by2.
971
972 2009-12-13  Torbjorn Granlund  <tege@gmplib.org>
973
974         * mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q): Avoid a buffer
975         overrun.
976
977         * mpn/generic/mul_fft.c (mpn_mul_fft_full): Handle carry-out from 2nd
978         mpn_mul_fft, add an ASSERT for the 1st mpn_mul_fft.  Replace some
979         comments on cc's range with ASSERTs.
980
981         * mpn/generic/gcdext.c (compute_v): Normalise tp[] after mpn_mul.
982
983         * mpz/powm.c: Rework buffer handling.
984
985 2009-12-13  Niels Möller  <nisse@lysator.liu.se>
986
987         * tests/mpn/toom-shared.h (main): Use refmpn_mul_basecase to check
988         results (slow!). Iteration counts of all toom tests reduced
989         considerably.
990
991 2009-12-13  Marco Bodrato <bodrato@mail.dm.unipi.it>
992
993         * mpn/generic/invert.c (mpn_invertapp): Split in _bc and _ni.
994         (mpn_bc_invertappr): New function, the basecase.
995         (mpn_ni_invertapp): New function, Newton iteration.
996         (mpn_invert): Use mpn_ni_invertapp.
997         * tune/tuneup.c (tune_invert): Min for INV_APPR_THRESHOLD.
998         (tune_invertappr): Min for INV_NEWTON_THRESHOLD.
999
1000         * tune/speed.h (SPEED_ROUTINE_MPN_NI_INVERTAPPR): New macro.
1001         (speed_mpn_ni_invertappr): Declare function.
1002         * tune/common.c (speed_mpn_ni_invertappr): New function.
1003         * tune/speed.c (routine): Add speed_mpn_ni_invertappr.
1004
1005         * tune/tuneup.c (tune_invertappr): Use speed_mpn_ni_invertappr to
1006         tune INV_MULMOD_BNM1_THRESHOLD.
1007
1008 2009-12-12  Torbjorn Granlund  <tege@gmplib.org>
1009
1010         * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr_itch): Rewrite.
1011
1012 2009-12-12  Marco Bodrato <bodrato@mail.dm.unipi.it>
1013
1014         * tests/mpn/t-mulmod_bnm1.c (main): Disable B^n+1 stressing test
1015         for odd sizes.
1016
1017         * mpn/generic/invert.c: Complete rewrite. Uses Newton iterations.
1018         * gmp-impl.h (mpn_invertappr): Added prototype and name-mangling.
1019         (mpn_invertappr_itch): Added prototype and name-mangling.
1020         (INV_APPR_THRESHOLD): Support for a new tunable const.
1021         * tune/speed.h (SPEED_ROUTINE_MPN_INVERTAPPR): New macro.
1022         (speed_mpn_invertappr): Declare function.
1023         * tune/common.c (speed_mpn_invertappr): New function.
1024         * tune/speed.c (routine): Add speed_mpn_invertappr.
1025         * tune/tuneup.c (tune_invertappr): New function: was tune_invert.
1026         (tune_invert): Now tune only INV_APPR_THRESHOLD.
1027         (all): Enable call to tune_invert and tune_invertappr.
1028
1029 2009-12-11  Torbjorn Granlund  <tege@gmplib.org>
1030
1031         * mpn/generic/binvert.c: Use mpn_mulmod_bnm1 instead of FFT wrapping.
1032         Old, evidently broken wrapping code removed.
1033         * tune/tuneup.c (tune_binvert): Tune BINV_MULMOD_BNM1_THRESHOLD.
1034         * gmp-impl.h: Provide declarations for corresponding threshold var.
1035
1036         * tests/mpn/t-bdiv.c (COUNT): Decrease to keep run time reasonable.
1037
1038         * tune/tuneup.c (tune_invert): Tune INV_MULMOD_BNM1_THRESHOLD.
1039         * gmp-impl.h: Provide declarations for corresponding threshold var.
1040
1041         * tests/mpn/t-mulmod_bnm1.c: Avoid a division by zero.
1042
1043         * configure.in: Set up different paths for different 64-bit sparc
1044         processors.
1045         * mpn/sparc64/ultrasparc34/gmp-mparam.h: New file.
1046
1047 2009-12-10  Torbjorn Granlund  <tege@gmplib.org>
1048
1049         * mpn/*/gmp-mparam.h: Regenerate many of these files.
1050
1051 2009-12-10  Niels Möller  <nisse@lysator.liu.se>
1052
1053         * gmp-impl.h (mpn_divexact): Removed scratch pointer from
1054         prototype.
1055         * mpn/generic/gcdext.c (divexact): Deleted, moved to...
1056         * mpn/generic/divexact.c (mpn_divexact): New implementation (moved
1057         from gcdext.c). The bidirectional divexact is kept but #if:ed out.
1058         Interface change, since the new code doesn't take a scratch
1059         argument.
1060
1061         * tests/mpn/t-mulmod_bnm1.c (main): Ensure that an >= bn. Lowered
1062         MIN_N to 1. Various fixes to handle n == 1 properly.
1063
1064         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Small interface
1065         change, require an >= bn.
1066
1067         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Fixed non-recursive
1068         case to not write beyond end of result area.
1069
1070 2009-12-09  Torbjorn Granlund  <tege@gmplib.org>
1071
1072         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL): New macro, made
1073         from now deleted SPEED_ROUTINE_MPN_MULMOD_BNM1.
1074         * tune/common.c (speed_mpn_bc_mulmod_bnm1): New function.
1075         (speed_mpn_mulmod_bnm1): Use SPEED_ROUTINE_MPN_MULMOD_BNM1_CALL.
1076         * tune/speed.c (routine): Add mpn_bc_mulmod_bnm1.
1077
1078         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
1079
1080         * tune/tuneup.c (tune_mulmod_bnm1): Rewrite.
1081
1082 2009-12-08  Marco Bodrato <bodrato@mail.dm.unipi.it>
1083
1084         * mpn/generic/mulmod_bnm1.c (mpn_bc_mulmod_bnm1,
1085         mpn_bc_mulmod_bnp1): Added a parameter for scratch area, possibly
1086         same as result area (as suggested by Niels Möller).
1087         (mpn_mulmod_bnm1): Calls changed accordingly.
1088
1089 2009-12-08  Niels Möller  <nisse@lysator.liu.se>
1090
1091         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]: Use
1092         table lookup for count_trailing_zeros. Binary algorithm still
1093         disabled by default.
1094
1095         * mpn/generic/gcdext.c (divexact): Local definition of divexact,
1096         using mpn_bdiv_q.
1097         (compute_v): Use it.
1098
1099         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-bdiv.
1100
1101         * tests/mpn/t-bdiv.c: New file.
1102
1103         * mpn/generic/bdiv_q.c (mpn_bdiv_q): Fixed bad quotient length,
1104         should have qn == nn.
1105
1106         * mpn/generic/bdiv_qr.c (mpn_bdiv_qr): Pass correct nn length to
1107         the lower-level functions.
1108
1109 2009-12-08  Torbjorn Granlund  <tege@gmplib.org>
1110
1111         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1_ROUNDED): New define.
1112         * tune/common.c (speed_mpn_mulmod_bnm1_rounded): New function.
1113         * tune/speed.c (routine): Add mpn_mulmod_bnm1_rounded for measuring
1114         mpn_mulmod_bnm1 at recommended sizes.
1115
1116         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): Rewrite.
1117         (mpn_bc_mulmod_bnm1): Use mpn_add_n instead of mpn_add.
1118
1119         * tune/speed.c (routine): Add mpn_invert.
1120
1121         * tune/tuneup.c (tune_invert): New function.
1122         * tune/speed.h (SPEED_ROUTINE_MPN_INVERT): New macro.
1123         * tune/common.c (speed_mpn_invert): New function.
1124         * gmp-impl.h: Provide declarations for corresponding threshold var.
1125         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add invert.c.
1126
1127 2009-12-08  Marco Bodrato <bodrato@mail.dm.unipi.it>
1128
1129         * tests/devel/try.c: Test mpn_addlsh2_n and mpn_{add,sub}lsh_n;
1130         mpn_rsblsh_n now tests all shift values.
1131         * tests/refmpn.c (refmpn_addlsh_n, refmpn_sublsh_n): New functions.
1132         (refmpn_addlsh1_n): Use generic refmpn_addlsh_n.
1133         (refmpn_sublsh1_n): Use generic refmpn_sublsh_n.
1134         (refmpn_addlsh2_n): New function.
1135         * tests/tests.h: Declare new functions.
1136
1137 2009-12-06  Torbjorn Granlund  <tege@gmplib.org>
1138
1139         * tune/tuneup.c (tune_mulmod_bnm1): Up min_size to 12.
1140
1141         * Globally: Rename *mullow* to *mullo*, *MULLOW* to *MULLO*.
1142
1143         * configure.in: Don't include ev5 directory for ev6* and ev7.  Misc
1144         alpha path cleanups.
1145         * mpn/alpha/add_n.asm: Replaced by mpn/alpha/ev5/add_n.asm.
1146         * mpn/alpha/sub_n.asm: Replaced by mpn/alpha/ev5/sub_n.asm.
1147         * mpn/alpha/lshift.asm: Replaced by mpn/alpha/ev5/lshift.asm.
1148         * mpn/alpha/rshift.asm: Replaced by mpn/alpha/ev5/rshift.asm.
1149         * mpn/alpha/com_n.asm: New, moved from mpn/alpha/ev5/rshift.asm.
1150         * mpn/alpha/ev5/diveby3.asm: New, moved from mpn/alpha/diveby3.asm.
1151
1152         * mpn/powerpc64/mode64/diveby3.asm: Remove, it is slower than
1153         mpn_bdiv_dbm1c on all hardware.
1154
1155         * mpn/generic/powm_sec.c: Rework logic for mpn_sqr_basecase size limit.
1156
1157         * gmp-impl.h (mpn_redc_1_sec): Declare.
1158         * configure.in (gmp_mpn_functions): Add redc_1_sec.
1159
1160 2009-12-06  Marco Bodrato <bodrato@mail.dm.unipi.it>
1161
1162         * tests/devel/try.c (try_one): DATA_SRC0_HIGHBIT sets the high bit.
1163
1164 2009-12-05  Marco Bodrato <bodrato@mail.dm.unipi.it>
1165
1166         * mpn/generic/toom_eval_dgr3_pm1.c: Change return value: 0 or ~0.
1167         * mpn/generic/toom_eval_dgr3_pm2.c: Likewise.
1168         * mpn/generic/toom_eval_pm1.c: Likewise.
1169         * mpn/generic/toom_eval_pm2exp.c: Likewise.
1170         * mpn/generic/toom_eval_pm2.c: Rewrite to use mpn_addlsh2_n.
1171
1172         * mpn/generic/toom_interpolate_5pts.c: Param sa is a flag, not a sign.
1173
1174         * mpn/generic/toom33_mul.c: Adapt to changes above.
1175         * mpn/generic/toom3_sqr.c: Likewise.
1176         * mpn/generic/toom42_mul.c: Likewise.
1177         * mpn/generic/toom43_mul.c: Reduce branches.
1178         * mpn/generic/toom44_mul.c: Likewise.
1179         * mpn/generic/toom53_mul.c: Likewise.
1180         * mpn/generic/toom62_mul.c: Likewise.
1181
1182         * mpn/generic/toom52_mul.c: Use toom_eval_ functions.
1183
1184         * mpn/generic/toom4_sqr.c: Avoid C99 construct.
1185         * mpn/generic/toom_interpolate_7pts.c: Likewise.
1186
1187 2009-12-05  Torbjorn Granlund  <tege@gmplib.org>
1188
1189         * mpn/generic/redc_1_sec.c: New file.
1190         * mpn/generic/powm_sec.c: Use redc_1_sec.  Use dummy full subtract
1191         instead of mpn_cmp since the latter leaks to the side channel.
1192         (mpn_local_sqr_n): New function, with associated macros.
1193         (mpn_powm_sec): Use mpn_local_sqr_n.
1194
1195         * configure.in (HAVE_NATIVE): Add missing functions, then sort.
1196
1197 2009-12-04  Torbjorn Granlund  <tege@gmplib.org>
1198
1199         * tune/tuneup.c (tune_dc_div): Up min_size to 6.
1200         (tune_mod_1): Set MOD_1_1_THRESHOLD min_size to 2.
1201
1202         * tune/speed.h: Negate "binvert"-type inverses, as required.
1203
1204         * mpn/generic/redc_1.c: Add ASSERTs.
1205         * mpn/generic/redc_2.c: Likewise.
1206
1207         * mpn/generic/sbpi1_bdiv_q.c: Simplify loops, indexing.
1208
1209 2009-12-03  Yann Droneaud  <yann@droneaud.fr>
1210
1211         * acinclude.m4 ([long long reliability test 1]): Add a "static" for C99
1212         inline semantics compatibility.
1213
1214 2009-12-03  Torbjorn Granlund  <tege@gmplib.org>
1215
1216         * configure.in: Move intptr_t test into common AC_CHECK_TYPES.
1217
1218         * mpn/generic/gcdext.c: Add a TMP_FREE.
1219
1220 2009-12-03  Niels Möller  <nisse@lysator.liu.se>
1221
1222         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
1223         Added various masking tricks.
1224
1225         * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]:
1226         Reimplemented binary gcdext, with proper canonicalization.
1227
1228         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Handle v == 0
1229         from mpn_gcdext_1.
1230         * mpn/generic/gcdext_1.c (mpn_gcdext_1): Allow inputs with a < b,
1231         assertions fixed accordingly.
1232
1233 2009-12-03  Torbjorn Granlund  <tege@gmplib.org>
1234
1235         * tune/tuneup.c: Tune DC_DIVAPPR_Q_THRESHOLD.  Rewrite
1236         DC_DIV_QR_THRESHOLD tuning code.
1237         (tune_dc_div): Rewrite.
1238         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_DIV): New macro.
1239         * tune/common.c (speed_mpn_sbpi1_div_qr, speed_mpn_dcpi1_div_qr,
1240         speed_mpn_sbpi1_divappr_q, speed_mpn_sbpi1_bdiv_qr): New functions.
1241         * gmp-impl.h: Provide declarations for corresponding threshold vars.
1242         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_divappr_q.c.
1243
1244         * tune/tuneup.c (tune_binvert): Up max_size.
1245
1246 2009-12-02  Marco Bodrato <bodrato@mail.dm.unipi.it>
1247
1248         * tests/devel/try.c: Test mpn_rsblsh2_n and mpn_rsblsh_n.
1249         * tests/refmpn.c (refmpn_rsblsh_n, refmpn_rsblsh2_n): New functions.
1250         (refmpn_rsblsh1_n): Use generic refmpn_rsblsh_n.
1251         * tests/tests.h: Declare new functions.
1252
1253 2009-12-03  Niels Möller  <nisse@lysator.liu.se>
1254
1255         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step):
1256         Select the right cofactor in the cases A == B or A == 2B.
1257
1258         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Deleted
1259         handling of ap[0] == 0 and bp[0] == 0; these cases don't happen.
1260         Select the right cofactor in the case ap[0] == bp[0].
1261         * mpn/generic/gcdext.c (mpn_gcdext): Analogous changes.
1262
1263 2009-12-02  Niels Möller  <nisse@lysator.liu.se>
1264
1265         * gmp-h.in (mpn_gcdext_1): Updated prototype.
1266         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
1267         signed cofactors from gcdext_1.
1268         * mpn/generic/gcdext_1.c (mpn_gcdext_1): Use Euclid's algorithm,
1269         and return signed cofactors.
1270
1271 2009-12-02  Torbjorn Granlund  <tege@gmplib.org>
1272
1273         * doc/gmp.texi (Low-level Functions): Document mpn_sqr_n.
1274
1275         * tune/speed.c (routine): Add mpn_binvert.
1276
1277         * tune/tuneup.c: Tune BINV_NEWTON_THRESHOLD.
1278         (tune_binvert): New function.
1279         * tune/speed.h (SPEED_ROUTINE_MPN_BINVERT): New macro.
1280         * tune/common.c (speed_mpn_binvert): New function.
1281         * gmp-impl.h: Provide declarations for corresponding threshold var.
1282         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add binvert.c.
1283
1284         * tune/tuneup.c: Tune DC_BDIV_QR_THRESHOLD and DC_BDIV_Q_THRESHOLD.
1285         (tune_dc_bdiv): New function.
1286         (tune_dc_div): New name for tune_dc.
1287         * tune/speed.h (SPEED_ROUTINE_MPN_PI1_BDIV_QR,
1288         SPEED_ROUTINE_MPN_PI1_BDIV_Q): New macros.
1289         * tune/common.c (speed_mpn_sbpi1_bdiv_qr, speed_mpn_dcpi1_bdiv_qr,
1290         speed_mpn_sbpi1_bdiv_q, speed_mpn_dcpi1_bdiv_q): New functions.
1291         * gmp-impl.h: Provide declarations for corresponding threshold vars.
1292         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add dcpi1_bdiv_qr.c and
1293         dcpi1_bdiv_q.c.
1294
1295 2009-12-01  Marco Bodrato <bodrato@mail.dm.unipi.it>
1296
1297         * mpn/generic/toom53_mul.c: Removed double computation of vinf.
1298
1299         * mpn/x86_64/aorrlsh_n.asm: Correct return value for rsblsh_n.
1300         * mpn/asm-defs.m4 (define_mpn): Add rsblsh_n.
1301         * gmp-impl.h (mpn_rsblsh_n): Added prototype and name-mangling.
1302
1303         * mpn/generic/fib2_ui.c: Reduce the amount of temporary storage.
1304         Use mpn_rsblsh_n.
1305
1306 2009-12-01  Torbjorn Granlund  <tege@gmplib.org>
1307
1308         * mpn/generic/redc_n.c: Rework temp allocation.
1309
1310         * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n_itch): Add pi1 also
1311         to this function.
1312
1313         * mpn/generic/dcpi1_bdiv_q.c: Get the mpn_sbpi1_bdiv_q call right.
1314         Misc cleanups.
1315
1316         * tune/speed.c (routine): Fix typo in last change.
1317         Add mpn_redc_2.
1318
1319         * tune/speed.h (SPEED_ROUTINE_REDC_N): Set min size properly.
1320
1321 2009-12-01  Niels Möller  <nisse@lysator.liu.se>
1322
1323         * tune/speed.c (routine): Added mpn_toom42_mul and mpn_redc_n.
1324         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM42_MUL): New macro.
1325         (speed_mpn_toom42_mul): Declare function.
1326         * tune/common.c (speed_mpn_toom42_mul): New function.
1327         * gmp-impl.h (MPN_TOOM42_MUL_MINSIZE): New constant.
1328
1329 2009-11-30  Marco Bodrato <bodrato@mail.dm.unipi.it>
1330
1331         * mpn/generic/fib2_ui.c: Use mpn_rsblsh2_n.
1332
1333 2009-11-29  Torbjorn Granlund  <tege@gmplib.org>
1334
1335         * mpn/x86_64/pentium4/gmp-mparam.h
1336         (HAVE_NATIVE_mpn_addlsh1_n, HAVE_NATIVE_mpn_sublsh1_n): Don't undef.
1337
1338         * Makefile.am (EXTRA_DIST): Remove macos.
1339
1340 2009-11-28  Torbjorn Granlund  <tege@gmplib.org>
1341
1342         * tune/tuneup.c (tune_redc): Set min_size to 16 for redc_n tuning.
1343
1344         * mpn/x86_64/sqr_basecase.asm (SQR_TOOM2_THRESHOLD_MAX): Avoid quoting
1345         to allow configure.in parse it more easily.  Trim from 120 to 80.
1346
1347 2009-11-28  Marco Bodrato <bodrato@mail.dm.unipi.it>
1348
1349         * mpn/generic/mulmod_bnm1.c: Basecases made simpler, this also corrects
1350         a bug affecting previous version.
1351
1352 2009-11-28  Torbjorn Granlund  <tege@gmplib.org>
1353
1354         * configure.in: Handle atom also in 32-bit mode.
1355         * mpn/x86/atom/gmp-mparam.h: New file.
1356
1357         * gmp-impl.h (MULMOD_BNM1_THRESHOLD): Default.
1358
1359         * mpn/generic/redc_n.c: Use mpn_mulmod_bnm1 instead of mpn_mul_n.
1360
1361         * Use TMP_ALLOC_LIMBS consistently.
1362         * Finish renaming BITS_PER_MP_LIMB to GMP_LIMB_BITS.
1363
1364         * macos: Remove entire directory.
1365
1366 2009-11-27  Torbjorn Granlund  <tege@gmplib.org>
1367
1368         * mpn/x86_64/corei/gmp-mparam.h: New file.
1369         * mpn/x86_64/core2/gmp-mparam.h: Now for just core2.
1370         * mpn/powerpc64/mode64/p3/gmp-mparam.h: New file.
1371         * mpn/powerpc64/mode64/p4/gmp-mparam.h: New file.
1372         * mpn/powerpc64/mode64/p5/gmp-mparam.h: New file.
1373
1374         * config.guess: Return "corei" for core i7 and core i5.
1375         * config.sub: Recognise "corei".
1376         * acinclude.m4 (X86_64_PATTERN): Add corei.
1377         * configure.in (powerpc): Set up more CPU-specific paths.
1378         (x86): Handle corei.
1379
1380         * mpz/powm.c: Allow input operand overlap also when exponent = 1.
1381         Misc cleanups.
1382
1383 2009-11-26  Marco Bodrato <bodrato@mail.dm.unipi.it>
1384
1385         * tests/mpn/t-mulmod_bnm1.c: New test file.
1386         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-mulmod_bnm1.
1387
1388         * mpn/generic/mullow_n.c: Comments on Mulders' trick implementation.
1389
1390 2009-11-26  Torbjorn Granlund  <tege@gmplib.org>
1391
1392         * mpn/generic/powm.c: Make comments reflect current code state.
1393
1394         * tests/devel/try.c: Make mpn_mullow_n testing actually work.
1395
1396 2009-11-25  Torbjorn Granlund  <tege@gmplib.org>
1397
1398         * mpz/powm.c: Clean up unused defs.
1399
1400 2009-11-24  Torbjorn Granlund  <tege@gmplib.org>
1401
1402         * tune/tuneup.c (tune_redc): Rewrite.
1403         * mpn/generic/powm.c: Use REDC_1_TO_REDC_2_THRESHOLD,
1404         REDC_1_TO_REDC_N_THRESHOLD, and REDC_2_TO_REDC_N_THRESHOLD.
1405         Get rid of previous REDC params, including LOCAL_REDC_N_THRESHOLD.
1406         (WANT_REDC_2): Define.
1407         * gmp-impl.h: Corresponding changes.
1408
1409 2009-11-23  Torbjorn Granlund  <tege@gmplib.org>
1410
1411         * mpn/generic/powm.c: Fix typo.
1412         Define LOCAL_REDC_N_THRESHOLD, use in REDC_2_THRESHOLD...
1413         REDC_N_THRESHOLD chain.
1414
1415 2009-11-22  Torbjorn Granlund  <tege@gmplib.org>
1416
1417         * tune/tuneup.c (tune_mullow): Set min_size to 1.
1418
1419         * mpn/generic/powm_sec.c: Use just mpn_mul_basecase and
1420         mpn_sqr_basecase for multiplication and squaring.
1421
1422         * tune/tuneup.c: Tune REDC_2_THRESHOLD and REDC_N_THRESHOLD.
1423         (tune_redc): New function.
1424         (tune_powm): Remove function.
1425         * tune/speed.h (SPEED_ROUTINE_REDC_2, SPEED_ROUTINE_REDC_N): New.
1426         * tune/common.c (speed_mpn_redc_2, speed_mpn_redc_n): New.
1427
1428         * mpz/powm.c: Complete rewrite.  Use mpn_powm and mpn_powlo.
1429         * mpn/generic/powm.c: Rewrite.
1430         * mpn/generic/redc_n.c: New file.
1431         * configure.in (gmp_mpn_functions): Add redc_n.
1432         * gmp-impl.h (REDC_2_THRESHOLD, REDC_N_THRESHOLD): Default, and define
1433         for tuneup.
1434
1435 2009-11-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
1436
1437         * mpn/generic/mullow_n.c: Disable Mulders' trick for small operands,
1438         use fft for bigger ones.
1439         * tests/mpn/t-mullo.c: New test file.
1440
1441 2009-11-22  Torbjorn Granlund  <tege@gmplib.org>
1442
1443         * tune/tuneup.c (tune_mullow): Rewrite.
1444
1445 2009-11-21  Marco Bodrato <bodrato@mail.dm.unipi.it>
1446
1447         * gmp-impl.h: Removed unused macros (CACHED_ABOVE_THRESHOLD and
1448         CACHED_BELOW_THRESHOLD).
1449
1450         * mpn/generic/mullow_n.c: Use Mulders' trick.
1451         * tune/tuneup.c (tune_mullow): MULLOW_MUL_N_THRESHOLD range of
1452         search depends on FFT tuning;
1453         (all): Anticipate tune_fft_{mul,sqr}.
1454
1455         * tune/speed.c (routine): Add entry related to mpn_mulmod_bnm1.
1456
1457 2009-11-19  Niels Möller  <nisse@lysator.liu.se>
1458
1459         * mpn/generic/toom_eval_dgr3_pm2.c (mpn_toom_eval_dgr3_pm2)
1460         [HAVE_NATIVE_mpn_add_n_sub_n]: Fixed typo in mpn_add_n_sub_n call
1461         (spotted by Marco Bodrato).
1462         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): Likewise.
1463         * mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Likewise.
1464
1465         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2) [HAVE_NATIVE_mpn_addlsh_n]:
1466         Fixed missing declaration.
1467
1468         * mpn/asm-defs.m4 (define_mpn): Add addlsh_n.
1469         * gmp-impl.h (mpn_addlsh_n): Added prototype and name-mangling.
1470
1471 2009-11-19  Niels Möller  <nisse@lysator.liu.se>
1472
1473         * mpn/generic/toom_eval_pm2.c (mpn_toom_eval_pm2): New file.
1474         * mpn/generic/toom53_mul.c (mpn_toom53_mul): Use mpn_toom_eval_pm2.
1475         * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
1476         * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
1477
1478 2009-11-18  Torbjorn Granlund  <tege@gmplib.org>
1479
1480         * gmp-impl.h (mpn_and_n, etc): Adapt to now-public logic functions.
1481
1482         * config.guess: Recognise VIA nano.
1483         * config.sub: Likewise.
1484         * configure.in: Generalise x86_64 support; recognise VIA nano.
1485
1486 2009-11-16  Torbjorn Granlund  <tege@gmplib.org>
1487
1488         * tune/speed.c (routine): Add measurement of mpn_addlsh2_n,
1489         mpn_sublsh2_n, mpn_rsblsh2_n.
1490         * tune/common.c: Add speed routines for lsh2 functions.
1491
1492         * mpn/generic/divis.c: Use MU_BDIV_QR_THRESHOLD.
1493
1494         * configure.in (gmp_mpn_functions_optional): Add *lsh_n functions.
1495
1496         * mpn/generic/toom_eval_pm2exp.c: Make HAVE_NATIVE_mpn_addlsh_n code
1497         work.
1498
1499         * mpn/x86_64/aorrlsh2_n.asm: Optimise inner loop.
1500
1501         * configure.in (gmp_mpn_functions_optional): Remove copyi,copyd, they
1502         are now in gmp_mpn_functions.  Analogously move logical functions.
1503
1504 2009-11-16  Marco Bodrato <bodrato@mail.dm.unipi.it>
1505
1506         * mpn/generic/toom53_mul.c: Use addlsh2 for evaluation (and fix typo).
1507         * mpn/generic/toom_eval_dgr3_pm2.c: Likewise (affects toom44 and 43).
1508
1509         * mpn/asm-defs.m4: Fix comments for op_lsh2 new functions.
1510         * gmp-impl.h: Likewise.
1511         * tests/mpz/t-fac_ui.c: Fix a comment.
1512
1513 2009-11-15  Torbjorn Granlund  <tege@gmplib.org>
1514
1515         * mpn/x86_64/aorrlsh2_n.asm: New file.
1516         * configure.in: Add support for addlsh2_n, sublsh2_n, and rsblsh2_n,
1517         including mulfuncs.
1518         * gmp-impl.h (mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n): Declare.
1519         * mpn/asm-defs.m4: Likewise.
1520
1521         * mpn/generic/copyi.c: New file.
1522         * mpn/generic/copyd.c: Likewise.
1523         * mpn/generic/zero.c: Likewise.
1524         * gmp-h.in: Declare new functions.
1525         * configure.in (gmp_mpn_functions): Add new functions.
1526
1527 2009-11-15  Marco Bodrato <bodrato@mail.dm.unipi.it>
1528
1529         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1_next_size): fix typo
1530
1531         * mpn/generic/toom33_mul.c: Use rsblsh1 for evaluation.
1532         * mpn/generic/toom3_sqr.c: Likewise.
1533
1534 2009-11-14  Torbjorn Granlund  <tege@gmplib.org>
1535
1536         * mpn/generic/toom52_mul.c: Use mpn_addlsh1_n.
1537
1538         * mpn/generic/toom52_mul.c: Toggle the right flag bit in an
1539         HAVE_NATIVE_mpn_add_n_sub_n arm.
1540
1541         * tests/mpz/t-remove.c: New file.
1542
1543         * mpn/generic/remove.c: Major overhaul.  Add parameter 'cap'.
1544
1545         * mpn/generic/binvert.c: Fix typo in last change.
1546
1547         * mpn/generic/bdiv_qr.c: Make it actually work.  Also use passed-in
1548         scratch space.
1549
1550         * mpn/generic/mu_bdiv_qr.c: Reset FFT parameters for each call.
1551
1552 2009-11-12  Torbjorn Granlund  <tege@gmplib.org>
1553
1554         * mpn/x86/k7/gcd_1.asm (MASK): Compute from MAXSHIFT.
1555
1556 2009-11-11  Torbjorn Granlund  <tege@gmplib.org>
1557
1558         * mpn/generic/binvert.c: Simplify, fix comments.
1559
1560         * tests/devel/try.c: Test mpn_invert and mpn_binvert.
1561
1562         * tests/refmpn.c (refmpn_invert, refmpn_binvert): New functions.
1563         * tests/tests.h: Declare new functions.
1564
1565 2009-11-10  Torbjorn Granlund  <tege@gmplib.org>
1566
1567         * configure.in: Supply compiler options for atom in 32-bit mode.
1568
1569         * acinclude.m4 (X86_64_PATTERN): New.
1570         * configure.in: Setup and use X86_64_PATTERN.
1571
1572         * mpn/x86_64/fat/fat.c: New file.
1573         * mpn/x86_64/fat/fat_entry.asm: New file.
1574         * mpn/x86_64/fat: Copy C placeholder files from mpn/x86/fat.
1575         * mpn/x86_64/x86_64-defs.m4 (CPUVEC_FUNCS_LIST): New, copied from
1576         mpn/x86/x86-defs.m4.
1577         * configure.in: Move down x86 fat setup code until after ABI has been
1578         determined; generalise to handle x86_64.
1579
1580 2009-11-09  Torbjorn Granlund  <tege@gmplib.org>
1581
1582         * mpn/x86/fat/mod_1.c: New file.
1583
1584         * acinclude.m4 (GMP_C_FOR_BUILD_ANSI): Avoid poor quoting.
1585
1586 2009-11-08  Torbjorn Granlund  <tege@gmplib.org>
1587
1588         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Rewrite, update interface.  Callers
1589         updated.
1590         * mpn/generic/logops_n.c: New file.
1591         * doc/gmp.texi (Low-level Functions): Document logical mpn functions.
1592
1593 2009-11-07  Torbjorn Granlund  <tege@gmplib.org>
1594
1595         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): Adapt to new
1596         mpn_mulmod_bnm1 interface.
1597
1598 2009-11-07  Marco Bodrato <bodrato@mail.dm.unipi.it>
1599
1600         * mpn/generic/mulmod_bnm1.c: New interface, with size
1601         specified for all operands in mpn_mulmod_bnm1.
1602         * gmp-impl.h: Changed mpn_mulmod_bnm1 prototype.
1603
1604 2009-11-05  Torbjorn Granlund  <tege@gmplib.org>
1605
1606         * mpn/x86/k7/gcd_1.asm: Actually use div-reduced value.
1607         Mnemonic cleanup.
1608
1609         * mpn/x86_64/gcd_1.asm: New file.
1610
1611 2009-11-03  Torbjorn Granlund  <tege@gmplib.org>
1612
1613         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add sqr_n.c.
1614
1615 2009-11-03  Marco Bodrato <bodrato@mail.dm.unipi.it>
1616
1617         * mpn/generic/toom_interpolate_6pts.c: removed an addmul_1 and cleanup.
1618
1619 2009-11-02  Torbjorn Granlund  <tege@gmplib.org>
1620
1621         * configure.in (gmp_mpn_functions): Remove obsolete functions
1622         dc_divrem_n and sb_divrem_mn.
1623         * gmp-impl.h: Misc cleanup.
1624         (mpn_sb_divrem_mn, mpn_dc_divrem_n): Remove.
1625         (DIV_DC_THRESHOLD): Remove.
1626         * mpn/generic/dc_divrem_n.c: Remove.
1627         * mpn/generic/sb_divrem_mn.c: Remove.
1628         * mpn/generic/tdiv_qr.c: Use DC_DIV_QR_THRESHOLD, not DIV_DC_THRESHOLD.
1629
1630         * tests/devel/try.c: Replace mpn_sb_divrem_mn by mpn_sbpi1_div_qr.
1631         * tests/refmpn.c (refmpn_sb_div_qr): New name for refmpn_sb_divrem_mn.
1632
1633         * tune/Makefile.am (libspeed_la_SOURCES): Remove sb_div.c and sb_inv.c.
1634         (TUNE_MPN_SRCS_BASIC): Remove sb_divrem_mn.c.
1635         * tune/common.c (speed_mpn_dcpi1_div_qr_n): New function.
1636          Remove mpn_sb_divrem_mn related functions.
1637         * tune/speed.c (routine): Remove entries related to mpn_dc_divrem and
1638         mpn_sb_divrem.
1639         (routine): New entry for mpn_dc_div_qr_n.
1640         * tune/speed.h (SPEED_ROUTINE_MPN_DC_DIVREM_CALL): Compute inverse
1641         needed by pi1 calls.
1642         (SPEED_ROUTINE_MPN_SB_DIVREM_M3): Remove.
1643         * tune/tuneup.c (tune_sb_preinv): Remove.
1644         (tune_dc): Update to measure DC_DIV_QR_THRESHOLD.
1645
1646         * mpn/generic/sb_divappr_q.c: Remove.
1647
1648 2009-11-01  Torbjorn Granlund  <tege@gmplib.org>
1649
1650         * gmp-impl.h: Misc minor cleanups.
1651
1652 2009-10-31  Torbjorn Granlund  <tege@gmplib.org>
1653
1654         * gmp-impl.h (toom itch functions): Simplify, make some into macros.
1655         (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Remove.
1656         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove.
1657         * mpn/generic/mul_n.c (mpn_sqr_n): Move from here...
1658         * mpn/generic/sqr_n.c: ...to this new file.
1659         * configure.in (gmp_mpn_functions): Add sqr_n.
1660
1661         * Globally change
1662           MUL_TOOM3_THRESHOLD => MUL_TOOM33_THRESHOLD,
1663           MUL_KARATSUBA_THRESHOLD => MUL_TOOM22_THRESHOLD,
1664           SQR_KARATSUBA_THRESHOLD => SQR_TOOM2_THRESHOLD,
1665         and associated names analogously.
1666
1667 2009-10-31  Niels Möller  <nisse@lysator.liu.se>
1668
1669         * mpn/generic/toom_interpolate_7pts.c: Changed evaluation points,
1670         replacing -1/2 by -2.
1671         * mpn/generic/toom44_mul.c: Updated to use new evaluation points,
1672         and use mpn_toom_eval_dgr3_pm2.
1673         * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Likewise.
1674         * mpn/generic/toom53_mul.c (mpn_toom53_mul): Updated to use new
1675         evaluation points, and use mpn_toom_eval_pm1 and
1676         mpn_toom_eval_pm2exp.
1677         * mpn/generic/toom62_mul.c (mpn_toom62_mul): Likewise.
1678
1679         * mpn/generic/toom_eval_pm2exp.c: New file.
1680         * mpn/generic/toom_eval_pm1.c: New file.
1681
1682         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
1683         mpn_toom_eval_dgr3_pm2.
1684
1685 2009-10-30  Torbjorn Granlund  <tege@gmplib.org>
1686
1687         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom2* and toom3* files.
1688
1689 2009-10-30  Niels Möller  <nisse@lysator.liu.se>
1690
1691         * configure.in (gmp_mpn_functions): Added toom_eval_dgr3_pm2.
1692         * gmp-impl.h: Added prototype for mpn_toom_eval_dgr3_pm2.
1693         * mpn/generic/toom_eval_dgr3_pm2.c: New file.
1694
1695 2009-10-29  Niels Möller  <nisse@lysator.liu.se>
1696
1697         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use
1698         mpn_toom_eval_dgr3_pm1.
1699         * mpn/generic/toom42_mul.c (mpn_toom42_mul): Likewise.
1700
1701 2009-10-29  Torbjorn Granlund  <tege@gmplib.org>
1702
1703         * mpn/generic/mulmod_bnm1.c: Replace some add_1 by INCR.
1704
1705         * gmp-impl.h (mpn_mulmod_bnm1_itch): New macro.
1706
1707         * mpn/generic/mulmod_bnm1.c (mpn_mulmod_bnm1): Call mpn_mul_fft.
1708         (mpn_mulmod_bnm1_next_size): Adopt to SS FFT.
1709
1710         * mpn/generic/mul_fft.c (mpn_mul_fft): Make it return high limb.
1711         (mpn_mul_fft_internal): Likewise.
1712
1713         * mpn/generic/mulmod_bnm1.c: New file, by Niels Möller.
1714         * configure.in (gmp_mpn_functions): Add mulmod_bnm1.
1715         * gmp-impl.h: Add related declarations.
1716         * tune/tuneup.c: Tune MULMOD_BNM1_THRESHOLD.
1717         * tune/speed.h (SPEED_ROUTINE_MPN_MULMOD_BNM1): New macro.
1718         * tune/common.c (speed_mpn_mulmod_bnm1): New function.
1719         * Makefile.am (TUNE_MPN_SRCS_BASIC): Add mulmod_bnm1.c.
1720
1721         * gmp-impl.h (mpn_kara_mul_n, mpn_kara_sqr_n): Remove declarations.
1722         * tune/common.c: Remove/rename kara functions.
1723         * tune/speed.h: Likewise.
1724
1725         * tests/devel/try.c: Clean up usage of %p printf arguments.
1726
1727         * gmp-impl.h: Update MUL/SQR MINSIZE macros to reflect new function
1728         names and limitations
1729         * tune/tuneup.c: Use updated macro names.
1730         * tune/speed.h: Likewise.
1731         * tests/devel/try.c: Test new mul/sqr functions, remove old tests.
1732
1733 2009-10-29  Niels Möller  <nisse@lysator.liu.se>
1734
1735         * tune/speed.c: Added support for mpn_toom4_sqr,
1736
1737         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM4_SQR): New macro.
1738         (SPEED_ROUTINE_MPN_KARA_MUL_N): Deleted.
1739         (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Deleted.
1740         (SPEED_ROUTINE_MPN_TOOM2_SQR): Use mpn_toom2_sqr_itch.
1741
1742         * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove
1743         declarations.
1744         (mpn_toom2_sqr_itch): Add margin for recursive calls.
1745
1746 2009-10-28  Niels Möller  <nisse@lysator.liu.se>
1747
1748         * mpn/generic/mul_n.c (mpn_kara_mul_n): Deleted old Karatsuba
1749         implementation.
1750         (mpn_kara_sqr_n): Likewise deleted.
1751
1752         * mpn/generic/mul_n.c (mpn_sqr_n): Use mpn_toom2_sqr and
1753         mpn_toom3_sqr, not the old implementations.
1754
1755         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE): Deleted, replaced by
1756         mpn_toom33_mul_itch.
1757         (MPN_TOOM3_SQR_N_TSIZE): Deleted, replaced by
1758         mpn_toom3_sqr_itch.
1759         (mpn_toom33_mul_itch): Needs more scratch.
1760         (mpn_toom3_sqr_itch): Likewise.
1761         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM3_MUL_N): Use
1762         mpn_toom33_mul_itch.
1763         (SPEED_ROUTINE_MPN_TOOM3_SQR_N): Use mpn_toom3_sqr_itch.
1764         * mpn/generic/mul_n.c (mpn_mul_n): Use mpn_toom33_mul_itch.
1765         (mpn_sqr_n): Use mpn_toom3_sqr_itch.
1766
1767         * mpn/generic/toom33_mul.c (mpn_toom33_mul): Avoid TMP_ALLOC. Needs
1768         some more supplied scratch instead.
1769         * mpn/generic/toom3_sqr.c (mpn_toom3_sqr): Likewise.
1770
1771 2009-10-26  Torbjorn Granlund  <tege@gmplib.org>
1772
1773         * gmp-impl.h (invert_pi1): Streamline, as suggested by Niels.
1774
1775 2009-10-24  Torbjorn Granlund  <tege@gmplib.org>
1776
1777         * mpn/generic/bdiv_q.c: Update to call new functions.
1778         * mpn/generic/bdiv_qr.c: Likewise.
1779         * mpn/generic/binvert.c: Likewise.
1780         * mpn/generic/divexact.c: Likewise.
1781         * mpn/generic/divis.c: Likewise.
1782         * mpn/generic/perfpow.c: Likewise.
1783         * mpn/generic/tdiv_qr.c: Likewise.
1784         * mpn/generic/dcpi1_bdiv_q.c: New file.
1785         * mpn/generic/dcpi1_bdiv_qr.c: New file.
1786         * mpn/generic/dcpi1_div_q.c: New file.
1787         * mpn/generic/dcpi1_div_qr.c: New file.
1788         * mpn/generic/dcpi1_divappr_q.c: New file.
1789         * mpn/generic/sbpi1_bdiv_q.c: New file.
1790         * mpn/generic/sbpi1_bdiv_qr.c: New file.
1791         * mpn/generic/sbpi1_div_q.c: New file.
1792         * mpn/generic/sbpi1_div_qr.c: New file.
1793         * mpn/generic/sbpi1_divappr_q.c: New file.
1794         * mpn/generic/dc_bdiv_q.c: Removed.
1795         * mpn/generic/dc_bdiv_qr.c: Removed.
1796         * mpn/generic/dc_div_q.c: Removed.
1797         * mpn/generic/dc_div_qr.c: Removed.
1798         * mpn/generic/dc_divappr_q.c: Removed.
1799         * mpn/generic/sb_bdiv_q.c: Removed.
1800         * mpn/generic/sb_bdiv_qr.c: Removed.
1801         * mpn/generic/sb_div_q.c: Removed.
1802         * mpn/generic/sb_div_qr.c: Removed.
1803
1804         * configure.in (gmp_mpn_functions): Add new division functions, remove
1805         obsolete division functions.
1806
1807         * gmp-impl.h: Add declarations of new division functions, remove
1808         corresponding obsolete declarations.
1809         (gmp_pi1_t, gmp_pi2_t): New types.
1810         (invert_pi1): New macro for computing 2/1 and 3/2 inverses.
1811
1812 2009-10-23  Niels Möller  <nisse@lysator.liu.se>
1813
1814         * gmp-impl.h (mpn_toom62_mul_itch): New function.
1815
1816         * tests/mpn/t-toom53.c: New test program.
1817         * tests/mpn/t-toom62.c: New test program.
1818
1819 2009-10-23  Torbjorn Granlund  <tege@gmplib.org>
1820
1821         * mpn/generic/get_d.c: Fix code handling denorms for 64-bit machines.
1822         * tests/mpf/t-get_d.c (test_denorms): New function.
1823
1824 2009-10-23  Niels Möller  <nisse@lysator.liu.se>
1825
1826         * mpn/generic/toom52_mul.c (mpn_toom52_mul): Use supplied scratch
1827         space, not TMP_ALLOC. Interface change, now requires input sizes
1828         such that s + t >= 5.
1829
1830         * gmp-impl.h (mpn_toom52_mul_itch): New function.
1831
1832         * tests/mpn/t-toom52.c: New test program.
1833
1834 2009-10-22  Torbjorn Granlund  <tege@gmplib.org>
1835
1836         * mpn/x86_64/sqr_basecase.asm: Tune for speed and a 7% size decrease.
1837
1838 2009-10-22  Niels Möller  <nisse@lysator.liu.se>
1839
1840         * tests/mpn/t-toom44.c: New test program.
1841         * tests/mpn/t-toom33.c: New test program.
1842
1843         * tests/mpn/toom-shared.h (main): Reorganized input generation.
1844         Users are now supposed to define macros MAX_AN, MIN_BN and MAX_BN.
1845         Updated existing toom test programs.
1846
1847 2009-10-22  Torbjorn Granlund  <tege@gmplib.org>
1848
1849         * tests/devel/try.c: Fix typos in last change.
1850
1851 2009-10-21  Torbjorn Granlund  <tege@gmplib.org>
1852
1853         * mpn/asm-defs.m4 (define_mpn): Add mullow_basecase.
1854
1855         * tests/devel/try.c: Test mpn_mullow_n.
1856
1857         * tests/refmpn.c (refmpn_mullow_n): New function.
1858         * tests/tests.h: Declare it.
1859
1860 2009-10-21  Niels Möller  <nisse@lysator.liu.se>
1861
1862         * tests/mpn/toom-shared.h (main): Check for writes outside of the
1863         product or scratch area.
1864
1865         * gmp-impl.h (mpn_toom43_mul_itch): New function.
1866
1867         * mpn/generic/toom43_mul.c (mpn_toom43_mul): Use supplied scratch
1868         space, not TMP_ALLOC. Interface change, now requires input sizes
1869         such that s + t >= 5.
1870
1871 2009-10-20  Niels Möller  <nisse@lysator.liu.se>
1872
1873         * tests/mpn/toom-shared.h (MIN_BLOCK): New constant, which can be
1874         overridden by users. Needed by t-toom42 and t-toom43.
1875
1876         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom32,
1877         t-toom42 and t-toom43.
1878         * tests/mpn/t-toom43.c: New test program.
1879         * tests/mpn/t-toom42.c: New test program.
1880         * tests/mpn/t-toom32.c: New test program.
1881
1882         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-toom22.
1883         * tests/mpn/t-toom22.c: New test file.
1884         * tests/mpn/toom-shared.h: New file. Test framework for Toom
1885         functions.
1886
1887 2009-10-14  Niels Möller  <nisse@lysator.liu.se>
1888
1889         * mpn/generic/hgcd.c (mpn_hgcd_itch): Thanks to the new
1890         mpn_matrix22_mul_strassen, the scratch need is reduced by 16%.
1891
1892 2009-10-14  Marco Bodrato  <bodrato@mail.dm.unipi.it>
1893
1894         * mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): New
1895         Strassen-like algorithm, to reduce the amount of temporary
1896         storage.
1897         (mpn_matrix22_mul_itch): Updated to reflect the reduced storage
1898         need.
1899
1900 2009-10-03  Torbjorn Granlund  <tege@gmplib.org>
1901
1902         * Rename mpn_addsub_n to mpn_add_n_sub_n.
1903
1904 2009-10-01  Torbjorn Granlund  <tege@gmplib.org>
1905
1906         * mpn/generic/tdiv_qr.c: Call mpn_divrem_1 and mpn_dc_div_qr instead of
1907         old functions.
1908
1909         * mpn/generic/mul_n.c: Call toom22 and toom33 instead of old functions.
1910
1911         * mpn/generic/toom42_mul.c (TOOM42_MUL_N_REC): Renamed from
1912         TOOM22_MUL_N_REC.  Unconditionally call the generic mpn_mul_n.
1913         * mpn/generic/toom32_mul.c: Analogous changes.
1914
1915 2009-09-28  Niels Möller  <nisse@lysator.liu.se>
1916
1917         * mpn/x86_64/invert_limb.asm: Rewrite. Exploit cancellation in the
1918         Newton iteration.
1919
1920 2009-09-27  Niels Möller  <nisse@lysator.liu.se>
1921
1922         * mpn/x86/invert_limb.asm: Reduce register usage. Eliminated $1
1923         arguments to add, sub and shift.
1924
1925 2009-09-25  Niels Möller  <nisse@lysator.liu.se>
1926
1927         * mpn/x86/invert_limb.asm: New file.
1928
1929 2009-09-24  Torbjorn Granlund  <tege@gmplib.org>
1930
1931         * mpn/generic/toom33_mul.c: Use new toom functions for all recursive
1932         products.
1933         * mpn/generic/toom3_sqr.c: Likewise.
1934         * mpn/generic/toom44_mul.c: Likewise.
1935         * mpn/generic/toom4_sqr.c: Likewise.
1936
1937         * mpn/generic/add_n.c: Relax operand overlap ASSERTs.
1938         * mpn/generic/sub_n.c: Likewise.
1939
1940 2009-09-15  Torbjorn Granlund  <tege@gmplib.org>
1941
1942         Suggested by Uwe Mueller:
1943         * printf/doprnt.c: Use "%ld" for exponent printing.
1944         * printf/doprntf.c (__gmp_doprnt_mpf): Make expval "long".
1945
1946 2009-09-14  Torbjorn Granlund  <tege@gmplib.org>
1947
1948         * configure.in: Handle mingw64.
1949         * gmp-impl.h (gmp_intptr_t): Declare.
1950         * tests/amd64check.c (calling_conventions_values): Use CNST_LIMB.
1951         * tests/memory.c: Use gmp_intptr_t; print pointers using C90 "%p".
1952         * tests/misc.c: Use gmp_intptr_t.
1953         * tests/mpq/t-get_str.c: Print pointers using C90 "%p".
1954
1955 2009-08-12  Torbjorn Granlund  <tege@gmplib.org>
1956
1957         * mpn/generic/mod_1_1.c (mpn_mod_1_1p_cps): Remove silly ASSERT code.
1958
1959         * mpn/asm-defs.m4 (define_mpn): Remove mod_1s_1p, add mod_1_1p.
1960
1961         * mpn/arm/invert_limb.asm: Complete rewrite.
1962
1963         * longlong.h: Document LONGLONG_STANDALONE and NO_ASM.
1964
1965 2009-08-05  Torbjorn Granlund  <tege@gmplib.org>
1966
1967         * tests/mpz/dive_ui.c (check_random): Avoid zero divisors.
1968
1969 2009-07-31  Torbjorn Granlund  <tege@gmplib.org>
1970
1971         * mpn/generic/mod_1_1.c: Tweak to handle any modulus (possibility
1972         pointed out by Per Austrin).
1973         (mpn_mod_1_1p): Renamed from mpn_mod_1s_1p.
1974         (mpn_mod_1_1p_cps): Renamed from mpn_mod_1s_1p_cps.
1975         *mpn/generic/mod_1.c (mpn_mod_1): Reorganise to call mpn_mod_1_1p for
1976         any modulus.
1977
1978 2009-07-28  Torbjorn Granlund  <tege@gmplib.org>
1979
1980         * configure.in: Pass arch for x86 also in 64-bit mode.
1981
1982 2009-07-26  Torbjorn Granlund  <tege@swox.com>
1983
1984         * config.guess (_cpuid): Recognise more Intel "Core" processors.
1985
1986 2009-07-13  Torbjorn Granlund  <tege@gmplib.org>
1987
1988         * mpf/eq.c: Rewrite.
1989
1990         * tests/mpf/t-eq.c: New test.
1991
1992 2009-07-06  Torbjorn Granlund  <tege@gmplib.org>
1993
1994         * gmp-impl.h (__mp_bases): Remove this alias.
1995
1996         * mpf/get_str.c: Use less overflow prone expression for computing limb
1997         allocation.
1998         * mpz/inp_str.c: Likewise.
1999         * mpf/set_str.c: Likewise.
2000         * mpz/set_str.c: Likewise.
2001
2002 2009-07-03  Niels Möller  <nisse@lysator.liu.se>
2003
2004         * mpn/generic/gcd_1.c (mpn_gcd_1): Use masking tricks to reduce
2005         the number of branches in the loop.
2006
2007 2009-06-28  Torbjorn Granlund  <tege@gmplib.org>
2008
2009         * demos/factorize.c (factor_using_pollard_rho): Rewrite.
2010
2011         * mpz/clears.c: New file.
2012         * mpq/clears.c: New file.
2013         * mpf/clears.c: New file.
2014         * gmp-h.in (mpz_clears, mpq_clears, mpf_clears): Declare.
2015         * mpz/Makefile.am: Add clears.c.
2016         * mpq/Makefile.am: Add clears.c.
2017         * mpf/Makefile.am: Add clears.c.
2018         * Makefile.am: Add these also to respective OBJECTS variables.
2019         * doc/gmp.texi: Document inits function and clears functions.
2020
2021 2009-06-20  Torbjorn Granlund  <tege@gmplib.org>
2022
2023         * mp-h.in (mp_bitcnt_t): Declare here too.
2024
2025 2009-06-19  Torbjorn Granlund  <tege@gmplib.org>
2026
2027         * mpq/inits.c: New file.
2028         * mpf/inits.c: New file.
2029         * gmp-h.in (mpz_inits, mpq_inits, mpf_inits): Declare .
2030
2031         * mpn/generic/remove.c: New file.
2032         * configure.in (gmp_mpn_functions): Add remove.
2033         * gmp-impl.h (mpn_remove): Declare.
2034
2035         * gmp-h.in (mp_bitcnt_t): New basic type.
2036         * mpn/generic/perfpow.c (mp_bitcnt_t): Remove private definition.
2037
2038         * mpn/generic/bdiv_qr.c: Make it actually work.
2039
2040         * mpn/x86_64/core2/aorsmul_1.asm: Rewrite to use shorter pipeline and
2041         to need fewer registers.
2042
2043 2009-06-17  Torbjorn Granlund  <tege@gmplib.org>
2044
2045         * mpn/x86_64/rsh1aors_n.asm: New file.
2046         * mpn/x86_64/rsh1add_n.asm: Remove.
2047         * mpn/x86_64/rsh1sub_n.asm: Remove.
2048
2049         * mpz/inits.c: New file.
2050
2051         * gen-trialdivtab.c: Wrap limb constants into CNST_LIMB.
2052
2053         With Martin Boij:
2054         * mpn/generic/perfpow.c (binv_root, binv_sqroot): Change from being
2055         recursive to being iterative.
2056         (mpn_perfect_power_p): Reorganise temp memory usage to avoid a buffer
2057         overrun.  Trim allocation of next and prev.  Never create oversize
2058         products in the multiplicity binary search.
2059
2060         * mpn/generic/dc_div_q.c: Add missing TMP_FREE.
2061
2062 2009-06-16  Torbjorn Granlund  <tege@gmplib.org>
2063
2064         Revert:
2065         * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
2066
2067 2009-06-16  Martin Boij  <mboij@kth.se>
2068
2069         * mpn/generic/perfpow.c (logs): Use more conservative table.
2070
2071 2009-06-15  Torbjorn Granlund  <tege@gmplib.org>
2072
2073         * mpn/pa64/aors_n.asm: New file.
2074         * mpn/pa64/add_n.asm: Remove.
2075         * mpn/pa64/sub_n.asm: Remove.
2076
2077         * mpn/generic/perfpow.c (perfpow): Test exponents up to ub, inclusive.
2078
2079 2009-06-14  Torbjorn Granlund  <tege@gmplib.org>
2080
2081         * mpn/x86_64/bdiv_q_1.asm: Optimise away a mov insn.
2082         * mpn/x86_64/dive_1.asm: Likewise.
2083
2084         * mpn/generic/perfpow.c (binv_root): Use mpn_bdiv_q_1, not
2085         mpn_divexact_itch for 2-adic division.
2086         (all functions): Micro optimise.
2087
2088         * Makefile.am (libmp_la_SOURCES): Add nextprime.c.
2089
2090 2009-06-13  Torbjorn Granlund  <tege@gmplib.org>
2091
2092         * gmp-h.in (mpn_perfect_power_p): Declare.
2093         * configure.in (gmp_mpn_functions): Add perfpow.
2094         * mpz/perfpow.c: Now trivial, simply calls mpn_perfect_power_p.
2095
2096 2009-06-13  Martin Boij  <mboij@kth.se>
2097
2098         * mpn/generic/perfpow.c: New file.
2099         * tests/mpz/t-perfpow.c: Rewrite.
2100
2101 2009-06-12  Torbjorn Granlund  <tege@gmplib.org>
2102
2103         * mpn/generic/bdiv_qr.c: New file.
2104         * mpn/generic/bdiv_q.c: New file.
2105         * configure.in (gmp_mpn_functions): Add bdiv_qr and bdiv_q.
2106         * gmp-impl.h: Declare new functions.
2107
2108         * nextprime.c: New file.
2109         * gmp-impl.h (gmp_primesieve_t, gmp_init_primesieve, gmp_nextprime):
2110         Declare
2111         * Makefile.am (libgmp_la_SOURCES): Add nextprime.c.
2112
2113 2009-06-11  Torbjorn Granlund  <tege@gmplib.org>
2114
2115         * mpn/generic/trialdiv.c: New file.
2116         * gen-trialdivtab.c: New file.
2117         * configure.in (gmp_mpn_functions): Add trialdiv.
2118         * gmp-impl.h (mpn_trialdiv): Declare
2119         * Makefile.am: Add rules for gen-trialdivtab and trialdiv.
2120
2121         * longlong.h (arm count_leading_zeros): Define for armv5.
2122
2123         * gmp-impl.h: Move down toom itch functions to after we've #defined
2124         all THRESHOLDs.
2125
2126         * dumbmp.c (isprime): Replace with slightly less inefficient code.
2127         (mpz_tdiv_r): New function.
2128
2129 2009-06-11  Niels Möller  <nisse@lysator.liu.se>
2130
2131         Support for mpn_toom32_mul in speed:
2132         * tune/speed.c (routine): Added mpn_toom32_mul.
2133         * tune/speed.h (SPEED_ROUTINE_MPN_TOOM32_MUL): New macro.
2134         * tune/common.c (speed_mpn_toom32_mul): New function.
2135
2136         * gmp-impl.h (mpn_toom32_mul_itch): Count scratch space needed
2137         for the calls to mpn_toom22_mul.
2138         (ABOVE_THRESHOLD): Moved this and related macros so it can be used
2139         by mpn_toom32_mul_itch.
2140         (mpn_toom22_mul_itch): Count scratch space for recursive calls.
2141
2142 2009-06-11  Torbjorn Granlund  <tege@gmplib.org>
2143
2144         * mpn/x86/k7/mod_1_4.asm: New file, mainly for k7, but perhaps useful
2145         also for k6 and non-sse p6.
2146
2147 2009-06-10  Torbjorn Granlund  <tege@gmplib.org>
2148
2149         * mpn/x86_64/mod_1_4.asm: Minor size reducing tweaks.
2150
2151         * mpn/x86/mod_1.asm: Remove obsolete file.
2152         * mpn/x86/k7/mmx/mod_1.asm: Likewise.
2153         * mpn/x86/pentium4/sse2/mod_1.asm: Likewise.
2154         * mpn/x86/p6/mod_1.asm: Likewise.
2155         * mpn/x86/pentium/mod_1.asm: Likewise.
2156
2157 2009-06-08  Niels Möller  <nisse@lysator.liu.se>
2158
2159         * mpn/generic/toom4_sqr.c (mpn_toom4_sqr): Reorganized, to reduce
2160         the need for scratch space, and get rid of TMP_ALLOC. Also use
2161         mpn_toom_eval_dgr3_pm1.
2162
2163         * mpn/generic/toom_interpolate_6pts.c (mpn_toom_interpolate_6pts):
2164         Stricter ASSERTs based on maximum size of polynomial coefficients.
2165         Improved comments on the signedness of intermediate values.
2166
2167 2009-06-07  Torbjorn Granlund  <tege@gmplib.org>
2168
2169         * mpn/generic/toom2_sqr.c: Make it actually work.
2170
2171         * mpn/generic/toom3_sqr.c: Reduce local scratch space.
2172
2173 2009-06-05  Torbjorn Granlund  <tege@gmplib.org>
2174
2175         * mpn/generic/mul_fft.c (FFT_TABLE2_SIZE): Default to 200.
2176         (MUL_FFT_TABLE2_SIZE, SQR_FFT_TABLE2_SIZE): Let these decide
2177         FFT_TABLE2_SIZE if they are defined.
2178         (struct nk): Use bit field.
2179
2180 2009-06-05  Niels Möller  <nisse@lysator.liu.se>
2181
2182         * mpn/generic/toom44_mul.c (mpn_toom44_mult): Use
2183         mpn_toom_eval_dgr3_pm1.
2184
2185         * mpn/generic/toom_eval_dgr3_pm1.c: New file.
2186
2187         * mpn/generic/toom_interpolate_7pts.c (mpn_toom_interpolate_7pts):
2188         Minor cleanup, use mpn_add rather than mpn_add_n + MPN_INCR_U.
2189
2190         * mpn/generic/toom44_mul.c (mpn_toom44_mul): Reorganized, to
2191         reduce the need for scratch space, and get rid of TMP_ALLOC.
2192
2193 2009-06-05  Torbjorn Granlund  <tege@gmplib.org>
2194
2195         * mpn/generic/toom_interpolate_7pts.c: Fall back mpn_divexact_byN to
2196         mpn_bdiv_q_1_pi1, if the latter is NATIVE.
2197
2198 2009-06-04  Torbjorn Granlund  <tege@gmplib.org>
2199
2200         * mpn/x86_64/bdiv_q_1.asm: New file.
2201
2202         * configure.in (HAVE_NATIVE): Add recently added functions.
2203         (GMP_MULFUNC_CHOICES): Handle addlsh_n, sublsh_n, rsblsh_n.
2204
2205         * tune/common.c (speed_mpn_bdiv_q_1, speed_mpn_bdiv_q_1_pi1):
2206         New functions.
2207         * tune/speed.c (routine): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
2208         * tune/speed.h (SPEED_ROUTINE_MPN_BDIV_Q_1_PI1): New #define.
2209         (SPEED_ROUTINE_MPN_BDIV_Q_1): Mew #define.
2210
2211         * configure.in (gmp_mpn_functions): Add bdiv_q_1.
2212         * mpn/generic/bdiv_q_1.c: New file.
2213         * mpn/asm-defs.m4 (define_mpn): Add mpn_bdiv_q_1 and mpn_bdiv_q_1_pi1.
2214         * gmp-impl.h (mpn_bdiv_q_1, mpn_bdiv_q_1_pi1): Declare.
2215
2216         * mpn/x86_64/lshift.asm: Cleanup.
2217         * mpn/x86_64/rshift.asm: Cleanup.
2218
2219         * mpn/x86_64/addlsh1_n.asm: Removed.
2220         * mpn/x86_64/aorrlsh1_n.asm: Generalised addlsh1_n.asm to handle
2221         addlsh1_n and rsblsh1_n functionality.
2222
2223         * tests/refmpn.c (refmpn_rsblsh1_n): New function.
2224         * tests/devel/try.c: Test mpn_rsblsh1_n.
2225         * tests/tests.h: Declare refmpn_rsblsh1_n.
2226         * tune/common.c (speed_mpn_rsblsh1_n): New function.
2227         * tune/speed.c (routine): Add mpn_rsblsh1_n.
2228         * tune/speed.h (mpn_rsblsh1_n): Declare.
2229
2230         * configure.in (gmp_mpn_functions_optional): Add rsblsh1_n.
2231         (GMP_MULFUNC_CHOICES): Handle rsblsh1_n defined with a mulfunc.
2232         * mpn/asm-defs.m4 (define_mpn): Add rsblsh1_n.
2233         * gmp-impl.h (mpn_rsblsh1_n): Declare.
2234
2235         * mpn/generic/toom32_mul.c: Consistently use TOOM22_MUL_N_REC.
2236
2237 2009-06-03  Marco Bodrato  <bodrato@mail.dm.unipi.it>
2238
2239         * mpn/generic/toom43_mul.c: New file.
2240         * mpn/generic/toom52_mul.c: New file.
2241         * mpn/generic/toom_interpolate_6pts.c: New file.
2242
2243 2009-06-03  Torbjorn Granlund  <tege@gmplib.org>
2244
2245         * configure.in (gmp_mpn_functions): Add toom43_mul, toom52_mul, and
2246         toom_interpolate_6pts, but also some previously forgotten functions.
2247         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Likewise.
2248         * gmp-impl.h: Declare new functions. Sort toom function declarations.
2249
2250         * gmp-impl.h: Rename  toom4_* flags enum to toom7_*.  Relevant C files
2251         updated.
2252
2253         * mpn/generic/toom_interpolate_7pts (divexact_2exp): Remove.
2254
2255 2009-06-02  Torbjorn Granlund  <tege@gmplib.org>
2256
2257         * demos/factorize.c: Add -q command line option.
2258
2259 2009-06-02  Marco Bodrato  <bodrato@mail.dm.unipi.it>
2260
2261         * mpn/generic/toom_interpolate_7pts.c: Streamline, resulting in speed
2262         improvements.
2263
2264         * mpn/generic/toom_interpolate_5pts.c: Likewise, but also completely
2265         do away with explicit scratch space.
2266         * gmp-impl.h (mpn_toom_interpolate_5pts): Update prototype.
2267
2268         * mpn/generic/mul_n.c (mpn_toom3_sqr_n, mpn_toom3_mul_n):
2269         Update toom_interpolate_5pts call without scratch space parameter.
2270         * mpn/generic/toom3_sqr.c: Likewise.
2271         * mpn/generic/toom42_mul.c: Likewise.
2272         * mpn/generic/toom33_mul.c: Likewise.
2273
2274         * mpn/generic/toom33_mul.c: Reduce local scratch space.
2275         * mpn/generic/toom32_mul.c: Rewrite to not use local scratch space.
2276
2277 2009-06-02  Torbjorn Granlund  <tege@gmplib.org>
2278
2279         * mpn/generic/toom22_mul.c (TOOM22_MUL_MN_REC): New macro, use it for
2280         oo point.
2281
2282 2009-06-01  Torbjorn Granlund  <tege@gmplib.org>
2283
2284         * mpn/generic/mul.c: Loop to avoid excessive recursion in toom33 and
2285         toom44 slicing code.
2286
2287         * mpz/remove.c: Correctly handle multiplicity that does not fit an int.
2288
2289         * Makefile.am (dist-hook): Check library version consistency.
2290
2291         * mpn/generic/mul.c: Rewrite.
2292
2293 2009-05-29  Torbjorn Granlund  <tege@gmplib.org>
2294
2295         * tests/mpz/t-divis.c (check_random): Create huge test operands.
2296
2297         * mpn/generic/toom44_mul.c: Allocate temp space using one TMP_ALLOC
2298         call, not multiple TMP_SALLOC.
2299         * mpn/generic/toom4_sqr.c: Likewise.
2300
2301         * gmp-impl.h (mpn_toom22_mul_itch): Replace totally wrong code.
2302
2303         * mpn/generic/mullow_n.c: Relax overlap requirement implied by ASSERT.
2304
2305         * mpn/generic/divis.c: Rewrite.
2306
2307         * gmp-impl.h (mpn_mu_bdiv_qr): Now returns mp_limb_t.
2308         (mpn_toom2_sqr_itch): Simplify.
2309
2310         * mpn/generic/mu_bdiv_qr.c: Implement properly.
2311
2312 2009-05-27  Torbjorn Granlund  <tege@gmplib.org>
2313
2314         * mpn/generic/mod_1_1.c: Add proper ASSERT functionality cps function.
2315         * mpn/generic/mod_1_2.c: Likewise.
2316         * mpn/generic/mod_1_3.c: Likewise.
2317         * mpn/generic/mod_1_4.c: Likewise.
2318
2319         * tune: Add speed measuring of toom22, toom33, and toom44.
2320
2321         * mpn/generic/toom22_mul.c: Handle potentially unbalanced coefficient
2322         product better.
2323
2324 2009-05-26  Torbjorn Granlund  <tege@gmplib.org>
2325
2326         * tests/mpz/t-mul.c (ref_mpn_mul): Use mpn_toom44_mul in FFT range for
2327         better huge-operands performance.
2328
2329 2009-05-24  Torbjorn Granlund  <tege@gmplib.org>
2330
2331         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Try "$L" too, before "$".
2332
2333 2009-05-23  Torbjorn Granlund  <tege@gmplib.org>
2334
2335         * gmp-impl.h (mpn_mod_1s_1p,mpn_mod_1s_2p,mpn_mod_1s_3p,mpn_mod_1s_4p):
2336         Declare using __GMP_ATTRIBUTE_PURE.
2337
2338         * tune/tuneup.c (tune_mod_1): Specify check_size for measuring mod_1_N
2339         functions.
2340         (one): Remove redundant size loop exit condition.
2341
2342 2009-05-20  Torbjorn Granlund  <tege@gmplib.org>
2343
2344         * mpn/x86/pentium4/sse2/mod_1_4.asm: New file.
2345         * mpn/x86/p6/sse2/mod_1_4.asm: New file (grabbing pentium4 code).
2346
2347 2009-05-18  Torbjorn Granlund  <tege@gmplib.org>
2348
2349         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 4.
2350         (__GNU_MP_VERSION_PATCHLEVEL): Set to -1.
2351
2352         * mpn/x86_64/mod_1_4.asm: New file.
2353
2354         * mpn/asm-defs.m4: Correct names for mod_1_N functions.
2355         Add defines for corresponding cps functions.
2356
2357         * mpn/generic/mod_1_2.c: Support any sizes > 1.
2358         * mpn/generic/mod_1_3.c: Likewise.
2359         * mpn/generic/mod_1_4.c: Likewise.
2360
2361 2009-05-12  Torbjorn Granlund  <tege@gmplib.org>
2362
2363         * Version 4.3.1 released.
2364
2365 2009-05-11  Torbjorn Granlund  <tege@gmplib.org>
2366
2367         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
2368
2369         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
2370         Bump version info.
2371
2372 2009-05-09  Torbjorn Granlund  <tege@gmplib.org>
2373
2374         * tests/mpz: Add MPZ_CHECK_FORMAT to many tests.
2375
2376 2009-05-07  Torbjorn Granlund  <tege@gmplib.org>
2377
2378         * mpn/x86/pentium4/sse2/mul_basecase.asm: Avoid L(ret), "ret" is
2379         defined in x86-defs.m4.
2380
2381 2009-05-06  Torbjorn Granlund  <tege@gmplib.org>
2382
2383         * mpn/x86/p6/aors_n.asm: Use L() for labels.
2384         * mpn/x86/pentium4/sse2/addmul_1.asm: Likewise.
2385         * mpn/x86/pentium4/sse2/mul_1.asm: Likewise.
2386         * mpn/x86/pentium4/sse2/mul_basecase.asm: Likewise.
2387         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
2388         * mpn/x86_64/lshift.asm: Likewise.
2389         * mpn/x86_64/rshift.asm: Likewise.
2390
2391         * tests/cxx/t-locale.cc (point_string): Declare as extern "C" to
2392         placate compilers that mangle variable names.
2393
2394 2009-05-04  Torbjorn Granlund  <tege@gmplib.org>
2395
2396         * tests/mpz/t-gcd.c: Generate operands that are multiple of each other.
2397
2398 2009-05-01  Torbjorn Granlund  <tege@gmplib.org>
2399
2400         * gmp-h.in (__GMP_EXTERN_INLINE): Support for more systems.
2401         (gmp_randinit_set): Add missing __GMP_DECLSPEC.
2402
2403 2009-04-28  Torbjorn Granlund  <tege@gmplib.org>
2404
2405         * mpn/generic/neg_n.c: New file.
2406         * configure.in (gmp_mpn_functions): Add neg_n.
2407         * mpn/asm-defs.m4 (define_mpn): Add neg_n.
2408         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add neg_n.c.
2409         * gmp-h.in: Handle mpn_neg_n properly.
2410
2411         * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Nailify.
2412
2413         * mpn/generic/gcdext.c: Change some MPN_NORMALIZE to
2414         MPN_NORMALIZE_NOT_ZERO.
2415         * mpn/generic/gcdext_lehmer.c: Likewise.
2416         Add a MPN_NORMALIZE_NOT_ZERO.
2417
2418         * mpn/generic/binvert.c: Remove own mpn_neg_n.
2419
2420         * tests/mpz/t-gcd.c: Add some MPZ_CHECK_FORMAT calls.
2421
2422 2009-04-27  Torbjorn Granlund  <tege@gmplib.org>
2423
2424         * mpn/Makefile.am (TARG_DIST): Add minithres.
2425
2426         * mpn/generic/bdiv_dbm1c.c: Handle nails.
2427
2428 2009-04-26  Torbjorn Granlund  <tege@gmplib.org>
2429
2430         * config.guess: Recognise more POWER processor types.
2431
2432 2009-04-25  Torbjorn Granlund  <tege@gmplib.org>
2433
2434         * mpn/x86/pentium4/sse2/popcount.asm: Work around Apple reloc bug.
2435         * mpn/x86/darwin.m4: Define symbol "DARWIN".
2436
2437 2009-04-19  Torbjorn Granlund  <tege@gmplib.org>
2438
2439         * mpn/generic/powm.c (mpn_redc_n): Use ASSERT_ALWAYS, not abort().
2440         * mpn/generic/powm_sec.c: Likewise.
2441
2442         * mpn/powerpc64/aix.m4 (EXTERN_FUNC): New define.  Add dummy variants
2443         for other m4 files.
2444         * mpn/powerpc64/mode64/divrem_1.asm: Use EXTERN_FUNC.
2445         * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
2446
2447 2009-04-16  Torbjorn Granlund  <tege@gmplib.org>
2448
2449         * mpn/x86_64/x86_64-defs.m4 (JUMPTABSECT): New define.
2450         * mpn/x86_64/darwin.m4: Likewise.
2451         * mpn/x86_64/sqr_basecase.asm: Rework switch code using JUMPTABSECT.
2452
2453         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
2454         Remove an unused variable.
2455
2456         * mpn/x86/x86-defs.m4 (LEA): Get SIZE arguments right.
2457
2458 2009-04-14  Torbjorn Granlund  <tege@gmplib.org>
2459
2460         * Version 4.3.0 released.
2461
2462         * scanf/doscan.c (__gmp_doscan): Pad 3-operand scanf call with dummy
2463         argument.
2464         * scanf/sscanffuns.c (scan): Disable vsscanf variant for now.
2465
2466 2009-04-13  Torbjorn Granlund  <tege@gmplib.org>
2467
2468         * scanf/sscanffuns.c (scan): Rewrite to use stdarg.
2469
2470         * tests/mpz/t-root.c: Rewrite.  Add unconditional gcc 4.3.2 tests.
2471
2472 2009-04-09  Torbjorn Granlund  <tege@gmplib.org>
2473
2474         * mpn/generic/powm.c: New file.
2475         * mpn/generic/powlo.c: New file.
2476         * mpn/generic/powm_sec.c: New file.
2477         * configure.in (gmp_mpn_functions): List new functions.
2478
2479 2009-04-08  Torbjorn Granlund  <tege@gmplib.org>
2480
2481         * mpz/urandomm.c: Amend last fix.
2482
2483 2009-04-06  Torbjorn Granlund  <tege@gmplib.org>
2484
2485         * configure.in: Support Sun cc for x86_64.
2486
2487         * mpz/urandomm.c: Handle operand overlap.
2488
2489 2009-03-11  Torbjorn Granlund  <tege@gmplib.org>
2490
2491         * configure.in (powerpc): Brave removing -Wa,-mppc64, in the hope that
2492         GCC now passes the proper options.
2493
2494 2009-03-09  Torbjorn Granlund  <tege@gmplib.org>
2495
2496         * mpn/x86_64/divrem_1.asm: Add a nop to save a cycle in unnormalised
2497         case.
2498
2499 2009-03-05  Torbjorn Granlund  <tege@gmplib.org>
2500
2501         * ia64/gmp-mparam.h, arm/gmp-mparam.h, x86/p6/mmx/gmp-mparam.h,
2502         pa32/hppa2_0/gmp-mparam.h sparc32/v9/gmp-mparam.h: Update.
2503
2504 2009-03-03  Torbjorn Granlund  <tege@gmplib.org>
2505
2506         * mpn/ia64/bdiv_dbm1c.asm: Accept/return carry.
2507
2508 2009-03-02  Torbjorn Granlund  <tege@gmplib.org>
2509
2510         * configure.in (64-bit sparc/solaris): Pass -xO3, not -O3 to solaris
2511         system compiler.
2512
2513 2009-03-01  Torbjorn Granlund  <tege@gmplib.org>
2514
2515         * longlong.h (mips, powerpc): Provide assembly-free umul_ppmm for newer
2516         gcc.
2517
2518 2009-02-04  Torbjorn Granlund  <tege@gmplib.org>
2519
2520         * mpn/generic/redc_2.c: Remove code for testing and timing.  Update
2521         to current FSF header.
2522         * mpn/generic/redc_1.c: Update to current FSF header.
2523
2524 2009-01-21  Torbjorn Granlund  <tege@gmplib.org>
2525
2526         * mpz/powm.c (redc): Remove.
2527         (mpz_powm): Use mpn_redc_1 instead of redc.
2528
2529         * tests/mpz/t-powm.c: Rewrite reference code.
2530
2531 2009-01-18  Torbjorn Granlund  <tege@gmplib.org>
2532
2533         * tests/mpz: Increase reps for many tests.
2534
2535         * mpn/generic/rootrem.c (mpn_rootrem_internal): Use MPN_DECR_U instead of
2536         mpn_sub_1 (works around gcc 4.3 bugs and is also faster).
2537
2538 2009-01-16  Torbjorn Granlund  <tege@gmplib.org>
2539
2540         * tests/tests.h: Declare refmpn_divrem_2.
2541
2542 2009-01-15  Torbjorn Granlund  <tege@gmplib.org>
2543
2544         * mpz/perfpow.c: Add TMP_FREE before every return statement.
2545
2546         * mpn/generic/rootrem.c (mpn_rootrem_internal): Add a missing TMP_FREE.
2547
2548         * configure.in (gcc_cflags, gcc_64_cflags): Revert from -O3 to -O2,
2549         the change was accidental and cause too much miscompilation.
2550
2551 2009-01-14  Torbjorn Granlund  <tege@gmplib.org>
2552
2553         * tune/tuneup.c (tune_mod_1): Run MOD_1_x_THRESHOLD tests also when
2554         longlong.h specified UDIV_PREINV_ALWAYS.
2555
2556         * mpn/generic/mod_1.c (mpn_mod_1): Properly check for normalisation
2557         divisor.
2558
2559 2009-01-13  Torbjorn Granlund  <tege@gmplib.org>
2560
2561         * tune/tuneup.c (tune_mod_1): Tune for MOD_1_1_THRESHOLD,
2562         MOD_1_2_THRESHOLD, and MOD_1_4_THRESHOLD.
2563
2564         * mpn/generic/mod_1.c: Rewrite.
2565         * mpn/generic/mod_1_1.c: New file.
2566         * mpn/generic/mod_1_2.c: New file.
2567         * mpn/generic/mod_1_3.c: New file.
2568         * mpn/generic/mod_1_4.c: New file.
2569         * configure.in (gmp_mpn_functions): Add mod_1_*.
2570         * mpn/asm-defs.m4 (define_mpn): Add mod_1_*.
2571         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mod_1_*.c.
2572         * gmp-impl.h: Declare new mpn_mod_1s_* functions and associated
2573         THRESHOLD macros.
2574         (udiv_rnd_preinv): New macro.
2575
2576 2009-01-12  Torbjorn Granlund  <tege@gmplib.org>
2577
2578         * tune/tuneup.c (tune_gcd_dc,tune_gcdext_dc): Lower step_factor to 0.1.
2579
2580 2009-01-08  Torbjorn Granlund  <tege@gmplib.org>
2581
2582         * tests/mpz/t-nextprime.c: New test file.
2583         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-nextprime.
2584
2585         From Niels Möller:
2586         * mpz/nextprime.c: Handle large prime gaps by limiting incr.
2587
2588 2009-01-04  Torbjorn Granlund  <tege@gmplib.org>
2589
2590         * mpz/and.c, mpz/ior.c, mpz/xor.c: Re-read only necessary source
2591         pointers after reallocation.  Misc cleanup.
2592
2593         * gmp-impl.h (MPN_TOOM44_MAX_N): New define, replaces MPN_TOOM3_MAX_N.
2594
2595         * mpn/x86/fat/diveby3.c: New file.
2596
2597 2008-12-30  Niels Möller  <nisse@lysator.liu.se>
2598
2599         * doc/gmp.texi (Greatest Common Divisor Algorithms): Updated
2600         section on GCD algorithms.
2601
2602 2008-12-29  Torbjorn Granlund  <tege@gmplib.org>
2603
2604         * doc/gmp.texi (Multiplication Algorithms): Add descriptions of Toom-4
2605         and unbalanced multiplication.
2606         (Radix to Binary): Add warning that text is outdated,
2607         (Contributors): Fix typos.
2608
2609         * mpn/generic/toom*.c: Use coherent MAYBE_ macros for trimming
2610         unreachable recursive functions.
2611         * gmp-impl.h: Update toom itch functions.
2612
2613         * mpn/x86_64/sqr_basecase.asm: Slightly increase stack allocation, to
2614         placate tuneup.
2615
2616 2008-12-28  Torbjorn Granlund  <tege@gmplib.org>
2617
2618         * mpn/x86_64/pentium4/aors_n.asm: Tune prologue code.
2619
2620         * mpn/x86_64/pentium4/aorslsh1_n.asm: New file.
2621
2622         * mpn/x86_64/darwin.m4: Define symbol "DARWIN".
2623         * mpn/x86_64/invert_limb.asm: Work around darwin quirks.
2624
2625         * mpn/x86_64/sqr_basecase.asm: Further optimize, support Darwin.
2626
2627         * mpn/x86_64/invert_limb.asm: New file.
2628
2629 2008-12-27  Torbjorn Granlund  <tege@gmplib.org>
2630
2631         * mpn/x86_64/core2/aorslsh1_n.asm: New file.
2632
2633 2008-12-26  Torbjorn Granlund  <tege@gmplib.org>
2634
2635         * mpz/perfpow.c: Handle negative arguments properly.
2636         * tests/mpz/t-perfpow.c: New file.
2637         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-perfpow.
2638
2639 2008-12-23  Torbjorn Granlund  <tege@gmplib.org>
2640
2641         * tests/mpz/t-mul.c (dump_abort): Improve error message.
2642
2643         * gcd.c gcd_subdiv_step.c gcdext.c gcdext_subdiv_step.c:
2644         Remove private mpn_zero_p.
2645
2646         * tune/tuneup.c (tune_mul): Tune for MUL_TOOM44_THRESHOLD.
2647         (tune_sqr): Tune for SQR_TOOM4_THRESHOLD.
2648
2649         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Add toom44_mul.c and
2650         toom4_sqr.c.
2651
2652         * configure.in (gmp_mpn_functions): Toom function updates.
2653
2654         * Rename mpn/mul_toomMN.c to mpn/toomMN_mul.c.  Function names changed
2655         accordingly.
2656
2657         * mpn/toomMN_mul.c: Add scratch parameter.  Do recursive multiplies
2658         properly.  Misc tuning.  Remove CHECK and TIMING code.
2659
2660         * mpn/toom2_sqr.c, mpn/toom3_sqr.c, mpn/toom4_sqr.c: New files.
2661
2662         * gmp-impl.h (mpn_toomMN_mul_itch): Several new functions.
2663         (mpn_zero_p): New functions.
2664         Add various TOOM4/TOOM44 related parameters.
2665         Update mpn_toomMN_mul prototypes.
2666
2667         * mpn/generic/mul_n.c (mpn_mul_n): Call mpn_toom44_mul.  Use TMP_BALLOC
2668         instead of malloc.
2669         (mpn_sqr_n): Analogous changes.
2670
2671         * mpn/generic/mul.c: Update unbalanced toom code to pass scratch space.
2672
2673 2008-12-21  Torbjorn Granlund  <tege@gmplib.org>
2674
2675         * mpz/nextprime.c: Add TMP_SDECL/MARK/FREE.
2676
2677 2008-12-20  Torbjorn Granlund  <tege@gmplib.org>
2678
2679         * mpn/generic/sqrtrem.c (mpn_sqrtrem1): Rewrite, improve interface.
2680         (invsqrttab): New table, remove table approx_tab.
2681         (mpn_sqrtrem2): Optimize, update mpn_sqrtrem1 call.
2682         (mpn_sqrtrem): Update mpn_sqrtrem1 call.
2683
2684 2008-12-18  Torbjorn Granlund  <tege@gmplib.org>
2685
2686         * mpz/nextprime.c: Run 10 mpz_millerrabin tests (was 5).
2687         Give credit to authors.
2688
2689         * mpn/x86_64/redc_1.asm: Align stack as mandated by ABI.
2690
2691         * mpn/x86_64/divrem_2.asm: Add some comments.
2692
2693         * mpn/x86_64/darwin.m4: New file.
2694         * configure.in: Use x86_64/darwin.m4.
2695
2696 2008-12-15  Torbjorn Granlund  <tege@gmplib.org>
2697
2698         * doc/projects.html: Remove GCD and division projects, update text on
2699         multiplication.
2700
2701         * doc/tasks.html: Add a caution about that the file is somewhat
2702         outdated.
2703
2704 2008-12-14  Torbjorn Granlund  <tege@gmplib.org>
2705
2706         * mpn/alpha/ev6/aorsmul_1.asm: New file (same code for mpn_addmul_1,
2707         much improved for mpn_submul_1).
2708         * mpn/alpha/ev6/addmul_1: File removed.
2709         * mpn/alpha/ev6/submul_1: File removed.
2710
2711 2008-12-09  Torbjorn Granlund  <tege@gmplib.org>
2712
2713         From David Harvey:
2714         * mpn/x86_64/mul_basecase.asm: Further tweaks for code size and speed.
2715
2716         * mpn/powerpc64/mode64/divrem_1.asm: Rewrite.
2717
2718         * mpn/powerpc64/mode64/mul_basecase.asm: New file.
2719
2720 2008-12-08  Torbjorn Granlund  <tege@gmplib.org>
2721
2722         * mpn/powerpc64/mode64/gmp-mparam.h: New file.
2723
2724         * gmp-impl.h: Additional cleanups.
2725         (mpn_set_str_compute_powtab): New prototype.
2726         (mpn_powm, mpn_powlo): New prototypes.
2727
2728         * mpz/pow_ui.c: Handle some small exponents locally.
2729
2730 2008-12-07  Torbjorn Granlund  <tege@gmplib.org>
2731
2732         * mpn/generic/set_str.c: Remove prototypes (they are in gmp-impl.h).
2733
2734         * tune/set_strs.c, tune/set_strb.c: Make prototypes effective by moving
2735         the #define mpn_set_str* before including gmp-impl.h.
2736
2737         * All files: Change _PROTO => __GMP_PROTO.
2738
2739         * tune/speed.c (routine): Remove non-working choice mpn_set_str_subquad.
2740         * tune/common.c (speed_mpn_dc_set_str): Remove, it is broken.
2741
2742         * mpn/generic/toom_interpolate_7pts.c (divexact_2exp): Make this static,
2743         and inline it.
2744
2745         * gmp-impl.h: Major cleanup.
2746         (Remove formal parameter names.  Use __GMP_PROTO consistently.  Move
2747         __GMP_PROTO and __MPN use to adjacent lines for declared function.
2748         Fix typos.  Remove code inside #if 0.)
2749
2750         * configure.in (gmp_mpn_functions): Add mul_toom33.  Reformat.
2751
2752 2008-12-05  Torbjorn Granlund  <tege@gmplib.org>
2753
2754         * mpn/generic/redc_1.c: New file.
2755         * mpn/generic/redc_2.c: New file.
2756
2757         * configure.in (gmp_mpn_functions): List redc_1 and redc_2.
2758         (HAVE_NATIVE): Likewise.
2759
2760         * tune/common.c (speed_mpn_redc_1): Renamed from speed_redc.
2761         * tune/speed.c (routine): Remove "redc", and "mpn_redc_1".
2762         * tune/speed.h (SPEED_ROUTINE_REDC_1): Renamed from SPEED_ROUTINE_REDC.
2763         Updated call.
2764         * tune/tuneup.c (tune_powm): Update redc call.
2765
2766 2008-12-04  Torbjorn Granlund  <tege@gmplib.org>
2767
2768         * mpn/x86_64/sqr_basecase.asm: Inline a combined diagonal product code
2769         and addlsh1 loop.  Misc cleanup.
2770
2771 2008-12-02  Torbjorn Granlund  <tege@gmplib.org>
2772
2773         * mpn/x86_64/sqr_basecase.asm: New file.
2774
2775 2008-11-30  Torbjorn Granlund  <tege@gmplib.org>
2776
2777         * mpn/generic/sqr_basecase.c: Fix typo in mpn_addmul_2s variant.
2778
2779 2008-11-28  Torbjorn Granlund  <tege@gmplib.org>
2780
2781         * mpn/x86_64/redc_1.asm: Rewrite.
2782
2783 2008-11-27  Torbjorn Granlund  <tege@gmplib.org>
2784
2785         * tests/refmpn.c (refmpn_redc_1): New function.
2786
2787 2008-11-25  Torbjorn Granlund  <tege@gmplib.org>
2788
2789         * mpn/x86/k7/aorsmul_1.asm: Actually handle mpn_submul_1.
2790
2791 2008-11-23  Torbjorn Granlund  <tege@gmplib.org>
2792
2793         * mpn/x86_64/divrem_1.asm: Rewrite.
2794
2795         * alpha/divrem_2.asm: New file.
2796         * powerpc32/divrem_2.asm: New file.
2797         * powerpc64/mode64/divrem_2.asm: New file.
2798         * x86/divrem_2.asm: New file.
2799         * x86_64/divrem_2.asm: New file.
2800         * tests/refmpn.c (refmpn_divrem_2): New function.
2801
2802 2008-11-22  Torbjorn Granlund  <tege@gmplib.org>
2803
2804         * mpn/x86/k7/mul_1.asm: Rewrite for smaller size and better speed.
2805         * mpn/x86/k7/aorsmul_1.asm: Likewise.
2806
2807         * acinclude.m4 (GMP_VERSION): Include last component even when zero.
2808
2809 2008-11-21  Torbjorn Granlund  <tege@gmplib.org>
2810
2811         * mpn/x86_64/README: Rewrite.
2812
2813         * tests/devel/try.c (malloc_region, mprotect_maybe): Add casts for
2814         printf type correctness.
2815
2816         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump.
2817
2818         * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
2819         Bump version info.
2820
2821 2008-11-20  Torbjorn Granlund  <tege@gmplib.org>
2822
2823         * gmp-impl.h: Rename modlimb_invert to binvert_limb.
2824         * tune/speed.h: Likewise.
2825         * tune/modlinv.c: Likewise.
2826         * tune/common.c: Likewise.
2827         * tests/t-modlinv.c: Likewise.
2828         * tests/t-constants.c: Likewise.
2829         * mpn/sparc64/mode1o.c: Likewise.
2830         * mpn/alpha/dive_1.c: Likewise.
2831         * mpn/sparc64/dive_1.c: Likewise.
2832         * mpn/generic/mode1o.c: Likewise.
2833         * mpn/generic/dive_1.c: Likewise.
2834         * mpn/generic/bdivmod.c: Likewise.
2835         * mpn/alpha/mode1o.asm: Likewise.
2836         * mpn/asm-defs.m4: Likewise.
2837         * mpn/ia64/mode1o.asm: Likewise.
2838         * mpn/powerpc32/README: Likewise.
2839         * mpn/powerpc32/mode1o.asm: Likewise.
2840         * mpn/powerpc64/mode64/dive_1.asm: Likewise.
2841         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
2842         * mpn/x86/dive_1.asm: Likewise.
2843         * mpn/x86/k6/mmx/dive_1.asm: Likewise.
2844         * mpn/x86/k6/mode1o.asm: Likewise.
2845         * mpn/x86/k7/dive_1.asm: Likewise.
2846         * mpn/x86/k7/mode1o.asm: Likewise.
2847         * mpn/x86/p6/dive_1.asm: Likewise.
2848         * mpn/x86/p6/mode1o.asm: Likewise.
2849         * mpn/x86/pentium/dive_1.asm: Likewise.
2850         * mpn/x86/pentium/mode1o.asm: Likewise.
2851         * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
2852         * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
2853         * mpn/x86_64/dive_1.asm: Likewise.
2854         * mpn/x86_64/mode1o.asm: Likewise.
2855
2856         * mpn/x86_64/aors_n.asm: Replace with slightly faster, more alignment
2857         neutral loop.
2858
2859 2008-11-18  Torbjorn Granlund  <tege@gmplib.org>
2860
2861         * configure.in: Remove gcd_finda related declarations.
2862         * gmp-impl.h (mpn_gcd_finda): Remove declaration.
2863         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Remove gcd_finda.
2864         * mpn/asm-defs.m4: Remove define_mpn(gcd_finda).
2865         * mpn/x86/k6/gcd_finda.asm: Remove file.
2866         * tests/devel/try.c (param_init): Remove mpn_gcd_finda.
2867         (choice_array): Remove mpn_gcd_finda.
2868         * tests/mpn/t-instrument.c (check): Remove testing of mpn_gcd_finda.
2869         * tests/refmpn.c (refmpn_gcd_finda): Remove.
2870         * tests/tests.h (refmpn_gcd_finda): Remove declaration.
2871         * tune/common.c (speed_mpn_gcd_finda): Remove.
2872         * tune/gcd_finda_gen.c: Remove file.
2873         * tune/speed.h (speed_mpn_gcd_finda): Remove declaration.
2874         * tune/speed.c (routine): Remove mpn_gcd_finda entry.
2875
2876         * tests/mpz/t-powm.c: Print test number when failing a test.
2877
2878         * mpn/x86_64/redc_1.asm (CALL): Move from here...
2879         * mpn/x86_64/x86_64-defs.m4: ...to here.
2880
2881         * gmp-impl.h (mpn_jacobi_base): Remove parameter names.
2882
2883 2008-11-11  Torbjorn Granlund  <tege@gmplib.org>
2884
2885         * tests/mpf/t-conv.c: Add some specific tests, supplementing the random
2886         tests.
2887
2888 2008-11-09  Torbjorn Granlund  <tege@gmplib.org>
2889
2890         * mpf/set_str.c: Default 'base' before letting exp_base inherit it.
2891
2892         * tests/cxx/t-prec.cc: Use the right precision for all float constants.
2893
2894 2008-11-08  Torbjorn Granlund  <tege@gmplib.org>
2895
2896         * doc/gmp.texi (Float Comparison): Update mpf_eq documentation.
2897
2898         * mpf/eq.c: Compare the right number of bits.
2899
2900 2008-11-02  Torbjorn Granlund  <tege@gmplib.org>
2901
2902         Undo, it made testing too slow:
2903         * tests/mpz/t-mul.c: Use slower geometric progression for operand
2904         sizes.
2905
2906         * mpn/x86/k7/mod_34lsub1.asm: Use movzb for masking low 8 bits.
2907
2908 2008-10-31  Niels Möller  <nisse@lysator.liu.se>
2909
2910         * mpn/generic/hgcd2.c (div1): New function (taken from old gcdext
2911         implementation)
2912         (mpn_hgcd2): Use single precision for the second half of the work.
2913
2914 2008-10-30  Torbjorn Granlund  <tege@gmplib.org>
2915
2916         * mpn/x86/p6/sse2/gmp-mparam.h: New file.
2917
2918 2008-10-29  Torbjorn Granlund  <tege@gmplib.org>
2919
2920         * configure.in (x86 fat_path): Add "x86/p6/sse2".
2921
2922         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Recognize sse2 capable p6
2923         (pentiumm, core2).
2924
2925         * mpn/x86/p6/sse2/mul_1.asm: New file.
2926         * mpn/x86/p6/sse2/addmul_1.asm: New file.
2927         * mpn/x86/p6/sse2/submul_1.asm: New file.
2928         * mpn/x86/p6/sse2/mul_basecase.asm: New file.
2929         * mpn/x86/p6/sse2/sqr_basecase.asm: New file.
2930         * mpn/x86/p6/sse2/popcount.asm: New file.
2931
2932         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Handle "extended" fields for
2933         model and family.
2934
2935 2008-10-28  Torbjorn Granlund  <tege@gmplib.org>
2936
2937         From Mickael Gastineau:
2938         * gmp-h.in (gmp_urandomm_ui, gmp_urandomb_ui): Add __GMP_DECLSPEC.
2939
2940 2008-10-27  Torbjorn Granlund  <tege@gmplib.org>
2941
2942         * gmp-h.in (mpn_gcdext_1): Remove bogus __GMP_ATTRIBUTE_PURE.
2943
2944 2008-10-27  Niels Möller  <nisse@lysator.liu.se>
2945
2946         * tune/common.c (speed_mpn_hgcd): Call mpn_hgcd_matrix_init once
2947         for each call to mpn_hgcd.
2948         (speed_mpn_hgcd_lehmer): Likewise.
2949
2950 2008-10-26  Torbjorn Granlund  <tege@gmplib.org>
2951
2952         * configure.in: Point to p6/sse2 for pentiumm and core2.
2953
2954         * gmp-impl.h (mpn_add_nc, mpn_sub_nc): Move these macros to after fat
2955         definitions.
2956
2957         * tune/common.c, tune/speed.c, tune/speed.h:
2958         Add speed measurement of mpn_bdiv_dbm1c.
2959
2960 2008-10-24  Torbjorn Granlund  <tege@gmplib.org>
2961
2962         * mpn/x86_64/gmp-mparam.h (MUL_FFT_TABLE2, SQR_FFT_TABLE2): Extend.
2963
2964         * mpz/nextprime.c: Move declarations to function beginning.
2965
2966 2008-10-23  Niels Möller  <nisse@lysator.liu.se>
2967
2968         * gmp-impl.h (DECL_gcdext_1): Deleted.
2969
2970 2008-10-22  Torbjorn Granlund  <tege@gmplib.org>
2971
2972         * mpn/x86_64/atom/aors_n.asm: New file.
2973         * mpn/x86_64/atom/gmp-mparam.h: New file.
2974
2975 2008-10-21  Torbjorn Granlund  <tege@gmplib.org>
2976
2977         With Neils Möller:
2978         * mpz/nextprime.c: Rewrite.
2979
2980         * tests/devel/try.c (main): Use strtol for 's' and 'S' optargs.
2981
2982         * mpn/x86_64/pentium4/rshift.asm: Misc cleanups.
2983         * mpn/x86_64/pentium4/lshift.asm: Likewise.
2984
2985         * mpn/x86_64/pentium4/aors_n.asm: Use fewer registers.
2986
2987         * configure.in: Set up specific path for x86_64/atom.
2988
2989 2008-10-21  Niels Möller  <nisse@lysator.liu.se>
2990
2991         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Removed
2992         qstack.c.
2993         * mpn/generic/qstack.c: Deleted obsolete file.
2994
2995 2008-10-20  Torbjorn Granlund  <tege@gmplib.org>
2996
2997         * mpn/x86_64/core2/aorsmul_1.asm: New file.
2998
2999 2008-10-19  Torbjorn Granlund  <tege@gmplib.org>
3000
3001         * mpn/x86_64/aors_n.asm: Remove redundant MULFUNC_PROLOGUE.
3002
3003         * gmp-impl.h (popc_limb): Remove redundant checks of GMP_LIMB_BITS
3004         inside several of these macros.
3005
3006 2008-10-17  Torbjorn Granlund  <tege@gmplib.org>
3007
3008         * tests/mpz/t-mul.c: Use slower geometric progression for operand
3009         sizes.  Do every other tests for same size operands.
3010
3011 2008-10-15  Torbjorn Granlund  <tege@gmplib.org>
3012
3013         * mpn/x86_64/mul_basecase.asm: Simplify addressing in epilogue.
3014
3015         * mpn/mips64/divrem_1.asm: Remove file, it is n32-only, and uses an old
3016         algorithm.
3017
3018         * config.guess, config.sub, configure.in: Support Intel Atom processor.
3019
3020 2008-10-10  Torbjorn Granlund  <tege@gmplib.org>
3021
3022         * mpq/mul.c: Fix typo in last change.
3023
3024 2008-10-09  Torbjorn Granlund  <tege@gmplib.org>
3025
3026         * tests/refmpn.c (refmpn_sb_divrem_mn): Work around a gcc bug.
3027
3028 2008-10-08  Torbjorn Granlund  <tege@gmplib.org>
3029
3030         * mpq/mul.c: Use TMP_ALLOC.  Cleanup.
3031         * mpq/div.c: Likewise.
3032
3033         * mpn/x86_64/mul_basecase.asm: Use lea directly for loading entry point
3034         addresses.
3035
3036 2008-10-09  Niels Möller  <nisse@lysator.liu.se>
3037
3038         * mpn/x86/k7/gmp-mparam.h: Updated GCD-related values.
3039
3040 2008-10-05  Torbjorn Granlund  <tege@gmplib.org>
3041
3042         * mpn/generic/mul_fft.c (mpn_mul_fft_internal): Do store
3043         mpn_fft_norm_modF return value, if (rec).
3044
3045 2008-10-04  Torbjorn Granlund  <tege@gmplib.org>
3046
3047         * mpn/x86_64/aorsmul_1.asm: Replace with faster code.
3048         * mpn/x86_64/mul_1.asm: Likewise.
3049         * mpn/x86_64/addmul_2.asm: Likewise.
3050         * mpn/x86_64/mul_2.asm: Likewise.
3051         * mpn/x86_64/mul_basecase.asm: Likewise.
3052
3053 2008-10-02  Torbjorn Granlund  <tege@gmplib.org>
3054
3055         * mpn/minithres/gmp-mparam.h: Update FFT values.
3056
3057 2008-10-02  Niels Möller  <nisse@lysator.liu.se>
3058
3059         * hgcd.c (mpn_hgcd_matrix_mul): Fixed normalization bug.
3060
3061 2008-09-24  Torbjorn Granlund  <tege@gmplib.org>
3062
3063         * configure.in: Handle --enable-minithres.
3064         * mpn/minithres/gmp-mparam.h: Update all values.
3065
3066 2008-09-22  Torbjorn Granlund  <tege@gmplib.org>
3067
3068         * tune/speed.c (routine): New entry for mpn_mul.
3069         * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Renamed from
3070         SPEED_ROUTINE_MPN_MUL_BASECASE.
3071         (speed_mpn_mul): Renamed from speed_mpn_mul_basecase.
3072         (SPEED_ROUTINE_MPN_MUL): Allocate our own memory of xp operand.
3073
3074         * tune/common.c: Corresponding changes.
3075
3076 2008-09-22  Niels Möller  <nisse@lysator.liu.se>
3077
3078         * mpn/generic/gcdext.c (hgcd_mul_matrix_vector): New function,
3079         replaces addmul2_n. Needs less copying.
3080         (mpn_gcdext): Use hgcd_mul_matrix_vector. Updated for interface
3081         change in mpn_gcdext_subdiv_step
3082
3083         * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Rewritten to use
3084         mpn_hgcd_mul_matrix1_vector.
3085         (hgcd_step): Updated for interface change in
3086         mpn_hgcd_mul_matrix1_inverse_vector.
3087
3088         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_n): Updated for
3089         interface changes in mpn_hgcd_mul_matrix1_vector,
3090         mpn_hgcd_mul_matrix1_inverse_vector and mpn_gcdext_subdiv_step.
3091
3092         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Updated for
3093         interface change in mpn_hgcd_mul_matrix1_inverse_vector.
3094
3095         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): Use
3096         separate scratch arguments for the quotient and for the cofactor
3097         update.
3098
3099         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Interface
3100         change. Store first element in rp and leave ap unmodified. No
3101         additional scratch space or copying needed. Callers that require
3102         modification in place still need to copy one of the inputs.
3103         (mpn_hgcd_mul_matrix1_inverse_vector): Likewise.
3104
3105 2008-09-22  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
3106
3107         * mpn/generic/hgcd.c (hgcd_matrix_mul_1): Use mpn_addaddmul_1msb0.
3108         * mpn/generic/hgcd2.c (mpn_hgcd_mul_matrix1_vector): Likewise.
3109
3110         * mpn/generic/gcd.c: Use libspeed for timing measurements.
3111
3112         * gmp-impl.h: Declare mpn_addaddmul_1msb0.
3113         * mpn/asm-defs.m4: Added addaddmul_1msb0.
3114         * mpn/x86_64/addaddmul_1msb0.asm: New file.
3115         * configure.in (gmp_mpn_functions_optional): Added
3116         addaddmul_1msb0.
3117         (HAVE_NATIVE): List addaddmul_1msb0.
3118
3119 2008-09-21  Torbjorn Granlund  <tege@gmplib.org>
3120
3121         * mpn/generic/get_str.c (GET_STR_DC_THRESHOLD): Remove default.
3122         (GET_STR_PRECOMPUTE_THRESHOLD): Likewise.
3123         Misc code cleanups.
3124
3125         * gmp-impl.h (mpn_dc_set_str_itch): Allocate GMP_LIMB_BITS more limbs.
3126
3127         Revert:
3128         * mpn/generic/set_str.c:
3129         (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
3130
3131 2008-09-18  Torbjorn Granlund  <tege@gmplib.org>
3132
3133         * mpn/alpha/ev6/gmp-mparam.h (DIVEXACT_BY3_METHOD): Define.
3134
3135         * mpn/ia64/diveby3.asm: Remove.
3136         * mpn/x86/diveby3.asm: Remove.
3137         * mpn/x86/k6/diveby3.asm: Remove.
3138         * mpn/x86/k7/diveby3.asm: Remove.
3139         * mpn/x86/p6/diveby3.asm: Remove.
3140         * mpn/x86/pentium/diveby3.asm: Remove.
3141         * mpn/x86_64/diveby3.asm: Remove.
3142         * mpn/x86/pentium4/sse2/diveby3.asm: Remove.
3143
3144         * configure.in (HAVE_NATIVE): List divexact_by3c.
3145
3146         * gmp-impl.h (mpn_divexact_by3c): Override gmp-h.in's definition.
3147         (DIVEXACT_BY3_METHOD): Don't default to 0 if
3148         HAVE_NATIVE_mpn_divexact_by3c.
3149
3150 2008-09-18  Niels Möller  <nisse@lysator.liu.se>
3151
3152         * mpn/generic/gcd.c (main): Added code for tuning of CHOOSE_P.
3153
3154         * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Assert that inputs are
3155         normalized.
3156
3157 2008-09-17  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
3158
3159         * mpn/generic/gcdext.c (mpn_gcdext): p = n/5 caused a
3160         slowdown for large inputs. As a compromise, use p = n/2 for the
3161         first iteration, and p = n/3 for the rest. Handle the first
3162         iteration specially, since the initial u0 and u1 are trivial.
3163
3164         * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
3165         from 409 to 390.
3166
3167         * mpn/generic/gcdext.c (CHOOSE_P): New macro. Use p = n/5.
3168         (mpn_gcdext): Use CHOOSE_P, and generalized the calculation of
3169         scratch space.
3170
3171         * tune/tuneup.c (tune_hgcd): Use default step factor.
3172
3173         * mpn/x86_64/gmp-mparam.h: (GCD_DC_THRESHOLD): Reduced from 493 to
3174         412.
3175
3176         * mpn/generic/gcd.c (CHOOSE_P): New macro, to determine the
3177         split when calling hgcd. Use p = 2n/3, as that seems better than
3178         the more obvious split p = n/2.
3179         (mpn_gcd): Use CHOOSE_P, and generalized the calculation of
3180         scratch space.
3181
3182 2008-09-16  Torbjorn Granlund  <tege@gmplib.org>
3183
3184         * mpn/generic/toom_interpolate_7pts.c: Use new mpn_divexact_byN
3185         functions.
3186
3187         * gmp-impl.h (mpn_divexact_by3, mpn_divexact_by5, mpn_divexact_by7,
3188         mpn_divexact_by9, mpn_divexact_by11, mpn_divexact_by13,
3189         mpn_divexact_by15): New macros, defined in terms of mpn_bdiv_dbm1.
3190
3191         * configure.in (gmp_mpn_functions): List bdiv_dbm1c.
3192         (HAVE_NATIVE): Likewise.
3193         * mpn/asm-defs.m4: Define bdiv_dbm1c.
3194         * gmp-impl.h (mpn_bdiv_dbm1c): Declare.
3195         (mpn_bdiv_dbm1): New macro.
3196         * mpn/generic/bdiv_dbm1c.c: New file.
3197         * mpn/alpha/bdiv_dbm1c.asm: New file.
3198         * mpn/ia64/bdiv_dbm1c.asm: New file.
3199         * mpn/powerpc32/bdiv_dbm1c.asm: New file.
3200         * mpn/powerpc64/mode64/bdiv_dbm1c.asm: New file.
3201         * mpn/x86/bdiv_dbm1c.asm: New file.
3202         * mpn/x86_64/bdiv_dbm1c.asm: New file.
3203
3204         * mpn/generic/diveby3.c: Add mpn_bdiv_dbm1c based function.
3205         Choose function depending on DIVEXACT_BY3_METHOD.
3206         * gmp-impl.h (DIVEXACT_BY3_METHOD): Provide default.
3207
3208 2008-09-16  Niels Möller  <nisse@lysator.liu.se>
3209
3210         * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Moved function to
3211         gcdext.c, where it is used.
3212         * mpn/generic/gcdext.c (addmul2_n): Moved and renamed, was
3213         mpn_hgcd_addmul2_n. Made static. Deleted input normalization.
3214         Deleted rn argument.
3215         (mpn_gcdext): Updated calls to addmul2_n, and added assertions.
3216
3217         * gmp-impl.h (MPN_HGCD_MATRIX_INIT_ITCH): Increased storage by four limbs.
3218         (MPN_HGCD_LEHMER_ITCH): Reduced storage by one limb.
3219         (MPN_GCD_SUBDIV_STEP_ITCH): Likewise.
3220         (MPN_GCD_LEHMER_N_ITCH): Likewise.
3221
3222         * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Use two extra limbs.
3223         (hgcd_step): Use overlapping arguments to mpn_tdiv_qr.
3224         (mpn_hgcd_matrix_mul): Deleted normalization code. Tigher bounds
3225         for the element size of the product. Needs two extra limbs of
3226         storage for the elements.
3227         (mpn_hgcd_itch): Updated storage calculation.
3228
3229         * mpn/generic/gcd_subdiv_step.c (mpn_gcd_subdiv_step): Use
3230         overlapping arguments to mpn_tdiv_qr. Use mpn_zero_p.
3231
3232         * mpn/generic/gcd.c (mpn_gcd): Use mpn_zero_p.
3233
3234 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
3235
3236         * mpn/generic/hgcd.c (mpn_hgcd_matrix_init): Updated for deleted
3237         tp pointer.
3238         (hgcd_matrix_update_q): Likewise.
3239         (mpn_hgcd_matrix_mul): Likewise.
3240         (mpn_hgcd_itch): Updated calculation of scratch space.
3241
3242         * gmp-impl.h (struct hgcd_matrix): Deleted tp pointer.
3243         (MPN_HGCD_MATRIX_INIT_ITCH): Reduced storage.
3244         (mpn_hgcd_step, MPN_HGCD_STEP_ITCH): Deleted declarations.
3245
3246 2008-09-15  Niels Möller <nisse@lysator.liu.se>  <nisse@king.swox.se>
3247
3248         * mpn/x86_64/gmp-mparam.h (MATRIX22_STRASSEN_THRESHOLD): New
3249         threshold.
3250
3251         * mpn/generic/hgcd.c (mpn_hgcd_matrix_mul): Use mpn_matrix22_mul.
3252         (mpn_hgcd_itch): Updated calculation of scratch space. Use
3253         count_leading_zeros to get the recursion depth.
3254
3255         * mpn/generic/gcd.c (mpn_gcd): Fixed calculation of scratch space,
3256         and use mpn_hgcd_itch.
3257
3258 2008-09-15  Niels Möller  <nisse@lysator.liu.se>
3259
3260         * tune/tuneup.c (tune_matrix22_mul): New function.
3261         (all): Use it.
3262
3263         * tune/common.c (speed_mpn_matrix22_mul): New function.
3264
3265         * tune/Makefile.am (TUNE_MPN_SRCS_BASIC): Added matrix22_mul.c.
3266
3267         * tests/mpn/t-matrix22.c: Use MATRIX22_STRASSEN_THRESHOLD to
3268         select sizes for tests.
3269
3270         * gmp-impl.h (MATRIX22_STRASSEN_THRESHOLD): New threshold
3271
3272         * configure.in (gmp_mpn_functions): Added matrix22_mul.
3273         * gmp-impl.h: Added declarations for mpn_matrix22_mul and related
3274         functions.
3275
3276         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added
3277         matrix22_mul.c.
3278         * tests/mpn/Makefile.am (check_PROGRAMS): Added t-matrix22.
3279
3280         * tests/mpn/t-matrix22.c: New file.
3281         * mpn/generic/matrix22_mul.c: New file.
3282
3283 2008-09-11  Niels Möller  <nisse@king.swox.se>
3284
3285         * tune/tuneup.c: Updated tuning of gcdext.
3286
3287         * mpn/x86_64/gmp-mparam.h (GCDEXT_DC_THRESHOLD): Reduced threshold
3288         from 713 to 409.
3289
3290 2008-09-11  Niels Möller  <nisse@lysator.liu.se>
3291
3292         * gmp-impl.h: Updated for gcdext changes.
3293         (GCDEXT_DC_THRESHOLD): New constant, renamed from
3294         GCDEXT_SCHOENHAGE_THRESHOLD.
3295
3296         * mpn/generic/gcdext.c (compute_v): Accept non-normalized a and b
3297         as inputs.
3298         (mpn_gcdext): Rewrote and simplified. Now uses the new mpn_hgcd
3299         interface.
3300
3301         * mpn/generic/hgcd.c (mpn_hgcd_addmul2_n): Renamed from addmul2_n
3302         and made non-static. Changed interface to take non-normalized
3303         inputs, and only two size arguments.
3304         (mpn_hgcd_matrix_mul): Simplified using new mpn_hgcd_addmul2_n.
3305
3306         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): Deleted
3307         function.
3308         (mpn_gcdext_lehmer_n): Renamed from mpn_gcd_lehmer. Now takes
3309         inputs of equal size. Moved the code for the division step to a
3310         separate function...
3311         * mpn/generic/gcdext_subdiv_step.c (mpn_gcdext_subdiv_step): New
3312         file, new function.
3313
3314         * configure.in (gmp_mpn_functions): Added gcdext_subdiv_step.
3315
3316 2008-09-10  Torbjorn Granlund  <tege@gmplib.org>
3317
3318         * tests/devel/anymul_1.c: Include <string.h>.
3319
3320         * gmp-h.in: Unconditionally include <cstdio>.
3321
3322 2008-09-10  Niels Möller  <nisse@lysator.liu.se>
3323
3324         * tune/common.c: #if:ed out speed_mpn_gcd_binary and
3325         speed_mpn_gcd_accel.
3326         * tune/speed.c (routine): #if:ed out mpn_gcd_binary, mpn_gcd_accel
3327         and find_a.
3328         * tune/Makefile.am (libspeed_la_SOURCES): Removed gcd_bin.c
3329         gcd_accel.c gcd_finda_gen.c.
3330         * tune/tuneup.c: Enable tuning of GCD_DC_THRESHOLD.
3331
3332         * mpn/generic/gcd.c (mpn_gcd): Rewrote and simplified. Now uses
3333         the new mpn_hgcd interface.
3334
3335         * */gmp-mparam.h: Renamed GCD_SCHOENHAGE_THRESHOLD to
3336         GCD_DC_THRESHOLD.
3337
3338         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer_n): Renamed (was
3339         mpn_gcd_lehmer). Now takes inputs of equal size.
3340
3341         * mpn/generic/gcd_lehmer.c (mpn_gcd_lehmer): Reintroduced gcd_2,
3342         to get better performance for small inputs.
3343
3344         * mpn/generic/hgcd.c: Don't hardcode small HGCD_THRESHOLD.
3345         * mpn/x86_64/gmp-mparam.h (HGCD_THRESHOLD): Reduced from 145 to
3346         120.
3347         * */gmp-mparam.h: Renamed HGCD_SCHOENHAGE_THRESHOLD to
3348         HGCD_THRESHOLD.
3349
3350 2008-09-09  Torbjorn Granlund  <tege@gmplib.org>
3351
3352         * doc/gmp.texi: Fix a typo and clarify mpn_gcdext docs.
3353
3354 2008-09-09  Niels Möller  <nisse@lysator.liu.se>
3355
3356         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Adapted
3357         to new hgcd interface.
3358
3359         * gmp-impl.h (MPN_HGCD_LEHMER_ITCH): New macro.
3360
3361         * hgcd.c (mpn_hgcd_lehmer): Renamed function, from hgcd_base. Made
3362         non-static.
3363
3364         * gcd_lehmer.c (mpn_gcd_lehmer): Use hgcd2 also for n == 2.
3365
3366         * gcdext_lehmer.c (mpn_gcdext_lehmer): Simplified code for
3367         division step. Added proper book-keeping of swaps, which affect
3368         the sign of the returned cofactor.
3369
3370         * tests/mpz/t-gcd.c (one_test): Display co-factor when mpn_gcdext
3371         fails.
3372
3373         * gcd_lehmer.c (mpn_gcd_lehmer): At end of loop, need to handle
3374         the special case n == 1 correctly.
3375
3376         * gcd_subdiv_step.c (mpn_gcd_subdiv_step): Simplified function.
3377         The special cancellation logic is not needed here.
3378
3379 2008-09-08  Torbjorn Granlund  <tege@gmplib.org>
3380
3381         * mpn/generic/invert.c: Add working but slow code.
3382
3383         * mpn/x86_64/x86_64-defs.m4 (R32, R8): New macros.
3384
3385         * mpn/ia64/submul_1.asm: Move some labels for broader assembler
3386         compatibility.
3387
3388         * gmp-impl.h (mpn_mul_3, mpn_mul_4): Declare.
3389         * tests/tests.h (refmpn_mul_3, refmpn_mul_4): Declare.
3390         * tests/try.c (param_init): Set things up for mpn_mul_3 and mpn_mul_4.
3391         (choice_array): Likewise.
3392         (call): Likewise.
3393         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES):
3394         Add mul_3.c and mul_4.
3395         * mpn/asm-defs.m4: Define mul_3 and mul_4.
3396         * tests/refmpn.c (refmpn_mul_N): New function.
3397         (refmpn_mul_2): Remove old definition, call refmpn_mul_N.
3398         (refmpn_mul_3, refmpn_mul_4): New functions.
3399         * tune/common.c (speed_mpn_mul_3, speed_mpn_mul_4): New functions.
3400         * tune/speed.h (speed_mpn_mul_3, speed_mpn_mul_4): Declare.
3401         * tune/speed.c (routine): New entries for mpn_mul_2 and mpn_mul_3.
3402
3403         * ltmain.sh: Update to libtool 1.5.24.
3404
3405         * mpn/generic/mul_toom22.c: Compute s and t more cleverly.
3406
3407 2008-09-08  Niels Möller  <nisse@lysator.liu.se>
3408
3409         * tests/mpn/t-hgcd.c: Updated tests. Rewrite of hgcd_ref.
3410
3411         * mpn/generic/gcdext_lehmer.c (mpn_gcdext_lehmer_itch): New function.
3412         (mpn_gcdext_lehmer): Various bugfixes.
3413
3414         * gcdext.c (mpn_gcdext): Allocate scratch space for gcdext_lehmer.
3415
3416         * mpn/generic/gcd_lehmer.c (gcd_2): ASSERT that inputs are odd.
3417         (mpn_gcd_lehmer): Added tp argument, for scratch space. Make both
3418         arguments odd before calling gcd_2.
3419
3420         * mpn/generic/hgcd.c (mpn_hgcd): Allow the trivial case n <= 2,
3421         and return 0 immediately.
3422
3423         * gmp-impl.h (MPN_EXTRACT_NUMB): New macro.
3424
3425         * configure.in (gmp_mpn_functions): Added gcdext_lehmer.
3426
3427 2008-09-05  Torbjorn Granlund  <tege@gmplib.org>
3428
3429         * mpn/generic/toom_interpolate_7pts.c: Use mpn_divexact_by3c instead of
3430         divexact_odd.
3431
3432         * doc/texinfo.tex: Update to 2007-06-29.13.
3433
3434         * doc/gmp.texi: Update GMP site URL.  Fix some typos.
3435
3436         * demos/pexpr.c (main): Allow bases up to 62.
3437
3438         * gmp-impl.h: Remove formal parameter names from function prototypes.
3439
3440         * config.guess: Recognize recent AMD and Itanium CPUs.
3441         Default X86 CPU recognition to configfsf.guess' value.
3442
3443         * configure.in: Handle core2 separately from athlon64.
3444
3445 2008-09-05  Niels Möller  <nisse@lysator.liu.se>
3446
3447         * */Makefile.in, configure, aclocal.m4, config.in: Removed files
3448         from repository. They're instead generated by automake and
3449         autoconf before distribution.
3450
3451 2008-08-25  Torbjorn Granlund  <tege@gmplib.org>
3452
3453         * mpf/set_str.c: Allocate mantissa space based on mantissa size,
3454         not on destination variable space.
3455         * mpf/set_str.c: Accept unary plus before exponent.
3456
3457 2008-08-06  Torbjorn Granlund  <tege@gmplib.org>
3458
3459         * mpn/generic/mul_toom22.c: Add statistics gathering functionality,
3460         triggered by cpp predef STAT.
3461
3462         From David Harvey:
3463         * mpn/generic/mul_toom22.c: Decrease scratch space usage.
3464
3465 2008-08-02  Torbjorn Granlund  <tege@gmplib.org>
3466
3467         * tests/misc/t-scanf.c: Avoid negative arguments to _ui functions.
3468         * tests/misc/t-printf.c: Likewise.
3469
3470         * acinclude.m4 (X86_PATTERN): Add geode.
3471
3472         * acinclude.m4 (CL_AS_NOEXECSTACK): Avoid -q flag to grep.
3473
3474 2008-08-01  Torbjorn Granlund  <tege@gmplib.org>
3475
3476         * acinclude.m4 (CL_AS_NOEXECSTACK): New.
3477         * configure.in: Use CL_AS_NOEXECSTACK.
3478         * mpn/Makeasm.am: Use ASM_FLAGS (defined by CL_AS_NOEXECSTACK).
3479
3480         * gmpxx.h (__GMP_DBL_LIMBS): Use DBL_MAX_EXP instead of
3481         std::numeric_limits<double>::max_exponent for better portability.
3482
3483 2008-07-29  Torbjorn Granlund  <tege@gmplib.org>
3484
3485         * gmpxx.h (__GMP_DBL_LIMBS): New #define.
3486         (__GMP_ULI_LIMBS): New #define.
3487         (__GMPXX_TMP_UI): New macro.
3488         (__GMPXX_TMP_SI): New macro.
3489         (__GMPXX_TMP_D): New macro.
3490         (struct __gmp_binary_and): Rewrite, using the new macros.
3491         (struct __gmp_binary_ior): Likewise.
3492         (struct __gmp_binary_xor): Likewise.
3493
3494 2008-07-28  Torbjorn Granlund  <tege@gmplib.org>
3495
3496         * tests/cxx/t-binary.cc: Add some tests for logical operations.
3497
3498 2008-07-24  Torbjorn Granlund  <tege@gmplib.org>
3499
3500         * gmpxx.h: Use __GMPZ_* instead of __GMPZZ_* for bitwise ops, remove
3501         __GMPZZ_*.
3502         Remove repeated #undefs.
3503         (__gmp_alloc_cstring): Declare freefunc as extern "C".
3504
3505 2008-07-23  Torbjorn Granlund  <tege@gmplib.org>
3506
3507         * gmp-h.in (__GMP_CC): New define, undocumented for now.
3508         (__GMP_CFLAGS): Likewise.
3509
3510 2008-07-21  Torbjorn Granlund  <tege@gmplib.org>
3511
3512         * tests/amd64check.c: Fix a printf type clash.
3513
3514         * mpz/realloc.c: Amend last fix.
3515
3516         * gmp-h.in: Include <cstdlib> for C++.
3517         * gmp-h.in: Handle new gcc 4.3 inline semantics defaults.
3518
3519         * configfsf.guess: Update to version of 2008-04-14.
3520         * configfsf.sub: Update to version of 2008-06-16.
3521
3522         * configure.in: Separate core2 and athlon64 flags handling.
3523
3524 2008-06-19  Torbjorn Granlund  <tege@gmplib.org>
3525
3526         * config.guess: Recognize pentiumm and AMD geode.
3527         * config.sub: Likewise.
3528         * configure.in: Likewise.
3529
3530 2008-06-02  Torbjorn Granlund  <tege@gmplib.org>
3531
3532         * configure.in: Disallow odd nails sizes.
3533         * configure.in: Inherit default gcc_cflags/gcc_64_cflags everywhere.
3534
3535 2008-05-23  Torbjorn Granlund  <tege@gmplib.org>
3536
3537         * mpz/init2.c: Rewrite to avoid internal overflow and to detect mpz_t
3538         overflow.
3539         * mpz/realloc2.c: Likewise.
3540         * mpz/realloc.c: Detect mpz_t overflow.
3541
3542 2008-05-22  Torbjorn Granlund  <tege@gmplib.org>
3543
3544         * configure.in (sparc): Remove -fast, it causes documented
3545         miscompilation.
3546
3547         * config.guess: Properly handle the "extended" variants of x86 cpuid.
3548
3549 2008-05-09  Torbjorn Granlund  <tege@gmplib.org>
3550
3551         * gmp-impl.h (mpn_mul_fft): Now void.
3552         (udiv_qrnnd_preinv3): Special case for constant (nl).
3553
3554 2008-05-08  Torbjorn Granlund  <tege@gmplib.org>
3555
3556         * mpn/generic/mul_fft.c: Clean up types in TRACE (printf (...)).
3557         (TRACE): Redefine to allow command line control.
3558         (mpn_mul_fft_internal): Now void, remove return value.
3559         (mpn_mul_fft): Likewise.
3560         (MPN_FFT_TABLE2_SIZE): Up size fro 256 to 512.
3561         (mpn_fft_fft): Call mpn_fft_mul_2exp_modF just once instead of twice,
3562         then add/subtract result.  Get rid of temp allocation as a result.
3563         Remove some redundant CNST_LIMB.
3564         (mpn_fft_fftinv): Analogous changes.
3565         (mpn_fft_sub_modF): Re-enable, now needed by mpn_fft_fft and
3566         mpn_fft_fftinv.
3567
3568 2008-03-10  Torbjorn Granlund  <tege@gmplib.org>
3569
3570         * tests/mpz/t-mul.c (main): Let GMP_CHECK_FFT mean largest allowed
3571         power-of-2 of test operands.
3572
3573 2008-02-28  Torbjorn Granlund  <tege@gmplib.org>
3574
3575         * tests/cxx/t-binary.cc (check_mpz): Expect floor rounding for right
3576         shift.
3577
3578 2008-02-27  Torbjorn Granlund  <tege@gmplib.org>
3579
3580         * mpz/mul_i.h: Check sml's size (not the signed small_mult).
3581
3582         * longlong.h (umul_ppmm) [alpha]: Define using __builtin_alpha_umulh
3583         when possible.
3584
3585         * longlong.h (count_trailing_zeros): Force destination register mode.
3586
3587         * gmpxx.h (struct __gmp_binary_rshift): Use floor rounding, not
3588         truncation.
3589
3590         * gmpxx.h (__gmp_binary_and, __gmp_binary_ior, __gmp_binary_xor):
3591         Add variants with unsigned long int argument.
3592
3593         * config.sub: Recog geode.
3594         * config.guess: Likewise.
3595         * acinclude.m4 (X86_PATTERN): Likewise.
3596
3597 2008-02-10  Torbjorn Granlund  <tege@gmplib.org>
3598
3599         * mpn/x86/p6/aors_n.asm: Use Zdisp to work around GNU as bug.
3600         * mpn/x86/x86-defs.m4 (Zdisp): Add more instructions.
3601
3602 2008-02-08  Torbjorn Granlund  <tege@gmplib.org>
3603
3604         * mpn/x86_64/aors_n.asm: New file.
3605         * mpn/x86_64/add_n.asm: Delete.
3606         * mpn/x86_64/sub_n.asm: Delete.
3607
3608 2008-02-07  Torbjorn Granlund  <tege@gmplib.org>
3609
3610         * mpn/x86/k6/mmx/dive_1.asm: Fix typo in last change.
3611
3612 2007-12-10  Torbjorn Granlund  <tege@swox.com>
3613
3614         * mpf/set_str.c (mpf_set_str): Write own code for converting the
3615         exponent, avoids strtol base < 36 limitation.
3616
3617 2007-10-28  Torbjorn Granlund  <tege@swox.com>
3618
3619         * gmp-impl.h (mpn_dc_get_str_itch): New macro.
3620         (mpn_dc_get_str_powtab_alloc): New macro.
3621         (struct powers): Add field "shift".
3622
3623         * mpn/generic/get_str.c: Compute powers without low zero limbs; all
3624         functions modified.  Correct temporary allocation.  Misc cleanups.
3625
3626         * mpn/generic/set_str.c: Compute powers without low zero limbs; all
3627         functions modified.
3628         (mpn_dc_set_str): Remove impossible case, replace by an ASSERT.
3629
3630 2007-10-26  Torbjorn Granlund  <tege@swox.com>
3631
3632         * mpn/generic/set_str.c: Remove default thresholds, not in gmp-impl.h.
3633         (mpn_dc_set_str): Insert ASSERT_ALWAYS in a presumably dead code arm.
3634
3635 2007-10-22  Torbjorn Granlund  <tege@swox.com>
3636
3637         * gmp-impl.h (mpn_add_nc): Define as inline function, unless NATIVE.
3638         (mpn_sub_nc): Likewise.
3639
3640 2007-10-17  Torbjorn Granlund  <tege@swox.com>
3641
3642         * tests/misc/t-printf.c: Fix a printf type clash.
3643         * tests/mpq/t-get_str.c: Likewise.
3644         * tests/mpz/t-import.c: Likewise.
3645
3646         * acinclude.m4: Conditionally disable some tests when compiled by a C++
3647         compiler.
3648
3649         * gmp-impl.h (udiv_qrnnd_preinv3): Remove an unused variable.
3650
3651         * mpn/generic/hgcd.c: Add some WANT_ASSERTs to shut up warnings.
3652
3653 2007-10-08  Torbjorn Granlund  <tege@swox.com>
3654
3655         * mpn/powerpc64/elf.m4 (LEAL): Define as an alias for LEA.
3656         * mpn/powerpc32/darwin.m4 (LEAL): Likewise.
3657         * mpn/powerpc64/aix.m4: Likewise.
3658
3659         * mpn/powerpc64/vmx/popcount.asm: Use LEAL.
3660
3661         * mpn/powerpc64/darwin.m4 (LEAL): New name for LEA, since it is only
3662         usable for local symbols.
3663         (LEA): Replace with code for external references.
3664
3665
3666         * mpn/powerpc32/vmx/mod_34lsub1.asm: Use LEAL.
3667
3668 2007-10-07  Torbjorn Granlund  <tege@swox.com>
3669
3670         * mpn/x86/dive_1.asm: Use LEA, remove explicit movl_eip_*.
3671         * mpn/x86/k6/mode1o.asm: Likewise.
3672         * mpn/x86/k6/mmx/dive_1.asm: Likewise.
3673         * mpn/x86/k7/dive_1.asm: Likewise.
3674         * mpn/x86/k7/mode1o.asm: Likewise.
3675         * mpn/x86/p6/dive_1.asm: Likewise.
3676         * mpn/x86/p6/mode1o.asm: Likewise.
3677         * mpn/x86/pentium4/sse2/dive_1.asm: Likewise.
3678         * mpn/x86/pentium4/sse2/mode1o.asm: Likewise.
3679         * mpn/x86/pentium4/sse2/popcount.asm: Likewise.
3680
3681         * mpn/x86/p6/aors_n.asm: Table cycle counts.
3682
3683         * mpn/x86/k7/mod_34lsub1.asm: Fix over-optimistic cycle count claims.
3684
3685         * mpn/x86/x86-defs.m4 (DEF_OBJECT, END_OBJECT): New define's.
3686
3687         * mpn/x86/darwin.m4 (LEA): Put also movl_eip_XX into EPILOGUE_cpu.
3688         Expect target register to have prepended %.
3689
3690         * mpn/x86_64/add_n.asm: Use L() for labels.
3691         * mpn/x86_64/addlsh1_n.asm: Likewise.
3692         * mpn/x86_64/addmul_2.asm: Likewise.
3693         * mpn/x86_64/aorrlsh_n.asm: Likewise.
3694         * mpn/x86_64/aorsmul_1.asm: Likewise.
3695         * mpn/x86_64/com_n.asm: Likewise.
3696         * mpn/x86_64/copyd.asm: Likewise.
3697         * mpn/x86_64/copyi.asm: Likewise.
3698         * mpn/x86_64/diveby3.asm: Likewise.
3699         * mpn/x86_64/logops_n.asm: Likewise.
3700         * mpn/x86_64/lshsub_n.asm: Likewise.
3701         * mpn/x86_64/mul_1.asm: Likewise.
3702         * mpn/x86_64/mul_2.asm: Likewise.
3703         * mpn/x86_64/mul_basecase.asm: Likewise.
3704         * mpn/x86_64/popham.asm: Likewise.
3705         * mpn/x86_64/redc_1.asm: Likewise.
3706         * mpn/x86_64/rsh1add_n.asm: Likewise.
3707         * mpn/x86_64/rsh1sub_n.asm: Likewise.
3708         * mpn/x86_64/rshift.asm: Likewise.
3709         * mpn/x86_64/sub_n.asm: Likewise.
3710         * mpn/x86_64/sublsh1_n.asm Likewise.
3711         * mpn/x86_64/pentium4/aors_n.asm: Likewise.
3712         * mpn/x86_64/pentium4/lshift.asm: Likewise.
3713         * mpn/x86_64/pentium4/rshift.asm: Likewise.
3714
3715         * mpn/x86_64/x86_64-defs.m4: New file, defining LEA, DEF_OBJECT, and
3716         END_OBJECT.
3717
3718         * mpn/generic/mul.c: Put TMP_DECL as last decl.
3719
3720 2007-10-06  Torbjorn Granlund  <tege@swox.com>
3721
3722         * mpn/x86/pentium4/sse2/popcount.asm: New file.
3723
3724 2007-09-26  Torbjorn Granlund  <tege@swox.com>
3725
3726         * mpz/get_str.c: Cast a char index to int to shut up compilers.
3727
3728         * mpn/generic/dc_div_qr.c: Pass dummy scratch argument to mpn_invert.
3729         * mpn/generic/dc_divappr_q.c: Likewise.
3730         * mpn/generic/mu_div_qr.c: Likewise.
3731         * mpn/generic/mu_divappr_q.c: Likewise.
3732         * mpn/generic/mu_div_q.c: Likewise.
3733         * mpn/generic/divexact.c: Likewise.
3734
3735         * mpn/generic/invert.c: New file, placeholder for now.
3736
3737 2007-09-24  Torbjorn Granlund  <tege@swox.com>
3738
3739         * mpn/generic/toom_interpolate_5pts.c: New file, contents from
3740         mpn/generic/mul_n.c
3741         * mpn/generic/mul_n.c (mpn_toom3_interpolate): Function removed.
3742
3743         * mpn/generic/toom_interpolate_7pts.c: New file.
3744
3745         * mpn/x86/k7/mmx/popham.asm: Table cycle counts.
3746
3747         * mpn/x86/k6/README: Update URLs.
3748
3749         * mpn/powerpc32/README: Update URL's, company names.
3750
3751         * mpn/generic/get_d.c: Complete rewrite.
3752
3753         * mpn/generic/mul_toom33.c: New file.
3754
3755         * mpn/generic/mul_toom22.c: Make orthogonal with other toomXY files.
3756         * mpn/generic/mul_toom32.c: Likewise.
3757         * mpn/generic/mul_toom42.c: Likewise.
3758
3759         * mpn/alpha/invert_limb.asm: Update cycle counts.  Fix a comment typo.
3760
3761         * mpf/get_str.c: Include stdlib.h, not stdio.h for NULL.
3762
3763         * doc/gmp.texi: Fix a typo.
3764
3765         * memory.c (__gmp_default_allocate, __gmp_default_reallocate):
3766         Cast size operands in error fprintf's.
3767
3768         * longlong.h (sub_ddmmss) [powerpc 64]: Add more variants for constant
3769         args.
3770
3771         * gmp-impl.h (udiv_qrnnd_preinv3): New define.
3772         * gmp-impl.h (ULONG_PARITY): Exclude masquerading __INTEL_COMPILER from
3773         ia64 asm.
3774
3775         * gmp-h.in (mpn_neg_n): New function.
3776
3777 2007-09-18  Torbjorn Granlund  <tege@swox.com>
3778
3779         * demos/pexpr.c (main): Add -v option.
3780         (enum op_t): New tag TIMING.
3781         (mpz_eval_expr): Execute TIMING.
3782         (fns): Add TIMING entry.
3783
3784         * gmp-impl.h: Add decls and THRESHOLDs for new toom multiplication
3785         functions and division functions.
3786
3787 2007-09-10  Torbjorn Granlund  <tege@swox.com>
3788
3789         * mpn/powerpc32/addlsh1_n.asm: Use L() for labels.
3790         * mpn/powerpc32/sublsh1_n.asm: Likewise.
3791
3792 2007-09-09  Torbjorn Granlund  <tege@swox.com>
3793
3794         * mpn/x86/x86-defs.m4 (LEA): New define.
3795         * mpn/x86/darwin.m4: New file, for now just defining LEA.
3796         * configure.in: Pick up x86/darwin.m4.
3797         * mpn/x86/*: Use LEA for PIC references.
3798
3799         * configure.in: For X86/32, treat core2 like pentium3.
3800
3801 2007-09-06  Torbjorn Granlund  <tege@swox.com>
3802
3803         * tests/amd64check.c (calling_conventions_values): Put constants,
3804         dynamic values in this array (was in scalars).
3805         (calling_conventions_check): Corresponding changes.
3806         * tests/amd64call.asm: Rewrite to be PIC, smaller, using amd64check.c's
3807         array.
3808
3809 2007-09-04  Torbjorn Granlund  <tege@swox.com>
3810
3811         * mpn/x86/pentium4/sse2/mul_basecase.asm: Misc cleanups.
3812         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Likewise.
3813
3814         * mpn/x86_64/mod_34lsub1.asm: Optimize loop, reduce code size.
3815
3816         * tests/amd64call.asm: Remove bogus no-op moves.
3817
3818 2007-09-03  Torbjorn Granlund  <tege@swox.com>
3819
3820         From Richard Guenther:
3821         * gmp-h.in (__GMP_EXTERN_INLINE): Declare conditionally on
3822         __GNUC_STDC_INLINE__.
3823
3824         * tests/cxx/t-locale.cc: #include <cstdlib>, for abort.
3825
3826         * mpn/x86_64/core2/popcount.asm: New file.
3827         * mpn/x86_64/pentium4/popcount.asm: New file.
3828
3829         * mpn/x86_64/addmul_2.asm: New file.
3830         * mpn/x86_64/mul_2.asm: New file.
3831
3832         * mpn/x86_64/aorsmul_1.asm: Use 32-bit mov for zeroing registers
3833         (saves space).
3834
3835 2007-09-01  Torbjorn Granlund  <tege@swox.com>
3836
3837         * configure.in: Handle athlon64, core2, and pentium4 separately for
3838         64-bit ABI.
3839
3840         * config.sub: Recog athlon64, core2, and opteron.
3841
3842         * config.guess: Do two x86 variants, for 32-bit ABI and 64-bit ABI.
3843         Return "athlon64" and "core2", not x86_64.
3844
3845 2007-08-31  Torbjorn Granlund  <tege@swox.com>
3846
3847         From Patrick Pelissier:
3848         * gmp-h.in: Don't refer to FILE from C++ unless we've seen FILE.
3849
3850 2007-08-30  Torbjorn Granlund  <tege@swox.com>
3851
3852         * demos/isprime.c: Include string.h for strcmp.
3853
3854         * demos/factorize.c (main): Declare to int.
3855
3856 2007-06-22  Torbjorn Granlund  <tege@swox.com>
3857
3858         * mpn/x86_64/pentium4/lshift.asm: Minor tuning.
3859         * mpn/x86_64/pentium4/rshift.asm: Likewise.
3860
3861 2007-05-30  Torbjorn Granlund  <tege@swox.com>
3862
3863         * mpn/powerpc64/mode64/aors_n.asm: Add _nc entry points.
3864
3865 2007-05-22  Torbjorn Granlund  <tege@swox.com>
3866
3867         * tests/memory.c: Cast calls to new mem* calls to avoid unaligned ops.
3868
3869 2007-05-16  Torbjorn Granlund  <tege@swox.com>
3870
3871         * tests/mpz/convert.c: Tweak operand sizes for best coverage.
3872
3873         * tests/memory.c: Add red zones around allocations.
3874
3875 2007-05-15  Torbjorn Granlund  <tege@swox.com>
3876
3877         * mpn/ia64/mul_1.asm: Make mul_1c entry point actually work.
3878
3879         * mpn/generic/set_str.c (mpn_dc_set_str): Avoid calling mpn_add_n when
3880         ln == 0.
3881
3882         * tests/mpz/convert.c (string_urandomb): New function.
3883         (main): Use it by enabling ifdef'ed out code.
3884
3885 2007-04-30  Torbjorn Granlund  <tege@swox.com>
3886
3887         * mpn/x86_64/mul_basecase.asm: Complete rewrite.
3888
3889         * mpn/x86_64/copyi.asm: Use short shift-by-one form.  Misc cleanups.
3890         * mpn/x86_64/copyi.asm: Likewise.
3891         * mpn/x86_64/popham.asm: Likewise.
3892
3893         * mpn/x86_64/aorsmul_1.asm: Cleanup formatting.
3894
3895 2007-04-25  Torbjorn Granlund  <tege@swox.com>
3896
3897         * mpz/divexact.c: Handle undefined case of |N| < |D| to avoid segfaults.
3898
3899 2007-02-24  Torbjorn Granlund  <tege@swox.com>
3900
3901         * doc/gmp.texi (Toom 3-Way Multiplication): Fix typo.
3902         (mpz_scan0, mpz_scan1): Fix typos.
3903         (Float Internals): Rewrite paragraph about struct types.
3904
3905 2007-02-12  Torbjorn Granlund  <tege@swox.com>
3906
3907         * mpn/x86/pentium4/sse2/sqr_basecase.asm: Complete rewrite (except
3908         diagonal code).
3909
3910 2007-02-05  Torbjorn Granlund  <tege@swox.com>
3911
3912         * mpn/generic/mul_fft.c (mpn_fft_fft): New name for mpn_fft_fft_sqr,
3913         old mpn_fft_fft removed.
3914         (mpn_mul_fft_internal): Call mpn_fft_fft separately for each operand.
3915         (mpn_fft_add_modF): Rewrite to avoid random branches.
3916         (mpn_fft_sub_modF): Likewise.
3917
3918         * mpn/x86/pentium4/sse2/addmul_1.asm: Complete rewrite.
3919         * mpn/x86/pentium4/sse2/mul_1.asm: Complete rewrite.
3920         * mpn/x86/pentium4/sse2/mul_basecase.asm: Complete rewrite, based on
3921         new addmul and mul code.
3922
3923 2007-01-31  Torbjorn Granlund  <tege@swox.com>
3924
3925         * mpn/generic/get_str.c (mpn_sb_get_str): Get loop count for frac
3926         development right.
3927
3928         * mpn/powerpc32/vmx/mod_34lsub1.asm: New file.
3929
3930         * mpn/powerpc32/aors_n.asm: New file, complete rewrite.
3931         * mpn/powerpc32/add_n.asm: Remove.
3932         * mpn/powerpc32/sub_n.asm: Remove.
3933
3934 2007-01-25  Torbjorn Granlund  <tege@swox.com>
3935
3936         * mpn/x86_64/core2/aors_n.asm: Add _nc entry points, minor cleanups.
3937
3938         * mpn/x86_64/core2/lshift.asm: Rewrite.
3939         * mpn/x86_64/core2/rshift.asm: Rewrite.
3940
3941         * mpn/x86_64/pentium4/lshift.asm: Swap some loop insns for a small
3942         speedup.
3943         * mpn/x86_64/pentium4/rshift.asm: New file, based on lshift.asm.
3944
3945         * mpn/x86_64/pentium4/gmp-mparam.h: New file.
3946
3947         * mpn/x86_64/pentium4/aors_n.asm: Complete rewrite of add/subtract
3948         code.
3949         * mpn/x86_64/pentium4/add_n.asm: Remove.
3950         * mpn/x86_64/pentium4/sub_n.asm: Remove.
3951
3952 2007-01-20  Torbjorn Granlund  <tege@swox.com>
3953
3954         * mpn/x86_64/lshift.asm: Add special case for cnt=1.
3955
3956 2007-01-19  Torbjorn Granlund  <tege@swox.com>
3957
3958         * mpn/x86_64/aorsmul_1.asm: New file, written from scratch, finally at
3959         3.0 c/l on K8 (addmul_1 was 3.3; submul_1 was 3.5).
3960         * mpn/x86_64/addmul_1.asm: Remove.
3961         * mpn/x86_64/submul_1.asm: Remove.
3962
3963 2006-12-29  Torbjorn Granlund  <tege@swox.com>
3964
3965         * randmt.c (__gmp_randclear_mt): Initialize ALLOC field, like in
3966         __gmp_randinit_mt_noseed.
3967         (__gmp_randclear_mt, __gmp_randinit_mt_noseed): Make similar functions
3968         look similar.
3969         (__gmp_randclear_mt): Pass actually allocated size.
3970
3971         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Add mul_toom22.c,
3972         mul_toom32.c, mul_toom42.c.
3973
3974         * configure.in: Recognize athlon64 and core2 as alternatives to x86_64.
3975         Provide special settings for core2.
3976
3977         * configure.in (gmp_mpn_functions): Add mul_toom22, mul_toom32,
3978         mul_toom42.
3979
3980         * mpn/generic/mul_toom22.c: New file.
3981         * mpn/generic/mul.c: Use mpn_mul_toom22.  Trim cutoff points between
3982         the mpn_mul_toomN2 functions.  Handle balanced operands at function
3983         entry.
3984
3985 2006-12-29  Marco Bodrato  <bodrato@mail.dm.unipi.it>
3986
3987         * mpn/generic/mul_n.c: Rewrite interpolation code.
3988
3989 2006-12-28  Torbjorn Granlund  <tege@swox.com>
3990
3991         * mpn/generic/mul_toom32.c: New file.
3992         * mpn/generic/mul_toom42.c: New file.
3993         * mpn/generic/mul.c: Use mpn_mul_toom32 and mpn_mul_toom42 for
3994         unbalanced operands.
3995
3996 2006-12-17  Torbjorn Granlund  <tege@swox.com>
3997
3998         * mpn/x86_64/aorrlsh_n.asm: New file.
3999         * mpn/x86_64/lshsub_n.asm: New file.
4000
4001         * mpn/x86_64/core2/aors_n.asm: New file.
4002         * mpn/x86_64/core2/lshift.asm: New file.
4003         * mpn/x86_64/core2/rshift.asm: New file.
4004
4005         * mpn/x86/p6/aors_n.asm: Replace K7 grabbing code with P6 specific
4006         code.
4007
4008         * mpn/x86/p6/lshsub_n.asm: New file.
4009
4010 2006-11-23  Torbjorn Granlund  <tege@swox.com>
4011
4012         * tune/speed.h (SPEED_ROUTINE_MPN_MUL_BASECASE): Allocate space for xp
4013         locally, s->xp might be insufficient.
4014
4015 2006-11-22  Torbjorn Granlund  <tege@swox.com>
4016
4017         * randmt.c (__gmp_randinit_mt_noseed): Initialize ALLOC field of result
4018         param.
4019
4020 2006-11-06  Torbjorn Granlund  <tege@swox.com>
4021
4022         * tune/set_strp.c: New file.
4023
4024 2006-11-04  Torbjorn Granlund  <tege@swox.com>
4025
4026         * extract-dbl.c: Rewrite to handle nails better, and for general
4027         optimization.
4028
4029         * mpz/bin_uiui.c: Simplify.
4030
4031         * longlong.h (umul_ppmm) [mmix]: New.
4032
4033         * tune/tuneup.c, tune/common.c, tune/speed.c, tune/speed.h,
4034         tune/set_strb.c, tune/set_strs.c: Add tuning and speed measurements
4035         of separate SET_STR_DC_THRESHOLD and SET_STR_PRECOMPUTE_THRESHOLD.
4036         Add tuning and speed measurement of mpn_addsub_n.
4037
4038 2006-10-31  Torbjorn Granlund  <tege@swox.com>
4039
4040         * gmpxx.h: Remove ternary stuff, it is hardly an optimization and it
4041         writes to destination before reading all source operands.
4042
4043 2006-10-25  Torbjorn Granlund  <tege@swox.com>
4044
4045         * mpn/generic/set_str.c: Complete rewrite.
4046         * mpn/generic/get_str.c: Likewise.
4047
4048         * gmp-impl.h (struct powers, powers_t): New types.
4049         Restructure GET_STR_* and SET_STR_* thresholds.
4050
4051 2006-09-21  Torbjorn Granlund  <tege@swox.com>
4052
4053         * mpn/generic/rootrem.c: Remove some redundant casts.
4054
4055 2006-07-12  Torbjorn Granlund  <tege@swox.com>
4056
4057         * mpn/alpha/ev6/nails/addmul_2.asm: Make it run at claimed speed.
4058         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
4059
4060         * mpf/get_str.c: Avoid copying result when not needed.  Misc cleanups.
4061
4062         * tests/amd64call.asm: Use jmp instead of jmpq to placate Solaris.
4063
4064 2006-06-30  Torbjorn Granlund  <tege@swox.com>
4065
4066         * configure.in (powerpc-*): Remove repeated path component.
4067
4068 2006-06-15  Torbjorn Granlund  <tege@swox.com>
4069
4070         * configure.in: (ia64-*-linux*): Don't use -O3.
4071
4072 2006-06-14  Torbjorn Granlund  <tege@swox.com>
4073
4074         * mpq/get_str.c: Fix upper base limit boundary in an ASSERT.
4075
4076         * tests/refmpn.c (refmpn_sb_divrem_mn): Use ASSERT_CARRY for add-back.
4077
4078 2006-05-31  Torbjorn Granlund  <tege@swox.com>
4079
4080         * tests/mpz/t-set_d.c (check_data): Add more data points.
4081
4082         * mpz/set_d.c: Handle negative return values from __gmp_extract_double.
4083
4084 2006-05-17  Torbjorn Granlund  <tege@swox.com>
4085
4086         * configure.in: Clear out gcc_cflags_cpu and gcc_cflags_arch for a fat
4087         build.
4088
4089 2006-05-16  Torbjorn Granlund  <tege@swox.com>
4090
4091         * demos/primes.c (find_primes): Increase mpz_probab_prime_p cnt to 10.
4092
4093         * mpn/generic/addsub_n.c: Fix criteria form when to call _nc functions.
4094
4095 2006-05-12  Torbjorn Granlund  <tege@swox.com>
4096
4097         * config.guess: Recognize more ppc processor types.
4098
4099 2006-05-11  Torbjorn Granlund  <tege@swox.com>
4100
4101         * tune/speed.c (usage): Update URL for gnuplot and quickplot.
4102
4103 2006-05-10  Torbjorn Granlund  <tege@swox.com>
4104
4105         * configure.in (powerpc-*-*): Pass -maltivec to assembler for
4106         appropriate CPUs.
4107
4108 2006-05-08  Torbjorn Granlund  <tege@swox.com>
4109
4110         * mpn/powerpc32/aix.m4 (LEA): Remove [RW] attribute.
4111
4112 2006-05-03  Torbjorn Granlund  <tege@swox.com>
4113
4114         * mpn/powerpc64/vmx/popcount.asm: Conditionally zero extend n.
4115
4116 2006-04-27  Torbjorn Granlund  <tege@swox.com>
4117
4118         * mpz/divexact.c: Call mpz_tdiv_q for large operands.
4119
4120         * configure.in (powerpc-*-darwin): Remove -fast, it affects PIC.
4121
4122 2006-04-26  Torbjorn Granlund  <tege@swox.com>
4123
4124         * config.guess: Try to recognize Ultrasparc T1 (as ultrasparct1).
4125         * config.sub: Handle ultrasparct1.
4126
4127 2006-04-25  Torbjorn Granlund  <tege@swox.com>
4128
4129         * mpn/sparc64/gmp-mparam.h: Retune, without separation of GNUC and
4130         non-GNUC data.
4131
4132 2006-04-20  Torbjorn Granlund  <tege@swox.com>
4133
4134         * tests/mpz/convert.c: Increase operands range.
4135
4136 2006-04-19  Torbjorn Granlund  <tege@swox.com>
4137
4138         * configure.in: Support powerpc eABI.
4139         * mpn/powerpc32/eabi.m4: New file.
4140
4141         * configure.in: Support powerpc *bsd.
4142         * mpn/powerpc64/elf.m4: New name for mpn/powerpc64/linux64.m4.
4143         * mpn/powerpc32/elf.m4: New name for mpn/powerpc32/linux.m4.
4144
4145         * mpn/powerpc64/linux64.m4 (ASM_END): Quote TOC_ENTRY.
4146
4147 2006-04-18  Torbjorn Granlund  <tege@swox.com>
4148
4149         * configure.in (gmp_mpn_functions_optional): Add lshiftc.
4150         (HAVE_NATIVE): Add lshiftc.
4151
4152         * mpn/powerpc64/mode64/invert_limb.asm: Use LEA, not LDSYM.
4153         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
4154         * mpn/powerpc64/mode64/dive_1.asm: Likewise.
4155
4156         * mpn/powerpc64/linux64.m4 (TOC_ENTRY): Define to empty.
4157         * mpn/powerpc64/aix.m4 (TOC_ENTRY): Likewise.
4158         * mpn/powerpc32/aix.m4 (TOC_ENTRY): Likewise.
4159
4160         * mpn/powerpc32/aix.m4 (EXTERN): New, copied form powerpc64/aix.m4.
4161         * mpn/powerpc32/mode1o.asm: Use EXTERN.
4162         * mpn/powerpc32/linux.m4 (EXTERN): Provide dummy definition.
4163         * mpn/powerpc32/darwin.m4 (EXTERN): Likewise.
4164
4165 2006-04-13  Torbjorn Granlund  <tege@swox.com>
4166
4167         * mpn/generic/mul_fft.c: Use new thresholds mechanism if MUL_FFT_TABLE2
4168         is defined.
4169         (mpn_lshiftc): New name for mpn_lshift_com (for consistency with some
4170         stuff already in 4.1.4.
4171         (mpn_fft_mul_2exp_modF): Reorganize initial operand reductions to avoid
4172         divisions.
4173
4174         * tests/devel/try.c (choice_array): Add mpn_addsub_n[c].
4175
4176 2006-04-11  Torbjorn Granlund  <tege@swox.com>
4177
4178         * aclocal.m4: Regenerate with patched libtool.
4179
4180         * mpn/asm-defs.m4 (ASM_END): Provide (empty) default.
4181
4182 2006-04-08  Torbjorn Granlund  <tege@swox.com>
4183
4184         * configure.in (gmp_mpn_functions_optional): Add addsub.
4185
4186         * gmpxx.h: Remove missed MPFR references.
4187
4188         * gmp-impl.h (LIMBS_PER_DOUBLE): Adjust formula to not be pessimistic.
4189
4190         * gmp-impl.h (TMP_*, WANT_TMP_DEBUG): Don't expect marker argument;
4191         define TMP_SALLOC and TMP_BALLOC.
4192
4193         * mpn/minithres/gmp-mparam.h: New file.
4194
4195         * tests/mpz/t-io_raw.c: Fix printf type/arg mismatches.
4196         * tests/mpz/t-export.c: Likewise.
4197         * tests/mpz/io.c: Likewise.
4198         * tests/t-constants.c: Likewise.
4199
4200         * mpn/ia64/popcount.asm: Append "cond.dptk" to conditional branches to
4201         placate icc.
4202         * mpn/ia64/hamdist.asm: Likewise.
4203         * mpn/ia64/lorrshift.asm: Likewise.
4204         * mpn/ia64/dive_1.asm: Likewise.
4205
4206 2006-04-05  Torbjorn Granlund  <tege@swox.com>
4207
4208         * tal-notreent.c (__gmp_tmp_mark): Add "struct" tag for tmp_marker.
4209         (__gmp_tmp_free): Likewise.
4210
4211         * mpn/generic/mul_fft.c: Optimize many scalar divisions and mod
4212         operations into masks and shifts.
4213         (mpn_fft_mul_modF_K): Fix a spurious ASSERT_NOCARRY.
4214
4215 2006-03-26  Torbjorn Granlund  <tege@swox.com>
4216
4217         * Version 4.2 released.
4218
4219         * mpn/powerpc64/aix.m4 (LEA): Renamed from LDSYM.
4220         * mpn/powerpc64/darwin.m4: Likewise.
4221         * mpn/powerpc64/linux64.m4: Likewise.
4222         * mpn/powerpc64/vmx/popcount.asm: Use LEA, not LDSYM.
4223
4224 2006-03-23  Torbjorn Granlund  <tege@swox.com>
4225
4226         * gmp-impl.h: (class gmp_allocated_string): Prefix strlen with std::.
4227
4228         * gmpxx.h (__GMP_DEFINE_TERNARY_EXPR2): Remove for now.
4229         (struct __gmp_ternary_addmul2): Likewise.
4230         (struct __gmp_ternary_submul2): Likewise.
4231
4232         * gmpxx.h: #include <cstring>.
4233         (struct __gmp_alloc_cstring): Prefix strlen with std::.
4234
4235         * mpn/x86/pentium/com_n.asm: Add TEXT and ALIGN.
4236         * mpn/x86/pentium/copyi.asm: Likewise.
4237         * mpn/x86/pentium/copyd.asm: Likewise.
4238
4239 2006-03-22  Torbjorn Granlund  <tege@swox.com>
4240
4241         * gmp-h.in: Add a "using std::FILE" for C++.
4242         (_GMP_H_HAVE_FILE): Check also _ISO_STDIO_ISO_H.
4243
4244         * gmpxx.h: Remove mpfr code.
4245         * tests/cxx: Likewise.
4246
4247         * gmp-impl.h (FORCE_DOUBLE): Rename a tempvar to avoid a clash with
4248         GNU/Linux public include file.
4249
4250         * configure.in (powerpc64, darwin): New optional, gcc_cflags_subtype.
4251         Grab powerpc32/darwin.m4 for ABI=mode32.
4252
4253         * configure.in: Use host_cpu whenever just the cpu type is needed.
4254
4255 2006-03-08  Torbjorn Granlund  <tege@swox.com>
4256
4257         * mpz/get_si.c: Fix a typo.
4258
4259         * tests/mpq/t-get_d.c (check_random): Improve random generation for
4260         nails.
4261
4262 2006-02-28  Torbjorn Granlund  <tege@swox.com>
4263
4264         * tests/mpq/t-get_d.c (check_random): New function.
4265         (main): Call check_random.
4266
4267         * mpq/set_d.c: Make choices based on LIMBS_PER_DOUBLE, not
4268         BITS_PER_MP_LIMB.  Make it work for LIMBS_PER_DOUBLE == 4.
4269         Use MPZ_REALLOC.
4270
4271         * mpz/set_d.c: Make it work for LIMBS_PER_DOUBLE == 4.
4272
4273         * extract-dbl.c: Make it work for LIMBS_PER_DOUBLE > 3.
4274
4275 2006-02-27  Torbjorn Granlund  <tege@swox.com>
4276
4277         * mpz/cmp_d.c: Declare `i'.
4278         * mpz/cmpabs_d.c: Likewise.
4279
4280 2006-02-23  Torbjorn Granlund  <tege@swox.com>
4281
4282         * mpn/powerpc32/vmx/copyd.asm: Set right VRSAVE bits.
4283         * mpn/powerpc32/vmx/copyi.asm: Likewise.
4284
4285 2006-02-22  Torbjorn Granlund  <tege@swox.com>
4286
4287         * mpn/powerpc32/vmx/logops_n.asm: New file.
4288
4289         * mpn/powerpc32/diveby3.asm: Rewrite.
4290
4291 2006-02-21  Torbjorn Granlund  <tege@swox.com>
4292
4293         * mpn/powerpc32/vmx/copyi.asm: New file.
4294         * mpn/powerpc32/vmx/copyd.asm: New file.
4295
4296 2006-02-17  Torbjorn Granlund  <tege@swox.com>
4297
4298         * mpn/alpha/ev6/nails/aors_n.asm (CYSH): Import proper setting from
4299         deleted mpn_sub_n.
4300
4301 2006-02-16  Torbjorn Granlund  <tege@swox.com>
4302
4303         * mpn/alpha/ev6/addmul_1.asm: Correct slotting comments.
4304
4305 2006-02-15  Torbjorn Granlund  <tege@swox.com>
4306
4307         * tests/devel/anymul_1.c: Copy error reporting code from addmul_N.c.
4308
4309         * tests/devel/addmul_N.c: New file.
4310         * tests/devel/mul_N.c: New file.
4311
4312         * mpn/alpha/default.m4 (PROLOGUE_cpu): Align functions at 16-byte
4313         boundary.
4314
4315         * mpn/alpha/ev6/nails/aors_n.asm: New file.
4316         * mpn/alpha/ev6/nails/add_n.asm: Remove.
4317         * mpn/alpha/ev6/nails/sub_n.asm: Remove.
4318
4319         * mpn/alpha/ev6/nails/addmul_1.asm: Rewrite.
4320         * mpn/alpha/ev6/nails/submul_1.asm: Likewise.
4321         * mpn/alpha/ev6/nails/mul_1.asm: Likewise.
4322
4323         * mpn/alpha/ev6/nails/addmul_2.asm: Use L() for labels.
4324         * mpn/alpha/ev6/nails/addmul_3.asm: Use L() for labels.
4325         * mpn/alpha/ev6/nails/addmul_4.asm: Use L() for labels.
4326
4327 2006-02-13  Torbjorn Granlund  <tege@swox.com>
4328
4329         * mpn/powerpc32/diveby3.asm: Trivially reorder loop insns to save
4330         1 c/l.
4331
4332         * mpn/x86_64/dive_1.asm: Use movabsq to support large model non-PIC.
4333
4334         * mpn/x86_64/rsh1add_n.asm: Replace high register with rbx.
4335         * mpn/x86_64/rsh1sub_n.asm: Likewise.
4336
4337 2006-02-10  Torbjorn Granlund  <tege@swox.com>
4338
4339         * mpn/powerpc64/sqr_diagonal.asm: Software pipeline.
4340
4341         * mpn/powerpc64/vmx/popcount.asm: Add prefetching.
4342
4343 2006-02-07  Torbjorn Granlund  <tege@swox.com>
4344
4345         * mpn/powerpc64/mode64/diveby3.asm: Rewrite.
4346
4347 2006-02-04  Torbjorn Granlund  <tege@swox.com>
4348
4349         * mpn/powerpc64/vmx/popcount.asm: Remove mpn_hamdist partial code.
4350         Move compare for huge n so that it is always executed.
4351
4352 2006-02-03  Torbjorn Granlund  <tege@swox.com>
4353
4354         * mpn/powerpc32/linux.m4 (LEA): Add support for PIC.
4355
4356         * configure.in (powerpc): New optional, gcc_cflags_subtype.
4357
4358         * mpn/x86_64/pentium4/add_n.asm: New file.
4359         * mpn/x86_64/pentium4/sub_n.asm: New file.
4360         * mpn/x86_64/pentium4/lshift.asm: New file.
4361
4362         * mpn/powerpc64/linux64.m4 (PROLOGUE_cpu): Align function start to
4363         16-multiple.
4364         * mpn/powerpc64/aix.m4: Likewise.
4365         * mpn/powerpc64/darwin.m4: Likewise.
4366
4367         * mpn/powerpc64/copyi.asm: Align loop to 16-multiple.
4368         * mpn/powerpc64/copyd.asm: Likewise
4369
4370         * configure.in (powerpc): Add vmx to relevant paths.
4371
4372         * mpn/powerpc64/linux64.m4 (DEF_OBJECT): Accept 2nd argument, for
4373         alignment.
4374         * mpn/powerpc64/aix.m4: Likewise.
4375         * mpn/powerpc64/darwin.m4: Likewise.
4376
4377         * mpn/powerpc32/linux.m4 (DEF_OBJECT, END_OBJECT): New macros,
4378         inherited from powerpc64 versions.
4379         * mpn/powerpc32/aix.m4: Likewise.
4380         * mpn/powerpc32/darwin.m4: Likewise.
4381
4382         * mpn/powerpc64/vmx/popcount.asm: New file, for ppc32 and ppc64.
4383         * mpn/powerpc32/vmx/popcount.asm: New file, grabbing above file.
4384
4385 2006-01-22  Torbjorn Granlund  <tege@swox.com>
4386
4387         * configure.in: Generalize OS-dependent patterns for powerpcs.
4388
4389 2006-01-20  Torbjorn Granlund  <tege@swox.com>
4390
4391         * mpn/x86_64/popham.asm: Optimize.
4392
4393         * config.guess: Recognize power4 and up under linux-gnu.
4394         * config.sub: Generalize power recognition code.
4395         * acinclude.m4 (POWERPC64_PATTERN): Add 64-bit powerpc processors.
4396         * configure.in: Recognize powerpc processors masquerading as power
4397         processors.
4398
4399 2006-01-19  Torbjorn Granlund  <tege@swox.com>
4400
4401         * mpn/x86_64/logops_n.asm: Rewrite for more stable speed and smaller
4402         code.
4403         * mpn/x86_64/com_n.asm: Likewise.
4404
4405 2006-01-18  Torbjorn Granlund  <tege@swox.com>
4406
4407         * mpn/x86_64/addlsh1_n.asm: Rewrite to use indexed addressing.
4408         * mpn/x86_64/sublsh1_n.asm: Likewise.
4409
4410 2006-01-17  Torbjorn Granlund  <tege@swox.com>
4411
4412         * mpn/generic/diveby3.c: Use GMP standard parameter names.  Nailify
4413         alternative code.  Use restrict for params.
4414
4415         * configure.in: Recognize andn_n as not needing nailification.
4416
4417         * tests/mpq/t-equal.c (check_various): Disable a test that gives common
4418         factors for GMP_NUMB_BITS == 62.
4419
4420 2006-01-16  Torbjorn Granlund  <tege@swox.com>
4421
4422         * mpn/generic/get_str.c (mpn_sb_get_str): Fix digit count computation,
4423         was inaccurate for nails.
4424
4425 2006-01-15  Torbjorn Granlund  <tege@swox.com>
4426
4427         * mpn/x86_64/mode1o.asm: Remove unneeded carry register zeroing.
4428
4429 2006-01-08  Torbjorn Granlund  <tege@swox.com>
4430
4431         * mpn/alpha/ev6/sqr_diagonal.asm: New file.
4432
4433 2006-01-06  Torbjorn Granlund  <tege@swox.com>
4434
4435         * mpn/powerpc64/mode64/mod_34lsub1.asm: Tune to 1.5 c/l.
4436
4437         * mpn/generic/mullow_n.c (MUL_BASECASE_ALLOC): New #define.
4438         (mpn_mullow_n): Use it.
4439
4440         * mpn/powerpc64/mode64/dive_1.asm: Use EXTERN.
4441         * mpn/powerpc64/mode64/mode1o.asm: Likewise.
4442
4443         * mpn/powerpc64/aix.m4 (EXTERN): Define to import symbol.
4444         (LDSYM): Remove [RW] attribute.
4445         * mpn/powerpc64/linux64.m4 (EXTERN): Dummy definition.
4446         * mpn/powerpc64/darwin.m4 (EXTERN): Likewise.
4447
4448 2006-01-05  Torbjorn Granlund  <tege@swox.com>
4449
4450         * mpn/powerpc64/mode64/mode1o.asm: New file.
4451
4452         * mpn/powerpc64/mode64/dive_1.asm: Use L() for labels.  Invoke ASM_END.
4453
4454         * mpn/powerpc64/mode64/invert_limb.asm: Invoke ASM_END.
4455
4456         * mpn/powerpc64/linux64.m4: Move toc entry generation from direct at
4457         DEF_OBJECT to delayed via LDSYM, define ASM_END to output it.
4458         * mpn/powerpc64/aix.m4: Likewise.
4459         * mpn/powerpc64/darwin.m4: Define a dummy ASM_END.
4460
4461         * mpn/powerpc64/mode64/addmul_1.asm: Add POWER5 timings.
4462         * mpn/powerpc64/mode64/mul_1.asm: Likewise.
4463
4464         * mpn/powerpc64/mode64/submul_1.asm: Tweak to save 1.5 c/l for POWER5.
4465
4466 2006-01-04  Torbjorn Granlund  <tege@swox.com>
4467
4468         * mpn/powerpc64/mode64/dive_1.asm: New file.
4469
4470         * mpn/powerpc64/mode64/invert_limb.asm: Add missing ASM_START.
4471
4472         * mpn/powerpc64/mode64/addmul_1.asm: Fix a comment typo.
4473
4474         * mpn/x86_64/diveby3.asm: Rewrite.
4475
4476 2006-01-03  Torbjorn Granlund  <tege@swox.com>
4477
4478         * configure.in: Update bugs reporting address.
4479
4480         * mpn/powerpc64/mode64/diveby3.asm: Trim a cycle off of POWER4 timing.
4481         Misc cleanup.
4482
4483 2006-01-02  Torbjorn Granlund  <tege@swox.com>
4484
4485         * mpn/powerpc64/linux64.m4 (CALL): New macro.
4486         * mpn/powerpc64/aix.m4: Likewise.
4487         * mpn/powerpc64/darwin.m4: Likewise, also define macro "DARWIN".
4488
4489 2005-12-28  Torbjorn Granlund  <tege@swox.com>
4490
4491         * mpn/powerpc64/mode64/mod_34lsub1.asm: New file.
4492
4493 2005-12-26  Torbjorn Granlund  <tege@swox.com>
4494
4495         * mpn/x86_64/mod_34lsub1.asm: New file.
4496
4497 2005-12-20  Torbjorn Granlund  <tege@swox.com>
4498
4499         * mpn/x86_64/submul_1.asm: Save a push/pop by not using register r12.
4500         Use addq instead of leaq for pointer updates; schedule them.  (These
4501         changes shaves one cycle of overhead and 0.25 c/l.)
4502
4503 2005-12-18  Torbjorn Granlund  <tege@swox.com>
4504
4505         * mpf/ui_div.c: Implement workaround for GCC bug triggered on alpha.
4506         * mpf/set_q.c: Likewise.
4507
4508 2005-12-16  Torbjorn Granlund  <tege@swox.com>
4509
4510         * mpn/generic/tdiv_qr.c: Remove statement with no effect.
4511         Rename dead variable to `dummy'.
4512
4513 2005-12-15  Torbjorn Granlund  <tege@swox.com>
4514
4515         * demos/pexpr.c (setup_error_handler): Add a missing ";".
4516
4517 2005-11-27  Torbjorn Granlund  <tege@swox.com>
4518
4519         * mpn/generic/mul.c: Crudely call mpn_mul_fft_full before checking
4520         for unbalanced operands.
4521
4522         * mpn/generic/mul_fft.c: Remove many scalar divisions.
4523         (mpn_mul_fft_lcm): Simplify.
4524         (mpn_mul_fft_decompose): Rewrite to handle arbitrarily unbalanced
4525         operands.
4526
4527 2005-11-22  Torbjorn Granlund  <tege@swox.com>
4528
4529         * configure.in: Properly recognize all 32-bit Solaris releases.
4530
4531 2005-11-10  Torbjorn Granlund  <tege@swox.com>
4532
4533         * mpn/generic/mul_fft.c: Inline mpn_fft_mul_2exp_modF,
4534         mpn_fft_add_modF and mpn_fft_normalize.
4535
4536 2005-11-02  Torbjorn Granlund  <tege@swox.com>
4537
4538         * tests/mpz/reuse.c: Increase operand size, decrease # of reps.
4539
4540         * mpz/rootrem.c: Adapt to new mpn_rootrem.
4541         * mpz/root.c: Likewise.
4542
4543         * tests/mpz/reuse.c: Test mpz_rootrem.
4544
4545         With Paul Zimmermann:
4546         * mpn/generic/rootrem.c: Complete rewrite.
4547
4548 2005-10-31  Torbjorn Granlund  <tege@swox.com>
4549
4550         * mpz/pprime_p.c (mpz_probab_prime_p): Considerably limit trial
4551         dividing.
4552
4553         * mpz/perfpow.c (mpz_perfect_power_p): Use mpz_divisible_ui_p instead
4554         of mpz_tdiv_ui.
4555
4556         * mpz/divegcd.c: Correct probability number for GCD == 1.
4557
4558         * mpn/x86_64/mul_basecase.asm: Remove an obsolete comment.
4559
4560         * mpn/x86: Add cycle counts for array of x86 processors.
4561
4562         * mpn/x86/k7/mod_34lsub1.asm: Remove spurious mentions of ebp.
4563
4564         * mpn/powerpc32: Add POWER5 timings.
4565
4566         * mpn/powerpc32/README: Describe global reference variations.
4567
4568         * mpn/ia64/divrem_2.asm: Add some comments.
4569
4570         * mpn/ia64/divrem_1.asm: Reformat.
4571
4572         * mpn/ia64/addmul_2.asm: Correct a comment on slotting.
4573         * mpn/ia64/logops_n.asm: Likewise.
4574
4575         * mpn/ia64/addmul_1.asm: Remove a redundant preg mutex decl.
4576
4577         * mpn/generic/dive_1.c: Whitespace cleanup.
4578
4579         * mpn/alpha/ev6/nails/addmul_1.asm: Correct comments on slotting.
4580         * mpn/alpha/ev6/nails/addmul_2.asm: Likewise.
4581         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
4582
4583         * mpf/out_str.c: List some allocation improvement ideas.
4584
4585         * doc/gmp.texi: Update many URLs and email addresses.
4586
4587         * gmp-h.in (_GMP_H_HAVE_FILE): Check also _STDIO_H_INCLUDED.
4588
4589 2005-10-26  Torbjorn Granlund  <tege@swox.com>
4590
4591         * tune/tuneup.c (tune_mullow): Update param.max_size for each threshold
4592         measurement.
4593
4594         * configure.in (POWERPC64_PATTERN/*-*-darwin*): Set
4595         SPEED_CYCLECOUNTER_OBJ_mode64 and cyclecounter_size_mode64.
4596         (POWERPC64_PATTERN/*-*-linux*): Likewise.
4597
4598 2005-10-03  Torbjorn Granlund  <tege@swox.com>
4599
4600         * demos/factorize.c (factor_using_division_2kp): Honor verbose flag.
4601         (factor_using_pollard_rho): Divide out new factor before it's
4602         clobbered.  Don't stop factoring after a composite factor was found.
4603
4604 2005-09-17  Torbjorn Granlund  <tege@swox.com>
4605
4606         * demos/pexpr.c (fns): Add factorial keywords.
4607
4608 2005-08-16  Torbjorn Granlund  <tege@swox.com>
4609
4610         * tune/Makefile.am (EXTRA_DIST): Change "amd64" => "x86_64".
4611         * mpn/Makefile.am (TARG_DIST): Change "amd64" => "x86_64".
4612
4613 2005-08-15  Torbjorn Granlund  <tege@swox.com>
4614
4615         * configure.in: Change "amd64" => "x86_64".
4616
4617 2005-06-13  Torbjorn Granlund  <tege@swox.com>
4618
4619         * mpn/generic/pre_mod_1.c: Canonicalize variable names.
4620
4621         * mpn/generic/divrem.c: Rate qxn test as UNLIKELY.
4622
4623         * mpn/generic/gcdext.c (sanity_check_row): Invoke TMP_MARK.
4624
4625         * tune/tuneup.c (tune_mullow): Fix all max_size fields.
4626
4627         * gmp-impl.h (SQR_TOOM3_THRESHOLD_LIMIT): New #define.
4628         * tune/tuneup.c (tune_sqr): Use SQR_TOOM3_THRESHOLD_LIMIT.
4629         (sqr_toom3_threshold): Initialize from SQR_TOOM3_THRESHOLD_LIMIT.
4630
4631         * mpn/generic/mul_n.c (mpn_sqr_n): Use SQR_TOOM3_THRESHOLD_LIMIT.
4632
4633         * gmp-impl.h (mpn_nand_n, mpn_iorn_n, mpn_nior_n, mpn_xnor_n):
4634         Handle nails.
4635
4636 2005-06-13  Niels Möller  <nisse@lysator.liu.se>
4637
4638         * mpn/generic/gcdext.c (gcdext_schoenhage): Check for the
4639         (unlikely) case that one of the hgcd/euclid steps results in two
4640         remainders of one limb each. Then use gcdext_1.
4641
4642 2005-06-12  Torbjorn Granlund  <tege@swox.com>
4643
4644         * mpn/alpha/ev6/sub_n.asm: Analogous changes as to add_n.asm last.
4645
4646 2005-06-11  Torbjorn Granlund  <tege@swox.com>
4647
4648         * mpn/alpha/ev6/add_n.asm: Rewrite inner loop to load later.
4649         Add mpn_add_nc entry.
4650
4651         * mpn/alpha/ev6/addmul_1.asm: Remove redundant initial loads.
4652
4653 2005-06-09  Torbjorn Granlund  <tege@swox.com>
4654
4655         * mpn/ia64/dive_1.asm: Fix issues with HP-UX.
4656
4657 2005-06-08  Torbjorn Granlund  <tege@swox.com>
4658
4659         * mpn/ia64/diveby3.asm: Update TODO list.
4660
4661         * mpn/ia64/mode1o.asm: Fix comment typos.
4662
4663         * mpn/ia64/dive_1.asm: New file.
4664
4665 2005-06-07  Torbjorn Granlund  <tege@swox.com>
4666
4667         * mpn/ia64/mode1o.asm: Add prefetching.
4668
4669         * mpn/generic/dive_1.c: Use variable h for upper umul_ppmm result.
4670
4671 2005-06-06  Torbjorn Granlund  <tege@swox.com>
4672
4673         * mpn/ia64/hamdist.asm: Complete rewrite.
4674         * mpn/ia64/popcount.asm: Rewrite to use multi-pronged feed-in.
4675
4676         * mpn/ia64/aors_n.asm: Rewrite feed-in code.
4677         * mpn/ia64/rsh1aors_n.asm: Likewise.
4678         * mpn/ia64/aorslsh1_n.asm: Likewise.
4679         * mpn/ia64/lorrshift.asm: Likewise.
4680
4681 2005-06-04  Torbjorn Granlund  <tege@swox.com>
4682
4683         * tests/devel/try.c (choice_array): Exclude mpn_preinv_mod_1 unless
4684         USE_PREINV_MOD_1.
4685         (choice_array): Exclude mpn_sqr_basecase if SQR_KARATSUBA_THRESHOLD
4686         is zero.
4687
4688 2005-06-03  Torbjorn Granlund  <tege@swox.com>
4689
4690         * mpn/alpha/ev6/addmul_1.asm: Prefix all labels with "$".
4691         * mpn/alpha/ev6/mul_1.asm: Likewise.
4692
4693 2005-06-02  Torbjorn Granlund  <tege@swox.com>
4694
4695         * tests/refmpn.c (refmpn_divmod_1c_workaround): Implement workaround
4696         to gcc 3.4.x bug triggered on powerpc64 with 32-bit ABI.
4697
4698 2005-06-01  Torbjorn Granlund  <tege@swox.com>
4699
4700         * tests/devel/try.c (main): Fix a typo.
4701
4702 2005-05-31  Torbjorn Granlund  <tege@swox.com>
4703
4704         * mpn/alpha/ev6/addmul_1.asm: Rewrite for L1 cache, add prefetch.
4705
4706 2005-05-30  Torbjorn Granlund  <tege@swox.com>
4707
4708         * tests/misc.c (tests_rand_start): Mask random seed to 32 bits.
4709
4710 2005-05-29  Torbjorn Granlund  <tege@swox.com>
4711
4712         * mpn/powerpc64/mode32/mul_1.asm: Handle BROKEN_LONGLONG_PARAM.
4713         * mpn/powerpc64/mode32/addmul_1.asm: Likewise.
4714         * mpn/powerpc64/mode32/submul_1.asm: Likewise.
4715
4716         * mpn/powerpc32/mode1o.asm: Rewrite to actually work.
4717
4718         * mpn/powerpc32/aix.m4 (LEA): New macro.
4719         (ASM_END): New macro.
4720
4721         * mpn/powerpc32/linux.m4: New file.
4722         * mpn/powerpc32/darwin.m4: New file.
4723         * configure.in: Use linux.m4 and darwin.m4.
4724         (powerpc64-linux-gnu): Add support for mode32.
4725
4726 2005-05-25  Torbjorn Granlund  <tege@swox.com>
4727
4728         * mpn/generic/mullow_n.c: Remove FIXME mentioning fixed flaw.
4729
4730         * tests/mpz/t-cmp_d.c (check_one): Fix printf fmt string typo.
4731
4732         * demos/isprime.c: #include stdlib.h.
4733         * tests/rand/t-urbui.c: Likewise.
4734         * tests/rand/t-urmui.c: Likewise.
4735
4736         * tests/mpz/t-popcount.c (check_random): Remove spurious printf arg.
4737
4738         * mpn/ia64/lorrshift.asm: Cleanup code layout.
4739         * mpn/ia64/popcount.asm: Likewise.
4740
4741 2005-05-24  Torbjorn Granlund  <tege@swox.com>
4742
4743         * tests/devel/try.c (param_init) [TYPE_GET_STR]: Set retval field.
4744         (compare): Handle SIZE_GET_STR as SIZE_RETVAL.
4745
4746         * tests/refmpn.c (refmpn_get_str): Rewrite to make it work.
4747
4748 2005-05-23  Torbjorn Granlund  <tege@swox.com>
4749
4750         * mpn/amd64/add_n.asm: Add mpn_add_nc entry point.
4751         * mpn/amd64/sub_n.asm: Add mpn_sub_nc entry point.
4752
4753         * longlong.h (many places): Remove lvalue casts.
4754
4755         * gmp-impl.h (MPF_SIGNIFICANT_DIGITS): Cast prec to avoid overflow
4756         for > 4G digits.
4757
4758         * mpn/alpha/ev6/add_n.asm: Prefetch using ldl.
4759         * mpn/alpha/ev6/sub_n.asm: Likewise.
4760
4761         * mpn/alpha/ev6/slot.pl (optable): Recognize negq and ldl.
4762
4763         * mpn/ia64/aors_n.asm: Prefetch using lfetch.
4764         * mpn/ia64/lorrshift.asm: Likewise.
4765         * mpn/ia64/popcount.asm: Likewise.
4766         * mpn/ia64/diveby3.asm: Likewise.
4767
4768 2005-05-22  Torbjorn Granlund  <tege@swox.com>
4769
4770         * mpn/alpha/ev67/popcount.asm: Prefetch.
4771         * mpn/alpha/ev67/hamdist.asm: Prefetch.
4772
4773         * longlong.h (add_ssaaaa) [x86]: Remove lvalue casts.
4774         (sub_ddmmss) [x86]: Likewise.
4775
4776         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Add DATA_SRC1_ODD.
4777         (param_init) [TYPE_MPZ_KRONECKER]: Clear inherited DATA_SRC1_ODD.
4778         (param_init) [TYPE_DIVEXACT_1]: Use symbolic name DIVISOR_LIMB.
4779
4780 2005-05-21  Torbjorn Granlund  <tege@swox.com>
4781
4782         * tests/devel/try.c (param_init) [TYPE_MPZ_JACOBI]: Initialize divisor
4783         field according to UDIV_NEEDS_NORMALIZATION.
4784
4785         * mpz/mul_i.h: Remove left-over TMP_XXXX marker arguments.
4786
4787 2005-05-20  Torbjorn Granlund  <tege@swox.com>
4788
4789         * mpn/x86/pentium4/sse2/addmul_1.asm (mpn_addmul_1c): Put carry in
4790         proper register.
4791
4792         * mpn/generic/sqr_basecase.c (mpn_sqr_basecase, addmul_2 version):
4793         Avoid accesses out-of-bound in MPN_SQR_DIAGONAL applicate code.
4794
4795 2005-05-19  Torbjorn Granlund  <tege@swox.com>
4796
4797         * mpn/alpha/diveby3.asm: Make it actually work.
4798
4799         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD_LIMIT): New #define.
4800         * mpn/generic/mullow_n.c: Use fixed stack allocation for the smallest
4801         operands; use TMP_S* allocation for medium operands.
4802
4803         * gmp-impl.h: Remove nested TUNE_PROGRAM_BUILD test.
4804
4805 2005-05-18  Torbjorn Granlund  <tege@swox.com>
4806
4807         * mpn/generic/mul_n.c: Make squaring and multiplication code more
4808         similar.  Use TMP_S* functions.
4809
4810         * gmp-impl.h (TMP_DECL, TMP_MARK, TMP_FREE): Get rid of argument.
4811         (TMP_SALLOC): New macro for "small" allocations.
4812         (TMP_BALLOC): New macro for "big" allocations.
4813         (TMP_SDECL, TMP_SMARK, TMP_SFREE): New macros for functions that use
4814         just TMP_SALLOC.
4815         (WANT_TMP_ALLOCA): Make default functions choose alloca or reentrant
4816         functions, depending on size.
4817
4818         * *.c: Remove TMP_XXXX marker arguments.
4819
4820         * acinclude.m4 (WANT_TMP): Want tal-reent.lo also for alloca case.
4821
4822 2005-05-16  Torbjorn Granlund  <tege@swox.com>
4823
4824         * mpn/ia64/gmp-mparam.h: Further extend FFT tables.
4825
4826 2005-05-15  Torbjorn Granlund  <tege@swox.com>
4827
4828         * gmp-impl.h (udiv_qrnnd_preinv2): Pull an add into add_ssaaaa.
4829         (udiv_qrnnd_preinv2gen): Likewise.
4830
4831 2005-05-14  Torbjorn Granlund  <tege@swox.com>
4832
4833         * longlong.h (add_ssaaaa) [x86_64]: Restrict allowed immediate
4834         operands.
4835         * (sub_ddmmss) [x86_64]: Likewise.
4836
4837 2005-05-02  Torbjorn Granlund  <tege@swox.com>
4838
4839         * acinclude.m4 (GMP_HPC_HPPA_2_0): Make gmp_tmp_v1 sed pattern handle
4840         version numbers like B.11.X.32509-32512.GP.
4841
4842         * mpn/m68k/aors_n.asm: Correct MULFUNC_PROLOGUE.
4843
4844         * mpn/powerpc64/mode64/aors_n.asm: Add a MULFUNC_PROLOGUE.
4845
4846         * mpf/inp_str.c: Use plain int for mpf_set_str return value (works
4847         around gcc 4 bug).
4848
4849         * acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): Handle darwin's assembly
4850         syntax.
4851         (long long reliability test 1): New GMP_PROG_CC_WORKS_PART test.
4852         (long long reliability test 2): New GMP_PROG_CC_WORKS_PART test.
4853
4854         * configure.in: Add mode64 support for darwin.  Use darwin.m4.
4855         Add cflags_opt flags for mode32 darwin.
4856
4857         * mpn/powerpc64: Use L() for all asm files.
4858
4859         * mpn/asm-defs.m4 (PIC_ALWAYS): Define PIC just iff PIC_ALWAYS = "yes".
4860
4861         * mpn/powerpc64/darwin.m4: New file.
4862
4863         * mpn/powerpc64/linux64.m4: Remove TOCREF, add LDSYM.
4864         Rework DEF_OBJECT to need just one argument.
4865         * mpn/powerpc64/aix.m4: Likewise.
4866
4867         * mpn/powerpc64/mode64/invert_limb.asm: Load approx_tab address with
4868         LDSYM.  Optimize somewhat.  Remove 2nd DEF_OBJECT operand.
4869
4870 2005-05-01  Torbjorn Granlund  <tege@swox.com>
4871
4872         * mpn/generic/popham.c: Compute final summation differently for 64-bit.
4873
4874         * tests/mpz/t-popcount.c (check_random): New function.
4875         (main): Call it.
4876
4877 2005-04-28  Torbjorn Granlund  <tege@swox.com>
4878
4879         * mpn/amd64/add_n.asm: Use r9 instead of rbx to save push/pop.
4880         * mpn/amd64/sub_n.asm: Likewise.
4881
4882 2005-04-09  Torbjorn Granlund  <tege@swox.com>
4883
4884         * mpn/powerpc64/copyi.asm: If HAVE_ABI_mode32, ignore upper 32 bits of
4885         mp_size_t argument.
4886         * mpn/powerpc64/copyd.asm: Likewise.
4887         * mpn/powerpc64/sqr_diagonal.asm: Likewise.
4888         * mpn/powerpc64/lshift.asm: Likewise.
4889         * mpn/powerpc64/rshift.asm: Likewise.
4890         * mpn/powerpc64/logops_n.asm: Likewise.
4891         * mpn/powerpc64/com_n.asm: Likewise.
4892
4893 2005-04-08  Torbjorn Granlund  <tege@swox.com>
4894
4895         * mpn/generic/rootrem.c: Allocate PP_ALLOC limbs also for qp.
4896
4897 2005-04-07  Torbjorn Granlund  <tege@swox.com>
4898
4899         * mpn/powerpc32/add_n.asm: Add nc entry point.
4900         * mpn/powerpc32/sub_n.asm: Likewise.
4901
4902         * mpn/amd64/*.asm: Add Prescott/Nocona cycle/limb numbers.
4903
4904         * mpn/alpha/add_n.asm: Add correct cycle/limb numbers.
4905         * mpn/alpha/sub_n.asm: Likewise.
4906         * mpn/alpha/ev5/add_n.asm: Likewise.
4907         * mpn/alpha/ev5/sub_n.asm: Likewise.
4908
4909 2005-03-31  Torbjorn Granlund  <tege@swox.com>
4910
4911         * mpn/x86/k7/gmp-mparam.h: Fix typo in last change.
4912
4913 2005-03-19  Torbjorn Granlund  <tege@swox.com>
4914
4915         * mpn/amd64/gmp-mparam.h: Update.
4916
4917         * mpn/alpha/gmp-mparam.h: Update.
4918         * mpn/alpha/ev5/gmp-mparam.h: Update.
4919         * mpn/alpha/ev6/gmp-mparam.h: Update.
4920
4921         * mpn/ia64/gmp-mparam.h: Update.
4922
4923         * mpn/x86/p6/mmx/gmp-mparam.h: Update.
4924         * mpn/x86/pentium4/sse2/gmp-mparam.h: Update.
4925         * mpn/x86/k7/gmp-mparam.h: Update.
4926
4927         * tests/mpz/t-gcd.c (main): Honor command line reps argument.
4928
4929         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Simplify and correct code
4930         for generating test operands.
4931
4932 2005-03-17  Niels Möller  <nisse@lysator.liu.se>
4933
4934         * mpn/generic/hgcd.c (qstack_adjust): New argument d, saying how much
4935         to adjust the top quotient.
4936         (hgcd_adjust): The quotient can be off by either 1 or 2.
4937
4938 2005-03-16  Torbjorn Granlund  <tege@swox.com>
4939
4940         * tests/mpz/t-gcd.c (MAX_SCHOENHAGE_THRESHOLD): Set to largest of
4941         gcd,gcdext thresholds.
4942
4943 2005-03-15  Niels Möller  <nisse@lysator.liu.se>
4944
4945         * mpn/generic/gcdext.c (gcdext_schoenhage): When calling gcdext_lehmer,
4946         reuse all temporary limb storage, including the storage used for the
4947         qstack.
4948
4949 2005-03-09  Torbjorn Granlund  <tege@swox.com>
4950
4951         * mpn/amd64/logops_n.asm: Add MULFUNC_PROLOGUE.
4952
4953 2005-03-05  Torbjorn Granlund  <tege@swox.com>
4954
4955         * mpn/amd64/gmp-mparam.h: Extend MUL_FFT_TABLE and SQR_FFT_TABLE.
4956         * mpn/ia64/gmp-mparam.h: Likewise.
4957
4958 2005-02-17  Torbjorn Granlund  <tege@swox.com>
4959
4960         * mpn/ia64/divrem_1.asm: Add preinv entry point.
4961
4962 2005-01-13  Torbjorn Granlund  <tege@swox.com>
4963
4964         * gmp-impl.h (MPN_SIZEINBASE): Count bits in type size_t.
4965         (MPN_SIZEINBASE_16): Likewise.
4966
4967 2004-12-17  Torbjorn Granlund  <tege@swox.com>
4968
4969         * tune/speed.c (run_gnuplot): Use lines, not linespoints.
4970         Output a reset gnuplot command initially.
4971
4972 2004-12-04  Torbjorn Granlund  <tege@swox.com>
4973
4974         * mpn/generic/random2.c (gmp_rrandomb): Rework again.
4975         * mpz/rrandomb.c (gmp_rrandomb): Likewise.
4976
4977         * mpn/amd64/redc_1.asm: Call via PLT when PIC.
4978
4979 2004-11-29  Torbjorn Granlund  <tege@swox.com>
4980
4981         * mpn/amd64/divrem_1.asm: Add preinv entry point.
4982         * mpn/amd64/gmp-mparam.h: Set USE_PREINV_DIVREM_1 to 1.
4983
4984 2004-11-24  Torbjorn Granlund  <tege@swox.com>
4985
4986         * mpn/alpha/diveby3.asm: Use correct prefetch instruction.
4987
4988 2004-11-19  Torbjorn Granlund  <tege@swox.com>
4989
4990         * mpn/alpha/diveby3.asm: Add ",gp" glue in PROLOGUE.
4991         Add r31 dummy operand to `br' instruction.
4992
4993 2004-11-17  Torbjorn Granlund  <tege@swox.com>
4994
4995         * mpn/powerpc64/mode64/addmul_1.asm: Rewrite.
4996         * mpn/powerpc64/mode64/mul_1.asm: Rewrite.
4997
4998         * configure.in: Invoke AC_C_RESTRICT.
4999
5000 2004-11-16  Torbjorn Granlund  <tege@swox.com>
5001
5002         * mpn/alpha/diveby3.asm: New file.
5003
5004 2004-11-13  Torbjorn Granlund  <tege@swox.com>
5005
5006         * mpn/amd64/popham.asm: New file.
5007
5008 2004-11-12  Torbjorn Granlund  <tege@swox.com>
5009
5010         * mpn/amd64/add_n.asm: Correct cycle count.
5011         * mpn/amd64/sub_n.asm: Likewise.
5012
5013         * mpn/amd64/dive_1.asm: Speed divisors with many factors of 2.
5014
5015 2004-11-11  Torbjorn Granlund  <tege@swox.com>
5016
5017         * mpn/amd64/dive_1.asm: New file.
5018
5019 2004-11-10  Torbjorn Granlund  <tege@swox.com>
5020
5021         * mpn/generic/popham.c: Add comment.
5022
5023 2004-11-09  Torbjorn Granlund  <tege@swox.com>
5024
5025         * mpn/amd64/com_n.asm: New file.
5026
5027         * mpn/amd64/logops_n.asm: New file.
5028
5029 2004-11-08  Torbjorn Granlund  <tege@swox.com>
5030
5031         * mpn/powerpc64/com_n.asm: New file.
5032
5033 2004-11-05  Torbjorn Granlund  <tege@swox.com>
5034
5035         * mpn/amd64/diveby3.asm: New file.
5036
5037         * config.guess: Strip any PPC string in /proc/cpuinfo.
5038         Recognize 970 in that code.
5039
5040 2004-11-01  Torbjorn Granlund  <tege@swox.com>
5041
5042         * mpn/amd64/mul_basecase.asm: New file.
5043
5044         * mpn/amd64/redc_1.asm: New file.
5045
5046 2004-10-25  Torbjorn Granlund  <tege@swox.com>
5047
5048         * mpn/powerpc64/mode64/addlsh1_n.asm: Correct cycle counts.
5049
5050         * mpn/powerpc64/README: Update POWER5/PPC970 pipeline information.
5051
5052         * mpn/generic/mul_basecase.c (MAX_LEFT): Add comment.
5053
5054         * doc/gmp.texi: Consistently use "x86" denotation.
5055         (Assembler SIMD Instructions): Mention SSE2 usage.
5056
5057         * demos/pexpr.c (main): Handle "negative" base in mpz_sizeinbase call.
5058
5059 2004-10-18  Torbjorn Granlund  <tege@swox.com>
5060
5061         * mpn/powerpc64/mode64/submul_1.asm: Shave 2 cycles/limb with new carry
5062         inversion trick.
5063
5064 2004-10-16  Torbjorn Granlund  <tege@swox.com>
5065
5066         * configure.in: Support icc under x86.
5067         (ia64-*-linux*): Pass -no-gcc to icc.
5068
5069 2004-10-15  Torbjorn Granlund  <tege@swox.com>
5070
5071         * longlong.h (ia64 umul_ppmm): Add version for icc.
5072
5073         * configure.in: Support icc under ia64-*-linux*.
5074
5075         * acinclude.m4: New "compiler works" test for icc 8.1 bug.
5076         (GMP_PROG_CC_IS_GNU): Don't let Intel's icc fool us it is GCC.
5077
5078 2004-10-14  Torbjorn Granlund  <tege@swox.com>
5079
5080         * mpn/generic/gcdext.c: Add a few missing TMP_MARK.
5081
5082 2004-10-14  Torbjorn Granlund  <tege@swox.com>
5083
5084         * acinclude.m4 (GMP_ASM_W32): Try also "data4".
5085
5086         * mpn/ia64/logops_n.asm: Don't use naked "br", rejected by Intel
5087         assembler.
5088         * mpn/ia64/aors_n.asm: Likewise.
5089
5090         * mpn/ia64/divrem_2.asm: Add ".prologue".
5091
5092         * mpn/ia64/hamdist.asm: Put alloc first in bundle, enforced by the
5093         Intel assembler.
5094
5095         * longlong.h: Exclude masquerading __INTEL_COMPILER from ia64 asm.
5096         * gmp-impl.h: Likewise.
5097
5098 2004-10-12  Torbjorn Granlund  <tege@swox.com>
5099
5100         * mpn/ia64/mul_2.asm: Rewrite function entry code, write new code for
5101         n=2.
5102         * mpn/ia64/addmul_2.asm: Likewise.
5103
5104         * tests/devel/try.c: Handle mpn_mul_2 like mpn_addmul_2.
5105
5106         * tune/speed.c (routine): Make R parameter optional for mpn_mul_2.
5107
5108 2004-10-11  Torbjorn Granlund  <tege@swox.com>
5109
5110         * mpn/sparc64/addmul_1.asm: Update a comment.
5111
5112         * tests/devel/aors_n.c: #include tests.h.
5113         * tests/devel/anymul_1.c: Likewise.
5114         * tests/devel/shift.c: Likewise.
5115         * tests/devel/copy.c: Likewise.
5116
5117         * tests/devel/aors_n.c: Handle also mpn_addlsh1_n, mpn_sublsh1_n,
5118         mpn_rsh1add_n, and mpn_rsh1sub_n.
5119
5120         * mpn/ia64/submul_1.asm: Add TODO item.
5121
5122         * mpn/ia64/aors_n.asm: Rewrite function entry code (again).
5123         * mpn/ia64/aorslsh1_n.asm: Likewise.
5124         * mpn/ia64/logops_n.asm: Likewise.
5125
5126         * mpn/ia64/rsh1aors_n.asm: Tune function entry and feed-in code.
5127         * mpn/ia64/lorrshift.asm: Likewise.  Remove several spurious loads.
5128
5129         * tests/devel/Makefile.am (EXTRA_PROGRAMS): Updates for yesterday's
5130         file removals and additions.
5131
5132 2004-10-10  Torbjorn Granlund  <tege@swox.com>
5133
5134         * mpn/ia64/copyi.asm: Tune function entry code.
5135         * mpn/ia64/copyd.asm: Likewise.
5136
5137         * mpn/ia64/logops_n.asm: Tune function entry and feed-in code for speed
5138         and size.
5139         * mpn/ia64/aors_n.asm: Likewise.
5140
5141         * mpn/powerpc64/logops_n.asm: Correct cycles counts.
5142         * mpn/powerpc64/mode64/aors_n.asm: Likewise.
5143
5144         * tests/devel/copy.c: Handle both MPN_COPY_INCR and MPN_COPY_DECR.
5145
5146         * tests/devel/logops_n.c: New file, handle all logical operations.
5147
5148         * tests/devel/anymul_1.c: New file, handle mpn_mul_1, mpn_addmul_1, and
5149         mpn_submul_1
5150         * tests/devel/mul_1.c: Remove.
5151         * tests/devel/addmul_1.c: Remove.
5152         * tests/devel/submul_1.c: Remove.
5153
5154         * tests/devel/shift.c: New file, handle mpn_lshift and mpn_rshift.
5155         * tests/devel/lshift.c: Remove.
5156         * tests/devel/rshift.c: Remove.
5157
5158         * tests/devel/aors_n.c: New file, handle mpn_add_n and mpn_sub_n.
5159         * tests/devel/add_n.c: Remove.
5160         * tests/devel/sub_n.c: Remove.
5161
5162 2004-10-09  Torbjorn Granlund  <tege@swox.com>
5163
5164         * mpn/powerpc64/linux64.m4: Define DEF_OBJECT, END_OBJECT, and TOCREF.
5165         * mpn/powerpc64/aix.m4: Likewise.
5166         * mpn/powerpc64/mode64/invert_limb.asm: Use DEF_OBJECT, END_OBJECT, and
5167         TOCREF for approx_tab.
5168
5169         * mpn/amd64/mul_1.asm: Add mpn_mul_1c entry point.
5170
5171 2004-10-08  Torbjorn Granlund  <tege@swox.com>
5172
5173         * mpn/powerpc64/copyi.asm: New file.
5174         * mpn/powerpc64/copyd.asm: New file.
5175         * gmp-h.in: Remove PPC MPN_COPY variants.
5176         * gmp-impl.h: Likewise.
5177
5178         * mpn/powerpc64/logops_n.asm: New file.
5179
5180         * mpn/powerpc64/mode64/invert_limb.asm: New file.
5181
5182 2004-10-07  Torbjorn Granlund  <tege@swox.com>
5183
5184         * mpn/powerpc64/mode64/aors_n.asm: New file, optimized for POWER4 and
5185         its derivatives.
5186         * mpn/powerpc64/mode64/add_n.asm: Delete.
5187         * mpn/powerpc64/mode64/sub_n.asm: Delete.
5188
5189         * configfsf.guess: Patch HP-UX code to accommodate HP compiler's new
5190         inability to read from stdin.
5191
5192         * mpn/powerpc64/mode64/addsub_n.asm: Remove accidentally added file.
5193
5194 2004-10-02  Torbjorn Granlund  <tege@swox.com>
5195
5196         * mpn/amd64/README: Update for new developments, fix typos.
5197
5198         * mpn/amd64/mul_1.asm: Tweak addressing (3.25 => 3.0 cycles/limb).
5199
5200         * mpn/amd64/addmul_1.asm: Remove unreachable code block.
5201
5202 2004-09-30  Torbjorn Granlund  <tege@swox.com>
5203
5204         * mpn/amd64/addmul_1.asm: Rewrite, now 3.25 cycles/limb.
5205
5206         * mpn/ia64/addmul_1.asm: Slightly enhance cross-jumping for code
5207         density.
5208         * mpn/ia64/mul_1.asm: Analogous changes.
5209
5210 2004-09-29  Torbjorn Granlund  <tege@swox.com>
5211
5212         * gmp-impl.h (x86 ULONG_PARITY): Work around GCC change of "q" register
5213         flag.
5214
5215 2004-09-28  Torbjorn Granlund  <tege@swox.com>
5216
5217         * mpn/ia64/divrem_1.asm: Add cycle counts to loop.
5218
5219         * mpn/ia64/divrem_2.asm: New file.
5220
5221 2004-09-28  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
5222
5223         * mpn/generic/mul_fft.c (mpn_mul_fft): Fix a bug in the choice of the
5224         recursive fft parameters.
5225
5226 2004-09-20  Torbjorn Granlund  <tege@swox.com>
5227
5228         * tests/misc.c (tests_rand_start): Default to strtoul for re-seeding.
5229
5230         * tests/mpz/t-mul.c (ref_mpn_mul): Fudge tmp allocation for toom3.
5231
5232 2004-09-19  Torbjorn Granlund  <tege@swox.com>
5233
5234         * tests/misc.c (tests_rand_start): Shift tv_usec for better seeding.
5235
5236 2004-09-18  Torbjorn Granlund  <tege@swox.com>
5237
5238         * tests/misc.c (tests_rand_start): Invoke fflush after printing seed.
5239
5240         * tests/mpz/t-mul.c (main): Check environment for GMP_CHECK_FFT, run
5241         extra FFT tests if set.
5242         (ref_mpn_mul): Use library code for kara and toom, but skewded so that
5243         we never use the same algorithm that we're testing.
5244         (mul_kara): Delete.
5245         (debug_mp): Print just one line of large numbers.
5246         (ref_mpn_mul): Rework usage of tp temporary space.
5247
5248 2004-09-15  Torbjorn Granlund  <tege@swox.com>
5249
5250         * mpn/ia64/mul_2.asm: For HAVE_ABI_32, convert vp.
5251         * mpn/ia64/addmul_2.asm: Likewise.
5252
5253 2004-09-13  Torbjorn Granlund  <tege@swox.com>
5254
5255         * mpn/ia64/invert_limb.asm: Rewrite.
5256
5257         * mpn/ia64/logops_n.asm: Insert some more stops.
5258
5259 2004-09-12  Torbjorn Granlund  <tege@swox.com>
5260
5261         * mpn/ia64/gmp-mparam.h: Update.
5262         * mpn/amd64/gmp-mparam.h: Update.
5263
5264         * mpn/ia64/sqr_diagonal.asm: Shave off a few cycles.
5265
5266 2004-09-11  Torbjorn Granlund  <tege@swox.com>
5267
5268         * mpn/ia64/mul_2.asm: New file.
5269         * mpn/ia64/addmul_2.asm: New file.
5270
5271         * mpn/ia64/addmul_1.asm: Tune a cycle from prologue.
5272
5273         * mpn/ia64/lorrshift.asm: Insert stops after several branches.
5274         * mpn/ia64/aorslsh1_n.asm: Likewise.
5275         * mpn/ia64/rsh1aors_n.asm: Likewise.
5276
5277         * mpn/generic/sqr_basecase.c: In variant for HAVE_NATIVE_mpn_addmul_2,
5278         accumulate carry also for when HAVE_NATIVE_mpn_addlsh1_n.
5279
5280 2004-09-07  Torbjorn Granlund  <tege@swox.com>
5281
5282         * mpn/ia64/submul_1.asm: Rewrite.
5283
5284         * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
5285         * mpn/ia64/mul_1.asm: Likewise.
5286
5287 2004-09-02  Torbjorn Granlund  <tege@swox.com>
5288
5289         * mpn/ia64/mul_1.asm: Optimize feed-in code.
5290         * mpn/ia64/addmul_1.asm: Rewrite feed-in code.
5291
5292 2004-08-29  Torbjorn Granlund  <tege@swox.com>
5293
5294         * tests/mpz/t-sizeinbase.c: Disable mpz_fake_bits and check_sample.
5295
5296 2004-07-16  Torbjorn Granlund  <tege@swox.com>
5297
5298         * mpn/ia64/addmul_1.asm: Format to placate HP-UX assembler.
5299
5300 2004-06-17  Kevin Ryde  <kevin@swox.se>
5301
5302         * doc/gmp.texi: Use @. when sentence ends with a capital, for good
5303         spacing in tex.
5304         (Language Bindings): Add gmp-d, reported by Ben Hinkle.  Update SWI
5305         Prolog URL, reported by Jan Wielemaker.
5306
5307 2004-06-09  Torbjorn Granlund  <tege@swox.com>
5308
5309         * configure.in: Handle --enable-fat.  Use that to enable x86 fat
5310         builds, remove magic meaning of i386-*-*.
5311
5312 2004-06-03  Kevin Ryde  <kevin@swox.se>
5313
5314         * gmp-impl.h (memset): Use a local char* pointer, in case parameter is
5315         something else (eg. tune/common.c).  Reported by Emmanuel Thomé.
5316
5317 2004-06-01  Kevin Ryde  <kevin@swox.se>
5318
5319         * config.guess (i?86-*-*): Avoid "Illegal instruction" message which
5320         goes to stdout on 80386 freebsd4.9.
5321
5322 2004-05-23  Niels Möller  <nisse@lysator.liu.se>
5323
5324         * mpn/generic/gcdext.c (gcdext_1_u): New function.
5325         (mpn_gcdext): Use it.
5326
5327 2004-05-23  Torbjorn Granlund  <tege@swox.com>
5328
5329         * mpn/generic/gcdext.c (gcdext_1_odd): Use masking to avoid jumps.
5330
5331 2004-05-22  Torbjorn Granlund  <tege@swox.com>
5332
5333         * mpn/x86/pentium4/sse2/addmul_1.asm: Add Prescott cycle numbers.
5334
5335         * mpn/amd64/divrem_1.asm: Shave a cycle from fraction development code.
5336
5337         * mpn/powerpc32/lshift.asm: Add more cycle numbers.
5338         * mpn/powerpc32/rshift.asm: Likewise.
5339
5340         * mpn/ia64/addmul_1.asm: Reformat.
5341
5342 2004-05-21  Torbjorn Granlund  <tege@swox.com>
5343
5344         * gmp-impl.h (mpn_mullow_n, mpn_mullow_basecase): Declare.
5345
5346         * tune/Makefile.am: Compile gcdext.c.
5347
5348         * gmp-impl.h (GET_STR_THRESHOLD_LIMIT): Lower outrageous value to 150.
5349         (GCDEXT_SCHOENHAGE_THRESHOLD): Set reasonable default.  Override when
5350         TUNE_PROGRAM_BUILD.
5351         (GCDEXT_THRESHOLD): Remove.
5352
5353         * tune/tuneup.c (gcdext_schoenhage_threshold): New variable.
5354         (gcdext_threshold): Remove variable.
5355         (tune_gcd_schoenhage): Lower step_factor to 0.1.
5356         (tune_gcdext_schoenhage): New function, based on tune_gcd_schoenhage.
5357         (tune_gcdext): Remove function.
5358         (all): Corresponding changes.
5359
5360 2004-05-21  Niels Möller  <nisse@lysator.liu.se>
5361
5362         * mpn/generic/gcdext.c: Complete rewrite.  Uses fast Lehmer code for
5363         small operands, and Schoenhage code for large operands.
5364
5365         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Ensure first operand is
5366         not smaller than 2nd operand.
5367
5368 2004-05-17  Kevin Ryde  <kevin@swox.se>
5369
5370         * gmp-h.in (mpz_get_ui): Use #if instead of plain if, and for nails
5371         use ?: same as normal case, to avoid warnings from Borland C++ 6.0.
5372         Reported by delta trinity.
5373
5374 2004-05-15  Kevin Ryde  <kevin@swox.se>
5375
5376         * tune/time.c (getrusage_backwards_p): New function
5377         (speed_time_init): Use it to exclude broken netbsd1.4.1 getrusage.
5378         * configure.in (m68*-*-netbsd1.4*): Remove code pretending getrusage
5379         doesn't exist.
5380         * tune/README (NetBSD 1.4.1 m68k): Update notes.
5381
5382         * configure.in (mips*-*-* ABI=n32): Remove gcc_n32_ldflags and
5383         cc_n32_ldflags, libtool knows to put the linker in n32 mode.
5384
5385 2004-05-15  Torbjorn Granlund  <tege@swox.com>
5386
5387         * config.guess (powerpc*-*-*): Add more processor types to mfpvr code.
5388         * configure.in: Generalize powerpc subtype matching code.
5389
5390         * mpz/fac_ui.c: Misc cleanups, spelling corrections.
5391
5392 2004-05-14  Kevin Ryde  <kevin@swox.se>
5393
5394         * mpf/sub.c: When one operand cancels high limbs of the other, strip
5395         high zeros on the balance before truncating to destination precision.
5396         Truncating first loses accuracy and can lead to a result 0 despite
5397         operands being not equal.  Reported by John Abbott.
5398         Also, ensure exponent is zero when result is zero, for instance if
5399         operands are exactly equal.
5400         * tests/mpf/t-sub.c (check_data): New function, exercising these.
5401
5402 2004-05-12  Kevin Ryde  <kevin@swox.se>
5403
5404         * configure.in (AC_PROG_RANLIB): New macro, supposedly required by
5405         automake, though it doesn't complain.
5406
5407         * demos/expr/Makefile.am (ARFLAGS): Add a default setting, to
5408         workaround an automake bug.
5409
5410 2004-05-10  Kevin Ryde  <kevin@swox.se>
5411
5412         * */Makefile.in, install-sh, aclocal.m4: Update to automake 1.8.4.
5413
5414         * doc/gmp.texi (Demonstration Programs): Add a remark about expression
5415         evaluation in the main gmp library.
5416
5417         * demos/expr/exprfa.c (mpf_expr_a): Correction to mpX_init, use
5418         mpf_init2 to follow requested precision.
5419         * demos/expr/exprza.c, demos/expr/exprqa.c: Use wrappers for mpX_init,
5420         to make parameters match.
5421
5422         * demos/expr/run-expr.c: Don't use getopt, to avoid needing configury
5423         for optarg declaration.  Remove TRY macro, rename foo and bar to var_a
5424         and var_b, for clarity.
5425         * demos/expr/expr-impl.h: Don't use expr-config.h.
5426         * configure.in (demos/expr/expr-config.h): Remove.
5427         * demos/expr/expr-config.in: Remove file.
5428
5429 2004-05-08  Kevin Ryde  <kevin@swox.se>
5430
5431         * doc/configuration (Configure): Update for current automake not
5432         copying acinclude.m4 into aclocal.m4.
5433
5434         * configure.in, Makefile.am, doc/gmp.texi, doc/configuration,
5435         tests/cxx/Makefile.am, demos/expr/Makefile.am, demos/expr/README,
5436         demos/expr/expr.c, demos/expr/expr.h, demos/expr/expr-config-h.in,
5437         demos/expr/expr-impl.h, demos/expr/run-expr.c, demos/expr/t-expr.c:
5438         MPFR now published separately, remove various bits.
5439         * mpfr/*, tests/cxx/t-headfr.cc, demos/expr/exprfr.c,
5440         demos/expr/exprfra.c: Remove.
5441
5442 2004-05-07  Kevin Ryde  <kevin@swox.se>
5443
5444         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Amend c++ shared library
5445         path hack, on k62-unknown-dragonfly1.0 /usr/bin/make runs its commands
5446         "set -e", so we need an "|| true" in case there's nothing to copy (for
5447         instance in a static build).
5448
5449 2004-05-06  Kevin Ryde  <kevin@swox.se>
5450
5451         * mpn/alpha/mode1o.c: Remove, in favour of ...
5452         * mpn/alpha/mode1o.asm: New file.
5453         * mpn/alpha/alpha-defs.m4 (bwx_available_p): New macro.
5454
5455         * tune/amd64.asm: Save rbx in r10 rather than on the stack.
5456
5457         * configure.in (x86_64-*-*): Try also "-march=k8 -mno-sse2", in case
5458         we're in ABI=32 on an old OS not supporting xmm regs.
5459         (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): Run these tests under
5460         -march=k8 too, and not under ABI=64.
5461
5462         * doc/gmp.texi (Converting Integers): For mpz_get_d, note truncation
5463         and overflows.  For mpz_get_d_2exp note truncation, note result if
5464         OP==0, and cross reference libc frexp.
5465         (Rational Conversions): For mpq_get_d, note truncation and overflows.
5466         (Converting Floats): For mpf_get_d, note truncation and overflows.
5467         For mpf_get_d_2exp, note truncation, note result if OP==0.
5468         (Assembler Code Organisation): Note nails subdirectories.
5469         Clarification of get_d_2exp OP==0 reported by Sylvain Pion.
5470
5471 2004-05-05  Torbjorn Granlund  <tege@swox.com>
5472
5473         * mpn/generic/mullow_n.c, mpn/generic/mullow_basecase.c: New files
5474         (mainly by Niels Möller).
5475         * configure.in, mpn/Makefile.am: Add them.
5476
5477         * gmp-impl.h (MULLOW_BASECASE_THRESHOLD, MULLOW_DC_THRESHOLD,
5478         MULLOW_MUL_N_THRESHOLD): Override for TUNE_PROGRAM_BUILD.
5479
5480         * tune/Makefile.am: Compile mullow_n.c.
5481         * tune/common.c (speed_mpn_mullow_n, speed_mpn_mullow_basecase):
5482         New functions.
5483         * tune/speed.c (routine): Add entries for mpn_mullow_n and
5484         mpn_mullow_basecase.
5485         * tune/speed.h (SPEED_ROUTINE_MPN_MULLOW_N_CALL,
5486         SPEED_ROUTINE_MPN_MULLOW_BASECASE): New #defines.
5487         * tune/tuneup.c (tune_mullow): New function.
5488
5489         * gmp-impl.h (invert_limb): Compute branch-freely.
5490
5491 2004-05-02  Kevin Ryde  <kevin@swox.se>
5492
5493         * mpn/amd64/mode1o.asm: Use movabsq to support large model non-PIC.
5494         Use 32-bit insns to save code bytes, and to save a couple of cycles on
5495         the initial setup multiplies.
5496
5497 2004-05-01  Kevin Ryde  <kevin@swox.se>
5498
5499         * doc/gmp.texi (References): Update gcc online docs url to
5500         gcc.gnu.org.
5501
5502         * configure.in (mips*-*-irix[6789]*): Correction to m4 quoting of this
5503         pattern.  (Believe the mips64*-*-* part also used picks up all current
5504         irix6 tuples anyway.)  Reported by Rainer Orth.
5505
5506 2004-04-30  Kevin Ryde  <kevin@swox.se>
5507
5508         * acinclude.m4 (GMP_PROG_CC_X86_GOT_EAX_EMITTED,
5509         GMP_ASM_X86_GOT_EAX_OK): New macros.
5510         (GMP_PROG_CC_WORKS): Use them to detect an old gas bug tickled by
5511         recent gcc.  Reported by David Newman.
5512
5513         * doc/gmp.texi (Reentrancy): Note also gmp_randinit_default as an
5514         alternative to gmp_randinit.
5515
5516 2004-04-29  Torbjorn Granlund  <tege@swox.com>
5517
5518         * configfsf.guess: Update to 2004-03-12.
5519         * configfsf.sub: Likewise.
5520
5521 2004-04-27  Torbjorn Granlund  <tege@swox.com>
5522
5523         * mpz/rrandomb.c (gmp_rrandomb): Rework to avoid extra limb allocation
5524         and to generate even numbers.
5525         * mpn/generic/random2.c (gmp_rrandomb): Likewise.
5526
5527 2004-04-25  Kevin Ryde  <kevin@swox.se>
5528
5529         * gmp-impl.h (FORCE_DOUBLE): Don't use an asm with a match constraint
5530         on a memory output, apparently not supported and provokes a warning
5531         from gcc 3.4.
5532
5533 2004-04-24  Kevin Ryde  <kevin@swox.se>
5534
5535         * longlong.h (count_leading_zeros_gcc_clz,
5536         count_trailing_zeros_gcc_ctz): New macros.
5537         (count_leading_zeros, count_trailing_zeros) [x86]: Use them on gcc
5538         3.4.
5539
5540         * configure.in (x86-*-* gcc_cflags_cpu): Give a -mtune at the start of
5541         each option list, for use by gcc 3.4 to avoid deprecation warnings
5542         about -mcpu.
5543
5544         * mpz/aorsmul.c, mpz/aorsmul_i.c, mpz/cfdiv_q_2exp.c,
5545         mpz/cfdiv_r_2exp.c, mpq/aors.c, mpf/ceilfloor.c: Give REGPARM_ATTR()
5546         on function definition too, as demanded by gcc 3.4.
5547
5548 2004-04-22  Kevin Ryde  <kevin@swox.se>
5549
5550         * tests/rand/t-lc2exp.c (check_bigc1): New test.
5551
5552         * doc/fdl.texi: Tweak @appendixsubsec -> @appendixsec to match our
5553         preference for this in an @appendix, and because texi2pdf doesn't
5554         support @appendixsubsec directly within an @appendix.
5555
5556 2004-04-20  Kevin Ryde  <kevin@swox.se>
5557
5558         * doc/texinfo.tex: Update to 2004-04-07.08 from texinfo 4.7.
5559         * doc/gmp.texi, mpfr/mpfr.texi (@copying): Don't put a line break in
5560         @ref within @copying, recent texinfo.tex doesn't like that.
5561
5562         * demos/perl/GMP.xs (static_functable): Treat cygwin the same as mingw
5563         DLLs.
5564
5565         * */Makefile.in, install-sh: Update to automake 1.8.3.
5566         * ltmain.sh, aclocal.m4, configure: Update to libtool 1.5.6.
5567
5568         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): Use a compile-time constant
5569         expression, rather than a configure test.
5570         * acinclude.m4, configure.in (GMP_C_RIGHT_SHIFT): Remove, no longer
5571         needed.
5572         * tests/t-hightomask.c: New file.
5573         * tests/Makefile.am (check_PROGRAMS): Add it.
5574
5575         * macos/configure (parse_top_configure): Look for PACKAGE_NAME and
5576         PACKAGE_VERSION now used by autoconf.
5577         (what_objects): Only demand 9 object files, as for instance occurs in
5578         the scanf directory.
5579         (asm files): Transform labels L(foo) -> Lfoo.  Take func name from
5580         PROLOGUE to support empty "EPILOGUE()".  Recognise and substitute
5581         register name "define()"s.
5582         * macos/Makefile.in (CmnObjs): Add tal-notreent.o.
5583
5584 2004-04-19  Torbjorn Granlund  <tege@swox.com>
5585
5586         * tune/speed.h (SPEED_ROUTINE_MPN_ROOTREM): New #define.
5587         (speed_mpn_rootrem): Declare.
5588         * tune/common.c (speed_mpn_rootrem): New function.
5589         * tune/speed.c (routine): Add entry for mpn_rootrem.
5590
5591 2004-04-16  Kevin Ryde  <kevin@swox.se>
5592
5593         * doc/fdl.texi: Update from FSF, just fixing a couple of typos.
5594
5595         * macos/configure, macos/Makefile.in: Add printf and scanf directories.
5596
5597         * tests/mpz/t-gcd.c (check_data): New function, exercising K6
5598         gcd_finda bug.
5599
5600 2004-04-14  Kevin Ryde  <kevin@swox.se>
5601
5602         * doc/gmp.texi (Reentrancy, Random State Initialization): Note
5603         gmp_randinit use of gmp_errno is not thread safe.  Reported by Vincent
5604         Lefèvre.
5605
5606         * doc/gmp.texi (Random State Initialization): Add index entries for
5607         gmp_errno and constants.
5608
5609         * mpn/m68k/README: Update _SHORT_LIMB -> __GMP_SHORT_LIMB.
5610
5611         * configure.in (--enable-mpbsd): Typo Berkley -> Berkeley in help msg.
5612
5613 2004-04-12  Kevin Ryde  <kevin@swox.se>
5614
5615         * demos/perl/GMP.xs (static_functable): New macro, use it for all
5616         function tables, to support mingw DLL builds.
5617         * demos/perl/INSTALL (NOTES FOR PARTICULAR SYSTEMS): Remove note on
5618         DLLs, should be ok now.
5619
5620         * demos/perl/sample.pl: Print the module and library versions in use.
5621
5622         * demos/perl/GMP.pm, Makefile.PL (VERSION): Set to '2.00'.
5623         * demos/perl/GMP.pm (COPYRIGHT): New in the doc section.
5624
5625         * Makefile.am: Note 4.1.3 libtool versioning info, and REVISION policy.
5626
5627         * tal-debug.c: Add <stdlib.h> for abort.
5628
5629 2004-04-07  Torbjorn Granlund  <tege@swox.com>
5630
5631         * tests/refmpf.c (refmpf_add_ulp): Adjust exponent when needed.
5632
5633         * mpn/generic/random2.c: Rewrite (clone mpz/rrandomb.c).
5634
5635 2004-04-07  Kevin Ryde  <kevin@swox.se>
5636
5637         * mpn/x86/k6/gcd_finda.asm: Correction jbe -> jb in initial setups.
5638         Zero flag is wrong here, it relects only the high limb of the compare,
5639         leading to n1>=n2 not satisfied and wrong results.  cp[1]==0x7FFFFFFF
5640         with cp[0]>=0x80000001 provokes this.
5641
5642         * doc/gmp.texi (BSD Compatible Functions): Note "pow" name clash under
5643         the pow function description too.
5644         (Language Bindings): Add XEmacs (betas at this stage).  Reported by
5645         Jerry James.
5646
5647         * tests/refmpn.c (refmpn_mod2): Correction to ASSERTs, r==a is allowed.
5648
5649         * gen-psqr.c (generate_mod): Cast mpz_invert_ui_2exp args, for K&R.
5650         * gen-bases.c, gen-fib.c, gen-psqr.c: For mpz_out_str, use stdout
5651         instead of 0, in case a K&R treats int and FILE* params differently.
5652
5653 2004-04-04  Kevin Ryde  <kevin@swox.se>
5654
5655         * gmp-impl.h (BSWAP_LIMB) [amd64]: New macro.
5656         (FORCE_DOUBLE): Use this for amd64 too.
5657
5658         * tests/amd64check.c, tests/amd64call.asm: New files, derived in part
5659         from x86check.c and x86call.asm.
5660         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Add them.
5661         * configure.in (x86_64-*-* ABI=64): Use them.
5662
5663 2004-04-03  Kevin Ryde  <kevin@swox.se>
5664
5665         * mpn/amd64/mode1o.asm: New file.
5666         * mpn/amd64/amd64-defs.m4 (ASSERT): New macro.
5667
5668         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/pentium4/sse2/divrem_1.asm: Add
5669         note on how "dr" part of algorithm is handled.
5670
5671         * mpn/x86/k7/dive_1.asm, mpn/x86/k7/mod_34lsub1.asm,
5672         mpn/x86/k7/mode1o.asm: Note Hammer (32-bit mode) speeds.
5673
5674 2004-03-31  Kevin Ryde  <kevin@swox.se>
5675
5676         * doc/gmp.texi (Language Bindings): Add GOO, MLGMP and Numerix.
5677
5678         * mpf/mul_2exp.c, mpf/div_2exp.c: Rate u==0 as UNLIKELY.
5679
5680 2004-03-28  Torbjorn Granlund  <tege@swox.com>
5681
5682         * mpn/amd64/divrem_1.asm: Trim a few cycles.
5683
5684 2004-03-27  Torbjorn Granlund  <tege@swox.com>
5685
5686         * mpn/amd64/sublsh1_n.asm: Fix typo.
5687
5688         * mpn/generic/divrem_1.c: Fix typo.
5689
5690         * mpn/generic/sqr_basecase.c: Fix typo.
5691
5692         * mpn/amd64/divrem_1.asm: New file.
5693
5694 2004-03-20  Kevin Ryde  <kevin@swox.se>
5695
5696         * longlong.h (power, powerpc): Add comments on how we select this code.
5697
5698         * gmp-h.in (mpz_get_ui): Use ?: instead of mask style, gcc treats the
5699         two identically but ?: is a bit clearer.
5700
5701         * insert-dbl.c: Remove file, no longer used, scaling is now integrated
5702         in mpn_get_d.
5703         * Makefile.am (libgmp_la_SOURCES): Remove insert-dbl.c.
5704         * gmp-impl.h (__gmp_scale2): Remove prototype.
5705
5706 2004-03-17  Kevin Ryde  <kevin@swox.se>
5707
5708         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init, fake_cpuid_table): Add x86_64.
5709
5710         * mpq/get_d.c: Use mpn_tdiv_qr, demand den>0 per canonical form.
5711
5712 2004-03-16  Torbjorn Granlund  <tege@swox.com>
5713
5714         * mpn/generic/sqr_basecase.c: Add versions using mpn_addmul_2 and
5715         mpn_addmul_2s.
5716
5717 2004-03-14  Kevin Ryde  <kevin@swox.se>
5718
5719         * mpf/mul_ui.c: Incorporate carry from low limbs, for exactness.
5720         * tests/mpf/t-mul_ui.c: New file.
5721         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5722
5723         * mpf/div.c: Use mpn_tdiv_qr.  Use just one TMP_ALLOC.  Use full
5724         divisor, since truncating can lose accuracy.
5725         * tests/mpf/t-div.c: New file.
5726         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5727
5728         * tests/mpf/t-set_q.c, tests/mpf/t-ui_div.c (check_various): Amend
5729         bogus 99/4 test.
5730         * tests/mpf/t-ui_div.c (check_rand): Exercise r==v overlap.
5731
5732         * tests/refmpf.c, tests/tests.h (refmpf_set_overlap): New function.
5733
5734         * mpf/cmp_si.c [nails]: Correction, cast vval in exp comparisons, for
5735         when vval=-0x800..00 and limb==longlong.
5736
5737         * mpf/cmp_si.c [nails]: Correction, return usign instead of 1 when
5738         uexp==2 but value bigger than an mp_limb_t.
5739         * tests/mpf/t-cmp_si.c (check_data): Add test cases.
5740
5741         * tests/trace.c (mpf_trace): Use ABS(mp_trace_base) to allow for
5742         negative bases used for upper case hex in integer traces.
5743
5744 2004-03-12  Torbjorn Granlund  <tege@swox.com>
5745
5746         * mpn/generic/sb_divrem_mn.c: Correct header comment.
5747
5748 2004-03-11  Kevin Ryde  <kevin@swox.se>
5749
5750         * aclocal.m4, configure, ltmain.sh: Downgrade to libtool 1.5, version
5751         1.5.2 doesn't remove .libs/*.a files when rebuilding, which is bad for
5752         development when changing contents or with duplicate named files like
5753         we have.
5754
5755         Revert this, ie restore AR_FLAGS=cq:
5756         * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
5757         does this itself on detecting duplicate object filenames in piecewise
5758         linking mode.
5759
5760         * randbui.c, randmui.c [longlong+nails]: Correction to conditionals
5761         for second limb.
5762
5763         * mpz/aors_ui.h, mpz/cdiv_q_ui.c, mpz/cdiv_qr_ui.c, mpz/cdiv_r_ui.c,
5764         mpz/cdiv_ui.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr_ui.c, mpz/fdiv_r_ui.c,
5765         mpz/fdiv_ui.c, mpz/gcd_ui.c, mpz/iset_ui.c, mpz/lcm_ui.c,
5766         mpz/set_ui.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr_ui.c, mpz/tdiv_r_ui.c,
5767         mpz/tdiv_ui.c, mpz/ui_sub.c, mpf/div_ui.c, mpf/mul_ui.c
5768         [longlong+nails]: Amend #if to avoid warnings about shift amount.
5769
5770 2004-03-07  Kevin Ryde  <kevin@swox.se>
5771
5772         * mpf/reldiff.c: Use rprec+ysize limbs for d, to ensure accurate
5773         result.  Inline mpf_abs(d,d) and mpf_cmp_ui(x,0), and rate the latter
5774         UNLIKELY.
5775
5776         * mpf/ui_div.c: Use mpn_tdiv_qr.  Use just one TMP_ALLOC.  Use full
5777         divisor, since truncating can lose accuracy.
5778         * tests/mpf/t-ui_div.c: New file.
5779         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5780
5781         * mpf/set_q.c: Expand TMP_ALLOC_LIMBS_2, to make conditional clearer
5782         and avoid 1 limb alloc when not wanted.
5783
5784         * gmp-impl.h (WANT_TMP_DEBUG): Define to 0 if not defined.
5785         (TMP_ALLOC_LIMBS_2): Use "if" within macro rather than "#if", for less
5786         preprocessor conditionals.
5787
5788         * mpf/mul_2exp.c, mpf/div_2exp.c: Add some comments.
5789
5790         * tests/refmpn.c (refmpn_sb_divrem_mn, refmpn_tdiv_qr): Nailify.
5791
5792 2004-03-04  Kevin Ryde  <kevin@swox.se>
5793
5794         * gen-psqr.c (print): Add CNST_LIMB in PERFSQR_MOD_TEST, for benefit
5795         of K&R.
5796         * tests/mpn/t-perfsqr.c (PERFSQR_MOD_1): Use CNST_LIMB for K&R.
5797
5798         * doc/configuration (Configure): Remove mkinstalldirs, no longer used.
5799
5800         * acinclude.m4 (GMP_PROG_AR): Remove AR_FLAGS=cq, libtool 1.5.2 now
5801         does this itself on detecting duplicate object filenames in piecewise
5802         linking mode.
5803
5804         * configure.in (hppa2.0*-*-*): Test sizeof(long) == 4 or 8 to verify
5805         ABI=2.0n versus ABI=2.0w.  In particular this lets CC=cc_bundled
5806         correctly fall back to ABI=2.0n (we don't automatically add CC=+DD64
5807         to that compiler, currently).
5808
5809         * doc/gmp.texi (Reentrancy): Note C++ mpf_class constructors using
5810         global default precision.
5811         (Random State Miscellaneous): Describe gmp_urandomb_ui as giving N
5812         bits.
5813         (C++ Interface Floats): Describe operator= copying the value, not the
5814         precision, and what this can mean about copy constructor versus
5815         default constructor plus assignment.
5816
5817         * mpf/set_q.c: Use mpn_tdiv_qr rather than mpn_divrem, so no shifting.
5818         Don't truncate the divisor, it can make the result inaccurate.
5819         * tests/mpf/t-set_q.c: New file.
5820         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5821
5822         * mpf/set.c: Use MPN_COPY_INCR, in case r==u and ABSIZ(u) > PREC(r)+1.
5823         No actual bug here, because MPN_COPY has thusfar been an alias for
5824         MPN_COPY_INCR, only an ASSERT failure.
5825         * tests/mpf/t-set.c: New file.
5826         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5827
5828         * mpf/set.c, mpf/iset.c: Do MPN_COPY last, for possible tail call.
5829
5830         * mpf/set_d.c: Rate d==0 as UNLIKELY.  Store size before extract call,
5831         to shorten lifespan of "negative".
5832
5833         * mpf/init.c, mpf/init2.c, mpf/iset_d.c, mpf/iset_si.c,
5834         mpf/iset_str.c, mpf/iset_ui.c: Store prec before alloc call, for one
5835         less live quantity across that call.
5836         * mpf/init.c, mpf/init2.c, mpf/iset_str.c: Store size and exp before
5837         alloc call, to overlap with other operations.
5838
5839         * tests/refmpf.c, tests/tests.h (refmpf_fill, refmpf_normalize,
5840         refmpf_validate, refmpf_validate_division): New functions.
5841
5842         * tests/refmpn.c, tests/tests.h (refmpn_copy_extend,
5843         refmpn_lshift_or_copy_any, refmpn_rshift_or_copy_any): New functions.
5844
5845         * tal-debug.c: Add <string.h> for strcmp.
5846
5847         * tests/cxx/t-istream.cc (check_mpz, check_mpq, check_mpf): Use size_t
5848         for loop index, to quieten g++ warning.
5849
5850 2004-03-02  Kevin Ryde  <kevin@swox.se>
5851
5852         * tests/mpn/t-hgcd.c: Use __GMP_PROTO on prototypes.
5853
5854 2004-03-01  Torbjorn Granlund  <tege@swox.com>
5855
5856         With Karl Hasselström:
5857         * mpn/generic/dc_divrem_n.c (mpn_dc_div_2_by_1): New function, with
5858         meat from old mpn_dc_divrem_n.  Accept scratch parameter.  Rewrite to
5859         avoid a recursive call.
5860         (mpn_dc_div_3_by_2): New function, with meat from old
5861         mpn_dc_div_3_halves_by_2.  Accept scratch parameter.
5862         (mpn_dc_divrem_n): Now just allocate scratch space and call new
5863         mpn_dc_div_2_by_1.
5864
5865 2004-02-29  Kevin Ryde  <kevin@swox.se>
5866
5867         * longlong.h (count_leading_zeros) [alpha gcc]: New version, inlining
5868         mpn/alpha/cntlz.asm cmpbge technique.
5869
5870         * aclocal.m4, configure, install-sh, missing, ltmain.sh,
5871         */Makefile.in: Update to automake 1.8.2 and libtool 1.5.2.
5872
5873         * doc/gmp.texi (C++ Interface Integers): Note / and % rounding follows
5874         C99 / and %.
5875         (Exact Remainder): Index entries for divisibility testing algorithm.
5876
5877         * tune/time.c (speed_endtime): Return 0.0 for negative time measured.
5878         Revise usage comments for clarity.
5879         * tune/common.c (speed_measure): Recognise speed_endtime 0.0 for
5880         failed measurement.
5881
5882         * tests/mpn/t-get_d.c (check_rand): Correction to nhigh_mask setup.
5883
5884 2004-02-27  Torbjorn Granlund  <tege@swox.com>
5885
5886         * tune/tuneup.c (tune_dc, tune_set_str): Up param.step_factor.
5887
5888         * tests/mpz/t-gcd.c: Decrease # of tests to 50.
5889
5890 2004-02-27  Kevin Ryde  <kevin@swox.se>
5891
5892         * tests/devel/try.c: Add a comment that this is not for Cray systems.
5893
5894         * mpf/set_q.c: Don't support den(q)<0, demand canonical form in the
5895         usual way.
5896
5897 2004-02-24  Torbjorn Granlund  <tege@swox.com>
5898
5899         From Kevin:
5900         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Loop until normalization
5901         criterion met.
5902
5903 2004-02-22  Kevin Ryde  <kevin@swox.se>
5904
5905         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_OS_X86_XMM, GMP_PROG_CXX_WORKS):
5906         Remove files that might look like compiler output, so our "||"
5907         alternatives are not fooled.
5908
5909         * acinclude.m4 (GMP_PROG_CC_WORKS): Add test for lshift_com code
5910         mis-compiled by certain IA-64 HP cc at +O3.
5911
5912         * gmp-impl.h (USE_LEADING_REGPARM): Disable under prof or gprof, for
5913         the benefit of freebsd where .mcount clobbers registers.  Spotted by
5914         Torbjorn.
5915         * configure.in (WANT_PROFILING_PROF, WANT_PROFILING_GPROF): New
5916         AC_DEFINEs.
5917
5918 2004-02-21  Kevin Ryde  <kevin@swox.se>
5919
5920         * configure.in (sparc64-*-*bsd*): Amend -m32 setup for ABI=32, so it's
5921         not used in ABI=64 on the BSD systems.
5922
5923 2004-02-18  Niels Möller  <nisse@lysator.liu.se>
5924
5925         * tests/mpz/t-gcd.c (gcdext_valid_p): New function.
5926         (ref_mpz_gcd): Deleted function.
5927         (one_test): Rearranged to call mpz_gcdext first, so that the
5928         returned value can be validated.
5929         (main): Don't use ref_mpz_gcd.
5930
5931 2004-02-18  Torbjorn Granlund  <tege@swox.com>
5932
5933         * gmp-impl.h (MPN_TOOM3_MAX_N): Move to !WANT_FFT section.
5934
5935         * tests/mpz/t-mul.c: Exclude special huge operands unless WANT_FFT.
5936
5937         * mpz/rrandomb.c (gmp_rrandomb): Rewrite.
5938
5939         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Remove write-only variable c5.
5940
5941 2004-02-18  Kevin Ryde  <kevin@swox.se>
5942
5943         * mpf/iset_si.c, mpf/iset_ui.c, mpf/set_si.c, mpf/set_ui.c [nails]:
5944         Always store second limb, to avoid a conditional.
5945
5946         * tests/mpf/t-get_ui.c: New file.
5947         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
5948         * tests/mpf/t-get_si.c (check_limbdata): Further tests.
5949         * gmp-impl.h (MP_EXP_T_MAX, MP_EXP_T_MIN): New defines.
5950
5951         * mpf/get_ui.c, mpf/get_si.c: Remove size==0 test, it's covered by
5952         other conditions.  Attempt greater clarity by expressing conditions as
5953         based on available data range.
5954         * mpf/get_si.c [nails]: Correction, don't bail on exp > abs_size,
5955         since may still have second limb above radix point available.
5956         * mpf/get_ui.c: Nailify.
5957
5958 2004-02-16  Kevin Ryde  <kevin@swox.se>
5959
5960         * mpz/scan0.c, mpz/scan1.c: Use count_trailing_zeros, instead of
5961         count_leading_zeros on limb&-limb.
5962
5963         * mpf/sqrt.c: Use "/ 2" for exp, avoiding C undefined behaviour on
5964         ">>" of negatives.  Correction to comment, exp is rounded upwards.
5965         SIZ(r) always prec now, no need for tsize expression.  Store EXP(r)
5966         and SIZ(r) where calculated to reduce variable lifespans.  Make tsize
5967         mp_size_t not mp_exp_t, though of course those are currently the same.
5968
5969         * gmp-h.in (GMP_ERROR_ALLOCATE, GMP_ERROR_BAD_STRING,
5970         GMP_ERROR_UNUSED_ERROR): Remove, never used or documented, and we
5971         don't want to use globals for communicating error information.
5972
5973         * mpz/gcd_ui.c [nails]: Correction, actually return a value.
5974
5975         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails==1]: Add code.
5976
5977 2004-02-15  Kevin Ryde  <kevin@swox.se>
5978
5979         * tests/mpz/t-jac.c (check_data): Remove unnecessary variable
5980         "answer".
5981
5982 2004-02-14  Torbjorn Granlund  <tege@swox.com>
5983
5984         * mpn/ia64/aors_n.asm: Break a group with a RAW conflict.
5985
5986 2004-02-14  Kevin Ryde  <kevin@swox.se>
5987
5988         * acinclude.m4 (GMP_C_RIGHT_SHIFT): Note that it's "long"s which we're
5989         concerned about.
5990
5991         * mpn/generic/mul_n.c: Add some remarks about toom3 high zero
5992         stripping.
5993
5994         * mpn/generic/scan0.c, mpn/generic/scan1.c: Remove design issue
5995         remarks.  What to do about going outside `up' space is a problem, but
5996         anything to address it would be an incompatible change.
5997
5998 2004-02-12  Torbjorn Granlund  <tege@swox.com>
5999
6000         * tests/mpn/t-hgcd.c: Remove unused variables.
6001
6002         * mpn/ia64/hamdist.asm: Remove bundling incompatible with HP-UX
6003         assembler.  Misc HP-UX changes.
6004         * mpn/ia64/gcd_1.asm: Add some syntax to placid the HP-UX assembler.
6005
6006 2004-02-11  Kevin Ryde  <kevin@swox.se>
6007
6008         * longlong.h (power, powerpc): Use HAVE_HOST_CPU_FAMILY_power and
6009         HAVE_HOST_CPU_FAMILY_powerpc rather than various cpp defines.
6010
6011         * gmp-impl.h: Add remarks about limits.h and Cray etc.
6012
6013         * mpn/ia64/mul_1.asm: Don't put .pred directives on labelled lines,
6014         hpux 11.23 assembler doesn't like that.
6015         * mpn/ia64/README: Add a note on this.
6016
6017         * dumbmp.c (mpz_mul): Set ALLOC(r) for new data block used.  Reported
6018         by Jason Moxham.
6019
6020         * mpn/pa32/README, mpn/pa64/README (REFERENCES): New sections.
6021
6022 2004-02-10  Torbjorn Granlund  <tege@swox.com>
6023
6024         * tests/mpz/t-gcd.c: Decrease # of tests run.
6025
6026         * mpn/*/gmp-mparam.h: Add HGCD values, update TOOM values.
6027
6028 2004-02-01  Torbjorn Granlund  <tege@swox.com>
6029
6030         From Kevin:
6031         * config.guess: Recognize AMD's hammer processors, return x86_64.
6032
6033 2004-01-31  Niels Möller  <nisse@lysator.liu.se>
6034
6035         * mpn/generic/hgcd.c (mpn_cmp_sum3): Declare static.
6036
6037 2004-01-25  Niels Möller  <nisse@lysator.liu.se>
6038
6039         * tests/mpn/Makefile.am (check_PROGRAMS): Add t-hgcd.
6040
6041         * mpn/generic/hgcd.c (hgcd_jebelean): Simplify, use mpn_cmp_sum3.
6042         (mpn_cmp_sum3): New function.
6043         (mpn_diff_smaller_p): Remove.
6044         (hgcd_final, hgcd_jebelean, hgcd_small_1, hgcd_small_2, euclid_step):
6045         Remove tp,talloc arguments.  Callers changed.
6046
6047 2004-01-25  Torbjorn Granlund  <tege@swox.com>
6048
6049         * tune/tuneup.c (all): Reenable calls of tune_gcd_schoenhage and
6050         tune_hgcd.
6051
6052         * mpn/generic/gcd.c: Reenable Schoenhage code.
6053
6054         With Niels Möller:
6055         * mpn/generic/hgcd.c: Add const and inline to several functions.
6056         (qstack_push_start qstack_push_end qstack_push_quotient): Remove.
6057         (euclid_step): Insert removed functions here.
6058         (hgcd_adjust): Simplify, don't handle d != 1.
6059         (qstack_adjust): Corresponding changes.
6060         (mpn_hgcd2_lehmer_step): Remove redundant tests for bh against zero.
6061         (hgcd_start_row_p): Tweak.
6062         (hgcd_final): Shorten life of ralloc.
6063
6064 2004-01-24  Kevin Ryde  <kevin@swox.se>
6065
6066         * tests/mpf/t-sqrt.c (check_rand1): Further diagnostic printouts.
6067
6068         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Add ASSERT_MPN.
6069         (mpn_dc_sqrtrem): Add casts for K&R.
6070
6071         * mpf/sqrt_ui.c: Nailify.
6072
6073         * mpf/set_z.c: Do MPN_COPY last, for possible tail call.
6074
6075         * doc/gmp.texi (Miscellaneous Float Functions): For mpf_random2, note
6076         exponent is in limbs.
6077
6078         * mpn/ia64/README: Add remark about concentrating on itanium-2.
6079
6080 2004-01-22  Kevin Ryde  <kevin@swox.se>
6081
6082         * mpf/sqrt.c: Change tsize calculation to get prec limbs result
6083         always, previously got prec+1 when exp was odd.
6084         * tests/mpf/t-sqrt.c (check_rand1): New function, code from main.
6085         (check_rand2): New function.
6086
6087         * mpf/sqrt_ui.c: Change rsize calculation to get prec limbs result,
6088         previously got prec+1.
6089         * tests/mpf/t-sqrt_ui.c: New file.
6090         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
6091
6092         * tests/refmpf.c, tests/tests.h (refmpf_add_ulp,
6093         refmpf_set_prec_limbs): New functions.
6094
6095         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Remove x86+m68k force to double,
6096         mpn_get_d now does this.  Remove res==1.0 check for round upwards,
6097         mpn_get_d now rounds towards zero.  Move exp store to make mpn_get_d a
6098         tail call.
6099
6100         * configure.in (x86-*-*): Use ABI=32 rather than ABI=standard.
6101         Use gcc -m32 when available, to force mode on bi-arch amd64 gcc.
6102         * configure.in, acinclude.m4 (x86_64-*-*): Merge into plain x86 setups
6103         as ABI=64.  Support ABI=32, using athlon code.  Use gcc -mcpu=k8,
6104         -march=k8.
6105         (amd64-*-*): Remove pattern, config.sub only gives x86_64.
6106         * doc/gmp.texi (ABI and ISA): Add x86_64 dual ABIs.
6107
6108         * mpn/amd64/README: Add reference to ABI spec.
6109
6110 2004-01-17  Niels Möller  <nisse@lysator.liu.se>
6111
6112         * mpn/generic/hgcd.c (hgcd_adjust): Backed out mpn_addlsh1_n
6113         change for now.
6114
6115         * mpn/generic/hgcd.c (hgcd_adjust): Fixed calls of mpn_addlsh1_n.
6116
6117 2004-01-17  Kevin Ryde  <kevin@swox.se>
6118
6119         * tune/README: Remove open/mpn versions of toom3, no longer exist.
6120         * tune/powerpc64.asm: Remove unused L(again).
6121         * tune/time.c (mftb): Note single mftb possible for powerpc64.
6122
6123         * mpn/generic/mode1o.c: Use "c<s" to do underflow detection in last
6124         step, for better parallelism.
6125
6126         * mpn/generic/get_d.c: Preserve comments about hppa fcnv,udw,dbl from
6127         previous mpz_get_d code.
6128
6129         * tune/freq.c: Add some comments about systems not covered.
6130
6131         * gmp-h.in (_GMP_H_HAVE_FILE): Add _MSL_STDIO_H for Metrowerks.
6132         Reported by Tomas Zahradnicky.
6133
6134 2004-01-16  Niels Möller  <nisse@lysator.liu.se>
6135
6136         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use MPN_DECR_U.
6137         (hgcd_adjust): Use mpn_addlsh1_n when available.
6138
6139 2004-01-16  Kevin Ryde  <kevin@swox.se>
6140
6141         * configure.in (powerpc64-*-linux*): Try gcc64.  Try -m64 with
6142         "cflags_maybe" to get it used in all probing.  Add sizeof-long-8 test
6143         to check the mode is right if -m64 is not applicable.
6144
6145 2004-01-15  Kevin Ryde  <kevin@swox.se>
6146
6147         * configure.in (--with-readline=detect): Check for readline/readline.h
6148         and readline/history.h.  Report result of detection.
6149
6150 2004-01-14  Niels Möller  <nisse@lysator.liu.se>
6151
6152         * tune/speed.c (routine): Disabled speed_mpn_hgcd_lehmer.
6153         * tune/common.c (speed_mpn_hgcd_lehmer): Disabled function.
6154
6155         * mpn/generic/hgcd.c (mpn_hgcd_lehmer_itch, mpn_hgcd_lehmer)
6156         (mpn_hgcd_equal): Deleted functions.
6157
6158         * mpn/generic/gcd.c (hgcd_start_row_p): Deleted function.
6159         (gcd_schoenhage): Deleted assertion code using mpn_hgcd_lehmer.
6160
6161         * mpn/generic/hgcd.c (hgcd_final): Fixed ASSERT typos.
6162         (mpn_hgcd): To use Lehmer's algorithm, call hgcd_final directly,
6163         not mpn_hgcd_lehmer.
6164
6165         * mpn/generic/gcd.c (gcd_schoenhage): Updated for changes to
6166         mpn_hgcd and mpn_hgcd_fix. (Schoenhage code is still disabled).
6167
6168         * gmp-impl.h (mpn_hgcd_fix): Updated prototype.
6169
6170         * mpn/generic/hgcd.c (mpn_hgcd_fix): Replaced a bunch of arguments
6171         by a pointer const struct hgcd_row *s. Updated callers.
6172
6173         * mpn/generic/hgcd.c (hgcd_start_row_p): Use const for the input.
6174         Moved function definition before hgcd_jebelean.
6175         (hgcd_jebelean): Interface change, analogous to hgcd2.
6176         (mpn_hgcd_fix): Normalize v. Require that v > 0.
6177         (hgcd_adjust): Fix bug in carry update.
6178         (mpn_hgcd): Reorganized again, to adapt to mpn_hgcd/hgcd_jebelean
6179         now sometimes returning 1. Reintroduced hgcd_adjust.
6180
6181         * mpn/generic/hgcd.c (hgcd_final): Streamlined logic for the first
6182         hgcd2 call.
6183
6184         * mpn/generic/hgcd2.c (mpn_hgcd2): Interface change. Return 1
6185         instead of 2, in the no progress case r0=A, r1=B.
6186
6187         * mpn/generic/hgcd.c (hgcd_adjust): Changed arguments and return
6188         value. Now takes a struct hgcd_row * and the uv size, and returns
6189         updated uvsize.
6190         (hgcd_final): Special handling of the case hgcd2 returning 1. Now
6191         uses hgcd_adjust, instead of a full Euclid division.
6192
6193 2004-01-13  Niels Möller  <nisse@lysator.liu.se>
6194
6195         * mpn/generic/hgcd.c (euclid_step, hgcd_case0): Merged into a
6196         single function euclid_step.
6197         (mpn_hgcd): Reorganized the logic for the second recursive call.
6198         Avoid unnecessary Euclid steps.
6199
6200         * tests/mpn/t-hgcd.c (hgcd_values): One more test value.
6201
6202         * tests/mpn/t-hgcd.c (hgcd_values): Added values that trigged the
6203         hgcd_jebelean bug.
6204
6205         * mpn/generic/hgcd.c (hgcd_jebelean): Fixed off by one error.
6206         (mpn_hgcd): Simplified the logic for the first recursive call. Now
6207         it uses only the correct values from the recursive call, and
6208         doesn't do tricks with hgcd_adjust (hgcd_adjust will probably be
6209         reintroduced later, though).
6210
6211         * tests/mpn/t-hgcd.c (mpz_mpn_equal, hgcd_ref_equal)
6212         (hgcd_ref_init, hgcd_ref_clear): New functions.
6213         (hgcd_ref): Reference implementation of hgcd, using mpz.
6214         (one_test): Use hgcd_ref. Don't use mpn_hgcd_lehmer.
6215         (main): Skip one_step if both input values are zero.
6216
6217 2004-01-12  Niels Möller  <nisse@lysator.liu.se>
6218
6219         * mpn/generic/hgcd.c (hgcd_final): Rewritten, now uses Lehmer
6220         steps instead of a division loop.
6221         (mpn_hgcd_lehmer): Deleted old Lehmer code, instead just
6222         initialize and then call hgcd_final.
6223
6224         * tests/tests.h: Added refmpn_free_limbs prototype.
6225         * tests/refmpn.c (refmpn_free_limbs): New function.
6226
6227         * tests/mpn/t-hgcd.c: Try the same kind of random inputs as for
6228         mpz/t-gcd.
6229
6230 2004-01-11  Niels Möller  <nisse@lysator.liu.se>
6231
6232         * mpn/generic/hgcd.c (mpn_hgcd_lehmer): Rewritten, after some more
6233         analysis of the size reduction for one Lehmer step.
6234
6235         * tests/mpn/t-hgcd.c: New file.
6236
6237 2004-01-11  Torbjorn Granlund  <tege@swox.com>
6238
6239         With Niels Möller:
6240         * mpn/generic/hgcd.c (hgcd_normalize): Fix ASSERTs.
6241         (hgcd_mul): Normalize R[1].uvp[1].  Add some more ASSERTs.
6242         (hgcd_update_uv): Streamline.  ASSERT that input and output is
6243         normalized.
6244
6245 2004-01-11  Kevin Ryde  <kevin@swox.se>
6246
6247         * mpn/alpha/ev6/slot.pl: New file, derived in part from
6248         mpn/x86/k6/cross.pl.
6249
6250         * mpn/alpha/alpha-defs.m4 (ASSERT): New macro.
6251
6252         * mpn/asm-defs.m4 (m4_ifdef): New macro, avoiding OSF 4.0 m4 bug.
6253         (m4_assert_defined): Use it.
6254
6255         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (LDGP): New macro.
6256         * mpn/alpha/ev67/gcd_1.asm: Use it to re-establish gp after jsr.
6257
6258         * configure.in, demos/calc/Makefile.am: Use -lcurses or -lncurses with
6259         readline, when available.
6260
6261         * longlong.h (sub_ddmmss) [generic]: Use al<bl for the borrow rather
6262         than __x>al, since the former can be done without waiting for __x,
6263         helping superscalar chips, in particular alpha ev5 and ev6.
6264
6265         * longlong.h (sub_ddmmss) [ia64]: New macro.
6266
6267         * tests/t-sub.c: New file.
6268         * tests/Makefile.am (check_PROGRAMS): Add it.
6269         * tests/refmpn.c, tests/tests.h (refmpn_sub_ddmmss): New function.
6270
6271 2004-01-09  Kevin Ryde  <kevin@swox.se>
6272
6273         * mpn/x86/p6/mod_34lsub1.asm: New file, derived in part from
6274         mpn/x86/mod_34lsub1.asm.
6275
6276         * configure.in (IA64_PATTERN): Use -mtune on gcc 3.4.
6277
6278 2004-01-07  Kevin Ryde  <kevin@swox.se>
6279
6280         * gmp-h.in, mp-h.in (__GMP_SHORT_LIMB): Renamed from _SHORT_LIMB, to
6281         keep in our namespace.  (Not actually used anywhere currently.)
6282         Reported by Patrick Pelissier.
6283
6284         * mp-h.in: Use "! defined (__GMP_WITHIN_CONFIGURE)" in the same style
6285         as gmp-h.in (though mp-h.in is not actually used during configure).
6286
6287         * mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
6288         Use __dllexport__ and __dllimport__ to keep out of application
6289         namespace.  Same previously done in gmp-h.in.
6290
6291 2004-01-06  Kevin Ryde  <kevin@swox.se>
6292
6293         * configfsf.sub, configfsf.guess: Update to 2004-01-05.
6294         * configure.in (amd64-*-* | x86_64-*-*): Update comments on what
6295         configfsf.sub does.
6296
6297 2004-01-04  Kevin Ryde  <kevin@swox.se>
6298
6299         * mpn/alpha/README (REFERENCES): Add tru64 assembly manuals.
6300         (ASSEMBLY RULES): Note what gcc says about !literal! etc.
6301
6302 2004-01-03  Kevin Ryde  <kevin@swox.se>
6303
6304         * mpn/alpha/ev67/gcd_1.asm: New file.
6305
6306         * mpn/x86/pentium4/sse2/rsh1add_n.asm: New file, derived in part from
6307         mpn/x86/pentium4/sse2/addlsh1_n.asm.
6308
6309         * mpn/x86/p6/p3mmx/popham.asm: Note measured speeds.
6310
6311         * mpn/ia64/hamdist.asm: Correction to inputs vs locals in alloc (makes
6312         no difference to the generated code).  Corrections to a couple of
6313         comments.
6314
6315         * mpn/x86/pentium4/sse2/addlsh1_n.asm (PARAM_CARRY): Remove macro, not
6316         used, no such parameter.
6317
6318         * mpn/generic/gcd.c: Use <stdio.h> for NULL.
6319
6320         * doc/gmp.texi (Single Limb Division): Correction to tex expression
6321         for (1/2)x1.  And minor wording tweaks elsewhere.
6322
6323         * gmp-impl.h (mpn_rsh1add_n, mpn_rsh1sub_n): Correction to comments
6324         about how carries returned.
6325
6326         * longlong.h (umul_ppmm) [generic]: Add comments about squaring
6327         (dropped from tasks list)
6328
6329 2003-12-31  Kevin Ryde  <kevin@swox.se>
6330
6331         * demos/perl/GMP.xs (scan0, scan1): Return ~0 for not-found.
6332         * demos/perl/GMP.pm: Describe this, remove the note about ULONG_MAX
6333         being the same as ~0 (which is not true in old perl).
6334         * demos/perl/test.pl: Update tests.
6335         * demos/perl/typemap (gmp_UV): New type.
6336
6337         * demos/perl/test.pl (fits_slong_p): Comment out uv_max test, it won't
6338         necessarily exceed a long.
6339
6340         * demos/perl/GMP.pm: Add a remark about get_str to the bugs section.
6341
6342         * mpn/generic/sqrtrem.c, mpz/fac_ui.c, tests/mpf/reuse.c: Add casts
6343         for K&R.
6344         * tests/mpf/t-muldiv.c: Make ulimb, vlimb into ulongs, which is how
6345         they're used, for the benefit of K&R calling.
6346
6347         * doc/gmp.texi (Square Root Algorithm): Add a summary of the algorithm.
6348         And add further index entries in various places.
6349
6350         * mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
6351
6352         * gmp-impl.h, mpn/generic/mul_n.c (mpn_addlsh1_n, mpn_sublsh1_n,
6353         mpn_rsh1add_n, mpn_rsh1sub_n): Move descriptions to gmp-impl.h with
6354         the prototypes, for ease of locating.
6355
6356 2003-12-30  Torbjorn Granlund  <tege@swox.com>
6357
6358         * tune/tuneup.c (all): Disable calls of tune_gcd_schoenhage and
6359         tune_hgcd for now.
6360
6361 2003-12-29  Torbjorn Granlund  <tege@swox.com>
6362
6363         * tests/mpz/t-gcd.c: Rewrite, based on suggestions by Kevin.
6364
6365         * mpn/ia64/mul_1.asm: Amend TODO list.
6366
6367         * mpn/sparc64/README: Remove mpn_Xmul_2, done.
6368         Add blurb about L1 cache conflicts.
6369
6370         * mpn/generic/gcd.c: Disable Schoenhage code for now.
6371
6372 2003-12-29  Kevin Ryde  <kevin@swox.se>
6373
6374         * mpn/generic/mul_fft.c, mpz/root.c, mpq/cmp_ui.c: Add casts for K&R.
6375
6376 2003-12-27  Kevin Ryde  <kevin@swox.se>
6377
6378         * tests/mpz/t-mul.c (mul_kara, mul_basecase): Use __GMP_PROTO.
6379
6380         * mpn/generic/gcd.c (NHGCD_SWAP4_2, NHGCD_SWAP3_LEFT),
6381         mpn/generic/hgcd.c (HGCD_SWAP4_LEFT, HGCD_SWAP4_RIGHT, HGCD_SWAP4_2,
6382         HGCD_SWAP3_LEFT): Aggregate initializers for automatics is an
6383         ANSI-ism, avoid.
6384
6385         * Makefile.am (AUTOMAKE_OPTIONS): Restore this, giving no directory on
6386         ansi2knr to avoid a circular build rule.
6387         * configure.in (AM_INIT_AUTOMAKE): Note options also in Makefile.am.
6388
6389         * configure.in (cflags_maybe): Don't loop adding cflags_maybe if the
6390         user has set CFLAGS.
6391
6392 2003-12-24  Torbjorn Granlund  <tege@swox.com>
6393
6394         * mpn/generic/gcd.c (gcd_schoenhage_itch): Avoid unary "+".
6395         (mpn_gcd): Allocate scratch space on heap for gcd_schoenhage.
6396         (mpn_gcd): Don't invoke MPN_NORMALIZE on input operands.
6397
6398 2003-12-23  Kevin Ryde  <kevin@swox.se>
6399
6400         * configure.in (*sparc*-*-*): Test sizeof(long)==4 or 8 for ABIs, to
6401         get the right mode when the user sets the CFLAGS.
6402         (testlist): Introduce "any_<abi>_testlist" to apply to all compilers.
6403
6404         * demos/perl/typemap (MPZ_ASSUME, MPQ_ASSUME, MPF_ASSUME): Remove
6405         output rules, these are only meant for inputs.
6406         (MPZ_MUTATE): Remove, not used since changes for magic.
6407
6408         * demos/perl/GMP.xs (mpz_class_hv, mpq_class_hv, mpf_class_hv): New
6409         variables, initialized in BOOT.
6410         * demos/perl/GMP.xs, demos/perl/typemap: Use them and explicit
6411         sv_bless, to save a gv_stashpv for every new object.
6412
6413 2003-12-22  Kevin Ryde  <kevin@swox.se>
6414
6415         * mpn/alpha/mode1o.c, mpn/alpha/dive_1.c: Moved from ev5/mode1o.c and
6416         ev5/dive_1.c, these are good for ev4, and would like them in a generic
6417         alpha build.
6418
6419 2003-12-21  Kevin Ryde  <kevin@swox.se>
6420
6421         * doc/gmp.texi (Integer Logic and Bit Fiddling): Say "bitwise" in
6422         mpz_and, mpz_ior and mpz_xor, to avoid any confusion with what C means
6423         by "logical".  Reported by Rüdiger Schütz.
6424
6425         * gmp-h.in (_GMP_H_HAVE_FILE): Note why defined(EOF) is not good.
6426
6427 2003-12-20  Torbjorn Granlund  <tege@swox.com>
6428
6429         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Use mpn_cmp instead of
6430         mpn_sub_n where possible.  Use mp_size_t for relevant variables.
6431
6432 2003-12-20  Kevin Ryde  <kevin@swox.se>
6433
6434         * tune/speed.h (SPEED_TMP_ALLOC_LIMBS): Correction to last change,
6435         don't want "- 1" on the TMP_ALLOC_LIMBS.
6436
6437         * demos/expr/expr.h: Test #ifdef MPFR_VERSION_MAJOR for when mpfr.h is
6438         included, not GMP_RNDZ which is now an enum.
6439
6440         * demos/expr/exprfra.c (e_mpfr_ulong_p): Use mpfr_integer_p and
6441         mpfr_fits_ulong_p.
6442         (e_mpfr_get_ui_fits): Use mpfr_get_ui.
6443
6444         * mpfr/*: Update to mpfr cvs head 2003-12-20.
6445
6446         * configure, config.in: Update to autoconf 2.59.
6447         * */Makefile.in, configure, aclocal.m4, ansi2knr.c, install-sh,
6448         doc/mdate-sh: Update to automake 1.8.
6449
6450         * mkinstalldirs: Remove, not required by automake 1.8.
6451         * doc/gmp.texi (Build Options): HTML is a usual target in automake 1.8.
6452
6453         * configure.in (AC_PREREQ): Require autoconf 2.59.
6454         (AM_INIT_AUTOMAKE): Require automake 1.8.
6455         (AC_C_INLINE): Use rather than GMP_C_INLINE, now has #ifndef
6456         __cplusplus we want.
6457         (gettimeofday): Use AC_CHECK_FUNCS rather than our workaround code,
6458         autoconf now ok.
6459
6460         * acinclude.m4 (GMP_C_INLINE): Remove.
6461         (GMP_H_EXTERN_INLINE): Use AC_C_INLINE.
6462         (GMP_PROG_AR): Comment on automake $ARFLAGS.
6463
6464 2003-12-19  Niels Möller  <nisse@lysator.liu.se>
6465
6466         * mpn/generic/hgcd.c (mpn_diff_smaller_p): Rewrote function. Tried
6467         to explain how it works.
6468         (slow_diff_smaller_p, wrap_mpn_diff_smaller_p) [WANT_ASSERT]: Use
6469         CPP to wrap assertion checks around all calls to
6470         mpn_diff_smaller_p.
6471
6472         * mpn/generic/hgcd.c (mpn_addmul2_n_1) [nails]: Fixed carry handling.
6473
6474         * mpn/generic/hgcd.c (mpn_diff_smaller_p) [nails]: Use
6475         GMP_NUMB_MAX, not MP_LIMB_T_MAX.
6476         (mpn_hgcd_itch): Improved size calculation.
6477         (mpn_hgcd_max_recursion): Moved function from qstack.c. Should to
6478         be recompiled when HGCD_SCHOENHAGE_THRESHOLD is tuned.
6479
6480         * mpn/generic/qstack.c (mpn_hgcd_max_recursion): ... moved from
6481         here.
6482
6483 2003-12-19  Torbjorn Granlund  <tege@swox.com>
6484
6485         * tests/mpf/t-get_d.c: Print message before aborting.
6486
6487         * mpn/generic/hgcd2.c (mpn_hgcd2): Substitute always-zero variable
6488         with 0.  Remove bogus comment.
6489
6490         * mpn/generic/get_d.c: Make ONE_LIMB case actually work for nails.
6491
6492 2003-12-18  Niels Möller  <niels@lysator.liu.se>
6493
6494         * mpn/generic/hgcd.c (hgcd_update_r): Assert that the output r2 is
6495         smaller than the input r1.
6496
6497 2003-12-18  Torbjorn Granlund  <tege@swox.com>
6498
6499         * mpz/get_d.c: Don't include longlong.h.
6500
6501         * tests/mpz/t-mul.c (ref_mpn_mul): Handle un == vn specially, to avoid
6502         a dummy r/w outside of allocated area.
6503
6504 2003-12-18  Kevin Ryde  <kevin@swox.se>
6505
6506         * mpn/alpha/unicos.m4 (ALIGN): Add comments on what GCC does.
6507
6508         * configure.in (fat setups), acinclude.m4 (GMP_INIT): Obscure
6509         include() from automake 1.8 aclocal.
6510         * acinclude.m4: Quote names in AC_DEFUN, for automake 1.8 aclocal.
6511
6512 2003-12-17  Niels Möller  <nisse@lysator.liu.se>
6513
6514         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer) [nails]:
6515         Enabled code also for GMP_NAIL_BITS > 0.
6516         * tune/speed.c [nails]: Enable speed_mpn_hgcd and
6517         speed_mpn_hgcd_lehmer.
6518         * tune/tuneup.c (tune_hgcd) [nails]: Likewise.
6519
6520         * mpn/generic/gcd.c [nails]: Use Schönhage's algorithm also for
6521         GMP_NAIL_BITS > 0.
6522
6523         * mpn/generic/hgcd.c [nails]: Enable the code for GMP_NAIL_BITS > 0.
6524         (MPN_EXTRACT_LIMB) [nails]: Handle nails.
6525         (__gmpn_hgcd_sanity): Allocate temporaries on the heap, not on the
6526         stack. Also check that r[i] >= r[i+1].
6527         (mpn_hgcd2_lehmer_step) [nails]: Handle nails.
6528         (mpn_hgcd_lehmer): When we temporarily have r3 > r2, avoid
6529         trigging that assert in __gmpn_hgcd_sanity.
6530         (mpn_hgcd): Likewise.
6531
6532         * mpn/generic/hgcd2.c (div2) [nails]: Alternative nail-aware
6533         version.
6534         (SUB_2): New macro of Kevin's, which reduces do sub_ddmmss in the
6535         non-nail case.
6536         (HGCD2_STEP): Use SUB_2, not sub_ddmmss. Added alternative version
6537         for K&R compilers.
6538         (mpn_hgcd2) [nails]: Use SUB_2, not sub_ddmmss. New nail-aware
6539         code for checking Jebelean's condition.
6540
6541 2003-12-13  Kevin Ryde  <kevin@swox.se>
6542
6543         * mpq/get_d.c: Amend comments per mpn_get_d change.
6544         (limb2dbl): Remove, no longer used.
6545
6546         * gmp-impl.h (DIVREM_1_NORM_THRESHOLD etc) [nails]: Correction to
6547         comments, MP_SIZE_T_MAX means preinv never.
6548
6549         * gmp-impl.h (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD) [nails]:
6550         Remove overrides, divexact_1 and modexact_1 have been nailified.
6551
6552         * mpz/inp_str.c (mpz_inp_str_nowhite): Use ASSERT_ALWAYS for EOF value
6553         requirement.
6554
6555         * tests/refmpn.c (refmpn_rsh1add_n, refmpn_rsh1sub_n): Parens around
6556         GMP_NUMB_BITS - 1 with ">>", to quieten gcc -Wall.
6557         * tests/t-constants.c (main), tests/t-count_zeros.c (check_clz),
6558         tests/t-modlinv.c (one), tests/mpz/t-jac.c (try_si_zi),
6559         tests/mpq/t-get_d.c (check_onebit): : Correction to printfs.
6560         * tests/mpn/t-fat.c: Add <string.h> for memcpy.
6561         * tests/mpz/t-scan.c (check_ref): Remove unused variable "isigned".
6562         * tests/mpq/t-get_d.c (check_onebit): Remove unused variable "limit".
6563         * tests/mpf/t-set_si.c, tests/mpf/t-set_ui.c (check_data): Braces for
6564         initializers.
6565         * tests/devel/try.c (mpn_divexact_by3_fun, mpn_modexact_1_odd_fun):
6566         Correction to return values.
6567
6568         * doc/gmp.texi (Miscellaneous Integer Functions): Note mpz_sizeinbase
6569         can be used to locate the most significant bit.  Reword a bit for
6570         clarity.
6571
6572 2003-12-12  Niels Möller  <niels@lysator.liu.se>
6573
6574         * mpn/generic/hgcd.c (__gmpn_hgcd_sanity): Fixed stack buffer
6575         overrun.
6576         * mpn/generic/hgcd.c: Improved comments.
6577
6578 2003-12-11  Torbjorn Granlund  <tege@swox.com>
6579
6580         * gmp-impl.h: Change asm => __asm__, tabify.
6581         * mpz/get_d_2exp.c: Likewise.
6582         * mpf/get_d_2exp.c: Likewise.
6583
6584         * tests/cxx/t-ops.cc: #if .. #endif out tests that cause ambiguities.
6585
6586 2003-12-10  Torbjorn Granlund  <tege@swox.com>
6587
6588         * tests/mpz/t-gcd.c: Generate operands with sizes as a geometric
6589         progression, to allow for larger operands and less varying timing.
6590
6591         * tune/tuneup.c (tune_gcd_schoenhage): Set param.step_factor.
6592         (tune_hgcd): Likewise.
6593
6594 2003-12-10  Kevin Ryde  <kevin@swox.se>
6595
6596         * demos/perl/test.pl: Should be $] for perl version in old perl.
6597
6598         * configure.in (sparc64-*-*): Single block of gcc configs for all
6599         systems, on unknown systems try both ABI 32 and 64.
6600
6601         * configure.in (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New AC_SUBSTs with
6602         options to generate .def files with windows DLLs.
6603         * Makefile.am (libgmp_la_LDFLAGS, libgmpxx_la_LDFLAGS): Use them.
6604
6605         * mpn/generic/gcd.c: Use ABOVE_THRESHOLD / BELOW_THRESHOLD, to follow
6606         convention and cooperate with tune/tuneup.c.
6607
6608         * tune/tuneup.c (tune_gcd_schoenhage): Increase max_size to 3000, side
6609         default 1000 is approx the crossover point on athlon.
6610
6611         * tune/common.c, tune/speed.c, tune/speed.h, tune/speed-ext.c,
6612         tune/tuneup.c (SPEED_TMP_ALLOC_LIMBS): Take variable as parameter
6613         rather than returning a value, avoids alloca in a function call.
6614         * tune/common.c, tune/speed.h (speed_tmp_alloc_adjust): Remove, now
6615         inline in SPEED_TMP_ALLOC_LIMBS, and using ptr-NULL for alignment
6616         extraction.
6617
6618         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal,
6619         __gmp_binary_less, __gmp_binary_less_equal, __gmp_binary_greater,
6620         __gmp_binary_greater_equal, __gmp_cmp_function): Use mpfr_cmp_si and
6621         mpfr_cmp_d.
6622         * tests/cxx/t-ops.cc: Exercise this.
6623
6624         * demos/perl/Makefile.PL: Don't install sample.pl and test2.pl.
6625
6626         * demos/perl/GMP.xs (use_sv): Prefer PV over IV or NV to avoid any
6627         rounding.
6628         * demos/perl/test.pl: Exercise this.
6629
6630         * demos/perl/GMP/Mpf.pm (overload_string): Corrections to $# usage.
6631         * demos/perl/test.pl: Exercise this.
6632
6633 2003-12-08  Kevin Ryde  <kevin@swox.se>
6634
6635         * demos/perl/GMP.pm: Correction to canonicalize example.
6636
6637         * demos/perl/GMP.xs: New type check scheme, support magic scalars,
6638         support UV when available.  Remove some unused local variables.
6639         (coerce_long): Check range of double.
6640         (get_d_2exp): Remove stray printf.
6641
6642         * demos/perl/test.pl: Exercise magic, rearrange to make it clearer
6643         what's being tested.
6644
6645 2003-12-07  Kevin Ryde  <kevin@swox.se>
6646
6647         * mpn/generic/hgcd.c (mpn_hgcd): Use BELOW_THRESHOLD, to follow the
6648         convention of N<THRESH for the lower algorithm, not <=.  Fixes
6649         algorithm selection in tuneup.c.
6650
6651         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Use intended
6652         align_xp, align_yp.
6653
6654         * tune/tuneup.c (mul_toom3_threshold): Use MUL_TOOM3_THRESHOLD_LIMIT,
6655         for the benefit of ASSERT in mpn_mul_n.
6656
6657         * tune/tuneup.c (tune_mul): Correction to toom3 param.min_size, should
6658         use MPN_TOOM3_MUL_N_MINSIZE.
6659
6660         * tune/speed.c (check_align_option): Correction to printf format.
6661         * tune/freq.c (freq_sysctl_hw_model): Remove unused "i" variable.
6662
6663         * scanf/doscan.c: Correction to a couple of trace printfs.
6664         Add <stdlib.h> for strtol.
6665
6666         * tests/misc/t-scanf.c (test_sscanf_eof_ok): New function.
6667         (check_misc): Use it to suppress tests broken by libc.
6668         And should be EOF rather than -1 in various places.
6669
6670 2003-12-06  Torbjorn Granlund  <tege@swox.com>
6671
6672         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer):
6673         Move SPEED_TMP_ALLOC_LIMBS invocations out from calls.
6674
6675         * mpn/generic/get_str.c (mpn_get_str, POW2_P case):
6676         Don't append extra '\0' byte.
6677
6678 2003-12-05  Niels Möller  <niels@lysator.liu.se>
6679
6680         * tune/common.c (speed_mpn_hgcd_lehmer, speed_mpn_hgcd):
6681         Updated for the renaming hgcd_sanity -> ASSERT_HGCD.
6682
6683         * mpn/generic/gcd.c (gcd_schoenhage): TMP_DECL must be the final
6684         declaration in the declaration section of a block.
6685
6686         * tune/speed.h (mpn_gcd_accel): Added prototype.
6687
6688 2003-12-05  Torbjorn Granlund  <tege@swox.com>
6689
6690         * randmt.c (__gmp_mt_recalc_buffer): Put parens around "&" expressions
6691         inside "!=".
6692
6693         * mpf/get_str.c: Remove unused variable "fracn".
6694
6695 2003-12-03  Kevin Ryde  <kevin@swox.se>
6696
6697         * configure.in, Makefile.am (LIBGMP_LDFLAGS, LIBGMPXX_LDFLAGS): New
6698         AC_SUBSTs, use them to create .def files with Windows DLLs.
6699         * doc/gmp.texi (Notes for Particular Systems): Update notes on mingw
6700         DLL with MS C.
6701
6702         * mpz/export.c: Allow NULL for countp.
6703         * doc/gmp.texi (Integer Import and Export): Describe this.
6704         Suggested by Jack Lloyd.
6705
6706         * mpn/x86/p6/aors_n.asm: New file, grabbing the K7 code.
6707         Superiority of this reported by Patrick Pelissier.
6708
6709 2003-11-30  Kevin Ryde  <kevin@swox.se>
6710
6711         * mpn/alpha/ev67/popcount.asm, mpn/alpha/ev67/hamdist.asm: New files.
6712
6713         * mpn/alpha/ev67: New directory.
6714         * configure.in (alphaev67, alphaev68, alphaev7*): Use it.
6715
6716         * doc/gmp.texi (GMPrefu, GMPpxrefu): Change back to plain ref and
6717         pxref, remove macros.
6718         (GMPreftopu, GMPpxreftopu): Remove URL parameter, rename to GMPreftop
6719         and GMPpxreftop.
6720         (Debugging): Remove debauch, seems to have disappeared.
6721         (Language Bindings): Corrections to URLs for CLN, Omni F77, Pike.
6722
6723 2003-11-29  Kevin Ryde  <kevin@swox.se>
6724
6725         * demos/perl/GMP/Mpf.pm (overload_string): Use $OFMT to avoid warnings
6726         about $#.
6727
6728         * demos/perl/GMP.xs (fits_slong_p): Use LONG_MAX+1 to avoid possible
6729         rounding of 0x7F..FF in a double on 64-bit systems.
6730
6731         * configure.in (ppc601-*-*): Remove this case, it never matched
6732         anything, the name adopted is powerpc601.
6733         (powerpc601-*-*): Use gcc -mcpu=601, xlc -qarch=601.
6734
6735         * configure.in: Introduce ${cc}_cflags_maybe, used if they work.
6736         (*sparc*-*-*) [ABI=32]: Add gcc_cflags_maybe=-m32 to force that mode.
6737
6738         * doc/gmp.texi (Introduction to GMP): Add AMD64 to optimizations list.
6739         (Build Options): Add cpu types alphaev7 and amd64.  Update texinfo
6740         html cross reference.
6741
6742 2003-11-28  Niels Möller  <nisse@lysator.liu.se>
6743
6744         * tune/tuneup.c (tune_hgcd): Disable if GMP_NAIL_BITS > 0.
6745         * tune/speed.c (routine): Likewise.
6746         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer): Likewise.
6747
6748         * mpn/generic/gcd.c, mpn/generic/hgcd.c, mpn/generic/hgcd2.c
6749         [GMP_NAIL_BITS]: Disabled new code if we have nails.
6750
6751         * mpn/generic/gcd.c (MPN_LEQ_P): Copied macro definition (needed
6752         for compilation with --enable-assert).
6753
6754         * tune/tuneup.c (hgcd_schoenhage_threshold,
6755         gcd_schoenhage_threshold): New variables.
6756         (tune_hgcd, tune_gcd_schoenhage): New functions.
6757         (all): Call tune_hgcd and tune_gcd_schoenhage.
6758
6759         * tune/common.c (speed_mpn_hgcd, speed_mpn_hgcd_lehmer)
6760         (speed_mpn_gcd_accel): New functions.
6761         * tune/speed.c (routine): Added mpn_hgcd, mpn_hgcd_lehmer and
6762         mpn_gcd _accel.
6763         * tune/speed.h: Added corresponding prototypes.
6764
6765         * tune/gcd_accel.c: New file.
6766
6767         * tune/gcd_bin.c (GCD_SCHOENHAGE_THRESHOLD): Set to MP_SIZE_T_MAX.
6768
6769         * tune/Makefile.am (libspeed_la_SOURCES): Added gcd_accel.c.
6770         (TUNE_MPN_SRCS_BASIC): Added hgcd.c.
6771
6772         * mpn/x86/k7/gmp-mparam.h (HGCD_SCHOENHAGE_THRESHOLD)
6773         (GCD_SCHOENHAGE_THRESHOLD): Tuned values.
6774
6775         * mpn/generic/gcd.c (mpn_gcd, gcd_binary_odd): Renamed the
6776         old mpn_gcd function (which implements accelerated binary gcd) to
6777         gcd_binary_odd.
6778         (gcd_binary): New function, with the additional book keeping
6779         needed when using gcd_binary_odd to compute the gcd of non-odd
6780         numbers.
6781         (hgcd_tdiv): New function.
6782         (gcd_lehmer): New function, currently #if:ed out.
6783         (hgcd_start_row_p): New function, duplicatd from hgcd.c.
6784         (gcd_schoenhage_itch): New function.
6785         (gcd_schoenhage): New function.
6786         (mpn_gcd): New advertised gcd function, which calls
6787         mpn_gcd_binary_odd or mpn_gcd_schoenhage, depending on the size of
6788         the input.
6789
6790         * mpn/generic/hgcd.c (mpn_hgcd2_lehmer_step): Renamed function
6791         (was lehmer_step), and made non-static. Updated callers.
6792
6793         * gmp-impl.h (GCD_LEHMER_THRESHOLD): #if:ed out this macro.
6794         (mpn_hgcd2_lehmer_step): Added prototype.
6795
6796 2003-11-27  Niels Möller  <nisse@lysator.liu.se>
6797
6798         * tests/mpz/t-gcd.c (gcd_values): Moved definition, so that we
6799         don't need to forward declare the array.
6800
6801 2003-11-26  Niels Möller  <nisse@lysator.liu.se>
6802
6803         * mpn/generic/hgcd.c (mpn_hgcd2_fix): Deleted duplicate definition
6804         (the function belongs to hgcd2.c).
6805
6806 2003-11-26  Torbjorn Granlund  <tege@swox.com>
6807
6808         * tests/mpz/t-gcd.c: Generate random operands up to 32767 bits;
6809         decrease # of test to 1000.
6810         (gcd_values): Remove oversize test case.
6811
6812 2003-11-26  Niels Möller  <niels@lysator.liu.se>
6813
6814         * gmp-impl.h: Added name mangling for hgcd-related functions. Also
6815         use __GMP_PROTO.
6816         (MPN_LEQ_P, MPN_EXTRACT_LIMB): Moved macros to hgcd.c.
6817         * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
6818         Adapted to name changes.
6819
6820         * tests/mpz/t-gcd.c (main): Added some tests with non-random
6821         input.
6822
6823 2003-11-25  Niels Möller  <nisse@lysator.liu.se>
6824
6825         * gmp-impl.h (MPN_LEQ_P, MPN_EXTRACT_LIMB): New macros.
6826         (struct qstack, struct hgcd2_row, struct hgcd2, struct hgcd_row)
6827         (struct hgcd): New structs. Also added prototypes for new hgcd,
6828         hgcd2, qstack and gcd functions.
6829
6830         * configure.in (gmp_mpn_functions): Added hgcd2, hgcd and qstack.
6831
6832         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Added hgcd2.c,
6833         hgcd.c and qstack.c.
6834
6835         * mpn/generic/hgcd.c, mpn/generic/hgcd2.c, mpn/generic/qstack.c:
6836         New files, needed for the sub-quadratic gcd.
6837
6838 2003-11-25  Kevin Ryde  <kevin@swox.se>
6839
6840         * doc/gmp.texi (Language Bindings): Add Axiom.
6841
6842 2003-11-22  Kevin Ryde  <kevin@swox.se>
6843
6844         * mpn/alpha/README: More notes on assembler syntax variations.
6845
6846         * mpn/alpha/alpha-defs.m4, mpn/alpha/unicos.m4 (unop): Should be ldq_u
6847         not bis, and move to alpha-defs.m4 since it can be happily used
6848         everywhere.
6849
6850         * mpn/alpha/alpha-defs.m4, mpn/alpha/default.m4, mpn/alpha/unicos.m4
6851         (bigend): Move to alpha-defs.m4 and base it on HAVE_LIMB_BIG_ENDIAN or
6852         HAVE_LIMB_LITTLE_ENDIAN, so as not to hard code system endianness.
6853
6854         * mpn/alpha/alpha-defs.m4: New file.
6855         * configure.in (alpha*-*-*): Use it.
6856
6857 2003-11-21  Kevin Ryde  <kevin@swox.se>
6858
6859         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-21.
6860
6861         * mpn/alpha/ev5/com_n.asm: Change "not" to "ornot r31", since "not"
6862         isn't recognised by on Cray Unicos.  Add missing "gp" to PROLOGUE.
6863         * mpn/alpha/README: Add a note on "not".
6864
6865 2003-11-19  Torbjorn Granlund  <tege@swox.com>
6866
6867         * mpn/alpha/aorslsh1_n.asm: Slightly rework feed-in code, avoiding
6868         spurious reads beyond operand limits.
6869
6870         * mpn/alpha/ev5/com_n.asm: Add ASM_START/ASM_END.
6871
6872         * mpn/generic/mul_fft.c (mpn_fft_zero_p): Remove unused function.
6873         (mpn_lshift_com): Make static, nailify properly.
6874
6875 2003-11-19  Kevin Ryde  <kevin@swox.se>
6876
6877         * mpn/generic/diveby3.c: Use a "q" variable to make it clearer what
6878         the code is doing.
6879
6880         * mpn/powerpc32/750/lshift.asm, mpn/powerpc32/750/rshift.asm: New
6881         files.
6882
6883         * mpn/alpha/ev5/com_n.asm: New file.
6884
6885         * doc/gmp.texi (Assembler Functional Units, Assembler Writing Guide):
6886         New sections by Torbjorn, tweaked by me.
6887
6888 2003-11-17  Torbjorn Granlund  <tege@swox.com>
6889
6890         * mpn/powerpc32: Add power4/powerpc970 cycle counts.
6891         Use cmpwi instead of cmpi to placate darwin.
6892
6893 2003-11-15  Kevin Ryde  <kevin@swox.se>
6894
6895         * config.guess: Add comments on MacOS "machine" command.
6896
6897         * tests/devel/try.c (main): Use gmp_randinit_default explicitly on
6898         __gmp_rands, since RANDS doesn't allow seeding.
6899
6900         * doc/gmp.texi (Assigning Integers): Remove notes on possible change
6901         to disallow whitespace, this would be an incompatible change and
6902         really can't be made.
6903         (Toom 3-Way Multiplication): Updates for Paul's new code.
6904
6905         * mpn/generic/mul_n.c (toom3_interpolate, mpn_toom3_mul_n): Put
6906         if/else braces around whole of #if code, for readability.
6907
6908         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
6909         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps
6910         etc.
6911
6912         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-15.
6913
6914 2003-11-14  Torbjorn Granlund  <tege@swox.com>
6915
6916         * mpn/alpha/aorslsh1_n.asm: Use Cray-friendly syntax for "br".
6917
6918 2003-11-13  Torbjorn Granlund  <tege@swox.com>
6919
6920         * mpn/alpha/aorslsh1_n.asm: New file.
6921
6922 2003-11-12  Kevin Ryde  <kevin@swox.se>
6923
6924         * acinclude.m4 (GMP_PROG_CC_WORKS): Add case provoking AIX power2
6925         assembler, test code by Torbjorn.
6926         * configure.in (power*-*-*): Add a comment about -mcpu=rios2 fallback.
6927
6928         * tune/speed.c (main): Use gmp_randinit_default explicitly on
6929         __gmp_rands, since RANDS doesn't allow seeding.
6930
6931         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-12.
6932
6933         * gmp-impl.h, randmt.h (__gmp_randinit_mt_noseed): Move prototype to
6934         gmp-impl.h, for use by RANDS.
6935
6936         * mpn/Makeasm.am (.s, .S, .asm): Quote $< in test -f, per automake.
6937         (.obj): Use test -f and $(CYGPATH_W) as per automake.
6938
6939 2003-11-11  Kevin Ryde  <kevin@swox.se>
6940
6941         * configure.in: Make umul and udiv standard-optional objects, rather
6942         than under various extra_functions.
6943
6944         * mpn/pa32/hppa1_1/pa7100/add_n.asm,
6945         mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
6946         mpn/pa32/hppa1_1/pa7100/lshift.asm,
6947         mpn/pa32/hppa1_1/pa7100/rshift.asm,
6948         mpn/pa32/hppa1_1/pa7100/sub_n.asm,
6949         mpn/pa32/hppa1_1/pa7100/submul_1.asm: Use LDEF for labels.
6950
6951         * mpf/set_str.c: Don't use memcmp for decimal point testing, just a
6952         loop is enough and avoids any chance of memcmp reading past the end of
6953         the given string.
6954
6955         * randmts.c, randmt.h: New files.
6956         * Makefile.am (libgmp_la_SOURCES): Add them.
6957         * randmt.c: Move seeding to randmts.c, common defines in randmt.h.
6958         * gmp-impl.h (RANDS): Use __gmp_randinit_mt_noseed.
6959         * tests/misc.c (tests_rand_start): Use gmp_randinit_default
6960         explicitly, not RANDS.
6961
6962         * mpn/ia64/ia64-defs.m4 (PROLOGUE_cpu): Use 32-byte alignment, for the
6963         benefit of itanium 2.
6964         * mpn/ia64/gcd_1.asm: Remove own .align 32.
6965
6966         * mpn/ia64/ia64-defs.m4 (ALIGN): New define, using IA64_ALIGN_OK.
6967         * mpn/ia64/hamdist.asm: Use ALIGN instead of .align.
6968
6969         * acinclude.m4 (GMP_ASM_IA64_ALIGN_OK): New macro.
6970         * configure.in (IA64_PATTERN): Use it.
6971         * mpn/ia64/README: Add notes on gas big endian align problem.
6972
6973 2003-11-10  Torbjorn Granlund  <tege@swox.com>
6974
6975         * mpn/ia64/mul_1.asm: Rewrite.
6976
6977 2003-11-08  Torbjorn Granlund  <tege@swox.com>
6978
6979         * mpn/x86/aors_n.asm: Align loop to a multiple of 16.  Also align
6980         M4_function_n to a multiple of 16, to minimize alignment padding.
6981         Update P6 cycle counts reflecting improvements with new alignment.
6982
6983 2003-11-07  Kevin Ryde  <kevin@swox.se>
6984
6985         * gmp-impl.h (HAVE_HOST_CPU_alpha_CIX): New define.
6986         (ULONG_PARITY, popc_limb): Use it, to pick up ev7 as well as 67 and 68.
6987         * longlong.h (count_leading_zeros, count_trailing_zeros): Ditto.
6988
6989         * doc/gmp.texi (Notes for Package Builds): Add notes on multi-ABI
6990         system packaging.
6991         (ABI and ISA): Add GNU/Linux ABI=64.
6992         (Binary GCD): Add notes on 1x1 GCD algorithms.
6993
6994         * mpn/alpha/README: Add some literature references.
6995
6996         * mpn/ia64/mode1o.asm: Various corrections to initial checkin.
6997         * mpn/ia64/ia64-defs.m4 (ASSERT): Correction to arg quoting.
6998
6999 2003-11-05  Torbjorn Granlund  <tege@swox.com>
7000
7001         * mpn/powerpc64/linux64.m4: New file.
7002         * configure.in (POWERPC64_PATTERN): Handle *-*-linux*.
7003         Use linux64.m4.
7004
7005         * mpn/ia64/logops_n.asm: New file.
7006
7007 2003-11-05  Kevin Ryde  <kevin@swox.se>
7008
7009         * tune/freq.c (freq_sysctl_hw_model): Relax to just look for "%u MHz",
7010         for the benefit of sparc cypress under netbsd 1.6.1.
7011
7012         * mpfr/*: Update to mpfr-2-0-2-branch 2003-11-05.
7013
7014         * mpn/alpha/ev5/dive_1.c: New file.
7015
7016         * configure.in (x86_64-*-*): Accept together with amd64-*-*.
7017
7018         * tune/speed.c: Check range of -x,-y,-w,-W alignment specifiers.
7019         * tune/speed.h (CACHE_LINE_SIZE): Amend comments.
7020
7021 2003-11-04  Torbjorn Granlund  <tege@swox.com>
7022
7023         * tune/speed.c: Fix typo in testing HAVE_NATIVE_mpn_modexact_1_odd.
7024
7025 2003-11-03  Kevin Ryde  <kevin@swox.se>
7026
7027         * mpn/ia64/hamdist.asm: New file.
7028         * mpn/ia64/mode1o.asm: New file.
7029         * mpn/ia64/ia64-defs.m4 (ASSERT): New macro.
7030
7031         * tests/mpz/t-set_d.c (check_2n_plus_1): New test.
7032
7033 2003-11-01  Kevin Ryde  <kevin@swox.se>
7034
7035         * mpz/fac_ui.c (BSWAP_ULONG) [limb==2*long]: Remove this case, it
7036         provokes code gen problems on HP cc.
7037         (BSWAP_ULONG) [generic]: Rename __dst variable to avoid conflicts with
7038         BITREV_ULONG.
7039         Fix by Jason Moxham.
7040
7041         * mpn/powerpc32/mode1o.asm: Use 16-bit i*i for early out, no need to
7042         truncate divisor.  Amend stated 750/7400 speeds, and note operands
7043         that give the extremes.
7044
7045         * mpz/set_d.c: Don't use a special case for d < MP_BASE_AS_DOUBLE, gcc
7046         3.3 -mpowerpc64 on darwin gets ulonglong->double casts wrong.
7047
7048         * mpn/generic/diveby3.c: Show a better style carry handling in the
7049         alternative pipelined sample code.
7050
7051         Revert this, the longlong.h macros need -mpowerpc64:
7052         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
7053         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
7054         when bad.
7055
7056 2003-10-31  Torbjorn Granlund  <tege@swox.com>
7057
7058         * mpn/powerpc64/mode64/submul_1.asm: Move an instruction to save a
7059         cycle on POWER4.
7060
7061         * mpn/powerpc64/mode64/divrem_1.asm: Fix several syntax problems
7062         revealed on Mac OS X.
7063
7064         * mpn/powerpc64/mode64/*.asm: Add cycle counts for POWER4.
7065
7066         * mpn/powerpc64/sqr_diagonal.asm: Rewrite to save a cycle on POWER4.
7067
7068 2003-10-31  Kevin Ryde  <kevin@swox.se>
7069
7070         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-31.
7071
7072         * mpn/powerpc64/README: Add subdirectory organisation notes.
7073
7074         * tests/mpn/t-get_d.c: Don't use limits.h, LONG_MIN is wrong on gcc
7075         2.95 with -mcpu=ultrasparc.
7076
7077         * acinclude.m4 (GMP_GCC_POWERPC64): New macro.
7078         * configure.in (powerpc64-*-darwin*): Use it to exclude -mpowerpc64
7079         when bad.
7080
7081         * configure.in (powerpc64-*-darwin*) [ABI=mode32]: Use gcc -mcpu flags.
7082
7083         * mpn/ia64/divrem_1.asm, mpn/ia64/gcd_1.asm: Use "C" for comments.
7084         * mpn/ia64/README, mpn/ia64/ia64-defs.m4: Note this.
7085
7086         * mpn/ia64/ia64-defs.m4: Renamed from default.m4, per other defs files.
7087         * configure.in (IA64_PATTERN): Update GMP_INCLUDE_MPN.
7088
7089         * doc/gmp.texi (Notes for Particular Systems): Remove m68k ABI notes
7090         for -mshort and PalmOS, now works.
7091         (References): Correction, GMP Square Root proof already there, just
7092         wanting URL from RRRR 4475.
7093
7094 2003-10-29  Kevin Ryde  <kevin@swox.se>
7095
7096         * configure.in (sparc*-*-*): Use gcc -m32 when that option works, to
7097         force 32-bit mode on dual 32/64 configurations like GNU/Linux.
7098         (sparc64-*-linux*): Add support for ABI=64.
7099
7100         * mpn/generic/pre_divrem_1.c: In fraction part, use CNST_LIMB(0) with
7101         udiv_qrnnd_preinv to avoid warning about shift > type.
7102
7103         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-29.
7104
7105         * tests/cxx/t-istream.cc: Avoid tellg() checks if putback() doesn't
7106         update that, avoids certain g++ 2.96 problems.
7107
7108         * tests/mpn/t-fat.c: New file.
7109         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
7110
7111         * configure.in (CPUVEC_INSTALL, ITERATE_FAT_THRESHOLDS): New macros
7112         for fat.h.
7113         * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Use CPUVEC_INSTALL instead
7114         of memcpy.  Correction to location of "initialized" set.  Improve
7115         various comments.
7116
7117 2003-10-27  Torbjorn Granlund  <tege@swox.com>
7118
7119         * mpn/sparc64/mul_1.asm: Change addcc => add in a few places.
7120         * mpn/sparc64/addmul_1.asm: Likewise.
7121
7122         * mpn/sparc32/v9/mul_1.asm: Apply cross-jumping.
7123         * mpn/sparc32/v9/addmul_1.asm: Likewise.
7124         * mpn/sparc32/v9/submul_1.asm: Likewise.
7125         * mpn/sparc32/v9/sqr_diagonal.asm: Likewise.
7126
7127 2003-10-27  Kevin Ryde  <kevin@swox.se>
7128
7129         * tests/cxx/t-misc.cc: Don't use <climits>, on g++ 2.95.4 (debian 3.0)
7130         -mcpu=ultrasparc LONG_MIN is wrong and kills the compile.
7131
7132         * tests/cxx/t-istream.cc: Correction to tellg tests, don't assume
7133         streampos is zero based.
7134
7135         * configure.in (HAVE_HOST_CPU_FAMILY_alpha): New define for config.h.
7136         * mpn/generic/get_d.c: Use it instead of __alpha for alpha workaround,
7137         since Cray cc doesn't define __alpha.
7138
7139         * mpn/x86/README: Revise PIC coding notes a bit, add gcc visibility
7140         attribute.
7141
7142 2003-10-25  Kevin Ryde  <kevin@swox.se>
7143
7144         * mpn/ia64/gcd_1.asm: New file.
7145
7146         * tune/many.pl: Allow for PROLOGUE(fun,...), as used on alpha.
7147
7148         * doc/gmp.texi (C++ Formatted Input): Describe base indicator handling.
7149
7150         * tests/cxx/t-istream.cc: New file.
7151         * tests/cxx/Makefile.am: Add it.
7152
7153         * cxx/ismpznw.cc: New file, integer input without whitespace ...
7154         * cxx/ismpz.cc: ... from here.
7155         * gmp-impl.h (__gmpz_operator_in_nowhite): Add prototype.
7156         * cxx/ismpq.cc: Rewrite using mpz input routines.  Change to accept a
7157         separate base indicator on numerator and denominator.  Fix base
7158         indicator case where "123/0456" would stop at "123/0".
7159         * Makefile.am, cxx/Makefile.am: Add cxx/ismpznw.cc.
7160
7161         * tests/mpz/t-set_d.c: New file, derived from tests/mpz/t-set_si.c
7162         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
7163
7164         * mpn/m68k/lshift.asm, mpn/m68k/rshift.asm: Support 16-bit int and
7165         stack alignment.
7166         * mpn/m68k/README: Add notes on this.
7167         * configure.in (SIZEOF_UNSIGNED): New define in config.m4.
7168         * mpn/m68k/m68k-defs.m4 (m68k_definsn): Add cmpw, movew.
7169         Reported by Patrick Pelissier.
7170
7171         * mpn/m68k/t-m68k-defs.pl: Don't use -> with hashes, to avoid
7172         deprecation warnings from perl 5.8.
7173
7174         * configure.in (viac3-*-*): Use just x86/pentium in $path not x86/p6.
7175         If gcc is to be believed the old C3s don't have cmov.
7176
7177         * Makefile.am: Amend comments about not building from libtool
7178         convenience libraries.
7179
7180         * mpn/asm-defs.m4 (PROLOGUE): Use m4_file_seen, for correct filename
7181         in missing EPILOGUE error messages.
7182         (m4_file_seen): Amend comments about where used.
7183
7184         * Makefile.am (CXX_OBJECTS): Remove $U, C++ files are not subject to
7185         ansi2knr rules.
7186
7187         * gmp-h.in (mpn_divmod_1): Use __GMP_CAST, to avoid warnings in
7188         applications using g++ -Wold-style-cast.
7189
7190         * mpn/z8000/README: New file.
7191
7192 2003-10-22  Kevin Ryde  <kevin@swox.se>
7193
7194         * mpn/generic/get_d.c (CONST_1024, CONST_NEG_1023,
7195         CONST_NEG_1022_SUB_53): Replace ALPHA_WORKAROUND with a non-gcc-ism,
7196         and use on Cray Unicos alpha too, which has the same problem.
7197
7198         * configure.in (powerpc64-*-darwin*): Make ABI=32 available as the
7199         final fallback, remove mode64 until we know how it will work.
7200
7201         * doc/gmp.texi (Build Options): Add powerpc970 to available CPUs.
7202         (ABI and ISA): Add mode32 for Darwin.
7203
7204         * configure.in (gettimeofday): Use an explicit AC_TRY_LINK, to avoid
7205         known autoconf 2.57 problems with gettimeofday in AC_CHECK_FUNCS on
7206         HP-UX.
7207
7208         * configure.in (powerpc*-*-*): Use ABI=32 instead of ABI=standard for
7209         the default 32-bit ABI.  Fixes powerpc64-*-aix* which is documented as
7210         choices "aix64 32" but had "aix64 standard".
7211
7212         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-22.
7213
7214         * doc/gmp.texi (Notes for Particular Systems): Note m68k gcc -mshort
7215         and PalmOS calling conventions not supported.  Reported by Patrick
7216         Pelissier.
7217         (References): Add Paul Zimmermann's Inria 4475 paper.
7218
7219 2003-10-21  Torbjorn Granlund  <tege@swox.com>
7220
7221         * mpn/ia64/submul_1.asm: Slightly reschedule loop to accommodate
7222         Itanium 2 getf.sig latency.
7223
7224 2003-10-21  Kevin Ryde  <kevin@swox.se>
7225
7226         * tests/mpn/t-instrument.c: Add mpn_addlsh1_n, mpn_rsh1add_n,
7227         mpn_rsh1sub_n, mpn_sub_nc, mpn_sublsh1_n.  Typo in mpn_preinv_divrem_1
7228         conditional.
7229
7230 2003-10-20  Torbjorn Granlund  <tege@swox.com>
7231
7232         * mpn/powerpc64/mode32/add_n.asm: New file.
7233         * mpn/powerpc64/mode32/sub_n.asm: New file.
7234         * mpn/powerpc64/mode32/mul_1.asm: New file.
7235         * mpn/powerpc64/mode32/addmul_1.asm: New file.
7236         * mpn/powerpc64/mode32/submul_1.asm: New file.
7237
7238 2003-10-19  Torbjorn Granlund  <tege@swox.com>
7239
7240         * longlong.h (AMD64): __x86_64__ => __amd64__.
7241         (64-bit powerpc): Only define carry-dependent macros if
7242         !_LONG_LONG_LIMB.
7243
7244         * acinclude.m4 (POWERPC64_PATTERN): Add powerpc970-*-*.
7245
7246         * configure.in (POWERPC64_PATTERN): Handle *-*-darwin*.
7247         (POWERPC64_PATTERN, *-*-aix*): Prepend powerpc64/mode64 to path_aix64.
7248
7249         * mpn/powerpc64/mode64/mul_1.asm: Change cal => addi.
7250         * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
7251         * mpn/powerpc64/mode64/submul_1.asm: Likewise.
7252         * mpn/powerpc64/sqr_diagonal.asm: Likewise.
7253
7254         * mpn/powerpc64/mode64/mul_1.asm: Move from "..".
7255         * mpn/powerpc64/mode64/addmul_1.asm: Likewise.
7256         * mpn/powerpc64/mode64/submul_1.asm: Likewise.
7257         * mpn/powerpc64/mode64/divrem_1.asm: Likewise.
7258         * mpn/powerpc64/mode64/rsh1sub_n.asm: Likewise.
7259         * mpn/powerpc64/mode64/add_n.asm: Likewise.
7260         * mpn/powerpc64/mode64/addsub_n.asm: Likewise.
7261         * mpn/powerpc64/mode64/sub_n.asm: Likewise.
7262         * mpn/powerpc64/mode64/addlsh1_n.asm: Likewise.
7263         * mpn/powerpc64/mode64/diveby3.asm: Likewise.
7264         * mpn/powerpc64/mode64/rsh1add_n.asm: Likewise.
7265         * mpn/powerpc64/mode64/sublsh1_n.asm: Likewise.
7266
7267         * mpn/powerpc64/lshift.asm: Handle mode32 ABI.
7268         * mpn/powerpc64/rshift.asm: Likewise.
7269         * mpn/powerpc64/umul.asm: Likewise.
7270
7271         * tune/powerpc64.asm: Make it actually work.
7272
7273 2003-10-19  Kevin Ryde  <kevin@swox.se>
7274
7275         * mpn/generic/get_d.c: Add a workaround for alpha gcc signed constant
7276         comparison bug.
7277
7278         * gmpxx.h (gmp_randclass gmp_randinit_lc_2exp_size constructor): Throw
7279         std::length_error if size is too big.
7280         * tests/cxx/t-rand.cc (check_randinit): Exercise this.
7281
7282         * mpn/x86/pentium4/sse2/addlsh1_n.asm: New file, derived in part from
7283         mpn/x86/pentium4/sse2/add_n.asm.
7284
7285         * doc/gmp.texi (C++ Interface Integers, C++ Interface Rationals, C++
7286         Interface Floats): Note std::invalid_argument exception for invalid
7287         strings to constructors and operator=.
7288         (C++ Interface Random Numbers): Note std::length_error exception for
7289         size too big in gmp_randinit_lc_2exp_size.
7290
7291 2003-10-18  Kevin Ryde  <kevin@swox.se>
7292
7293         * mpfr/*: Update to mpfr-2-0-2-branch 2003-10-18.
7294
7295         * gmpxx.h (mpz_class, mpq_class, mpf_class, mpfr_class constructors
7296         and operator= taking string or char*): Throw std::invalid_argument if
7297         string cannot be converted.
7298         * tests/cxx/t-constr.cc, tests/cxx/t-assign.cc: Exercise this.
7299
7300         * cxx/ismpz.cc, cxx/ismpq.cc, cxx/ismpf.cc: Use istream std::locale
7301         ctype facet for isspace when available.  Only accept space at the
7302         start of the input, same as g++ libstdc++.  Use ASSERT_NOCARRY to
7303         check result of mpz_set_str etc.
7304         * cxx/ismpf.cc: Don't accept "@" for exponent indicator.
7305
7306         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Remove
7307         _open and _mpn variants of mpn_toom3_mul_n, only one style now.
7308         * tune/mul_n_open.c, tune/mul_n_mpn.c: Remove files.
7309
7310         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
7311         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
7312
7313         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use octal for character
7314         constants, hex is an ANSI-ism.
7315
7316         * mpn/alpha/ev5/mode1o.c: Corrections to ASSERTs, as per
7317         mpn/generic/mode1o.c.
7318
7319         * mpn/generic/diveby3.c: Add commented out alternative code and notes
7320         for taking the multiply off the dependent chain.  Amend/clarify some
7321         of the other comments.
7322
7323         * configure.in (powerpc970-*-*): Use gcc -mcpu=970 when available.
7324         (powerpc7400-*-*): Fallback on gcc -mcpu=750 if -mcpu=7400 not
7325         available.
7326
7327         * doc/gmp.texi (C++ Formatted Input): Note locale digit grouping not
7328         supported.
7329         (C++ Formatted Input, C++ Formatted Output): Cross reference class
7330         interface on overloading.
7331
7332         * mpn/m68k/README: Add various ideas from doc/tasks.html.
7333
7334         * mpn/m88k/README: New file.
7335
7336 2003-10-16  Torbjorn Granlund  <tege@swox.com>
7337
7338         * config.sub: Recognize powerpc970.
7339
7340 2003-10-15  Torbjorn Granlund  <tege@swox.com>
7341
7342         * config.guess: Recognize powerpc970 under MacOS.
7343
7344 2003-10-15  Kevin Ryde  <kevin@swox.se>
7345
7346         * configure.in, acinclude.m4 (GMP_C_RIGHT_SHIFT): New test.
7347         * gmp-impl.h (LIMB_HIGHBIT_TO_MASK): New macro.
7348         (udiv_qrnnd_preinv2, udiv_qrnnd_preinv2gen): Use it.
7349
7350         * mpn/amd64/amd64-defs.m4: New file, with a non-aligning PROLOGUE.
7351         * configure.in (amd64-*-*): Use it.
7352         * mpn/amd64/addlsh1_n.asm: Add ALIGN(16).
7353
7354         * mpfr/*: Update to mpfr cvs 2003-10-15.
7355
7356         * mpn/generic/get_d.c: Rewrite, simplifying and truncating towards
7357         zero unconditionally.
7358         * tests/mpn/t-get_d.c: Add various further tests.
7359         * gmp-impl.h (FORCE_DOUBLE): New macro.
7360
7361         * gmp-h.in (__mpz_struct): Add comment on __mpz_struct getting into
7362         C++ mangled function names.
7363
7364         * doc/gmp.texi (Build Options): Update notes for new doc subdir.
7365         (Low-level Functions): Note mpn functions don't check for zero limbs
7366         etc, it's up to an application to strip.
7367
7368         * doc/configuration (Configure): mdate-sh now in doc subdir, add
7369         generated fat.h.
7370
7371 2003-10-14  Torbjorn Granlund  <tege@swox.com>
7372
7373         * mpn/ia64/lorrshift.asm: Rewrite.
7374
7375         * mpn/ia64/diveby3.asm: Remove explicit bundling; add branch hints.
7376
7377 2003-10-13  Torbjorn Granlund  <tege@swox.com>
7378
7379         * mpn/ia64/diveby3.asm: New file.
7380
7381 2003-10-13  Kevin Ryde  <kevin@swox.se>
7382
7383         * mpn/powerpc32/mod_34lsub1.asm: New file.
7384
7385         * mpn/powerpc32/diveby3.asm, mpn/powerpc64/diveby3.asm: src[] in
7386         second operand of mullw, to allow possible early-out, which the
7387         0xAA..AB inverse cannot give.  This improvement noticed by Torbjorn.
7388
7389         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Print to config.log whether
7390         local label is purely temporary or appears in object files, for
7391         development purposes.
7392
7393         * doc/gmp.texi, doc/fdl.texi, doc/texinfo.tex, doc/mdate-sh: Moved
7394         from top-level.
7395         * doc/Makefile.am: New file.
7396         * configure.in (AC_OUTPUT): Add doc/Makefile.
7397         * Makefile.am (SUBDIRS): Move doc subdirectory from EXTRA_DIST.
7398         (info_TEXINFOS, gmp_TEXINFOS): Moved to doc/Makefile.am.
7399         * mpfr/Makefile.am (mpfr_TEXINFOS): fdl.texi now in doc subdir.
7400         (TEXINFO_TEX): texinfo.tex now in doc subdir.
7401         (AM_MAKEINFOFLAGS): Set -I to doc subdir.
7402
7403         * mpz/and.c: For positive/positive, use mpn_and_n, rate a realloc as
7404         UNLIKELY.
7405
7406         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Don't test
7407         for high zero limbs.
7408
7409 2003-10-12  Torbjorn Granlund  <tege@swox.com>
7410
7411         * mpn/powerpc64/diveby3.asm: New file (trivial edits of
7412         powerpc32/diveby3.asm).
7413
7414         * mpn/powerpc32/diveby3.asm: Update cycle counts with more processors.
7415         * mpn/powerpc32/sqr_diagonal.asm: Likewise.
7416
7417         * mpn/pa64/add_n.asm: Correct PA8500 cycle counts.
7418         * mpn/pa64/sub_n.asm: Likewise.
7419
7420         * mpn/m68k/aors_n.asm (INPUT PARAMETERS): Fix typo.
7421         * mpn/m68k/lshift.asm: Likewise.
7422         * mpn/m68k/rshift.asm: Likewise.
7423
7424         * mpn/m68k/README: Correct an URL; add some STATUS comments.
7425
7426         * mpn/ia64/aorslsh1_n.asm: Avoid shrp when shl/shr works just as well.
7427
7428         * mpn/powerpc32/addlsh1_n.asm: New file.
7429         * mpn/powerpc32/sublsh1_n.asm: New file.
7430
7431 2003-10-12  Kevin Ryde  <kevin@swox.se>
7432
7433         * mpn/sparc64/divrem_1.c, mpn/sparc64/mod_1.c: New files.
7434         * mpn/sparc64/sparc64.h (HALF_ENDIAN_ADJ, count_leading_zeros_32,
7435         invert_half_limb, udiv_qrnnd_half_preinv): New macros.
7436
7437         * gmp-impl.h (udiv_qrnnd_preinv2): Use a ? : for getting the n1 bit,
7438         so as not to depend on signed right shifts being arithmetic.
7439
7440         * mpn/powerpc32/diveby3.asm: New file.
7441
7442         * mpn/generic/divrem_1.c: Use CNST_LIMB(0) to avoid warnings from
7443         udiv_qrnnd_preinv about shift count when int<long.  Do the same with
7444         udiv_qrnnd, for consistency.
7445
7446         * Makefile.am (install-data-hook): Print a warning recommending "make
7447         check" to watch out for compiler bugs.  Proposed by Torbjorn.
7448
7449         * mpn/ia64/README (mpn_lshift, mpn_rshift): Amend prospective itanium2
7450         speed, 0.75 c/l with shrp plus shl/shr.
7451
7452         * mpn/ia64/popcount.asm: Add comment on optimality.
7453
7454 2003-10-11  Torbjorn Granlund  <tege@swox.com>
7455
7456         * mpn/ia64/rsh1aors_n.asm: New file.
7457
7458         * mpn/asm-defs.m4: Handle rsh1aors_n.
7459
7460         * configure.in (tmp_mulfunc): Handle rsh1aors_n.
7461
7462 2003-10-11  Kevin Ryde  <kevin@swox.se>
7463
7464         * mpn/x86/pentium4/sse2/diveby3.asm: Remove non-PIC RODATA memory
7465         access for 0xAAAAAAAB constant.
7466
7467         * gmp-impl.h (popc_limb, ULONG_PARITY) [ev67, ev68]: Add gcc asm
7468         versions using ctpop.
7469
7470         * mpn/x86/k6/aorsmul_1.asm: Tweak some comments, remove M4_description
7471         and M4_desc_retval used only in comments.
7472
7473         * mpn/x86/k6/mul_basecase.asm: Add comment on using mpn_mul_1.
7474
7475 2003-10-09  Torbjorn Granlund  <tege@swox.com>
7476
7477         * mpn/powerpc64/addlsh1_n.asm: Tweak for 0.25 c/l better loop speed.
7478         * mpn/powerpc64/sublsh1_n.asm: Likewise.
7479
7480 2003-10-09  Kevin Ryde  <kevin@swox.se>
7481
7482         * mpfr/*: Update to mpfr cvs 2003-10-09.
7483
7484         * tests/devel/try.c (_SC_PAGESIZE): Define from _SC_PAGE_SIZE on
7485         systems which use that, eg. hpux 9.
7486
7487 2003-10-07  Kevin Ryde  <kevin@swox.se>
7488
7489         * tune/freq.c (freq_sysctl_hw_model): Correction to last sscanf change.
7490
7491         * configure.in: Check for psp_iticksperclktick in struct pst_processor.
7492         * tune/freq.c (freq_pstat_getprocessor): Use this.
7493
7494         * tests/devel/try.c (divisor_array): Add a couple of half-limb values.
7495
7496         * acinclude.m4 (GMP_PROG_CC_WORKS): Correction to last change, need to
7497         set result "yes" when cross compiling.
7498
7499 2003-10-06  Torbjorn Granlund  <tege@swox.com>
7500
7501         * mpn/generic/mul_n.c: Use __GMPN_ADD_1/_GMPN_SUB_1 instead of
7502         mpn_add_1 and mpn_sub_1.
7503
7504         * mpn/pa64/aorslsh1_n.asm: Schedule register save and restore code.
7505
7506 2003-10-05  Torbjorn Granlund  <tege@swox.com>
7507
7508         * mpn/pa64/mul_1.asm: Misc comment cleanups.
7509         * mpn/pa64/addmul_1.asm: Likewise.
7510         * mpn/pa64/submul_1.asm: Likewise.
7511
7512         * mpn/pa64/README: Correct cycle counts.
7513
7514         * mpn/pa64/aorslsh1_n.asm: New file.
7515
7516 2003-10-04  Kevin Ryde  <kevin@swox.se>
7517
7518         * tune/freq.c (freq_sysctl_hw_model, freq_sunos_sysinfo,
7519         freq_sco_etchw, freq_bsd_dmesg, freq_irix_hinv): Demand matching of
7520         MHz etc at end of sscanf format string.  In particular need this for
7521         freq_bsd_dmesg on i486-pc-freebsd4.7 to avoid the 486 cpu being used
7522         for the frequency.
7523
7524         * tests/misc.c, tests/tests.h (tests_setjmp_sigfpe,
7525         tests_sigfpe_handler, tests_sigfpe_done, tests_sigfpe_target,
7526         tests_dbl_mant_bits): New.
7527
7528         * configure.in (viac3*-*-*): Add gcc VIA c3 options.
7529
7530         * mpfr/*: Update to mpfr cvs 2003-10-04.
7531
7532         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n,
7533         refmpn_rsh1add_n, refmpn_rsh1sub_n): Add ASSERTs for operand overlaps.
7534         * tests/tests.h (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
7535         refmpn_rsh1sub_n): Add prototypes.
7536
7537         * tests/devel/try.c, tune/many.pl: Add mpn_addlsh1_n, mpn_sublsh1_n,
7538         mpn_rsh1add_n, mpn_rsh1sub_n.
7539
7540 2003-10-03  Torbjorn Granlund  <tege@swox.com>
7541
7542         * tests/refmpn.c (refmpn_addlsh1_n, refmpn_sublsh1_n, refmpn_rsh1add_n,
7543         refmpn_rsh1sub_n): New functions.
7544
7545 2003-10-03  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
7546
7547         * mpn/generic/mul_n.c (toom3_interpolate): Use mpn_add_1/mpn_sub_1
7548         instead of MPN_INCR_/MPN_DECR_U.
7549
7550 2003-10-02  Torbjorn Granlund  <tege@swox.com>
7551
7552         * configure.in (ia64*-*-hpux*): Fall back to +O1, not +O.
7553
7554 2003-10-02  Kevin Ryde  <kevin@swox.se>
7555
7556         * configure.in (ia64*-*-hpux*): For cc, let +O optimization level
7557         fallback if +O3 doesn't work.
7558
7559         * acinclude.m4 (GMP_PROG_CC_WORKS): Add a test of __builtin_alloca
7560         when available, to pick up Itanium HP-UX cc internal errors in +O2.
7561         Provoking code by Torbjorn.
7562
7563 2003-10-01  Torbjorn Granlund  <tege@swox.com>
7564
7565         * mpn/ia64/gmp-mparam.h: Retune.
7566
7567         * mpn/asm-defs.m4: Handle aorslsh1_n.
7568
7569         * configure.in (tmp_mulfunc): Handle aorslsh1_n.
7570
7571         * mpn/ia64/aorslsh1_n.asm: New file.
7572
7573         * mpn/ia64/aors_n.asm: New file, complete rewrite of mpn_add_n and
7574         mpn_sub_n.
7575         * mpn/ia64/add_n.asm: Replace by aors_n.asm.
7576         * mpn/ia64/sub_n.asm: Replace by aors_n.asm.
7577
7578 2003-10-01  Kevin Ryde  <kevin@swox.se>
7579
7580         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Make bad ARM last byte into a
7581         separate case and consider it non-IEEE, since it looks like this is
7582         due to some sort of restricted or incorrect software floats.
7583
7584         * demos/calc/Makefile.am: Use automake yacc/lex support, seems fine in
7585         separate objdir now.
7586
7587         * cxx/dummy.cc: Moved from top-level dummy.cc.
7588         * Makefile.am (libgmpxx_la_SOURCES): Update to cxx/dummy.cc,
7589         correction to comment about this.
7590
7591 2003-09-30  Torbjorn Granlund  <tege@swox.com>
7592
7593         * demos/pexpr.c: Correct documentation of -split.
7594         (TIME): Remove cast of result to double.
7595         (main): Change timing variables to int.
7596         (main): #ifdef LIMIT_RESOURCE_USAGE, don't convert numbers of more than
7597         100000 digits.
7598
7599 2003-09-28  Torbjorn Granlund  <tege@swox.com>
7600
7601         * mpn/*/*.asm: Clean up spacing, tabify.
7602
7603         * mpn/alpha/rshift.asm: Table cycle counts.
7604         * mpn/alpha/lshift.asm: Likewise.
7605         * mpn/alpha/ev5/rshift.asm: Likewise.
7606         * mpn/alpha/ev5/lshift.asm: Likewise.
7607         * mpn/alpha/ev6/add_n.asm: Likewise.
7608         * mpn/alpha/ev6/sub_n.asm: Likewise.
7609
7610         * mpn/ia64/lorrshift.asm: Amend comments about performance.
7611
7612         * mpn/pa64/mul_1.asm: Fix comment typo.
7613         * mpn/pa64/addmul_1.asm: Likewise.
7614         * mpn/pa64/submul_1.asm: Likewise.
7615
7616         * mpn/amd64/addlsh1_n.asm: Save/restore carry using two insn to break
7617         recurrency.  Add remarks about possible further speedup.
7618         * mpn/amd64/sublsh1_n.asm: Likewise.
7619
7620         * mpn/amd64/rsh1add_n.asm: Add remarks about possible further speedup.
7621         * mpn/amd64/rsh1sub_n.asm: Likewise.
7622
7623 2003-09-27  Torbjorn Granlund  <tege@swox.com>
7624
7625         * mpn/powerpc64/README: Update with POWER4/PPC970 pipeline info.
7626
7627         * mpn/powerpc64/rsh1add_n.asm: New file.
7628         * mpn/powerpc64/rsh1sub_n.asm: New file.
7629         * mpn/powerpc64/rshift.asm: Rewrite.
7630         * mpn/powerpc64/lshift.asm: Rewrite.
7631
7632 2003-09-26  Torbjorn Granlund  <tege@swox.com>
7633
7634         * mpn/powerpc64/addlsh1_n.asm: New file.
7635         * mpn/powerpc64/sublsh1_n.asm: New file.
7636
7637 2003-09-25  Torbjorn Granlund  <tege@swox.com>
7638
7639         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
7640         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): Conditionalize on
7641         corresponding HAVE_NATIVE_*.
7642
7643 2003-09-25  Kevin Ryde  <kevin@swox.se>
7644
7645         * mpz/combit.c: Use GMP_NUMB_BITS not BITS_PER_MP_LIMB.
7646
7647         * demos/expr/exprfr.c: Allow for mpfr_inf_p, mpfr_nan_p and
7648         mpfr_number_p merely returning non-zero, rather than 1 or 0.
7649
7650         * demos/expr/exprfr.c, demos/expr/t-expr.c: Add erf, integer_p, zeta.
7651
7652         * demos/expr/Makefile.am (LDADD): Update comments on $(LIBM).
7653
7654 2003-09-24  Torbjorn Granlund  <tege@swox.com>
7655
7656         * tune/speed.c (routine): Add entires for mpn_addlsh1_n, mpn_sublsh1_n,
7657         mpn_rsh1add_n, and mpn_rsh1sub_n.
7658
7659         * tune/speed.h: Declare speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
7660         speed_mpn_rsh1add_n, and speed_mpn_rsh1sub_n.
7661
7662         * tune/common.c (speed_mpn_addlsh1_n, speed_mpn_sublsh1_n,
7663         speed_mpn_rsh1add_n, speed_mpn_rsh1sub_n): New functions.
7664
7665         * gmp-impl.h: Declare mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsh1add_n, and
7666         mpn_rsh1sub_n.
7667
7668         * mpn/asm-defs.m4: Add define_mpn's for addlsh1_n, sublsh1_n,
7669         rsh1add_n, and rsh1sub_n.
7670
7671         * mpn/powerpc64/*.asm: Add cycle counts in consistent style.  Misc
7672         styling edits.
7673
7674         * mpn/amd64/gmp-mparam.h: Retune.
7675
7676         * configure.in: Add #undefs for HAVE_NATIVE_mpn_addlsh1_n,
7677         HAVE_NATIVE_mpn_sublsh1_n, HAVE_NATIVE_mpn_rsh1add_n,
7678         HAVE_NATIVE_mpn_rsh1sub_n.
7679         (gmp_mpn_functions_optional): List addlsh1_n, sublsh1_n, rsh1add_n,
7680         and rsh1sub_n.
7681
7682         * mpn/amd64/addlsh1_n.asm: New file.
7683         * mpn/amd64/sublsh1_n.asm: New file.
7684         * mpn/amd64/rsh1add_n.asm: New file.
7685         * mpn/amd64/rsh1sub_n.asm: New file.
7686
7687 2003-09-24  Kevin Ryde  <kevin@swox.se>
7688
7689         * mpfr/*: Update to mpfr cvs 2003-09-24.
7690
7691         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Remove conftest* temporary files.
7692
7693 2003-09-23  Torbjorn Granlund  <tege@swox.com>
7694
7695         * gmp-impl.h (MUL_TOOM3_THRESHOLD, SQR_TOOM3_THRESHOLD): Now 128.
7696
7697 2003-09-23  Kevin Ryde  <kevin@swox.se>
7698
7699         * gmp-h.in (gmp_randinit_set): Use __gmp_const rather than const.
7700
7701 2003-09-22  Torbjorn Granlund  <tege@swox.com>
7702
7703         * tune/mul_n_mpn.c: (__gmpn_sqr_n): New #define.
7704         * tune/mul_n_open.c (__gmpn_sqr_n): New #define.
7705
7706         * mpn/generic/mul.c (mpn_sqr_n): Move from here...
7707         * mpn/generic/mul_n.c (mpn_sqr_n): ...to here.
7708         (mpn_sqr_n): Allocate workspace for toom3 using TMP_* mechanism except
7709         for very large operands when !WANT_FFT.
7710
7711         * mpn/generic/mul_n.c: Add a missing ";". Misc comment fixes.
7712
7713         * mpn/generic/mul.c: Remove spurious #include <stdio.h>.
7714
7715         * mpn/x86/k7/gmp-mparam.h: Retune.
7716
7717         * mpn/generic/mul_n.c (mpn_mul_n): Allocate workspace for toom3 using
7718         TMP_* mechanism except for very large operands when !WANT_FFT.
7719
7720         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE):
7721         Define conditionally on WANT_FFT and HAVE_NATIVE_mpn_sublsh1_n.
7722         (MPN_TOOM3_MAX_N): New #define.
7723
7724         * mpn/amd64/gmp-mparam.h: Retune.
7725
7726         * mpn/Makefile.am (TARG_DIST): Add amd64.
7727
7728         * mpn/generic/sqr_basecase.c: Use mpn_addlsh1_n when available.
7729
7730         * mpn/generic/mul_n.c: Use proper form for HAVE_NATIVE macros.
7731
7732 2003-09-22  Kevin Ryde  <kevin@swox.se>
7733
7734         * mpfr/*: Update to mpfr cvs 2003-09-22.
7735
7736 2003-09-21  Kevin Ryde  <kevin@swox.se>
7737
7738         * mpn/x86/pentium4/sse2/gmp-mparam.h (USE_PREINV_DIVREM_1,
7739         USE_PREINV_MOD_1): Set to 1 for new asm versions.
7740
7741         * mpfr/*: Update to mpfr cvs 2003-09-21.
7742
7743 2003-09-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
7744
7745         * mpn/generic/mul_n.c (mpn_toom3_mul_n): Conditionally use
7746         mpn_sublsh1_n, mpn_rsh1add_n and mpn_rsh1sub_n, in addition to
7747         mpn_addlsh1_n.  Avoid all copying, at the expense of some additional
7748         workspace.
7749
7750         * gmp-impl.h (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Accomodate
7751         latest toom3 code.
7752
7753 2003-09-19  Kevin Ryde  <kevin@swox.se>
7754
7755         * mpn/x86/pentium4/sse2/divrem_1.asm, mpn/x86/pentium4/sse2/mod_1.asm:
7756         New files.
7757
7758 2003-09-16  Kevin Ryde  <kevin@swox.se>
7759
7760         * tune/speed.c (run_one): Don't scale the -1.0 not-available return.
7761         Print "n/a" for times not-available.
7762
7763 2003-09-13  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
7764
7765         * mpn/generic/mul_n.c (toom3_interpolate): New function.
7766         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Call toom3_interpolate.
7767
7768 2003-09-12  Torbjorn Granlund  <tege@swox.com>
7769
7770         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove unused
7771         variables.
7772         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use offset `+ 1', not `+ 2' in last
7773         MPN_DECR_U calls.
7774
7775 2003-09-12  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
7776
7777         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Rewrite.
7778
7779 2003-09-12  Torbjorn Granlund  <tege@swox.com>
7780
7781         * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_SQR_N_TSIZE): Reformulate
7782         to use the same form as MPN_TOOM3_MUL_N_TSIZE.
7783         (MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_SQR_N_TSIZE): Update for new Toom3
7784         code requirements.
7785         * mpn/generic/mul_n.c (evaluate3, interpolate3, add2Times): Remove.
7786         (USE_MORE_MPN): Remove.
7787
7788 2003-08-31  Kevin Ryde  <kevin@swox.se>
7789
7790         * mpfr/*: Update to mpfr cvs 2003-08-31.
7791
7792 2003-08-30  Kevin Ryde  <kevin@swox.se>
7793
7794         * mpfr/*: Update to mpfr cvs 2003-08-30.
7795
7796 2003-08-29  Torbjorn Granlund  <tege@swox.com>
7797
7798         * mpn/amd64/copyi.asm: New file.
7799         * mpn/amd64/copyd.asm: New file.
7800         * mpn/amd64/README: New file.
7801
7802 2003-08-28  Torbjorn Granlund  <tege@swox.com>
7803
7804         * mpn/amd64/lshift.asm: New file.
7805         * mpn/amd64/rshift.asm: New file.
7806         * mpn/amd64/gmp-mparam.h: Retune.
7807
7808 2003-08-23  Kevin Ryde  <kevin@swox.se>
7809
7810         * tune/freq.c (freq_getsysinfo): Correction to speed_cycletime value
7811         established.
7812
7813         * mpz/rootrem.c, gmp-h.in, gmp.texi (mpz_rootrem): Don't return
7814         exactness indication, can get that from testing the remainder.
7815
7816         * mpn/x86/k7/aors_n.asm, mpn/x86/k7/mmx/copyi.asm: Amend to comments
7817         about loads and stores and what speed should be possible.
7818
7819 2003-08-22  Torbjorn Granlund  <tege@swox.com>
7820
7821         * mpn/amd64/add_n.asm: New file.
7822         * mpn/amd64/sub_n.asm: New file.
7823         * mpn/amd64/mul_1.asm: New file.
7824         * mpn/amd64/addmul_1.asm: New file.
7825         * mpn/amd64/submul_1.asm: New file.
7826
7827 2003-08-19  Kevin Ryde  <kevin@swox.se>
7828
7829         * longlong.h (add_ssaaaa, sub_ddmmss) [hppa 64]: Move down into main
7830         __GNUC__ block.  Exclude for _LONG_LONG_LIMB (ie. ABI=2.0n) since
7831         these forms are only for ABI=2.0w.
7832
7833         * longlong.h (count_leading_zeros) [__mcpu32__]: Check __mcpu32__ to
7834         avoid bfffo on GCC 3.4 in CPU32 mode.  Reported by Bernardo Innocenti.
7835
7836         * longlong.h (count_trailing_zeros) [x86_64]: Use "%q0" to force
7837         64-bit register destination.  Pointed out by Torbjorn.
7838
7839         * mpz/combit.c: Correction to carry handling when extending a
7840         negative, and use __GMPN_ADD_1.  Correction to complement limb for a
7841         negative when there's a non-zero low limb.
7842         * tests/mpz/bit.c (check_clr_extend, check_com_negs): Exercise these.
7843
7844         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add
7845         get_d_2exp.
7846         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Rand.pm,
7847         demos/perl/test.pl: Add gmp_urandomb_ui, gmp_urandomm_ui.
7848         (GMP::Rand::randstate): Accept a randstate object to copy.
7849         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/GMP/Mpz.pm,
7850         demos/perl/test.pl: Add combit, rootrem.
7851
7852 2003-08-19  Torbjorn Granlund  <tege@swox.com>
7853
7854         * tune/Makefile.am (EXTRA_DIST): Add amd64.asm.
7855
7856 2003-08-17  Kevin Ryde  <kevin@swox.se>
7857
7858         * gmpxx.h [__MPFR_H]: Include full <iostream> for inlines.
7859         * tests/cxx/t-headfr.cc: New file, exercising this.
7860         * tests/cxx/Makefile.am: Add it.
7861
7862         * tests/cxx/t-constr.cc: Include config.h for WANT_MPFR.
7863
7864         * gmpxx.h: Correction to temp variable type in mpf -> mpfr assignment.
7865         Reported by Derrick Bass.
7866         * tests/cxx/t-assign.cc (check_mpfr): Exercise this.
7867
7868         * configure.in (WANT_MPFR): AC_DEFINE this, for the benefit of
7869         tests/cxx/t-*.cc.  (Was always meant to have been defined.)
7870         * tests/cxx/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpfr.
7871
7872         * gmpxx.h: __gmp_default_rounding_mode -> __gmpfr_default_rounding_mode
7873         (struct __gmp_hypot_function): Correction to mpfr_hypot addition.
7874         * tests/cxx/t-misc.cc (check_mpfr_hypot): Corrections to mpfr/long
7875         tests.
7876
7877 2003-08-16  Torbjorn Granlund  <tege@swox.com>
7878
7879         * configure.in (amd64): New.
7880
7881         * mpn/amd64/gmp-mparam.h: New file.
7882
7883         * tune/amd64.asm: New file, derived in part from tune/pentium.asm.
7884
7885 2003-08-15  Kevin Ryde  <kevin@swox.se>
7886
7887         * tune/freq.c (freq_irix_hinv): Reinstate, for the benefit of IRIX 6.2.
7888         (freq_attr_get_invent): Conditionalize on INFO_LBL_DETAIL_INVENT too.
7889
7890 2003-08-14  Kevin Ryde  <kevin@swox.se>
7891
7892         * mpq/get_d.c: Use mpn_get_d.
7893         * tests/mpq/t-get_d.c (check_onebit): New test.
7894
7895         * gmp.texi (Notes for Particular Systems): Under x86 cpu types, note
7896         i386 is a fat binary, remove pentium4 recommendation since i386 is now
7897         quite reasonable for p4.
7898         (Notes for Particular Systems): Under Windows DLLs, remove caveat
7899         about --enable-cxx now ok, update .lib creation for new libtool,
7900         remove .exp not needed for MS C.
7901         (Notes for Package Builds): i386 is a fat binary.
7902         (Reentrancy): Remove SCO ctype.h note, don't want to list every system
7903         misfeature, and was quite possibly for non-threading mode anyway.
7904         (Autoconf): Remove notes on gmp 2 detection, too old to want to
7905         encourage anyone to use.
7906         (Karatsuba Multiplication): Correction to threshold increase/decrease
7907         for a and b terms.  Reported by Richard Brent and Paul Zimmermann.
7908         Also add various further index entries.
7909
7910         * tune/freq.c (freq_attr_get_invent): New function.
7911         (freq_irix_hinv): Remove, in favour or freq_attr_get_invent.
7912         * configure.in (AC_CHECK_FUNCS): Add attr_get.
7913         (AC_CHECK_HEADERS): Add invent.h, sys/attributes.h, sys/iograph.h.
7914
7915 2003-08-03  Kevin Ryde  <kevin@swox.se>
7916
7917         * tune/tuneup.c (tune_mul): Use MUL_KARATSUBA_THRESHOLD_LIMIT.
7918
7919 2003-08-02  Kevin Ryde  <kevin@swox.se>
7920
7921         * mpn/asm-defs.m4: Tweak some comments, add hpux11 to m4wrap 0xFF
7922         problem systems.
7923
7924         * configure.in (*-*-sco3.2v5*): Remove lt_cv_archive_cmds_need_lc=no,
7925         since libtool no longer uses it.  This was a workaround fixing ctype.h
7926         in SCO 5 shared libraries; not sure if libtool now gets it right on
7927         its own, let's hope so.
7928
7929         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Remove, libtool no
7930         longer demands HOST_CC.
7931
7932         * configure.in: When C or C++ compiler not found, refer user to
7933         config.log.
7934
7935         * configure.in (i386-*-*): Turn i386 into a fat binary build.
7936         * mpn/x86/fat/fat.c, mpn/x86/fat/fat_entry.asm,
7937         mpn/x86/fat/gmp-mparam.h, mpn/x86/fat/gcd_1.c, mpn/x86/fat/mode1o.c:
7938         New files.
7939         * gmp-impl.h (struct cpuvec_t) [x86 fat]: New structure.
7940         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB) [x86 fat]: Define.
7941         * mpn/asm-defs.m4 (foreach): New macro.
7942         * mpn/x86/x86-defs.m4 (CPUVEC_FUNCS_LIST): New define.
7943         * mpn/x86/sqr_basecase.asm: New file, primarily as a fallback for fat
7944         binaries.
7945         * mpn/x86/p6/gmp-mparam.h, mpn/x86/p6/mmx/gmp-mparam.h: Add comments
7946         about fat binary SQR_KARATSUBA_THRESHOLD for p6 and p6/mmx.
7947
7948         * configure.in: Add various supports for fat binaries, via fat_path,
7949         fat_functions and fat_thresholds variables.
7950         * acinclude.m4 (GMP_STRIP_PATH): Mung $fat_path too.
7951         (GMP_FAT_SUFFIX, GMP_REMOVE_FROM_LIST): New macros.
7952         * gmp-impl.h: Add various supports for fat binaries.
7953         (DECL_add_n etc): New macros.
7954         (mpn_mul_basecase etc): Define only if not already defined.
7955         * mpn/asm-defs.m4 (m4_config_gmp_mparam): Mention fat binary.
7956         (MPN): Use m4_unquote, for the benefit of fat binary name expansion.
7957         * doc/configuration: Notes on fat binaries.
7958         * gmp-impl.h (MUL_TOOM3_THRESHOLD_LIMIT): Define always.
7959         (MUL_KARATSUBA_THRESHOLD_LIMIT): New define.
7960         * mpn/generic/mul.c, mpn/generic/mul_n.c: Use these.
7961         * tune/divrem1div.c, tune/divrem1inv.c, tune/mod_1_div.c,
7962         tune/mod_1_inv.c: Define OPERATION_divrem_1 and OPERATION_mod_1, to
7963         tell fat.h what's being done.
7964
7965         * config.guess (alpha-*-*): Update comments on what configfsf.guess
7966         does and doesn't do for us.
7967
7968 2003-07-31  Kevin Ryde  <kevin@swox.se>
7969
7970         * config.guess: Remove $dummy.o files everywhere, in case vendor
7971         compilers produce that even when not asked.
7972
7973         * demos/perl/GMP.xs (class_or_croak): Rename "class" parameter to
7974         avoid C++ keyword.
7975         (coerce_ulong, coerce_long): Move croaks to stop g++ 3.3 complaining
7976         about uninitialized variables.
7977
7978         * demos/perl/INSTALL: Add notes on building with a DLL.
7979
7980         * longlong.h (count_trailing_zeros) [x86_64]: Ensure bsfq destination
7981         is a 64-bit register.  Diagnosed by Francois G. Dorais.
7982
7983 2003-07-31  Torbjorn Granlund  <tege@swox.com>
7984
7985         * longlong.h [ppc]: Remove nested test for vxworks.
7986
7987 2003-07-24  Kevin Ryde  <kevin@swox.se>
7988
7989         * gmpxx.h (struct __gmp_binary_multiplies): Use mpz_mul_si for
7990         mpz*long and long*mpz.
7991         * tests/cxx/t-ops.cc (check_mpz): Exercise mpz*long and mpz*ulong.
7992
7993         * cxx/ismpf.cc: Use std::locale decimal point when available.  Expect
7994         localeconv available always.
7995         * tests/cxx/t-locale.cc: Enable check_input tests.
7996
7997         * gmpxx.h (struct __gmp_hypot_function): Use mpfr_hypot.
7998         * tests/cxx/t-misc.cc (check_mpfr_hypot): New tests.
7999
8000         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-ops.cc,
8001         tests/cxx/t-prec.cc, tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc:
8002         Include config.h for WANT_MPFR.
8003
8004         * tests/mpz/bit.c (check_single): Correction to a diagnostic print.
8005
8006 2003-07-24  Niels Möller  <nisse@lysator.liu.se>
8007
8008         * mpz/combit.c: New file.
8009         * Makefile.am, mpz/Makefile.am: Add it.
8010         * gmp-h.in (mpz_combit): Add prototype.
8011         * tests/mpz/bit.c (check_single): Exercise mpz_combit.
8012
8013 2003-07-16  Kevin Ryde  <kevin@swox.se>
8014
8015         * mpn/generic/get_d.c: Correction to infinity handling for large exp.
8016
8017 2003-07-14  Kevin Ryde  <kevin@swox.se>
8018
8019         * mpz/get_d.c, mpz/get_d_2exp.c, mpf/get_d.c, mpf/get_d_2exp.c: Use
8020         mpn_get_d.
8021
8022         * mpn/generic/get_d.c: New file, based on mpz/get_d.c and insert-dbl.c.
8023         * configure.in, mpn/Makefile.am: Add it.
8024         * gmp-impl.h (mpn_get_d): Add prototype.
8025
8026         * tests/mpn/t-get_d.c: New file.
8027         * tests/mpn/Makefile.am: Add it.
8028
8029         * tests/mpz/t-get_d_2exp.c (check_onebit, check_round): Test negatives.
8030         (check_onebit): Add a few more bit sizes.
8031
8032         * tests/misc.c, tests/tests.h (tests_isinf): New function.
8033
8034 2003-07-12  Kevin Ryde  <kevin@swox.se>
8035
8036         * configure.in (GMP_PROG_CXX_WORKS): Include $CPPFLAGS, same as
8037         automake does in the actual build.
8038
8039         * acinclude.m4 (GMP_PROG_CXX_WORKS): In the namespace test, declare
8040         namespace before trying to use.  In std iostream test, provoke a
8041         failure from Compaq C++ in pre-standard mode.
8042
8043 2003-07-08  Kevin Ryde  <kevin@swox.se>
8044
8045         * acinclude.m4 (GMP_PROG_CC_WORKS): Use separate compiles for various
8046         known problems, and indicate to the user the reason for rejecting.
8047         (GMP_PROG_CXX_WORKS): Ditto, and insist on being able to execute each
8048         compiled program.
8049
8050 2003-07-05  Kevin Ryde  <kevin@swox.se>
8051
8052         * config.sub: Add comments to our alias transformations.
8053
8054         * configfsf.sub, configfsf.guess: Update to 2003-07-04.
8055
8056         * acinclude.m4 (GMP_PROG_CC_WORKS, GMP_PROG_CC_WORKS_LONGLONG): Show
8057         failing program in config.log, per other autoconf tests.
8058
8059         * configure.in (i786-*-*): Recognise as pentium4, per configfsf.sub.
8060
8061 2003-06-28  Kevin Ryde  <kevin@swox.se>
8062
8063         * mpz/get_d_2exp.c, mpf/get_d_2exp.c: Avoid res==1.0 when floats round
8064         upwards.
8065
8066         * tests/mpz/t-get_d_2exp.c: New file.
8067         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
8068         * tests/mpf/t-get_d_2exp.c: New file.
8069         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
8070         * tests/x86call.asm, test/tests.h (x86_fldcw, x86_fstcw): New
8071         functions.
8072         * tests/misc.c, tests/tests.h (tests_hardware_getround,
8073         tests_hardware_setround): New functions.
8074
8075 2003-06-25  Kevin Ryde  <kevin@swox.se>
8076
8077         * mpn/sparc64/dive_1.c: New file.
8078
8079         * mpn/sparc64/sparc64.h: New file.
8080         * mpn/sparc64/mode1o.c: Remove things now in sparc64.h.
8081
8082         * mpfr/*: Update to mpfr cvs 2003-06-25.
8083
8084         * acinclude.m4 (GMP_PROG_CC_WORKS): In last change provoking gnupro
8085         gcc, don't use ANSI style function definition.
8086
8087 2003-06-22  Kevin Ryde  <kevin@swox.se>
8088
8089         * mpn/pa32/hppa1_1/udiv.asm: Remove .proc, .entry, .exit and .procend,
8090         handled by PROLOGUE and EPILOGUE.  Comment out .callinfo, per other
8091         asm files.
8092
8093         * gmpxx.h (mpz_class __gmp_binary_divides, __gmp_binary_modulus): Fix
8094         long/mpz and long%mpz for dividend==LONG_MIN divisor==-LONG_MIN.
8095         (mpz_class __gmp_binary_modulus): Fix mpz%long for negative dividend.
8096         * tests/cxx/t-ops.cc (check_mpz): Add test cases for these, merging
8097         operator/ and operator% sections for clarity.
8098
8099 2003-06-21  Kevin Ryde  <kevin@swox.se>
8100
8101         * mpfr/*: Update to mpfr cvs 2003-06-21.
8102
8103         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code by Torbjorn provoking an
8104         ICE from gcc 2.9-gnupro-99r1 under -O2 -mcpu=ev6.
8105         * configure.in (alpha*-*-* gcc_cflags_cpu): Fallback on -mcpu=ev56 for
8106         this compiler.
8107
8108         * gmpxx.h (get_d): Remove comments about long double, double is
8109         correct for get_d, a future long double form would be get_ld.
8110
8111 2003-06-19  Kevin Ryde  <kevin@swox.se>
8112
8113         * mpfr/*: Update to mpfr cvs 2003-06-19.
8114
8115         * mpn/generic/dive_1.c: Share src[0] fetch among all cases.  No need
8116         for separate final umul_ppmm in even case, make it part of the loop.
8117
8118         * mpz/get_d_2exp.c, mpq/set_si.c, mpq/set_ui.c: Nailify.
8119
8120         * mpf/iset_si.c: Rewrite using mpf/set_si.c code, in particular this
8121         nailifies it.
8122         * tests/mpf/t-set_si.c: Nailify tests.
8123
8124         * mpf/iset_ui.c: Nailify, as per mpf/set_ui.c
8125         * tests/mpf/t-set_ui.c: New file.
8126         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
8127
8128 2003-06-15  Kevin Ryde  <kevin@swox.se>
8129
8130         * mpfr/*: Update to mpfr cvs 2003-06-15.
8131
8132         * mpn/x86/k6/mode1o.asm: Remove a bogus ASSERT.
8133
8134 2003-06-12  Kevin Ryde  <kevin@swox.se>
8135
8136         * configure.in (--enable-assert): Emit WANT_ASSERT to config.m4.
8137         * mpn/powerpc32/powerpc-defs.m4, mpn/x86/x86-defs.m4 (ASSERT): Check
8138         WANT_ASSERT is defined.
8139
8140         * mpn/sparc32/v9/udiv.asm: Amend heading, this file is for sparc v9.
8141
8142         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): In libtool openbsd hack,
8143         disard error messages from cp, for the benefit of --disable-shared or
8144         systems not using names libgmp.so.*.
8145
8146         * tests/devel/try.c (try_one): When overlapping, copy source data
8147         after filling dst.  Previously probably used only DEADVAL in
8148         overlapping cases.
8149
8150 2003-06-11  Torbjorn Granlund  <tege@swox.com>
8151
8152         * mpf/random2.c: Rewrite.  Ignore sign of exp parameter.
8153
8154 2003-06-10  Kevin Ryde  <kevin@swox.se>
8155
8156         * mpn/sparc64/mode1o.c: New file.
8157
8158 2003-06-09  Torbjorn Granlund  <tege@swox.com>
8159
8160         * mpn/powerpc32/lshift.asm: Add more cycle counts.
8161         * mpn/powerpc32/rshift.asm: Add more cycle counts.
8162
8163         * mpn/ia64/addmul_1.asm: Reformat comments for 80 columns.
8164
8165         * gmp-impl.h (udiv_qrnnd_preinv1): New name for udiv_qrnnd_preinv.
8166         (udiv_qrnnd_preinv2): New name for udiv_qrnnd_preinv2norm.
8167         (udiv_qrnnd_preinv): New #define, making udiv_qrnnd_preinv2
8168         the default.
8169         * tune/speed.c: Corresponding changes.
8170         * tune/speed.h: Likewise.
8171         * tune/common.c: Likewise.
8172
8173         * mpf/get_str.c: Simplify `off' computation.
8174
8175         * longlong.h: Tabify.
8176
8177 2003-06-09  Kevin Ryde  <kevin@swox.se>
8178
8179         * gmp.texi (ABI and ISA): FreeBSD has sparc64 too, just say "BSD" to
8180         cover all flavours.
8181         * configure.in: Ditto in some comments.
8182
8183         * mpfr/*: Update to mpfr cvs 2003-06-09.
8184
8185         * tests/cxx/Makefile.am (LDADD): Add -L$(top_builddir)/$(LIBS), for
8186         the benefit of gcc 3.2 on itanium2-hp-hpux11.22.
8187
8188         * tune/many.pl (mul_2): Add speed routine settings.
8189         (MAKEFILE): Close when done, for the benefit of development hackery.
8190
8191 2003-06-08  Kevin Ryde  <kevin@swox.se>
8192
8193         * mpfr/*: Update to mpfr cvs 2003-06-08.
8194
8195         * mpn/x86/x86-defs.m4 (femms): Remove fallback to emms.
8196         (cmovCC, psadbw): Remove simulated versions.
8197         (cmov_available_p, psadbw_available_p): Remove.
8198         This trickery was only ever for development purposes on machines
8199         without those instructions.  Removing it simplifies gmp and in
8200         particular avoids complications for fat binary builds.  Development
8201         can be done with a wrapper around "as" if really needed.
8202
8203         * mpn/x86/divrem_1.asm: Don't use loop_or_decljnz, now K6 has its own
8204         mpn/x86/k6/divrem_1.asm.  Amend K6 comments now moved to there.
8205         * mpn/x86/x86-defs.m4 (loop_or_decljnz): Remove, no longer used.
8206
8207         * mpn/x86/k6/divrem_1.asm: New file, derived from mpn/x86/divrem_1.asm.
8208
8209         * mpn/x86/k6/pre_mod_1.asm: Remove comments now in mpn/x86/mod_1.asm.
8210
8211         * mpn/x86/mod_1.asm: Put mpn_mod_1c after mpn_mod_1 for better branch
8212         prediction.  Put done_zero at end for less wastage in alignment.  Use
8213         decl+jnz unconditionally since in fact it's ok on k6.  Amend comments.
8214
8215 2003-06-07  Kevin Ryde  <kevin@swox.se>
8216
8217         * mpn/generic/mode1o.c: Fix ASSERTs on return value.
8218
8219         * gmp.texi (Build Options): Add viac3 and viac32 cpu types.
8220         (ABI and ISA): Note on sparcv9 ABI=32 vs ABI=64 speed.  More indexing.
8221
8222         * configfsf.guess, configfsf.sub: Update to 2003-06-06.
8223         * config.guess: Remove $RANDOM hack supporting netbsd 1.4, not needed
8224         by new configfsf.guess.
8225
8226 2003-06-06  Torbjorn Granlund  <tege@swox.com>
8227
8228         * mpn/ia64/submul_1.asm: Add branch over .align block.
8229
8230 2003-06-05  Torbjorn Granlund  <tege@swox.com>
8231
8232         * longlong.h (add_ssaaaa) [pa64]: Output zero operand as register 0.
8233         Allow more immediate operands.
8234         (sub_ddmmss) [pa64]: Likewise.
8235         (add_ssaaaa) [pa32]: Likewise.
8236         (sub_ddmmss) [pa32]: Likewise.
8237
8238         * mpn/pa64: Change ".level 2.0W" to ".level 2.0w" to please
8239         picky GNU assembler.
8240
8241 2003-06-05  Kevin Ryde  <kevin@swox.se>
8242
8243         * gmp.texi (Integer Special Functions): In mpz_array_init, fix type
8244         shown for integer_array and give an example use.
8245
8246 2003-06-04  Torbjorn Granlund  <tege@swox.com>
8247
8248         * mpf/set_str.c (mpf_set_str): Work around gcc 2 bug triggered on
8249         alpha.
8250
8251 2003-06-03  Kevin Ryde  <kevin@swox.se>
8252
8253         * mpn/x86/pentium/README: Add 7 c/l mmx mul_1, tweak wordings.
8254
8255         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Use octal char constants in test
8256         program, hex is not supported by K&R.
8257
8258 2003-06-02  Torbjorn Granlund  <tege@swox.com>
8259
8260         * mpn/mips64/divrem_1.asm: New file.
8261
8262 2003-06-01  Torbjorn Granlund  <tege@swox.com>
8263
8264         * mpn/powerpc32/lshift.asm: Reformat code.
8265         * mpn/powerpc32/rshift.asm: Reformat code.
8266
8267 2003-05-30  Kevin Ryde  <kevin@swox.se>
8268
8269         * tests/misc.c (tests_start): Set stdout and stderr to unbuffered, to
8270         avoid any chance of losing output on segv etc.
8271
8272 2003-05-28  Torbjorn Granlund  <tege@swox.com>
8273
8274         * mpf/get_str.c: Move label `done' to match TMP_MARK and TMP_FREE.
8275         Remove redundant variable prec.
8276
8277 2003-05-26  Torbjorn Granlund  <tege@swox.com>
8278
8279         * tests/mpz/convert.c: Test bases up to 62.
8280
8281         * tests/mpf/t-conv.c: Test bases up to 62.
8282
8283         * demos/pexpr.c: Don't iterate to get accurate timing.
8284
8285         * mpf/set_str.c (mpn_pow_1_highpart): Cleanup.
8286
8287         * mp_dv_tab.c: Fix typo.
8288
8289         * mpf/get_str.c: Rewrite (now sub-quadratic).
8290
8291 2003-05-22  Kevin Ryde  <kevin@swox.se>
8292
8293         * tests/mpn/t-divrem_1.c: New file.
8294         * tests/mpn/Makefile.am: Add it.
8295
8296 2003-05-22  Torbjorn Granlund  <tege@swox.com>
8297
8298         * config.sub: Recognize viac3* processors.
8299
8300 2003-05-20  Torbjorn Granlund  <tege@swox.com>
8301
8302         * mpn/sparc64/addmul_2.asm: New file.
8303
8304 2003-05-19  Torbjorn Granlund  <tege@swox.com>
8305
8306         * configure.in: Recognize alphaev7* as alphaev67.
8307
8308         * config.guess: Recognize viac3* processors.
8309         * configure.in: Set up path for viac3* processors.
8310         * acinclude.m4 (X86_PATTERN): Include viac3* processors.
8311
8312 2003-05-19  Kevin Ryde  <kevin@swox.se>
8313
8314         * tune/freq.c (freq_pstat_getprocessor): New function.
8315         (freq_all): Use it.
8316         * configure.in (AC_CHECK_HEADERS): Add sys/pstat.h.
8317         (AC_CHECK_FUNCS): Add pstat_getprocessor.
8318
8319 2003-05-15  Kevin Ryde  <kevin@swox.se>
8320
8321         * mpn/generic/mul_fft.c (mpn_mul_fft_decompose): Remove "inline",
8322         since the code is a bit too big.  gcc doesn't actually inline when
8323         alloca (TMP_ALLOC) is used anyway.
8324
8325 2003-05-13  Kevin Ryde  <kevin@swox.se>
8326
8327         * gmp.texi (Notes for Particular Systems): Libtool directory is .libs
8328         not _libs for mingw dll.  Reported by Andreas Fabri.
8329
8330 2003-05-07  Kevin Ryde  <kevin@swox.se>
8331
8332         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code to generate sse2/xmm code
8333         from gcc -march=pentium4, to check the assembler supports that.
8334         (GMP_GCC_PENTIUM4_SSE2, GMP_OS_X86_XMM): New macros.
8335         * configure.in (pentium4-*-*): Use them to see if gcc -march=pentium4
8336         (with sse2) is ok.
8337
8338 2003-05-06  Kevin Ryde  <kevin@swox.se>
8339
8340         * mpz/com.c: Rate size==0 as UNLIKELY, fix comment to mpn_add_1.
8341
8342         * tune/freq.c (<sys/sysinfo.h>): Include only when needed for
8343         getsysinfo(), to avoid a problem with this file on AIX 5.1.
8344
8345 2003-05-03  Torbjorn Granlund  <tege@swox.com>
8346
8347         * mpf/set_str.c: Do not ignore supposedly superfluous digits (in part
8348         reverting last change).
8349
8350 2003-05-03  Kevin Ryde  <kevin@swox.se>
8351
8352         * gmp.texi: Use @code for files in @cindex entries, it looks nicer
8353         than @file.
8354
8355         * Makefile.am: Note gmp 4.1.1 and 4.1.2 version info.
8356
8357         * configure.in, acinclude.m4 (GMP_CRAY_OPTIONS): New macro for Cray
8358         system setups, letting AC_REQUIRE do its job instead of a hard coded
8359         AC_PROG_EGREP.
8360
8361         * config.guess: Amend fake RANDOM to avoid ". configfsf.guess" which
8362         segfaults on Debian "ash" 0.4.16.
8363
8364 2003-05-01  Kevin Ryde  <kevin@swox.se>
8365
8366         * configure.in (AC_CHECK_FUNCS): Add getsysinfo.
8367         (AC_CHECK_HEADERS): Add sys/sysinfo.h and machine/hal_sysinfo.h.
8368         * tune/freq.c (freq_getsysinfo): New function.
8369         (freq_all): Use it.
8370         (freq_sysctlbyname_i586_freq, freq_sysctlbyname_tsc_freq,
8371         freq_sysctl_hw_cpufrequency, freq_sysctl_hw_model): Set
8372         speed_cycletime before trying to print it, when verbose.
8373
8374 2003-04-28  Torbjorn Granlund  <tege@swox.com>
8375
8376         * mpf/set_str.c: Major overhaul.
8377         (mpn_pow_1_highpart): New helper function, meat extracted from
8378         mpf_set_str.
8379
8380 2003-04-24  Kevin Ryde  <kevin@swox.se>
8381
8382         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Quote result string against m4.
8383
8384         * configure, ltmain.sh, aclocal.m4: Update to libtool 1.5.
8385
8386         * longlong.h (add_ssaaaa) [all]: Remove first "%" commutative in each,
8387         since gcc only supports one per asm.
8388
8389         * printf/doprnt.c: Add M for mp_limb_t.
8390         * tests/misc/t-printf.c: Exercise this.
8391
8392         * tests/mpz/t-cmp_d.c: Test infinities.
8393         * tests/mpf/t-cmp_d.c: New file.
8394         * tests/mpf/Makefile.am: Add it.
8395
8396         * mpz/cmp_d.c, mpz/cmpabs_d.c, mpf/cmp_d.c: NaN invalid, Inf bigger
8397         than any value.
8398         * mpz/set_d.c, mpq/set_d.c, mpf/set_d.c: Nan or Inf invalid.
8399
8400         * configure.in (AC_CHECK_FUNCS): Add raise.
8401         * invalid.c: New file.
8402         * Makefile.am: Add it.
8403         * gmp-impl.h (__gmp_invalid_operation): Add prototype.
8404         (DOUBLE_NAN_INF_ACTION): New macro.
8405
8406         * tests/trace.c, tests/tests.h (d_trace): New function.
8407         * tests/misc.c, tests/tests.h (tests_infinity_d): New function.
8408         * tests/misc.c (mpz_erandomb, mpz_errandomb): Use gmp_urandomm_ui.
8409
8410         * tune/tuneup.c, tune/common.c, tests/devel/try.c: Cast various
8411         mp_size_t values for printf %ld in case mp_size_t==int.  Use
8412         gmp_printf for mp_limb_t values.
8413
8414         * gmp.texi (Nomenclature and Types): Add mp_exp_t, mp_size_t,
8415         gmp_randstate_t.  Note ulong for bit counts and size_t for byte
8416         counts.  Don't bother with @noindent.
8417         (Debugging): New valgrind is getting MMX/SSE.
8418         (Integer Comparisons): mpz_cmp_d and mpz_cmpabs_d on NaNs and Infs.
8419         (Float Comparison): mpf_cmp_d behaviour on NaNs and Infs.
8420         (Low-level Functions): Note with mpn_hamdist what hamming distance is.
8421         (Formatted Output Strings): Add type M.
8422         (Internals): Remove remarks on ulong bits and size_t bytes.  Move int
8423         field remarks to ...
8424         (Integer Internals, Float Internals): ... here.
8425
8426 2003-04-19  Kevin Ryde  <kevin@swox.se>
8427
8428         * configure.in (*sparc*-*-* ABI=32): Add umul to extra_functions.
8429
8430         * mpn/x86/p6/mul_basecase.asm: New file.
8431
8432 2003-04-18  Kevin Ryde  <kevin@swox.se>
8433
8434         * configure.in (m68060-*-*): Fallback to gcc -m68000 when -m68060 not
8435         available, and don't use mpn/m68k/mc68020 asm routines.  (Avoids 32x32
8436         mul and 64/32 div which trap to the kernel on 68060.  Advice by
8437         Richard Zidlicky.)
8438         * mpn/m68k/README: Update notes on directory usage.
8439
8440         * tests/cxx/Makefile.am (TESTS_ENVIRONMENT): Add a hack to let the
8441         test programs run with a shared libgmpxx on openbsd 3.2.
8442
8443         * gmp.texi (Language Bindings): Add Guile.
8444
8445 2003-04-12  Kevin Ryde  <kevin@swox.se>
8446
8447         * configure.in (cygwin*, mingw*, pw32*, os2*): Add
8448         -Wl,--export-all-symbols to GMP_LDFLAGS, no longer the default in
8449         latest mingw and libtool.
8450
8451         * acinclude.m4 (GMP_ASM_COFF_TYPE): New macro.
8452         * configure.in (x86s): Use it.
8453         * mpn/x86/x86-defs.m4 (COFF_TYPE): New macro.
8454         (PROLOGUE_cpu): Use it, for the benefit of mingw DLLs.
8455
8456         * gmp-impl.h (mpn_copyi, mpn_copyd): Add __GMP_DECLSPEC.
8457
8458         * gmp.texi (Known Build Problems): Remove windows test program .exe
8459         repeated built, fixed by new libtool.  Remove MacOS C++ shared library
8460         creation, fixed by new libtool.
8461         (Notes for Package Builds, Known Build Problems): Remove DESTDIR notes
8462         on libgmpxx, fixed in new libtool.
8463
8464 2003-04-10  Torbjorn Granlund  <tege@swox.com>
8465
8466         * configure.in: Match turbosparc.
8467         * config.guess: Recognize turbosparc (just for *bsd for now).
8468
8469 2003-04-09  Kevin Ryde  <kevin@swox.se>
8470
8471         * mpf/mul_ui.c [nails]: Call mpf_mul to handle v > GMP_NUMB_MAX.
8472
8473         * tests/mpz/t-mul.c (main): Don't try FFT sizes when FFT disabled via
8474         MP_SIZE_T_MAX, eg. for nails.
8475
8476         * tests/cxx/t-ternary.cc: Split up tests to help compile speed and
8477         memory usage.
8478
8479         * tests/devel/try.c: Print seed under -R, add -E to reseed, use ulong
8480         for seed not uint.
8481
8482         * gmp.texi: Add @: after various abbreviations, more index entries.
8483         (leftarrow): New macro, for non-tex.
8484         (Random State Initialization): Remove commented gmp_randinit_lc, not
8485         going to be implemented.
8486         (Random Number Algorithms): New section.
8487         (References): Add Matsumoto and Nishimura on Mersenne Twister, add
8488         Bertot, Magaud and Zimmermann on GMP Square Root.
8489
8490 2003-04-06  Kevin Ryde  <kevin@swox.se>
8491
8492         * tests/mpz/t-gcd_ui.c: New file.
8493         * tests/mpz/Makefile.am: Add it.
8494
8495         * mpz/gcd_ui.c: Correction to return value on longlong limb systems,
8496         limb might not fit a ulong.
8497
8498 2003-04-04  Kevin Ryde  <kevin@swox.se>
8499
8500         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
8501         2003-04-02.
8502
8503 2003-04-02  Kevin Ryde  <kevin@swox.se>
8504
8505         * configure.in (*-*-cygwin*): No longer force lt_cv_sys_max_cmd_len,
8506         libtool has addressed this now.
8507         (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): Remove this, libtool _LT_AC_LOCK
8508         no longer needs it.
8509
8510         * acinclude.m4 (GMP_PROG_AR): Also set ac_cv_prog_AR and
8511         ac_cv_prog_ac_ct_AR when adding flags to AR, so they're not lost by
8512         libtool's call to AC_CHECK_TOOL.
8513
8514 2003-04-01  Kevin Ryde  <kevin@swox.se>
8515
8516         * configure, aclocal.m4, ltmain.sh: Update to libtool cvs snapshot
8517         2003-03-31.
8518
8519         * configure.in (AC_PROG_F77): Add a dummy AC_PROVIDE to stop libtool
8520         running F77 probes.
8521
8522         * randlc2x.c (gmp_rand_lc_struct): Add comments about what exactly is
8523         in each field.
8524         (randseed_lc): Rename seedp to seedz to avoid confusion with seedp in
8525         the lc function.  Suggested by Pedro Gimeno.
8526         (gmp_randinit_lc_2exp): Use __GMP_ALLOCATE_FUNC_TYPE.  No need for
8527         "+1" in mpz_init2 of _mp_seed.  Don't bother with mpz_init2 for _mp_a.
8528
8529 2003-03-29  Kevin Ryde  <kevin@swox.se>
8530
8531         * configure.in (m68k-*-*): Use -O2, no longer need to fallback to -O.
8532         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): Remove macro.
8533
8534         * configure.in (AC_CHECK_TYPES): Add notes on why tested.
8535
8536         * gmp.texi (GMPrefu, GMPpxrefu, GMPreftopu, GMPpxreftopu): New macros,
8537         use them for all external references to get URLs into HTML output.
8538         (Random State Initialization): Add gmp_randinit_set.
8539         (Random State Miscellaneous): New section.
8540
8541 2003-03-29  Kevin Ryde  <kevin@swox.se>
8542
8543         * randbui.c, randmui.c: New files.
8544         * Makefile.am: Add them.
8545         * gmp-h.in (gmp_urandomb_ui, gmp_urandomm_ui): Add prototypes.
8546         * tests/rand/t-urbui.c, tests/rand/t-urmui.c: New files.
8547         * tests/rand/Makefile.am: Add them.
8548
8549         * gmp-impl.h (gmp_randstate_srcptr): New typedef.
8550         (gmp_randfnptr_t): Add randiset_fn.
8551         * randiset.c: New file.
8552         * Makefile.am: Add it.
8553         * gmp-h.in (gmp_randinit_set): Add prototype.
8554         * randlc2x.c, randmt.c: Add gmp_randinit_set support.
8555         * tests/rand/t-iset.c: New file.
8556         * tests/rand/Makefile.am: Add it.
8557
8558         * tests/misc.c, tests/tests.h (call_rand_algs): New function.
8559
8560 2003-03-27  Kevin Ryde  <kevin@swox.se>
8561
8562         * mpz/bin_uiui.c: Use plain "*" for kacc products rather than
8563         umul_ppmm since high not needed, except for an ASSERT now amended.
8564
8565 2003-03-26  Kevin Ryde  <kevin@swox.se>
8566
8567         * demos/expr/exprfr.c (cbrt, cmpabs, exp2, gamma, nextabove,
8568         nextbelow, nexttoward): New functions.
8569         * demos/expr/t-expr.c: Exercise these.
8570
8571         * mpfr/*: Update to mpfr cvs 2003-03-26.
8572
8573         * gmp-impl.h (MPZ_REALLOC): Use UNLIKELY, to expect no realloc.
8574
8575         * tune/time.c (cycles_works_p): Scope variables down to relevant part
8576         to avoid warnings about unused.
8577
8578         * configfsf.guess, configfsf.sub: Update to 2003-02-22.
8579         * config.guess: Fake a $RANDOM variable when running configfsf.guess,
8580         to workaround a problem on m68k NetBSD 1.4.1.
8581
8582         * mpz/fac_ui.c: Remove unused variable "z1".
8583
8584         * tune/freq.c (freq_irix_hinv): Allow "Processor 0" line from IRIX 6.5.
8585
8586 2003-03-24  Torbjorn Granlund  <tege@swox.com>
8587
8588         * randlc2x.c (randget_lc): Remove write-only variable rn.
8589         * mpf/eq.c: Remove write-only variable usign.
8590         * gen-psqr.c (main): Remove write-only variable numb_bits.
8591
8592 2003-03-17  Torbjorn Granlund  <tege@swox.com>
8593
8594         * Makefile.am (libgmp_la_SOURCES): Add mp_dv_tab.c.
8595         (libmp_la_SOURCES): Add mp_dv_tab.c.
8596
8597         * mpn/alpha/invert_limb.asm: Add a few comments.
8598
8599         * mp_dv_tab.c: New file, defining __gmp_digit_value_tab.
8600
8601         * mpz/set_str.c: Get rid of function digit_value_in_base and use table
8602         __gmp_digit_value_tab instead.
8603         * mpz/inp_str.c: Likewise.
8604         * mpf/set_str.c: Likewise.
8605         * mpbsd/min.c: Likewise.
8606         * mpbsd/xtom.c: Likewise.
8607
8608         * mpz/set_str.c: Allow bases <= 62.  Return error for invalid bases.
8609         * mpz/inp_str.c: Likewise.
8610         * mpf/set_str.c: Likewise.
8611         * mpz/out_str.c: Likewise.
8612         * mpz/get_str.c: Likewise.
8613         * mpf/get_str.c: Likewise.
8614
8615         * mpz/inp_str.c: Restucture to allocate more string space just
8616         before needed.
8617         * mpbsd/min.c: Likewise.
8618
8619         * longlong.h (__udiv_qrnnd_c): Remove redundant casts.
8620         (32-bit sparc): Test HAVE_HOST_CPU_supersparc in addition to various
8621         sparc_v8 spellings.
8622
8623 2003-03-17  Kevin Ryde  <kevin@swox.se>
8624
8625         * mpfr/*: Update to mpfr cvs 2003-03-17.
8626
8627 2003-03-15  Kevin Ryde  <kevin@swox.se>
8628
8629         * Makefile.am (EXTRA_libgmp_la_SOURCES): Use this for TMP_ALLOC
8630         sources, instead of a libdummy.la.
8631
8632 2003-03-16  Torbjorn Granlund  <tege@swox.com>
8633
8634         * config.guess: Recognize supersparc and microsparc for *BSD systems.
8635         Generalize some superscalar recognition patterns.
8636
8637 2003-03-14  Torbjorn Granlund  <tege@swox.com>
8638
8639         * mpn/sparc64/udiv.asm: New file.
8640
8641 2003-03-13  Torbjorn Granlund  <tege@swox.com>
8642
8643         * mpn/sparc64: Table cycle counts.  Update some comments.
8644
8645         * mpn/powerpc64/divrem_1.asm: New file.
8646
8647 2003-03-10  Torbjorn Granlund  <tege@swox.com>
8648
8649         * mpn/generic/mul.c (mpn_mul): Don't blindly expect
8650         MUL_KARATSUBA_THRESHOLD to be a constant.
8651
8652 2003-03-07  Torbjorn Granlund  <tege@swox.com>
8653
8654         * mpn/generic/mul.c (mpn_mul): New operand splitting code for
8655         avoiding cache misses when un >> MUL_KARATSUBA_THRESHOLD > vn.
8656         (MUL_BASECASE_MAX_UN): New #define, default to 500 for now.
8657
8658 2003-03-07  Kevin Ryde  <kevin@swox.se>
8659
8660         * Makefile.am: Put gmp.h and mp.h under $(exec_prefix)/include.
8661         * gmp.texi (Build Options): Add notes on this.
8662         Reported by Vincent Lefèvre.
8663
8664 2003-03-06  Kevin Ryde  <kevin@swox.se>
8665
8666         * configure.in (alpha*-*-* gcc): Add asm option before testing -mcpu,
8667         for the benefit of gcc 2.9-gnupro-99r1 on alphaev68-dec-osf5.1 which
8668         doesn't otherwise put the assembler in the right mode for -mcpu=ev6.
8669
8670 2003-03-05  Torbjorn Granlund  <tege@swox.com>
8671
8672         * mpn/powerpc32/powerpc-defs.m4: Set up renaming for v registers.
8673
8674         * mpz/powm.c (redc): Instead of repeated mpn_incr_u invocations,
8675         accumulate carries and add at the end.
8676         (mpz_powm): Trim tp allocation, now as redc doesn't need carry guard.
8677
8678 2003-02-25  Torbjorn Granlund  <tege@swox.com>
8679
8680         * mpn/x86/pentium4/copyd.asm: Correct header comment.
8681
8682         * mpn/arm/addmul_1.asm: Correct cycle counts.
8683         * mpn/arm/submul_1.asm: Likewise.
8684
8685 2003-02-20  Kevin Ryde  <kevin@swox.se>
8686
8687         * demos/factorize.c (factor_using_pollard_rho): Test k>0 to avoid
8688         infinite loop if k=0 and gcd!=1 reveals a factor.  Reported by John
8689         Pongsajapan.
8690
8691         * gmp.texi, fdl.texi: Update to FDL version 1.2.
8692
8693 2003-02-18  Torbjorn Granlund  <tege@swox.com>
8694
8695         * mpn/arm/mul_1.asm: Fix typo introduced in last change.
8696
8697 2003-02-17  Torbjorn Granlund  <tege@swox.com>
8698
8699         * mpn/ia64/gmp-mparam.h: Retune.
8700
8701         * mpn/sparc64/copyi.asm: Add some header comments.
8702         * mpn/sparc64/copyd.asm: Likewise.
8703
8704         * mpn/arm/mul_1.asm: Put vl operand last for umull/umlal.
8705         Add some header comments.
8706         * mpn/arm/addmul_1.asm: Rewrite.
8707         * mpn/arm/submul_1.asm: Rewrite.
8708         * mpn/arm/gmp-mparam.h: Retune.
8709
8710 2003-02-16  Torbjorn Granlund  <tege@swox.com>
8711
8712         * mpn/arm/copyi.asm: New file.
8713         * mpn/arm/copyd.asm: New file.
8714
8715 2003-02-16  Kevin Ryde  <kevin@swox.se>
8716
8717         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Tolerate incorrect last data
8718         byte seen on an arm system.
8719
8720 2003-02-15  Torbjorn Granlund  <tege@swox.com>
8721
8722         * mpn/arm/gmp-mparam.h: Retune.
8723
8724 2003-02-13  Torbjorn Granlund  <tege@swox.com>
8725
8726         * mpn/powerpc32/750/com_n.asm: Add more cycle counts.
8727
8728 2003-02-13  Kevin Ryde  <kevin@swox.se>
8729
8730         * configure.in (AC_PREREQ): Bump to 2.57.
8731
8732         * configure.in, acinclude.m4 (GMP_GCC_WA_OLDAS): New macro, applying
8733         -Wa,-oldas only when necessary.
8734
8735         * configure.in (powerpc*-*-*): Don't use -Wa,-mppc with gcc, it
8736         overrides options recent gcc adds for -mcpu, making generated code
8737         fail to assemble.
8738
8739         * tune/tuneup.c (mpn_fft_table): Remove definition, it's in mul_fft.c.
8740
8741 2003-02-12  Torbjorn Granlund  <tege@swox.com>
8742
8743         * mpn/x86/pentium4/sse2/gmp-mparam.h: Retune.
8744         * mpn/x86/k7/gmp-mparam.h: Retune.
8745         * mpn/x86/k6/gmp-mparam.h: Retune.
8746         * mpn/x86/p6/gmp-mparam.h: Retune.
8747         * mpn/x86/p6/mmx/gmp-mparam.h: Retune.
8748
8749         * tests/mpz/t-mul.c (main): Rewrite FFT testing code.
8750
8751 2003-02-10  Torbjorn Granlund  <tege@swox.com>
8752
8753         * config.guess: Recognize "power2" systems.
8754
8755         * mpn/powerpc64/gmp-mparam.h: Fix indentation.
8756         * mpn/power/gmp-mparam.h: Retune.
8757         * mpn/alpha/ev6/nails/gmp-mparam.h: Retune.
8758         * mpn/sparc64/gmp-mparam.h: Retune.
8759         * mpn/pa64/gmp-mparam.h: Retune.
8760         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
8761         * mpn/sparc32/v8/gmp-mparam.h: Retune.
8762         * mpn/mips64/gmp-mparam.h: Retune.
8763         * mpn/alpha/ev6/gmp-mparam.h: Retune.
8764         * mpn/powerpc32/gmp-mparam.h: Retune.
8765         * mpn/powerpc32/750/gmp-mparam.h: Retune.
8766         * mpn/alpha/ev5/gmp-mparam.h: Retune.
8767         * mpn/m68k/gmp-mparam.h: Retune.
8768         * mpn/cray/gmp-mparam.h: Set GET_STR_PRECOMPUTE_THRESHOLD.
8769
8770         * configure.in: Undo this, problem doesn't happen any more:
8771         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
8772
8773 2003-02-03  Kevin Ryde  <kevin@swox.se>
8774
8775         * gmp-impl.h (MPN_NORMALIZE, MPN_NORMALIZE_NOT_ZERO): Add parens
8776         around macro parameters.  Reported by Jason Moxham.
8777
8778 2003-02-01  Kevin Ryde  <kevin@swox.se>
8779
8780         * gmp.texi (Low-level Functions): No overlap permitted by mpn_mul_n.
8781         Reported by Jason Moxham.
8782         (Formatted Input Strings): Correction to strtoul cross reference
8783         formatting.
8784         (BSD Compatible Functions): Add index entry for MINT.
8785
8786 2003-01-29  Torbjorn Granlund  <tege@swox.com>
8787
8788         * gmp-impl.h (mpn_mul_fft): Now returns int.
8789
8790 2003-01-29  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
8791
8792         * mpn/generic/mul_fft.c: Major rewrite.
8793
8794 2003-01-25  Kevin Ryde  <kevin@swox.se>
8795
8796         * config.guess (powerpc*-*-*): Remove $dummy.core file when mfpvr
8797         fails on NetBSD.
8798         (trap): Remove $dummy.core on abnormal termination too.
8799
8800         * mpfr/*: Update to mpfr cvs 2003-01-25.
8801
8802 2003-01-24  Torbjorn Granlund  <tege@swox.com>
8803
8804         * mpn/ia64/README: Update cycle counts to match current code.
8805
8806 2003-01-18  Kevin Ryde  <kevin@swox.se>
8807
8808         * mpfr/*: Update to mpfr cvs 2003-01-18.
8809
8810 2003-01-17  Torbjorn Granlund  <tege@swox.com>
8811
8812         * gmp.texi: Canonicalize URLs.
8813
8814 2003-01-15  Kevin Ryde  <kevin@swox.se>
8815
8816         * gmp.texi (Notes for Particular Systems): Add hardware floating point
8817         precision mode.
8818
8819         * mpfr/*, configure, aclocal.m4, config.in: Update to mpfr cvs
8820         2003-01-15.
8821
8822 2003-01-11  Kevin Ryde  <kevin@swox.se>
8823
8824         * mpfr/*: Update to mpfr cvs 2003-01-11.
8825
8826 2003-01-09  Kevin Ryde  <kevin@swox.se>
8827
8828         * mpfr/get_str.c: Update to mpfr cvs 2003-01-09.
8829
8830         * doc/configuration: Various updates.
8831
8832 2003-01-06  Torbjorn Granlund  <tege@swox.com>
8833
8834         * mpn/alpha/copyi.asm: Avoid `nop' mnemonic, unsupported on Cray.
8835         * mpn/alpha/copyd.asm: Likewise.
8836
8837 2003-01-05  Kevin Ryde  <kevin@swox.se>
8838
8839         * demos/expr/t-expr.c (check_r): Tolerate mpfr_set_str new return
8840         value.
8841
8842         * configure, aclocal.m4 (*-*-osf4*, *-*-osf5*): Regenerate with
8843         libtool patch to avoid bash printf option problem when building shared
8844         libraries with cxx.
8845
8846         * configure.in (pentium4-*-*): Use "-march=pentium4 -mno-sse2" since
8847         sse2 causes buggy code from gcc 3.2.1 and is only supported on new
8848         enough kernels.
8849
8850         * acinclude.m4 (GMP_PROG_NM): Add some notes about failures, per
8851         report by Krzysztof Kozminski.
8852
8853         * gmp-h.in (mpz_mdivmod_ui, mpz_mmod_ui): Add parens around "r".
8854
8855         * gmp-h.in (__GMP_CAST): New macro, clean to g++ -Wold-style-cast.
8856         (GMP_NUMB_MASK, mpz_cmp_si, mpq_cmp_si, mpz_odd_p, mpn_divexact_by3,
8857         mpn_divmod): Use it.  Reported by Krzysztof Kozminski.
8858         (mpz_odd_p): No need for the outermost cast to "int".
8859         * tests/cxx/t-cast.cc: New file.
8860         * tests/cxx/Makefile.am: Add it.
8861
8862 2003-01-04  Kevin Ryde  <kevin@swox.se>
8863
8864         * mpfr/set_str.c: Update to mpfr cvs 2003-01-04.
8865
8866         * demos/expr/exprfra.c (e_mpfr_number): Tolerate recent mpfr_set_str
8867         returning count of characters accepted.
8868
8869 2003-01-03  Torbjorn Granlund  <tege@swox.com>
8870
8871         * mpn/alpha/copyi.asm: New file.
8872         * mpn/alpha/copyd.asm: New file.
8873
8874 2003-01-03  Kevin Ryde  <kevin@swox.se>
8875
8876         * demos/expr/t-expr.c: Use __gmpfr on some mpfr internals that have
8877         changed.
8878
8879         * mpfr/*, aclocal.m4, config.in, configure: Update to mpfr cvs
8880         2003-01-03.
8881
8882         * gmp.texi (Introduction to GMP): Mention release announcements
8883         mailing list, and put home page and ftp before mailing lists.
8884
8885 2002-12-28  Torbjorn Granlund  <tege@swox.com>
8886
8887         * mpn/generic/mul_fft.c (mpn_fft_next_size): Simplify.
8888
8889 2002-12-28  Kevin Ryde  <kevin@swox.se>
8890
8891         * acinclude.m4 (M68K_PATTERN): New macro.
8892         (GMP_GCC_M68K_OPTIMIZE): Use it to avoid m6811 and friends.
8893         * configure.in: Ditto.
8894
8895         * tests/mpz/t-import.c, tests/mpz/t-export.c: Use '\xHH' to avoid
8896         warnings about char overflows.
8897         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Ditto.
8898
8899 2002-12-28  Pedro Gimeno  <pggimeno@wanadoo.es>
8900
8901         * randmt.c (randseed_mt, default_state): Fix off-by-one bug on padding.
8902         (randseed_mt): Add ASSERT checking result of mpz_export.
8903
8904 2002-12-24  Kevin Ryde  <kevin@swox.se>
8905
8906         * gmp.texi (Integer Import and Export): Clarify treatment of signs,
8907         reported by Kent Boortz.
8908
8909         * randmt.c: Use gmp_uint_least32_t.
8910         (randseed_mt): Add nails to mpz_export in case mt[i] more than 32 bits.
8911
8912         * gmp-impl.h (gmp_uint_least32_t): New typedef, replacing GMP_UINT32.
8913         * configure.in (AC_CHECK_TYPES): Add uint_least32_t.
8914         (AC_CHECK_SIZEOF): Add unsigned short.
8915
8916 2002-12-22  Kevin Ryde  <kevin@swox.se>
8917
8918         * gmp-impl.h (ULONG_PARITY) [generic C]: Mask result to a single bit.
8919         (ULONG_PARITY) [_CRAY, __ia64]: New macros.
8920         * tests/t-parity.c: New test.
8921         * tests/Makefile.am (check_PROGRAMS): Add it.
8922
8923         * longlong.h (count_trailing_zeros) [ia64]: New macro.
8924
8925         * tests/t-count_zeros.c (check_various): Remove unused variable "n".
8926
8927         * mpn/x86/README: Revise notes on PIC, PLT and GOT.
8928
8929         * demos/perl/GMP.xs, demos/perl/GMP.pm, demos/perl/test.pl: Add "mt"
8930         to GMP::Rand::randstate.
8931
8932 2002-12-22  Pedro Gimeno  <pggimeno@wanadoo.es>
8933
8934         * randmt.c (randseed_mt): Fix bug that might cause the generator to
8935         return all zeros with certain seeds.  Fix WARM_UP==0 case.
8936         (gmp_randinit_mt): Initialize to a known state by default.
8937         (randget_mt): Remove check for uninitialized buffer: no longer needed.
8938         (recalc_buffer): Use ?: instead of two-element array.
8939
8940         * tests/rand/t-mt.c: New test.
8941         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
8942
8943 2002-12-21  Kevin Ryde  <kevin@swox.se>
8944
8945         * cxx/osdoprnti.cc: Use <cstdarg> and <cstring> rather than <stdarg.h>
8946         and <string.h>.  No need for <stdio.h>.
8947
8948         * demos/expr/expr.c, demos/expr/exprfa.c, demos/expr/exprfra.c,
8949         demos/expr/exprza.c: Use mp_get_memory_functions, not
8950         __gmp_allocate_func etc.
8951         * demos/expr/t-expr.c: Don't use gmp-impl.h.
8952         (numberof): New macro.
8953
8954         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
8955         __gmp_free_func): Move declarations to gmp-impl.h
8956
8957         * mp_get_fns.c: New file.
8958         * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
8959         * gmp-h.in (mp_get_memory_functions): Add prototype.
8960         * gmp.texi (Custom Allocation): Add mp_get_memory_functions, refer to
8961         "free" not "deallocate" function.
8962         * gmpxx.h (struct __gmp_alloc_cstring): Use mp_get_memory_functions,
8963         not __gmp_free_func.
8964
8965         * gmp-impl.h [__cplusplus]: Add <cstring> for strlen.
8966         (gmp_allocated_string): Hold length in a field.
8967         * cxx/osdoprnti.cc, cxx/osmpf.cc: Use this.
8968
8969 2002-12-20  Torbjorn Granlund  <tege@swox.com>
8970
8971         * tests/mpz/t-perfsqr.c (check_sqrt): Print more variables upon
8972         failure.
8973
8974         * mpn/generic/rootrem.c: In Newton loop, pad qp with leading zero.
8975
8976 2002-12-19  Torbjorn Granlund  <tege@swox.com>
8977
8978         * mpn/generic/rootrem.c: Allocate 1.585 (log2(3)) times more space
8979         for pp temporary to allow for worst case overestimate of root.
8980         Add some asserts.
8981
8982         * tests/mpz/t-root.c: Generalize and speed up.
8983
8984 2002-12-19  Kevin Ryde  <kevin@swox.se>
8985
8986         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt test.
8987
8988         * gmp-h.in: Don't bother trying to support Compaq C++ in pre-standard
8989         I/O mode.
8990         * gmp.texi (Notes for Particular Systems): Compaq C++ must be used in
8991         "standard" iostream mode.
8992
8993 2002-12-18  Torbjorn Granlund  <tege@swox.com>
8994
8995         * mpn/alpha/mod_34lsub1.asm: Add code for big-endian, using existing
8996         little-endian code only if HAVE_LIMB_LITTLE_ENDIAN is defined.
8997
8998 2002-12-18  Kevin Ryde  <kevin@swox.se>
8999
9000         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): New
9001         defines in config.m4.
9002
9003 2002-12-17  Torbjorn Granlund  <tege@swox.com>
9004
9005         * printf/printffuns.c (gmp_fprintf_reps): Make it actually work
9006         for padding > 256.
9007
9008 2002-12-17  Kevin Ryde  <kevin@swox.se>
9009
9010         * tune/freq.c: Add <string.h> for memcmp.
9011
9012         * mpz/pprime_p.c: Use MPN_MOD_OR_MODEXACT_1_ODD.
9013
9014         * gmp.texi (Formatted Output Strings): %a and %A are C99 not glibc.
9015         (Formatted Input Strings): Type "l" is for double too.  Hex floats are
9016         accepted for mpf_t.
9017         (Formatted Input Functions): Describe tightened parse rule, clarify
9018         return value a bit.
9019
9020         * scanf/doscan.c: Add hex floats, tighten matching to follow C99, for
9021         instance "0x" is no longer acceptable to "%Zi".
9022         Rename "invalid" label to avoid "invalid" variable, SunOS cc doesn't
9023         like them the same.
9024         * tests/misc/t-scanf.c: Update tests.
9025         * tests/misc/t-locale.c (check_input): Don't let "0x" appear from fake
9026         decimal point.
9027
9028         * config.guess (sparc*-*-*): Look at BSD sysctl hw.model to recognise
9029         ultrasparcs.
9030
9031         * mpfr/tests/dummy.c: New file.
9032         * mpfr/tests/Makefile.am (libfrtests_a_SOURCES): Add it.
9033
9034 2002-12-14  Kevin Ryde  <kevin@swox.se>
9035
9036         * mpbsd/Makefile.am (nodist_libmpbsd_la_SOURCES): Move these mpz
9037         sources to libmpbsd_la_SOURCES directly, automake 1.7.2 now gets the
9038         ansi2knr setups right for sources in other directories.
9039
9040         * mpfr/tests/Makefile.am: Add libfrtests.a in preparation for new mpfr.
9041
9042 2002-12-13  Kevin Ryde  <kevin@swox.se>
9043
9044         * mpfr/Makefile.am (mpfr_TEXINFOS, AM_MAKEINFOFLAGS): Allow for
9045         fdl.texi in recent mpfr.
9046
9047         * configure.in (AC_PROG_EGREP): Ensure this is run outside the Cray
9048         conditional AC_EGREP_CPP.
9049
9050         * configure.in (alpha*-*-*): Use gcc -Wa,-oldas if it works, to avoid
9051         problems with new compaq "as" on OSF 5.1.
9052
9053         * mpn/Makefile.am (EXTRA_DIST): Remove Makeasm.am, automake 1.7.2 does
9054         it automatically.
9055
9056         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Remove this hack, fixed by
9057         autoconf 2.57.
9058
9059         * configure.in (AC_CONFIG_LIBOBJ_DIR): Set to mpfr, for the benefit of
9060         new mpfr using LIBOBJ.
9061
9062         * configure.in: (AM_INIT_AUTOMAKE): Use "gnu no-dependencies
9063         $(top_builddir)/ansi2knr".
9064         * */Makefile.am (AUTOMAKE_OPTIONS): Remove, now in configure.in.
9065
9066         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.57.
9067         * */Makefile.in, configure, aclocal.m4, install-sh, mkinstalldirs:
9068         Update to automake 1.7.2.
9069
9070         * gmp.texi (Build Options): Add hppa64 to cpu types.
9071         (ABI and ISA): Add gcc to hppa 2.0.
9072         (Debugging): Add maximum debuggability config options.
9073         (Language Bindings): Add Arithmos, reported by Johan Vervloet.
9074         (Formatted Output Strings): 128 bits is about 40 digits, ll is only
9075         for long long not long double.
9076         (Formatted Input Strings): ll is only for long long not long double.
9077
9078         * mpz/divis.c, mpz/divis_ui.c, mpz/cong.c, mpz/cong_ui.c: Allow d=0,
9079         under the rule n==c mod d iff exists q satisfying n=c+q*d.
9080         * gmp.texi (Integer Division): Describe this.
9081         Suggested by Jason Moxham.
9082
9083 2002-12-13  Pedro Gimeno  <pggimeno@wanadoo.es>
9084
9085         * randlc2x.c (lc): Remove check for seedn < an, which is now
9086         superfluous.  Add ASSERT to ensure it's correct.  Add ASSERT to check
9087         precondition of __GMPN_ADD.
9088         (gmp_randinit_lc_2exp): Avoid reallocation by allocating one extra bit
9089         for both seed and a.  Simplify seedn < p->_cn case.
9090
9091         * tests/rand/t-lc2exp.c (check_bigs): Test negative seeds.
9092
9093 2002-12-12  Torbjorn Granlund  <tege@swox.com>
9094
9095         * mpn/pa32/pa-defs.m4 (PROLOGUE_cpu): Zap spurious argument to `.proc'.
9096         Add empty `.callinfo'.
9097
9098 2002-12-11  Torbjorn Granlund  <tege@swox.com>
9099
9100         * mpn/x86/pentium4/sse2/addmul_1.asm: Don't reuse `ret' symbol for a
9101         label.
9102
9103 2002-12-11  Kevin Ryde  <kevin@swox.se>
9104
9105         * configure.in (hppa*-*-*): Don't use gcc -mpa-risc-2-0 in ABI=1.0.
9106
9107         * mpn/pa32/pa-defs.m4: New file, arranging for .proc/.procend.
9108         * configure.in (hppa*-*-*): Use it.
9109
9110         * printf/doprnt.c: Comments on "ll" versus "L".
9111
9112         * tests/mpz/t-div_2exp.c: Reduce tests, especially the random ones.
9113
9114 2002-12-11  Torbjorn Granlund  <tege@swox.com>
9115
9116         * mpz/get_d.c (limb2dbl): New macro for conversion to `double'.
9117         Define it to something non-trivial for 64-bit hppa.
9118         * mpq/get_d.c: Likewise.
9119         * mpf/get_d.c: Likewise.
9120
9121         * mpn/x86/pentium4/sse2/addmul_1.asm: Unroll to save one c/l.
9122
9123 2002-12-09  Kevin Ryde  <kevin@swox.se>
9124
9125         * tune/Makefile.am: Don't use -static under --disable-static, it tends
9126         not to work.
9127         * configure.in (ENABLE_STATIC): New AM_CONDITIONAL.
9128
9129         * gmp-h.in: Use <iostream> instead of <iosfwd> with Compaq C++ in
9130         pre-standard I/O mode.
9131
9132         * tests/mpz/t-jac.c, tests/mpz/t-scan.c: Reduce tests.
9133
9134 2002-12-08  Kevin Ryde  <kevin@swox.se>
9135
9136         * configure.in (*-*-ultrix*): Remove forcible --disable-shared,
9137         believe this was a generic problem with libtool, now gone.
9138
9139 2002-12-08  Torbjorn Granlund  <tege@swox.com>
9140
9141         * gmp-impl.h (USE_LEADING_REGPARM): Disable for PIC code generation.
9142
9143 2002-12-07  Torbjorn Granlund  <tege@swox.com>
9144
9145         * tests/cxx/t-misc.cc (check_mpq): Use 0/1 for canonical 0 in
9146         mpq_cmp_ui calls.
9147
9148         * configure.in (hppa2.0*-*-*): Pass +O2 instead of +O3 to work around
9149         compiler bug with mpfr/tests/tdiv.
9150
9151 2002-12-07  Kevin Ryde  <kevin@swox.se>
9152
9153         * configure.in (hppa2.0*-*-* ABI=2.0n): Make -mpa-risc-2-0 optional.
9154         New hppa-level-2.0 test using GMP_HPPA_LEVEL_20 to detect assembler
9155         support for 2.0n.
9156         * acinclude.m4 (GMP_PROG_CC_WORKS): Add code that provokes an error
9157         from gcc -mpa-risc-2-0 if the assembler doesn't know 2.0 instructions.
9158         (GMP_HPPA_LEVEL_20): New macro.
9159
9160 2002-12-07  Pedro Gimeno  <pggimeno@wanadoo.es>
9161
9162         * gmp-impl.h (gmp_randfnptr_t.randseed_fn) Return void.
9163         (LIMBS_PER_ULONG, MPN_SET_UI): New macros.
9164         (MPZ_FAKE_UI): Rename couple of parameters.
9165
9166         * randlc2x.c (gmp_rand_lc_struct): _mp_c and _mp_c_limbs replaced
9167         with mpn style _cp and _cn.  All callers changed.
9168         (randseed_lc): Fix limbs(seed) > bits_to_limbs(m2exp) case.
9169         Remove return value.
9170         (gmp_randinit_lc_2exp): Attempt to avoid redundant reallocation.
9171
9172         * randmt.c (mangle_seed): New function by Kevin.
9173         (randseed_mt): Use it instead of mpz_powm, for performance.  Remove
9174         return value.  Remove commented out code (an inferior alternative to
9175         mpz_export).
9176
9177         * randsdui.c (gmp_randseed_ui): Use MPZ_FAKE_UI.
9178
9179         * tests/rand/t-lc2exp.c (check_bigm, check_bigs): New tests.
9180         * tests/rand/t-urndmm.c: Add L to constants in calls, for K&R.
9181
9182 2002-12-06  Torbjorn Granlund  <tege@swox.com>
9183
9184         * configure.in: Remove -g.
9185         (hppa*-*-*): Pass -Wl,+vnocompatwarnings with +DA2.0.
9186
9187 2002-12-05  Torbjorn Granlund  <tege@swox.com>
9188
9189         * mpn/pa64/sqr_diagonal.asm: Remove .entry, .proc, .procend.
9190         * mpn/pa64/udiv.asm: Likewise.
9191
9192 2002-12-05  Kevin Ryde  <kevin@swox.se>
9193
9194         * mpn/pa64/sub_n.asm: Remove space in "sub, db" which gas objects to.
9195         * mpn/pa64/*.asm, tune/hppa2.asm: Use ".level 2.0" for 2.0n, since gas
9196         doesn't like ".level 2.0N".
9197
9198         * configure.in (hppa*-*-*): Group path and flags choices, for clarity.
9199         (hppa1.0*-*-*): Use gcc -mpa-risc-1-0 when available.
9200         (hppa2.0*-*-*): Ditto -mpa-risc-2-0.
9201         (*-*-hpux*): Exclude ABI=2.0w for hpux[1-9] and hpux10, rather than
9202         the converse of allowing it for hpux1[1-9]; ie. list the bad systems
9203         rather than try to guess the good systems.
9204         (hppa2.0*-*-*) [ABI=2.0n ABI=2.0w]: Add gcc to likely compilers.
9205         (hppa*-*-*) [gcc]: Test sizeof(long) to differentiate a 32-bit or
9206         64-bit build of the compiler.
9207         (hppa64-*-*): Add this as equivalent to hppa2.0-*-*.
9208         * acinclude.m4 (GMP_C_TEST_SIZEOF): New macro.
9209
9210         * tests/tests.h (ostringstream::str): Must null-terminate
9211         ostrstream::str() for the string constructor.
9212
9213 2002-12-04  Torbjorn Granlund  <tege@swox.com>
9214
9215         * mpn/pa32/hppa1_1/udiv.asm: Don't wrap symbol to INT64 in L() stuff.
9216
9217         * longlong.h (mpn_udiv_qrnnd_r based udiv_qrnnd): Fix typo.
9218
9219         * mpn/powerpc32/powerpc-defs.m4: Define float registers with `f'
9220         prefix.
9221
9222 2002-12-04  Kevin Ryde  <kevin@swox.se>
9223
9224         * gmp.texi (Floating-point Functions): Note the mantissa is binary and
9225         decimal fractions cannot be represented exactly.  Suggested by Serge
9226         Winitzki.
9227         (Known Build Problems): Note libtool stripping options when linking.
9228         Reported by Vincent Lefevre.
9229
9230         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Don't make an empty result a
9231         failure, that's a valid result.
9232         (GMP_ASM_GLOBL): Establish this from the host cpu type.
9233         (IA64_PATTERN): New macro.
9234         (GMP_PROG_EXEEXT_FOR_BUILD, GMP_C_FOR_BUILD_ANSI,
9235         GMP_CHECK_LIBM_FOR_BUILD): Remove temporary files created.
9236         * configure.in: Use IA64_PATTERN.
9237
9238 2002-12-03  Torbjorn Granlund  <tege@swox.com>
9239
9240         * tune/hppa.asm: Use config.m4.
9241         * tune/hppa2.asm: Likewise.
9242         * tune/hppa2w.asm: Likewise.
9243
9244         * mpn/pa64: Use LDEF.
9245
9246 2002-12-03  Kevin Ryde  <kevin@swox.se>
9247
9248         * INSTALL: Use return rather than exit in the example programs.
9249         Suggested by Richard Dawe.
9250
9251         * gmp.texi (Build Options): Move non-unix notes to ...
9252         (Notes for Particular Systems): ... here.  Mention MS Interix,
9253         reported by Paul Leyland.
9254         (C++ Interface Random Numbers): Add gmp_randinit_mt to examples.
9255
9256         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Must test empty suffix first,
9257         for the benefit of hppa hp-ux.
9258         (GMP_ASM_UNDERSCORE): Grep the output of "nm" instead of trying to
9259         construct an asm file, and in case of failure fallback on no
9260         underscore and a warning.
9261
9262         * longlong.h (count_leading_zeros, count_trailing_zeros) [ev67, ev68]:
9263         Restrict __asm__ ctlz and cttz to __GNUC__.
9264
9265         * gen-psqr.c (HAVE_CONST, const): New macros.
9266
9267         * tests/cxx/t-rand.cc (check_randinit): Add gmp_randinit_mt.
9268
9269 2002-12-02  Torbjorn Granlund  <tege@swox.com>
9270
9271         * gmp-impl.h: Split popc_limb again, combined version gives too many
9272         compiler warnings.
9273
9274 2002-12-01  Torbjorn Granlund  <tege@swox.com>
9275
9276         * mpn/generic/gcdext.c (div1): Disable unused function.
9277
9278         * mpz/root.c: Don't include stdlib.h or longlong.h.
9279         * mpz/rootrem.c: Likewise.
9280
9281         * extract-dbl.c: abort => ASSERT_ALWAYS.
9282         * mpz/set_d.c: Likewise.
9283         * mpn/generic/tdiv_qr.c: Likewise.
9284
9285         * gen-psqr.c (f_cmp_fraction, f_cmp_divisor): Change parameter to
9286         `const void *', to match qsort spec.
9287
9288 2002-12-01  Kevin Ryde  <kevin@swox.se>
9289
9290         * gmp.texi (Integer Division): Fix a couple of @math's for tex.
9291         Use @dots in more places.
9292
9293         * tests/cxx/t-locale.cc: Test non std::locale systems too.
9294         * tests/cxx/clocale.c: New file, reinstating what was localeconv.c,
9295         and subverting nl_langinfo too.
9296         * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
9297
9298         * tests/tests.h (ostringstream, istringstream): Provide fakes of these
9299         if <sstream> not available.
9300         * tests/cxx/t-locale.cc, tests/cxx/t-ostream.cc: Remove <sstream>.
9301         * configure.in (AC_CHECK_HEADERS) [C++]: Add <sstream>.
9302
9303 2002-11-30  Torbjorn Granlund  <tege@swox.com>
9304
9305         * printf/doprnt.c (__gmp_doprnt): Comment out a `break' to shut up
9306         compiler warnings.
9307
9308         * mpn/ia64/invert_limb.asm: Add `many' hints to return insns.
9309
9310         * mpn/ia64/divrem_1.asm: Allocate more local registers; put b0 in
9311         one of them.
9312
9313         * mpn/ia64/popcount.asm: Properly restore register ar.lc.
9314
9315         * longlong.h (umul_ppmm) [ia64]: Form both product parts in asm.
9316
9317         * mpz/bin_uiui.c: Cast umul_ppmm operands.
9318
9319         * scanf/doscan.c (gmpscan): Remove unused label store_get_digits.
9320
9321         * gmp-impl.h: #undef MIN and MAX before #defining.
9322
9323         * mpn/ia64/copyi.asm: Add `;' after bundle declarators.
9324         * mpn/ia64/copyd.asm: Likewise.
9325
9326         * mpn/ia64/divrem_1.asm: Add some syntax to placid the HP-UX assembler.
9327
9328 2002-11-30  Kevin Ryde  <kevin@swox.se>
9329
9330         * configure.in (AC_CHECK_HEADERS): Add nl_types.h.
9331         * tests/misc/t-locale.c: Use this, for nl_item on netbsd 1.4.1.
9332
9333 2002-11-29  Torbjorn Granlund  <tege@swox.com>
9334
9335         * tests/devel/addmul_1.c: Provide prototype for mpn_print.
9336         (OPS): Account for function overhead.
9337         * tests/devel/{submul_1.c,mul_1.c,add_n.c,sub_n.c}: Likewise.
9338
9339         * mpn/ia64/addmul_1.asm: Rewrite.
9340
9341 2002-11-28  Torbjorn Granlund  <tege@swox.com>
9342
9343         * mpn/ia64/sqr_diagonal.asm: Don't allocate any registers.
9344
9345         * mpn/ia64/submul_1.asm: Adapt to Itanium 2.
9346
9347         * mpn/ia64/mul_1.asm: Fix typo in HAVE_ABI_32 code.
9348
9349         * mpn/ia64/add_n.asm: Rewrite.
9350         * mpn/ia64/sub_n.asm: Rewrite.
9351
9352 2002-11-28  Kevin Ryde  <kevin@swox.se>
9353
9354         * mpn/Makefile.am (nodist_EXTRA_libmpn_la_SOURCES): Use this rather
9355         than libdummy.
9356         * tests/Makefile.am (EXTRA_libtests_la_SOURCES): Use this for
9357         x86call.asm and x86check.c rather than libdummy.
9358
9359 2002-11-27  Torbjorn Granlund  <tege@swox.com>
9360
9361         * tests/mpz/t-mul.c: Implement reference Karatsuba multiplication.
9362         Rewrite testing scheme to run fewer really huge tests.
9363
9364 2002-11-26  Torbjorn Granlund  <tege@swox.com>
9365
9366         * tests: Decrease repetition count for some of the slowest tests.
9367
9368         * mpn/ia64/divrem_1.asm: New file.
9369
9370 2002-11-25  Torbjorn Granlund  <tege@swox.com>
9371
9372         * mpfr/tests/tdiv.c: Decrease number of performed tests.
9373
9374 2002-11-23  Torbjorn Granlund  <tege@swox.com>
9375
9376         * mpn/ia64/mul_1.asm: Rewrite.
9377
9378 2002-11-23  Kevin Ryde  <kevin@swox.se>
9379
9380         * mpn/ia64/README: Add some references.
9381
9382         * gmp.texi (Build Options): Add itanium and itanium2, mention DocBook
9383         and XML from makeinfo, add texinfo top level cross reference.
9384         (Integer Division): Try to clarify 2exp functions a bit.
9385         (C++ Interface Floats): Giving bad string to constructor is undefined.
9386         (C++ Interface Integers, C++ Interface Rationals): Ditto, and show
9387         default base in prototype, not the description.
9388
9389         * config.sub, config.guess, configure.in (itanium, itanium2): New cpu
9390         types.
9391
9392         * tests/misc/t-printf.c, tests/misc/t-scanf.c (check_misc): Suppress
9393         %zd test on glibc prior to 2.1, it's not supported.
9394
9395 2002-11-22  Torbjorn Granlund  <tege@swox.com>
9396
9397         * mpn/ia64/copyi.asm: Optimize for Itanium 2.
9398         * mpn/ia64/copyd.asm: Likewise.
9399
9400 2002-11-20  Torbjorn Granlund  <tege@swox.com>
9401
9402         * mpn/ia64/sqr_diagonal.asm: New file.
9403
9404         * mpn/ia64/submul_1.asm: Handle vl == 0 specially.
9405
9406 2002-11-20  Kevin Ryde  <kevin@swox.se>
9407
9408         * tests/cxx/t-locale.cc: Test with locales imbued into stream, use
9409         <sstream>, eliminated some C-isms.  istream tests disabled, not yet
9410         locale-ized.
9411         * tests/cxx/Makefile.am (t_locale_SOURCES): Remove localeconv.c.
9412         * tests/cxx/localeconv.c: Remove file.
9413
9414         * configure.in (AC_CHECK_TYPES) [C++]: Add std::locale.
9415         * printf/doprntf.c: Add decimal point parameter, remove localeconv use.
9416         * gmp-impl.h (__gmp_doprnt_mpf): Update prototype, bump symbol to
9417         __gmp_doprnt_mpf2 to protect old libgmpxx.
9418         * cxx/osmpf.cc: Use this with ostream locale decimal_point facet.
9419         * printf/doprnt.c: Ditto, with GMP_DECIMAL_POINT.
9420
9421         * gmp-h.in: More comments on __declspec for windows DLLs.
9422
9423         * mpf/set_str.c, scanf/doscan.c: Cast through "unsigned char" for
9424         decimal point string, same as input chars.
9425
9426         * configure.in (AC_CHECK_HEADERS): Add langinfo.h.
9427         (AC_CHECK_FUNCS): Add nl_langinfo.
9428         * gmp-impl.h (GMP_DECIMAL_POINT): New macro.
9429         * mpf/out_str.c, mpf/set_str.c, scanf/doscan.c: Use it, and don't
9430         bother with special code for non-locale systems.
9431         * tests/misc/t-locale.c: Subvert nl_langinfo too.
9432
9433         * configure.in, acinclude.m4 (GMP_ASM_X86_GOT_UNDERSCORE): New macro.
9434         * mpn/x86/x86-defs.m4 (_GLOBAL_OFFSET_TABLE_): New macro, inserting
9435         extra underscore for OpenBSD.
9436         * mpn/x86/README (_GLOBAL_OFFSET_TABLE_): Update notes.
9437         Reported by Christian Weisgerber.
9438
9439         * tests/cxx/t-rand.cc (check_randinit): New function, collecting up
9440         constructor tests.
9441
9442         * tests/cxx/t-ostream.cc: Use <sstream> instead of <strstream>, use
9443         compare instead of strcmp.
9444
9445         * gmpxx.h (__gmp_randinit_lc_2exp_size_t): Return type is int.
9446
9447 2002-11-18  Kevin Ryde  <kevin@swox.se>
9448
9449         * tune/speed.c (r_string): Use CNST_LIMB with <N>bits, spotted by
9450         Torbjorn.
9451
9452 2002-11-19  Torbjorn Granlund  <tege@swox.com>
9453
9454         * mpn/ia64/mul_1.asm: Remove redundant cmp from prologue code.
9455         Streamline prologue.
9456         * mpn/ia64/addmul_1.asm: Likewise.
9457         * mpn/ia64/submul_1.asm: New file.
9458         * mpn/ia64/submul_1.c: Remove.
9459
9460 2002-11-17  Torbjorn Granlund  <tege@swox.com>
9461
9462         * mpn/generic/popham.c: New file, using new faster algorithm.
9463         * mpn/generic/popcount.c: Remove.
9464         * mpn/generic/hamdist.c: Remove.
9465
9466         * mpn/ia64/addmul_1.asm: Don't clobber callee-saves register f16.
9467         * mpn/ia64/mul_1.asm: Likewise.
9468
9469         * mpn/ia64/addmul_1.asm: Add pred.rel declarations.  Resolve RAW
9470         hazards for condition code registers, duplicating code as needed.  Add
9471         prediction to all branches.
9472         * mpn/ia64/mul_1.asm: Likewise.
9473         * mpn/ia64/add_n.asm: Likewise.
9474         * mpn/ia64/sub_n.asm: Likewise.
9475         * mpn/ia64/copyi.asm: Likewise.
9476         * mpn/ia64/copyd.asm: Likewise.
9477
9478         * mpn/generic/random2.c: Add a cast to silence some compilers.
9479
9480 2002-11-16  Torbjorn Granlund  <tege@swox.com>
9481
9482         * mpz/powm.c: Cap allocation by limiting k to 10 (512 precomputed
9483         values).
9484
9485 2002-11-16  Kevin Ryde  <kevin@swox.se>
9486
9487         * configure.in, gmp.texi: Remove powerpc64 ABI=32L, doesn't work and
9488         is unlikely to ever do so.
9489         * configure.in: Allow ABI=32 for powerpc64.
9490         Reported by David Edelsohn.
9491
9492 2002-11-14  Kevin Ryde  <kevin@swox.se>
9493
9494         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add addmul_2.c
9495         addmul_3.c addmul_4.c addmul_5.c addmul_6.c addmul_7.c addmul_8.c.
9496
9497         * gmp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT) [__GNUC__]:
9498         Use __dllexport__ and __dllimport__ to keep out of application
9499         namespace.
9500
9501 2002-11-14  Gerardo Ballabio <gerardo.ballabio@unimib.it>
9502
9503         * gmpxx.h (__gmp_randinit_default_t, __gmp_randinit_lc_2exp_t,
9504         __gmp_randinit_lc_2exp_size_t): Use extern "C" { typedef ... }, for
9505         the benefit of g++ prior to 3.2.
9506
9507 2002-11-12  Kevin Ryde  <kevin@swox.se>
9508
9509         * gmpxx.h (gmp_randclass constructors): Patch from Roberto Bagnara to
9510         use extern "C" on C function pointer arguments.
9511
9512 2002-11-09  Kevin Ryde  <kevin@swox.se>
9513
9514         * configure.in, Makefile.am, printf/Makefile.am,
9515         printf/repl-vsnprintf.c: Handle vsnprintf replacement with C
9516         conditionals.
9517
9518         * acinclude.m4 (AC_LANG_FUNC_LINK_TRY(C)): Workaround troubles recent
9519         HP cc +O3 causes for AC_CHECK_FUNCS.
9520
9521         * gmp.texi (Notes for Particular Systems): Add Sparc app regs.
9522         (Debugging): Note gcc -fstack options to detect overflow.
9523         (Formatted Output Strings, Formatted Input Strings): Format strings
9524         are not multibyte.
9525
9526 2002-11-06  Torbjorn Granlund  <tege@swox.com>
9527
9528         * mpn/generic/tdiv_qr.c: Remove a bogus assert.
9529
9530 2002-11-05  Torbjorn Granlund  <tege@swox.com>
9531
9532         * mpn/generic/tdiv_qr.c: Remove two dead mpn_divrem_2 calls.
9533
9534 2002-11-04  Kevin Ryde  <kevin@swox.se>
9535
9536         * acinclude.m4 (GMP_C_INLINE): Don't define "inline" for C++.
9537
9538         * demos/expr/expr-impl.h (stdarg.h): Test __DECC same as gmp.h.
9539
9540         * mpbsd/mtox.c, printf/obprintf.c, printf/obvprintf.c,
9541         scanf/vsscanf.c, demos/expr/expr.c, demos/expr/exprf.c,
9542         demos/expr/exprfa.c, demos/expr/exprfr.c, demos/expr/exprq.c,
9543         demos/expr/exprz.c, demos/expr/exprza.c: Add <string.h> for strlen and
9544         memcpy.
9545
9546 2002-11-02  Kevin Ryde  <kevin@swox.se>
9547
9548         * longlong.h: Test __x86_64__ not __x86_64.  Reported by Andreas
9549         Jaeger.
9550
9551         * mpz/import.c, mpz/export.c: Use char* subtract from NULL to get
9552         pointer alignment, for the benefit of Cray vector systems.
9553
9554         * cxx/ismpf.cc: Use <clocale>.
9555         * tests/cxx/t-locale.cc: No need to conditionalize <clocale>.
9556
9557         * scanf/doscan.c: Don't use isascii, rely on C99 ctype.h.
9558
9559         * gmp.texi (Build Options): Describe CC_FOR_BUILD, cross reference
9560         texinfo manual.
9561         (ABI and ISA): Add powerpc620 and powerpc630 to powerpc64, add NetBSD
9562         and OpenBSD sparc64.
9563         (Notes for Package Builds): Cross reference libtool manual.
9564         (Notes for Particular Systems): Add OpenBSD to non-MMX versions of gas.
9565         (Known Build Problems): Add MacOS X C++ shared libraries.
9566
9567 2002-10-31  Kevin Ryde  <kevin@swox.se>
9568
9569         * gmp-impl.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
9570         tests/devel/try.c, tests/tests.h, tests/refmpn.c (mpn_addmul_5,
9571         mpn_addmul_6, mpn_addmul_7, mpn_addmul_8): Add testing and measuring.
9572         * configure.in (config.in): Add #undefs of HAVE_NATIVE_mpn_addmul_5,
9573         HAVE_NATIVE_mpn_addmul_6, HAVE_NATIVE_mpn_addmul_7,
9574         HAVE_NATIVE_mpn_addmul_8.
9575         (gmp_mpn_functions_optional): Add addmul_5 addmul_6 addmul_7 addmul_8.
9576
9577         * tests/devel/try.c (ASSERT_CARRY): Remove, now in gmp-impl.h
9578         (try_one): Do dest setups after sources, for benefit of
9579         dst0_from_src1.
9580
9581 2002-11-01  Torbjorn Granlund  <tege@swox.com>
9582
9583         * mpn/generic/tdiv_qr.c: Avoid quadratic behaviour for
9584         sub-division when numerator is more than twice the size of the
9585         denominator.  Simplify loop logic for the same case.  Clean up a
9586         few comments.
9587
9588 2002-10-29  Torbjorn Granlund  <tege@swox.com>
9589
9590         * configure.in (*-cray-unicos*): Pass -hnofastmd again.
9591
9592 2002-10-25  Torbjorn Granlund  <tege@swox.com>
9593
9594         * tests/tadd.c: Disable test of denorms.
9595
9596 2002-10-23  Linus Nordberg  <linus@swox.se>
9597
9598         * gmp.texi (Introduction to GMP): Update section about mailing
9599         lists.
9600
9601 2002-10-23  Kevin Ryde  <kevin@swox.se>
9602
9603         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Suppress this when
9604         __GMP_NO_ATTRIBUTE_CONST_PURE is defined.
9605         * gmp-impl.h (ATTRIBUTE_CONST): Ditto.
9606         * tune/common.c: Use __GMP_NO_ATTRIBUTE_CONST_PURE.
9607
9608         * tune/speed.h, tune/many.pl: Remove ATTRIBUTEs from prototypes.
9609         * tune/speed.h: Remove various "dummy" variables attempting to keep
9610         "pure" calls live, no longer necessary.  They weren't sufficient for
9611         recent MacOS cc anyway.
9612
9613 2002-10-21  Torbjorn Granlund  <tege@swox.com>
9614
9615         * mpn/cray/ieee/addmul_1.c: Handle overlap as in mul_1.c.
9616         * mpn/cray/ieee/submul_1.c: Likewise.
9617
9618 2002-10-19  Kevin Ryde  <kevin@swox.se>
9619
9620         * configure.in (sparcv9 etc -*-*bsd*): Add support for NetBSD and
9621         OpenBSD sparc64.  Reported by Christian Weisgerber.
9622         (AC_CHECK_HEADERS): Add sys/param.h for sys/sysctl.h on *BSD.
9623
9624         * demos/calc/calc.y: Change ={ to {, needed for bison 1.50.
9625
9626         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]:
9627         Should be UDItype.
9628
9629         * mpz/set_str.c, mpf/set_str.c, mpbsd/xtom.c, scanf/sscanffuns.c: Cast
9630         chars through "unsigned char" to zero extend, required by C99 ctype.h.
9631
9632 2002-10-18  Torbjorn Granlund  <tege@swox.com>
9633
9634         * tests/mpz/t-root.c: Test also mpz_rootrem.
9635
9636         * mpn/generic/rootrem.c: Avoid overflow problem when n is huge.
9637
9638         * mpz/root.c: Avoid overflow problems in allocation computation; also
9639         simplify it.  Misc cleanups.
9640
9641         * mpz/rootrem.c: New file.
9642         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
9643
9644 2002-10-17  Torbjorn Granlund  <tege@swox.com>
9645
9646         * gmp-impl.h (popc_limb): Combine variants.
9647
9648 2002-10-14  Kevin Ryde  <kevin@swox.se>
9649
9650         * configure.in (AC_CHECK_HEADERS): Add sys/time.h for sys/resource.h
9651         test, needed by SunOS, and next autoconf will insist headers actually
9652         compile.
9653
9654 2002-10-08  Kevin Ryde  <kevin@swox.se>
9655
9656         * tune/time.c (speed_time_init): Allow for Cray times() apparently
9657         being a cycle counter.
9658
9659         * dumbmp.c (mpz_get_str): Fix buf size allocation.
9660
9661         * tests/trace.c, tests/tests.h (mp_limb_trace): New function.
9662
9663         * tune/speed-ext.c (SPEED_EXTRA_PROTOS): Use __GMP_PROTO.
9664         * tests/devel/try.c (malloc_region): Add a cast for SunOS cc.
9665
9666         * configure.in (AC_CHECK_FUNCS): Add strerror.
9667         (AC_CHECK_DECLS): Add sys_errlist, sys_nerr.
9668         * tune/time.c, tests/devel/try.c: Use them.
9669
9670 2002-10-05  Kevin Ryde  <kevin@swox.se>
9671
9672         * configure.in (AC_CHECK_HEADERS): Test float.h, not in SunOS cc.
9673         * printf/repl-vsnprintf.c: Use this.
9674
9675         * configure.in (*sparc*-*-*): Collect up various options for clarity,
9676         use gcc -mcpu=supersparc and ultrasparc3, use cc -xchip, don't use
9677         -xtarget=native, use cc configs with acc, merge SunOS bundled cc and
9678         SunPRO cc configs.
9679
9680         * gmp-impl.h (gmp_randfnptr_t): Use __GMP_PROTO.
9681         (MPZ_REALLOC): Cast _mpz_realloc return value to mp_ptr, for the
9682         benefit of SunOS cc which requires pointers of the same type on the
9683         two legs of a ?:.
9684
9685         * dumbmp.c (mpz_realloc): Add a cast to avoid a warning from SunOS cc.
9686
9687         * acinclude.m4: Allow for i960 b.out default cc output.
9688
9689         * gmp.texi (Random State Initialization): Add gmp_randinit_mt.
9690         (Perfect Square Algorithm): Describe new mpn_mod_34lsub1 use.
9691         (Factorial Algorithm): Describe Jason's new code.
9692         (Binomial Coefficients Algorithm): Ideas about improvements
9693         moved to doc/projects.html.
9694         (Contributors): Add Jason Moxham and Pedro Gimeno.
9695
9696 2002-10-03  Kevin Ryde  <kevin@swox.se>
9697
9698         * gen-psqr.c: New file.
9699         * Makefile.am, mpn/Makefile.am: Use it to generate mpn/perfsqr.h.
9700         * mpn/generic/perfsqr.c: Use generated data, put mod 256 data into
9701         limbs to save space, use mpn_mod_34lsub1 when good.
9702         * tests/mpn/t-perfsqr.c: New file.
9703         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
9704         * tests/mpz/t-perfsqr.c (check_modulo): New test.
9705         (check_sqrt): New function holding current tests.
9706
9707         * configure.in (AC_INIT): Modernize to package name and version here
9708         rather than AM_INIT_AUTOMAKE, add bug report email.
9709         (AC_CONFIG_SRCDIR): New macro.
9710
9711         * gmp-impl.h (ROUND_UP_MULTIPLE): Fix for non-power-of-2 moduli (not
9712         normal in current uses), clarify the comments a bit.
9713
9714 2002-09-30  Kevin Ryde  <kevin@swox.se>
9715
9716         * mpn/Makeasm.am (.s.lo): Add --tag=CC for the benefit of CCAS!=CC,
9717         same as .S.lo and .asm.lo.
9718
9719         * Makefile.am (gen-fac_ui, gen-fib, gen-bases): Quote source files in
9720         test -f stuff to avoid Sun make rewriting them.
9721
9722 2002-09-28  Kevin Ryde  <kevin@swox.se>
9723
9724         * tests/devel/try.c, tune/speed.c: Avoid strings longer than C99
9725         guarantees.
9726
9727         * tests/refmpn.c, tests/tests.h (refmpn_zero_extend, refmpn_normalize,
9728         refmpn_sqrtrem): New functions.
9729         * tests/devel/try.c (TYPE_SQRTREM): Use refmpn_sqrtrem.
9730         (compare): Correction to tr->dst_size subscripting.
9731
9732         * dumbmp.c: Add several new functions, allow for initial n<d in
9733         mpz_tdiv_q (now in mpz_tdiv_qr actually).
9734
9735         * gen-bases.c (chars_per_limb): Get GMP_NUMB_BITS for base==2,
9736         similarly other powers of 2, which this was in the past.
9737         * tests/refmpn.c (refmpn_chars_per_limb): Ditto.
9738         * tests/mpn/t-mp_bases.c: Test chars_per_limb for power-of-2 bases too.
9739
9740         * Makefile.am, mpz/Makefile.am: Setups for gen-fac_ui.c generating
9741         mpz/fac_ui.h.
9742
9743 2002-09-28  Jason Moxham <J.L.Moxham@maths.soton.ac.uk>
9744
9745         * dumbmp.c (mpz_pow_ui, mpz_addmul_ui, mpz_root): New functions.
9746         * gen-fac_ui.c: New file.
9747         * mpz/fac_ui.c: Rewrite.
9748
9749 2002-09-26  Kevin Ryde  <kevin@swox.se>
9750
9751         * tests/cxx/localeconv.c: New file, split from t-locale.cc.
9752         * tests/cxx/t-locale.cc: Use it.
9753         * tests/cxx/Makefile.am (t_locale_SOURCES): Add it.
9754
9755         * tests/cxx/Makefile.am: Updates for Gerardo's new test programs.
9756
9757 2002-09-26  Gerardo Ballabio <gerardo.ballabio@unimib.it>
9758
9759         * gmpxx.h (__gmp_cmp_function): Bug fixes in double/mpq and
9760         double/mpfr comparisons.
9761
9762         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc, tests/cxx/t-constr.cc,
9763         tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: Revise and add various
9764         tests, including some for mpfr, some split from t-expr.cc.
9765         * tests/cxx/t-locale.cc: Modernize include files.
9766         * tests/cxx/t-ostream.cc: Modernize include files, use cout rather
9767         than printf for diagnostics.
9768         * tests/cxx/t-misc.cc, tests/cxx/t-rand.cc: New file, split from
9769         t-allfuns.cc.
9770         * tests/cxx/t-ops.cc: New file, some split from t-allfuns.cc.
9771         * tests/cxx/t-prec.cc: New file.
9772         * tests/cxx/t-allfuns.cc, tests/cxx/t-expr.cc: Remove files.
9773
9774 2002-09-25  Torbjorn Granlund  <tege@swox.com>
9775
9776         * configure.in (*-cray-unicos*): Remove -hscalar0, it causes too much
9777         performance loss.  Let's trust Cray to fix their compilers.
9778
9779 2002-09-24  Torbjorn Granlund  <tege@swox.com>
9780
9781         * mpn/powerpc32/add_n.asm: Rewrite.
9782         * mpn/powerpc32/sub_n.asm: Rewrite.
9783
9784 2002-09-24  Pedro Gimeno  <pggimeno@wanadoo.es>
9785
9786         * randlc2x.c: Prepare for nails by changing type of _mp_c to mpz_t,
9787         make _mp_seed fixed-size, disallow SIZ(a)==0 to optimize comparisons
9788         for mpn_mul.
9789         * gmp-impl.h (MPZ_FAKE_UI): New macro.
9790
9791         * randmt.c: Some constants made long for K&R compliance; remove UL at
9792         the end of other constants; use mp_size_t where appropriate; use
9793         mpz_export to split the seed.
9794
9795         * gmp-impl.h: Remove type cast in RNG_FNPTR and RNG_STATE, to allow
9796         them to be used as lvalues.
9797         * randclr.c, randlc2x.c, randmt.c, randsd.c: All callers changed.
9798
9799         * mpz/urandomm.c: Replace mpn_cmp with MPN_CMP.
9800
9801         * tests/rand/gen.c: Get rid of gmp_errno.
9802
9803 2002-09-24  Kevin Ryde  <kevin@swox.se>
9804
9805         * gmp.texi (Custom Allocation): Keep allocate_function etc out of the
9806         function index by using @deftypevr.
9807         More index entries.
9808
9809 2002-09-24  Gerardo Ballabio <gerardo.ballabio@unimib.it>
9810
9811         * gmpxx.h (mpfr_class constructors from strings): Precision was set
9812         incorrectly, fixed.
9813
9814 2002-09-23  Torbjorn Granlund  <tege@swox.com>
9815
9816         * mpf/urandomb.c: Don't crash for overlarge nbits argument.
9817         Let nbits==0 mean to fill number with random bits.
9818
9819 2002-09-21  Torbjorn Granlund  <tege@swox.com>
9820
9821         * mpn/alpha/mod_34lsub1.asm: Add r31 dummy operand to `br' instruction.
9822
9823 2002-09-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
9824
9825         * gmpxx.h (__gmp_binary_equal, __gmp_binary_not_equal): Fix broken
9826         mpq/double functions.
9827
9828 2002-09-18  Torbjorn Granlund  <tege@swox.com>
9829
9830         * randmt.c (randget_mt): Fix typo.
9831
9832 2002-09-18  Kevin Ryde  <kevin@swox.se>
9833
9834         * gmp-impl.h (_gmp_rand): Avoid evaluating "state" more than once, for
9835         the benefit places calling it with RANDS.
9836
9837         * randmt.c (randseed_mt): Use mpz_init for mod and seed1, for safety.
9838
9839         * tune/tuneup.c (sqr_karatsuba_threshold): Initialize to
9840         TUNE_SQR_KARATSUBA_MAX so mpn_sqr_n works for randmt initialization.
9841
9842         * gmp.texi (Integer Comparisons): Remove mention of non-existent
9843         mpz_cmpabs_si, reported by Conrad Curry.
9844
9845         * tune/speed.c, tune/speed.h, tune/common.c: Add gmp_randseed,
9846         gmp_randseed_ui and mpz_urandomb.
9847
9848 2002-09-18  Pedro Gimeno  <pggimeno@wanadoo.es>
9849
9850         * tests/rand/gen.c: Add mt, remove lc and bbs.
9851
9852         * Makefile.am (libgmp_la_SOURCES): Add randmt.c, remove randlc.c and
9853         randraw.c.
9854
9855         * randmt.c: New file.
9856         * gmp-h.in (gmp_randinit_mt): Add prototype.
9857         * randdef.c: Use gmp_randinit_mt.
9858
9859         * gmp-impl.h (RNG_FNPTR, RNG_STATE): New macros.
9860         (gmp_randfnptr_t): New structure.
9861         (_gmp_rand): Now a macro not a function.
9862         * gmp-h.in (__gmp_randata_lc): Remove, now internal to randlc2x.c.
9863         (__gmp_randstate_struct): Revise comments on field usage.
9864         * randsd.c, randclr.c: Use function pointer scheme.
9865         * randsdui.c: Use gmp_randseed.
9866         * randraw.c: Remove file.
9867         * randlc2x.c: Collect up lc_2exp related code from randsd.c, randclr.c
9868         and randraw.c, use function pointer scheme, integrate seed==0/a==0
9869         into main case and fix case where bits(a) < m2exp.
9870
9871         * randlc.c: Remove file, never documented and never worked.
9872         * gmp-h.in (gmp_randinit_lc): Remove prototype.
9873
9874 2002-09-16  Torbjorn Granlund  <tege@swox.com>
9875
9876         * mpn/alpha/mod_34lsub1.asm: New file.
9877
9878 2002-09-16  Kevin Ryde  <kevin@swox.se>
9879
9880         * configure.in, acinclude.m4 (GMP_C_RESTRICT): Remove this, not
9881         currently used, and #define restrict upsets Microsoft C headers on
9882         win64.  Reported by David Librik.
9883
9884         * configure.in (x86): Add gcc 3.2 -march and -mcpu flags, remove some
9885         unnecessary -march=i486 fallbacks.
9886
9887         * gmp.texi (Notes for Particular Systems): Note cl /MD is required for
9888         Microsoft C and MINGW to cooperate on I/O.  Explained by David Librik.
9889         (Language Bindings): Add linbox.
9890         * gmp.texi (Language Bindings):
9891
9892 2002-09-12  Kevin Ryde  <kevin@swox.se>
9893
9894         * mpz/aorsmul_i.c: Allow for w==x overlap with nails.  Test
9895         BITS_PER_ULONG > GMP_NUMB_BITS rather than GMP_NAIL_BITS != 0.
9896         * tests/mpz/t-aorsmul.c: Test this.
9897
9898         * tune/common.c: mpn_mod_34lsub1 only exists for GMP_NUMB_BITS%4==0
9899         * tune/speed.c: Add mpn_mod_34lsub1.
9900
9901 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
9902
9903         * rand.c: Remove old disabled BBS code.
9904         * mpf/urandomb.c: Use BITS_TO_LIMBS.
9905
9906 2002-09-10  Kevin Ryde  <kevin@swox.se>
9907
9908         * gmp.texi (Multiplication Algorithms): FFT is now enabled by default.
9909
9910 2002-09-10  Pedro Gimeno  <pggimeno@wanadoo.es>
9911
9912         * mpz/urandomm.c: Use mpn level functions, avoid an infinite loop if
9913         _gmp_rand forever returns all "1" bits.
9914         * tests/rand/t-urndmm.c: New file
9915         * tests/rand/Makefile.am (check_PROGRAMS): Add it.
9916
9917         * gmp-impl.h (BITS_TO_LIMBS): New macro.
9918         * mpz/urandomb.c: Use it, and use MPZ_REALLOC.
9919
9920 2002-09-08  Kevin Ryde  <kevin@swox.se>
9921
9922         * acinclude.m4 (GMP_GCC_WA_MCPU): New macro.
9923         * configure.in (alpha*-*-*): Use it to avoid -Wa,-mev67 if gas isn't
9924         new enough to know ev67.  Reported by David Bremner.
9925
9926 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
9927
9928         * gmpxx.h (__gmpz_value etc): Remove, use mpz_t etc instead.
9929         (__gmp_expr): Reorganise specializations, use __gmp_expr<T,T> not
9930         mpz_class etc.
9931         (mpfr evals): Remove mode parameter, was always
9932         __gmp_default_rounding_mode anyway.
9933
9934 2002-09-07  Kevin Ryde  <kevin@swox.se>
9935
9936         * gmp-h.in, mp-h.in: Use #ifdef for tests, for the benefit of
9937         applications using gcc -Wundef.
9938
9939         * longlong.h: Define COUNT_LEADING_ZEROS_NEED_CLZ_TAB for all alphas,
9940         since mpn/alpha/cntlz.asm always goes into libgmp.so, even for ev67
9941         and ev68 which don't need it.  Reported by David Bremner.
9942
9943         * gmp.texi (Demonstration Programs): New section, expanding on what
9944         was under "Build Options".
9945         (Converting Floats): Don't need \ for _ in @var within @math.
9946         Add and amend various index entries.
9947
9948         * demos/qcn.c: Add -p prime limit option.
9949
9950 2002-08-30  Kevin Ryde  <kevin@swox.se>
9951
9952         * mpz/pprime_p.c: Handle small negatives with isprime, in particular
9953         must do so for n==-2.
9954         * tests/mpz/t-pprime_p.c: New file.
9955         * tests/mpz/Makefile.am: Add it.
9956
9957 2002-08-26  Torbjorn Granlund  <tege@swox.com>
9958
9959         * gmp.texi (Converting Floats): Fix typo in mpf_get_d_2exp docs,
9960         reported by Paul Zimmermann.
9961
9962 2002-08-26  Kevin Ryde  <kevin@swox.se>
9963
9964         * configure.in: Echo the ABI being tried for the compilers.
9965         (powerpc*-*-*): Use powerpc64/aix.m4 for ABI=aix64 too.
9966         (AC_CHECK_FUNCS): Add strtol, for tests/rand/gen.c.
9967
9968 2002-08-24  Kevin Ryde  <kevin@swox.se>
9969
9970         * configure.in (HAVE_HOST_CPU_, HAVE_HOST_CPU_FAMILY_, HAVE_NATIVE_):
9971         Setup templates for these using AH_VERBATIM rather than acconfig.h,
9972         preferred by latest autoconf.  Prune lists to just things used.
9973         * acconfig.h: Remove file.
9974
9975         * mpn/powerpc32/mode1o.asm: Forgot ASM_START.
9976
9977         * tune/time.c (have_cgt_id): Renamed from HAVE_CGT_ID so avoid
9978         confusion with autoconf outputs, and turn it into a "const" variable.
9979
9980 2002-08-23  Torbjorn Granlund  <tege@swox.com>
9981
9982         * configure.in: Choose powerpc32/aix.m4 or powerpc64/aix.m4 based on
9983         ABI, not configuration triple.
9984
9985         * mpz/pprime_p.c: Partially undo last change--handle small and
9986         negative numbers in the same test.
9987
9988 2002-08-22  Kevin Ryde  <kevin@swox.se>
9989
9990         * gmp-impl.h (MUL_FFT_THRESHOLD, SQR_FFT_THRESHOLD): Note
9991         mpn/generic/mul_fft.c is not nails-capable, and don't bother setting
9992         other FFT data for nails.
9993
9994         * configfsf.guess: Update to 2002-08-19.
9995         * configfsf.sub: Update to 2002-08-20.
9996
9997         * config.guess (powerpc*-*-*): Use a { } construct to suppress SIGILL
9998         message on AIX.
9999
10000 2002-08-20  Kevin Ryde  <kevin@swox.se>
10001
10002         * gmp.texi (Build Options): Add ia64 under cpu types.
10003         (ABI and ISA): Describe IRIX 6 ABI=o32.
10004         (Notes for Particular Systems): Remove -march=pentiumpro, now ok.
10005         (Known Build Problems): Binutils 2.12 is ok for libgmp.a.
10006         (Emacs): New section.
10007         (Language Bindings): Update MLton URL, reported by Stephen Weeks.
10008         (Prime Testing Algorithm): New section.
10009         Don't put a blank line after @item in @table since it can make a page
10010         break between the heading and the entry.
10011         Misc tweaks elsewhere, in particular more index entries.
10012
10013         * mpz/millerrabin.c: Need x to be size+1 for change to urandomm.
10014
10015         * gmp-impl.h: Comments on the use of __GMP_DECLSPEC.
10016
10017         * tune/time.c (freq_measure_mftb_one): Use struct_timeval, for the
10018         benefit of mingw.
10019
10020         * tests/refmpn.c, tests/tests.h (ref_addc_limb, ref_subc_limb):
10021         Renamed from add and sub, following gmp-impl.h ADDC_LIMB and SUBC_LIMB.
10022
10023 2002-08-17  Kevin Ryde  <kevin@swox.se>
10024
10025         * mpn/powerpc32/mode1o.asm: New file.
10026         * configure.in, acinclude.m4 (GMP_ASM_POWERPC_PIC_ALWAYS): New macro.
10027         * mpn/asm-defs.m4: Use it to help setting up PIC.
10028
10029         * configure.in (AC_PREREQ): Bump to 2.53.
10030
10031         * mpn/powerpc32/powerpc-defs.m4 (ASSERT): New macro.
10032         (PROLOGUE_cpu): New macro, giving ALIGN(4) not 8.
10033
10034 2002-08-16  Torbjorn Granlund  <tege@swox.com>
10035
10036         * mpn/m68k/lshift.asm: Fix typo in !scale_available_p code.
10037         * mpn/m68k/rshift.asm: Likewise.
10038
10039 2002-08-16  Kevin Ryde  <kevin@swox.se>
10040
10041         * configure.in (--enable-profiling=instrument): New option.
10042         * gmp.texi (Profiling): Describe it.
10043         * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_instrument, ret_internal):
10044         Add support.
10045         (call_mcount): Share PIC setups with call_instrument.
10046         * mpn/x86/*.asm: Use ret_internal.
10047         * mpn/asm-defs.m4 (m4_unquote): New macro.
10048         * tests/mpn/t-instrument.c: New file.
10049         * tests/mpn/Makefile.am: Add it.
10050
10051         * mpn/alpha/umul.asm: Add ASM_END.
10052
10053 2002-08-12  Kevin Ryde  <kevin@swox.se>
10054
10055         * mpz/pprime_p.c: Fake up a local mpz_t to take abs(n), rather than
10056         using mpz_init etc.
10057
10058         * mpz/millerrabin.c: Use mpz_urandomm for uniform selection of x,
10059         reported by Jason Moxham.  Exclude x==n-1, ie. -1 mod n.  Use
10060         gmp_randinit_default.
10061
10062         * mpn/alpha/umul.asm: Use "r" registers, for the benefit of Unicos.
10063
10064         * tests/devel/try.c: Add mpn_copyi and mpn_copyd.
10065
10066 2002-08-09  Kevin Ryde  <kevin@swox.se>
10067
10068         * Makefile.am: Remove configure.lineno from DISTCLEANFILES and gmp.tmp
10069         from MOSTLYCLEANFILES, automake does these itself now.
10070
10071         * */Makefile.in, aclocal.m4, configure, install-sh, missing,
10072         mkinstalldirs: Update to automake 1.6.3.
10073
10074         * mpn/ia64/README: Some notes on assembler syntax.
10075
10076         * mpn/ia64/add_n.asm, mpn/ia64/sub_n.asm: Add .body.
10077         * mpn/ia64/add_n.asm, mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm,
10078         mpn/ia64/sub_n.asm: Position .save ar.lc just before relevant
10079         instruction.
10080         * mpn/ia64/addmul_1.asm, mpn/ia64/mul_1.asm: Add .save ar.pfs and pr.
10081         * mpn/ia64/copyd.asm, mpn/ia64/copyi.asm: Correction to .body position.
10082         * mpn/ia64/lorrshift.asm: Add .prologue stuff.
10083
10084         * configure.in (*-*-unicos*): Remove forcible --disable-shared,
10085         libtool gets this right itself now.
10086
10087 2002-08-07  Kevin Ryde  <kevin@swox.se>
10088
10089         * mpn/x86/pentium/mmx/hamdist.asm: New file, adapted from
10090         mpn/x86/pentium/mmx/popham.asm.
10091         * mpn/x86/pentium/mmx/popham.asm: Remove file, not faster than plain
10092         mpn/x86/pentium/popcount.asm for the popcount.
10093
10094         * mpn/alpha/umul.asm: Use PROLOGUE/EPILOGUE, rename it mpn_umul_ppmm.
10095         * configure.in (alpha*-*-*): Add umul to extra_functions.
10096
10097         * mpz/remove.c: Make src==0 return 0, not do DIVIDE_BY_ZERO.
10098
10099 2002-08-05  Torbjorn Granlund  <tege@swox.com>
10100
10101         * acconfig.h: Remove spurious undefs for mpn_divrem_newton and
10102         mpn_divrem_classic.
10103
10104 2002-08-05  Kevin Ryde  <kevin@swox.se>
10105
10106         * tests/refmpn.c, tests/tests.h, tests/misc/t-printf.c,
10107         tests/mpf/t-trunc.c, tests/mpn/t-mp_bases.c, tests/mpn/t-scan.c,
10108         tests/mpq/t-cmp_ui.c, tests/mpz/bit.c, tests/mpz/t-aorsmul.c,
10109         tests/mpz/t-powm_ui.c tests/mpz/t-root.c, tests/mpz/t-scan.c: More
10110         care with long and mp_size_t parameters, for the benefit of K&R.
10111
10112         * demos/perl/GMP.pm, demos/perl/GMP.xs, demos/perl/GMP/Mpz.pm,
10113         demos/perl/test.pl: Add mpz_import and mpz_export.
10114         * demos/perl/GMP.pm: Remove "preliminary" warning.
10115
10116         * mpn/lisp/gmpasm-mode.el: Set add-log-current-defun-header-regexp to
10117         pick up m4 defines etc.
10118
10119         * Makefile.am (libgmpxx_la_DEPENDENCIES): libgmp.la should be here,
10120         not libgmpxx_la_LIBADD, for the benefit of "make -j2".
10121
10122         * mpn/ia64/*.asm [hpux ABI=32]: Extend 32-bit operands to 64-bits, not
10123         optimal and might not be sufficient, but seems to work.
10124
10125 2002-08-03  Kevin Ryde  <kevin@swox.se>
10126
10127         * gmp.texi (Profiling): Use a table and expand for clarity.
10128         (Integer Special Functions): New section for mpz_array_init,
10129         _mpz_realloc, mpz_getlimbn and mpz_size, to discourage their use.
10130
10131         * configure.in (*-*-msdosdjgpp*): Remove forcible --disable-shared,
10132         libtool gets this right itself now.
10133
10134 2002-07-30  Kevin Ryde  <kevin@swox.se>
10135
10136         * mpn/powerpc32/lshift.asm, mpn/powerpc32/rshift.asm: Lose final mr,
10137         and make final stwu into an stw.
10138
10139         * gmp.texi (Known Build Problems): An easier workaround for DESTDIR,
10140         using LD_LIBRARY_PATH.
10141         (C++ Interface MPFR): Remove mpfrxx.h.
10142
10143         * mpfrxx.h: Remove file.
10144         * Makefile.am: Remove mpfrxx.h.
10145         * tests/cxx/Makefile.am: Add Gerardo's new test programs.
10146
10147 2002-07-30  Gerardo Ballabio <gerardo.ballabio@unimib.it>
10148
10149         * gmpxx.h: Use mpz_addmul etc for ternary a+b*c etc.  Reorganise some
10150         macros for maintainability.  Merge mpfrxx.h.
10151         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: Various updates.
10152         * tests/cxx/t-assign.cc, tests/cxx/t-binary.cc,
10153         tests/cxx/t-ternary.cc, tests/cxx/t-unary.cc: New files.
10154
10155 2002-07-27  Kevin Ryde  <kevin@swox.se>
10156
10157         * longlong.h (count_trailing_zeros) [ia64 __GNUC__]: Don't use
10158         __builtin_ffs for now, doesn't seem to work.
10159
10160         * configure.in: Establish CONFIG_SHELL to avoid a problem with
10161         AC_LIBTOOL_SYS_MAX_CMD_LEN on ia64-*-hpux*.
10162
10163         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_FINDA): Don't let calls to
10164         mpn_gcd_finda go dead.
10165
10166         * mpn/generic/tdiv_qr.c: Inline mpn_rshift and MPN_COPY of 2 limbs.
10167
10168 2002-07-24  Kevin Ryde  <kevin@swox.se>
10169
10170         * demos/primes.c: Use __GMP_PROTO and don't use signed, for the
10171         benefit of K&R.
10172
10173         * demos/calc/calclex.l: Add <string.h> for strcmp.
10174
10175         * mpn/ia64/invert_limb.asm: Use .rodata which works on ia64-*-hpux*
10176         and should be standard, rather than worrying about RODATA.
10177
10178         * gmp.texi (Function Classes): Add cross references.
10179         (Integer Import and Export): Fix return value grouping.
10180
10181         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add // for
10182         ia64.  Add notes on what the various styles are for.
10183
10184         * mpn/ia64/default.m4 (ASM_START): Define to empty, not dnl, so as not
10185         to kill text on the same line.
10186         (EPILOGUE_cpu): Force a newline after "#", so as not to suppress macro
10187         expansion in the rest of the EPILOGUE line.
10188
10189 2002-07-21  Kevin Ryde  <kevin@swox.se>
10190
10191         * tune/speed.h: Fix some missing _PROTOs.
10192
10193         * Makefile.am (DISTCLEANFILES): Add configure.lineno.
10194
10195         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Define
10196         HAVE_DOUBLE_IEEE_BIG_ENDIAN and HAVE_DOUBLE_IEEE_LITTLE_ENDIAN in
10197         config.m4 too.
10198         * mpn/ia64/invert_limb.asm: Add big-endian data.
10199
10200         * tests/mpz/t-jac.c (try_si_zi): Correction to "a" parameter type.
10201
10202 2002-07-20  Kevin Ryde  <kevin@swox.se>
10203
10204         * mpz/bin_ui.c, mpz/jacobi.c, mpz/pprime_p.c, mpn/generic/divis.c:
10205         More care with long and mp_size_t parameters, for the benefit of K&R.
10206
10207         * gmp-impl.h (invert_limb): Use parens around macro arguments.
10208         (mpn_invert_limb): Give prototype and define unconditionally.
10209
10210         * gmp-impl.h (CACHED_ABOVE_THRESHOLD, CACHED_BELOW_THRESHOLD): New
10211         macros.
10212         * mpn/generic/sb_divrem_mn.c: Use them to help gcc let preinv code go
10213         dead when not wanted.
10214
10215 2002-07-17  Kevin Ryde  <kevin@swox.se>
10216
10217         * tests/refmpz.c (refmpz_hamdist): Ensure mp_size_t parameters are
10218         that type, for the benefit of hpux ia64 bundled cc ABI=64.
10219
10220         * configure.in (ia64*-*-hpux*): Need +DD64 in cc_64_cppflags to get
10221         the right headers for ansi2knr.
10222
10223         * acinclude.m4 (GMP_TRY_ASSEMBLE, GMP_ASM_UNDERSCORE): Use $CPPFLAGS
10224         with $CCAS and when linking, as done by the makefiles.
10225         (GMP_ASM_X86_MMX, GMP_ASM_X86_SSE2): Show $CPPFLAGS in diagnostics.
10226
10227         * gmp-impl.h (ieee_double_extract): Setup using HAVE_DOUBLE_IEEE_*.
10228         (GMP_UINT32): New define, 32 bit type for ieee_double_extract.
10229         * configure.in: Add AC_CHECK_SIZEOF unsigned.
10230         * configure.in, acinclude.m4 (GMP_IMPL_H_IEEE_FLOATS): Remove.
10231         (GMP_C_DOUBLE_FORMAT): Instead warn about unknown float here.
10232
10233         * configure.in, acinclude.m4 (GMP_C_SIZES): Remove.
10234         * acinclude.m4 (GMP_INCLUDE_GMP_H_BITS_PER_MP_LIMB): Remove this
10235         scheme, not required.
10236         * configure.in (unsigned long, mp_limb_t): Run AC_CHECK_SIZEOF for
10237         these unconditionally, check mp_limb_t against gmp-mparam.h values.
10238         * gmp-impl.h (BYTES_PER_MP_LIMB, BITS_PER_MP_LIMB): Define based on
10239         SIZEOF_MP_LIMB_T if not provided by gmp-mparam.h.
10240         (BITS_PER_ULONG): Define here now.
10241
10242         * gmp.texi (ABI and ISA): Add HP-UX IA-64 choices.
10243         (Random State Initialization): Typo in m2exp described for
10244         gmp_randinit_lc_2exp_size.
10245         (Formatted Output Functions): Clarify gmp_obstack_printf a bit.
10246         (Formatted Input Strings): Typo in %n summary.
10247
10248         * mpz/inp_raw.c (NTOH_LIMB_FETCH): Use simple generic default, since
10249         endianness detection is now cross-compile friendly.
10250         * mpz/out_raw.c (HTON_LIMB_STORE): Ditto.
10251
10252         * mpz/fib_ui.c: Nailify.
10253         * mpz/random.c: Nailify.
10254
10255         * mpfr/acinclude.m4 (MPFR_CONFIGS): Patch by Vincent for an apparent
10256         float rounding gremlin on powerpc.
10257
10258 2002-07-15  Kevin Ryde  <kevin@swox.se>
10259
10260         * Makefile.am (PRINTF_OBJECTS): Avoid ending in a backslash, hpux ia64
10261         make doesn't like that.
10262
10263         * mpn/ia64/*.asm: Add .sptk to unconditional branches, add ";" after
10264         .mib etc, for the benefit of hpux.
10265
10266         * configure.in (ia64*-*-*): Use ABI=64 on non-HPUX systems, for
10267         consistency.
10268
10269         * gmp-impl.h (ieee_double_extract): Test __sparc__, used by gcc 3.1.
10270         Reported by nix@esperi.demon.co.uk.
10271         * mpfr/mpfr-math.h (_MPFR_NAN_BYTES etc): Ditto.
10272
10273 2002-07-13  Kevin Ryde  <kevin@swox.se>
10274
10275         * mpn/powerpc32/rshift.asm: Rewrite, transformed from lshift.asm.
10276
10277         * tune/tuneup.c (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD):
10278         Always zero for native mpn_divexact_1, mpn_modexact_1_odd.
10279
10280         * gmp-h.in (__GMP_EXTERN_INLINE): Don't use this during configure,
10281         ie. __GMP_WITHIN_CONFIGURE, to avoid needing dependent routines.
10282         * acinclude.m4 (GMP_H_EXTERN_INLINE): Consequent changes.
10283
10284         * gmp-impl.h, mpn/asm-defs.m4 (mpn_addmul_2, mpn_addmul_3,
10285         mpn_addmul_4): Add prototypes and defines.
10286
10287         * gmp.texi (Number Theoretic Functions): Clarify return value.
10288         Reported by Peter Keller.
10289
10290 2002-07-10  Kevin Ryde  <kevin@swox.se>
10291
10292         * configure.in, acinclude.m4 (GMP_PROG_LEX): Remove this in favour of
10293         AM_PROG_LEX, now ok when lex is missing.
10294
10295         * longlong.h (count_leading_zeros) [pentiummmx]: Don't use __clz_tab
10296         variant under LONGLONG_STANDALONE.
10297         (count_trailing_zeros) [ia64 __GNUC__]: Use __builtin_ffs.
10298
10299         * gmp-impl.h (popc_limb): Add an ia64 asm version.
10300         (DItype): Use HAVE_LONG_LONG to choose long long, avoiding _LONGLONG
10301         which is in gcc but means something unrelated in MS Visual C 7.0.
10302         Reported by David Librik.
10303
10304         * mpz/divexact.c: Add an ASSERT that den divides num.
10305
10306         * mpn/asm-defs.m4 (LDEF): New macro.
10307         (INT32, INT64): Use it.
10308         * mpn/pa32/*.asm: Use it.
10309         * mpn/pa32/README: Update notes on labels.
10310
10311         * tests/refmpn.c, tests/tests.h, tests/t-bswap.c (ref_bswap_limb):
10312         Renamed from refmpn_bswap_limb.
10313         * tests/t-bswap.c: Add tests_start/tests_end for randomization.
10314
10315         * tests/refmpn.c, tests/tests.h (ref_popc_limb): New function.
10316         * tests/t-popc.c: New file.
10317         * tests/Makefile.am: Add it.
10318
10319         * mpn/ia64/invert_limb.asm: Use RODATA since ".section .rodata" is not
10320         accepted by ia64-*-hpux*.
10321
10322         * acinclude.m4 (GMP_ASM_BYTE): New macro.
10323         (GMP_ASM_ALIGN_LOG, GMP_ASM_W32): Use it.
10324         (GMP_ASM_LABEL_SUFFIX): Use test compiles, not $host.
10325         (GMP_ASM_GLOBL): Ditto, and add .global for ia64-*-hpux*.
10326         (GMP_ASM_GLOBL_ATTR): Use GMP_ASM_GLOBL result, not $host.
10327         (GMP_ASM_LSYM_PREFIX): Allow any "a-z" nm symbol code, add ".text" to
10328         test program, required by ia64-*-hpux*.
10329         (GMP_ASM_LABEL_SUFFIX): Make LABEL_SUFFIX just the value, not a "$1:",
10330         the former being how it's currently being used in fact.
10331
10332         * configure.in, acinclude.m4 (GMP_PROG_CC_WORKS_LONGLONG): New macro.
10333         * configure.in (ia64-*-hpux*): Add 32 and 64 bit ABI modes.
10334
10335 2002-07-06  Kevin Ryde  <kevin@swox.se>
10336
10337         * tests/cxx/t-allfuns.cc: New file.
10338         * tests/cxx/Makefile.am: Add it.
10339
10340         * mpz/clrbit.c, mpz/setbit.c: Only MPN_NORMALIZE if high limb changes
10341         to zero.  Use _mpz_realloc return value.
10342
10343         * gmp.texi (Build Options, C++ Formatted Output, C++ Formatted Input):
10344         Cross reference to Headers and Libraries for libgmpxx stuff.
10345         (Low-level Functions): mpn_divexact_by3 result based on GMP_NUMB_BITS.
10346         mpn_set_str takes "unsigned char *", reported by Mark Sofroniou.
10347         (C++ Interface General): Describe linking with libgmpxx and libgmp.
10348
10349 2002-07-01  Kevin Ryde  <kevin@swox.se>
10350
10351         * tune/tuneup.c, gmp-impl.h: Eliminate the array of thresholds in
10352         one(), tune just one at a time and let the callers hand dependencies.
10353         Eliminate the second_start_min hack, handle SQR_KARATSUBA_THRESHOLD
10354         oddities in tune_sqr() instead.
10355
10356         * mpn/pa64/umul.asm, mpn/pa64/udiv.asm, mpn/asm-defs.m4, acconfig.h,
10357         longlong.h, tune/speed.c, tune/speed.h, tune/common.c, tune/many.pl,
10358         tests/devel/try.c: Introduce mpn_umul_ppmm_r and mpn_udiv_qrnnd_r
10359         rather than having variant parameter order for mpn_umul_ppmm and
10360         mpn_udiv_qrnnd on pa64.
10361
10362         * gmp-h.in (mpz_export): Remove a spurious parameter name.
10363         * gmp-impl.h (mpn_rootrem): Use __MPN.
10364
10365 2002-06-29  Kevin Ryde  <kevin@swox.se>
10366
10367         * longlong.h (udiv_qrnnd) [hppa32]: Remove mpn_udiv_qrnnd version, the
10368         general mechanism for that suffices.
10369
10370         * mpf/inp_str.c: Fix returned count of chars read, reported by Paul
10371         Zimmermann.  Also fix a memory leak for invalid input.
10372         * tests/mpf/t-inp_str.c: New file.
10373         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
10374
10375         * tests/devel/try.c (mpn_mod_34lsub1): Only exists for
10376         GMP_NUMB_BITS%4==0.
10377         (SIZE2_FIRST): Respect option_firstsize2 for "fraction" case.
10378
10379         * mpn/generic/diveby3.c: Further nailifications.
10380         * gmp-impl.h (MODLIMB_INVERSE_3): Allow for GMP_NUMB_BITS odd.
10381         (GMP_NUMB_CEIL_MAX_DIV3, GMP_NUMB_CEIL_2MAX_DIV3): New constants.
10382         * tests/t-constants.c: Check them.
10383
10384         * gmp-h.in (__GMP_CRAY_Pragma): New macro.
10385         (__GMPN_COPY_REST): Use it.
10386         * gmp-impl.h (CRAY_Pragma): Use it.
10387
10388 2002-06-25  Kevin Ryde  <kevin@swox.se>
10389
10390         * mpz/import.c, mpz/export.c: Cast data pointer through "char *" in
10391         alignment tests, for the benefit of Cray vector systems.
10392
10393         * configure.in (x86-*-*): Remove -march=pentiumpro check, seems ok
10394         with current code.
10395         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO, GMP_GCC_VERSION_GE): Remove
10396         macros, no longer needed
10397
10398         * acinclude.m4 (GMP_ASM_RODATA): Remove temporary files.
10399
10400         * configure.in (GMP_ASM_GLOBL_ATTR): Reposition to avoid duplication
10401         through AC_REQUIRE.
10402
10403 2002-06-23  Kevin Ryde  <kevin@swox.se>
10404
10405         * tests/mpz/t-fib_ui.c (check_fib_table): Check table values, not just
10406         that they're non-zero.
10407
10408         * acinclude.m4 (GMP_GCC_ARM_UMODSI): Match bad "gcc --version" output
10409         exactly, rather than parsing it with GMP_GCC_VERSION_GE.
10410         (GMP_ASM_UNDERSCORE): Use GLOBL_ATTR.
10411
10412         * mpn/pa32/udiv.asm, mpn/pa32/hppa1_1/udiv.asm, mpn/pa64/udiv.asm:
10413         Renamed from udiv_qrnnd.asm, for consistency with other udiv's.
10414         * mpn/pa64/umul.asm: Renamed from umul_ppmm.asm likewise.
10415         * configure.in (hppa*-*-*): Update extra_functions.
10416         (NAILS_SUPPORT): Remove umul_ppmm, udiv_qrnnd, udiv_fp, udiv_nfp from
10417         nails-neutral list, no longer needed.
10418
10419         * gmp-h.in (__DECC): Add notes on testing this for ANSI-ness.
10420         (__GMP_EXTERN_INLINE): Add static __inline for DEC C.
10421         (mpz_mod_ui): Move up to main section, it's still documented.
10422
10423 2002-06-22  Kevin Ryde  <kevin@swox.se>
10424
10425         * mpz/jacobi.c, mpz/kronsz.c, mpz/kronuz.c, mpz/kronzs.c,
10426         mpz/kronzu.c: Allow for odd GMP_NUMB_BITS, tweak a few variable setups.
10427         * gmp-impl.h (JACOBI_STRIP_LOW_ZEROS): New macro.
10428
10429         * mpn/generic/mod_34lsub1.c: Nailify.
10430         * tests/devel/try.c (CNST_34LSUB1): Nailify.
10431         * gmp-impl.h (ADDC_LIMB): New macro.
10432
10433         * gmpxx.h (mpf_class::get_str): Make exponent mp_exp_t&, default
10434         base=10 and ndigits=0.
10435         (mpz_class::set_str, mpq_class::set_str, mpf_class::set_str): Add
10436         versions accepting "const char *".
10437         * mpfrxx.h (mpfr_class::get_str, mpfr_class::set_str): Ditto, and
10438         uncommenting set_str and operator=.
10439         * gmp.texi (C++ Interface Integers, C++ Interface Rationals)
10440         (C++ Interface Floats): Update.
10441
10442         * gmp-impl.h (modlimb_invert): Merge the <=64bits and general versions.
10443         (const, signed): Move to near top of file, fixes --enable-alloca=debug
10444         on K&R.
10445
10446         * gen-fib.c: New file, derived from mainline in mpn/generic/fib2_ui.c.
10447         * dumbmp.c (mpz_init_set_ui): New function.
10448         * Makefile.am, mpn/Makefile.am: Generate fib_table.h, mpn/fib_table.c.
10449         * gmp-impl.h: Use fib_table.h, add __GMP_DECLSPEC to __gmp_fib_table
10450         (for the benefit of tests/mpz/t-fib_ui.c).
10451         * mpn/generic/fib2_ui.c: Remove __gmp_fib_table and generating code.
10452
10453         * Makefile.am: Add mp.h to BUILT_SOURCES, distclean all BUILT_SOURCES,
10454         use += more.
10455
10456         * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_BRANCHES):
10457         Don't let "unknown" get into the cache variables.
10458         (GMP_ASM_TEXT): See what assembles, don't hard-code hpux and aix.
10459         (GMP_PROG_EXEEXT_FOR_BUILD): Add ,ff8 for RISC OS, per autoconf cvs.
10460         (GMP_PROG_CPP_FOR_BUILD): Restructure per AC_PROG_CPP, print correct
10461         result if CPP_FOR_BUILD overrides the cache variable.
10462         (GMP_PROG_CC_FOR_BUILD_WORKS): New macro split from
10463         GMP_PROG_CC_FOR_BUILD.  Allow for "conftest" default compiler output.
10464         * configure.in, acinclude.m4 (GMP_PROG_HOST_CC): Reinstate this,
10465         separating HOST_CC establishment from GMP_PROG_CC_FOR_BUILD.
10466
10467         * configure.in (mpn_objs_in_libgmp): Move mpn/mp_bases.lo ...
10468         * Makefile.am (MPN_OBJECTS): ... to here, add $U, and arrange
10469         MPN_OBJECTS to be common between libgmp and libmp.
10470
10471 2002-06-20  Torbjorn Granlund  <tege@swox.com>
10472
10473         * mpn/generic/mul_n.c (TOOM3_MUL_REC, TOOM3_SQR_REC): Don't check if
10474         basecase is to be invoked when *_TOOM3_THRESHOLD is more than 3 times
10475         the corresponding *_THRESHOLD.
10476
10477 2002-06-20  Kevin Ryde  <kevin@swox.se>
10478
10479         * mpn/ia64/submul_1.c: Add missing TMP_DECL, TMP_MARK, TMP_FREE.
10480         Reported by Paul Zimmermann.
10481
10482         * configure.in, acinclude.m4 (AC_DEFINE): Make templates read "Define
10483         to 1", for clarity as per autoconf.
10484         * acinclude.m4 (GMP_OPTION_ALLOCA): Group WANT_TMP templates.
10485
10486 2002-06-20  Gerardo Ballabio <gerardo.ballabio@unimib.it>
10487
10488         * gmpxx.h, mpfrxx.h: Remove mpz_classref, let mpq_class::get_num and
10489         mpq_class::get_den return mpz_class& as per the documentation.
10490         Reported by Roberto Bagnara.
10491
10492 2002-06-18  Kevin Ryde  <kevin@swox.se>
10493
10494         * tests/rand/t-lc2exp.c: New file.
10495         * tests/rand/Makefile.am: Add it, and use tests/libtests.la.
10496
10497         * randraw.c (lc): Pad seed==0 case with zero limbs, return same
10498         (m2exp+1)/2 bits as normal, right shift "c" result as normal.
10499
10500         * configure.in: Don't bother with line numbers in some diagnostics.
10501         (*-*-mingw*): Use -mno-cygwin if it works, suggested by delta trinity.
10502
10503         * tests/mpz/Makefile.am, tests/mpq/Makefile.am,
10504         tests/misc/Makefile.am, (CLEANFILES): Set to *.tmp for test program
10505         temporaries, to get t-scanf.tmp and reduce future maintenance.
10506
10507 2002-06-16  Torbjorn Granlund  <tege@swox.com>
10508
10509         * mpn/generic/get_str.c (mpn_dc_get_str): Pass scratch memory area in
10510         new `tmp' parameter.  Trim allocation needs by reusing input parameter.
10511
10512 2002-06-15  Torbjorn Granlund  <tege@swox.com>
10513
10514         * mpn/sparc32/v9/udiv.asm: New file.
10515
10516 2002-06-15  Kevin Ryde  <kevin@swox.se>
10517
10518         * acinclude.m4 (GMP_GCC_VERSION_GE): Correction to recognising mingw
10519         gcc 3.1 version number.  Reported by Jim Fougeron.
10520
10521         * configure.in (AC_PROVIDE_AC_LIBTOOL_WIN32_DLL): New define, to make
10522         AC_LIBTOOL_WIN32_DLL work with autoconf 2.53.
10523
10524         * acinclude.m4 (GMP_C_SIZES): Establish BITS_PER_MP_LIMB as a value,
10525         not an expression, for the benefit of the gen-bases invocation.
10526
10527         * config.guess (CC_FOR_BUILD): Try c99, same as configfsf.guess.
10528
10529 2002-06-15  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
10530
10531         * mpfr/set_q.c: Allow for 1 bit numerator or denominator.
10532
10533 2002-06-14  Kevin Ryde  <kevin@swox.se>
10534
10535         * configure.in (AC_C_BIGENDIAN): Use new style action parameters.
10536
10537         * randlc2x.c: Allow for a<0, allow for c>=2^m2exp.
10538         * randraw.c (lc): Allow for a==0.
10539
10540         * mpn/sparc32/udiv.asm: Renamed from udiv_fp.asm.  Don't know if float
10541         is the best way for v7, but it's what configure has chosen since gmp 3.
10542         * configure.in (*sparc*-*-* ABI=32): extra_functions="udiv" for all,
10543         in particular sparc32/v8/udiv.asm is faster (on ultrasparc2) than
10544         udiv_fp previously used for v9 chips.
10545
10546         * gen-bases.c: New file, derived from mpn/mp_bases.c.
10547         * dumbmp.c: New file, mostly by Torbjorn, some by me.
10548         * configure.in, acinclude.m4 (GMP_PROG_CC_FOR_BUILD,
10549         GMP_PROG_CPP_FOR_BUILD, GMP_PROG_EXEEXT_FOR_BUILD,
10550         GMP_C_FOR_BUILD_ANSI, GMP_CHECK_LIBM_FOR_BUILD): New macros.
10551         (GMP_PROG_HOST_CC): Remove, superceded by GMP_PROG_CC_FOR_BUILD.
10552         * Makefile.am: Run gen-bases to create mp_bases.h and mpn/mp_bases.c.
10553         * gmp-impl.h: Use mp_bases.h.
10554         * mpn/mp_bases.c: Remove file.
10555         * mpn/Makefile.am: mp_bases.c now in nodist_libmpn_la_SOURCES.
10556
10557         * tests/mpz/t-cmp_d.c (check_one_2exp): Use volatile to force to
10558         double, fixes gcc 3.1 with -O4.  Reported by Michael Lee.
10559         * configure.in (AC_C_VOLATILE): New macro.
10560
10561         * tests/misc/t-scanf.c: (fromstring_gmp_fscanf): Add missing va_end.
10562         Don't mix varargs and fixed args functions, not good on x86_64.
10563         Reported by Marcus Meissner.
10564
10565         * Makefile.am (EXTRA_DIST): Remove mpfr/README, now in mpfr/Makefile.in
10566
10567         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.53.
10568         * */Makefile.in, install-sh, mdate-sh, missing, aclocal.m4, configure:
10569         Update to automake 1.6.1.
10570         * configfsf.guess, configfsf.sub: Update to 2002-05-29.
10571
10572 2002-06-12  Kevin Ryde  <kevin@swox.se>
10573
10574         * acinclude.m4 (GMP_GCC_VERSION_GE): Recognise mingw gcc 3.1 version.
10575         (GMP_PROG_CC_WORKS): Allow for a_out.exe, as per autoconf.
10576         (GMP_GCC_NO_CPP_PRECOMP, GMP_ASM_UNDERSCORE): Ditto, plus a.exe.
10577
10578 2002-06-09  Torbjorn Granlund  <tege@swox.com>
10579
10580         * randraw.c (lc): Remove broken ASSERT_ALWAYS.
10581
10582         * mpn/x86: Update gmp-mparam.h files with current measures *_THRESHOLD
10583         values.
10584         * mpn/x86/p6/mmx/gmp-mparam.h: New file.
10585
10586 2002-06-09  Kevin Ryde  <kevin@swox.se>
10587
10588         * mpn/x86/*/gmp-mparam.h (USE_PREINV_DIVREM_1): Add tuned settings.
10589
10590         * acconfig.h (HAVE_NATIVE_mpn_preinv_divrem_1): New template.
10591
10592         * tests/refmpn.c, tests/tests.h (refmpn_chars_per_limb,
10593         refmpn_big_base): New functions.
10594         * tests/mpn/t-mp_bases.c: Use them, and don't test big_base_inverted
10595         unless it's being used.
10596
10597         * gmp.texi (Notes for Particular Systems): Using Microsoft C with DLLs.
10598         (Known Build Problems): Notes on MacOS and GCC.
10599         (Integer Logic and Bit Fiddling): Use ULONG_MAX for maximum ulong.
10600         (Low-level Functions): mpn_get_str accepts base==256.
10601         (Formatted Output Functions): Note output is not atomic.
10602         (Internals): Note mp_size_t for limb counts.
10603
10604         * mp-h.in, gmp-h.in (mp_ptr, mp_srcptr, mp_size_t, mp_exp_t): Remove
10605         these types from mp.h, not needed.
10606
10607         * mpfr/tests/tadd.c, mpfr/tests/tmul.c (check): Apply a hack to the
10608         parameter order to make sparc gcc 2.95.2 happy.
10609
10610         * doc/configuration: Notes on bootstrapping.
10611
10612 2002-06-08  Kevin Ryde  <kevin@swox.se>
10613
10614         * mpfr/tests/tsqrt.c, mpfr/tests/tsqrt_ui.c: Suppress tests if sqrt is
10615         not affected by mpfr_set_machine_rnd_mode.
10616
10617         * mpfr/mul_2si.c: Workaround a mips gcc 2.95.3 bug under -O2 -mabi=n32.
10618
10619         * configure.in (alphev56): Fix to use ev5 path.
10620
10621 2002-06-06  Kevin Ryde  <kevin@swox.se>
10622
10623         * gmp-h.in: Use __gmp_const not const, in a number of places.
10624
10625         * configure.in (sparc): Use ABI=32 instead of ABI=standard on v7 and
10626         v8, for consistency with v9 choices.
10627         (sparc64): Restrict GMP_ASM_SPARC_REGISTER to ABI=64.
10628         (x86): Move MMX $path munging to before printout.
10629         (CCAS): Move upward to support this.
10630
10631         * gmp-impl.h (modlimb_invert): Merge macros for specific limb sizes,
10632         add a version for arbitrary limb size, use GMP_NUMB_BITS.
10633         (modlimb_invert, MODLIMB_INVERSE_3): Fix comments to say GMP_NUMB_BITS.
10634
10635         * gmp-h.in (__GMP_LIKELY, __GMP_UNLIKELY): New macros.
10636         (mpz_getlimbn, mpz_perfect_square_p, mpz_popcount): Use them, make the
10637         fetch or mpn call likely, unconditionally calculate the alternative so
10638         as to avoid an "else" clause.
10639         * gmp-impl.h (LIKELY, UNLIKELY): Aliases.
10640
10641         * configure.in, mpfr/tests/Makefile.am: Add $LIBM to $LIBS for
10642         MPFR_CONFIGS so it detects fesetround, and let it go through to
10643         $MPFR_LIBS.
10644         * mpfr/rnd_mode.c: Use gmp-impl.h to get MPFR_HAVE_FESETROUND.
10645
10646         * tests/mpz/t-sizeinbase.c: Disable fake bits test, such pointer
10647         setups are bogus and have been seen failing on hppa.
10648
10649         * tests/misc.c, tests/refmpz.c, tests.tests.h, tests/mpz/t-cong.c:
10650         Rename mpz_flipbit to refmpz_combit and move from misc.c to refmpz.c.
10651
10652 2002-06-05  Torbjorn Granlund  <tege@swox.com>
10653
10654         * tests/mpz/t-powm_ui.c Print proper routine name in error message.
10655
10656 2002-06-03  Kevin Ryde  <kevin@swox.se>
10657
10658         * tune/time.c, tune/freq.c, tune/speed.h: Add powerpc mftb support.
10659         (FREQ_MEASURE_ONE): Move to speed.h, fix tv_sec factor.
10660         (freq_measure): Use for mftb measuring too.
10661         * tune/powerpc.asm, tune/powerpc64.asm: New files.
10662         * configure.in, tune/Makefile.am: Add them.
10663
10664         * gmp-impl.h (popc_limb): Add versions for Cray and fallback for
10665         arbitrary limb size.
10666
10667         * mpn/sparc32/sparc-defs.m4: New file.
10668         * configure.in (sparc*-*-*): Use it.
10669         * acinclude.m4 (GMP_ASM_SPARC_REGISTER): New macro.
10670         * configure.in (sparc64): Use it.  Also, use -Wc,-m64 for linking.
10671         * mpn/sparc64/add_n.asm, mpn/sparc64/addmul_1.asm,
10672         mpn/sparc64/copyd.asm, mpn/sparc64/copyi.asm, mpn/sparc64/lshift.asm,
10673         mpn/sparc64/mul_1.asm, mpn/sparc64/rshift.asm,
10674         mpn/sparc64/sqr_diagonal.asm, mpn/sparc64/sub_n.asm,
10675         mpn/sparc64/submul_1.asm: Use REGISTER for .register.
10676
10677 2002-06-01  Kevin Ryde  <kevin@swox.se>
10678
10679         * mpz/powm_ui.c: Fix for result range in certain circumstances.
10680
10681         * mpn/x86/k6/diveby3.asm: Speedup to 10 c/l, same as divexact_1.
10682         Anomaly pointed out by Alexander Kruppa.
10683
10684 2002-05-31  Torbjorn Granlund  <tege@swox.com>
10685
10686         * mpz/export.c: Cast pointer via `unsigned long' when checking
10687         alignment to avoid compiler warnings.
10688
10689 2002-05-29  Kevin Ryde  <kevin@swox.se>
10690
10691         * gmp-impl.h (BSWAP_LIMB): Versions for m68k, powerpc, and arbitrary
10692         limb size.
10693         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_m68k): New define.
10694
10695 2002-05-27  Torbjorn Granlund  <tege@swox.com>
10696
10697         * mpn/generic/mul_basecase.c: Improve MAX_LEFT handling, returning
10698         when possible.  Add code for mpn_addmul_5 and mpn_addmul_6.
10699
10700 2002-05-25  Kevin Ryde  <kevin@swox.se>
10701
10702         * tune/tuneup.c: Misc nailifications, and disable preinv thresholds
10703         with nails.
10704         * tune/speed.h: Use GMP_NUMB_HIGHBIT with mpn_sb_divrem_mn and
10705         mpn_divrem_2.
10706         * mpz/powm.c (redc): Nailify q.
10707
10708         * tests/mpn/t-scan.c: Reduce the amount of testing, to go faster.
10709
10710 2002-05-23  Torbjorn Granlund  <tege@swox.com>
10711
10712         * Version 4.1 released.
10713
10714         * mpn/alpha/ev6/nails/gmp-mparam.h: New file.
10715
10716         * tests/devel/add_n.c (refmpn_add_n): Nailify.
10717         * tests/devel/sub_n.c (refmpn_sub_n): Nailify.
10718         * tests/devel/addmul_1.c (refmpn_addmul_1): Nailify.
10719         * tests/devel/submul_1.c (refmpn_submul_1): Nailify.
10720
10721         * mpn/alpha/ev6/nails/add_n.asm: New file.
10722         * mpn/alpha/ev6/nails/sub_n.asm: New file.
10723         * mpn/alpha/ev6/nails/mul_1.asm: New file.
10724         * mpn/alpha/ev6/nails/submul_1.asm: New file.
10725
10726 2002-05-22  Torbjorn Granlund  <tege@swox.com>
10727
10728         * mpn/alpha/ev6/nails/addmul_1.asm: New file.
10729
10730         * mpz/inp_str.c (mpz_inp_str_nowhite): Nailify.
10731
10732         * mpn/generic/mul_basecase.c: Update pointers before conditional
10733         MAX_LEFT break statements.
10734
10735 2002-05-21  Torbjorn Granlund  <tege@swox.com>
10736
10737         * tests/mpz/t-gcd.c: Test mpz_gcd_ui.
10738
10739         * mpz/lcm_ui.c: Nailify.
10740
10741         * mpz/gcd_ui.c: Nailify.  Make it work as documented, allowing
10742         NULL to be passed for result parameter.  Fix gcd(0,0) case.
10743
10744         * mpz/set_str.c: Nailify.
10745
10746         * randlc2x.c (gmp_randinit_lc_2exp): Nailify.
10747
10748         From Jakub Jelinek:
10749         * longlong.h (add_ssaaaa,sub_ddmmss) [64-bit sparc]:
10750         Make it actually work.
10751
10752 2002-05-18  Torbjorn Granlund  <tege@swox.com>
10753
10754         * mpf/ui_div.c: Shut up compiler warning.
10755
10756         * mpn/generic/mul_basecase.c: Use mpn_addmul_2, mpn_addmul_3, and
10757         mpn_addmul_4, as available.
10758
10759         * mpn/alpha/ev6/nails/addmul_2.asm: Adjust NAILS_SUPPORT decls.
10760         * mpn/alpha/ev6/nails/addmul_3.asm: Likewise
10761         * mpn/alpha/ev6/nails/addmul_4.asm: Likewise.
10762
10763         * configure.in (*-cray-unicos*): Back again to -hscalar0.
10764         (gmp_mpn_functions_optional): Add mul_3, mul_4, addmul_2, addmul_3,
10765         and addmul_4.
10766         * acconfig.h: Add #undefs for new optional mpn functions.
10767
10768 2002-05-18  Kevin Ryde  <kevin@swox.se>
10769
10770         * gmp.texi (Integer Import and Export): Mention Cray unfilled words.
10771
10772         * mpz/set_d.c, mpq/set_d.c: Use LIMBS_PER_DOUBLE for the output of
10773         __gmp_extract_double.  Reported by Henrik Johansson.
10774
10775 2002-05-17  Torbjorn Granlund  <tege@swox.com>
10776
10777         * mpn/alpha/ev6/nails/addmul_2.asm: New file.
10778         * mpn/alpha/ev6/nails/addmul_3.asm: New file.
10779         * mpn/alpha/ev6/nails/addmul_4.asm: New file.
10780
10781         * mpn/generic/dump.c: Rewrite and nailify.
10782
10783 2002-05-16  Kevin Ryde  <kevin@swox.se>
10784
10785         * mpfr/Makefile.am (EXTRA_DIST): Add BUGS file.
10786
10787 2002-05-15  Torbjorn Granlund  <tege@swox.com>
10788
10789         * configure.in (*-cray-unicos*): Remove -hscalar0, add -hnofastmd
10790         as workaround for compiler bug.
10791         (mips64*-*-*): Pass just -O1 to cc, to work around compiler bug.
10792
10793 2002-05-14  Torbjorn Granlund  <tege@swox.com>
10794
10795         * configure.in (*-cray-unicos*): Pass -hscalar0 to work around
10796         compiler bug for mpz/import.c.
10797
10798 2002-05-11  Torbjorn Granlund  <tege@swox.com>
10799
10800         * mpz/import.c: Cast pointer via `unsigned long' when checking
10801         alignment to avoid compiler warnings.
10802
10803         * mpn/generic/rootrem.c: Adjust allocation of qp temporary area.
10804
10805 2002-05-09  Kevin Ryde  <kevin@swox.se>
10806
10807         * mpz/import.c: Corrections to size store, special case tests, and
10808         general case ACCUMULATE.
10809         * tests/mpz/t-import.c, tests/mpz/t-export.c: More test data.
10810
10811 2002-05-09  Torbjorn Granlund  <tege@swox.com>
10812
10813         * mpn/generic/rootrem.c: Use temp space for root, copy value in place
10814         before returning.
10815         * mpz/root.c: Don't allocate extra limb for root value.
10816         * mpz/perfpow.c: Undo last change.
10817
10818 2002-05-08  Torbjorn Granlund  <tege@swox.com>
10819
10820         * gmp-impl.h (powerpc BSWAP_LIMB_FETCH): Rename local variable to make
10821         it not clash with caller.
10822
10823         * mpn/generic/rootrem.c: New file.
10824         * configure.in (gmp_mpn_functions): Add rootrem and pow_1.
10825         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add rootrem.c and
10826         pow_1.c
10827         * gmp-impl.h (mpn_rootrem): Add declaration.
10828         * mpz/perfpow.c: Amend allocations for mpn_rootrem requirements.
10829         * mpz/root.c: Rewrite to use mpn_rootrem.
10830
10831 2002-05-08  Kevin Ryde  <kevin@swox.se>
10832
10833         * gmp-impl.h (MUL_KARATSUBA_THRESHOLD etc): Remove forced nail values.
10834
10835         * mpf/fits_u.h, mpf/fits_s.h, tests/mpf/t-fits.c: Ignore fraction
10836         part, making the code match the documentation.
10837
10838         * gmpxx.h (struct __gmp_binary_minus): Use mpz_ui_sub.
10839
10840 2002-05-07  Kevin Ryde  <kevin@swox.se>
10841
10842         * mpn/powerpc32/README: New file.
10843
10844         * mpz/root.c: Use unsigned long with mpz_sub_ui not mp_limb_t.
10845
10846         * tune/README: Misc updates including sparc32/v9 smoothness, low res
10847         timebase, and mpn_add_n operand overlaps.
10848         * tune/many.pl: Add udiv.asm support.
10849
10850         * gmp.texi (Build Options): A couple of --build better as --host.
10851         (Known Build Problems, Notes for Package Builds): Add DESTDIR problem.
10852         (Compatibility with older versions): Compatible with 4.x versions.
10853         (Converting Integers): Remove mpz_get_ui + mpz_tdiv_q_2exp decompose.
10854         (Integer Import and Export): New section.
10855         (Miscellaneous Integer Functions): Clarify mpz_sizeinbase returns 1
10856         for operand of 0.
10857         (Language Bindings): Add GNU Pascal.
10858         (Low-level Functions): Add GMP_NUMB_MAX.
10859
10860         * tests/mpz/t-import.c, tests/mpz/t-export.c, tests/mpz/t-get_d.c:
10861         New tests.
10862         * tests/mpz/Makefile.am: Add them.
10863
10864         * mpz/import.c, mpz/export.c: New files.
10865         * Makefile.am, mpz/Makefile.am, gmp-h.in: Add them.
10866
10867         * gmp-h.in, gmp-impl.h (GMP_NUMB_MAX): Move to gmp.h.
10868         * gmp-impl.h (CNST_LIMB): Add cast to mp_limb_t to ensure unsigned.
10869         (CRAY_Pragma, MPN_REVERSE, MPN_BSWAP, MPN_BSWAP_REVERSE,
10870         ASSERT_ALWAYS_LIMB, ASSERT_ALWAYS_MPN): New macros.
10871         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS_MPN.
10872
10873 2002-05-07  Torbjorn Granlund  <tege@swox.com>
10874
10875         * mpz/aors_ui.h: Nailify.
10876
10877         * tests/mpz/t-addsub.c: New file.
10878         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-addsub.
10879
10880         * mpz/ui_sub.c: New file.
10881         * mpz/Makefile.am (libmpz_la_SOURCES): Add ui_sub.c.
10882         * Makefile.am (MPZ_OBJECTS): Ditto.
10883         * gmp-h.in (mpz_ui_sub): Add declaration.
10884
10885         * gmp-impl.h (MPZ_REALLOC): Rewrite to allow the use of _mpz_realloc
10886         return value.
10887
10888         * gmp-h.in (mpn_pow_1): Add declaration.
10889
10890         * mpn/generic/pow_1.c: Handle exp <= 1.  Reverse rp/tp parity scheme
10891         for bn == 1 arm.
10892
10893         * Rename MP_LIMB_T_HIGHBIT => GMP_LIMB_HIGHBIT.
10894
10895 2002-05-06  Torbjorn Granlund  <tege@swox.com>
10896
10897         * demos/pexpr.c (main): Don't call mpz_sizeinbase with negative base.
10898
10899         * randraw.c (lc): Remove an unused variable.
10900
10901         * mpn/generic/get_str.c: Clarify an algorithm description.
10902
10903         * tests/mpf/t-trunc.c: Nailify.
10904         * tests/mpf/t-set_si.c: Disable for nails.
10905
10906         * mpf/cmp_si.c: Nailify.
10907         * mpf/cmp_ui.c: Nailify.
10908         * mpf/div.c: Nailify.
10909         * mpf/div_2exp.c: Nailify.
10910         * mpf/div_ui.c: Nailify.
10911         * mpf/eq.c: Nailify.
10912         * mpf/get_d.c: Nailify.
10913         * mpf/get_d_2exp.c: Nailify.
10914         * mpf/get_si.c: Nailify.
10915         * mpf/get_str.c: Nailify.
10916         * mpf/get_ui.c: Nailify.
10917         * mpf/mul_2exp.c: Nailify.
10918         * mpf/random2.c: Nailify.
10919         * mpf/set_q.c: Nailify.
10920         * mpf/set_si.c: Nailify.
10921         * mpf/set_str.c: Nailify.
10922         * mpf/set_ui.c: Nailify.
10923         * mpf/sub.c: Nailify.
10924         * mpf/ui_div.c: Nailify.
10925         * mpf/ui_sub.c: Nailify.
10926         * mpf/urandomb.c: Nailify.
10927
10928         * gmp-impl.h (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Nailify.
10929
10930         * mpz/get_si.c: Misc variable name changes.
10931
10932         * mpf/fits_u.h: Rewrite - nailify.
10933         * mpf/fits_s.h: Likewise.
10934
10935         * mpz/mod.c: Disambiguate if-statament with extra {}.
10936
10937         * mpf/int_p.c: Fix type of size variables.
10938         * mpf/get_ui: Likewise.
10939         * mpf/get_si: Likewise.
10940         * mpq/equal.c: Likewise.
10941         * mpq/get_d.c: Likewise.
10942         * mpz/cmp_d.c: Likewise.
10943         * mpz/cmpabs_d.c: Likewise.
10944         * mpz/divis_2exp.c: Likewise.
10945         * mpz/kronuz.c: Likewise.
10946         * mpz/kronzu.c: Likewise.
10947         * mpz/kronzs.c: Likewise.
10948         * mpz/kronsz.c: Likewise.
10949         * mpz/scan0.c: Likewise.
10950         * mpz/scan1.c: Likewise.
10951         * mpz/tstbit.c: Likewise.
10952         * mpz/cong_2exp.c: Likewise.
10953         * mpz/divis.c: Likewise.
10954
10955 2002-05-04  Torbjorn Granlund  <tege@swox.com>
10956
10957         * mpn/generic/gcd.c: Additional nailify changes.
10958
10959 2002-05-04  Kevin Ryde  <kevin@swox.se>
10960
10961         * gmp-h.in (__GNU_MP_VERSION): Set to 4.1.
10962         * Makefile.am (-version-info): Bump for new release.
10963
10964 2002-04-30  Torbjorn Granlund  <tege@swox.com>
10965
10966         * mpn/generic/divrem_1.c: Additional nailify changes.
10967         * mpn/generic/mod_1.c: Likewise.
10968
10969         * tests/mpq/t-get_d.c: Print floats with all 16 digits.
10970
10971         * mpq/get_d.c: Nailify.
10972
10973         * tests/mpq/t-set_f.c: Disable for nails.
10974
10975         * mpz/get_d.c: Nailify.
10976
10977         * gmp-impl.h (LIMBS_PER_DOUBLE, MP_BASE_AS_DOUBLE): Nailify.
10978
10979         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Cast maxval to before shifting it.
10980
10981         * extract-dbl.c: Nailify.
10982
10983 2002-04-29  Torbjorn Granlund  <tege@swox.com>
10984
10985         * mpq/md_2exp.c (mord_2exp): Nailify.
10986
10987         * mpq/cmp_ui.c: Nailify.
10988
10989         * mpq/cmp.c (mpq_cmp): Nailify.
10990
10991         * mpn/generic/gcd.c: Nailify.  GNUify code layout.
10992
10993         * mpn/generic/gcdext.c: Nailify.  Misc changes.
10994
10995         * tests/mpz/t-sqrtrem.c: Let argv[1] mean # of repetitions.
10996         * tests/mpz/t-gcd.c: Likewise.
10997
10998         * mpz/gcd.c: Nailify.
10999
11000         * mpn/generic/random.c: Nailify.
11001
11002         * gmp-impl.h (modlimb_invert): Nailify.
11003
11004 2002-04-27  Torbjorn Granlund  <tege@swox.com>
11005
11006         * mpn/generic/gcdext.c (div2): Remove qh parameter.
11007         (mpn_gcdext): Streamline double-limb code.
11008         Move GCDEXT_THRESHOLD check to after initial division.
11009
11010 2002-04-27  Kevin Ryde  <kevin@swox.se>
11011
11012         * gmp-impl.h (JACOBI_MOD_OR_MODEXACT_1_ODD): Allow for odd
11013         GMP_NUMB_BITS.
11014
11015         * tune/time.c (sgi_works_p): Allow for 64-bit counter, and fix
11016         SGI_CYCLECNTR_SIZE handling.
11017
11018         * demos/expr/exprfr.c: Add nan and inf constants.
11019         * demos/expr/t-expr.c: Exercise them.
11020
11021 2002-04-26  Torbjorn Granlund  <tege@swox.com>
11022
11023         * mpz/cmp_ui.c: Fix overflow conditions for nails.
11024
11025         * gmp-h.in (mpz_get_ui): Fix typo from last change.
11026
11027         * mpz/n_pow_ui.c: Adjust allocation for nails.
11028         (GMP_NUMB_HALFMAX): Renamed from MP_LIMB_T_HALFMAX.
11029         Fix umul_ppmm invocation for for nails.
11030
11031 2002-04-24  Torbjorn Granlund  <tege@swox.com>
11032
11033         * mpn/generic/gcdext.c: Simplify by using mpn_tdiv_qr instead of
11034         mpn_divmod.
11035
11036 2002-04-24  Kevin Ryde  <kevin@swox.se>
11037
11038         * configure.in (*-*-cygwin*): Give a sensible default command line
11039         limit, to avoid blowups reported by Jim Fougeron on windows 9x.
11040         (--enable-nails): Make the default 2, since mp_bases has data for that.
11041
11042         * mpfr/mpfr-math.h (__mpfr_nan): Use a "double" for the bytes, to
11043         avoid a mis-conversion on alpha gcc 3.0.2.
11044         (_MPFR_INFP_BYTES, _MPFR_INFM_BYTES): Should be a zero mantissa.
11045
11046 2002-04-23  Torbjorn Granlund  <tege@swox.com>
11047
11048         * mpz/dive_ui.c: Fix typo.
11049
11050         * mpz/fits_s.h: Rewrite.
11051
11052         * mpz/jacobi.c: Nailify.
11053         * mpz/kronuz.c: Additional nailify changes.
11054         * mpz/kronsz.c: Likewise.
11055
11056 2002-04-23  Kevin Ryde  <kevin@swox.se>
11057
11058         * demos/expr/Makefile.am (LDADD): Add $(LIBM) for the benefit of mpfr.
11059
11060         * mpz/divis_ui.c, mpz/cong_ui.c: Nailify.
11061         * mpn/generic/bdivmod.c, mpz/divexact.c, mpz/dive_ui.c: Nailify.
11062         * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem.c,
11063         mpn/generic/divrem_2.c: Nailify ASSERTs.
11064         * mpn/x86/k6/mmx/logops_n.asm, mpn/x86/k6/mmx/com_n.asm: Nailify.
11065         * mpz/inp_raw.c, mpz/out_raw.c: Nailify.
11066         * mpz/kronzu.c, mpz/kronuz.c, mpz/kronzs.c, mpz/kronsz.c: Nailify.
11067         * mpn/generic/divis.c, mpz/cong.c, mpz/cong_2exp.c: Nailify.
11068         * gmp-impl.h (NEG_MOD): Nailify.
11069
11070         * gmp-impl.h, mpn/mp_bases.c: Add back GMP_NUMB_BITS==30 bases data.
11071
11072         * mpfr/get_d.c: Patch from Paul to avoid problem with constant folding
11073         in gcc on OSF.
11074
11075         * mpn/lisp/gmpasm-mode.el: Remove mention of defunct LF macro.
11076
11077 2002-04-22  Torbjorn Granlund  <tege@swox.com>
11078
11079         * demos/pexpr.c: Handle "binomial" operator.
11080
11081         * mpz/cmp_ui.c: Move assignments of `up' out of conditionals.
11082
11083         * mpn/generic/gcdext.c: Fix fencepost error in STAT code.
11084
11085         * gmp-impl.h (mpn_com_n): Nailify.
11086
11087         * tests/mpz/t-cdiv_ui.c: New file.
11088         * tests/mpz/Makefile.am (check_PROGRAMS): Add t-cdiv_ui.
11089         * mpz/cdiv_qr_ui.c: Nailify.
11090         * mpz/cdiv_q_ui.c: Nailify.
11091         * mpz/cdiv_r_ui.c: Nailify.
11092         * mpz/cdiv_ui.c: Nailify.
11093
11094         * tests/misc/t-printf.c (CHECK_N): Add cast to allow `char' to be an
11095         unsigned type.
11096         * tests/misc/t-scanf.c: Likewise.
11097
11098         * mpz/mul_i.h: Rework nails code to handle parameter overlap.
11099
11100         * tests/mpz/t-set_f.c: Disable for nails.
11101
11102 2002-04-21  Torbjorn Granlund  <tege@swox.com>
11103
11104         * mpz/set_si.c: Add cast to support LONG_LONG_LIMB.
11105         * mpz/iset_si.c: Likewise.
11106
11107         * mpz/bin_ui.c: Nailify.
11108         * mpz/bin_uiui.c: Nailify.
11109
11110         * mpz/cmpabs_ui.c: Nailify.
11111
11112         * tests/mpz/t-aorsmul.c: Nailify.
11113         * mpz/aorsmul_i.c (mpz_addmul_ui, mpz_submul_ui): Nailify better.
11114
11115 2002-04-20  Torbjorn Granlund  <tege@swox.com>
11116
11117         * tests/mpz/t-fdiv_ui.c: Check mpz_fdiv_ui.
11118         * tests/mpz/t-tdiv_ui.c: Check mpz_tdiv_ui.
11119
11120         * mpz/tdiv_ui.c: Rewrite nails code.
11121         * mpz/fdiv_ui.c: Nailify.
11122
11123         * tests/mpz/t-tdiv_ui.c: Check returned remainders.
11124         * tests/mpz/t-fdiv_ui.c: Merge in recent t-tdiv_ui changes.
11125
11126         * mpz/tdiv_q_ui.c: Remove spurious TMP_* calls.
11127
11128         * mpz/fdiv_qr_ui.c: Nailify.
11129         * mpz/fdiv_q_ui.c: Nailify.
11130         * mpz/fdiv_r_ui.c: Nailify.
11131
11132         * mpz/get_si.c: Misc nailify changes to shut up compiler warnings.
11133
11134         * mpz/ui_pow_ui.c: Fix typo in last change.
11135
11136 2002-04-20  Kevin Ryde  <kevin@swox.se>
11137
11138         * tests/misc/t-printf.c, tests/misc/t-scanf.c: Check all %n types.
11139
11140         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/p6/mmx/divrem_1.asm
11141         (mpn_preinv_divrem_1): New entrypoint.
11142         (mpn_divrem_1): Avoid a branch when testing high<divisor.
11143         * mpn/asm-defs.m4: Add define_mpn(preinv_divrem_1).
11144         * configure.in: Allow divrem_1.asm to provide mpn_preinv_divrem_1.
11145
11146         * gmp-impl.h [nails]: Add #undefs of MUL_KARATSUBA_THRESHOLD etc, to
11147         override CPU gmp-mparam.h.  Remove JACOBI_BASE_METHOD override since
11148         it's nails-neutral.
11149
11150         * tests/mpn/t-mp_bases.c: New file.
11151         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
11152         * tests/t-constants.c: Move MP_BASES constants checks to it.
11153
11154         * mpn/mp_bases.c: Fix big_base_inverted values for nails.
11155         * gmp-impl.h (MP_BASES_BIG_BASE_INVERTED_10,
11156         MP_BASES_NORMALIZATION_STEPS_10): Fix nails values.
11157         (MP_BASES_*): Remove GMP_NUMB_BITS == 30 data.
11158
11159         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm: Add
11160         NAILS_SUPPORT indicators.
11161
11162         * configure.in: Grep for NAILS_SUPPORT in cpu-specific code, and look
11163         in "nails" subdirectories, print path used.
11164         * mpn/asm-defs.m4 (NAILS_SUPPORT): New macro.
11165
11166         * mpfr/mpfr-test.h: Include config.h, for the benefit of test programs
11167         not using gmp-impl.h.
11168
11169 2002-04-19  Torbjorn Granlund  <tege@swox.com>
11170
11171         * tests/mpz/t-scan.c: Nailify.
11172
11173         * mpz/tdiv_qr_ui.c: Nailify.
11174         * mpz/tdiv_q_ui.c: Nailify.
11175         * mpz/tdiv_r_ui.c: Nailify.
11176         * mpz/tdiv_ui.c: Nailify.
11177
11178         * mpz/cmp_ui.c: Nailify.
11179
11180         * mpz/ui_pow_ui.c: Misc nailify changes to shut up compiler warnings.
11181
11182         * mpz/scan0.c: Nailify.
11183         * mpz/scan1.c: Nailify.
11184
11185         * tests/mpz/t-sizeinbase.c (mpz_fake_bits): Nailify.
11186
11187 2002-04-18  Torbjorn Granlund  <tege@swox.com>
11188
11189         * mpz/aorsmul_i.c: Nailify.
11190
11191         * mpz/cmp_si.c: Nailify (botched).
11192
11193         * mpz/ui_pow_ui.c: Nailify.
11194
11195         * gmp-h.in (__GMPZ_FITS_UTYPE_P): Nailify.
11196
11197         * mpz/fits_s.h: Nailify.
11198
11199         * tests/mpz/bit.c (check_tstbit): Nailify.
11200
11201         From Paul Zimmermann:
11202         * mpn/generic/sqrtrem.c: Nailify.
11203
11204         * mpz/n_pow_ui.c: Nailify.
11205
11206         * mpz/cfdiv_r_2exp.c: Nailify.
11207
11208         * randraw.c (lc): Undo: Let mpn_rshift put result in place to avoid
11209         extra MPN_COPY.
11210
11211 2002-04-17  Torbjorn Granlund  <tege@swox.com>
11212
11213         * mpz/clrbit.c: Add two GMP_NUMB_MASK masks after addition.
11214
11215         * mpn/generic/random2.c (LOGBITS_PER_BLOCK): Decrease to 4.
11216
11217         * gmp-impl.h (nail DIV_DC_THRESHOLD): Decrease to 50 to allow fast
11218         division.
11219
11220         * mpn/generic/random2.c: Nailify.
11221
11222         * mpz/fac_ui.c: Nailify.
11223
11224         * mpz/mul_i.h: #if ... #endif code block to shut up gcc warnings.
11225
11226         * mpn/generic/sqrtrem.c: Adopt to GNU coding standards.
11227         (mpn_dc_sqrtrem): New name for mpn_dq_sqrtrem.
11228         Partial nailification.
11229
11230         * configure.in: As a temporary hack, clear extra_functions for nails
11231         builds.
11232
11233         * gmp-h.in (mpz_get_ui): #if ... #endif else code block to shut up gcc
11234         warnings.
11235
11236 2002-04-17  Kevin Ryde  <kevin@swox.se>
11237
11238         * texinfo.tex: Update to 2002-03-26.08 per texinfo 4.2.
11239         * gmp.texi: Must have @top in @ifnottex (or @contents doesn't come out
11240         in one run).
11241
11242         * mpn/generic/scan0.c, mpn/generic/scan1.c: Nailify.
11243
11244         * tests/mpn/t-scan.c: New file.
11245         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
11246
11247         * tests/refmpn.c, tests/tests.h (refmpn_tstbit): Use unsigned long for
11248         bit index.
11249         (refmpn_setbit, refmpn_clrbit, refmpn_scan0, refmpn_scan1): New
11250         functions.
11251
11252         * mpfr/cmp_ui.c (mpfr_cmp_si_2exp): Fix b==0 i!=0 case.
11253
11254 2002-04-17  Gerardo Ballabio <gerardo.ballabio@unimib.it>
11255
11256         * gmpxx.h, mpfrxx.h: Remove mpfr_class bool combinations, remove
11257         mpfr_class::get_str2, use mp_rnd_t for rounding modes, use
11258         8*sizeof(double) for mpfr_t's holding doubles.
11259
11260 2002-04-17  Torbjorn Granlund  <tege@swox.com>
11261
11262         * mpz/powm.c: Nailify.
11263         * mpz/powm_ui.c: Nailify.
11264
11265 2002-04-16  Torbjorn Granlund  <tege@swox.com>
11266
11267         * mpz/hamdist.c: Nailify.
11268         * tests/misc.c (urandom): Nailify.
11269
11270         * mpz/get_si.c: Nailify.
11271         * gmp-h.in (mpz_get_ui): Nailify.  Streamline (and probably upset
11272         memory checkers).
11273
11274         * gmp-impl.h (mp_bases[10] values): Add versions for GMP_NUMB_BITS
11275         being 28, 60, and 63.
11276         * mpn/mp_bases.c: Add tables for GMP_NUMB_BITS being 28, 60, and 63.
11277
11278         * mpz/iset_si.c: Nailify.
11279         * mpz/iset_ui.c: Nailify
11280
11281         * tests/mpz/convert.c (main): Print test number in error message.
11282
11283         * mpn/generic/get_str.c (mpn_sb_get_str): Shift up `frac' into nails
11284         field after bignum division.
11285
11286 2002-04-16  Kevin Ryde  <kevin@swox.se>
11287
11288         * gmp-h.in, gmp-impl.h (GMP_NAIL_MASK): Move to gmp.h.
11289
11290         * gmp.texi: Use @documentdescription and @copying, per texinfo 4.2.
11291         (Low-level Functions): Clarify mpn_gcd overlap requirements, rewrite
11292         mpn_set_str description, add nails section.
11293         (C++ Interface General): Remove bool from types that mix with classes.
11294         (Language Bindings): Add STklos, GNU Smalltalk, Regina.
11295         (Binary to Radix, Radix to Binary): Describe new code.
11296         (Assembler Cache Handling): More notes, mostly by Torbjorn.
11297
11298         * macos/configure (%vars): Remove __GMP from substitutions, per change
11299         to main configure.
11300
11301         * mpn/generic/dive_1.c: Nailify.
11302         * mpn/generic/mode1o.c: Nailify, remove bogus ASSERT in commented-out
11303         alternate implementation.
11304         * gmp-impl.h (SUBC_LIMB): New macro.
11305
11306         * tests/devel/try.c (validate_divexact_1): Correction to compare.
11307         (udiv_qrnnd): New testing.
11308         (SHIFT_LIMIT): Nailify.
11309         (-b): New option, remove spurious "H" from getopt string.
11310
11311         * mpz/clrbit.c: Nailify.
11312         * tests/mpz/t-hamdist.c: Nailify.
11313         * gmp-impl.h (MPN_FIB2_SIZE): Nailify.
11314         (PP): Nailify conditionals.
11315         * tests/mpz/t-fib_ui.c (MPZ_FIB_SIZE_FLOAT): Nailify.
11316
11317         * configure.in, acinclude.m4: Establish GMP_NAIL_BITS and
11318         GMP_LIMB_BITS for gmp-h.in configure tests.
11319
11320         * mpfr/*, configure.in: Update to final mpfr 2.0.1.
11321         * mpfr/acinclude.m4 (MPFR_CONFIGS): Use $host, not uname stuff.
11322         * mpfr/tests/tout_str.c: Patch from Paul for denorm fprintf tests.
11323
11324 2002-04-15  Torbjorn Granlund  <tege@swox.com>
11325
11326         * mpn/generic/divrem_1.c (EXTRACT): Remove.
11327
11328         * tests/mpz/t-tdiv_ui.c (dump_abort): Accept argument for error string.
11329
11330         * mpz/rrandomb.c: Nailify.  Needs further work.
11331
11332         * mpn/generic/mod_1.c: Nailify.
11333
11334         * gmp-impl.h: Set various *_THRESHOLD values to be used for nails to
11335         avoid not yet qualified algorithms.
11336         (MPZ_CHECK_FORMAT): Check that nail part is zero.
11337
11338         * tests/mpz/t-mul.c (main): Test squaring even for huge operands.
11339         (base_mul): Nailify.
11340         (dump_abort): Accept argument for error string.  Print product
11341         difference.
11342
11343         * mpn/generic/set_str.c: Nailify.
11344
11345         * gmp-h.in (__GMPN_ADD, __GMPN_SUB): Nailify.
11346
11347 2002-04-14  Torbjorn Granlund  <tege@swox.com>
11348
11349         * randraw.c (lc): Return non-nonsense return value for seed=0 case.
11350         Check for m2exp being non-zero early; remove all other tests of m2exp.
11351         Remove redundant MPN_ZERO call.
11352         Let mpn_rshift put result in place to avoid extra MPN_COPY.
11353         Remove confusing comment before function `lc' describing BBS algorithm.
11354         Misc simplification and cleanups.
11355         Nailify.  Needs further work.
11356
11357         * mpz/set_si.c: Nailify.
11358         * mpz/set_ui.c: Nailify.
11359         * mpz/mul_i.h: Nailify.
11360
11361         * tests/mpz/t-mul_i.c: Actually test _ui routines.  Add some more test
11362         values.
11363
11364         * mpn/generic/mul_n.c: Finish nailifying toom3 code.
11365
11366 2002-04-13  Kevin Ryde  <kevin@swox.se>
11367
11368         * mpfr/*: Update to another new mpfr 2.0.1.
11369         * configure.in, Makefile.am, mpfr/Makefile.am, mpfr/tests/Makefile.am:
11370         Use MPFR_CONFIGS macro, establish separate MPFR_CFLAGS for mpfr build.
11371
11372         * mpfr/tests/Makefile.am: Correction to convenience rule for libmpfr.a.
11373
11374 2002-04-11  Kevin Ryde  <kevin@swox.se>
11375
11376         * mpfr/set_q.c: gmp-impl.h before mpfr.h to avoid _PROTO redefine.
11377
11378         * mpfr/*, configure.in: Update to new mpfr 2.0.1.
11379
11380         * tests/refmpn.c (refmpn_udiv_qrnnd, refmpn_divmod_1c_workaround):
11381         Fixes for nails.
11382
11383         * tests/t-constants.c (MODLIMB_INVERSE_3): Nailify tests.
11384         (MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): Only
11385         check these under USE_PREINV_DIVREM_1.
11386         * tests/t-modlinv.c: Nailify tests.
11387
11388 2002-04-11  Gerardo Ballabio <gerardo.ballabio@unimib.it>
11389
11390         * gmpxx.h: Remove bool combinations, remove mpf_class::get_str2, only
11391         need <iosfwd> now.
11392
11393 2002-04-11  Torbjorn Granlund  <tege@swox.com>
11394
11395         * mpn/generic/diveby3.c: Nailify.
11396         * gmp-impl.h (MODLIMB_INVERSE_3): Nailify.
11397
11398         * mpn/generic/mul_n.c: Nailify Toom3 code.
11399
11400 2002-04-10  Kevin Ryde  <kevin@swox.se>
11401
11402         * gmp-impl.h (MPN_KARA_MUL_N_MINSIZE, MPN_KARA_SQR_N_MINSIZE): Set to
11403         3, as needed by nails case.
11404
11405         * mpn/generic/addmul_1.c, mpn/generic/submul_1.c [nails]: Fix vl
11406         assert, add rp,n and up,n asserts.
11407
11408         * mpfr/Makefile.am: Add new mpfr-math.h, install mpf2mpfr.h.
11409
11410 2002-04-10  Torbjorn Granlund  <tege@swox.com>
11411
11412         * mpn/generic/divrem_1.c: Nailify.  Update mp_size_t variables to use
11413         `n' suffix instead of `size' suffix.
11414         * mpn/generic/divrem_2.c: Likewise.
11415         * mpn/generic/sb_divrem_mn.c: Nailify.
11416         * mpn/generic/tdiv_qr.c: Nailify.
11417         (SHL): Remove silly macro.
11418
11419         * mpn/generic/mul_n.c (mpn_kara_mul_n): Replace open-coded increment by
11420         mpn_incr_u call.  Handle nails in ws[n] increment.
11421         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Likewise.
11422
11423         * gmp-h.in (GMP_NUMB_MASK): New #define.
11424         (__GMPN_AORS_1): Add version for nails.
11425
11426         * gmp-impl.h (GMP_NUMB_MASK): Comment out, now in gmp.h.
11427         (mpn_incr_u): Don't assume `incr' is non-zero.
11428         (mpn_decr_u): Similarly.
11429
11430 2002-04-09  Kevin Ryde  <kevin@swox.se>
11431
11432         * mpfr/*, configure.in: Update to mpfr 2.0.1.
11433
11434         * tests/refmpn.c (refmpn_mul_1c, lshift_make): Corrections for nails.
11435         * tssts/refmpn.c, tests/tests.h (refmpn_cmp_allowzero): New function.
11436
11437         * mpn/generic/mul_1.c [nails]: Fix vl assert, add {up,n} assert.
11438
11439         * mpn/pa32/hppa1_1/pa7100/addmul_1.asm,
11440         mpn/pa32/hppa1_1/pa7100/submul_1.asm: Rename "size" define, to avoid
11441         ELF .size directive.  Reported by LaMont Jones.
11442
11443         * tests/mpz/t-set_si.c: Add nails support.
11444
11445 2002-04-05  Torbjorn Granlund  <tege@swox.com>
11446
11447         * gmp-impl.h: Replace nail mpn_incr_u, mpn_decr_u with faster versions.
11448         (mp_bases[10] values): Check GMP_NUMB_BITS instead of BITS_PER_MP_LIMB.
11449         Add GMP_NUMB_BITS == 30 version.
11450         (__gmp_doprnt, etc): Remove parameter names.
11451
11452         * mpn/generic/mul_n.c: Nailify Karatsuba code.
11453         * mpn/generic/get_str.c: Nailify.
11454         * mpn/generic/sqr_basecase.c: Nailify.
11455         * mpn/generic/lshift.c: Nailify.
11456         * mpn/generic/rshift.c: Likewise.
11457         * mpn/generic/add_n.c: Nailify.  Revamp non-nail code.
11458         * mpn/generic/sub_n.c: Likewise.
11459         * mpn/generic/mul_1.c: Likewise.
11460         * mpn/generic/addmul_1.c: Likewise.
11461         * mpn/generic/submul_1.c: Likewise.
11462
11463 2002-04-02  Kevin Ryde  <kevin@swox.se>
11464
11465         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE) [powerpc]:
11466         Corrections to constraints, and restrict to bigendian.
11467
11468 2002-03-31  Kevin Ryde  <kevin@swox.se>
11469
11470         * tests/mpz/dive.c: Better diagnostics.
11471
11472         * tests/devel/try.c (mpn_get_str, mpn_umul_ppmm_r): New tests.
11473
11474         * tests/misc.c, tests/tests.h (byte_diff_lowest, byte_diff_highest):
11475         New functions.
11476
11477         * tests/t-bswap.c: New file.
11478         * tests/Makefile.am (check_PROGRAMS): Add it.
11479
11480         * tests/mpn/t-aors_1.c, tests/mpn/t-iord_u.c: Add nails support.
11481
11482         * gmp-impl.h (MPN_IORD_U) [x86]: Eliminate unnecessary jiord and iord,
11483         rename "n" to incr per generic versions, restrict to nails==0.
11484         (mpn_incr_u, mpn_decr_u): Add nails support.
11485         (GMP_NAIL_LOWBIT, GMP_NUMB_MAX): New macros.
11486
11487         * tests/trace.c, tests/tests.h (byte_trace, byte_tracen): New
11488         functions.
11489         * tests/trace.c: Handle NULL operands.
11490
11491         * tests/refmpn.c, tests/devel/try.c, tune/speed.c: Add preliminary
11492         nail support.
11493
11494         * tests/refmpn.c, test/tests.h (byte_overlap_p, refmpn_equal_anynail,
11495         refmpn_umul_ppmm_r, refmpn_udiv_qrnnd_r, refmpn_get_str,
11496         refmpn_bswap_limb, refmpn_random, refmpn_random2, refmpn_bswap_limb):
11497         New functions.
11498
11499         * gmp-impl.h, tests/refmpn.c (ASSERT_LIMB): Renamed from
11500         ASSERT_MP_LIMB_T.
11501
11502         * mpn/x86/*/*.asm, mpn/powerpc32/*/*.asm, mpn/powerpc64/*/*.asm: Put
11503         speeds after the copyright notice, so as to keep that clear.
11504
11505 2002-03-29  Kevin Ryde  <kevin@swox.se>
11506
11507         * configure.in (powerpc*-*-aix*): Correction to xlc -qarch selection,
11508         for 32-bit mode.
11509
11510 2002-03-28  Torbjorn Granlund  <tege@swox.com>
11511
11512         * mpn: Fix spacing in many files.
11513
11514         * mpn/generic/aorsmul_1.c: Split into addmul_1.c and submul_1.c.
11515         * mpn/generic/aors_n.c: Split into add_n.c and sub_n.c.
11516
11517         * mpn/pa64/add_n.asm: Trim another 0.125 cycle/limb.  Fix a comment.
11518         * mpn/pa64/sub_n.asm: Likewise.
11519
11520         * mpn/pa64/mul_1.asm: Change comclr, comb to proper forms cmpclr, cmpb.
11521         * mpn/pa64/addmul_1.asm: Likewise.
11522         * mpn/pa64/submul_1.asm: Likewise.
11523
11524 2002-03-28  Kevin Ryde  <kevin@swox.se>
11525
11526         * gmp.texi (Converting Integers): Fix type of exp in mpz_get_d_2exp,
11527         reported by epl@unimelb.edu.au.
11528         (References): Update Burnikel and Ziegler URL, reported by Keith
11529         Briggs.
11530
11531         * gmp-h.in, mp-h.in, configure.in, acinclude.m4: Remove __GMP from
11532         AC_SUBSTs, since autoconf says leading "_" in makefile variables is
11533         not portable.
11534
11535         * demos/expr/run-expr.c: Declare optarg, optind, opterr if necessary.
11536         * configure.in, demos/expr/expr-config-h.in: Configs for this.
11537
11538 2002-03-27  Torbjorn Granlund  <tege@swox.com>
11539
11540         * mpn/Makefile.am (TARG_DIST): Remove pa64w and hppa, add pa32.
11541
11542         * configure.in (path_20w): Remove pa64w.
11543
11544         * mpn/pa64/udiv_qrnnd.asm: Tweak for PA8000 performance comparative to
11545         that on PA8500.
11546
11547 2002-03-26  Torbjorn Granlund  <tege@swox.com>
11548
11549         * mpn/pa32: New name for mpn/hppa.
11550         * configure.in: Corresponding changes.
11551
11552         * mpn/pa64/umul_ppmm.asm: New file, generalized for both 2.0N and 2.0W.
11553         * mpn/pa64/umul_ppmm.S: Remove.
11554
11555         * mpn/pa64/udiv_qrnnd.asm: Generalize for both 2.0N and 2.0W.
11556         * mpn/pa64w/udiv_qrnnd.asm: Remove.
11557
11558 2002-03-26  Kevin Ryde  <kevin@swox.se>
11559
11560         * mpfr/tests/tdiv.c, mpfr/tests/tui_div.c: Don't depend on nan and inf
11561         handling in "double", for the benefit of alpha.
11562
11563         * configure (hppa2.0w): Set path to "pa64w pa64".
11564
11565         * acinclude.m4, configure.in (GMP_C_INLINE): New macro.
11566         * acinclude.m4 (GMP_H_EXTERN_INLINE): Use it, and fix "yes" handling.
11567
11568 2002-03-25  Torbjorn Granlund  <tege@swox.com>
11569
11570         * mpn/pa64w/add_n.s: Remove.
11571         * mpn/pa64w/sub_n.s: Remove.
11572         * mpn/pa64w/lshift.s: Remove.
11573         * mpn/pa64w/rshift.s: Remove.
11574         * mpn/pa64w/mul_1.S: Remove.
11575         * mpn/pa64w/addmul_1.S: Remove.
11576         * mpn/pa64w/submul_1.S: Remove.
11577         * mpn/pa64w/sqr_diagonal.asm: Remove.
11578
11579         * mpn/pa64/mul_1.asm: New file with twice faster code; generalized
11580         for both 2.0N and 2.0W.
11581         * mpn/pa64/submul_1.asm: Likewise.
11582         * mpn/pa64/mul_1.S: Remove.
11583         * mpn/pa64/submul_1.S: Remove.
11584
11585         * mpn/pa64/sqr_diagonal.asm: Generalize for both 2.0N and 2.0W.
11586
11587         * mpn/pa64/add_n.asm: New file, generalized for both 2.0N and 2.0W.
11588         * mpn/pa64/sub_n.asm: Likewise.
11589         * mpn/pa64/lshift.asm: Likewise.
11590         * mpn/pa64/rshift.asm: Likewise.
11591         * mpn/pa64/add_n.s: Remove.
11592         * mpn/pa64/sub_n.s: Remove.
11593         * mpn/pa64/lshift.s: Remove.
11594         * mpn/pa64/rshift.s: Remove.
11595
11596 2002-03-24  Kevin Ryde  <kevin@swox.se>
11597
11598         * gmp-impl.h (BSWAP_LIMB_FETCH, BSWAP_LIMB_STORE): New macros.
11599         * mpz/inp_raw.c, mpz/out_raw.c: Use them.
11600         * acconfig.h (HAVE_HOST_CPU): Add some powerpc types.
11601
11602         * mpn/powerpc32/750/com_n.asm: New file.
11603
11604         * mpfr/tests/tout_str.c: Disable random tests, since they fail on
11605         alphaev56-unknown-freebsd4.1 and do nothing by default.
11606
11607         * mpfr/tests/tsqrt.c: Don't depend on nan, inf or -0 in "double", for
11608         the benefit of alpha.
11609         * mpfr/sqrt.c: Clear nan flag on -0.
11610
11611         * demos/factorize.c: Use mpn_random() instead of random(), to avoid
11612         portability problems.
11613
11614         * demos/isprime.c (print_usage_and_exit): Declare as "void" to avoid
11615         warnings.
11616
11617         * demos/pexpr.c (setup_error_handler): Corrections to sigstack code.
11618
11619         * demos/calc/calc.y: Add some `;'s to make bison 1.34 happy.
11620
11621 2002-03-23  Torbjorn Granlund  <tege@swox.com>
11622
11623         * mpn/pa64/addmul_1.asm: New file with twice faster code; generalized
11624         for both 2.0N and 2.0W.
11625
11626 2002-03-22  Kevin Ryde  <kevin@swox.se>
11627
11628         * tune/time.c: Add SGI hardware counter measuring method, change some
11629         abort()s into ASSERT_FAIL()s.
11630
11631         * configure.in (AC_CHECK_HEADERS): Add fcntl.h and sys/syssgi.h.
11632         (AC_CHECK_FUNCS): Add syssgi.
11633
11634         * configure.in, mpfr/Makefile.am, mpfr/tests/Makefile.am: Use
11635         -mieee-with-inexact or -ieee_with_inexact for mpfr on alpha, so
11636         denorms work.
11637
11638         * mpfr/isinteger.c: Fix a memory leak.
11639
11640 2002-03-21  Torbjorn Granlund  <tege@swox.com>
11641
11642         * tune/speed.c (struct choice_t): Make `r' an mp_limb_t.
11643
11644 2002-03-21  Kevin Ryde  <kevin@swox.se>
11645
11646         * configure.in (HAVE_LIMB_BIG_ENDIAN, HAVE_LIMB_LITTLE_ENDIAN): Use an
11647         AH_VERBATIM and better explanation.
11648         * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Similarly for the HAVE_DOUBLE
11649         constants.
11650
11651         * gmp.texi (Number Theoretic Functions): Clarify sign of GCD returned
11652         by mpz_gcdext.
11653
11654         * demos/pexpr.c, demos/pexpr-config-h.in, configure.in: Use an
11655         autoconf test for stack_t.
11656
11657         * configure.in, gmp-h.in, mp-h.in, macos/configure, tests/mpz/reuse.c,
11658         tests/mpf/reuse.c: Use __GMP_LIBGMP_DLL to enable windows declspec,
11659         don't require _WIN32 (etc), remove __GMP_LIBGMP_SHARED and
11660         __GMP_LIBGMP_STATIC.
11661
11662         * gmp-impl.h (mp_bases): Add __GMP_DECLSPEC, for the benefit of
11663         tests/t-constants.c.
11664
11665         * tune/many.pl, tune/speed.h: Remove suffix hack for back.asm.
11666
11667 2002-03-21  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
11668
11669         * mpfr/sin_cos.c (mpfr_sin_cos): New file.
11670         * mpfr/mpfr.h, mpfr/mpfr.texi, mpfr/Makefile.am: Add it.
11671         * mpfr/tan.c: Fix sign in 2nd and 4th quadrants.
11672
11673         * mpfr/log10.c: Fix hangs on certain inputs.
11674
11675 2002-03-20  Torbjorn Granlund  <tege@swox.com>
11676
11677         * demos/pexpr.c (setup_error_handler): Declare `s', the first
11678         sigaltstack parameter, using `stack_t' just on AIX.
11679
11680 2002-03-19  Torbjorn Granlund  <tege@swox.com>
11681
11682         * mpn/powerpc32/mul_1.asm: Use free caller-saves registers instead
11683         of the callee-saves r30 and r31.
11684
11685 2002-03-19  Kevin Ryde  <kevin@swox.se>
11686
11687         * tune/freq.c (freq_proc_cpuinfo): Recognise powerpc "clock", where
11688         previously got the wrong result from "bogomips".
11689
11690         * mpn/powerpc32/add_n.asm, mpn/powerpc32/sub_n.asm: Rewrite, faster on
11691         750, and smaller too.
11692         * mpn/powerpc32/*.asm: Use L(), add some measured speeds.
11693
11694         * longlong.h (count_trailing_zeros) [vax]: Add a version using ffs,
11695         but commented out.
11696
11697 2002-03-17  Kevin Ryde  <kevin@swox.se>
11698
11699         * tune/speed.c, tune/speed.h, tune/common.c, many.pl: Use optional
11700         ".r" to specify operand overlaps for mpn_add_n, mpn_sub_n and logops.
11701         Remove mpn_add_n_inplace and mpn_add_n_self.
11702         * tune/many.pl: Fix MULFUNC_PROLOGUE parsing.
11703
11704         * gmp.texi (Known Build Problems): Note `make' problem with long
11705         libgmp.la dependencies list.
11706
11707         * printf/doprnt.c, scanf/doscan.c (%zn): Remove test of non-existent
11708         HAVE_SIZE_T, just use size_t unconditionally.
11709         * printf/doprnt.c (%zd etc): Fix 'z' type parsing.
11710         * tests/misc/t-printf.c, tests/misc/t-scanf.c: More tests.
11711
11712         * configure.in: Use AC_COPYRIGHT.
11713         Add m4_pattern_allow(GMP_MPARAM_H_SUGGEST).
11714
11715         * tune/Makefile.am (libdummy.la): Remove this, sqr_basecase.c already
11716         gets an ansi2knr rule from nodist_tuneup_SOURCES.
11717
11718         * longlong.h (count_leading_zeros) [pentiumpro gcc<3]: Test
11719         HAVE_HOST_CPU_i686 too.
11720
11721         * mpz/out_raw.c (HTON_LIMB_STORE): Fix a typo in big endian #if.
11722
11723 2002-03-14  Kevin Ryde  <kevin@swox.se>
11724
11725         * mpn/x86/pentium/com_n.asm, mpn/x86/pentium/logops_n.asm,
11726         mpn/x86/k6/mmx/com_n.asm: Add nails support.
11727
11728         * texinfo.tex: Update to 2002-03-01.06 (per texinfo 4.1).
11729         * gmp.texi (@ma): Remove, @math does this now.
11730
11731         * mpfr/tests/reuse.c: Clear op1 and op2 flags only in their respective
11732         outer loops.
11733
11734         * configure.in (--enable-cxx): Correction to the default stated in the
11735         help string.
11736         (power*-*-aix*, not powerpc): Use aix.m4, don't run
11737         GMP_ASM_POWERPC_R_REGISTERS or use powerpc-defs.m4.
11738
11739 2002-03-13  Torbjorn Granlund  <tege@swox.com>
11740
11741         * mpn/sparc32/gmp-mparam.h: New file.
11742
11743 2002-03-13  Kevin Ryde  <kevin@swox.se>
11744
11745         * demos/expr/exprfr.c: More mpfr functions, corrections to agm, cos,
11746         sin, rename log2 constant to loge2 to make room for log2 function.
11747         * demos/expr/t-expr.c: More tests.
11748
11749         * mpz/inp_raw.c (NTOH_LIMB_FETCH) [generic 16bit]: Remove spurious "+".
11750
11751         * mpfr/acos.c: Avoid a memory leak for certain operands.
11752
11753         * acinclude.m4, configure.in (GMP_C_DOUBLE_FORMAT): New macro.
11754
11755         * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
11756         GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
11757         Change ac_objext to OBJEXT, which is the documented variable.
11758
11759         * config.guess (powerpc*-*-*): Use #ifdef on constants POWER_630 etc
11760         in the AIX test, since old versions don't have them all.
11761
11762 2002-03-11  Kevin Ryde  <kevin@swox.se>
11763
11764         * configure.in (LIBC211): New AC_DEFINE, for mpfr.
11765
11766         * configure.in (mips*-*-*): Support ABI=o32 on irix 6, allow gcc 2.7.2
11767         to fall back on it, but detect it doesn't work with gcc 2.95.  Use
11768         single mips-defs.m4 for both mips32 and mips64.
11769         * acinclude.m4 (GMP_GCC_MIPS_O32): New macro.
11770         * mpn/mips32/mips-defs.m4: Renamed from mips.m4.
11771         * mpn/mips64/mips.m4: Remove (was a copy of mips32/mips.m4).
11772
11773         * mpn/powerpc32/750: New directory.
11774         * configure.in (powerpc740, powerpc750, powerpc7400): Use it.
11775         * mpn/powerpc32/750/gmp-mparam.h: New file.
11776
11777         * config.sub, gmp.texi (ultrasparc1): Remove this, just use plain
11778         "ultrasparc".
11779
11780 2002-03-10  Kevin Ryde  <kevin@swox.se>
11781
11782         * mpfr: Update to 20020301, except internal_ceil_exp2.c,
11783         internal_ceil_log2.c, internal_floor_log2.c renamed to i_ceil_exp2.c,
11784         i_ceil_log2.c, i_floor_log2.c to be unique in DOS 8.3.  And sqrtrem.c
11785         removed since no longer required.
11786         * mpfr/mpfr.texi: Fix some formatting.
11787         * mpfr/tests/reuse.c: Patch by Paul to fix test4 variable handling.
11788         * mpfr/sinh.c: Patch by Paul to fix err calculation when t==0.
11789         * mpfr/tests/tget_d.c: Disable until portability of rnd_mode.c can be
11790         sorted out.
11791
11792         * configure.in (powerpc*-*-*): Separate gcc and xlc cpu flags setups
11793         for clarity.
11794
11795         * longlong.h (count_leading_zeros, count_trailing_zeros) [x86_64]: New
11796         macros.
11797
11798 2002-03-07  Kevin Ryde  <kevin@swox.se>
11799
11800         * gmp.texi (Build Options): Note all the ultrasparcs accepted.
11801         (Language Bindings): Add Math::BigInt::GMP.
11802
11803         * config.sub (ultrasparc2i): New cpu type.
11804         * config.guess (sparc-*-*, sparc64-*-*): Add some exact CPU detection.
11805
11806 2002-03-05  Kevin Ryde  <kevin@swox.se>
11807
11808         * longlong.h (count_leading_zeros, count_trailing_zeros) [alphaev67,
11809         alphaev68]: Use ctlz and cttz insns (as per gcc longlong.h).
11810         (count_leading_zeros) [sparclite]: Fix parameter order (as per gcc
11811         longlong.h).
11812         * acconfig.h (HAVE_HOST_CPU_alphaev68): New define.
11813
11814         * config.guess [i?86-*-*]: Suppress error messages if compiler not
11815         found or test program won't run.
11816         [rs6000-*-*, powerpc-*-*]: Force code alignment for mfpvr test.
11817
11818 2002-03-04  Torbjorn Granlund  <tege@swox.com>
11819
11820         * mpn/generic/pow_1.c: New file.
11821
11822 2002-03-03  Kevin Ryde  <kevin@swox.se>
11823
11824         * gmp.texi (Build Options): Note compiler must be able to fully link,
11825         add alphapca57 and alphaev68, give a clearer example of MPN_PATH
11826         (Debugging): Add notes on valgrind.
11827         (C++ Formatted Output): Clarify mpf showbase handling, in particular
11828         note "00.4" in octal.
11829
11830         * printf/doprntf.c: Do a showbase on octal float fractions, for
11831         instance "00.4" where previously it gave "0.4".
11832         * tests/cxx/t-ostream.cc: Update.
11833
11834         * gmp-h.in, mp-h.in (__GMP_DECLSPEC, __GMP_DECLSPEC_XX): Test
11835         __WIN32__ for Borland C, reported by "delta trinity".
11836
11837         * gmp-h.in, mp-h.in: Use <cstddef> for size_t under C++, suggested by
11838         Hans Aberg some time ago.
11839         * gmp-h.in (<iosfwd>): Move to top of file for clarity.
11840
11841         * Makefile.am (libgmpxx_la_SOURCES): Use dummy.cc to force C++.
11842         (CXX_OBJECTS): Add osfuns$U.lo.
11843         * dummy.cc: New file.
11844         * cxx/Makefile.am (INCLUDES): Use __GMP_WITHIN_GMPXX.
11845         (libcxx_la_SOURCES): Add osfuns.cc.
11846         * gmp-h.in (__GMP_DECLSPEC_XX): New define, use it on libgmpxx funs.
11847         * gmp-impl.h: Add __GMP_DECLSPEC to libgmp functions used by libgmpxx.
11848
11849         * longlong.h (COUNT_TRAILING_ZEROS_TIME): Remove, no longer used.
11850
11851         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): Correction to
11852         __totbits for nails.
11853
11854         * gmp-impl.h (JACOBI_LS0): Test size before limb, to pacify valgrind.
11855         (JACOBI_0LS): Ditto, and fix parens around arguments.
11856
11857         * mpn/x86/x86-defs.m4 (call_mcount): Add a counter to make data labels
11858         unique, since simplified L() scheme no longer gives that effect.
11859         (notl_or_xorl_GMP_NUMB_MASK): New macro.
11860         Add m4_assert_numargs in a few places.
11861
11862         * configure.in (*sparc*): Fix cycle counter setups for ABI=64.
11863
11864 2002-02-28  Torbjorn Granlund  <tege@swox.com>
11865
11866         * mpn/vax/gmp-mparam.h: New file.
11867
11868 2002-02-28  Kevin Ryde  <kevin@swox.se>
11869
11870         * gmp-h.in (gmp_errno, gmp_version): Move into extern "C" block,
11871         reported by librik@panix.com.
11872
11873         * gmp-h.in, mp-h.in (__GMP_DECLSPEC_EXPORT, __GMP_DECLSPEC_IMPORT):
11874         Use __declspec(dllexport) and __declspec(dllimport) on Borland.
11875         * gmp-h.in (_GMP_H_HAVE_FILE): Test __STDIO_H for Borland.
11876         Reported by "delta trinity".
11877
11878         * gmp-impl.h (va_copy): Fall back on memcpy, not "=".
11879
11880         * mpn/generic/pre_mod_1.c: Add a comment about obsolescence.
11881
11882         * tune/time.c (MICROSECONDS_P): Don't trust time differences of 1
11883         microsecond.
11884
11885         * tests/cxx/t-ostream.cc: Use "const char *" not just "char *" for
11886         test data strings, avoids warnings on Sun CC.
11887
11888 2002-02-27  Torbjorn Granlund  <tege@swox.com>
11889
11890         * configure.in: For sparc under solaris2.[7-9], pass -fsimple=1 to
11891         disable some crazy -fast optimizations.
11892
11893 2002-02-25  Torbjorn Granlund  <tege@swox.com>
11894
11895         * configure.in: For sparc under solaris2.[7-9], pass -fns=no to enable
11896         denorm handling under -fast.
11897
11898 2002-02-25  Kevin Ryde  <kevin@swox.se>
11899
11900         * configure.in (alpha*-*-*): Rearrange -mcpu selection for gcc,
11901         provide an ev67 -> ev6 fallback.  Fix -arch,-tune selection for DEC C.
11902         Allow ~ for space in optional options lists.
11903
11904         * tune/tuneup.c (tune_preinv_divrem_1): Compare against an assembler
11905         mpn_divrem_1 if it exists, not the generic C mpn_divrem_1_div.
11906         (tune_preinv_mod_1): Ditto with mpn_mod_1.
11907
11908         * tune/time.c (DIFF_SECS_ROUTINE): Eliminate the unused "type"
11909         parameter, try to make the code a bit clearer.
11910
11911         * tune/freq.c: Reduce the period measured for cycles versus
11912         gettimeofday, add cycles versus microsecond getrusage.
11913
11914         * mpz/array_init.c: "i" should be mp_size_t, noticed by E. Khong.
11915
11916 2002-02-24  Torbjorn Granlund  <tege@swox.com>
11917
11918         * configure.in: For sparc under solaris2.[7-9], pass -fast instead of
11919         other optimization options.
11920
11921 2002-02-23  Kevin Ryde  <kevin@swox.se>
11922
11923         * mpn/asm-defs.m4 (GMP_NUMB_MASK): New macro.
11924         (PROLOGUE, EPILOGUE): Relax quoting for the benefit of tune/many.pl
11925         when GSYM_PREFIX non-empty.
11926
11927         * tune/time.c, tune/speed.h (speed_time_init): Include clock tick
11928         period in speed_time_string.
11929         * tune/time.c, configure.in (clock_gettime): New measuring method.
11930
11931         * tune/many.pl: Add -DHAVE_NATIVE_mpn_foo to C objects, to avoid
11932         conflicts with a macro version in gmp-impl.h, eg. mpn_com_n.
11933
11934 2002-02-22  Torbjorn Granlund  <tege@swox.com>
11935
11936         * demos/pexpr.c: Increase RLIMIT_STACK to 4Mibyte.
11937
11938 2002-02-22  Kevin Ryde  <kevin@swox.se>
11939
11940         * tune/tuneup.c: Don't confuse gcc with mipspro cc in diagnostic.
11941
11942 2002-02-20  Torbjorn Granlund  <tege@swox.com>
11943
11944         * configure.in (mips*-*-irix[6789]*]): Set `extra_functions_n32', not
11945         `extra_functions'.
11946
11947         * printf/doprnt.c: Conditionally include inttypes.h.
11948         * printf/repl-vsnprintf.c: Likewise.
11949         * scanf/doscan.c: Likewise.
11950
11951 2002-02-20  Kevin Ryde  <kevin@swox.se>
11952
11953         * mpn/x86/k7/mmx/com_n.asm: New file.
11954
11955         * mpz/n_pow_ui.c (SWAP_RP_TP): Use ASSERT_CODE on ralloc and talloc,
11956         to ensure they needn't live past the initial allocs in a normal build.
11957
11958         * mpn/generic/mod_34lsub1.c: Note this is for internal use.
11959
11960 2002-02-19  Torbjorn Granlund  <tege@swox.com>
11961
11962         * Clean up *_THRESHOLD names.  Many files affected.
11963
11964         * mpn/mips32: Asm-ify 32-bit mips code.
11965         Move files from `mips2' to `mips32' directory.
11966         * mpn/mips64: Move files from `mips3' to `mips64' directory.
11967         * configure.in: Change `mips2' => `mips32' and `mips3' => `mips64'.
11968
11969 2002-02-19  Kevin Ryde  <kevin@swox.se>
11970
11971         * acinclude.m4, configure.in (GMP_PROG_LEX): New macro.
11972
11973         * tune/tuneup.c (one): Start next threshold at a max of previous ones,
11974         in order to get a good starting point for TOOM3_SQR_THRESHOLD if
11975         KARATSUBA_SQR_THRESHOLD is 0 (ie. using mpn_mul_basecase only).
11976
11977         * configure.in, tune/tuneup.c (GMP_MPARAM_H_SUGGEST): New AC_DEFINE
11978         replacing GMP_MPARAM_H_FILENAME.  Suggest a new file in a cpu specific
11979         subdirectory rather than mpn/generic.
11980
11981         * acinclude.m4 (POWERPC64_PATTERN): New macro.
11982         * configure.in (powerpc*-*-*): Use it.
11983         (powerpc*-*-*): Use umul in 32L and aix64.
11984         (mips*-*-*): Use umul, 32 and 64 bit versions.
11985
11986 2002-02-18  Torbjorn Granlund  <tege@swox.com>
11987
11988         * longlong.h: Add basic x86-64 support.
11989
11990 2002-02-17  Torbjorn Granlund  <tege@swox.com>
11991
11992         * demos/pexpr.c: Support `-X' for upper case hex, make `-x' output
11993         lower case hex.
11994
11995         * mpn/mips2/umul.s: Make it actually work.
11996         * mpn/mips3/umul.asm: New file.
11997
11998         * mpn/mips2/gmp-mparam.h: New file.
11999
12000 2002-02-16  Torbjorn Granlund  <tege@swox.com>
12001
12002         * mpn/generic/get_str.c (mpn_sb_get_str): Round frac upwards after
12003         umul_ppmm calls.
12004
12005 2002-02-16  Kevin Ryde  <kevin@swox.se>
12006
12007         * config.guess (alpha-*-*): Do alpha exact cpu probes on any system,
12008         and only if configfsf.guess gives a plain "alpha".
12009
12010         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect a gcc 3.0.3 powerpc64
12011         linker invocation problem.
12012
12013 2002-02-15  Torbjorn Granlund  <tege@swox.com>
12014
12015         * mpn/generic/get_str.c (mpn_sb_get_str): For base 10, develop initial
12016         digits using umul_ppmm, then switch to plain multiplication.
12017
12018         * config.guess: Rewrite Alpha subtype detection code for *bsd systems.
12019
12020 2002-02-15  Kevin Ryde  <kevin@swox.se>
12021
12022         * gmp.texi (Build Options): Note powerpc exact cpu types.
12023         (Debugging): Advertise DEBUG in memory.c.
12024
12025         * config.sub, config.guess: Add some powerpc exact cpus.
12026         * configure.in: Add configs for them.
12027
12028         * memory.c [__NeXT__]: Remove unused #define of "static".
12029         (__gmp_default_allocate, __gmp_default_reallocate): Print size if
12030         allocation fails, don't use perror.
12031
12032         * gmp-h.in: g++ 3 demands __GMP_NOTHROW is before other attributes.
12033
12034 2002-02-14  Torbjorn Granlund  <tege@swox.com>
12035
12036         * mpn/alpha/mul_1.asm: Fix typo preventing build on T3E systems.
12037
12038 2002-02-14  Kevin Ryde  <kevin@swox.se>
12039
12040         * tune/tuneup.c (tune_set_str): Increase max_size, for the benefit of
12041         alpha.
12042
12043         * macos/README: Bug reports to bug-gmp@gnu.org, clarify MacOS X a bit.
12044
12045         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Add missing TMP_FREE.
12046
12047         * tune/speed.c, tune/tuneup.c: Allow for speed_cycletime of 0.0 in
12048         some diagnostic printouts.
12049         * tune/time.c (speed_cycletime): Note can be 0.0.
12050
12051 2002-02-12  Torbjorn Granlund  <tege@swox.com>
12052
12053         * mpn/alpha/mul_1.asm: Add mpn_mul_1c entry.
12054
12055         * mpn/pa64w/sqr_diagonal.asm: Use L() for labels.
12056
12057 2002-02-11  Torbjorn Granlund  <tege@swox.com>
12058
12059         * mpn/generic/get_str.c (mpn_sb_get_str): Change declaration of rp to
12060         accommodate tuneup compiles.
12061
12062 2002-02-11  Kevin Ryde  <kevin@swox.se>
12063
12064         * mpn/alpha/default.m4, mpn/alpha/unicos.m4 (PROLOGUE_cpu): Add
12065         noalign option.
12066         * mpn/alpha/default.m4 (PROLOGUE_cpu): use ALIGN instead of ".align".
12067
12068         * gmp.texi (Debugging): Notes on Checker.
12069         (Other Multiplication): Move note on float FFTs to here.
12070         (Assembler Floating Point): New text and revisions by Torbjorn,
12071         picture formatting by me.
12072         Simplify tex pictures elsewhere a bit, share heights, eliminate some
12073         gaps at line joins.
12074
12075 2002-02-11  Torbjorn Granlund  <tege@swox.com>
12076
12077         * mpn/generic/get_str.c (mpn_sb_get_str): Rewrite to generate fraction
12078         limbs and use multiplication for digit development.  Trim allocation of
12079         buf.  Get rid of code for !USE_MULTILIMB.
12080
12081 2002-02-10  Torbjorn Granlund  <tege@swox.com>
12082
12083         * mpn/generic/set_str.c (mpn_set_str): Undo this:
12084         Change invocations of mpn_add_1 to instead use mpn_incr_u.
12085
12086         * tests/mpz/convert.c: Free str only after it is used in error message.
12087
12088         * mpn/generic/get_str.c (mpn_sb_get_str): Combine tail code for base 10
12089         and generic bases.
12090
12091         * mpn/mp_bases.c: Add entries for base 256.  Remove __ prefix from
12092         table name.
12093         * gmp-impl.h (__mp_bases): Remove superflous `mp_' part of name, making
12094         it __gmpn_bases instead of __gmpn_mp_bases.
12095         (mp_bases): New #define.
12096         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Allow bases up to 256.
12097         (SPEED_ROUTINE_MPN_GET_STR): Likewise.
12098
12099 2002-02-09  Torbjorn Granlund  <tege@swox.com>
12100
12101         * mpn/generic/set_str.c (mpn_set_str): Use mpn_mul_1c if available.
12102         Change invocations of mpn_add_1 to instead use mpn_incr_u.
12103
12104 2002-02-09  Kevin Ryde  <kevin@swox.se>
12105
12106         * mpz/array_init.c, mpz/cfdiv_q_2exp.c, mpz/cfdiv_r_2exp.c,
12107         mpz/cong_2exp.c, mpz/divis_2exp.c, mpz/hamdist.c, mpz/init2.c,
12108         mpz/mul_2exp.c, mpz/realloc2.c, mpz/scan0.c, mpz/scan1.c,
12109         mpz/setbit.c, mpz/tdiv_q_2exp.c, mpz/tdiv_r_2exp.c, mpz/tstbit.c,
12110         mpz/urandomb.c: Use GMP_NUMB_BITS.
12111
12112         * mpz/iset_str.c [__CHECKER__]: Store a dummy value to the low limb to
12113         stop it appearing uninitialized.
12114
12115         * gmp-h.in (__GMP_NOTHROW): New macro.
12116         (mp_set_memory_functions, mpz_cmp, mpz_cmp_si, mpz_cmp_ui, mpz_cmpabs,
12117         mpz_cmpabs_ui, mpz_congruent_2exp_p, mpz_divisible_2exp_p,
12118         mpz_fits_sint_p, mpz_fits_slong_p, mpz_fits_sshort_p, mpz_fits_uint_p,
12119         mpz_fits_ulong_p, mpz_fits_ushort_p, mpz_get_si, mpz_get_ui,
12120         mpz_getlimbn, mpz_hamdist, mpz_popcount, mpz_scan0, mpz_scan1,
12121         mpz_size, mpz_sizeinbase, mpz_swap, mpz_tstbit, mpq_equal, mpq_swap,
12122         mpf_cmp, mpf_cmp_si, mpf_cmp_ui, mpf_fits_sint_p, mpf_fits_slong_p,
12123         mpf_fits_sshort_p, mpf_fits_uint_p, mpf_fits_ulong_p,
12124         mpf_fits_ushort_p, mpf_get_default_prec, mpf_get_prec, mpf_get_si,
12125         mpf_get_ui, mpf_integer_p, mpf_set_default_prec, mpf_set_prec_raw,
12126         mpf_size, mpf_swap, mpn_add_1, mpn_cmp, mpn_hamdist, mpn_popcount,
12127         mpn_sub_1): Use it.
12128
12129         * gmp-impl.h (MPN_SIZEINBASE, MPN_SIZEINBASE_16): New macros from
12130         mpn_sizeinbase, and use GMP_NUMB_BITS.
12131         * mpz/get_str.c, mpz/sizeinbase.c, mpbsd/mout.c, tune/speed.h: Use
12132         MPN_SIZEINBASE.
12133         * mpbsd/mtox.c: Use MPN_SIZEINBASE_16.
12134
12135         * configure.in, mpn/Makefile.am, gmp-impl.h (mpn_sizeinbase): Remove.
12136         * mpn/generic/sizeinbase.c: Remove file.
12137
12138         * gmp-impl.h (MPN_GET_STR_SIZE): Remove.
12139         * tests/mpn/t-g_str_size.c: Remove file.
12140         * tests/mpn/Makefile.am: Update.
12141
12142         * Makefile.am (dist-hook): Don't distribute cvs merge ".#" files.
12143
12144 2002-02-08  Torbjorn Granlund  <tege@swox.com>
12145
12146         * configure.in: Override extra_functions for all sparcv8 systems, not
12147         just supersparc.
12148
12149 2002-02-06  Kevin Ryde  <kevin@swox.se>
12150
12151         * tune/tuneup.c (tune_mul, tune_sqr): Disable FFTs until tuned.
12152         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix memory clobber in
12153         destination cache priming.
12154
12155         * printf/doprnt.c: Fix parsing of %s and %p conversions.
12156         * tests/misc/t-printf.c (check_misc): Add some tests.
12157
12158 2002-02-03  Torbjorn Granlund  <tege@swox.com>
12159
12160         * mpn/sparc32/v8/udiv.asm: New file, from v8/supersparc.
12161
12162         * mpn/generic/set_str.c: Rename indigits_per_limb => chars_per_limb.
12163         Remove redundant chars_per_limb.  Reverse 4 loops in basecase code for
12164         speed.  Use MP_BASES_CHARS_PER_LIMB_10.
12165
12166 2002-02-03  Kevin Ryde  <kevin@swox.se>
12167
12168         * acinclude.m4 (GMP_PROG_NM): Ensure -B or -p get used when doing a
12169         cross compile with the native nm, helps OSF for instance.
12170         (GMP_ASM_LSYM_PREFIX): Remove ".byte 0" for the benefit of irix 6,
12171         allow "N" from nm for OSF, allow for "t" for other systems, but prefer
12172         no mention of the symbol at all.
12173
12174         * tune/tuneup.c (print_define_remark): New function.
12175         Turn some "#if"s into plain "if"s.
12176
12177         * tune/tuneup.c, gmp-impl.h, tune/Makefile.am
12178         (GET_STR_BASECASE_THRESHOLD, GET_STR_PRECOMPUTE_THRESHOLD): Tune these.
12179         * mpn/generic/get_str.c [TUNE_PROGRAM_BUILD]: Cope with non-constant
12180         GET_STR_PRECOMPUTE_THRESHOLD.
12181
12182 2002-02-02  Torbjorn Granlund  <tege@swox.com>
12183
12184         * mpn/generic/get_str.c (mpn_get_str): Fix typo in a declaration.
12185
12186 2002-02-02  Kevin Ryde  <kevin@swox.se>
12187
12188         * mpn/generic/set_str.c: Use MP_PTR_SWAP and POW2_P, add __GMP_PROTO
12189         to convert_blocks prototype, disable SET_STR_BLOCK_SIZE sanity check.
12190
12191         * tune/set_strb.c, tune/set_strs.c: New files.
12192         * tune/speed.h, tune/speed.c, tune/common.c,tune/Makefile.am: Add them.
12193         * tune/tuneup.c: Tune SET_STR_THRESHOLD.
12194         (DEFAULT_MAX_SIZE): Renamed from MAX_SIZE, allow any param.max_size[].
12195
12196 2002-02-01  Torbjorn Granlund  <tege@swox.com>
12197
12198         * tests/mpz/convert.c: Increase operand size.  Add (yet disabled) code
12199         for testing with random strings.
12200
12201         * mpn/generic/get_str.c (mpn_get_str): Rewrite to become sub-quadratic.
12202         (mpn_dc_get_str, mpn_sb_get_str): New functions.
12203
12204 2002-01-31  Kevin Ryde  <kevin@swox.se>
12205
12206         * gmpxx.h (cmp): Renamed from "compare".
12207
12208         * configure.in (AC_C_BIGENDIAN): Don't abort when cross compiling.
12209         (PROLOGUE): Allow new style optional second parameter when grepping.
12210
12211         * acinclude.m4 (GMP_HPC_HPPA_2_0, GMP_ASM_UNDERSCORE,
12212         GMP_ASM_ALIGN_LOG, GMP_ASM_LSYM_PREFIX, GMP_ASM_W32, GMP_ASM_X86_MMX):
12213         Use $ac_objext for object filenames.
12214         (GMP_ASM_UNDERSCORE): Use CCAS to assemble.
12215
12216         * demos/pexpr-config-h.in: New file.
12217         * configure.in: Generate demos/pexpr-config.h.
12218         (AC_CHECK_FUNCS): Add clock, cputime, setrlimit, sigaction,
12219         sigaltstack, sigstack.
12220         * acinclude.m4 (GMP_SUBST_CHECK_FUNCS, GMP_SUBST_CHECK_HEADERS): New
12221         macros.
12222         * demos/pexpr.c: Use pexpr-config.h, not various #ifdefs.
12223         (setup_error_handler): Use signal if sigaction not available, allow
12224         for SIGBUS missing on mingw.
12225         (main): Use time() for random seed if gettimeofday not available.
12226         (cleanup_and_exit): Move SIGFPE out of LIMIT_RESOURCE_USAGE.
12227
12228 2002-01-30  Torbjorn Granlund  <tege@swox.com>
12229
12230         * mpn/generic/set_str.c: Rewrite to become sub-quadratic.
12231         (convert_blocks): New function.
12232
12233 2002-01-30  Kevin Ryde  <kevin@swox.se>
12234
12235         * gmp-impl.h (GMP_NUMB_MASK, GMP_NAIL_MASK, GMP_NUMB_HIGHBIT,
12236         ASSERT_MPN, ASSERT_MP_LIMB_T): New macros.
12237
12238         * mpn/generic/fib2_ui.c: Use GMP_NUMB_BITS, simplify the data
12239         generator program, share __gmp_fib_table initializers between bit
12240         sizes, cope with bit sizes other than those specifically setup.
12241         * gmp-impl.h (FIB_TABLE_LIMIT, FIB_TABLE_LUCNUM_LIMIT): Corresponding
12242         rearrangement of conditionals.
12243         * tests/mpz/t-fib_ui.c (check_fib_table): New test.
12244
12245 2002-01-28  Kevin Ryde  <kevin@swox.se>
12246
12247         * mpz/set_si.c, mpz/iset_si.c: Store to _mp_d[0] unconditionally, use
12248         an expression for _mp_size.
12249
12250         * mpz/init.c, mpz/init2.c, mpz/iset.c, mpq/init.c [__CHECKER__]: Store
12251         dummy values to low limbs to stop them appearing uninitialized.
12252
12253 2002-01-26  Kevin Ryde  <kevin@swox.se>
12254
12255         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use instead a patch from Paul and
12256         Vincent.
12257
12258 2002-01-24  Kevin Ryde  <kevin@swox.se>
12259
12260         * configure.in: Extra quoting to get argument help messages right.
12261
12262         * gmp.texi (Efficiency): Suggest hex or octal for input and output.
12263         (Formatted Output Strings): Mention "*" for width and precision.
12264
12265         * mpn/generic/sizeinbase.c: New file, adapted from mpz/sizeinbase.c.
12266         Use POW2_P, use __mp_bases[base].big_base for log2(base).
12267         * configure.in, mpn/Makefile.am: Add it.
12268         * gmp-impl.h: Add prototype.
12269         * mpz/sizeinbase.c, tune/speed.h, mpn/generic/get_str.c,
12270         mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c: Use it.
12271         * mpz/get_str.c: Write directly to user buffer, skip at most one
12272         leading zero, eliminate special case for x==0.
12273         * mpbsd/mtox.c: Allocate exact result space at the start, eliminate
12274         special case for x==0.
12275         * mpbsd/mout.c: Only need to skip one high zero with mpn_sizeinbase.
12276
12277         * configure.in (--enable-nails): New option.
12278         (GMP_NAIL_BITS, GMP_LIMB_BITS, GMP_NUMB_BITS): New defines for gmp.h
12279         and config.m4.
12280         * gmp-h.in: Add templates.
12281
12282         * mpfr/mpfr-test.h (MAX, MIN, ABS): Use #ifndef to avoid a redefine
12283         error on AIX xlc.
12284
12285 2002-01-23  Torbjorn Granlund  <tege@swox.com>
12286
12287         * mpn/generic/get_str.c: Correct type of `out_len'.
12288
12289 2002-01-22  Kevin Ryde  <kevin@swox.se>
12290
12291         * mpn/generic/pre_divrem_1.c: Corrections to some ASSERTs.
12292
12293         * mpfr/mul_ui.c: Don't call mpn_lshift with 0 shift.
12294
12295         * mpfr/mpz_set_fr.c: Produce correct mpz_t for f==0.
12296
12297 2002-01-21  Torbjorn Granlund  <tege@swox.com>
12298
12299         * longlong.h (32-bit powerpc add_ssaaaa): Remove spurious commutative
12300         declaration.
12301         (64-bit powerpc add_ssaaaa): Likewise.
12302
12303 2002-01-20  Kevin Ryde  <kevin@swox.se>
12304
12305         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Use %n to better detect sparc
12306         solaris 2.7 problems.
12307
12308 2002-01-19  Torbjorn Granlund  <tege@swox.com>
12309
12310         * demos/pexpr.c (mpz_eval_expr): Optimize s^rhs for -1 <= s <= 1.
12311         (cleanup_and_exit): Improve error message wording.
12312
12313 2002-01-19  Kevin Ryde  <kevin@swox.se>
12314
12315         * mpfr/mpfr.h (_PROTO): Use __GMP_PROTO, for compatibility with
12316         gmp-impl.h.
12317
12318 2002-01-17  Torbjorn Granlund  <tege@swox.com>
12319
12320         * mpfr/mpfr-test.h: Test "__hpux", not "hpux".  Mask off mrand48
12321         return value to 31 bits to work around sloppy mpfr #include practices.
12322
12323         * mpfr/tests/*.c: Use #include "", not <>, for gmp.h and mpfr.h.
12324         Make sure to #include mpfr-test.h from all files that use random().
12325
12326 2002-01-17  Kevin Ryde  <kevin@swox.se>
12327
12328         * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE_TYPE): New macro.
12329         * gmp-impl.h, mpz/get_str.c, mpz/out_raw.c, mpq/get_str.c,
12330         mpq/set_str.c, mpf/get_str.c, printf/asprntffuns.c, printf/doprnt.c,
12331         printf/repl-vsnprintf.c, printf/snprntffuns.c, scanf/doscan.c,
12332         mpbsd/mtox.c: Some fixes to compile as C++.
12333
12334         * mpn/generic/jacbase.c (JACOBI_BASE_METHOD): New tuned parameter,
12335         replacing COUNT_TRAILING_ZEROS_TIME test.  Add a third method too.
12336         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
12337         measuring of mpn_jacobi_base methods.
12338         * tune/jacbase1.c, tune/jacbase2.c, tune/jacbase3.c: New files.
12339         * tune/tuneup.c (JACOBI_BASE_METHOD): Tune this.
12340         * mpn/x86/*/gmp-mparam.h (COUNT_TRAILING_ZEROS_TIME): Remove macro.
12341
12342         * gmp-h.in: Use __gmp prefix on variables in inlines.
12343
12344         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Remove __i, unused.
12345
12346         * mpn/generic/mul_fft.c: Use HAVE_NATIVE_mpn_addsub_n, not ADDSUB.
12347         Use CNST_LIMB for some constants.
12348
12349 2002-01-15  Kevin Ryde  <kevin@swox.se>
12350
12351         * tests/mpbsd/Makefile.am: Add a convenience rule for ../libtests.la.
12352
12353         * printf/Makefile.am: libdummy.la should be in EXTRA_LTLIBRARIES.
12354
12355         * mpf/out_str.c: Use MPF_SIGNIFICANT_DIGITS, so mpf_out_str and
12356         mpf_get_str give the same for ndigits==0.
12357
12358         * mpfr/exceptions.c (mpfr_set_emin, mpfr_set_emax): Work around a
12359         powerpc64 gcc 3.0 -O2 bug.
12360
12361         * tests/memory.c, tests/tests.h (tests_memory_validate): New function.
12362
12363 2002-01-14  Kevin Ryde  <kevin@swox.se>
12364
12365         * mpn/generic/sb_divrem_mn.c, mpn/generic/divrem_1.c,
12366         mpn/generic/divrem_2.c, mpn/generic/mod_1.c: Don't use UMUL_TIME and
12367         UDIV_TIME, just default to preinv.
12368         * gmp-impl.h (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Ditto.
12369         (DIVEXACT_1_THRESHOLD, MODEXACT_1_ODD_THRESHOLD): Don't use UMUL_TIME
12370         and UDIV_TIME, make default thresholds 0.
12371         (UDIV_NORM_PREINV_TIME, UDIV_UNNORM_PREINV_TIME): Remove macros.
12372         * mpn/x86/*/gmp-mparam.h (UMUL_TIME, UDIV_TIME,
12373         UDIV_NORM_PREINV_TIME): Remove macros.
12374
12375         * gmp.texi (Headers and Libraries): New section, being the header
12376         notes from "GMP Basics" and some new stuff.
12377         (Parameter Conventions): Notes on "const" parameters.
12378         (Formatted Output Strings): Add type N, tweak some wording.
12379
12380         * tests/refmpn.c (refmpn_divmod_1c): Avoid a bug in i386 gcc 3.0.
12381
12382 2002-01-12  Kevin Ryde  <kevin@swox.se>
12383
12384         * mpz/root.c: Add <stdlib.h>, for abort().
12385
12386         * mpfr/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
12387         * mpfr/mpfr.h, mpfr/mpfr-tests.h, reuse.c, tadd.c, tadd_ui.c, tagm.c,
12388         tatan.c, tcmp2.c, tcos.c, tdiv.c, tdiv_ui.c, teq.c, texp.c,
12389         tget_str.c, thyperbolic.c, tlog.c, tmul.c, tout_str.c, tpow.c,
12390         trandom.c, tset_z.c, tsin.c, tsqrt.c, tsqrt_ui.c, tsub_ui.c, ttan.c,
12391         tui_div.c: Fixes for K&R.
12392
12393         * tests/misc/t-scanf.c (check_misc, check_misc):
12394
12395         * tests/mpz/t-inp_str.c, tests/mpq/t-inp_str.c, tests/misc/t-scanf.c:
12396         Avoid strings in ASSERT, not enjoyed by K&R.
12397         * gmp-impl.h (ASSERT): Note this.
12398
12399         * tests/tests.h (refmpn_mod_34lsub1): Add __GMP_PROTO.
12400
12401         * mpbsd/Makefile.am: Avoid an automake problem with ansi2knr and
12402         sources in a different directory.
12403
12404         * printf/repl-vsnprintf.c: Test HAVE_LONG_DOUBLE for long double.
12405
12406         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mod_34lsub1.c,
12407         mul_2.c, pre_divrem_1.c.
12408
12409         * gmp-h.in, gmp-impl.h (mpn_add_nc, mpn_addmul_1c, mpn_addsub_n,
12410         mpn_addsub_nc, mpn_divrem_1c, mpn_dump, mpn_mod_1c, mpn_mul_1c,
12411         mpn_mul_basecase, mpn_sqr_n, mpn_sqr_basecase, mpn_sub_nc,
12412         mpn_submul_1c): Move to gmp-impl.h, since they're undocumented.
12413
12414         * gmp-impl.h (mpn_reciprocal): Remove, unused.
12415
12416         * tune/many.pl (cntlz, cnttz): Use new SPEED_ROUTINE_COUNT_ZEROS.
12417
12418 2002-01-11  Kevin Ryde  <kevin@swox.se>
12419
12420         * mpn/hppa/*.asm, mpn/pa64/*.asm, mpn/pa64w/*.asm: Use L().
12421
12422 2002-01-08  Kevin Ryde  <kevin@swox.se>
12423
12424         * mpn/asm-defs.m4 (PROLOGUE, EPILOGUE): New scheme, optional function
12425         name to EPILOGUE, check for missing or wrong function name EPILOGUE.
12426         * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/m68k/m68k-defs.m4,
12427         mpn/mips3/mips.m4, mpn/ia64/default.m4, mpn/powerpc32/aix.m4,
12428         mpn/powerpc64/aix.m4, mpn/x86/x86-defs.m4: Consequent updates, add a
12429         few more asserts.
12430         * mpn/alpha/unicos.m4, mpn/alpha/default.m4, mpn/alpha/cntlz.asm,
12431         mpn/alpha/invert_limb.asm (PROLOGUE_GP): Change to an optional "gp"
12432         parameter on plain PROLOGUE.
12433
12434         * gmp.texi (Low-level Functions): mpn_get_str doesn't clobber an extra
12435         limb, and doesn't clobber at all for power of 2 bases.
12436         (Language Bindings): Add python gmpy.
12437
12438         * mpz/get_str.c: Determine realloc size arithmetically.
12439
12440         * mpbsd/mtox.c: Size memory block returned to actual space needed.
12441         * gmp.texi (BSD Compatible Functions): Describe this.
12442
12443         * mpz/get_str.c: Don't copy mpn_get_str input for power of 2 bases.
12444         * mpbsd/mtox.c: Ditto, and as a side effect avoid a memory leak from a
12445         missing TMP_FREE.
12446
12447         * mpz/get_str.c, mpbsd/mout.c: No longer need for +1 limb for
12448         mpn_get_str clobber.
12449
12450         * gmp-impl.h (MPN_GET_STR_SIZE): New macro.
12451         * mpn/generic/get_str.c, mpz/get_str.c, mpbsd/mout.c, mpbsd/mtox.c,
12452         tune/speed.h: Use it.
12453         * tests/mpn/t-g_str_size.c: New test.
12454         * tests/mpn/Makefile.am: Add it.
12455
12456         * gmp-impl.h (POW2_P): New macro.
12457         * mpn/generic/get_str.c, tests/misc.c: Use it.
12458
12459         * printf/doprnt.c: Add "N" for mpn, share some code between N, Q and Z.
12460         * tests/misc/t-printf.c: Add tests.
12461         * gmp-impl.h (ASSERT_CODE): New macro.
12462
12463         * tests/mpbsd/t-mtox.c: New test.
12464         * tests/mpbsd/Makefile.am: Add it.
12465         (allfuns_LDADD): Don't link against libgmp when testing everything in
12466         libmp can link.
12467
12468 2002-01-07  Torbjorn Granlund  <tege@swox.com>
12469
12470         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Rewrite generic versions.
12471
12472 2002-01-06  Kevin Ryde  <kevin@swox.se>
12473
12474         * mpn/generic/pre_divrem_1.c: Don't support size==0.
12475         * tests/devel/try.c: Update.
12476
12477         * mpn/generic/get_str.c: Add special case for base==10.
12478         * gmp-impl.h (MP_BASES_CHARS_PER_LIMB_10, MP_BASES_BIG_BASE_10,
12479         MP_BASES_BIG_BASE_INVERTED_10, MP_BASES_NORMALIZATION_STEPS_10): New
12480         constants.
12481         * tests/t-constants.c: Add checks.
12482         * mpn/mp_bases.c [GENERATE_TABLE]: Print defines for gmp-impl.h, print
12483         all standard bits-per-limb by default.
12484
12485         * demos/pexpr.c, demos/expr/expr.h, demos/expr/expr-impl.h: Use
12486         __GMP_PROTO.
12487
12488         * gmp-h.in (mpn_divexact_by3c): Remove variables from prototype, to
12489         keep out of application namespace.
12490
12491 2002-01-04  Torbjorn Granlund  <tege@swox.com>
12492
12493         * gmp-impl.h: Move _PROTO declaration to before its first usages.
12494
12495 2002-01-04  Kevin Ryde  <kevin@swox.se>
12496
12497         * gmp-h.in, mp-h.in, tests/tests.h: Rename _PROTO to __GMP_PROTO, and
12498         don't use #ifndef just define it ourselves.
12499         * gmp-impl.h: Provide _PROTO as an alias for __GMP_PROTO, to avoid big
12500         edits internally, for the moment.
12501
12502 2002-01-03  Torbjorn Granlund  <tege@swox.com>
12503
12504         * tune/speed.c (usage): Insert "\n\" into a string.
12505
12506 2001-12-30  Torbjorn Granlund  <tege@swox.com>
12507
12508         * mpn/pa64/udiv_qrnnd.c: Remove file.
12509         * mpn/pa64w/udiv_qrnnd.c: Remove file.
12510
12511         * gmp-impl.h (MPN_IORD_U): Change formatting (labels in pos 0, insns
12512         indented by tab).
12513         (MPN_INCR_U): Use "addl $1,foo; jc", not "incl foo; jz".
12514
12515         * gmp-impl.h (udiv_qrnnd_preinv): Use plain subtract, not sub_ddmmss,
12516         in one more case.
12517
12518 2001-12-30  Kevin Ryde  <kevin@swox.se>
12519
12520         * mpn/generic/get_str.c (udiv_qrnd_unnorm): New macro.
12521         Use "do while" for dig_per_u loop since it's non-zero.
12522         * acconfig.h (HAVE_HOST_CPU_m68k etc): Add templates.
12523
12524         * mpn/generic/mul_basecase.c, mpz/mul.c, mpz/n_pow_ui.c,
12525         mpn/x86/pentium/mul_2.asm, tests/devel/try.c, tests/tests.h,
12526         tests/refmpn.c, tune/speed.c, tune/speed.h, tune/common.c,
12527         tune/many.pl (mpn_mul_2): New parameter style.
12528         * gmp-impl.h (mpn_mul_2): Add prototype.
12529         * configure.in (gmp_mpn_functions_optional): Add mul_2.
12530
12531         * longlong.h (__vxworks__): Remove from powerpc tests, not correct,
12532         not on its own at least.
12533
12534         * tune/speed.c: Add "aas" to specify 0xAA..AA data.
12535
12536         * tune/tuneup.c (print_define_end): Indicate "never" and "always".
12537
12538 2001-12-29  Torbjorn Granlund  <tege@swox.com>
12539
12540         * mpq/set_d.c: ANSI-fy.
12541         * mpz/invert.c: Use PTR and SIZ (cosmetic change).
12542
12543         * mpz/cong.c: Rename `xor' to `sign' to avoid C++ reserved word.
12544
12545 2001-12-28  Torbjorn Granlund  <tege@swox.com>
12546
12547         * mpn/sparc64/sqr_diagonal.asm: New file.
12548
12549 2001-12-28  Kevin Ryde  <kevin@swox.se>
12550
12551         * mpn/generic/get_str.c: Avoid one mpn_divrem_1 by running main loop
12552         only until msize==1.
12553
12554         * tune/tuneup.c: Break up all() for clarity.
12555         (USE_PREINV_DIVREM_1, USE_PREINV_MOD_1): Compare against plain
12556         division udiv_qrnnd, not the tuned and possibly preinv version.
12557
12558         * tune/freq.c: Split sysctl and sysctlbyname probes into separate
12559         functions, shorten some identifiers, put descriptions inside
12560         functions, define functions unconditionally and do nothing if
12561         requisites not available.
12562
12563         * mpz/inp_raw.c: Avoid a gcc 3.0 powerpc64 bug on AIX.
12564
12565         * acinclude.m4, configure.in (GMP_C_RESTRICT): New macro.
12566
12567         * mpfr/sin.c: Patch from Paul to fix sign of sin(3pi/2).
12568
12569         * demos/calc/calc.y: Improve some error messages.
12570
12571 2001-12-28  Torbjorn Granlund  <tege@swox.com>
12572
12573         * mpn/sparc64/mul_1.asm: Rename r72 -> r80.
12574         * mpn/sparc64/addmul_1.asm: Likewise.
12575
12576 2001-12-27  Torbjorn Granlund  <tege@swox.com>
12577
12578         * mpn/generic/tdiv_qr.c: Misc formatting cleanups.
12579         For switch case 2, replace `dn' with its value (2).
12580
12581 2001-12-25  Torbjorn Granlund  <tege@swox.com>
12582
12583         * tests/devel/mul_1.c: Add FIXED_XLIMB.
12584         * tests/devel/addmul_1.c: Likewise.
12585         * tests/devel/submul_1.c: Likewise.
12586
12587         * tests/devel/add_n.c: Improve error message.
12588         Accept command line argument for # of tests.
12589         * tests/devel/sub_n.c: Likewise.
12590
12591         * tests/devel/: Remove CLOCK settings.
12592
12593         * mpn/sparc32/v9/mul_1.asm: Rewrite.
12594         * mpn/sparc32/v9/addmul_1.asm: Rewrite.
12595         * mpn/sparc32/v9/submul_1.asm: Rewrite.
12596
12597 2001-12-24  Torbjorn Granlund  <tege@swox.com>
12598
12599         * mpn/sparc64/mul_1.asm: Get rid of global constant 0.0 (L(noll)).
12600         * mpn/sparc64/addmul_1.asm: Likewise.
12601
12602 2001-12-23  Torbjorn Granlund  <tege@swox.com>
12603
12604         * mpn/generic/get_str.c: Move final ASSERT to just before zero fill
12605         loop.
12606
12607 2001-12-22  Torbjorn Granlund  <tege@swox.com>
12608
12609         * mpn/generic/get_str.c: Move ASSERTs out of loops.  Split digit
12610         generation code into two loops, saving a test of msize in the loop.
12611
12612 2001-12-22  Kevin Ryde  <kevin@swox.se>
12613
12614         * mpn/x86/x86-defs.m4, mpn/x86/*/*.asm: Remove L / LF scheme putting
12615         function name in local labels.
12616
12617         * mpn/generic/get_str.c: Use mpn_preinv_divrem_1, add a couple of
12618         ASSERTs.
12619
12620         * mpn/generic/pre_divrem_1.c: New file.
12621         * configure.in (gmp_mpn_functions): Add it.
12622         * gmp-impl.h (mpn_preinv_divrem_1): Add prototype.
12623         (USE_PREINV_DIVREM_1, MPN_DIVREM_OR_PREINV_DIVREM_1): New macros.
12624         * tests/devel/try.c, tune/speed.c, tune/speed.h, tune/common.c,
12625         tune/many.pl, tune/Makefile.am (mpn_preinv_divrem_1): Add testing and
12626         measuring.
12627         * tune/tuneup.c: Determine USE_PREINV_DIVREM_1.
12628         * tune/pre_divrem_1.c: New file.
12629         * tests/refmpn.c, tests/tests.h (refmpn_preinv_divrem_1): New function.
12630
12631         * tests/mpz/t-io_raw.c: New file.
12632         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
12633
12634         * mpz/inp_raw.c, mpz/out_raw.c: Rewrite.
12635         * acinclude.m4, configure.in (AC_C_BIGENDIAN): New test.
12636         * gmp-impl.h (BSWAP_LIMB): New macro.
12637
12638         * acinclude.m4 (GMP_PROG_CC_WORKS): For a native compile, demand
12639         executables will run, per AC_PROG_CC.  This detects ABI=64 is unusable
12640         in a native sparc solaris 7 build with the kernel in 32-bit mode.
12641         * gmp.texi (ABI and ISA): Add notes on this, add an example configure
12642         setting an ABI.
12643
12644         * tune/tuneup.c, configure.in: Print the gmp-mparam.h filename.
12645         * tune/tuneup.c: Print the CPU frequency.
12646
12647         * tune/time.c, tune/speed.h: Add s390 "stck" method, flatten
12648         conditionals in speed_time_init a bit, use have_* variables to let
12649         some code go dead in speed_starttime and speed_endtime.
12650
12651         * tune/freq.c (speed_cpu_frequency_irix_hinv): New function.
12652
12653         * Makefile.am, configure.in: Restore mpfr.
12654
12655         * configure.in: Add --with-readline, AC_PROG_YACC and AM_PROG_LEX.
12656         * demos/calc/calc.y, demos/calc/calclex.l: Add readline support, add
12657         lucnum function.
12658         * demos/calc/Makefile.am: Add calcread.c, calc-common.h, use $(YACC),
12659         $(LEX) and $(LEXLIB).
12660         * demos/calc/calcread.c, demos/calc/calc-common.h,
12661         demos/calc/calc-config-h.in, demos/calc/README: New files.
12662
12663         * configure.in: Put demos/expr configs in expr-config.h.
12664         * demos/expr/expr-config-h.in: New file.
12665         * demos/expr/expr-impl.h: Renamed from expr-impl-h.in, get configs
12666         from expr-config.h.
12667         * demos/expr/Makefile.am: Update.
12668
12669         * demos/expr/exprfr.c: Use mpfr_sin and mpfr_cos, remove some spurious
12670         returns.
12671
12672 2001-12-20  Torbjorn Granlund  <tege@swox.com>
12673
12674         * mpn/sparc64/mul_1.asm: Trim an instruction.
12675         * mpn/sparc64/addmul_1.asm: Likewise.
12676
12677         * mpn/ia64/add_n.asm: Rewrite.
12678         * mpn/ia64/sub_n.asm: Rewrite.
12679
12680 2001-12-19  Torbjorn Granlund  <tege@swox.com>
12681
12682         * mpn/ia64/mul_1.asm: Rewrite.
12683         * mpn/ia64/addmul_1.asm: Rewrite.
12684         * mpn/ia64/submul_1.c: Use TMP_ALLOC_LIMBS.
12685
12686         * tests/devel/mul_1.c: Improve error message.
12687         Accept command line argument for # of tests.
12688         * tests/devel/addmul_1.c: Likewise.
12689         * tests/devel/submul_1.c: Likewise.
12690
12691 2001-12-18  Torbjorn Granlund  <tege@swox.com>
12692
12693         * mpn/mips3/mul_1.asm: Add NOPs to save a cycle on R1x000.
12694
12695 2001-12-18  Kevin Ryde  <kevin@swox.se>
12696
12697         * gmpxx.h (gmp_randclass): Don't allow copy constructors or "=",
12698         implementation by Gerardo.
12699
12700         * gmp-h.in (operator<<, operator>>): Remove parameter names from
12701         prototypes, to keep out of user namespace.
12702
12703         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Let the test program work as C++.
12704
12705 2001-12-16  Torbjorn Granlund  <tege@swox.com>
12706
12707         * mpn/sparc64/mul_1.asm: Rewrite.
12708         * mpn/sparc64/addmul_1.asm: Rewrite.
12709         * mpn/sparc64/submul_1.asm: Rewrite.
12710
12711         * mpn/sparc64/addmul1h.asm: Remove.
12712         * mpn/sparc64/submul1h.asm: Remove.
12713         * mpn/sparc64/mul1h.asm: Remove.
12714
12715 2001-12-15  Kevin Ryde  <kevin@swox.se>
12716
12717         * gmp-h.in (mpn_add, mpn_add_1, mpn_cmp, mpn_sub, mpn_sub_1): Follow
12718         __GMP_INLINE_PROTOTYPES for whether to give prototype with inline.
12719
12720         * configure.in (i686*-*-*, pentiumpro-*-*, pentium[23]-*-*,
12721         athlon-*-*, pentium4-*-*): Fall back on -march=pentium if
12722         -march=pentiumpro or higher is not good (eg. solaris cmov).
12723
12724 2001-12-12  Torbjorn Granlund  <tege@swox.com>
12725
12726         * gmp-impl.h (MPN_ZERO): Rewrite generic version to be similar to
12727         powerpc version.
12728
12729 2001-12-12  Kevin Ryde  <kevin@swox.se>
12730
12731         * acinclude.m4 (GMP_PROG_CC_WORKS): Detect cmov problems with gcc
12732         -march=pentiumpro on solaris 2.8.
12733
12734         * tune/common.c, tune/speed.h: Allow for commas in count_leading_zeros
12735         and count_trailing_zeros macros.
12736
12737         * demos/expr/Makefile.am: Distribute exprfr.c and exprfra.c.
12738
12739         * tune/Makefile.am (speed_ext_SOURCES): Should be speed-ext.c.
12740
12741 2001-12-10  Torbjorn Granlund  <tege@swox.com>
12742
12743         * mpn/s390/addmul_1.asm: New file.
12744         * mpn/s390/submul_1.asm: New file.
12745         * mpn/s390/mul_1.asm: New file.
12746         * mpn/s390/gmp-mparam.h: Update.
12747
12748 2001-12-07  Kevin Ryde  <kevin@swox.se>
12749
12750         * gmp-h.in, mp-h.in, gmp-impl.h: __GMP_DECLSPEC at start of
12751         prototypes, for the benefit of Microsoft C.
12752
12753         * gmp.texi (Introduction to GMP): Mention ABI and ISA section.
12754         (Known Build Problems): Recommend GNU sed on solaris 2.6.
12755         (Assigning Integers): Direct feedback to bug-gmp.
12756         (References): Typo Knuth vol 2 is from 1998.
12757
12758         * gmpxx.h (gmp_randclass): Add initializers for gmp_randinit_default
12759         and gmp_randinit_lc_2exp_size.
12760         gmp.texi (C++ Interface Random Numbers): Describe them.
12761
12762         * tests/misc/t-locale.c, tests/cxx/t-locale.cc: Ensure mpf_clear is
12763         done when the localconv override doesn't work.  Reported by Mike
12764         Jetzer.
12765
12766         * printf/doprnti.c: Don't showbase on a zero mpq denominator.
12767         * tests/misc/t-printf.c, tests/cxx/t-ostream.c: Add test cases.
12768
12769 2001-12-04  Kevin Ryde  <kevin@swox.se>
12770
12771         * gmp.texi (Known Build Problems): Update to gmp_randinit_lc_2exp_size
12772         for the sparc solaris 2.7 problem.
12773         (Reentrancy): SCO ctype.h affects all text-based input functions.
12774         (Formatted Output Strings): Correction to the mpf example.
12775         (Single Limb Division): Correction, should be q-1 not q+1.
12776         (Extended GCD): Clarify why single-limb is inferior.
12777         (Raw Output Internals): Clarify size is twos complement, note limb
12778         order means _mp_d doesn't get directly read or written.
12779         (Contributors): Clarify mpz_jacobi.
12780         And a couple of formatting tweaks elsewhere.
12781
12782         * tests/cxx/t-headers.cc: New file.
12783         * tests/cxx/Makefile.am: Add it.
12784
12785         * gmpxx.h: Add <strstream>, needed by mpf_class::get_str2.
12786
12787         * gmp-h.in (mpq_inp_str, mpn_hamdist): Add __GMP_DECLSPEC.
12788
12789 2001-12-01  Torbjorn Granlund  <tege@swox.com>
12790
12791         * Version 4.0 released.
12792
12793         * mpfr/README: Replace contents with explanation of why mpfr is gone.
12794
12795 2001-12-01  Kevin Ryde  <kevin@swox.se>
12796
12797         * Makefile.am, configure.in: Temporarily remove mpfr, just leave a
12798         README.
12799
12800         * mpn/Makefile.am (EXTRA_DIST): Add Makeasm.am.
12801
12802 2001-11-30  Gerardo Ballabio  <ballabio@sissa.it>
12803
12804         * tests/cxx/t-constr.cc, tests/cxx/t-expr.cc: New files.
12805         * tests/cxx/Makefile.am (check_PROGRAMS): Add them.
12806
12807 2001-11-30  Kevin Ryde  <kevin@swox.se>
12808
12809         * mpfr: Update to 2001-11-16.  Patch TMP handling of agm.c and sqrt.c,
12810         use plain mpn_sqrtrem in sqrt.c, separate .c files for floor and ceil,
12811         disable an expression style assert in add1.c.
12812
12813         * mpn/s370: Rename to s390.
12814         * configure.in (s3[6-9]0*-*-*): Update.
12815         * mpn/Makefile.am (TARG_DIST): Add s390.
12816
12817         * mpz/fits_s.c, mpf/fits_s.c, mpf/fits_u.c: Remove files, unused since
12818         change to .h style.
12819
12820 2001-11-29  Torbjorn Granlund  <tege@swox.com>
12821
12822         * gmp-h.in: Declare mpz_get_d_2exp and mpf_get_d_2exp.
12823         * Makefile.am: Add mpz/get_d_2exp$U.lo and mpf/get_d_2exp$U.lo.
12824         * mpf/Makefile.am: Add get_d_2exp.c.
12825         * mpz/Makefile.am: Add get_d_2exp.c.
12826
12827 2001-11-29  Kevin Ryde  <kevin@swox.se>
12828
12829         * mpn/*/gmp-mparam.h: Update measured thresholds.
12830         * mpn/s370/gmp-mparam.h: New file.
12831
12832         * mpz/millerrabin.c: Mark for internal use only, for now.
12833         * gmp.texi (Number Theoretic Functions): Remove documentation.
12834
12835 2001-11-28  Torbjorn Granlund  <tege@swox.com>
12836
12837         * mpf/get_d_2exp.c: New file.
12838         * mpz/get_d_2exp.c: New file.
12839
12840         * mpz/realloc2.c: Fix typo.  Make more similar to mpz_realloc.
12841         * mpz/realloc.c: Use __GMP_REALLOCATE_FUNC_LIMBS.
12842
12843 2001-11-27  Gerardo Ballabio  <ballabio@sissa.it>
12844
12845         * gmpxx.h, mpfrxx.h: Various updates and improvements.
12846
12847 2001-11-27  Kevin Ryde  <kevin@swox.se>
12848
12849         * gmp.texi (Useful Macros and Constants): Add gmp_version, add @findex
12850         for mp_bits_per_limb.
12851
12852         * demos/perl/GMP.pm, demos/perl/GMP.xs: Use new style gmp_randinit's.
12853         * demos/perl/test.pl: Update for this, and for mpz_perfect_power_p
12854         handling of 0 and 1.
12855
12856 2001-11-26  Torbjorn Granlund  <tege@swox.com>
12857
12858         * mpz/realloc.c: Clear variable when decreasing allocation to less than
12859         needed.  Misc updates.
12860
12861 2001-11-25  Kevin Ryde  <kevin@swox.se>
12862
12863         * tests/misc/t-locale.c: Avoid printf in the normal case, since the
12864         replacement localeconv breaks it on SunOS 4.
12865
12866         * gmp.texi (Build Options, Notes for Package Builds): Note libgmpxx
12867         depends on libgmp from same GMP version.
12868
12869         * acinclude.m4, configure.in (GMP_FUNC_SSCANF_WRITABLE_INPUT): New
12870         test.
12871         * scanf/sscanf.c, scanf/vsscanf.c: Use it to ensure sscanf input is
12872         writable, if necessary.
12873
12874         * tests/misc/t-scanf.c: Ensure sscanf arguments are writable, always.
12875         * configure.in (AC_CHECK_DECLS): Remove sscanf, no longer required.
12876
12877         * configure.in (none-*-*): Fix default CFLAGS setups.
12878
12879         * doc/configuration: Misc updates.
12880
12881 2001-11-23  Kevin Ryde  <kevin@swox.se>
12882
12883         * mpz/init2.c, mpz/realloc2.c: New files.
12884         * Makefile.am, mpz/Makefile.am: Add them.
12885         * gmp-h.in: Add prototypes.
12886         * gmp.texi (Efficiency): Mention these instead of _mpz_realloc.
12887         (Initializing Integers): Add documentation, reword other parts.
12888
12889 2001-11-22  Torbjorn Granlund  <tege@swox.com>
12890
12891         * mpn/cray/ieee/addmul_1.c: Fix logic for more_carries scalar loop.
12892         * mpn/cray/ieee/submul_1.c: Likewise.
12893
12894 2001-11-20  Kevin Ryde  <kevin@swox.se>
12895
12896         * gmp.texi (Known Build Problems): Note an out of memory on DJGPP.
12897         (Function Classes): Update function counts.
12898         Misc tweaks elsewhere.
12899
12900         * configure.in (AC_CHECK_DECLS): Add sscanf.
12901         * tests/misc/t-scanf.c: Use it, for the benefit of SunOS 4.
12902
12903         * tal-debug.c, gmp-impl.h: More checks of TMP_DECL/TMP_MARK/TMP_FREE
12904         consistency.
12905
12906         * mpfr/Makefile.am (AR): Explicit AR=@AR@ to override automake
12907         default, necessary for powerpc64 ABI=aix64.
12908
12909 2001-11-18  Torbjorn Granlund  <tege@swox.com>
12910
12911         * mpz/powm.c: Move TMP_MARK to before any TMP_ALLOCs.
12912
12913 2001-11-18  Kevin Ryde  <kevin@swox.se>
12914
12915         * configure.in (--enable-fft): Make this the default.
12916         * gmp.texi (Build Options): Update.
12917
12918         * Makefile.am (libmp_la_DEPENDENCIES): Revise mpz objects needed by
12919         new mpz/powm.c.
12920
12921         * gmp.texi (Random State Initialization): Add gmp_randinit_default and
12922         gmp_randinit_lc_2exp_size, mark gmp_randinit as obsolete.
12923         (Random State Seeding): New section, taken from "Random State
12924         Initialization" and "Random Number Functions".
12925
12926         * configure.in (AC_CHECK_DECLS): Add fgetc, fscanf, ungetc.
12927         * scanf/fscanffuns.c: Use these, for the benefit of SunOS 4.
12928
12929         * gmp-impl.h, gmp-h.in (__gmp_default_fp_limb_precision): Move back to
12930         gmp-impl.h now not required for inlined mpf.
12931
12932         * randlc2s.c (gmp_randinit_lc_2exp_size): New file, the size-based LC
12933         selection from rand.c.
12934         * rand.c (gmp_randinit): Use it.
12935         * randdef.c (gmp_randinit_default): New file.
12936         * gmp-impl.h (RANDS): Use it.
12937         (ASSERT_CARRY): New macro.
12938         * gmp-h.in (gmp_randinit_default, gmp_randinit_lc_2exp_size: Add
12939         prototypes.
12940         * Makefile.am (libgmp_la_SOURCES): Add randdef.c and randlc2s.c.
12941
12942         * printf/asprntffuns.c: Include config.h before using its defines.
12943
12944         * gmp-impl.h: Move C++ <string> to top of file to avoid the memset
12945         redefine upsetting configure tests.  Remove <iostream> since <iosfwd>
12946         in gmp.h suffices.
12947
12948 2001-11-16  Kevin Ryde  <kevin@swox.se>
12949
12950         * gmp.texi (Integer Exponentiation): mpz_powm supports negative
12951         exponents.
12952         (Assigning Floats, I/O of Floats, C++ Formatted Output, C++ Formatted
12953         Input): Decimal point follows locale.
12954         (Formatted Output Strings): %n accepts any type.
12955         (Formatted Input Strings): New section.
12956         (Formatted Input Functions): New section.
12957         (C++ Class Interface): Corrections and clarifications suggested by
12958         Gerardo.
12959
12960         * scanf/doscan.c, scanf/fscanf.c, scanf/fscanffuns.c, scanf/scanf.c,
12961         scanf/sscanf.c, scanf/sscanffuns.c, scanf/vfscanf.c, scanf/vscanf.c,
12962         scanf/vsscanf.c, scanf/Makefile.am, tests/misc/t-scanf.c: New files.
12963         * gmp-h.in, gmp-impl.h, Makefile.am, configure.in: Consequent
12964         additions.
12965
12966         * tests/misc: New directory.
12967         * tests/misc/Makefile.am: New file.
12968         * tests/misc/t-locale.c: New file.
12969         * tests/misc/t-printf.c: Moved from tests/printf.
12970         * tests/printf: Remove directory.
12971         * configure.in, tests/Makefile.am: Update.
12972
12973         * tests/cxx/t-locale.cc: New file.
12974         * tests/cxx/Makefile.am: Add it.
12975
12976         * mpf/set_str.c, cxx/ismpf.cc: Use localeconv for the decimal point.
12977
12978         * acinclude.m4 (GMP_ASM_X86_MCOUNT): Update to $lt_prog_compiler_pic
12979         for current libtool, recognise non-PIC style mcount in windows DLLs.
12980
12981         * gmp-impl.h (__gmp_replacement_vsnprintf): Add prototype.
12982
12983         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized,
12984         modlimb_invert_table): Add __GMP_DECLSPEC for the benefit of test
12985         programs using them from a windows DLL.
12986         * longlong.h (__clz_tab): Ditto.
12987
12988         * mpn/x86/t-zdisp2.pl: New file.
12989
12990         * mpn/x86/pentium4/README: New file.
12991
12992 2001-11-15  Torbjorn Granlund  <tege@swox.com>
12993
12994         * mpz/powm.c (HANDLE_NEGATIVE_EXPONENT): #define to 1.
12995         * tests/mpz/reuse.c (main): Use mpz_invert to avoid undefined mpz_powm
12996         cases.
12997
12998 2001-11-14  Torbjorn Granlund  <tege@swox.com>
12999
13000         * mpz/powm_ui.c: Rewrite along the lines of mpz/powm.c (except still no
13001         redc).
13002         * mpz/powm.c: Adjust for negative b, after exponentiation done.  Add
13003         (still disabled) code for handling negative exponents.  Misc cleanups.
13004
13005 2001-11-14  Kevin Ryde  <kevin@swox.se>
13006
13007         * mpf/out_str.c: Use localeconv for the decimal point.
13008
13009         * tests/misc.c (tests_rand_end): Use time() if gettimeofday() not
13010         available (eg. on mingw).
13011
13012 2001-11-11  Kevin Ryde  <kevin@swox.se>
13013
13014         * gmp-h.in: Remove parameter names from prototypes, to keep out of
13015         application namespace.
13016
13017 2001-11-08  Kevin Ryde  <kevin@swox.se>
13018
13019         * acinclude.m4 (GMP_GCC_VERSION_GE): Fix sed regexps to work on
13020         Solaris 8.
13021
13022         * printf/doprnt.c: Support %n of all types, per glibc.
13023
13024         * gmp-h.in, gmp-impl.h, mpf/abs.c, mpf/neg.c, mpf/get_prc.c,
13025         mpf/get_dfl_prec.c, mpf/set_dfl_prec.c, mpf/set_prc_raw.c,
13026         mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Revert mpf inlining, in order
13027         to leave open the possibility of keeping binary compatibility if mpf
13028         becomes mpfr.
13029
13030         * mpn/x86/k7/mmx/lshift.asm, mpn/x86/k7/mmx/rshift.asm: Use Zdisp to
13031         force code size for computed jumps.
13032         * mpn/x86/k6/mod_34lsub1.asm, mpn/x86/k6/k62mmx/copyd.asm: Use Zdisp
13033         to force good code alignment.
13034         * mpn/x86/x86-defs.m4 (Zdisp): More instructions.
13035
13036         * mpn/x86/pentium/sqr_basecase.asm, mpn/x86/k7/mmx/mod_1.asm,
13037         mpn/x86/k7/mmx/popham.asm: Remove some unnecessary "0" address offsets.
13038
13039         * mpq/set_si.c, mpq/set_ui.c: Set _mp_den._mp_size correctly if den==0.
13040
13041 2001-11-07  Torbjorn Granlund  <tege@swox.com>
13042
13043         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Work around gas bug.
13044
13045         * mpn/asm-defs.m4 (PROLOGUE): Change alignment to 8 (probably a good
13046         idea in general; required for hppa/hppa1_1/udiv_qrnnd.asm).
13047
13048 2001-11-06  Torbjorn Granlund  <tege@swox.com>
13049
13050         * gmp-impl.h (MPN_COPY_INCR): Prepend local variable by `__'.
13051         (MPN_COPY_DECR): Likewise.
13052
13053 2001-11-05  Torbjorn Granlund  <tege@swox.com>
13054
13055         * mpz/powm.c: Call mpn functions, not mpz functions, for computation
13056         mod m.  Streamline allocations to use a mixture of stack allocation and
13057         heap allocation.  Add currently disabled phi(m) exponent reduction
13058         code.  Misc optimizations and cleanups.
13059
13060 2001-11-05  Kevin Ryde  <kevin@swox.se>
13061
13062         * mpq/inp_str.c: Remove unused variable "ret".
13063
13064         * mpn/x86/k7/sqr_basecase.asm: Fix a 0(%edi) to use Zdisp, so the
13065         computed jumps hit the right spot on old gas.
13066
13067         * mpq/canonicalize.c: DIVIDE_BY_ZERO if denominator is zero.
13068
13069         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Correction to the way
13070         the first \( \) pair is setup.
13071         (gmpasm-font-lock-keywords): Don't fontify the space before a "#" etc.
13072         Misc tweaks to some comments.
13073
13074 2001-11-03  Torbjorn Granlund  <tege@swox.com>
13075
13076         * tests/refmpn.c (refmpn_overlap_p): Reverse return values.
13077
13078 2001-11-02  Kevin Ryde  <kevin@swox.se>
13079
13080         * tune/many.pl: Setup CFLAGS_PIC and ASMFLAGS_PIC, since that's no
13081         longer done by configure.
13082
13083         * mpn/x86/pentium4/mmx/popham.asm: New file.
13084
13085         * mpn/x86/x86-defs.m4 (psadbw): New macro.
13086         * mpn/x86/k7/mmx/popham.asm: Use it.
13087
13088         * tests/refmpn.c (refmpn_overlap_p): New function, independent of
13089         MPN_OVERLAP_P.
13090
13091 2001-10-31  Torbjorn Granlund  <tege@swox.com>
13092
13093         * tests/mpz/t-powm.c: Print proper error message when finding
13094         discrepancy.
13095
13096 2001-10-31  Kevin Ryde  <kevin@swox.se>
13097
13098         * mpn/x86/pentium/mod_34lsub1.asm: New file.
13099         * mpn/x86/k7/mod_34lsub1.asm: New file.
13100         * mpn/x86/mod_34lsub1.asm: New file.
13101
13102 2001-10-30  Kevin Ryde  <kevin@swox.se>
13103
13104         * tests/printf/t-printf.c (check_misc): Add checks from the glibc docs.
13105         (check_vasprintf, check_vsnprintf): Run these unconditionally.
13106
13107         * gmp-impl.h (ASSERT_MPQ_CANONICAL): New macro.
13108         * mpq/cmp.c, mpq/cmp_si.c, mpq/cmp_ui.c, mpq/equal.c: Add ASSERTs for
13109         canonical inputs, where correctness depends on it.
13110
13111         * mpn/lisp/gmpasm-mode.el (comment-start-skip): Add "dnl".
13112
13113 2001-10-27  Torbjorn Granlund  <tege@swox.com>
13114
13115         * demos/pexpr.c: Remove some unused variables.
13116         (main): Allocate more buffer space to accommodate minus sign.
13117
13118 2001-10-27  Kevin Ryde  <kevin@swox.se>
13119
13120         * gmp-impl.h, mpn/asm-defs.m4, configure.in, tune/speed.h,
13121         tune/speed.c, tune/common.c, tune/many.pl, tests/devel/try.c: Add
13122         mpn_mod_34lsub1.
13123         * tests/refmpn.c, tests/tests.h (refmpn_mod_34lsub1): New function.
13124
13125         * mpn/generic/mod_34lsub1.c: New file.
13126         * mpn/x86/k6/mod_34lsub1.asm: New file.
13127         * mpn/x86/pentium4/sse2/mod_34lsub1.asm: New file.
13128         * mpn/x86/x86-defs.m4 (Zdisp): Add another instruction.
13129
13130         * gmp-h.in, gmpxx.h: Use <iosfwd> not whole <iostream>.
13131
13132         * gmp.texi (Known Build Problems): Add note on test programs with
13133         Windows DLLs.
13134
13135 2001-10-26  Kevin Ryde  <kevin@swox.se>
13136
13137         * tests/mpq/t-get_d.c: Limit the size of "eps" for vax.
13138
13139         * gmp.texi (maybepagebreak): New macro, use it in a few places.
13140         (Notes for Particular Systems): C++ Windows DLLs are not supported.
13141         (Known Build Problems): Note sparc solaris 2.7 gcc 2.95.2 shared
13142         library problems.
13143         (Autoconf): Tweak version numbers shown.
13144         (Integer Roots): mpz_perfect_square_p and mpz_perfect_power_p consider
13145         0 and 1 perfect powers, mpz_perfect_power_p accepts negatives.
13146         (Number Theoretic Functions): Add mpz_millerrabin, combined with a
13147         reworded mpz_probab_prime_p.
13148         (Formatted Output Strings): Misc clarifications.
13149         (Formatted Output Functions): gmp_asprintf, gmp_vasprintf,
13150         gmp_snprintf, gmp_vsnprintf always available.
13151         (C++ Formatted Output): Misc rewordings.
13152         (Formatted Input): New chapter.
13153         (C++ Class Interface): New chapter, by Gerardo and me.
13154         (Language Bindings): Update GMP++ now in GMP.
13155         (C++ Interface Internals): New section, by Gerardo and me.
13156
13157         * printf/repl-vsnprintf.c: New file.
13158         * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am: Use it
13159         if libc vsnprintf missing or bad.
13160         * configure.in (AC_CHECK_FUNCS): Add strnlen.
13161
13162         * printf/snprntffuns.c, printf/vasprintf.c: Use
13163         __gmp_replacement_vsnprintf if libc vsnprintf not available.
13164         * printf/asprintf.c, printf/snprintf.c, printf/vasprintf.c,
13165         printf/vsnprintf.c: Provide these functions unconditionally.
13166         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Remove warning about omissions
13167         when vsnprintf not available.
13168
13169 2001-10-24  Kevin Ryde  <kevin@swox.se>
13170
13171         * configure, aclocal.m4: Regenerate with a libtool patch for a stray
13172         quote in AC_LIBTOOL_PROG_LD_SHLIBS under mingw and cygwin.
13173
13174         * gmp-impl.h (modlimb_invert): More comments.
13175
13176         * printf/doprnt.c, printf/doprnti.c: Use the precision field to print
13177         leading zeros.
13178         * tests/printf/t-printf.c: Test this.
13179         * cxx/osdoprnti.cc, gmp-impl.h: Ignore precision in operator<<.
13180
13181         * tune/speed.c, tune/speed.h, tune/common.c: Add mpn_mul_1_inplace.
13182
13183 2001-10-23  Torbjorn Granlund  <tege@swox.com>
13184
13185         * mpz/pprime_p.c (mpz_millerrabin): Remove function and its descendant.
13186
13187         * mpz/millerrabin.c: New file with code from pprime.c.
13188         * mpz/Makefile.am: Compile millerrabin.c.
13189         * Makefile.am (MPZ_OBJECTS): Ditto.
13190         * gmp-h.in: Declare mpz_millerrabin.
13191
13192 2001-10-22  Torbjorn Granlund  <tege@swox.com>
13193
13194         * tests/mpz/t-perfsqr.c: New file.
13195         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
13196
13197         * demos/factorize.c (factor): Check for number to factor == 0.
13198         (main): When invoked without arguments, read from stdin.
13199
13200         * mpz/perfpow.c: Add code to handle negative perfect powers ((-b)^odd).
13201         Treat 0 and 1 as perfect powers.
13202
13203         * mpn/sparc32/v9/sqr_diagonal.asm: Jump past .align.
13204
13205 2001-10-21  Torbjorn Granlund  <tege@swox.com>
13206
13207         * mpn/generic/perfsqr.c (sq_res_0x100): Remove bogus final `,'.
13208         (mpn_perfect_square_p): Suppress superfluous `&1' in sq_res_0x100 test.
13209         (mpn_perfect_square_p, O(n) test): Improve comments.  Combine remainder
13210         tests for some small primes.  Don't share code for different limb
13211         sizes.  Use single `if' with many `||' for better code density.
13212
13213 2001-10-22  Kevin Ryde  <kevin@swox.se>
13214
13215         * demos/perl/GMP.xs (mutate_mpz, tmp_mpf_grow): Make these "static".
13216
13217         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm
13218         (mpn_popcount_table): Use GSYM_PREFIX.
13219
13220 2001-10-19  Kevin Ryde  <kevin@swox.se>
13221
13222         * mpn/x86/*.asm: Add some measured speeds on various x86s.
13223
13224         * tests/mpz/reuse.c, tests/mpf/reuse.c: Disable tests when using a
13225         windows DLL, because certain global variable usages won't compile.
13226
13227         * configure.in (AC_CHECK_FUNCS): Add alarm.
13228         * tests/spinner.c: Conditionalize alarm and SIGALRM availability, for
13229         the benefit of mingw32.
13230
13231         * acinclude.m4 (GMP_ASM_TYPE, GMP_ASM_SIZE): Suppress .type and .size
13232         on COFF.
13233
13234         * acinclude.m4 (GMP_PROG_HOST_CC): New macro.
13235         * configure.in: Use it for windows DLL cross-compiles.
13236         * aclocal.m4, configure: Regenerate with libtool patch to hold HOST_CC
13237         in the generated libtool script.
13238
13239         * aclocal.m4, configure: Regenerate with libtool patch to suppress
13240         warnings when probing command line limit on FreeBSD.
13241
13242         * demos/qcn.c (M_PI): Define if not already provided, helps mingw32.
13243
13244 2001-10-17  Kevin Ryde  <kevin@swox.se>
13245
13246         * printf/doprnt.c: Use <stdint.h> for intmax_t.
13247
13248         * longlong.h: Recognise __sparcv8 for gcc on Solaris.  Reported by
13249         Mark Mentovai <mark@mentovai.com>.
13250
13251         * gmp-impl.h (gmp_allocated_string): No need for inline on member funs.
13252
13253 2001-10-16  Kevin Ryde  <kevin@swox.se>
13254
13255         * gmp.texi (Debugging): Add mpatrol.
13256         (Integer Comparisons, Comparing Rationals, Float Comparison): Index
13257         entries for sign tests.
13258         (I/O of Floats): Clarify mpf_out_str exponent is in decimal.
13259         (C++ Formatted Output): mpf_t operator<< exponent now in decimal.
13260         (FFT Multiplication): Use an ascii art sigma.
13261         (Contributors): Add Gerardo Ballabio.
13262
13263         * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Always give mpf_t
13264         exponent in decimal, irrespective of ios::hex or ios::oct.
13265         * tests/cxx/t-ostream.cc (check_mpf): Update.
13266
13267         * printf/doprnt.c: Support %lln and %hhn.
13268
13269         * mpn/x86/pentium4/sse2/submul_1.asm: Use a psubq to negate the
13270         initial carry (helps the submul_1c case), and improve the comments.
13271
13272 2001-10-11  Kevin Ryde  <kevin@swox.se>
13273
13274         * acinclude.m4, configure.in (GMP_IMPL_H_IEEE_FLOATS): New macro.
13275
13276         * ltmain.sh: Send some rm errors to /dev/null, helps during compiles
13277         on Solaris 2.7 and HP-UX 10.
13278
13279         * tal-notreent.c: Renamed from stack-alloc.c.
13280         * Makefile.am, acinclude.m4, gmp-impl.h: Update.
13281
13282         * gmp-h.in: Don't give both prototypes and inlines, except on gcc.
13283
13284         * gmp-h.in, gmp-impl.h: Use #includes to get necessary standard
13285         classes, add std:: to prototypes.
13286         * cxx/*.cc, tests/cxx/t-ostream.cc: Add "use namespace std".
13287         * acinclude.m4 (GMP_PROG_CXX_WORKS): Ditto.
13288
13289         * tests/*/Makefile.in, mpfr/tests/Makefile.in: Regenerate with
13290         automake patch to avoid Ultrix problem with empty $(TESTS).
13291
13292         * */Makefile.in: Regenerate with automake patch to only rm *_.c in
13293         "make clean" when ansi2knr actually in use, helps DOS 8.3.
13294
13295         * Makefile.in: Regenerate with automake patch to fix stamp-h
13296         numbering, avoiding an unnecessary config.status run.
13297
13298 2001-10-09  Torbjorn Granlund  <tege@swox.com>
13299
13300         * mpn/hppa/hppa1_1/udiv_qrnnd.asm: Use L macros for labels.
13301         Quote L reloc operator.
13302
13303         * gmp-impl.h: Declare class string.
13304
13305         * mpn/asm-defs.m4 (INT32, INT64): Quote $1 to prevent further
13306         expansion.
13307
13308         * mpn/alpha/ev6/mul_1.asm: New file.
13309
13310 2001-10-09  Kevin Ryde  <kevin@swox.se>
13311
13312         * gmp.texi (Introduction to GMP): Add pentium 4 to optimized CPUs.
13313         (Build Options): Note macos directory.
13314         (Notes for Package Builds): GMP 4 series binary compatible with 3.
13315         (Known Build Problems): Remove $* and ansi2knr note, now fixed, except
13316         possibly under --host=none.
13317         (Formatted Output Strings): Remove -1 prec for all digits.
13318
13319         * mpz/add.c, mpz/sub.c: Don't use mpz path on #include (helps macos).
13320         * mpbsd/Makefile.am (INCLUDES): Add -I$(top_srcdir)/mpz.
13321
13322         * printf/doprnt.c, tests/printf/t-printf.c: Remove support for %.*Fe
13323         prec -1 meaning all digits.
13324
13325         * acinclude.m4 (GMP_PROG_AR): Override libtool, use AR_FLAGS="cq".
13326         (GMP_HPC_HPPA_2_0): Print version string to config.log.
13327
13328         * Makefile.am (AUTOMAKE_OPTIONS): Remove check-news (permission notice
13329         in NEWS file is too big).
13330         (dist-hook): Don't distribute numbered or unnumbered emacs backups.
13331
13332         * Makefile.am, cxx/Makefile.am: Updates for Gerardo's stuff.
13333
13334 2001-10-09  Gerardo Ballabio  <ballabio@sissa.it>
13335
13336         * cxx/isfuns.cc: New file.
13337         * gmp-impl.h: Add prototypes.
13338         * cxx/ismpf.cc, cxx/ismpq.cc, cxx/ismpz.cc: New files.
13339         * gmp-h.in: Add prototypes.
13340         * gmpxx.h, mpfrxx.h: New files.
13341
13342 2001-10-08  Kevin Ryde  <kevin@swox.se>
13343
13344         * configure.in (with_tags): Establish a default based on --enable-cxx.
13345
13346         * aclocal.m4: Regenerate with libtool patches for sed char range to
13347         help Cray, LTCC quotes and +Z warnings grep to help HP-UX.
13348
13349         * gmp-impl.h (doprnt_format_t, doprnt_memory_t, doprnt_reps_t,
13350         doprnt_final_t): Use _PROTO.
13351
13352 2001-10-05  Torbjorn Granlund  <tege@swox.com>
13353
13354         * mpn/asm-defs.m4 (INT32, INT64): Use LABEL_SUFFIX.
13355
13356         * mpn/hppa: Convert files to `.asm'.
13357
13358 2001-10-05  Kevin Ryde  <kevin@swox.se>
13359
13360         * mpn/Makeasm.am (.S files): Revert to separate CPP and CCAS, use
13361         cpp-ccas, and only pass CPPFLAGS to CPP, not whole CFLAGS.
13362         * mpn/cpp-ccas: New file.
13363         * mpn/Makefile.am (EXTRA_DIST): Add it.
13364
13365         * tune/common.c, tune/speed.h: Change SPEED_ROUTINE_MPN_COPY_CALL uses
13366         to SPEED_ROUTINE_MPN_COPY or new SPEED_ROUTINE_MPN_COPY_BYTES.  Avoids
13367         macro expansion problems on Cray.
13368
13369         * configure.in (AC_PROG_CXXCPP): Add this, to make libtool happier.
13370
13371 2001-10-04  Torbjorn Granlund  <tege@swox.com>
13372
13373         * mpz/rrandomb.c (gmp_rrandomb): Change bit_pos to be 0-based (was
13374         1-based); shift 2 (was 1) when making bit mask.  These two changes
13375         avoid undefined shift counts.
13376         (gmp_rrandomb): Avoid most calls to _gmp_rand by caching random values.
13377
13378         * mpn/generic/random2.c: Changes for mirroring mpz/rrandomb.c.
13379
13380 2001-10-04  Kevin Ryde  <kevin@swox.se>
13381
13382         * gmp.texi (Build Options): Add --enable-cxx.
13383         (Notes for Particular Systems): Mention pentium4 performance and SSE2.
13384         (Known Build Problems): Remove vax jsobgtr note, no longer needed.
13385         (Converting Floats): Tweak mpf_get_str description.
13386         (Low-level Functions): Correction to mpn_gcdext destination space
13387         requirements.
13388         (C++ Formatted Output): New section.
13389         (Language Bindings): Add ALP
13390         (Contributors): Add Paul Zimmermann's square root, update my things.
13391
13392         * acinclude.m4 (GMP_PROG_CC_IS_GNU, GMP_PROG_CXX_WORKS): Send compiler
13393         errors to config.log.
13394
13395         * mpq/Makefile.am (INCLUDES): Remove -DOPERATION_$*, not needed.
13396
13397         * mpn/x86/*.asm: Change references to old README.family to just README.
13398
13399         * mpz/README: Remove file, now adequately covered in the manual.
13400
13401 2001-10-03  Torbjorn Granlund  <tege@swox.com>
13402
13403         * mpn/x86/pentium4/copyi.asm: New file.
13404         * mpn/x86/pentium4/copyd.asm: New file.
13405
13406         * gmp-impl.h: Implement separate MPN_COPY_INCR and MPN_COPY_DECR
13407         macros for CRAY systems.
13408         (CRAY _MPN_COPY): Delete.
13409
13410 2001-10-02  Kevin Ryde  <kevin@swox.se>
13411
13412         * tests/mpz/t-popcount.c (check_data): Use "~ (unsigned long) 0" to
13413         avoid compiler warnings on sco.
13414
13415         * mpbsd/Makefile.am: Compile mpz files directly, no copying.
13416         Use mpz/add.c and mpz/sub.c rather than mpz/aors.c.
13417         (INCLUDES): Remove -DOPERATION_$*, no longer needed (by mpz).
13418
13419         * mpz/aors.h: Renamed from mpz/aors.c.
13420         * mpz/add.c, mpz/sub.c: New files, using mpz/aors.h.
13421         * mpz/aors_ui.h: Renamed from mpz/aors_ui.c.
13422         * mpz/add_ui.c, mpz/sub_ui.c: New files, using mpz/aors_ui.h.
13423         * mpz/fits_s.h: Renamed and adapted from mpz/fits_s.c.
13424         * mpz/fits_sshort.c, mpz/fits_sint.c, mpz/fits_slong.c: New files.
13425         * mpz/mul_i.h: Renamed from mpz/mul_siui.c.
13426         * mpz/mul_ui.c, mpz/mul_ui.c: New files, using mpz/mul_i.h.
13427         * mpz/Makefile.am: Consequent updates.
13428         (INCLUDES): Remove -DOPERATION_$*.
13429
13430         * mpf/fits_s.h: Renamed and adapted from mpf/fits_s.c.
13431         * mpf/fits_sshort.c, mpf/fits_sint.c, mpf/fits_slong.c: New files.
13432         * mpf/fits_u.h: Renamed and adapted from mpf/fits_u.c.
13433         * mpf/fits_ushort.c, mpf/fits_uint.c, mpf/fits_ulong.c: New files.
13434         * mpf/Makefile.am: Consequent updates.
13435         (INCLUDES): Remove -DOPERATION_$*.
13436
13437         * cxx/osfuns.cc (__gmp_doprnt_params_from_ios): Don't use ios::hex etc
13438         as cases in a switch, they're not constant in g++ 3.0.
13439
13440         * mpn/Makeasm.am (.s.o, .s.obj, .S.o, .S.obj, .asm.o, .asm.obj):
13441         Locate source file with test -f the same as automake.
13442         (.S): Let CCAS do the preprocessing, and run libtool for .S.lo.
13443         (.asm.lo): Run libtool via m4-ccas to get new style foo.lo right.
13444         (COMPILE_FLAGS): Add $(DEFAULT_INCLUDES), per new automake.
13445         * mpn/m4-ccas: New file.
13446         * mpn/Makefile.am (EXTRA_DIST): Add it.
13447         * mpn/asm-defs.m4: Add m4_not_for_expansion(`DLL_EXPORT').
13448         * mpn/x86/x86-defs.m4: Undefine PIC if DLL_EXPORT is set.
13449         * configure.in (CFLAGS_PIC, ASMFLAGS_PIC): Remove, no longer needed.
13450
13451         * acinclude.m4 (GMP_FUNC_VSNPRINTF): Warn what's omitted when
13452         vsnprintf not available.
13453
13454         * mpn/underscore.h: Remove file, not used since m68k converted to asm.
13455         * mpn/Makefile.am (EXTRA_DIST): Remove it.
13456
13457         * tests/refmpz.c: Add <stdlib.h>, for free().
13458
13459 2001-10-01  Torbjorn Granlund  <tege@swox.com>
13460
13461         * mpn/x86/pentium4/sse2/submul_1.asm: Apply some algebraic
13462         simplifications.
13463         * mpn/x86/pentium4/sse2/addmul_1.asm: Comment.
13464
13465 2001-10-01  Kevin Ryde  <kevin@swox.se>
13466
13467         * configure.in (--enable-cxx): New option for C++ support.
13468         Add cxx and tests/cxx subdirectories.
13469         * ltmain.sh, aclocal.m4: Update to libtool 2001-09-30.
13470
13471         * cxx/Makefile.am, cxx/Makefile.in, cxx/osdoprnti.cc, cxx/osfuns.cc,
13472         cxx/osmpf.cc, cxx/osmpq.cc, cxx/osmpz.cc: New files.
13473         * Makefile.am: Add them, in new libgmpxx.
13474         * gmp-h.in, gmp-impl.h: Prototypes and support.
13475         * tests/cxx/Makefile.am, tests/cxx/Makefile.in,
13476         tests/cxx/t-ostream.cc: New files.
13477
13478         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL,
13479         SPEED_ROUTINE_MPN_GCDEXT_ONE): mpn_gcdext needs size+1 for
13480         destinations.  Found by Torbjorn.
13481
13482         * gmp-h.in (__GNU_MP__, __GNU_MP_VERSION): Bump to 4.0.
13483         * mp-h.in (__GNU_MP__): Ditto.
13484         * gmp.texi, Makefile.am, compat.c: Amend version 3.2 to 4.0.
13485
13486         * acinclude.m4 (GMP_PROG_CXX_WORKS): New macro.
13487         (GMP_PROG_CC_WORKS): Write "conftest" test program, not a.out.
13488
13489         * gmp-impl.h (struct gmp_asprintf_t): Moved from printf/vasprintf.c.
13490         (GMP_ASPRINTF_T_INIT): New macro.
13491         (GMP_ASPRINTF_T_NEED): New macro, adapted from vasprintf.c NEED().
13492         * printf/vasprintf.c: Use these.
13493
13494         * printf/asprntffuns.c: New file.
13495         * printf/Makefile.am, Makefile.am: Add it.
13496         * printf/asprntffuns.c, printf/vasprintf.c, gmp-impl.h
13497         (__gmp_asprintf_memory, __gmp_asprintf_reps, __gmp_asprintf_final):
13498         Move to asprntffuns.c, rename to __gmp and make global, remove
13499         spurious formal parameters from __gmp_asprintf_final.
13500
13501         * configure.in (j90-*-*, sv1-*-*): Don't duplicate $path in $add_path.
13502         (*-*-mingw*): Don't assemble with -DPIC (as per cygwin).
13503
13504         * printf/snprntffuns.c (gmp_snprintf_final): Remove spurious formal
13505         parameters.
13506
13507         * tune/tuneup.c (POWM_THRESHOLD): Reduce stop_factor to 1.1 to help
13508         Cray vector systems.
13509
13510         * tests/misc.c (tests_rand_start): Print GMP_CHECK_RANDOMIZE=NN to
13511         facilitate cut and paste when re-running.
13512         * tests/mpz/t-inp_str.c (check_data): Add more diagnostic prints.
13513
13514 2001-09-30  Kent Boortz  <kent@swox.com>
13515
13516         * macos/configure, macos/Makefile.in, macos/README: Updates for gmp 4.
13517         * gmp-h.in (_GMP_H_HAVE_FILE): Recognise Apple MPW.
13518
13519 2001-09-30  Torbjorn Granlund  <tege@swox.com>
13520
13521         * mpn/cray/ieee/submul_1.c: Rewrite.  Streamline multiplications;
13522         use `majority' logic.
13523
13524 2001-09-27  Torbjorn Granlund  <tege@swox.com>
13525
13526         * gmp-h.in (__GMPN_AORS_1): Rewrite to work around Cray compiler bug.
13527
13528 2001-09-26  Torbjorn Granlund  <tege@swox.com>
13529
13530         * mpn/x86/pentium4/sse2/gmp-mparam.h: New file.
13531
13532 2001-09-26  Kevin Ryde  <kevin@swox.se>
13533
13534         * mpn/x86/pentium4/sse2/dive_1.asm: New file.
13535         * mpn/x86/pentium4/sse2/submul_1.asm: New file.
13536         * mpn/x86/pentium4/sse2/sqr_basecase.asm: New file.
13537
13538         * mpn/x86/pentium/copyi.asm: New file, based on past work by Torbjorn.
13539         * mpn/x86/pentium/copyi.asm: New file, ditto.
13540         * mpn/x86/pentium/com_n.asm: Rewrite, ditto.
13541
13542         * printf/snprntffuns.c (gmp_snprintf_format): Copy va_list in case
13543         vsnprintf trashes it.
13544         * printf/vasprintf.c (gmp_asprintf_format): Ditto.
13545         * gmp-impl.h, doprnt.c (va_copy): Move to gmp-impl.h.
13546
13547         * tests/mpz/t-cmp_d.c (check_low_z_one): Patch by Torbjorn for vax
13548         limited float range.
13549
13550 2001-09-23  Torbjorn Granlund  <tege@swox.com>
13551
13552         * mpn/vax/lshift.s: Change `jsob*' to `sob*'.
13553         * mpn/vax/rshift.s: Likewise.
13554
13555 2001-09-23  Kevin Ryde  <kevin@swox.se>
13556
13557         * mpn/x86/pentium4/sse2/mul_basecase.asm: Some simple but real code.
13558
13559         * printf/doprnt.c: Use va_copy for va_list variables, copy function
13560         parameter in case it's call-by-reference.
13561
13562         * tune/freq.c (speed_cpu_frequency_bsd_dmesg): New function.
13563         (speed_cpu_frequency_table): Use it.
13564
13565         * tune/many.pl (popcount, hamdist): Fix declared return value.
13566         (sb_divrem_mn): Remove a spurious duplicate entry.
13567         (CLEAN): Add tmp-$objbase.c when using that for .h files.
13568         (macro_speed): Give a default for .h files.
13569         Add ATTRIBUTE_CONST or __GMP_ATTRIBUTE_PURE as appropriate.
13570
13571         * tune/speed.h (SPEED_ROUTINE_MPN_MOD_CALL,
13572         SPEED_ROUTINE_MPN_PREINV_MOD_1, SPEED_ROUTINE_MPN_POPCOUNT,
13573         SPEED_ROUTINE_MPN_HAMDIST, SPEED_ROUTINE_MPN_GCD_1N,
13574         SPEED_ROUTINE_MPN_GCD_1_CALL, SPEED_ROUTINE_MPZ_JACOBI): Use return
13575         values so gcc 3 won't discard calls to pure or const functions.
13576         (mpn_mod_1_div, mpn_mod_1_inv): Add __GMP_ATTRIBUTE_PURE.
13577
13578 2001-09-22  Torbjorn Granlund  <tege@swox.com>
13579
13580         * mpn/x86/pentium4/sse2/mul_basecase.asm: New file, placeholder
13581         for real code, hiding the default x86 mul_basecase.asm.
13582
13583 2001-09-22  Kevin Ryde  <kevin@swox.se>
13584
13585         * configure.in (AC_PREREQ): Bump to 2.52.
13586         (m4_pattern_forbid, m4_pattern_allow): New calls, forbid GMP_.
13587         (AC_CHECK_HEADERS): Remove sys/types.h, already done by autoconf.
13588         * acinclude.m4, configure.in (GMP_GCC_NO_CPP_PRECOMP): New macro.
13589
13590         * tests/devel/try.c (TYPE_PREINV_MOD_1): Don't run size==0.
13591         (malloc_region): Need fd=-1 for mmap MAP_ANON on BSD.
13592
13593 2001-09-20  Torbjorn Granlund  <tege@swox.com>
13594
13595         * mpz/cong.c (mpz_congruent_p): Fix one-limb c<d test.
13596
13597         * longlong.h: Rewrite __i370__ smul_ppmm; enable also for __s390__.
13598
13599         * configure.in: Add support for IBM 360, 370, 390 families.
13600
13601 2001-09-20  Kevin Ryde  <kevin@swox.se>
13602
13603         * mpn/x86/pentium4/sse2/diveby3.asm: New file.
13604         * mpn/x86/pentium4/sse2/mode1o.asm: New file.
13605
13606 2001-09-16  Kevin Ryde  <kevin@swox.se>
13607
13608         * printf/doprnt.c: '#' means showpoint and showtrailing for %e, %f, %g.
13609         * tests/printf/t-printf.c (check_f): More test cases.
13610
13611 2001-09-15  Torbjorn Granlund  <tege@swox.com>
13612
13613         * gmp-h.in (__GMPN_AORS_1): Remove param TEST, add OP and CB.
13614         Postpone zeroing of (cout).
13615         (__GMPN_ADD_1, __GMPN_SUB_1): Corresponding changes.
13616
13617 2001-09-14  Kevin Ryde  <kevin@swox.se>
13618
13619         * ChangeLog: Merge in tests/rand/ChangeLog.
13620         * tests/rand/ChangeLog: Remove file.
13621
13622         * printf/doprnt.c: Fix handling of a plain format after a GMP one; no
13623         need to protect against negative precision internally.
13624         * tests/printf/t-printf.c (check_misc): More checks.
13625
13626 2001-09-12  Torbjorn Granlund  <tege@swox.com>
13627
13628         * mpn/cray/ieee/invert_limb.c: Add a PROLOGUE in a comment to have
13629         HAVE_NATIVE_... defined.
13630
13631 2001-09-11  Kevin Ryde  <kevin@swox.se>
13632
13633         * configure.in, gmp-h.in (__GMP_HAVE_HOST_CPU_FAMILY_power,
13634         __GMP_HAVE_HOST_CPU_FAMILY_powerpc): New AC_SUBSTs.
13635         * gmp-h.in (__GMPN_COPY_INCR): Use them to select the power/powerpc
13636         code, rather than preprocessor defines.
13637
13638         * acinclude.m4, configure.in (GMP_H_ANSI): New macro.
13639
13640         * gmp-h.in (__GMP_EXTERN_INLINE): Add a definition for SCO 8 cc.
13641
13642         * gmp-h.in, version.c (gmp_version): Make the pointer "const" as well
13643         as the string.
13644
13645         * acinclude.m4, configure.in (GMP_PROG_CC_IS_XLC): Recognise xlc when
13646         invoked under another name (cc, xlc128, etc).
13647         * acinclude.m4 (GMP_PROG_CC_IS_GCC): Print a message when recognised.
13648
13649 2001-09-11  Torbjorn Granlund  <tege@swox.com>
13650
13651         * gmp-h.in: Let __DECC mean __GMP_HAVE_CONST, etc.
13652         * mp-h.in: Likewise.
13653
13654 2001-09-10  Torbjorn Granlund  <tege@swox.com>
13655
13656         * mpn/x86/pentium4/mmx/lshift.asm: New file.
13657         * mpn/x86/pentium4/mmx/rshift.asm: New file.
13658
13659         * tests/mpn/t-iord_u.c (check_incr_data): Work around HP compiler bug.
13660         (check_decr_data): Likewise.
13661
13662 2001-09-08  Kevin Ryde  <kevin@swox.se>
13663
13664         * gmp.texi (Integer Logic and Bit Fiddling): Update mpz_hamdist
13665         behaviour, clarify mpz_popcount a touch.
13666         (Language Bindings): Add mlton, fix alphabetical order.
13667         (Single Limb Division): Describe 2 or 1/2 limbs at a time style.
13668
13669         * configure.in (AC_CHECK_FUNCS): Add mmap.
13670         * tests/devel/try.c (malloc_region): Use mmap if available.
13671
13672         * tests/refmpz.c, tests/tests.h (refmpz_hamdist): New function.
13673         * tests/mpz/t-hamdist.c: New file.
13674         * tests/mpz/Makefile.am: Add it.
13675
13676         * mpz/hamdist.c: Support neg/neg operands.
13677
13678         * macos/Makefile.in: Remove dual compile of mpq/aors.c and
13679         mpn/generic/popham.c.
13680
13681         * gmp-impl.h (popc_limb): New macro, adapted from mpn/generic/popham.c.
13682         For 64-bits reuse 0x33...33 constant.
13683         * mpn/generic/popcount.c, mpn/generic/hamdist.c: Split from popham.c,
13684         use popc_limb macro, remove unused "i", don't bother with "register"
13685         qualifiers.
13686         * mpn/generic/popham.c: Remove file.
13687
13688         * ltmain.sh, configure, aclocal.m4: Update to libtool 1.4.1, with one
13689         ltdll.c generation patch.
13690         * doc/configuration: Misc updates, note libtool patch used.
13691
13692         * mpn/x86/pentium4/sse2/mul_1.asm: Use pointer increments not indexed
13693         addressing, to get 4.0 c/l flat.
13694
13695         * tests/mpq/t-cmp_si.c (check_data): Use ULONG_MAX for denominators.
13696
13697         * tests/misc.c (mpz_negrandom): Use given rstate, not RANDS.
13698
13699 2001-09-07  Torbjorn Granlund  <tege@swox.com>
13700
13701         * mpn/x86/pentium4/sse2/addmul_1.asm: New file.
13702
13703 2001-09-04  Kevin Ryde  <kevin@swox.se>
13704
13705         * tune/freq.c: Define a HAVE for each speed_cpu_frequency routine to
13706         avoid duplicating conditionals.
13707         (speed_cpu_frequency_sco_etchw): New function.
13708         (speed_cpu_frequency_table): Use it.
13709         * tune/README: Mention SCO openunix 8 /etc/hw.
13710
13711         * mpz/fib_ui.c: Use ?: to avoid a gcc 3 bug on powerpc64.
13712         Store back a carry for limb<long.
13713
13714         * mpn/x86/k7/mmx/divrem_1.asm, mpn/x86/k7/mmx/mod_1.asm,
13715         mpn/x86/p6/mmx/divrem_1.asm: Fix a couple of comments.
13716
13717         * config.guess: Give m68020 for 68020 or better, not m68k.
13718         * configfsf.guess: Update to 2001-09-04.
13719
13720 2001-09-02  Kevin Ryde  <kevin@swox.se>
13721
13722         * configure.in (m68k-*-*): Let m68k mean 68000, not 68020.
13723         * gmp.texi (Notes for Particular Systems): Update.
13724
13725         * gmp-impl.h (union ieee_double_extract) [m68k]: Use longs, since int
13726         might be only 16 bits.
13727
13728         * tests/mpq/t-aors.c: New file.
13729         * tests/mpq/Makefile.am: Add it.
13730
13731         * tests/refmpq.c: New file.
13732         * tests/Makefile.am: Add it.
13733         * tests/tests.h: Add prototypes.
13734
13735         * mpq/aors.c: Share object code for mpq_add and mpq_sub.
13736         * Makefile.am, mpq/Makefile.am: Single mpq/aors.lo now.
13737
13738         * tests/devel/try.c (TYPE_SUBMUL_1): Use correct reference routine.
13739
13740 2001-08-30  Kevin Ryde  <kevin@swox.se>
13741
13742         * mpn/x86/x86-defs.m4 (cmov_available_p): Add pentium4.
13743
13744         * gmp-h.in: Put #define renamings with prototypes.
13745         Remove commented out #defines of gmp-impl.h things.
13746         (mpn_invert_limb): Remove #define, already in gmp-impl.h.
13747         (mpn_lshiftc, mpn_rshiftc): Remove #defines, unused.
13748         (mpn_addsub_nc): Add prototype to #define.
13749
13750 2001-08-28  Kevin Ryde  <kevin@swox.se>
13751
13752         * gmp.texi: Switch to GFDL.
13753         (Top): Arrange copyright and conditions to appear here too.  For
13754         clarity have all this before the miscellaneous macro definitions.
13755         (Copying): Refer to COPYING.LIB file, mention plain GPL2 in demo
13756         programs.
13757         (Contributors, References): Use @appendix rather than @unnumbered.
13758         (GNU Free Documentation License): New appendix.
13759         (@contents): Move to start of document, use only for tex (not html).
13760         (Debugging): Add leakbug.
13761         (Build Options): Add pentium4.
13762         (I/O of Rationals): Add mpq_inp_str.
13763
13764         * fdl.texi: New file, with two @appendix directive tweaks.
13765         * Makefile.am (gmp_TEXINFOS): Add it.
13766
13767         * tests/mpz/io.c: Check mpz_inp_str return against ftell, send error
13768         messages just to stdout.
13769
13770         * mpz/inp_str.c, gmp-impl.h (__gmpz_inp_str_nowhite): New function,
13771         and share a __gmp_free_func call.
13772         * mpq/inp_str.c: New file.
13773         * Makefile.am, mpq/Makefile.am: Add it.
13774         * tests/mpq/t-inp_str.c: New file.
13775         * tests/mpq/Makefile.am (check_PROGRAMS): Add it.
13776
13777         * configure.in, acconfig.h (HAVE_HOST_CPU_FAMILY_power,
13778         HAVE_HOST_CPU_FAMILY_powerpc, HAVE_HOST_CPU_FAMILY_x86): AC_DEFINEs
13779         for processor families.
13780         * gmp-impl.h: Use them, rather than cpp defines.
13781
13782         * demos/Makefile.am (primes_LDADD): Use $(LIBM), for log().
13783
13784         * tune/many.pl, tune/Makefile.am: Fix some from clean and distclean.
13785
13786 2001-08-26  Kevin Ryde  <kevin@swox.se>
13787
13788         * tests/devel/try.c (ARRAY_ITERATION): Make types match on "?:" legs.
13789         (TYPE_MPZ_JACOBI, TYPE_MPZ_KRONECKER): Remove some superseded code.
13790
13791         * tests/printf/t-printf.c (check_plain): Don't compare "all digits"
13792         precision against plain printf.
13793
13794         * tune/Makefile.am: Eliminate empty TUNE_MPZ_SRCS.
13795
13796         * configure, config.in, INSTALL.autoconf: Update to autoconf 2.52.
13797         * */Makefile.in, mdate-sh, missing, aclocal.m4, configure: Update to
13798         automake 1.5.
13799         * configfsf.guess, configfsf.sub: Update to 2001-08-23.
13800
13801 2001-08-24  Torbjorn Granlund  <tege@swox.com>
13802
13803         * demos/primes.c: Complete rewrite.
13804
13805 2001-08-24  Kevin Ryde  <kevin@swox.se>
13806
13807         * longlong.h: Test __ppc__ for apple darwin cc, reported by Jon
13808         Becker.  Also test __POWERPC__, PPC and __vxworks__.
13809
13810         * tune/speed.h (speed_cyclecounter) [x86]: Don't clobber ebx in PIC.
13811
13812 2001-08-22  Kevin Ryde  <kevin@swox.se>
13813
13814         * configure.in (x86 mmx): Correction to mmx path stripping.
13815
13816 2001-08-17  Kevin Ryde  <kevin@swox.se>
13817
13818         * configure.in, acinclude.m4, Makefile.am, printf/Makefile.am,
13819         tests/printf/Makefile.am, gmp-h.in, gmp-impl.h, gmp.texi: Remove C++
13820         support, for the time being.
13821         * printf/doprntfx.cc, doprntix.cc, osfuns.cc, osmpf.cc, osmpq.cc,
13822         osmpz.cc, tests/printf/t-ostream.cc: Remove files.
13823
13824         * printf/doprnt.c, printf/doprntf.c, gmp-impl.h: Use a single
13825         __gmp_doprnt_mpf, rather than a separate ndigits calculation.
13826         * printf/doprnt.c, printf/doprntf.c, gmp-impl.h, gmp.texi,
13827         tests/printf/t-printf.c: Let empty or -1 prec mean all digits for mpf.
13828         * printf/doprnt.c, tests/printf/t-printf.c: Accept h or l in %n; let
13829         negative "*" style width mean left justify.
13830
13831         * gmp-impl.h, mpf/get_str.c (MPF_SIGNIFICANT_DIGITS): New macro,
13832         extracted from mpf/get_str.c.
13833
13834         * libmp.sym: New file.
13835         * Makefile.am (libmp_la_LDFLAGS): Use it.
13836         (DISTCLEANFILES): Remove asm-syntax.h, no longer generated.
13837         Remove some comments about "make check".
13838
13839         * demos/perl/GMP.pm, GMP.xs, GMP/Mpf.pm: Add printf and sprintf,
13840         change get_str to string/exponent for floats, remove separate
13841         mpf_get_str.
13842         * demos/perl/GMP/Mpf.pm (overload_string): Use $# (default "%.g").
13843         * demos/perl/typemap: Fix some duplicate string entries.
13844         * demos/perl/test.pl: Update tests, split overloaded constants into ...
13845         * demos/perl/test2.pl: ... this new file.
13846         * demos/perl/Makefile.PL (clean): Add test.tmp.
13847
13848 2001-08-16  Kevin Ryde  <kevin@swox.se>
13849
13850         * printf/snprntffuns.c (gmp_snprintf_format): Correction to bufsize-1
13851         return value handling.
13852
13853         * demos/calc/calc.y: Reposition "%{" so copyright notice gets into
13854         generated files.
13855
13856         * INSTALL: Use gmp_printf.
13857
13858 2001-08-14  Kevin Ryde  <kevin@swox.se>
13859
13860         * mpz/inp_str.c: Fix return value (was 1 too big).
13861         * tests/mpz/t-inp_str.c: New file.
13862         * tests/mpz/Makefile.am: Add it.
13863
13864         * mpn/x86/pentium4/sse2/add_n.asm: New file.
13865         * mpn/x86/pentium4/sse2/sub_n.asm: New file.
13866         * mpn/x86/pentium4/sse2/mul_1.asm: New file.
13867
13868 2001-08-12  Kevin Ryde  <kevin@swox.se>
13869
13870         * printf/sprintffuns.c, printf/doprntf.c: Don't use sprintf return
13871         value (it's a pointer on SunOS 4).
13872
13873         * acinclude.m4 (GMP_ASM_X86_SSE2, GMP_STRIP_PATH): New macros.
13874         * configure.in: Add pentium4 support.
13875         * mpn/x86/pentium4, mpn/x86/pentium4/mmx, mpn/x86/pentium4/sse2: New
13876         directories.
13877         * mpn/x86/README: Update.
13878
13879 2001-08-10  Torbjorn Granlund  <tege@swox.com>
13880
13881         * demos/pexpr.c (setup_error_handler): Catch also SIGABRT.
13882
13883 2001-07-31  Kevin Ryde  <kevin@swox.se>
13884
13885         * tests/refmpn.c (refmpn_mul_1c): Allow low to high overlaps.
13886
13887         * gmp-h.in, gmp-impl.h (_gmp_rand): Move prototype to gmp-impl.h.
13888
13889         * tune/Makefile.am (EXTRA_DIST): Add many.pl.
13890
13891 2001-07-28  Kevin Ryde  <kevin@swox.se>
13892
13893         * gmp.texi (Random Number Functions): Old rand functions no longer use
13894         the C library.
13895
13896         * configure.in, acinclude.m4 (GMP_FUNC_VSNPRINTF): New macro.
13897
13898         * mpn/generic/get_str.c: Add an ASSERT for high limb non-zero.
13899
13900 2001-07-24  Kevin Ryde  <kevin@swox.se>
13901
13902         * gmp.texi (Build Options): Add --enable-cxx.
13903         (Converting Floats): Note mpf_get_str only generates accurately
13904         representable digits.
13905         (Low-level Functions): Note mpn_get_str requires non-zero high limb.
13906         (Formatted Output): New chapter.
13907         (Multiplication Algorithms): Use @quotation with @multitable.
13908         (Toom-Cook 3-Way Multiplication): Ditto.
13909
13910         * tests/memory.c (tests_free_nosize): New function.
13911         * tests/tests.h (tests_allocate etc): Add prototypes.
13912
13913         * tests/printf: New directory.
13914         * tests/printf/Makefile.am, t-printf.c, t-ostream.cc: New files.
13915         * configure.in, tests/Makefile.am: Add them.
13916
13917         * configure.in, acinclude.m4 (GMP_PROG_CXX): New macro.
13918         * configure.in (--enable-cxx): New option.
13919         (AC_CHECK_HEADERS): Add locale.h and sys/types.h, remove unistd.h.
13920         (AC_CHECK_TYPES): Add intmax_t, long double, long long, ptrdiff_t,
13921         quad_t.
13922         (AC_CHECK_FUNCS): Add localeconv, memset, obstack_vprintf, snprintf,
13923         strchr, vsnprintf.
13924         (AC_CHECK_DECLS): Add vfprintf.
13925
13926         * gmp-h.in, gmp-impl.h: Additions for gmp_printf etc.
13927
13928         * printf: New directory.
13929         * printf/Makefile.am, asprintf.c, doprnt.c, doprntf.c, doprntfx.cc,
13930         doprnti.c, doprntix.cc, fprintf.c, obprintf.c, obprntffuns.c,
13931         obvprintf.c, osfuns.cc, osmpf.cc, osmpq.cc, osmpz.cc, printf.c,
13932         printffuns.c, snprintf.c, snprntffuns.c, sprintf.c, sprintffuns.c,
13933         vasprintf.c, vfprintf.c, vprintf.c, vsnprintf.c, vsprintf.c: New
13934         files.
13935         * configure.in, Makefile.am: Add them.
13936
13937         * configure.in (HAVE_INLINE): Remove AC_DEFINE, unused.
13938         (AC_CHECK_TYPES): Don't test for void, assume it always exists.
13939
13940         * gmp-impl.h (__GMP_REALLOCATE_FUNC_MAYBE): New macro.
13941         * mpz/get_str.c, mpq/get_str.c, mpf/get_str.c: Use it.
13942
13943         * gmp-impl.h (mpn_fib2_ui): Use __MPN.
13944         (MPN_COPY_DECR): Fix an ASSERT.
13945         (CAST_TO_VOID): Remove macro.
13946
13947         * gmp-h.in (mpq_out_str): Give #define even without prototype.
13948         (mpz_cmp_d, mpz_cmpabs_d): Corrections to #defines.
13949
13950         * tests/devel/try.c: Add mpn_add and mpn_sub, don't use CAST_TO_VOID.
13951
13952 2001-07-23  Torbjorn Granlund  <tege@swox.com>
13953
13954         * config.guess: Recognize pentium4.
13955         * config.sub: Recognize pentium4.
13956
13957 2001-07-17  Kevin Ryde  <kevin@swox.se>
13958
13959         * gmp-h.in (__GMPN_AORS_1): Remove x86 and gcc versions, leave just
13960         one version.
13961         (__GMPN_ADD, __GMPN_SUB): New macros, rewrite of mpn_add and mpn_sub.
13962         (mpn_add, mpn_sub): Use them.
13963         (__GMPN_COPY_REST): New macro.
13964
13965         * gmp-h.in, gmp-impl.h, acinclude.m4: Remove __GMP_ASM_L and
13966         __GMP_LSYM_PREFIX, revert to ASM_L in gmp-impl.h and AC_DEFINE of
13967         LSYM_PREFIX.
13968
13969 2001-07-11  Kevin Ryde  <kevin@swox.se>
13970
13971         * gmp-h.in (__GMPN_ADD_1 etc) [x86]: Don't use this on egcs 2.91.
13972
13973         * mpz/fits_uint.c, fits_ulong.c, mpz/fits_ushort.c: Split up fits_u.c.
13974         * mpz/fits_u.c: Remove file.
13975         * mpz/Makefile.am, macos/Makefile.in: Update.
13976
13977         * tests/refmpn.c,tests.h (refmpn_copy): New function.
13978         * tests/devel/try.c (TYPE_ZERO): No return value from call.
13979         (TYPE_MODEXACT_1_ODD, TYPE_MODEXACT_1C_ODD): Share call with
13980         TYPE_MOD_1 and TYPE_MOD_1C.
13981         (MPN_COPY, __GMPN_COPY, __GMPN_COPY_INCR): Add testing.
13982
13983 2001-07-10  Kevin Ryde  <kevin@swox.se>
13984
13985         * gmp-h.in (__GMPN_COPY): Add form to help gcc on power and powerpc.
13986         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR, MPN_ZERO): Ditto.
13987         * mpn/powerpc64/copyi.asm, mpn/powerpc64/copyd.asm: Remove files.
13988
13989         * mpz/tdiv_ui.c: Eliminate some local variables (seems to save code on
13990         i386 gcc 2.95.x), remove a bogus comment about quotient.
13991
13992         * errno.c, gmp-impl.h (__gmp_exception, __gmp_divide_by_zero,
13993         __gmp_sqrt_of_negative): New functions.
13994         * gmp-impl.h (GMP_ERROR, DIVIDE_BY_ZERO, SQRT_OF_NEGATIVE): Use them.
13995
13996         * randclr.c, randraw.c: Use ASSERT(0) for unrecognised algorithms.
13997
13998 2001-07-07  Kevin Ryde  <kevin@swox.se>
13999
14000         * configure.in (powerpc*-*-*): Use -no-cpp-precomp for Darwin.
14001
14002         * tests/mpbsd/t-itom.c: Renamed from t-misc.c.
14003         * tests/mpbsd/t-misc.c: Remove file.
14004         * tests/mpbsd/Makefile.am: Update.
14005
14006         * tests/mpf/t-set_si.c,t-cmp_si.c,t-gsprec.c: Split from t-misc.c.
14007         * tests/mpf/t-misc.c: Remove file.
14008         * tests/mpf/Makefile.am: Update.
14009
14010         * tests/mpz/t-oddeven.c,t-set_si.c,t-cmp_si.c: Split from t-misc.c.
14011         * tests/mpz/t-misc.c: Remove file.
14012         * tests/mpz/Makefile.am: Update.
14013
14014         * stack-alloc.c: Add some alignment ASSERTs.
14015
14016         * gmp-impl.h (MPN_NORMALIZE): Add notes on x86 repe/scasl slow.
14017
14018         * tests/devel/try.c (MPN_ZERO): Add testing.
14019         * tune/speed.c,speed.h,common.c,many.pl (MPN_ZERO): Add measuring.
14020
14021         * mpn/x86/divrem_1.asm: Update a remark about gcc and "loop".
14022
14023         * tests/mpq/t-cmp_si.c: New file.
14024         * tests/mpq/Makefile.am: Add it.
14025
14026         * tests/misc.c,tests.h (mpq_set_str_or_abort): New function.
14027
14028         * mpq/cmp_si.c: New file.
14029         * Makefile.am, mpq/Makefile.am: Add it.
14030         * gmp-h.in (mpq_cmp_si): Add prototype.
14031         * gmp.texi (Comparing Rationals): Add doco.
14032
14033         * gmp-h.in (_GMP_H_HAVE_FILE): Add _FILE_DEFINED for microsoft, add
14034         notes on what symbols are for what systems.
14035
14036 2001-07-06  Torbjorn Granlund  <tege@swox.com>
14037
14038         * longlong.h (ibm032 umul_ppmm): Fix typo.
14039         * longlong.h (sparclite sdiv_qrnnd): Fix typo.
14040
14041 2001-07-03  Kevin Ryde  <kevin@swox.se>
14042
14043         * mpz/bin_ui.c (DIVIDE): Use MPN_DIVREM_OR_DIVEXACT_1.
14044         * mpz/bin_uiui.c (MULDIV): Ditto, and use local variables for size and
14045         pointer.
14046
14047         * acinclude.m4 (GMP_INCLUDE_GMP_H): New macro, use it everywhere gmp.h
14048         is wanted at configure time.
14049         * acinclude.m4, configure.in (GMP_H_EXTERN_INLINE, GMP_H_HAVE_FILE):
14050         New macros.
14051
14052         * gmp-h.in (__GMP_EXTERN_INLINE): Set to "inline" for C++.
14053         (mpn_add, mpn_sub): Use new style __GMP_EXTERN_INLINE.
14054         * gmp-h.in, mp-h.in, gmp-impl.h (_EXTERN_INLINE): Remove, unused.
14055         * mpn/generic/add.c, mpn/generic/sub.c: New files.
14056         * mpn/generic/inlines.c: Remove file.
14057         * configure.in, mpn/Makefile.am: Update.
14058
14059         * gmp.texi (GMP Basics): Note the need for stdio.h to get FILE
14060         prototypes.
14061
14062 2001-07-01  Kevin Ryde  <kevin@swox.se>
14063
14064         * gmp.texi (Build Options, Reentrancy): Updates for new
14065         --enable-alloca behaviour.
14066         (Debugging): Describe --enable-alloca=debug.
14067         (Miscellaneous Integer Functions): Note mpz_sizeinbase ignores signs.
14068         (Low-level Functions): Give a formula for mpn_gcdext cofactor.
14069         (Factorial Algorithm): New section.
14070         (Binomial Coefficients Algorithm): New section.
14071         Misc tweaks elsewhere.
14072
14073         * mpf/set_prc.c: Merge the two truncation conditionals, misc cleanups,
14074         no functional changes.
14075
14076         * mpn/*/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Add tuned values.
14077         * gmp-impl.h (DIVEXACT_1_THRESHOLD): Make the default 0 when
14078         2*UMUL_TIME < UDIV_TIME.
14079
14080         * mpn/x86/p6/dive_1.asm: New file.
14081
14082         * mpn/x86/dive_1.asm: New file.
14083         * mpn/x86/gmp-mparam.h (DIVEXACT_1_THRESHOLD): Use it always.
14084
14085         * tests/refmpn.c, tests.h (refmpn_zero): New function.
14086         * tests/devel/try.c: Use it.
14087
14088         * tests/refmpn.c (refmpn_sb_divrem_mn): Use refmpn_cmp, not mpn_cmp.
14089
14090         * tests/mpf/t-get_d.c (main): Use || not |.
14091
14092         * tests/misc.c, tests/t-modlinv.c, tests/mpq/t-get_str.c,
14093         tests/mpf/reuse.c: Add string.h.
14094
14095 2001-06-29  Kevin Ryde  <kevin@swox.se>
14096
14097         * tune/speed.h (SPEED_ROUTINE_MPN_FIB2_UI,
14098         SPEED_ROUTINE_COUNT_ZEROS_C): Corrections to TMP block handling.
14099
14100         * gmp-impl.h (MPN_TOOM3_MUL_N_MINSIZE, MPN_TOOM3_SQR_N_MINSIZE):
14101         Corrections to these to account for adding tD into E.
14102         (MPN_INCR_U, MPN_DECR_U) [WANT_ASSERT]: Add size
14103         assertions, since mpn_add_1 and mpn_sub_1 from gmp.h don't get them.
14104         (MPN_DIVREM_OR_DIVEXACT_1): Add an assert of no remainder.
14105
14106         * assert.c: Add stdlib.h for abort prototype.
14107         * tests/spinner.c, trace.c, t-constants.c, t-count_zeros.c,
14108         t-gmpmax.c, t-modlinv.c: Ditto.
14109         * tests/mpz/t-bin.c, t-cmp.c, t-get_si.c, t-misc.c, t-popcount.c,
14110         t-set_str.c, t-sizeinbase.c: Ditto.
14111         * tests/mpq/t-equal.c, t-get_str.c, t-set_f.c, t-set_str.c: Ditto.
14112         * tests/mpf/t-fits.c, t-get_d.c, t-get_si.c, t-int_p.c, t-misc.c,
14113         t-trunc.c: Ditto.
14114         * tests/mpbsd/allfuns.c, t-misc.c: Ditto.
14115
14116         * mpn/generic/mul_n.c, mpz/cfdiv_r_2exp.c: Use MPN_INCR_U rather than
14117         mpn_incr_u.
14118
14119         * tests/devel/try.c (TYPE_SB_DIVREM_MN): More fixes for calling method.
14120
14121         * mpn/x86/k6/cross.pl: More insn exceptions.
14122
14123 2001-06-23  Kevin Ryde  <kevin@swox.se>
14124
14125         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1) [i386]: Fix some asm output
14126         constraints.
14127
14128         * gmp-impl.h (modlimb_invert): Mask after shifting, so mask constant
14129         fits a signed byte.
14130
14131         * tests/devel/try.c (TYPE_SB_DIVREM_MN): Fix initial fill of quotient
14132         with garbage.
14133
14134 2001-06-20  Kevin Ryde  <kevin@swox.se>
14135
14136         * config.guess (rs6000-*-aix4* | powerpc-*-aix4*): Suppress error
14137         messages if $CC_FOR_BUILD or program don't work.
14138
14139         * mpz/sqrt.c,sqrtrem.c: Special case for op==0, to avoid TMP_ALLOC(0).
14140         * tests/refmpf.c (refmpf_add, refmpf_sub): Avoid TMP_ALLOC(0).
14141
14142         * tests/mpn/t-aors_1.c: New file.
14143         * tests/mpn/Makefile.am: Add it.
14144
14145         * gmp-h.in (__GMPN_ADD_1, __GMPN_SUB_1): New macros, rewrite of
14146         mpn_add_1 and mpn_sub_1, better code for src==dst and/or n==1,
14147         separate versions for gcc x86, gcc generic, and non-gcc.
14148         (mpn_add_1, mpn_sub_1): Use them.
14149         (mpn_add, mpn_sub): Ditto, to get inlines on all compilers.
14150         (extern "C") [__cplusplus]: Let this encompass the extern inlines too.
14151         * mpn/generic/add_1.c,sub_1.c: New files, force code from gmp.h.
14152         * configure.in, mpn/Makefile.am: Add them.
14153
14154         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): AC_SUBST __GMP_LSYM_PREFIX
14155         rather than AC_DEFINE LSYM_PREFIX.
14156         * gmp-h.in (__GMP_LSYM_PREFIX): New substitution.
14157         (__GMP_ASM_L): New macro.
14158         * gmp-impl.h (ASM_L): Use it.
14159
14160         * acinclude.m4, configure.in (GMP_C_ATTRIBUTE_MALLOC): New macro.
14161         * gmp-impl.h: Use it for all the malloc based TMP_ALLOCs.
14162
14163         * stack-alloc.h: Remove file.
14164         * tal-reent.c: New file.
14165         * Makefile.am: Update.
14166
14167         * acinclude.m4, configure.in (GMP_OPTION_ALLOCA): New macro, add
14168         malloc-reentrant method, use stack-alloc.c as malloc-notreentrant,
14169         make "reentrant" the default.
14170         * gmp-impl.h (__TMP_ALIGN): Moved from stack-alloc.c, use a union to
14171         determine the value, and demand only 4 bytes align on 32-bit systems.
14172         * gmp-impl.h (WANT_TMP_NOTREENTRANT): Move global parts of
14173         stack-alloc.h to here, allow non power-of-2 __TMP_ALIGN in TMP_ALLOC.
14174         * gmp-impl.h: Extend extern "C" to TMP_ALLOC declarations.
14175         * stack-alloc.c (tmp_stack): Move private parts of stack-alloc.h to
14176         here, use gmp-impl.h.
14177
14178         * gmp-impl.h (TMP_ALLOC_LIMBS_2): New macro.
14179         * mpz/fib_ui.c, mpz/jacobi.c, mpq/cmp.c, mpn/generic/fib2_ui.c: Use it.
14180
14181         * mpfr/exp2.c: Patch by Paul to match TMP_MARK and TMP_FREE in loop.
14182         * mpfr/sqrt.c: Scope nested TMP_DECL into nested { } block, patch by
14183         Paul, tweaked by me.
14184         * mpfr/agm.c: Ditto, and add a final TMP_FREE(marker2).
14185
14186         * gmp-h.in (mpn_cmp): Add __GMP_ATTRIBUTE_PURE.
14187
14188         * INSTALL: Clarify "make install", tweak formatting a bit.
14189
14190 2001-06-17  Kevin Ryde  <kevin@swox.se>
14191
14192         * configure.in, Makefile.am, gmp-impl.h: Add a debugging TMP_ALLOC,
14193         selected with --enable-alloca=debug.
14194         * tal-debug.c: New file.
14195         * configure.in, Makefile.am: Compile stack-alloc.c only for
14196         --disable-alloca.
14197         * assert.c (__gmp_assert_header): New function, split from
14198         __gmp_assert_fail.
14199
14200         * mpz/lcm.c: Don't TMP_MARK and then just return. Remove unnecessary
14201         _mpz_realloc prototype.
14202
14203         * mpn/generic/mul.c (mpn_sqr_n): Use __gmp_allocate_func for toom3
14204         temporary workspace.
14205
14206 2001-06-15  Kevin Ryde  <kevin@swox.se>
14207
14208         * tests/mpz/t-set_f.c: New file.
14209         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
14210
14211         * mpz/set_f.c: Share MPN_COPY between pad and trunc cases, do exp<=0
14212         test earlier, store SIZ(w) earlier.
14213
14214         * tests/t-count_zeros.c: New file.
14215         * tests/t-gmpmax.c: New file.
14216         * tests/Makefile.am (check_PROGRAMS): Add them.
14217
14218         * mp_clz_tab.c: Compile the table only if longlong.h says it's needed;
14219         add an internal-use-only comment.
14220         * tune/common.c: Force a __clz_tab for convenience when testing.
14221
14222         * mpn/x86/pentium/gmp-mparam.h, mpn/x86/pentium/mmx/gmp-mparam.h: Add
14223         COUNT_LEADING_ZEROS_NEED_CLZ_TAB, for mod_1.asm.
14224
14225         * longlong.h (count_leading_zeros) [pentium]: Decide to go with float
14226         method for p54.
14227         (count_leading_zeros) [alpha]: Add COUNT_LEADING_ZEROS_NEED_CLZ_TAB.
14228         (__clz_tab): Provide a prototype only if it's needed.
14229
14230         * tests/trace.c (mpz_trace): Don't use = on structures.
14231         (mpn_trace): Set _mp_alloc when creating mpz.
14232
14233 2001-06-12  Kevin Ryde  <kevin@swox.se>
14234
14235         * mpn/x86/divrem_1.asm: Amend some comments about P5 speed.
14236
14237         * tune/README: Clarify reconfigure on gmp-mparam.h update.
14238
14239         * mpn/x86/p6/copyd.asm: New file.
14240         * mpn/x86/p6/README: Update copyd and mod_1.
14241         * mpn/x86/copyd.asm: Amend some comments.
14242
14243         * gmp-impl.h (__builtin_constant_p): Add dummy for non-gcc.
14244         (mpn_incr_u, mpn_decr_u): Recognise incr==1 at compile time in the
14245         generic code on gcc.
14246
14247         * gmp-impl.h (ASSERT_ZERO_P, ASSERT_MPN_NONZERO_P): New macros.
14248         * mpn/generic/gcd_1.c, mpn/generic/mul_fft.c: Use them.
14249         * mpz/get_d.c: Add a private mpn_zero_p.
14250         * mpfr/trunc.c: Use own mpn_zero_p.
14251         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_1N): Use refmpn_zero_p.
14252         * gmp-impl.h (mpn_zero_p): Remove, no longer needed.
14253
14254         * gmp-h.in, gmp-impl.h: Move MPN_CMP to gmp.h as __GMPN_CMP, leave an
14255         MPN_CMP alias in gmp-impl.h.
14256         * gmp-h.in (mpn_cmp): Add an inline version.
14257         * mpn/generic/cmp.c: Use __GMP_FORCE_mpn_cmp to get code from gmp.h.
14258
14259         * acinclude.m4 (GMP_C_ATTRIBUTE_MODE): New macro.
14260         * configure.in: Call it.
14261         * gmp-impl.h (SItype etc): Use it.
14262
14263         * randraw.c (lc): Change mpn_mul_basecase->mpn_mul,
14264         mpn_incr_u->MPN_INCR_U, abort->ASSERT_ALWAYS(0).
14265
14266         * longlong.h (count_leading_zeros) [pentiumpro]: Work around a partial
14267         register stall on gcc < 3.
14268
14269         * gmp.texi (Introduction to GMP): Add IA-64.
14270         (Notes for Particular Systems): i386 means generic x86.
14271
14272         * tests/t-modlinv.c: Use tests_start and tests_end.
14273
14274 2001-06-10  Kevin Ryde  <kevin@swox.se>
14275
14276         * gmp.texi (Number Theoretic Functions): mpz_jacobi only defined for b
14277         odd.  Separate the jacobi/legendre/kronecker descriptions.
14278         (Low-level Functions): Document mpn_mul_1 "incr" overlaps.
14279         (Language Bindings): New chapter.
14280
14281         * mpz/jacobi.c: Don't retaining old behaviour of mpz_jacobi on even b
14282         (it wasn't documented in 3.1.1).
14283         * mpz/jacobi.c, gmp-h.in (mpz_kronecker, mpz_legendre): Remove
14284         separate entrypoints, just #define to mpz_jacobi.
14285         * compat.c (__gmpz_legendre): Add compatibility entrypoint.
14286
14287         * mpn/generic/mul_1.c: Allow "incr" style overlaps.
14288         * tests/devel/try.c (param_init): Test this.
14289
14290         * mpf/mul_ui.c: Do size==0 test earlier.
14291
14292 2001-06-08  Kevin Ryde  <kevin@swox.se>
14293
14294         * gmp-impl.h (ULONG_HIGHBIT, UINT_HIGHBIT, USHRT_HIGHBIT): Cast
14295         ULONG_MAX etc to unsigned long etc before attempting to right shift.
14296
14297         * acinclude.m4 (GMP_ASM_LSYM_PREFIX): Add an AC_DEFINE of LSYM_PREFIX.
14298         * gmp-impl.h (ASM_L): New macro.
14299         (mpn_incr_u, mpn_decr_u, MPN_INCR_U, MPN_DECR_U): Add i386 optimized
14300         versions.
14301
14302         * mpn/hppa/*.s,S,asm: Use .label so the code works with gas on hppa
14303         GNU/Linux too, reported by LaMont Jones <lamont@smallone.fc.hp.com>.
14304         * mpn/hppa/README: Add some notes on this.
14305         * acinclude.m4 (GMP_ASM_LABEL_SUFFIX): Ditto.
14306
14307         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add dive_1.c,
14308         fib2_ui.c.
14309
14310         * tests/mpn/t-iord_u.c: New file.
14311         * tests/mpn/Makefile.am (check_PROGRAMS): Add it.
14312
14313         * configure.in (mips*-*-irix[6789]*): Make ABI=n32 the default, same
14314         as in gmp 3.1.
14315         * gmp.texi (ABI and ISA): Update.
14316
14317         * gmp.texi (Build Options): Misc tweaks.
14318         (Notes for Particular Systems): Describe windows DLL handling.
14319         (Known Build Problems): DJGPP needs bash 2.04.
14320         (Number Theoretic Functions): mpz_invert returns 0<=r<modulus; add
14321         mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui.
14322         (Fibonacci Numbers Algorithm): Update for new formulas used.
14323         (Lucas Numbers Algorithm): New section.
14324
14325         * tune/speed.c,speed.h,common.c,many.pl: Add mpn_fib2_ui, mpz_fib2_ui,
14326         mpz_lucnum_ui, mpz_lucnum2_ui.
14327         * demos/expr/exprz.c,README: Add lucnum.
14328         * demos/perl/GMP.pm,GMP.xs,GMP/Mpz.pm,test.pl: Add fib2, lucnum,
14329         lucnum2.
14330
14331         * tests/mpz/t-lucnum_ui.c: New file.
14332         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
14333         * tests/mpz/t-fib_ui.c: Check mpz_fib2_ui too, updates for new style
14334         MPN_FIB2_SIZE.
14335
14336         * tune/tuneup.c, tune/Makefile.am, gmp-impl.h, mpn/*/gmp-mparam.h:
14337         Remove FIB_THRESHOLD, no longer required.
14338
14339         * mpz/fib2_ui.c, mpz/lucnum_ui.c mpz/lucnum2_ui.c: New files.
14340         * Makefile.am, mpz/Makefile.am: Add them.
14341         * gmp-h.in (mpz_fib2_ui, mpz_lucnum_ui, mpz_lucnum2_ui): Add
14342         prototypes.
14343
14344         * mpn/generic/fib2_ui.c: New file.
14345         * configure.in (gmp_mpn_functions): Add it.
14346         * gmp-impl.h (mpn_fib2_ui, FIB_TABLE, etc): Add these.
14347         * mpz/fib_ui.c: Rewrite.
14348
14349         * acinclude.m4 (GMP_C_SIZES): Fix _LONG_LONG_LIMB define for mp_limb_t
14350         size test.
14351         (GMP_FUNC_ALLOCA): Add dummy __GMP_BITS_PER_MP_LIMB for gmp-h.in work.
14352
14353         * configure.in (CPPFLAGS): Remove -D__GMP_WITHIN_GMP, don't want it
14354         everywhere.
14355         * Makefile.am, mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am,
14356         mpf/Makefile.am, mpbsd/Makefile.am (INCLUDES): Set -D__GMP_WITHIN_GMP.
14357
14358         * configure.in (*-*-msdosdjgpp*): Forcibly disable shared libraries,
14359         to make libtests.la work.
14360
14361         * acconfig.h (_LONG_LONG_LIMB, HAVE_MPFR): Remove dummy defines, no
14362         longer needed.
14363
14364         * mpz/set_ui.c: Store to _mp_d[0] unconditionally.
14365
14366 2001-05-27  Kevin Ryde  <kevin@swox.se>
14367
14368         * configure.in, gmp-h.in, mp-h.in: Add support for windows DLLs.
14369
14370 2001-05-26  Kevin Ryde  <kevin@swox.se>
14371
14372         * gmp.texi (ABI and ISA, Reentrancy): Minor tweaks
14373         (Notes for Package Builds): Note gmp.h is a generated file.
14374         (Notes for Particular Systems): -march=pentiumpro is used for gcc
14375         2.95.4 and up.
14376         (Assembler Loop Unrolling): Mention non power-of-2 unrolling.
14377         (Internals): New chapter.
14378         * mpf/README: Remove file.
14379
14380         * demos/expr/README: Miscellaneous rewordings.
14381
14382         * demos/perl: New directory.
14383         * demos/Makefile.am: Add it.
14384         * demos/perl/INSTALL, Makefile.PL, GMP.pm, GMP.xs, typemap,
14385         GMP/Mpz.pm, GMP/Mpq.pm, GMP/mpf.pm, GMP/Rand.pm, sample.pl, test.pl:
14386         New files.
14387
14388         * configure, aclocal.m4: Update to autoconf 2.50.
14389
14390         * configure, aclocal.m4, ltmain.sh: Update to libtool 1.4.
14391
14392         * configure, aclocal.m4, missing, ansi2knr.c, */Makefile.in: Update to
14393         automake 1.4f.
14394         * Makefile.am: Conditionalize mpfr in $(SUBDIRS) to handle mpfr.info.
14395         * mpfr/Makefile.am (INFO_DEPS): Remove previous mpfr.info handling.
14396         * mpn/Makefile.am (GENERIC_SOURCES): Remove this, just put mp_bases.c
14397         in libmpn_la_SOURCES.
14398         * tests/Makefile.am (tests.h): Move from EXTRA_HEADERS to
14399         libtests_la_SOURCES.
14400         * ltconfig: Remove file, no longer needed.
14401
14402         * Makefile.am (gmp-impl.h, longlong.h, stack-alloc.h): Move from
14403         EXTRA_DIST to libgmp_la_SOURCES, so they get included in TAGS.
14404         * tests/rand/Makefile.am (gmpstat.h): Move to libstat_la_SOURCES
14405         similarly.
14406
14407         * config.guess (68k-*-*): Use $SHELL not "sh", tweak some comments.
14408
14409         * mpfr/mpfr.texi (Introduction to MPFR): Tweak table formatting, note
14410         non-free programs must be able to be re-linked.
14411
14412 2001-05-20  Kevin Ryde  <kevin@swox.se>
14413
14414         * mpn/powerpc64/addmul_1.asm, mpn/powerpc64/mul_1.asm,
14415         mpn/powerpc64/submul_1.asm: Add carry-in entrypoints.
14416
14417 2001-05-17  Kevin Ryde  <kevin@swox.se>
14418
14419         * gmp.texi (ge): Fix definition for info.
14420         (Notes for Particular Systems): Mention 68k dragonball and cpu32.
14421         (Efficiency): Add static linking, more about in-place operations,
14422         describe mpq+/-integer using addmul.
14423         (Reporting Bugs): A couple of words about self-contained reports.
14424         (Floating-point Functions): Note exponent limitations of mpf_get_str
14425         and mpf_set_str.
14426         (Initializing Floats): Clarify mpf_get_prec, mpf_set_prec and
14427         mpf_set_prec_raw a bit.
14428         (Float Comparison): Note current mpf_eq deficiencies.
14429
14430         * gmp-h.in (__GMP_HAVE_CONST, __GMP_HAVE_PROTOTYPES,
14431         __GMP_HAVE_TOKEN_PASTE): Merge GNU ansidecl.h tests for ANSI compilers.
14432         * demos/expr/expr-impl-h.in: Ditto.
14433
14434         * gmp-impl.h (BITS_PER_MP_LIMB): Define from __GMP_BITS_PER_MP_LIMB if
14435         not already in gmp-mparam.h.
14436         * tests/t-constants.c (BITS_PER_MP_LIMB, __GMP_BITS_PER_MP_LIMB):
14437         Check these are the same.
14438
14439         * gmp-h.in (mpf_get_default_prec, mpf_get_prec, mpf_set_default_prec,
14440         mpf_set_prec_raw): Provide "extern inline" versions, use __GMPF on the
14441         macros.
14442         * mpf/get_dfl_prc.c, mpf/get_prc.c, mpf/set_dfl_prc.c,
14443         mpf/set_prc_raw.c: Get code from gmp.h using __GMP_FORCE.
14444
14445         * gmp-h.in, gmp-impl.h (__gmp_default_fp_limb_precision): Move from
14446         gmp-impl.h to gmp-h.in.
14447         (__GMPF_BITS_TO_PREC, __GMPF_PREC_TO_BITS): Ditto, and use __GMPF
14448         prefix and add a couple of casts.
14449         * gmp-h.in (__GMP_MAX): New macro.
14450         * mpf/init2.c mpf/set_prc.c: Update for __GMPF prefix.
14451
14452         * gmp-h.in (__GMP_BITS_PER_MP_LIMB): New templated define.
14453         * acinclude.m4 (GMP_C_SIZES): Add AC_SUBST __GMP_BITS_PER_MP_LIMB,
14454         remove AC_DEFINE BITS_PER_MP_LIMB.
14455
14456 2001-05-13  Kevin Ryde  <kevin@swox.se>
14457
14458         * gmp-h.in, gmp.texi, Makefile.am, mpz/Makefile.am, tests/mpz/t-pow.c:
14459         Remove mpz_si_pow_ui, pending full si support.
14460         * mpz/si_pow_ui.c: Remove file.
14461
14462 2001-05-11  Kevin Ryde  <kevin@swox.se>
14463
14464         * mpn/x86/pentium/dive_1.asm: New file.
14465
14466         * mpn/powerpc32/umul.asm: Use r on registers.
14467         * mpn/powerpc64/umul.asm: New file.
14468         * configure.in (powerpc*-*-*): Enable umul in extra_functions.
14469
14470         * tests/refmpn.c, tests/tests.h (refmpn_umul_ppmm): Use same arguments
14471         as normal mpn_umul_ppmm.
14472         (refmpn_mul_1c): Update.
14473         * tests/devel/try.c, tune/many.pl: Add some umul_ppmm testing support.
14474
14475         * mpn/x86/k6/mmx/popham.asm, mpn/x86/k7/mmx/popham.asm: Don't support
14476         size==0.
14477         * mpn/x86/pentium/popcount.asm, mpn/x86/pentium/hamdist.asm: Ditto,
14478         and shave a couple of cycles from the PIC entry code.
14479
14480         * mpz/mul.c: Use mpn_mul_1 for size==1 and mpn_mul_2 (if available)
14481         for size==2, to avoid copying; do vsize==0 test earlier.
14482
14483         * mpf/sub.c: Test r!=u before calling mpf_set.
14484         * mpf/add.c: Ditto, and share mpf_set between usize==0 and vsize==0.
14485
14486         * mpn/generic/tdiv_qr.c, mpq/get_d.c, mpf/div.c, mpf/set_q.c,
14487         mpf/set_str.c, mpf/ui_div.c: Test for high bit set, not for
14488         count_leading_zeros zero.
14489
14490         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Print a message if extra
14491         flags are added.
14492
14493         * tests/mpz/t-mul_i.c: New file.
14494         * tests/mpz/Makefile.am: Add it.
14495
14496         * mpz/mul_siui.c (mpz_mul_si): Fix for -0x80..00 on long long limb.
14497
14498         * gmp-h.in (mpf_set_si, mpf_set_ui): Revert last change, set exp to 0
14499         when n==0.
14500         * mpf/ceilfloor.c, mpf/trunc.c: Fix exp to 0 when setting r to 0.
14501         * gmp-impl.h (MPF_CHECK_FORMAT): Check exp==0 when size==0.
14502
14503 2001-05-07  Kevin Ryde  <kevin@swox.se>
14504
14505         * gmp-h.in (mpf_set_si, mpf_set_ui): Don't bother setting _mp_exp to 0
14506         when n==0 (use 1 unconditionally).
14507         * tests/mpf/t-misc.c (check_mpf_set_si): Don't demand anything of
14508         _mp_exp when _mp_size is zero.
14509
14510         * mpn/x86/README: Note gas _GLOBAL_OFFSET_TABLE_ with leal problem.
14511
14512         * gmp-h.in (mpz_fits_uint_p, mpz_fits_ulong_p, mpz_fits_ushort_p):
14513         Provide these as "extern inline"s.
14514         (__GMP_UINT_MAX, __GMP_ULONG_MAX, __GMP_USHRT_MAX): New macros.
14515         (mpz_popcount): Use __GMP_ULONG_MAX.
14516         * gmp-impl.h (UINT_MAX, ULONG_MAX, USHRT_MAX): Use __GMP_U*_MAX, if
14517         not already defined.
14518         * mpz/fits_u.c: Use the code from gmp.h.
14519
14520 2001-05-06  Kevin Ryde  <kevin@swox.se>
14521
14522         * mpn/x86/k7/dive_1.asm: New file.
14523         * mpn/x86/k7/gcd_1.asm: New file.
14524         * mpn/asm-defs.m4 (m4_count_trailing_zeros): New macro.
14525
14526         * gmp-h.in (mpz_get_ui, mpz_getlimbn, mpz_set_q, mpz_perfect_square_p,
14527         mpz_popcount, mpz_size, mpf_set_ui, mpf_set_si, mpf_size): Provide
14528         these as "extern inlines".
14529         Use just one big extern "C" block.
14530         * mpz/getlimbn.c, mpz/get_ui.c, mpz/perfsqr.c, mpz/popcount.c
14531         mpz/set_q.c, mpz/size.c, mpf/set_si.c, mpf/set_ui.c, mpf/size.c: Use
14532         __GMP_FORCE to get code from gmp.h.
14533
14534 2001-05-03  Kevin Ryde  <kevin@swox.se>
14535
14536         * extract-dbl.c: Add ASSERT d>=0.
14537
14538         * gmp.texi (Efficiency): Add mpz_addmul etc for mpz+=integer, add
14539         mpz_neg etc in-place.
14540         (Integer Arithmetic): Add mpz_addmul, mpz_submul, mpz_submul_ui.
14541         (Initializing Rationals): Add mpq_set_str.
14542         (Low-level Functions): mpn_set_str requires strsize >= 1.
14543
14544         * gmp-h.in (__GMP_EXTERN_INLINE, __GMP_ABS): New macros.
14545         (mpz_abs, mpq_abs, mpf_abs, mpz_neg, mpq_neg, mpf_neg): Provide inline
14546         versions.
14547         * mpz/abs.c, mpq/abs.c, mpf/abs.c, mpz/neg.c, mpq/neg.c, mpf/neg.c:
14548         Add suitable __GMP_FORCE to turn off inline versions.
14549
14550         * tests/mpz/t-aorsmul.c,t-cmp_d.c,t-popcount,t-set_str.c: New files.
14551         * tests/mpz/Makefile.am: Add them.
14552
14553         * mpz/aorsmul_i.c: New file, rewrite of addmul_ui.c.  Add
14554         mpz_submul_ui entrypoint, share more code between some of the
14555         conditionals, use mpn_mul_1c if available.
14556         * mpz/addmul_ui.c: Remove file.
14557         * mpz/aorsmul.c: New file.
14558         * Makefile.am, mpz/Makefile.am: Update.
14559         * gmp-h.in (mpz_addmul, mpz_submul, mpz_submul_ui): Add prototypes.
14560         * gmp-impl.h (mpz_aorsmul_1): Add prototype.
14561
14562         * tests/mpq/t-set_str.c: New file.
14563         * tests/mpq/Makefile.am: Add it.
14564
14565         * mpq/set_str.c: New file.
14566         * Makefile.am, mpq/Makefile.am: Add it.
14567         * gmp-h.in (mpq_set_str): Add prototype.
14568
14569         * mpz/set_str.c: Fix for trailing white space on zero, eg. "0 ".
14570         * mpn/generic/set_str.c: Add ASSERT str_len >= 1.
14571
14572         * gmp-h.in, gmp-impl.h (mpn_incr_u, mpn_decr_u): Move to gmp-impl.h.
14573         * gmp-impl.h (MPN_INCR_U, MPN_DECR_U): New macros.
14574
14575 2001-04-30  Kevin Ryde  <kevin@swox.se>
14576
14577         * tests/mpz/t-lcm.c: New file.
14578         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
14579
14580         * mpz/lcm.c: Add one limb special case.
14581
14582         * mpz/lcm_ui.c: New file.
14583         * Makefile.am, mpz/Makefile.am: Add it.
14584         * gmp-h.in (mpz_lcm_ui): Add prototype.
14585         * gmp.texi (Number Theoretic Functions): Add mpz_lcm_ui, document lcm
14586         now always positive.
14587
14588         * mp-h.in (mp_size_t, mp_exp_t): Fix typedefs to match gmp-h.in.
14589
14590         * gmp-h.in (mpn_add_1, mpn_add, mpn_sub_1, mpn_sub): Remove K&R
14591         function defines (ansi2knr will handle mpn/inline.c, and just ansi is
14592         enough for gcc extern inline).
14593
14594         * gmp-h.in (__GMP_HAVE_TOKEN_PASTE): New macro.
14595         (__MPN): Use it.
14596         * gmp-impl.h (CNST_LIMB): Ditto.
14597
14598         * gmp-h.in, mp-h.in (__gmp_const, __gmp_signed, _PROTO, __MPN): Use
14599         ANSI forms on Microsoft C.
14600         (__GMP_HAVE_CONST): New define.
14601         * gmp-impl.h (const, signed): Use it.
14602
14603         * demos/expr/expr-impl-h.in (<stdarg.h>): Use this with Microsoft C.
14604         (HAVE_STDARG): New define.
14605         * demos/expr/expr.c,exprz.c,exprq.c,exprf.c,exprfr.c: Use it.
14606
14607         * acinclude.m4 (GMP_C_STDARG): New macro.
14608         * configure.in: Call it.
14609         * rand.c: Use it.
14610
14611         * configure.in (AC_PROG_CC_STDC): New test.
14612
14613 2001-04-25  Kevin Ryde  <kevin@swox.se>
14614
14615         * mpn/x86/k6/mmx/dive_1.asm: New file.
14616         * mpn/x86/x86-defs.m4 (Zdisp): Two more insns.
14617
14618         * mpn/x86/pentium/mul_2.asm: New file.
14619         * mpn/asm-defs.m4: Add define_mpn(mul_2).
14620         * acconfig.h (HAVE_NATIVE_mpn_divexact_1, mul_2): Add templates.
14621
14622         * configure.in (ABI): Use AC_ARG_VAR.
14623
14624         * tests/devel/try.c: Run reference function when validate fails.
14625
14626         * mpq/get_str.c: Fixes for negative bases.
14627         * tests/mpq/t-get_str.c: Check negative bases.
14628         * tests/misc.c,tests.h (__gmp_allocate_strdup, strtoupper): New
14629         functions.
14630
14631 2001-04-24  Torbjorn Granlund  <tege@swox.com>
14632
14633         * mpz/lcm.c (mpz_lcm): Make result always positive.
14634
14635         * gmp-h.in (mpz_inp_binary, mpz_out_binary): Remove declarations.
14636
14637 2001-04-22  Kevin Ryde  <kevin@swox.se>
14638
14639         * mpn/powerpc64/addsub_n.asm: Use config.m4 not asm-syntax.m4.
14640
14641         * mpz/cmp_d.c, mpz/cmpabs_d.c: New files.
14642         * Makefile.am, mpz/Makefile.am: Add them.
14643         * mpf/cmp_d.c, mpf/get_dfl_prec.c: New files.
14644         * Makefile.am, mpf/Makefile.am: Add them.
14645         * gmp-h.in (mpz_cmp_d, mpz_cmpabs_d, mpf_cmp_d, mpf_get_default_prec):
14646         Add prototypes.
14647         * gmp.texi: Add documentation.
14648
14649         * mpf/set_prc.c: Avoid a realloc call if already the right precision.
14650
14651         * gmp-impl.h (MPF_BITS_TO_PREC, MPF_PREC_TO_BITS): New macros.
14652         * mpf/get_prc.c, init2.c, set_dfl_prec.c, set_prc.c, set_prc_raw.c:
14653         Use them.
14654
14655 2001-04-20  Kevin Ryde  <kevin@swox.se>
14656
14657         * tests/devel/try.c: Don't test size==0 on mpn_popcount and
14658         mpn_hamdist; add testing for mpn_divexact_1; print some limb values
14659         with mpn_trace not printf.
14660
14661         * mpz/popcount.c, mpz/hamdist.c: Don't pass size==0 to mpn_popcount
14662         and mpn_hamdist.
14663         * mpn/generic/popham.c: Don't support size==0.
14664
14665         * config.guess (m68k-*-*): Detect m68010, return m68360 for cpu32,
14666         cleanup the nesting a bit.
14667
14668         * gmp.texi (Integer Division): Fix mpz_congruent_2exp_p "c" type.
14669         (Integer Division): Add mpz_divexact_ui.
14670         (Number Theoretic Functions): Fix mpz_nextprime return type.
14671         (Exact Remainder): Divisibility tests now implemented.
14672         And more index entries in a few places.
14673
14674         * tests/mpz/dive_ui.c: New file.
14675         * tests/mpz/Makefile.am (check_PROGRAMS): Add it.
14676
14677         * mpz/dive_ui.c: New file.
14678         * Makefile.am, mpz/Makefile.am: Add it.
14679         * gmp-h.in (mpz_divexact_ui): Add prototype.
14680
14681         * tune/many.pl, tune/speed.h: Add special mpn_back_to_back for
14682         development.
14683
14684         * gmp-impl.h (MPN_DIVREM_OR_DIVEXACT_1): New macro.
14685         * mpz/divexact.c: Use it.
14686
14687         * gmp-impl.h (DIVEXACT_1_THRESHOLD): New threshold.
14688         * tune/tuneup.c: Tune it.
14689
14690         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
14691         mpn_divexact_1, mpn_copyi, mpn_copyd.
14692
14693         * mpn/generic/dive_1.c: New file.
14694         * configure.in (gmp_mpn_functions): Add it.
14695         * gmp-impl.h (mpn_divexact_1): Add prototype.
14696         * mpn/asm-defs.m4: Add define_mpn(divexact_1).
14697
14698         * tests/mpn: New directory.
14699         * tests/Makefile.am: Add it.
14700         * tests/mpn/Makefile.am: New file.
14701         * configure.in (AC_OUTPUT): Add it.
14702         * tests/mpn/t-asmtype.c: New file.
14703
14704         * configure, config.in: Update to autoconf 2.49d.
14705
14706         * configure.in, gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Revert
14707         to generating gmp.h, mp.h and expr-impl.h with AC_OUTPUT and AC_SUBST.
14708
14709         * configure.in (m68*-*-*): Oops, m683?2 is 68000, m68360 is cpu32.
14710         * mpn/m68k/m68k-defs.m4 (scale_available_p): Ditto.
14711
14712         * configure.in (underscore, asm_align): Remove these variables, unused.
14713         (GMP_ASM_*): Sort by AC_REQUIREs, to avoid duplication.
14714         * acinclude.m4 (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_LOG): Remove support
14715         for actions, no longer needed.
14716
14717 2001-04-17  Kevin Ryde  <kevin@swox.se>
14718
14719         * config.guess (m68k-*-*): Look for cpu in linux kernel /proc/cpuinfo.
14720
14721         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): The -mpentiumpro problem is
14722         fixed in 2.95.4, so test for that.
14723         (GMP_ASM_TYPE): Amend some comments.
14724
14725         * tune/freq.c (speed_cpu_frequency_sysctl): Avoid having unused
14726         variables on GNU/Linux.
14727
14728         * mpn/asm-defs.m4 (m4_instruction_wrapper): Fix a quoting problem if
14729         the name of the file is a macro.
14730
14731 2001-04-15  Kevin Ryde  <kevin@swox.se>
14732
14733         * mpn/powerpc64/*.asm: Add speeds on ppc630.
14734
14735         * acconfig.h: Add dummy templates for _LONG_LONG_LIMB and HAVE_MPFR.
14736         * configure.in: Ensure config.in is the last AM_CONFIG_HEADER,
14737         which autoheader requires.
14738
14739         * mpn/x86/pentium/popcount.asm: New file.
14740         * mpn/x86/pentium/hamdist.asm: New file.
14741
14742         * mpn/asm-defs.m4: (m4_popcount): New macro.
14743         Amend a few comments elsewhere.
14744
14745         * acinclude.m4 (GMP_ASM_RODATA): If possible, grep compiler output for
14746         the right directive.
14747
14748         * tune/speed.c: Print clock speed in MHz, not cycle time.
14749
14750         * configure.in (AC_CHECK_HEADERS): Check for sys/processor.h.
14751         * tune/freq.c (speed_cpu_frequency_processor_info): Require
14752         <sys/processor.h> to exist, to differentiate the different
14753         processor_info on Darwin.
14754         (speed_cpu_frequency_sysctlbyname): Remove hw.model test which is in
14755         speed_cpu_frequency_sysctl.
14756         (speed_cpu_frequency_sysctl): Add hw.cpufrequency for Darwin.
14757
14758         * gmp-impl.h (MPN_LOGOPS_N_INLINE, mpn_and_n ... mpn_xnor_n): Use a
14759         single expression argument for the different operations, necessary for
14760         the Darwin "smart" preprocessor.
14761
14762         * mpn/m68k/t-m68k-defs.pl: Allow white space in m4_definsn and
14763         m4_defbranch.
14764
14765         * tune/many.pl: Change RM_TMP_S to RM_TMP to match mpn/Makeasm.am,
14766         avoid a possibly undefined array in a diagnostic, add more renaming to
14767         hamdist.
14768
14769 2001-04-13  Kevin Ryde  <kevin@swox.se>
14770
14771         * ltmain.sh, aclocal.m4, configure, config.in: Update to libtool 1.3d.
14772         * configure.in: Change ac_ to lt_ in lt_cv_archive_cmds_need_lc and
14773         lt_cv_proc_cc_pic.
14774
14775         * config.guess (m68*-*-*): Detect exact cpu with BSD sysctl hw.model,
14776         detect 68000/68010 with trapf, detect 68302 with bfffo.
14777
14778 2001-04-11  Kevin Ryde  <kevin@swox.se>
14779
14780         * acinclude.m4 (GMP_ASM_M68K_INSTRUCTION, GMP_ASM_M68K_ADDRESSING,
14781         GMP_ASM_M68K_BRANCHES): New macros.
14782         * configure.in: Use them, remove old 68k configs, use mc68020 udiv and
14783         umul.
14784
14785         * mpn/m68k/m68k-defs.m4: New file.
14786         * mpn/m68k/t-m68k-defs.pl: New file.
14787         * mpn/m68k/*.asm: New files, converted from .S.  Merge add_n and sub_n
14788         to aors_n, ditto mc68020 addmul_1 and submul_1 to aorsmul_1.  No
14789         object code changes (except .type and .size now used on NetBSD 1.4).
14790         * mpn/m68k/README: New file.
14791         * mpn/m68k/*.S, */*.S, syntax.h: Remove files.
14792
14793         * configure.in (m68*-*-netbsd1.4*): Pretend getrusage doesn't exist.
14794         * tune/README: Update.
14795
14796         * configure.in (powerpc*-*-*): For the benefit of Darwin 1.3, add cc
14797         to cclist, make gcc_cflags -Wa,-mppc optional.
14798
14799 2001-04-06  Kevin Ryde  <kevin@swox.se>
14800
14801         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add | for 68k.
14802         (gmpasm-mode-syntax-table): Add to comments.
14803
14804         * tests/mpz/reuse.c (dsi_div_func_names): Add names for cdiv_[qr]_2exp.
14805
14806 2001-04-04  Kevin Ryde  <kevin@swox.se>
14807
14808         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): Fix test so as to actually
14809         detect the problem, add notes on m68k netbsd 1.4.1.
14810
14811         * gmp.texi (Compatibility with older versions): Note libmp
14812         compatibility.
14813
14814 2001-04-03  Kevin Ryde  <kevin@swox.se>
14815
14816         * tests/mpz/reuse.c: Add mpz_cdiv_q_2exp and mpz_cdiv_r_2exp.
14817
14818         * tests/mpz/t-pow.c: Drag in refmpn.o when testing mpz_pow_ui etc with
14819         refmpn_mul_2.
14820
14821         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of mpn_com_n
14822         and mpn_mul_2.
14823         * tests/devel/try.c: Add testing of mpn_mul_2, and a
14824         DATA_MULTIPLE_DIVISOR attribute.
14825
14826         * gmp.texi (Build Options): List more m68k's.
14827         (Build Options): Add cross reference to tex2html.
14828         (Notes for Particular Systems): Add m68k means 68020 or up.
14829         (Rational Conversions): New section, with mpq_get_d, mpq_set_d and
14830         mpq_set_f from Miscellaneous, and new mpq_set_str.
14831         (Applying Integer Functions): Move mpq_get_num, mpq_get_den,
14832         mpq_set_num and mpq_set_den from Misc.
14833         (Miscellaneous Rational Functions): Remove section.
14834         (Custom Allocation): Partial rewrite for various clarifications.
14835         (References): Improve line breaks near URLs.
14836
14837         * acinclude.m4 (GMP_GCC_M68K_OPTIMIZE): New macro.
14838         * configure.in (m68*-*-*): Use it to run gcc 2.95.x at -O not -O2.
14839         (m680?0-*-*, m683?2-*-*, m68360-*-*): Add optional gcc -m options.
14840
14841         * tests/mpz/t-cmp.c: New file.
14842         * tests/mpz/t-sizeinbase.c: New file.
14843         * tests/mpz/Makefile.am: Add them.
14844
14845         * gmp-impl.h (MPN_CMP): New macro.
14846         * mpz/cmp.c,cmpabs.c: Use it, and minor cleanups too.
14847
14848         * tests/mpq/t-equal.c: New file.
14849         * tests/mpq/t-get_str.c: New file.
14850         * tests/mpq/Makefile.am: Add them.
14851
14852         * mpq/get_str.c: New file.
14853         * Makefile.am, mpq/Makefile.am: Add it.
14854         * gmp-h.in (mpq_get_str): Add prototype.
14855
14856         * mpq/equal.c: Rewrite using inline compare loops.
14857
14858         * tests/refmpn.c,tests.h (refmpn_mul_2): Fix parameter order.
14859         * mpz/n_pow_ui.c: Fix mpn_mul_2 calls parameter order.
14860
14861 2001-03-29  Kevin Ryde  <kevin@swox.se>
14862
14863         * tests/mpf/t-trunc.c: New file.
14864         * tests/mpf/Makefile.am (check_PROGRAMS): Add it.
14865         * gmp-impl.h (MPF_CHECK_FORMAT): New macro.
14866
14867         * mpf/trunc.c: New file, rewrite of integer.c, preserve prec+1 in
14868         copy, don't copy if unnecessary.
14869         * mpf/ceilfloor.c: New file likewise, and use common subroutine for
14870         ceil and floor.
14871         * mpf/integer.c: Remove file.
14872         * Makefile.am, mpf/Makefile.am, macos/Makefile.in: Update.
14873
14874         * acinclude.m4 (GMP_GCC_VERSION_GE): New macro.
14875         (GMP_GCC_MARCH_PENTIUMPRO): Use it, remove CCBASE parameter (don't
14876         bother checking it's gcc).
14877         (GMP_GCC_ARM_UMODSI): New macro.
14878         * configure.in (GMP_GCC_MARCH_PENTIUMPRO): Update parameters.
14879         (arm*-*-*): Use GMP_GCC_ARM_UMODSI.
14880         * gmp.texi (Notes for Particular Systems): Add arm gcc requirements.
14881
14882 2001-03-28  Kevin Ryde  <kevin@swox.se>
14883
14884         * gmp.texi (Converting Integers): Document mpz_getlimbn using absolute
14885         value and giving zero for N out of range, move to end of section.
14886
14887         * tests/refmpn.c (refmpn_tdiv_qr): Use refmpn_divmod_1 rather than
14888         refmpn_divrem_1.
14889         * tests/tests.h: Add some prototypes that were missing.
14890
14891         * mpz/tdiv_q_ui.c: Remove a comment that belonged to mpz_tdiv_r_ui.
14892
14893 2001-03-26  Torbjorn Granlund  <tege@swox.com>
14894
14895         * mpn/generic/gcdext.c: Handle carry overflow after m*n multiply code
14896         in both arms.  Partially combine multiply arms.
14897
14898 2001-03-24  Kevin Ryde  <kevin@swox.se>
14899
14900         * longlong.h: Add comments to P5 count_leading_zeros.
14901
14902         * demos/expr/exprz.c,t-expr.c,README: Add congruent_p and divisible_p.
14903
14904 2001-03-23  Kevin Ryde  <kevin@swox.se>
14905
14906         * gmp.texi (GMPceil, GMPfloor, ge, le): New macros.
14907         (Integer Division, mpn_cmp, mpn_sqrtrem, Algorithms): Use them.
14908         (mpn_bdivmod): Refer to mp_bits_per_limb, not BITS_PER_MP_LIMB, and
14909         improve formatting a bit.
14910         (mpn_lshift, mpn_rshift): Clarify the return values, and use {rp,n}
14911         for the destination.
14912         Miscellaneous minor rewordings in a few places.
14913
14914         * mpn/arm/arm-defs.m4: New file.
14915         * configure.in (arm*-*-*): Use it.
14916         * mpn/arm/*.asm: Use changecom and registers from arm-defs.m4, use L()
14917         for local labels.
14918
14919         * mpn/x86/k6/mmx/com_n.asm: Relax code alignment (same speed).
14920
14921         * gmp-h.in (__GMP_ATTRIBUTE_PURE): Use __pure__ to avoid application
14922         namespace.
14923
14924         * gmp-impl.h (ABS): Add parens around argument.
14925
14926 2001-03-20  Kevin Ryde  <kevin@swox.se>
14927
14928         * acinclude.m4 (GMP_PROG_M4): Use AC_ARG_VAR on $M4.
14929
14930         * acinclude.m4 (GMP_M4_M4WRAP_SPURIOUS): New macro.
14931         * configure.in: Use it.
14932         * mpn/asm-defs.m4: Ditto.
14933
14934 2001-03-18  Kevin Ryde  <kevin@swox.se>
14935
14936         * mpn/x86/pentium/logops_n.asm: New file.
14937
14938         * mpn/x86/k6/k62mmx/copyd.asm: Rewrite, smaller and simpler, faster on
14939         small sizes, slower on big sizes (about half the time).
14940         * mpn/x86/k6/k62mmx/copyi.asm: Remove file, in favour of generic x86.
14941         * mpn/x86/copyi.asm: Add some comments.
14942         * mpn/x86/k6/README: Update.
14943
14944         * mpn/x86/k6/gcd_1.asm: New file.
14945
14946         * gmp-impl.h (NEG_MOD): Fix type of __dnorm.
14947
14948         * acinclude.m4 (GMP_C_SIZES): Fix use of __GMP_WITHIN_CONFIGURE.
14949
14950 2001-03-15  Kevin Ryde  <kevin@swox.se>
14951
14952         * gmp.texi (GMPabs): New macro.
14953         (Float Comparison - mpf_reldiff): Use it.
14954         (Integer Comparisons - mpz_cmpabs): Ditto, puts "abs" in info.
14955         (Reentrancy): Update notes on old random functions.
14956         (Karatsuba Multiplication): Better characterize the effect of basecase
14957         speedups on the thresholds, pointed out by Torbjorn.
14958
14959         * tune/README: Notes on the 1x1 div threshold for mpn_gcd_1.
14960
14961         * tests/misc.c (mpz_pow2abs_p, mpz_flipbit, mpz_errandomb,
14962         mpz_errandomb_nonzero, mpz_negrandom): New functions.
14963         (mpz_erandomb, mpz_erandomb_nonzero): Use urandom().
14964         * tests/spinner.c (spinner_wanted, spinner_tick): Make global.
14965         * tests/tests.h: Update prototypes.
14966
14967         * tests/mpz/t-cong.c, tests/mpz/t-cong_2exp.c: New files.
14968         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
14969
14970         * mpz/cong.c, mpz/cong_2exp.c, mpz/cong_ui.c: New files.
14971         * Makefile.am, mpz/Makefile.am: Add them.
14972         * gmp-impl.h (NEG_MOD): New macro.
14973         * gmp-h.in (mpz_congruent_p, mpz_congruent_2exp_p,
14974         mpz_congruent_ui_p): Add prototypes.
14975         * gmp.texi (Integer Division, Efficiency): Add documentation.
14976
14977         * mpq/aors.c: No need for ABS on denominator sizes.
14978
14979         * gmp-impl.h (mpn_divisible_p): Use __MPN.
14980
14981         * gmp-impl.h (LOW_ZEROS_MASK): New macro.
14982         * mpz/divis_ui.c, mpn/generic/divis.c: Use it.
14983
14984         * mpz/setbit.c: Fix normalization for case of a negative ending up
14985         with a zero high limb.
14986         * tests/mpz/bit.c (check_single): New test for this problem.
14987
14988         * configure.in (none-*-*): Fix cclist for default ABI=long.
14989
14990 2001-03-10  Kevin Ryde  <kevin@swox.se>
14991
14992         * mpz/cfdiv_q_2exp.c: Don't scan for non-zero limbs if they don't
14993         matter to the rounding.
14994
14995         * mpz/get_ui.c: Fetch _mp_d[0] unconditionally, so the code can come
14996         out branch-free.
14997
14998 2001-03-08  Kevin Ryde  <kevin@swox.se>
14999
15000         * tests/devel/try.c (param_init): Fix reference functions for and_n
15001         and nand_n.
15002
15003         * tune/speed.c, tests/devel/try.c: Seed RANDS, not srandom etc.
15004         * configure.in (AC_CHECK_FUNCS): Remove srand48 and srandom.
15005         * macos/configure (coptions): Remove random/srandom, now unnecessary.
15006
15007         * configure.in (gmp.h, mp.h, demos/expr/expr-impl.h): Generate using
15008         AM_CONFIG_HEADER.
15009         (_LONG_LONG_LIMB, HAVE_MPFR): Change to AC_DEFINEs.
15010         * gmp-h.in, mp-h.in, demos/expr/expr-impl-h.in: Change to #undef's.
15011         * acinclude.m4 (GMP_FUNC_ALLOCA, GMP_C_SIZES): Use gmp-h.in, not gmp.h.
15012         * Makefile.am (EXTRA_DIST): Remove gmp-h.in and mp-h.in, now done
15013         automatically.
15014         * acinclude.m4 (GMP_FUNC_ALLOCA), gmp-impl.h: Set and use
15015         __GMP_WITHIN_CONFIGURE rather than GMP_FUNC_ALLOCA_TEST.
15016
15017         * mpf/random2.c: Use _gmp_rand and RANDS instead of random() for the
15018         exponent, ensures full range of values too.
15019
15020         * tests/mpz/t-div_2exp.c (check_various): Start with d based on i, but
15021         don't let it go negative.
15022
15023         * tune/tuneup.c (KARATSUBA_MUL_THRESHOLD): Limit probing to
15024         TOOM3_MUL_THRESHOLD_LIMIT, the size of the workspace in mul_n.c.
15025         Use a -1 with this too, so size<LIMIT not <=.
15026
15027 2001-03-07  Torbjorn Granlund  <tege@swox.com>
15028
15029         * mpn/cray/cfp/mul_1.c: Don't call mpn_add_n with size 0.
15030         * mpn/cray/cfp/addmul_1.c: Likewise.
15031         * mpn/cray/cfp/submul_1.c: Don't call mpn_sub_n with size 0.
15032
15033         * tests/mpz/t-div_2exp.c (check_various): Start 2nd d loop from 0
15034         (avoid problems with Cray compilers).
15035
15036 2001-03-06  Torbjorn Granlund  <tege@swox.com>
15037
15038         * mpn/cray/ieee/submul_1.c: Don't call mpn_sub_n with size 0.
15039
15040         * mpn/cray/ieee/mul_basecase.c: New file.
15041         * mpn/cray/ieee/sqr_basecase.c: New file, derived from mul_basecase.c.
15042
15043 2001-03-06  Kevin Ryde  <kevin@swox.se>
15044
15045         * tests/devel/try.c (pointer_setup): Allow dst_size == SIZE_SIZE2 for
15046         the benefit of mpn_tdiv_qr.
15047
15048         * tune/tuneup.c (all): Start karatsuba probing at size==4, for the
15049         benefit of cray t90 ieee which has speed oddities at size==2.
15050
15051         * gmp-impl.h (USE_LEADING_REGPARM): Use __GMP_GNUC_PREREQ.
15052         Use __GMP_ATTRIBUTE_PURE and ATTRIBUTE_CONST in a few places.
15053
15054         * gmp-h.in (__GMP_GNUC_PREREQ) New macro.
15055         (__GMP_ATTRIBUTE_PURE): New macro, use it in many places.
15056
15057         * gmp-impl.h, gmp-h.in (mpn_jacobi_base): Move prototype to
15058         gmp-impl.h, use ATTRIBUTE_CONST.
15059
15060         * tune/speed.h (speed_cyclecounter): Inline asm version for i386.
15061
15062         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Only reread "up" after second
15063         realloc, first is under w!=u.
15064
15065 2001-03-05  Torbjorn Granlund  <tege@swox.com>
15066
15067         * mpn/cray/sub_n.c: Rewrite using `majority' logic.
15068
15069         * mpz/cfdiv_r_2exp.c (cfdiv_r_2exp): Reread `up' after realloc of w.
15070
15071         * mpn/cray/ieee/mul_1.c: Rewrite.  Streamline multiplications;
15072         use `majority' logic.
15073         * mpn/cray/ieee/addmul_1.c: Likewise.
15074
15075         * mpn/cray/add_n.c: Rewrite using `majority' logic.
15076
15077 2001-03-04  Torbjorn Granlund  <tege@swox.com>
15078
15079         * longlong.h (CRAY udiv_qrnnd): No longer conditional on CRAYMPP.
15080         (64-bit hppa add_ssaaaa): New.
15081         (64-bit hppa sub_ddmmss): New.
15082
15083         * mpn/cray/ieee/invert_limb.c: New file.
15084
15085         * gmp-impl.h (RANDS): Add a `,0' to make it compile on more compilers.
15086
15087 2001-03-03  Kevin Ryde  <kevin@swox.se>
15088
15089         * mpz/n_pow_ui.c (ULONG_PARITY): Move to gmp-impl.h.
15090         * gmp-impl.h (ULONG_PARITY): i386 part from n_pow_ui.c, new generic
15091         form by Torbjorn.
15092
15093         * tests/mpz/t-div_2exp.c: New file, rewrite of t-2exp.c.
15094         * tests/mpz/t-2exp.c: Remove file.
15095         * tests/mpz/Makefile.am (check_PROGRAMS): Update.
15096
15097         * gmp-h.in (mpz_cdiv_q_2exp, mpz_cdiv_q_2exp): Add prototypes.
15098         * gmp.texi (Integer Division): Add mpz_cdiv_q_2exp and mpz_cdiv_q_2exp.
15099
15100         * mpz/cfdiv_q_2exp.c: New file, partial rewrite of fdiv_q_2exp.c, add
15101         mpz_cdiv_q_2exp entrypoint.
15102         * mpz/cfdiv_r_2exp.c: New file, rewrite of fdiv_r_2exp.c, use all mpn,
15103         add mpz_cdiv_r_2exp entrypoint.
15104         * mpz/fdiv_q_2exp.c, mpz/fdiv_r_2exp.c: Remove files.
15105         * mpz/Makefile.am (libmpz_la_SOURCES): Update.
15106         * Makefile.am (MPZ_OBJECTS): Ditto.
15107
15108         * gmp-impl.h (USE_LEADING_REGPARM): Use __i386__ same as longlong.h
15109         (REGPARM_2_1, REGPARM_3_1, REGPARM_ATTR): New macros.
15110         * mpz/jacobi.c (jac_or_kron): Use them.
15111
15112         * configure.in (HAVE_ABI_$ABI): Re-enable this for config.m4, with
15113         dots changed to underscores (necessary for hppa).
15114
15115         * tests/mpz/t-divis.c, tests/mpz/t-divis_2exp.c: New files.
15116         * tests/mpz/Makefile.am (check_PROGRAMS): Add them.
15117
15118         * gmp-h.in (mpz_divisible_p, mpz_divisible_ui_p,
15119         mpz_divisible_2exp_p): Add prototypes.
15120         * gmp.texi (Integer Division): Add mpz_divisible_p.
15121         (Efficiency): Add remarks about divisibility testing.
15122
15123         * mpz/divis.c, mpz/divis_ui.c, mpz/divis_2exp.c: New files.
15124         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
15125         * Makefile.am (MPZ_OBJECTS): Ditto.
15126
15127         * mpn/generic/divis.c: New file.
15128         * configure.in (gmp_mpn_functions): Add it.
15129         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Ditto.
15130         * gmp-impl.h (mpn_divisible_p): Add prototype.
15131
15132         * urandom.h: Remove file.
15133         * Makefile.am (EXTRA_DIST): Remove it.
15134
15135         * tests/mpz/convert.c, dive.c, io.c, logic.c, reuse.c, t-2exp.c,
15136         t-fdiv.c, t-fdiv_ui.c, t-gcd.c, t-jac.c, t-mul.c, t-pow.c,
15137         t-powm.c, t-powm_ui.c, t-root.c, t-sqrtrem.c, t-tdiv.c,
15138         t-tdiv_ui.c: Use RANDS, initialized by tests_rand_start.
15139
15140         * tests/mpz/t-pow.c: New file, being t-pow_ui renamed and with some
15141         further tests added.
15142         * tests/mpz/t-pow_ui.c: Remove file.
15143         * tests/mpz/Makefile.am (check_PROGRAMS): Update.
15144
15145         * tests/t-modlinv.c: Don't use urandom.h.
15146         * tests/mpz/bit.c, tests/mpz/t-scan.c: Ditto.
15147         * tests/mpq/t-cmp.c, tests/mpq/t-cmp_ui.c, tests/mpq/t-get_d.c: Ditto.
15148         * tests/mpf/reuse.c, t-add.c, t-conv.c, t-dm2exp.c, t-muldiv.c,
15149         t-sqrt.c, t-sub.c: Ditto.
15150
15151         * tests/misc.c (tests_rand_start, tests_rand_end): New functions.
15152         (tests_start, tests_end): Use them.
15153         (urandom): New function.
15154         * tests/tests.h: Add prototypes.
15155
15156         * mpz/random.c: Rewrite using mpz_urandomb and RANDS.
15157         * mpn/generic/random.c: Rewrite using _gmp_rand and RANDS.
15158         * mpn/generic/random2.c: Use RANDS not random() etc.
15159
15160         * gmp-impl.h (__gmp_rands, __gmp_rands_initialized): Add externs.
15161         (gmp_randstate_ptr): New typedef.
15162         (RANDS, RANDS_CLEAR): New macros.
15163
15164         * rands.c: New file.
15165         * Makefile.am (libgmp_la_SOURCES): Add it.
15166
15167         * configure.in (mpn_objs_in_libmp): New AC_SUBST.
15168         * Makefile.am (libmp_la_DEPENDENCIES): Use it.
15169
15170 2001-03-02  Torbjorn Granlund  <tege@swox.com>
15171
15172         * mpn/pa64/udiv_qrnnd.asm: New file.
15173
15174 2001-03-01  Kevin Ryde  <kevin@swox.se>
15175
15176         * mpbsd/rpow.c: New file.
15177         * mpbsd/Makefile.am (libmpbsd_la_SOURCES): Add it
15178         (nodist_libmpbsd_la_SOURCES): Remove pow_ui.c.
15179         * Makefile.am (MPBSD_OBJECTS): Add rpow.lo, remove pow_ui.lo.
15180         (libmp_la_DEPENDENCIES): Add mpz/n_pow_ui.lo.
15181
15182         * mpz/ui_pow_ui.c: Rewrite using mpz_n_pow_ui.
15183         * mpz/pow_ui.c: Ditto, and no longer provide rpow for mpbsd.
15184
15185         * mpz/n_pow_ui.c: New file, rewrite of pow_ui.c and ui_pow_ui.c.  Use
15186         less temporary memory, strip factors of 2 from the base, use mpn_mul_2
15187         if available.
15188         * mpz/si_pow_ui.c: New file.
15189         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
15190         * Makefile.am (MPZ_OBJECTS): Ditto.
15191         * gmp-impl.h (mpz_n_pow_ui): Add prototype.
15192         * gmp-h.in (mpz_si_pow_ui): Add prototype.
15193         * gmp.texi (Integer Exponentiation): Add mpz_si_pow_ui.
15194
15195         * acinclude.m4 (GMP_C_SIZES): Add BITS_PER_ULONG.
15196         Correction to mp_limb_t working check.
15197         * configure.in (limb_chosen): New variable.
15198         * tests/t-constants.c (BITS_PER_ULONG): Check this value.
15199         Add some reminders about tests that fail on Cray.
15200
15201         * tests/refmpn.c (refmpn_mul_2): New function.
15202         * tests/refmpz.c (refmpz_pow_ui): Copied from tests/mpz/t-pow_ui.c
15203         * tests/tests.h: Add prototypes.
15204
15205         * configure.in (none-*-*): Add ABI=longlong.
15206         * doc/configuration (Long long limb testing): Describe it.
15207
15208         * gmp.texi (Low-level Functions): Move some commented out remarks ...
15209         * mpn/generic/mul_basecase.c: ... to here.
15210
15211         * mpn/x86/README: Note "%=" as an alternative to "1:" in __asm__.
15212
15213         * tests/trace.c (mp_trace_start): Print "bin" for binary.
15214
15215         * mpn/generic/dump.c: Add a couple of casts to keep gcc quiet.
15216
15217         * gmp-h.in (mpn_incr_u, mpn_decr_u): Add parens around arguments.
15218
15219         * mpbsd/mout.c, mpbsd/mtox.c (num_to_text): Remove unused variable.
15220
15221         * mpfr/set_d.c (mpfr_get_d2): Declare "q" for 64-bit limbs.
15222
15223 2001-02-28  Torbjorn Granlund  <tege@swox.com>
15224
15225         * mpn/pa64w/udiv_qrnnd.asm: Tune.
15226
15227 2001-02-27  Torbjorn Granlund  <tege@swox.com>
15228
15229         * mpn/pa64w/udiv_qrnnd.asm: New file.
15230
15231 2001-02-26  Torbjorn Granlund  <tege@swox.com>
15232
15233         * longlong.h (arm): Optimize sub_ddmmss by testing for constant
15234         operands.
15235         * mpn/arm/invert_limb.asm: New file.
15236
15237 2001-02-24  Torbjorn Granlund  <tege@swox.com>
15238
15239         * mpn/generic/lshift.c: Rewrite.
15240         * mpn/generic/rshift.c: Rewrite.
15241
15242         * longlong.h: Use UWtype for external interfaces that expect mp_limb_t.
15243
15244         * longlong.h (arm): #define invert_limb.
15245
15246         * mpn/arm: Make labels have local scope.
15247
15248         * configure.in (arm*-*-*): Set extra_functions.
15249         * longlong.h (arm): #define udiv_qrnnd.
15250         * mpn/arm/udiv.asm: New file.
15251
15252 2001-02-24  Kevin Ryde  <kevin@swox.se>
15253
15254         * tune/many.pl: Add mpn_count_leading_zeros, mpn_count_trailing_zeros
15255         and mpn_invert_limb.  Add count_leading_zeros, count_trailing_zeros
15256         from a .h file.  Correction to modexact_1_odd prototype.  Support
15257         ansi2knr.
15258         * tune/speed.h, tune/common.c: Consequent changes.
15259
15260         * demos/expr/*: Make a few more functions available in expressions,
15261         create only libexpr.a, misc minor updates.
15262
15263         * mpn/Makeasm.am: Add some comments about suffix ordering.
15264
15265         * tests/refmpn.c (rshift_make, lshift_make): No need to compare
15266         unsigned to zero.
15267
15268         * mpq/mul.c: Detect and optimize squaring.
15269
15270 2001-02-23  Torbjorn Granlund  <tege@swox.com>
15271
15272         * mpn/mips3: Convert files to `.asm'.
15273
15274         * mpn/arm: Convert files to `.asm'.  Misc cleanups.
15275         * mpn/arm/submul_1.asm: New file.
15276
15277 2001-02-21  Kevin Ryde  <kevin@swox.se>
15278
15279         * tune/tuneup.c (all): Only one compiler print should match, no need
15280         for #undef PRINTED_COMPILER.
15281
15282         * mpfr/mpfr.h (mpfr_sgn): Use mpfr_cmp_ui (patch from Paul).
15283
15284         * mpz/fib_ui.c: Update some remarks about alternative algorithms.
15285         * gmp.texi (Fibonacci Numbers Algorithm): Ditto.
15286         (Assigning Floats): Clarify mpf_swap swaps the precisions too.
15287         (Low-level Functions): Try to be clearer about negative cofactors.
15288
15289 2001-02-21  Torbjorn Granlund  <tege@swox.com>
15290
15291         * mpn/sparc64/copyi.asm: Streamline for small operands.
15292         * mpn/sparc64/add_n.asm: Likewise.
15293         * mpn/sparc64/sub_n.asm: Likewise.
15294
15295         * mpn/sparc64/copyd.asm: New file.
15296
15297 2001-02-20  Torbjorn Granlund  <tege@swox.com>
15298
15299         * mpn/sparc64/lshift.asm: Rewrite.
15300         * mpn/sparc64/rshift.asm: Rewrite.
15301
15302 2001-02-19  Torbjorn Granlund  <tege@swox.com>
15303
15304         * mpn/sparc64/add_n.asm: Rewrite using `majority' logic.
15305         * mpn/sparc64/sub_n.asm: Likewise.
15306
15307         * tune/tuneup.c (all): Recognise DECC and MIPSpro compilers.
15308
15309         * mpn/pa64/sqr_diagonal.asm: Use PROLOGUE/EPILOGUE.
15310         * mpn/pa642/sqr_diagonal.asm: Likewise.
15311
15312         * configure.in (HAVE_ABI_$abi): Disable for now.
15313
15314         * mpn/asm-defs.m4 (PROLOGUE): Use LABEL_SUFFIX.
15315
15316         * acinclude.m4 (GMP_ASM_ATTR): New check, for hppa oddities.
15317
15318 2001-02-18  Torbjorn Granlund  <tege@swox.com>
15319
15320         * mpn/hppa/hppa1_1/gmp-mparam.h: New file.
15321         * mpn/hppa/hppa2_0/gmp-mparam.h: New file.
15322
15323         * mpn/pa64/sqr_diagonal.asm: New file.
15324         * mpn/pa64w/sqr_diagonal.asm: New file.
15325         * mpn/hppa/hppa1_1/sqr_diagonal.asm: New file.
15326         * mpn/hppa/hppa2_0/sqr_diagonal.asm: New file.
15327
15328         * mpn/sparc32/v9/add_n.asm: Use `fitod' instead of `fxtod' for dummy
15329         FA-pipeline insns.
15330         * mpn/sparc32/v9/sub_n.asm: Likewise.
15331
15332 2001-02-18  Kevin Ryde  <kevin@swox.se>
15333
15334         * gmp.texi (Known Build Problems): Notes on make, $* and K&R, misc
15335         tweaks elsewhere.
15336         (Low-level Functions): Use {} notation in mpn_sqrtrem.
15337         (Basecase Multiplication): Mention BASECASE_SQR_THRESHOLD.
15338
15339         * mpfr/isnan.c (mpfr_number_p): Infinity is not a number.
15340         * mpfr/out_str.c: Pass strlen+1 for the block size to free.
15341         * mpfr/get_str.c: Correction for realloc to strlen+1.
15342
15343         * acinclude.m4 (GMP_C_SIZES): Generate an error if mp_limb_t doesn't
15344         seem to work for some reason.
15345
15346 2001-02-16  Torbjorn Granlund  <tege@swox.com>
15347
15348         * mpn/sparc32/v9/gmp-mparam.h: Retune.
15349
15350         * mpn/sparc32/v9/add_n.asm: New file.
15351         * mpn/sparc32/v9/sub_n.asm: New file.
15352
15353         * mpn/sparc32/v9/mul_1.asm: Tune function entry.
15354         * mpn/sparc32/v9/addmul_1.asm: Likewise.
15355         * mpn/sparc32/v9/submul_1.asm: Likewise.
15356
15357         * mpn/sparc32/v9/sqr_diagonal.asm: New file.
15358
15359 2001-02-16  Kevin Ryde  <kevin@swox.se>
15360
15361         * configure.in: Fix flags selection when $CC is a compiler known to us.
15362
15363         * demos/expr/exprfr.c (e_mpfr_cos, e_mpfr_sin): mpfr_sin_cos now
15364         allows NULL for one parameter.
15365
15366         * mpfr/*: Update to 20010215.
15367         * mpfr/trunc.c: Use -DOPERATION scheme, and gmp mpn_zero_p.
15368         * mpfr/sqrt.c: Use plain mpn_sqrtrem, not mpn_sqrtrem_new.
15369         * mpfr/sqrtrem.c: Remove file.
15370         * mpfr/Makefile.am (libmpfr_a_SOURCES): Add isnan.c and set_ui.c,
15371         remove sqrtrem.c and srandom.h.
15372
15373         * configfsf.guess: Update to 2001-02-13.
15374         * configfsf.sub: Update to 2001-02-16.
15375         * config.sub (j90, t90): Remove special handing, configfsf.sub now ok.
15376
15377         * Makefile.am (MPF_OBJECTS): Add a couple of missing $U's.
15378
15379         * tune/tuneup.c: Identify compiler used (GCC and Sun C so far).
15380
15381 2001-02-15  Torbjorn Granlund  <tege@swox.com>
15382
15383         * mpn/sparc32/v9/mul_1.asm: Change `ld' to `lduw' and `st' to `stw'.
15384         * mpn/sparc32/v9/addmul_1.asm: Likewise.
15385         * mpn/sparc32/v9/submul_1.asm: Likewise.
15386
15387 2001-02-14  Torbjorn Granlund  <tege@swox.com>
15388
15389         * mpn/mips3/mips.m4: New file.
15390         * configure.in (mips*-*-irix[6789]*): Use mips3/mips.m4.
15391
15392         * mpn/powerpc64/sqr_diagonal.asm: New file.
15393
15394         * mpn/mips3/sqr_diagonal.asm: New file.
15395
15396 2001-02-12  Torbjorn Granlund  <tege@swox.com>
15397
15398         * mpn/powerpc32/sqr_diagonal.asm: New file.
15399
15400         * mpn/generic/sqr_basecase.c: Remove declaration of mpn_sqr_diagonal.
15401         Fix typo in header comment.
15402
15403 2001-02-12  Kevin Ryde  <kevin@swox.se>
15404
15405         * mpn/generic/mul.c, mpn/generic/mul_n.c, gmp-impl.h: Use
15406         mpn_mul_basecase for squaring below new BASECASE_SQR_THRESHOLD.
15407         * tune/tuneup.c gmp-impl.h: Tune BASECASE_SQR_THRESHOLD.
15408
15409         * Makefile.am (libgmp.la, libmp.la): Revert change to build from
15410         mpn/libmpn.la etc, go back to explicitly listed objects.
15411
15412         * configure.in: Recognise sparc64-*-*, not just sparc64-*-linux*.
15413
15414 2001-02-11  Torbjorn Granlund  <tege@swox.com>
15415
15416         * mpn/asm-defs.m4 (sqr_diagonal): New define_mpn.
15417
15418         * mpn/alpha/sqr_diagonal.asm: New file.
15419
15420 2001-02-11  Kevin Ryde  <kevin@swox.se>
15421
15422         * gmp.texi (Low-level Functions): Note mpn_get_str clobbers its input
15423         plus 1 extra limb.
15424
15425         * mpfr/add.c,agm.c,exp2.c,exp3.c,generic.c,log2.c,pi.c,print_raw.c,
15426         set_d.c,sin_cos.c,sqrtrem.c,sub.c: Apply some tweaks for K&R.
15427         * tests/mpz/reuse.c, tests/mpq/t-md_2exp.c, demos/pexpr.c,
15428         demos/expr/t-expr.c: Ditto.
15429
15430         * configure.in (HAVE_ABI_$abi): New define in config.m4.
15431
15432         * gmp-impl.h (mpn_sqr_diagonal): Add prototype and define.
15433         * tune/speed.c,speed.h,common.c,many.pl: Add measuring of
15434         mpn_sqr_diagonal.
15435
15436         * gmp.texi, acinclude.m4: Mention x86 solaris 2.7 has the reg->reg
15437         movq bug the same as 2.6.
15438
15439         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr-test.h and mpf2mpfr.h.
15440
15441         * mpn/x86/README: Merge contents of README.family.
15442         * mpn/x86/README.family: Remove file.
15443
15444         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add mode1o, gcd_finda,
15445         invert_limb, sqr_diagonal; remove mod_1_rs; sort alphabetically.
15446
15447 2001-02-10  Torbjorn Granlund  <tege@swox.com>
15448
15449         * configure.in (gmp_mpn_functions_optional): List sqr_diagonal.
15450
15451         * mpn/powerpc32/aix.m4: Use unnamed csects.
15452         * mpn/powerpc64/aix.m4: Likewise.
15453
15454         * acconfig.h: Add #undef of mpn_sqr_diagonal.
15455         Remove lots of spacing.
15456
15457         * configure.in (syntax testing section): Match power* instead of
15458         powerpc*.
15459         * mpn/power: Convert files to `.asm'.
15460         Prefix umul_ppmm and sdiv_qrnnd.
15461         Update some comments.
15462
15463 2001-02-09  Kevin Ryde  <kevin@swox.se>
15464
15465         * acconfig.h: Add HAVE_NATIVE_mpn_modexact_1_odd and
15466         HAVE_NATIVE_mpn_modexact_1c_odd.
15467
15468         * configure.in (CCAS): Don't override a user selection.
15469
15470         * mpq/cmp_ui.c: DIVIDE_BY_ZERO if den2==0.
15471
15472 2001-02-08  Torbjorn Granlund  <tege@swox.com>
15473
15474         * mpn/generic/sqr_basecase.c: Use mpn_sqr_diagonal when appropriate.
15475
15476 2001-02-07  Kevin Ryde  <kevin@swox.se>
15477
15478         * gmp.texi (Low-level Functions): mpn_preinv_mod_1 now undocumented.
15479
15480         * mpn/generic/random2.c (myrandom): Use rand() on mingw.
15481
15482         * mpn/alpha/gmp-mparam.h: Update tuned parameters.
15483
15484 2001-02-05  Torbjorn Granlund  <tege@swox.com>
15485
15486         * mpn/alpha/ev6/gmp-mparam.h: Retune.
15487
15488 2001-02-05  Kevin Ryde  <kevin@swox.se>
15489
15490         * Makefile.am (libgmp, libmp): Construct from mpn/libmpn.la etc rather
15491         than explicitly listed objects.
15492
15493         * urandom.h: Use rand() on mingw.
15494
15495         * mpn/powerpc64/lshift.asm,addsub_n.asm: Use r1 not 1.
15496
15497 2001-02-04  Torbjorn Granlund  <tege@swox.com>
15498
15499         * mpn/ia64/copyi.asm: New file.
15500         * mpn/ia64/copyd.asm: New file.
15501
15502 2001-02-04  Kevin Ryde  <kevin@swox.se>
15503
15504         * mpn/alpha/ev5/gmp-mparam.h, mpn/mips3/gmp-mparam.h,
15505         mpn/powerpc32/gmp-mparam.h, mpn/powerpc64/gmp-mparam.h,
15506         mpn/sparc64/gmp-mparam.h, mpn/x86/*/gmp-mparam.h:
15507         Update tuned parameters.
15508
15509         * mpn/x86/i486: New directory.
15510         * configure.in (i486-*-*): Use it.
15511         * mpn/x86/i486/gmp-mparam.h: New file.
15512
15513         * mpn/x86/pentium/mode1o.asm: New file.
15514         * mpn/x86/p6/mode1o.asm: New file.
15515
15516         * tune/many.pl: Use $(ASMFLAGS_PIC) and $(CFLAGS_PIC).
15517
15518         * gmp.texi (Integer Division): Another rewording of 2exp divisions.
15519
15520 2001-02-03  Torbjorn Granlund  <tege@swox.com>
15521
15522         * mpn/arm/gmp-mparam.h: Tune.
15523
15524         * mpn/ia64/popcount.asm: Put a `;;' break at end of main loop.
15525
15526         * configure.in (arm*-*-*): Set gcc_cflags in order to pass
15527         $fomit_frame_pointer.
15528
15529         * tests/mpz/t-mul.c (base_mul): Remove an unused variable.
15530
15531 2001-02-02  Torbjorn Granlund  <tege@swox.com>
15532
15533         * demos/pexpr.c (TIME): New macro.
15534         (main): Use TIME--print timing more accurately.
15535         (setup_error_handler): Increase RLIMIT_DATA to 16 Mibyte.
15536
15537         * longlong.h (arm): Add __CLOBBER_CC to add_ssaaaa and sub_ddmmss.
15538
15539 2001-02-02  Kevin Ryde  <kevin@swox.se>
15540
15541         * configure.in: Don't remove gmp-mparam.h and mpn source links under
15542         --no-create since in that case they're not re-created.
15543
15544         * demos/expr: New directory.
15545         * Makefile.am (SUBDIRS, allprogs): Add it.
15546         * demos/expr/README, Makefile.am, expr.c, exprv.c, exprz.c, exprza.c,
15547         exprq.c, exprqa.c, exprfa.c, exprf.c, exprfr.c, exprfra.c, expr.h,
15548         expr-impl-h.in, run-expr.c, t-expr.c: New files.
15549         * configure.in: Generate demos/expr/Makefile & demos/expr/expr-impl.h.
15550
15551         * Makefile.am: Remove mpfr from main libgmp.
15552         * mpfr/Makefile.am: Build and install separate libmpfr.a.
15553         * mpfr/*: Update to mpfr 2001.
15554
15555         * gmp-h.in (__GNU_MP_VERSION_MINOR): Bump to 2.
15556         * Makefile.am (libtool -version-info): Bump appropriately.
15557         * NEWS: Updates.
15558
15559         * tune/divrem1div.c, tune/divrem1inv.c, tune/divrem2div.c,
15560         tune/divrem2inv.c: Renamed from divrem_1_div.c, divrem_1_inv.c,
15561         divrem_2_div.c, divrem_2_inv.c, to be unique in DOS 8.3 filenames.
15562         * tune/Makefile.am (libspeed_la_SOURCES): Update.
15563
15564         * mpn/x86/*/README, mpn/x86/README.family: Misc updates.
15565         * tune/README: Misc updates.
15566         * doc/configuration: Misc updates.
15567
15568         * mpn/x86/pentium/mmx/gmp-mparam.h: Change UDIV_PREINV_TIME to
15569         UDIV_NORM_PREINV_TIME.
15570
15571         * mpz/pprime_p.c: Use ASSERT_ALWAYS instead of abort.
15572
15573         * rand.c (__gmp_rand_lc_scheme): Add "const".
15574         (struct __gmp_rand_lc_scheme_struct): Make astr "const char *".
15575
15576         * demos/calc/calc.y, demos/calc/calclex.l: Add kron function.
15577
15578         * tests/devel/try.c: Partial rewrite, new scheme of function types,
15579         allow result validation functions, add sqrtrem and jacobi testing.
15580         * tune/many.pl: Corresponding updates.
15581         * tests/devel/Makefile.am: Add a convenience rule for libtests.la.
15582
15583         * tests/refmpz.c: New file.
15584         * tests/Makefile.am: Add it.
15585         * tests/misc.c (mpz_erandomb, mpz_erandomb_nonzero): New functions.
15586         * tests/tests.h: Add prototypes.
15587
15588         * mpn/x86/k6/cross.pl: Add a couple more exceptions.
15589
15590         * gmp.texi: Don't use @nicode{'\0'}, it doesn't come out right in tex.
15591         (Introduction to GMP): Mention Cray vector systems.
15592         (Build Options): Describe --enable-mpfr, refer to its manual.  Add
15593         Crays under supported CPUs.
15594         (Debugging): Add notes on source file paths.
15595         (Autoconf): New section.
15596         (Assigning Integers): Note truncation by mpz_set_d, mpz_set_q and
15597         mpz_set_f.
15598         (Converting Integers): Note the size mpz_get_str allocates.
15599         (Floating-point Functions): Rewrite introduction, clarifying some
15600         points about precision handling.
15601         (Converting Floats): Note the size mpf_get_str allocates, and that it
15602         gives an empty string for zero.  Add mpf_get_si and mpf_get_ui.
15603         (Float Comparison): Give the formula mpf_reldiff calculates.
15604         (Miscellaneous Float Functions): Add mpf_integer_p and mpf_fits_*_p.
15605         (Random Number Functions): Misc rewordings for clarity.
15606         (Random State Initialization): Ditto.
15607         (Custom Allocation): Remove note on deallocate_function called with 0,
15608         misc rewording and clarifications.
15609         (Exact Remainder): New section.
15610         (Binary GCD): A few words on initial reduction using division.
15611         (Accelerated GCD): Refer to exact remainder section.
15612         (Extended GCD): Extra remarks on single versus double selection.
15613         (Jacobi Symbol): Update for mpz/jacobi.c rewrite and modexact_1_odd.
15614         (Modular Powering Algorithm): Refer to exact remainder section.
15615         (Assembler SIMD Instructions): Update remarks on MMX.
15616         (Contributors): Amend to "Divide and Conquer" division.
15617         (References): Tweak some formatting.  Add "Proof of GMP Fast Division
15618         and Square Root Implementations" by Paul Zimmermann.
15619
15620 2001-01-31  Torbjorn Granlund  <tege@swox.com>
15621
15622         * configure.in: Don't ever pass -mips3; let ABI flags imply ISA.
15623
15624 2001-01-31  Kevin Ryde  <kevin@swox.se>
15625
15626         * tune/time.c: Remove unnecessary longlong.h.
15627         (speed_endtime): Add some extra diagnostics.
15628
15629         * tests/mpz/t-fdiv_ui.c, tests/mpz/t-tdiv_ui.c: Use unsigned long for
15630         the divisor, not mp_limb_t.
15631         * tests/mpz/t-jac.c (try_base): Use %llu for long long limb.
15632         * tests/trace.c: Add <string.h> for strlen.
15633
15634         * tune/freq.c (speed_cpu_frequency_proc_cpuinfo): Ignore "cycle
15635         frequency" of 0, allow "BogoMIPS" as well as "bogomips".
15636
15637         * macos/Makefile.in: Add mpf/fits_s.c and mpf/fits_u.c objects.
15638
15639 2001-01-30  Torbjorn Granlund  <tege@swox.com>
15640
15641         * longlong.h: Add add_ssaaaa and sub_ddmmss for 64-bit sparc.
15642
15643 2001-01-29  Torbjorn Granlund  <tege@swox.com>
15644
15645         * mpn/powerpc64/addmul_1.asm: Prefix registers with an `r'.
15646         * mpn/powerpc64/submul_1.asm: Likewise.
15647         * mpn/powerpc64/mul_1.asm: Likewise.
15648
15649         * configure.in (alpha*-*-*): Amend last change to handle pca*.
15650
15651 2001-01-29  Kevin Ryde  <kevin@swox.se>
15652
15653         * tune/speed.h (SPEED_ROUTINE_INVERT_LIMB_CALL): Don't let the
15654         compiler optimize everything away.
15655
15656         * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Measure
15657         operator_div, operator_mod, mpn_divrem_2_div, mpn_divrem_2_inv,
15658         mpn_sb_divrem_m3, mpn_sb_divrem_m3_div, mpn_sb_divrem_m3_inv,
15659         mpn_dc_divrem_sb_div, mpn_dc_divrem_sb_inv.
15660         * tune/divrem_2_div.c, tune/divrem_2_inv.c, tune/sb_div.c,
15661         tune/sb_inv.c: New files.
15662
15663         * tune/tuneup.c, gmp-impl.h, tune/speed.h, tune/common.c,
15664         tune/Makefile.am: Tune SB_PREINV_THRESHOLD and DIVREM_2_THRESHOLD.
15665
15666         * mpn/generic/divrem_2.c: Use new DIVREM_2_THRESHOLD.
15667         * mpn/generic/sb_divrem_mn.c: Use new SB_PREINV_THRESHOLD.
15668
15669         * mpn/x86/p6/mmx/lshift.asm, mpn/x86/p6/mmx/rshift.asm: New files,
15670         just m4 include()ing the P55 code.
15671         * configure.in (pentium[23]-*-*): Remove x86/pentium/mmx from path.
15672
15673 2001-01-27  Kevin Ryde  <kevin@swox.se>
15674
15675         * configure.in (AC_CHECK_FUNCS): Add srand48.
15676         * tune/speed.c: Use this test.
15677
15678         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): Allow "egcs-" prefix on gcc
15679         --version, warn if the format is unrecognised.
15680         (GMP_COMPARE_GE): Guard against empty $1 not only on last arg.
15681         (GMP_INIT, GMP_FINISH, GMP_PROG_M4): Obscure or eliminate literal
15682         "dnl"s since autoconf thinks they indicate faulty macros.
15683
15684         * mpz/get_str.c, mpf/get_str.c: Make allocated string block exactly
15685         strlen(str)+1 bytes.
15686         * mpz/dump.c, mpf/dump.c, tests/mpz/convert.c: Use this size when
15687         freeing.
15688         * tests/mpf/t-conv.c: Ditto, and ensure x==0 is exercised.
15689
15690         * tests/mpz/t-fits.c: New file.
15691         * tests/mpz/Makefile.am: Add it.
15692
15693         * tests/mpf/t-fits.c: New file.
15694         * tests/mpf/t-get_si.c: New file.
15695         * tests/mpf/t-int.c: New file.
15696         * tests/mpf/Makefile.am: Add them.
15697
15698         * mpf/fits_s.c: New file.
15699         * mpf/fits_u.c: New file.
15700         * mpf/get_si.c: New file.
15701         * mpf/get_ui.c: New file.
15702         * mpf/int_p.c: New file.
15703         * Makefile.am, mpf/Makefile.am: Add them.
15704         * gmp-h.in (mpf_fits_*_p, mpf_get_si, mpf_get_ui, mpf_integer_p): Add
15705         prototypes.
15706
15707         * tests/memory.c (tests_allocate, tests_reallocate): Guard against
15708         size==0.
15709
15710         * tests/mpz/*.c, tests/mpq/*.c, tests/mpf/*.c: Uses tests_start and
15711         tests_end.
15712
15713         * gmp-impl.h (USE_LEADING_REGPARM): Fix conditionals.
15714
15715 2001-01-23  Kevin Ryde  <kevin@swox.se>
15716
15717         * configure.in, mpn/Makeasm.am (ASMFLAGS_PIC): New substitution,
15718         allowing -DPIC to be suppressed on cygwin.
15719         (CFLAGS_PIC): New substitution, use it and $(CCAS) directly, rather
15720         than $(LIBTOOL), avoiding a problem with FreeBSD 2.2.8.
15721
15722         * mpn/x86/k6/mode1o.asm, mpn/x86/k7/mode1o.asm: Remove an unnecessary
15723         +[.-L(here)] from _GLOBAL_OFFSET_TABLE_, avoids a segv from gas 1.92.3.
15724         * mpn/x86/README.family: Add notes on the problem.
15725
15726 2001-01-20  Torbjorn Granlund  <tege@swox.com>
15727
15728         * configure.in (alpha*-*-*): Default `flavour' to ev4.
15729
15730 2001-01-19  Kevin Ryde  <kevin@swox.se>
15731
15732         * assert.c, gmp-impl.h (__gmp_assert_fail): Change return type to
15733         void, since it's no longer used in expressions.
15734
15735         * mpn/x86/addsub_n.S: Remove file, since it doesn't work and it upsets
15736         tune/many.pl.
15737
15738         * mpz/jacobi.c: Rewrite, but still binary algorithm; accept zero and
15739         negative denominators; merge mpz_jacobi and mpz_legendre, add
15740         mpz_kronecker; use mpn directly, add special cases for size==1.
15741         * gmp.texi (Number Theoretic Functions): Update.
15742         * gmp-h.in (mpz_kronecker): Add prototype.
15743         * gmp-impl.h (USE_LEADING_REGPARM): New macro.
15744         * tests/mpz/t-jac.c: Test mpz_kronecker.
15745         * mpz/legendre.c: Remove file.
15746         * Makefile.am, mpz/Makefile.am: Update.
15747
15748         * longlong.h (alpha count_leading_zeros): Use __attribute__ ((const))
15749         when possible, add parameter to prototype.
15750         (ia64 udiv_qrnnd): Use for all compilers, not just gcc.
15751         (pentium count_trailing_zeros): Use count_leading_zeros.
15752
15753         * acinclude.m4 (GMP_C_ATTRIBUTE_CONST, GMP_C_ATTRIBUTE_NORETURN): New
15754         macros.
15755         * configure.in: Use them.
15756         * gmp-impl.h (ATTRIBUTE_CONST, ATTRIBUTE_NORETURN): New macros.
15757         (mpn_invert_limb): Add ATTRIBUTE_CONST.
15758         (__gmp_assert_fail): Add ATTRIBUTE_NORETURN.
15759
15760 2001-01-18  Kevin Ryde  <kevin@swox.se>
15761
15762         * gmp-h.in, gmp-impl.h (__gmp_allocate_func, __gmp_reallocate_func,
15763         __gmp_free_func): Move prototypes from gmp-impl.h to gmp-h.in, for the
15764         benefit of gmp++.h.
15765
15766         * gmp-impl.h, tests/misc.c, tests/tests.h: Move MPZ_SET_STR_OR_ABORT
15767         and MPF_SET_STR_OR_ABORT to mpz_set_str_or_abort and
15768         mpf_set_str_or_abort in libtests.
15769         * tests/mpz/convert.c, tests/mpz/t-bin.c, tests/mpz/t-get_si.c,
15770         tests/mpz/t-jac.c, tests/mpz/t-misc.c, tests/mpq/t-md_2exp.c,
15771         tests/mpq/t-set_f.c, tests/mpf/t-conv.c, tests/mpf/t-misc.c: Update.
15772
15773         * mpn/generic/sqrtrem.c: Use MPN_COPY_INCR (for when rp==NULL).
15774
15775         * tests/mpz/reuse.c: Only run mpz_divexact_gcd on positive divisors.
15776
15777 2001-01-18  Torbjorn Granlund  <tege@swox.com>
15778
15779         * demos/pexpr.c (main): Accept -vml option.
15780         (fns): List `hamdist', `pow', `nextprime'.
15781         (mpz_eval_expr): Return -1 for `popc' of negative.
15782         (mpz_eval_expr): Handle `hamdist', `pow', `nextprime'.
15783
15784 2001-01-15  Kevin Ryde  <kevin@swox.se>
15785
15786         * mpn/alpha/ev5/mode1o.c: New file.
15787
15788         * tune/freq.c (speed_cpu_frequency_measure): Check cycles_works_p
15789         before running speed_cyclecounter.
15790         * tune/speed.h (cycles_works_p): Add prototype.
15791
15792 2001-01-13  Torbjorn Granlund  <tege@swox.com>
15793
15794         * tests/rand/t-rand.c (farr): Fix typo.
15795         (zarr): Fix typo.
15796
15797 2001-01-12  Kevin Ryde  <kevin@swox.se>
15798
15799         * mpz/kronsz.c: Don't depend on right shifting a negative.
15800
15801         * mpn/x86/gmp-mparam.h: New file.
15802
15803         * mpn/x86/pentium/mmx/mul_1.asm: New file.
15804
15805 2001-01-11  Torbjorn Granlund  <tege@swox.com>
15806
15807         * mpz/kronsz.c: Temporary workaround for Cray right shift oddities.
15808         Explicitly compare against zero in tests.
15809
15810 2001-01-10  Kevin Ryde  <kevin@swox.se>
15811
15812         * mpz/kronzs.c: Don't depend on right shifting a negative.
15813
15814 2001-01-09  Torbjorn Granlund  <tege@swox.com>
15815
15816         * tests/t-constants.c: Disable some undefined tests.
15817         (CHECK_MAX_S): Remove workaround for gcc 2.95.2 bug recently added.
15818
15819 2001-01-09  Kevin Ryde  <kevin@swox.se>
15820
15821         * tests/t-constants.c: Add more diagnostics.
15822         (CHECK_MAX_S): Fix for gcc 2.95.2 -mpowerpc64 -maix64.
15823
15824         * mpn/x86/k6/mode1o.asm: New file.
15825         * mpn/x86/k7/mode1o.asm: New file.
15826
15827         * mpn/asm-defs.m4 (modexact_1_odd, modexact_1c_odd): New define_mpn's.
15828         (__clz_tab, modlimb_invert_table, PROLOGUE, EPILOGUE): Add asserts for
15829         GSYM_PREFIX.
15830         * mpn/x86/x86-defs.m4 (Zdisp): Add a movzbl.
15831
15832         * tests/mpz/t-jac.c (check_a_zero): New test.
15833         (check_squares_zi): Fix to use (a^2/b), not (a*b/b); revert last
15834         change avoiding a,b=0, both are fine.
15835         (try_2den): Don't use mpz_kronecker_ui for the expected answer.
15836         (try_*): Call abort rather than exit.
15837
15838         * mpz/kronzu.c, mpz/kronzs.c: Fix for a=0.
15839
15840         * tune/tuneup.c (USE_PREINV_MOD_1): Fix to use new DATA_HIGH_LT_R.
15841
15842 2001-01-08  Torbjorn Granlund  <tege@swox.com>
15843
15844         * urandom.h: Amend 2000-11-21 change to also handle cygwin.
15845
15846 2001-01-08  Kevin Ryde  <kevin@swox.se>
15847
15848         * tune/many.pl: Updates for move to tests/devel, add modexact_1_odd,
15849         don't assume C files can't have carry-in entrypoints, remove
15850         $(TRY_TESTS_OBJS) now in libtests.
15851
15852         * tests/devel/try.c, tests/refmpn.c, tests/tests.h: Remove
15853         mpn_mod_1_rshift testing.
15854
15855         * tune/tuneup.c (fft_step_size): Test for overflow using the actual
15856         mp_size_t, don't use BITS_PER_INT.
15857
15858         * tune/speed.c (r_string): "r" is a limb, use BITS_PER_MP_LIMB and
15859         change LONG_ONES to LIMB_ONES.
15860         * tune/time.c (M_2POWU): Use INT_MAX rather than BITS_PER_INT.
15861
15862         * extract-dbl.c (BITS_PER_PART): Use BITS_PER_MP_LIMB not
15863         BITS_PER_LONGINT.
15864
15865         * mpz/inp_raw.c, mpz/out_raw.c: Add private defines of BITS_PER_CHAR.
15866         * mpz/fac_ui.c, tests/mpz/t-fac_ui.c: Don't use BITS_PER_LONGINT.
15867         * tests/mpz/t-get_si.c: Don't use BITS_PER_LONGINT, do the LONG_MAX
15868         tests with some explicit code.
15869
15870         * mpn/*/gmp-mparam.h, acinclude.m4, tests/t-constants.c
15871         (BITS_PER_LONGINT, BITS_PER_INT, BITS_PER_SHORTINT, BITS_PER_CHAR):
15872         Remove defines, remove probings, remove tests.
15873
15874         * tune/tuneup.c (MODEXACT_1_ODD_THRESHOLD): Add tuning.
15875
15876         * tune/speed.c,speed.h,common.c: Add measuring of mpn_modexact_1_odd,
15877         mpn_gcd_finda, and an "N" form for mpn_gcd_1.
15878
15879         * tests/mpz/t-jac.c (check_squares_zi): Ensure random a,b != 0.
15880
15881 2001-01-07  Kevin Ryde  <kevin@swox.se>
15882
15883         * configure.in (gmp_mpn_functions): Add mode1o, remove mod_1_rs.
15884
15885         * mpn/generic/mod_1_rs.c: Remove file, no longer needed.
15886         * gmp-h.in (mpn_mod_1_rshift): Remove prototype and define.
15887
15888         * mpq/set_f.c: Use MPN_STRIP_LOW_ZEROS_NOT_ZERO.
15889
15890         * mpz/kronzu.c, mpz/kronzs.c, mpz/kronuz.c, mpz/kronsz.c: Use
15891         mpn_modexact_1_odd, new style MPN_STRIP_LOW_ZEROS_NOT_ZERO, and new
15892         JACOBI macros.  Various rearrangements supporting all this.
15893
15894         * mpn/generic/gcd_1.c: Use mpn_modexact_1_odd, reduce u%v if u much
15895         bigger than v when size==1, some rearrangements supporting this.
15896
15897         * gmp-impl.h (JACOBI_*): More macros, add some casts to "int".
15898         (MPN_STRIP_LOW_ZEROS_NOT_ZERO): Add a "low" parameter.
15899         (mpn_modexact_1_odd, mpn_modexact_1c_odd): Add prototype and defines.
15900         (MODEXACT_1_ODD_THRESHOLD): New threshold.
15901         (MPN_MOD_OR_MODEXACT_1_ODD, JACOBI_MOD_OR_MODEXACT_1_ODD): New macros.
15902
15903         * mpn/generic/mode1o.c: New file.
15904
15905         * tests/mpz/reuse.c: Add testing of mpz_divexact_gcd.
15906         * tests/mpz/t-fac_ui.c: Use libtests for memory leak checking.
15907         * tests/mpz/t-fib_ui.c: Add a usage comment.
15908
15909         * tests/mpz/bit.c: Use libtests.
15910         * tests/mpz/t-scan.c: Remove unused subroutines.
15911         * tests/devel/try.c: Use libtests, define PROT_NONE if the system
15912         doesn't.
15913
15914         * tests/spinner.c, tests/x86check.c: Use tests.h.
15915         * tests/trace.c: Use tests.h, add mpf_trace.
15916         * tests/refmpn.c: Use tests.h, add refmpn_malloc_limbs_aligned,
15917         refmpn_tstbit, refmpn_neg.
15918
15919         * tune/common.c, tune/speed.h: Update for functions moved to
15920         tests/misc.c.
15921
15922         * tune/Makefile.am, tests/mpz/Makefile.am, tests/mpq/Makefile.am,
15923         tests/mpf/Makefile.am: Use tests/libtests.la.
15924
15925         * configure.in (AC_OUTPUT): Update for new directories.
15926         (x86 CALLING_CONVENTIONS_OBJS): Use .lo for libtests.la, allow
15927         ansi2knr on x86check.c.
15928
15929         * tests/Makefile.am: Establish new libtests.la convenience library,
15930         add mpz, mpq, mpf, mpbsd subdirectories.
15931         * tests/tests.h: New file.
15932         * mpn/tests/ref.h,try.h: Remove files, now in tests.h.
15933
15934         * tests/mpf/ref.c: Move to tests/refmpf.c, rename functions to refmpf.
15935         * tests/mpf/t-add.c, tests/mpf/t-sub.c: Use libtests.
15936         * tests/mpf/Makefile.am: Update.
15937
15938         * tests/memory.c: New file.
15939         * tests/misc.c: New file, a few subroutines from the test programs.
15940
15941         * mpz/tests, mpq/tests, mpf/tests, mpbsd/tests: Move directories to
15942         tests/mpz etc.
15943         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpbsd/Makefile.am
15944         (SUBDIRS): Remove.
15945
15946         * tests/devel: New directory.
15947         * mpn/tests/*.c: Move programs to tests/devel.
15948         * mpn/tests/Makefile.am, mpn/tests/README: Move to tests/devel, update.
15949
15950         * mpn/tests/ref.c: Move to tests/refmpn.c.
15951         * mpn/tests/spinner.c,trace.c,x86call.asm,x86check.c: Move to tests
15952         directory.
15953
15954         * tests/t-constants.c: Add checks of HIGHBIT, MAX and MIN constants,
15955         simplify ANSI vs K&R stringizing, use correct printf format types, do
15956         all tests before aborting.
15957
15958 2001-01-05  Torbjorn Granlund  <tege@swox.com>
15959
15960         * mpn/cray/ieee/gmp-mparam.h: Retune.
15961
15962 2001-01-05  Kevin Ryde  <kevin@swox.se>
15963
15964         * configure.in (mp.h): Only create this under --enable-mpbsd.
15965
15966         * demos/calc: New subdirectory, move demos/calc* to it.
15967         * demos/calc/Makefile.am: New file, split from demos/Makefile.am.
15968         * demos/Makefile.am: Update.
15969         * configure.in (AC_OUTPUT): Add demos/calc/Makefile.
15970
15971         * tests/t-constants.c (CALC_BITS_PER_TYPE etc): Use a run-time test
15972         for how many bits work in a give type, don't assume bits==8*sizeof.
15973
15974 2001-01-04  Kevin Ryde  <kevin@swox.se>
15975
15976         * mpz/fits_s.c, mpz/fits_u.c: New files, split from fits.c, use plain
15977         UINT_MAX etc, not MPZ_FITS_UTYPE_SDT etc.
15978         * mpz/fits.c: Remove file.
15979         * mpz/Makefile.am, macos/Makefile.in: Update.
15980
15981         * gmp-impl.h (UNSIGNED_TYPE_MAX etc): Remove these generic forms.
15982         (MPZ_FITS_[SU]TYPE_SDT): Remove these.
15983         (UINT_MAX etc): Provide a full set of defaults.
15984         * gmp-h.in (__GMP_MP_SIZE_T_INT): New define.
15985
15986         * mpz/tests/t-scan.c: New file.
15987         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
15988
15989         * mpz/scan0.c, mpz/scan1.c: Rewrite, don't read beyond allocated
15990         memory, support negatives, return ULONG_MAX for no bit found.
15991         * gmp.texi (Integer Logic and Bit Fiddling): Update.
15992
15993 2001-01-03  Torbjorn Granlund  <tege@swox.com>
15994
15995         * mpz/tests/dive.c: Generate test operands using new random functions.
15996         * mpz/tests/io.c: Likewise.
15997         * mpz/tests/logic.c: Likewise.
15998         * mpz/tests/t-2exp.c: Likewise.
15999
16000         * stack-alloc.c (__gmp_tmp_alloc): Round `now' to required alignment.
16001
16002         * stack-alloc.h (__TMP_ALIGN): Append `L'.
16003
16004         * gmp-impl.h: For Cray, #include limits.h.
16005         (LONG_MIN): New #define.
16006         (ULONG_HIGHBIT): #define in terms of ULONG_MAX.
16007         (LONG_HIGHBIT): #define as LONG_MIN.
16008         (USHRT_MAX): New name for USHORT_MAX.
16009         (SHRT_MAX): New name for SHORT_MAX.
16010         (SHRT_MIN): New #define.
16011         (USHORT_HIGHBIT,SHORT_HIGHBIT): Removed.
16012
16013         * mpbsd/tests/t-misc.c (check_itom [data]): *SHORT* => *SHRT*;
16014         remove code disabling a test for Cray.
16015
16016         * tests/t-constants.c (CHECK_CONSTANT): Cast parameters to long.
16017
16018         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove unused variable `t'.
16019         (mpn_kara_mul_n): Likewise.
16020
16021         * mpz/fac_ui.c (MPZ_SET_1_NZ): Actually use `__z'.
16022
16023         * mpz/tests/t-jac.c
16024         (main, check_squares_zi): Generate test operands using new random
16025         functions.
16026
16027         All changes below on this date for enabling `make; make check'
16028         with C++ compilers:
16029
16030         * mpz/tests/t-pow_ui.c (debug_mp, ref_mpz_pow_ui): Provide prototypes.
16031
16032         * mpz/tests/t-mul.c (debug_mp, base_mul, ref_mpz_mul):
16033         Provide prototypes.
16034         (dump_abort): Provide prototype and declare properly for C++.
16035
16036         * mpz/tests/t-jac.c: #include stdlib.h and sys/time.h.
16037
16038         * mpz/tests/t-fdiv.c
16039         (dump_abort): Provide prototype and declare properly for C++.
16040         (debug_mp): Provide prototype.
16041         * mpz/tests/t-fdiv_ui.c: Likewise.
16042         * mpz/tests/t-gcd.c: Likewise.
16043         * mpz/tests/t-powm.c: Likewise.
16044         * mpz/tests/t-powm_ui.c: Likewise.
16045         * mpz/tests/t-sqrtrem.c: Likewise.
16046         * mpz/tests/t-tdiv_ui.c: Likewise.
16047         * mpz/tests/t-tdiv.c: Likewise.
16048
16049         * mpz/tests/t-2exp.c: #include stdlib.h and sys/time.h.
16050         Remove #include of longlong.h.
16051
16052         * mpz/tests/io.c: #include config.h, stdlib.h, sys/time.h, and
16053         conditionally unistd.h.
16054
16055         * mpz/tests/dive.c: #include stdlib.h and sys/time.h.
16056         (dump_abort): Provide prototype and declare properly for C++.
16057         (debug_mp): Provide prototype.
16058         * mpz/tests/logic.c: Likewise.
16059
16060         * mpz/tests/convert.c (debug_mp): Provide prototype.
16061         * mpz/tests/t-root.c (debug_mp): Likewise.
16062
16063         * mpz/tests/bit.c: #include stdlib.h and sys/time.h.
16064
16065         * mpq/tests/t-get_d.c: #include stdlib.h and sys/time.h.
16066         (dump): Provide prototype and declare properly for C++.
16067
16068         * mpq/tests/t-cmp_ui.c: #include stdio.h, stdlib.h and sys/time.h.
16069         (ref_mpq_cmp_ui): Declare properly for C++.
16070
16071         * mpq/tests/t-cmp.c: #include stdlib.h and sys/time.h.
16072         (ref_mpq_cmp): Declare properly for C++.
16073         (dump): Delete unused function.
16074
16075         * mpf/random2.c (myrandom): New function.
16076         (mpf_random2): Use it.
16077
16078         * mpn/generic/random2.c: #include stdlib.h (for random/mrand48).
16079         (myrandom): New function.
16080         (mpn_random2): Use it.
16081
16082         * mpf/tests/t-add.c: #include stdlib.h and sys/time.h.
16083         (oo): Remove unused function.
16084         * mpf/tests/t-conv.c: Likewise.
16085         * mpf/tests/t-sub.c: Likewise.
16086         * mpf/tests/t-dm2exp.c: Likewise.
16087         * mpf/tests/t-muldiv.c: Likewise.
16088         * mpf/tests/t-sqrt.c: Likewise.
16089
16090         * mpf/tests/reuse.c: #include stdlib.h and sys/time.h.
16091         Use PROTO on some typedefs.
16092         (oo): Remove function.
16093         (dump_abort): Call mpf_dump instead of oo.
16094
16095         * mpf/set_str.c: #include stdlib.h (for strtol).
16096
16097         * mpf/random2.c: #include stdlib.h (for random/mrand48).
16098         * mpn/alpha/udiv_arnnd: File deleted.
16099
16100         * Remove K&R function headers.
16101
16102 2001-01-02  Torbjorn Granlund  <tege@swox.com>
16103
16104         * mpn/generic/mul.c: Clean up spacing and indentation.
16105
16106         * mpn/generic/mul_fft.c (mpn_fft_add_modF): Use mpn_decr_u.
16107         Clean up spacing and indentation.
16108
16109         * extract-dbl.c: Generalize to handle smaller limb sizes.
16110
16111 2001-01-01  Torbjorn Granlund  <tege@swox.com>
16112
16113         * mpbsd/mout.c: Output newline after "0".
16114
16115 2000-12-31  Torbjorn Granlund  <tege@swox.com>
16116
16117         * ltmain.sh: Remove space between `#!' and `$SHELL' when generating
16118         `libtool'.
16119
16120         * mpbsd/tests/t-misc.c (check_itom): Exclude test for all Cray
16121         vector systems.  Correct comment.
16122
16123 2000-12-31  Kevin Ryde  <kevin@swox.se>
16124
16125         * gmp.texi (ABI and ISA): New enough gcc needed for mips n32 etc, gcc
16126         2.95 needed for sparc 64-bit ABI, gcc 2.8 needed for -mv8plus.
16127
16128         * configure.in ([cjt]90,sv1-cray-unicos*): Preserve user specified
16129         MPN_PATH, amend test program indenting.
16130         (none-*-*): Add -DNO_ASM to gcc to disable longlong.h asm macros in
16131         generic C.
16132
16133         * config.sub (j90, t90): Preserve these, don't let configfsf.sub turn
16134         them into c90.
16135
16136         * config.guess (m68k-*-nextstep*,m68k-*-openstep*): Don't transform
16137         m68k to m68020, since m68k is already interpreted as 68020.
16138
16139 2000-12-30  Kevin Ryde  <kevin@swox.se>
16140
16141         * mpq/neg.c: Rewrite, use mpn, avoid denominator copy if unnecessary.
16142
16143         * mpz/tstbit.c: Rewrite, slightly simplified.
16144         * mpz/tests/bit.c (check_tstbit): New test, and add a couple more
16145         diagnostics elsewhere.
16146
16147         * configure.in (x86 gcc_cflags_cpu): Add -m486 for gcc 2.7.2.
16148         (ccbase): Only use a known compiler in eval statements (avoids
16149         problems with non-symbol characters).
16150         (ccbase): Use GMP_PROG_CC_IS_GNU to identify gcc installed under a
16151         different name.
16152         (cclist): Use same style $abi as other variables.
16153
16154         * acinclude.m4 (GMP_PROG_CC_IS_GNU): New macro.
16155         (GMP_GCC_MARCH_PENTIUMPRO): Use $ccbase to identify gcc.
16156         (GMP_ASM_TYPE): Define TYPE to empty, not "dnl", when no .type needed.
16157         (GMP_ASM_SIZE): Ditto for SIZE, which ensures EPILOGUE on the last
16158         line of a file doesn't leave a tab and no newline.
16159         (GMP_ASM_UNDERSCORE): Add a prototype for C++.
16160
16161         * configure.in (sys/mman.h, mprotect): New tests.
16162         * mpn/tests/try.c: Use them, and HAVE_UNISTD_H too.
16163
16164         * configure.in (getopt.h): Remove test.
16165         * tune/speed.c, mpn/tests/try.c (getopt.h): Remove include, since
16166         plain getopt() is in <unistd.h>.
16167
16168         * configure.in, gmp-h.in (mips*-*-irix6*): Set limb_n32=longlong
16169         rather than using _ABIN32.
16170
16171 2000-12-29  Torbjorn Granlund  <tege@swox.com>
16172
16173         * mpz/tests/reuse.c: Rename dump_abort => dump.
16174         * mpz/tests/reuse.c: Generate operands using gmp_rand*.
16175         * mpz/tests/convert.c: Likewise.
16176
16177         * configure.in: Detect T90-ieee systems; move Cray path
16178         selection to after AC_PROG_CC.  Invoke AC_PROG_CPP.
16179         * mpn/cray/cfp: New directory.  Move cfp specific files here.
16180         * mpn/cray/cfp/mulwwc90.s: New file.
16181         * mpn/cray/cfp/mulwwj90.s: New file.
16182         * mpn/cray/mulww.s: Delete.
16183
16184 2000-12-27  Torbjorn Granlund  <tege@swox.com>
16185
16186         * mpn/cray/ieee/mul_1.c: New file.
16187         * mpn/cray/ieee/addmul_1.c: New file.
16188         * mpn/cray/ieee/submul_1.c: New file.
16189         * mpn/cray/ieee/gmp-mparam.h: New file.
16190
16191         * mpn/cray/gmp-mparam.h: Disable UMUL_TIME and UDIV_TIME.
16192
16193         * mpn/cray/hamdist.c: New file.
16194         * mpn/cray/popcount.c: New file.
16195         * mpn/cray/rshift.c: New file.
16196         * mpn/cray/lshift.c: New file.
16197
16198         * longlong.h: Add count_leading_zeros for _CRAY.
16199         Reorganize _CRAY stuff.
16200
16201 2000-12-24  Kevin Ryde  <kevin@swox.se>
16202
16203         * configure.in (alpha*-cray-unicos*): Disable SPEED_CYCLECOUNTER_OBJ,
16204         as tune/alpha.asm doesn't suit.
16205
16206         * mpn/generic/sqrtrem.c, mpz/pow_ui.c, mpz/powm_ui.c, mpf/get_str.c,
16207         mpf/set_str.c: Use mpn_sqr_n when applicable, not mpn_mul_n.
16208
16209 2000-12-23  Torbjorn Granlund  <tege@swox.com>
16210
16211         * mpn/generic/mul_fft.c: Reformat.
16212         (mpn_fft_neg_modF): Remove.
16213         (mpn_fft_mul_2exp_modF): Inline mpn_fft_neg_modF.
16214
16215         * mpn/cray/gmp-mparam.h: Retune.
16216
16217         * configure.in (*-cray-unicos*): Pass `-O3 -htask0'.
16218         (vax*-*-*): Fix typo.
16219
16220         * mpn/cray/mul_1.c: Use dynamic arrays, get rid of TMP_*.
16221         * mpn/cray/addmul_1.c: Likewise.
16222         * mpn/cray/submul_1.c: Likewise.
16223         * mpn/cray/add_n.c: Likewise.
16224         * mpn/cray/sub_n.c: Likewise.
16225
16226         * configure.in (default cc_cflags,cc_64_cflags): Remove -g/add -O.
16227         (mips*-*-irix[6789]*]): Remove -g from cc_*_cflags.
16228
16229 2000-12-22  Torbjorn Granlund  <tege@swox.com>
16230
16231         * mpn/generic/mul_n.c: Delete K&R function headers.
16232
16233         * mpn/generic/mul_n.c (mpn_kara_mul_n): Clean up type confusion
16234         between mp_limb_t and mp_size_t.
16235         (mpn_kara_sqr_n): Likewise.
16236
16237         * mpn/generic/mul_n.c (mpn_kara_mul_n): Use mpn_incr_u.
16238         (mpn_kara_sqr_n): Likewise.
16239
16240         * mpn/generic/mul_n.c (mpn_kara_mul_n): Change handling of `sign'
16241         to work around GCC 2.8.1 MIPS bug.
16242
16243         * configure.in (implied alpha*-cray-unicos*): Remove -g from cc_cflags.
16244
16245 2000-12-21  Torbjorn Granlund  <tege@swox.com>
16246
16247         * mpn/alpha/invert_limb.asm: Simplify a bit.
16248         Add handling of bigend systems.
16249         * mpn/alpha/unicos.m4: Define `bigend'.
16250         * mpn/alpha/default.m4: Define `bigend' (to expand to nothing).
16251
16252         * tests/t-constants.c (CHECK_CONSTANT): Print using %lx.
16253
16254         * mpn/alpha/gmp-mparam.h: Remove sizes for plain C types.
16255         * mpn/alpha/ev5/gmp-mparam.h: Likewise.
16256         * mpn/alpha/ev6/gmp-mparam.h: Likewise.
16257
16258         * mpn/alpha/unicos.m4: Define LEA.
16259         * mpn/alpha/default.m4: Likewise.
16260         * mpn/alpha/invert_limb.asm: Use LEA for loading symbolic addresses.
16261         * mpn/alpha/cntlz.asm: Likewise.
16262
16263         * mpn/alpha/cntlz.asm: Don't use `ldbu', use slightly slower
16264         `ldq_u' + `extbl' instead.
16265
16266         * mpn/alpha/unicos.m4: Define EXTERN.
16267         * mpn/alpha/default.m4: Define EXTERN (to expand to nothing).
16268         * mpn/alpha/cntlz.asm: Declare __clz_tab usign `EXTERN' (for the
16269         benefit of Unicos).
16270
16271 2000-12-21  Kevin Ryde  <kevin@swox.se>
16272
16273         * mpn/alpha/unicos.m4 (GSYM_PREFIX): Define for the benefit of
16274         __clz_tab.
16275
16276 2000-12-20  Torbjorn Granlund  <tege@swox.com>
16277
16278         * longlong.h: Add udiv_qrnnd and count_leading_zeros for _CRAYMPP
16279         systems.
16280
16281 2000-12-19  Torbjorn Granlund  <tege@swox.com>
16282
16283         * configure.in (*sparc*-*-*): Remove -g from cc_cflags and acc_cflags.
16284
16285         * mpn/generic/sqrtrem.c (mpn_sqrtrem): Separate `limb' values from
16286         `size' values.
16287
16288         * configure.in (*-cray-unicos*): Add `-Wa,-B' to cc_cflags.
16289
16290         * demos/pexpr.c (rstate): New variable.
16291         (main): Initialize rstate.
16292         (enum op_t): Add RANDOM.
16293         (fns): Add field for RANDOM.
16294         (mpz_eval_expr): Handle RANDOM.
16295
16296 2000-12-19  Kevin Ryde  <kevin@swox.se>
16297
16298         * mpn/generic/sqrtrem.c: Rewrite by Paul Zimmermann, based on his
16299         Karatsuba Square Root algorithm.
16300         * gmp.texi (Square Root Algorithm): Update.
16301
16302         * tune/many.pl: New file.
16303
16304         * mpn/tests/try.c,ref.[ch] (mpn_preinv_mod_1, mpn_sb_divrem_mn,
16305         mpn_tdiv_qr, mpn_gcd_finda, mpn_kara_mul_n, mpn_kara_sqr_n,
16306         mpn_toom3_mul_n, mpn_toom3_sqr_n): Add testing.
16307         * mpn/tests/ref.c: Cast some "0"s in function calls.
16308
16309         * mpn/x86/k7/mmx/mod_1.asm: Add preinv_mod_1 entrypoint, remove extra
16310         variable for loop termination.
16311
16312         * mpn/x86/p6/mmx/mod_1.asm: Remove file, in favour of the following.
16313         * mpn/x86/p6/mod_1.asm: New file.
16314
16315         * mpn/x86/pentium/mod_1.asm: New file.
16316
16317 2000-12-18  Torbjorn Granlund  <tege@swox.com>
16318
16319         * configure.in (mips*-*-irix[6789]*): Pass options to compiler using
16320         `-Wc'.
16321
16322 2000-12-18  Kevin Ryde  <kevin@swox.se>
16323
16324         * mpn/x86/k6/pre_mod_1.asm: New file.
16325
16326         * tune/tuneup.c (USE_PREINV_MOD_1): Tune this, rearrange mpn_divrem_1
16327         and mpn_mod_1 handling in support of it.
16328         * tune/Makefile.am: Consequent changes to divrem_1.c and mod_1.c.
16329
16330         * gmp-impl.h (USE_PREINV_MOD_1, MPN_MOD_OR_PREINV_MOD_1): New macros.
16331         * mpn/generic/perfsqr.c, mpz/pprime_p.c: Use MPN_MOD_OR_PREINV_MOD_1.
16332
16333         * configure.in: Let an asm mod_1 provide a preinv_mod_1 entrypoint.
16334
16335         * mpn/alpha/default.m4: Remove some newlines, add some asserts.
16336         (r0 etc, f0 etc): Use defreg and deflit.
16337         (PROLOGUE, PROLOGUE_GP, EPILOGUE): Use GSYM_PREFIX.
16338         * mpn/alpha/unicos.m4: Remove some newlines, add some asserts.
16339         * mpn/alpha/invert_limb.asm: Remove unused second DATASTART parameter.
16340         * mpn/alpha/cntlz.asm: Use mpn_count_leading_zeros and __clz_tab.
16341
16342         * mpn/asm-defs.m4 (changecom): Comments on portability.
16343         (__clz_tab, modlimb_invert_table): New macros, matching gmp-impl.h.
16344         (count_leading_zeros, count_trailing_zeros): New define_mpn's.
16345         (PROLOGUE etc): Comments on usage, add some asserts.
16346         (OPERATION_[lr]shift): Use m4_not_for_expansion, for the benefit of
16347         lorrshift multifunc.
16348
16349         * mpn/Makeasm.am (RM_TMP): New variable controlling tmp-*.s
16350         removal, for development purposes.
16351
16352         * mpz/fac_ui.c: Fix for long long limb by using mpn_mul_1 not
16353         mpz_mul_ui, and note some possible enhancements.
16354
16355         * mpz/tests/t-fac_ui.c: New test.
16356         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
16357         * macos/Makefile.in: Ditto, and add t-fib_ui too.
16358
16359         * mpn/generic/[lr]shift.c: Remove some DEBUG code adequately covered
16360         by new parameter ASSERTs.
16361
16362         * longlong.h (count_trailing_zeros): Assert x!=0.
16363
16364         * doc/configuration: Updates for new configure things, add some notes
16365         on test setups.
16366
16367 2000-12-16  Torbjorn Granlund  <tege@swox.com>
16368
16369         * configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc also for 64-bit
16370         compiles.
16371         * configure.in: Disable shared libs for *-*-ultrix*.
16372
16373 2000-12-15  Torbjorn Granlund  <tege@swox.com>
16374
16375         * configure.in (powerpc*-*-*): Pass -Wa,-mppc when using gcc.
16376
16377         * gmp-impl.h (_EXTERN_INLINE): #define different for GCC and other
16378         compilers.
16379
16380         * gmp-h.in (__gmp_inline): Remove.
16381         * mp-h.in: Likewise.
16382         * mpn/generic/gcd.c: Use `inline' instead of `__gmp_inline'.
16383
16384         * configure.in (mips*-*-irix[6789]*): Define *_ldflags.
16385
16386 2000-12-14  Torbjorn Granlund  <tege@swox.com>
16387
16388         * mpn/generic/pre_mod_1.c: Use proper type for udiv_qrnnd
16389         parameter `dummy'.
16390
16391         * mpn/generic/divrem_1.c: Use explicit `!= 0' in if statement.
16392         * mpn/generic/mod_1.c: Likewise.
16393
16394 2000-12-14  Kevin Ryde  <kevin@swox.se>
16395
16396         * config.guess (mips-*-irix[6789]*): Transform to mips64.
16397         (m68k-*-nextstep* | m68k-*-openstep*): Transform to m68020.
16398
16399 2000-12-13  Torbjorn Granlund  <tege@swox.com>
16400
16401         * tests/t-constants.c (main): Conditionalize use of PP_INVERTED.
16402
16403         * mpn/mp_bases.c: Handle 4-bit limbs.
16404         (main): Add code for generating tables.
16405
16406         * mpn/generic/popham.c: Handle limb bitsizes of 4, 8, 16.
16407         Suffix all 32-bit constant with `L'.
16408         Use CNST_LIMB for 64-bit constants.
16409
16410 2000-12-13  Kevin Ryde  <kevin@swox.se>
16411
16412         * gmp-impl.h (FIB_THRESHOLD): Defaults for 4,8,16 bits per limb, and
16413         an arbitrary fallback default.
16414         (modlimb_invert): Add efficient code for 8,16 (or 4) bits per limb.
16415
16416         * configure.in (mips3, mips64): Don't bother with o32 (mips2 32-bit
16417         limb) on IRIX 6.
16418
16419         * Makefile.am (SUBDIRS): Put "tests" first so tests/t-constants.c is
16420         run first, to pick up any limb size mismatch.
16421
16422         * tune/tuneup.c (DIVREM_1, MOD_1): Fix result values, were off by 1.
16423
16424         * mpz/fib_ui.c (table1, table2): Add data for 4,8,16 bits per limb.
16425
16426 2000-12-12  Torbjorn Granlund  <tege@swox.com>
16427
16428         * gmp-impl.h (LIMBS_PER_DOUBLE): Define for any limb bitsize.
16429
16430 2000-12-11  Torbjorn Granlund  <tege@swox.com>
16431
16432         * mpn/mp_bases.c: Add tables for 8-bit and 16-bit limbs.
16433         Round existing `double' values properly.
16434
16435         * gmp-h.in (__gmp_randstate_struct): Prefix field names with _mp_
16436         to keep out of user name space.
16437         (__gmp_randata_lc): Likewise.
16438         * randclr.c, randlc.c, randlc2x.c, randraw.c, randsd.c, randsdui.c:
16439         Corresponding changes.
16440
16441         * gmp-impl.h (PP): #define for machines with BITS_PER_MP_LIMB
16442         of 2, 4, 8, and 16.
16443         (PP_FIRST_OMITTED): New, define for various BITS_PER_MP_LIMB.
16444         (PP_MASK): Remove.
16445         (PP_MAXPRIME): Remove.
16446
16447         * mpn/generic/perfsqr.c: Generalize PP handling for machines with
16448         limbs of < 32 bits.  Allow PP_INVERTED to be undefined.
16449         * mpz/pprime_p.c: Likewise.
16450
16451 2000-12-10  Torbjorn Granlund  <tege@swox.com>
16452
16453         * mpn/generic/mul_1.c: Declare parameters in C89 style.
16454
16455 2000-12-10  Kevin Ryde  <kevin@swox.se>
16456
16457         * tune/Makefile.am (speed_LDFLAGS, speed_ext_LDFLAGS, tune_LDFLAGS):
16458         Don't use -all-static, as gcc 2.95.2 on i386 solaris 8 doesn't like
16459         it.
16460
16461         * configure.in (mips3,mips64): Add ABI=64, name the others ABI=n32 and
16462         ABI=o32.
16463         * mpn/mips3/gmp-mparam.h (BITS_PER_LONGINT): Remove #define and let
16464         configure determine it, since it varies with ABI=64 or ABI=n32.
16465         * gmp.texi (ABI and ISA): Update.
16466         (mpz_mod_ui): Remark that it's identical to mpz_fdiv_r_ui.
16467         (mpn_divexact_by3): Qualify a statement needing mp_bits_per_limb even.
16468
16469         * mul_fft.c (mpn_fft_mul_modF_K etc): Patch by Paul Zimmermann to fix
16470         results in certain cases of recursing into a further FFT.
16471
16472 2000-12-09  Torbjorn Granlund  <tege@swox.com>
16473
16474         * mpz/cmpabs.c: Remove unused variable.
16475         * mpz/rrandomb.c: Likewise.
16476         * mpz/xor.c: Likewise.
16477
16478 2000-12-07  Torbjorn Granlund  <tege@swox.com>
16479
16480         * mpn/generic/gcdext.c: Handle double carry when computing s1.
16481         Merge two code blocks for computing s0 and s1.
16482
16483 2000-12-07  Kevin Ryde  <kevin@swox.se>
16484
16485         * configure.in (hppa*-*-*): Remove -Aa -D_HPUX_SOURCE from
16486         cc_cflags/cppflags, and instead let AM_C_PROTOTYPES add it, or -Ae,
16487         whichever works.
16488
16489         * configure.in (*-*-aix[34]*): Disable shared by default, but let
16490         the user override that, if desired.
16491         * gmp.texi (Notes for Particular Systems): Update.
16492
16493 2000-12-06  Torbjorn Granlund  <tege@swox.com>
16494
16495         * mpq/cmp_ui.c: Streamline.
16496
16497 2000-12-06  Kevin Ryde  <kevin@swox.se>
16498
16499         * tune/divrem_1_div.c,divrem_1_inv.c,mod_1_div.c,mod_1_inv.c,
16500         gcdext_double.c: New files for measuring.
16501         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
16502         * tune/speed.c,speed.h,common.c: Add measuring of them.
16503         (mpn_preinv_mod_1, mpz_jacobi, mpz_powm_ui): Add measuring.
16504
16505         * speed.c (getopt_long): Don't use this, just plain getopt.
16506         * configure.in (getopt_long): Remove test.
16507
16508         * gmp-impl.h (MPN_KARA_MUL_N_TSIZE, MPN_KARA_MUL_N_MINSIZE,
16509         MPN_TOOM3_MUL_N_TSIZE, MPN_TOOM3_MUL_N_MINSIZE): New macros, and
16510         assume toom3 square tsize was meant to be the same as the mul (both
16511         are overestimates).
16512         * tune/tuneup.c, mpn/generic/mul.c, mpn/generic/mul_n.c: Use them.
16513         * mpn/generic/mul_n.c (mpn_toom3_sqr_n): Fix an ASSERT to use
16514         TOOM3_SQR_THRESHOLD not TOOM3_MUL_THRESHOLD, add a few that might
16515         be more realistic size checks.
16516         * tune/speed.h (SPEED_ROUTINE_MPN_MUL_N_TSPACE etc): Use minsize.
16517
16518         * mpn/generic/divrem_1.c: Partial rewrite, merge fractional part
16519         calculation, skip a divide step in more cases, introduce
16520         DIVREM_1_NORM_THRESHOLD and DIVREM_1_UNNORM_THRESHOLD.
16521         * mpn/generic/mod_1.c: Partial rewrite, skip a divide step in more
16522         cases, introduce MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD.
16523         * longlong.h (UDIV_PREINV_ALWAYS): New define, set for alpha and ia64.
16524         * tune/tuneup.c (DIVREM_1_NORM_THRESHOLD, DIVREM_1_UNNORM_THRESHOLD,
16525         MOD_1_NORM_THRESHOLD, MOD_1_UNNORM_THRESHOLD): Tune these.
16526         * gmp-impl.h [TUNE_PROGRAM_BUILD]: Support for this.
16527         * tune/Makefile.am (TUNE_MPN_SRCS): Add divrem_1.c and mod_1.c.
16528
16529         * gmp-impl.h (UDIV_NORM_PREINV_TIME): Renamed from UDIV_PREINV_TIME.
16530         * mpn/generic/perfsqr.c, mpn/generic/sb_divrem_mn.c,
16531         mpn/x86/*/gmp-mparam.h: Ditto.
16532         * gmp-impl.h (UDIV_UNNORM_PREINV_TIME): New define.
16533
16534         * configure.in (AC_C_INLINE, HAVE_INLINE): New test and define.
16535         * gmp-impl.h (inline): Remove, use config.h.
16536         (_EXTERN_INLINE): Redefine based on HAVE_INLINE.
16537         (mpn_zero_p): Use HAVE_INLINE.
16538
16539         * acinclude.m4 (GMP_PROG_AR, GMP_PROG_NM): Don't add flags to a user
16540         selected $AR or $NM.
16541
16542         * tune/tuneup.c (all): Print how long the tuning took.
16543
16544         * configure.in (AM_C_PROTOTYPES): Use this, not GMP_ANSI2KNR.
16545         * acinclude.m4 (GMP_ANSI2KNR): Remove.
16546
16547         * Makefile.am (gmp.h, mp.h): In DISTCLEANFILES not CLEANFILES.
16548
16549         * gmp-h.in (mpn_divmod, mpn_divmod_1, mpn_divexact_by3): Cast some
16550         zeros, for the benefit of K&R if long!=int.
16551
16552         * mpn/lisp/gmpasm-mode.el (gmpasm-comment-start-regexp): Add "*" for
16553         the benefit of cray.
16554
16555         * compat.c (mpn_divexact_by3, mpn_divmod_1): Return types should be
16556         mp_limb_t, not int, and need an actual "return".
16557
16558 2000-12-05  Torbjorn Granlund  <tege@swox.com>
16559
16560         * mpn/sparc32/v8/supersparc/gmp-mparam.h: Retune.
16561         * mpn/alpha/gmp-mparam.h: Tune for 21064.
16562
16563         * longlong.h: Reformat to avoid newlines within strings.
16564
16565         * gmp-impl.h (inline): Disable if GCC has defined __STRICT_ANSI__.
16566
16567         * configure.in: Do a `mkdir tune' before creating tune/sqr_basecase.c.
16568
16569         * Makefile.am: Treat mp.h analogously to gmp.h.
16570
16571         configure.in (*-*-aix): Pass -qmaxmem=20000 to xlc.
16572
16573         * mp-h.in: Renamed from mp.h.
16574         Add #define for _LONG_LONG_LIMB.
16575         Move some other fixes from gmp-h.in.
16576         * mp.h: Removed.
16577         * configure.in: Generate mp.h from mp-h.in like we handle
16578         gmp-h.in/gmp.h.
16579
16580 2000-12-04  Torbjorn Granlund  <tege@swox.com>
16581
16582         * acinclude.m4: Fix typo testing for bad HP compiler.
16583
16584 2000-12-03  Torbjorn Granlund  <tege@swox.com>
16585
16586         * mpbsd/tests/t-misc.c (check_itom): Exclude some tests for Cray
16587         CFP systems.
16588
16589         * longlong.h (CRAYIEEE umul_ppmm): New.
16590
16591         * mpn/cray/gmp-mparam.h (BITS_PER_SHORTINT): 32 => 64.
16592         (*_THRESHOLD): Tune.
16593
16594         * configure.in: Disable shared libs for *-*-unicos*.
16595
16596 2000-12-03  Kevin Ryde  <kevin@swox.se>
16597
16598         * configure.in, tune/Makefile.am: Create tune/sqr_basecase.c during
16599         configure, and use it unconditionally in $(nodist_tuneup_SOURCES).
16600         Fixes a problem with sqr_basecase.lo under --disable-static.
16601
16602 2000-12-01  Torbjorn Granlund  <tege@swox.com>
16603
16604         * mpf/tests/t-get_d.c (LOW_BOUND,HIGH_BOUND): #define for non-IEEE
16605         Cray systems.
16606
16607         * gmp-impl.h (union ieee_double_extract): Test for _CRAYIEEE.
16608
16609 2000-11-30  Torbjorn Granlund  <tege@swox.com>
16610
16611         * mpz/tests/t-mul.c (base_mul): Fix re-evaluation problems in macro
16612         invocations.
16613         (ref_mpz_mul): New name from mpz_refmul.  Make static.
16614         (base_mul): New name for _mpn_mul_classic.
16615
16616 2000-11-30  Kevin Ryde  <kevin@swox.se>
16617
16618         * configure.in: Rewrite of CC/CFLAGS selection scheme, introduce a
16619         notion of ABI, merge compiler and mpn path selection, add flags
16620         selection for AR and NM, let CC without CFLAGS work.
16621         (AC_PROG_CC): Use this, not GMP_SELECT_CC.
16622         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't use AC_TRY_COMPILE, combine
16623         cc/cflags parameter.
16624         (GMP_PROG_CC_FIND, GMP_CHECK_CC_64BIT, GMP_PROG_CC_SELECT): Remove.
16625         * gmp.texi (Installing GMP): Updates for new scheme.
16626
16627         * configure.in (AC_CANONICAL_HOST): Use this and $host, not $target.
16628         * acinclude.m4, acconfig.h, longlong.h, mpn/x86/x86-defs.m4,
16629         mpn/x86/k7/mmx/popham.asm: Ditto, renaming HAVE_TARGET_CPU to
16630         HAVE_HOST_CPU.
16631         * gmp.texi (Build Options, and elsewhere): Update.
16632
16633         * acinclude.m4 (GMP_COMPARE_GE): New macro.
16634         (GMP_GCC_MARCH_PENTIUMPRO): Use it, add CC parameter, check for GCC.
16635         (GMP_HPC_HPPA_2_0): New macro, adapted from GMP_CHECK_CC_64BIT.
16636
16637         * acinclude.m4 (GMP_PROG_AR): New macro, using AC_CHECK_TOOL, adding
16638         GMP flags.
16639         * configure.in: Use it
16640
16641         * gmp-h.in: Renamed from gmp.h.
16642         (@define_LONG_LONG_LIMB@): Placeholder for instantiation.
16643         (__GNU_MP__): Bump to 3.
16644         * acinclude.m4 (GMP_VERSION): Get version from gmp-h.in.
16645         * configure.in: Create gmp.h from gmp-h.in to set _LONG_LONG_LIMB.
16646         * gmp.texi.h (ABI and ISA): Mention this.
16647         * acconfig.h (_LONG_LONG_LIMB): Remove undef.
16648         * Makefile.am: Distribute gmp-h.in, not gmp.h.
16649
16650         * configure.in (AC_PROG_CPP, AC_PROG_INSTALL, AC_PROG_LN_S): Remove,
16651         dragged in by other macros.
16652         (gmp_asm_syntax_testing): Renamed from gmp_no_asm_syntax_testing.
16653         (AC_EXEEXT, AC_OBJEXT): Remove, done automatically by libtool.
16654         * configure.in, acinclude.m4: Remove "" from "`foo`", being
16655         unnecessary and not portable.
16656
16657         * configure.in (GMP_LDFLAGS): New AC_SUBST flags for libtool link.
16658         (powerpc64*-*-aix*): Use for -Wc,-maix to fix shared library creation,
16659         but can't build shared and static at the same time.
16660         * Makefile.am (libgmp_la_LDFLAGS, libmp_la_LDFLAGS): Use
16661         $(GMP_LDFLAGS).
16662         * gmp.texi (Notes for Particular Systems): Update AIX problem
16663
16664         * configure.in (AC_CONFIG_LINKS): Use where needed, not via gmp_links.
16665         (gmp_srclinks): Build up as needed, not via gmp_links.
16666
16667         * acinclude.m4 (GMP_INIT): Do CONFIG_TOP_SRCDIR and asm-defs.m4 here.
16668         * configure.in (asm-defs.m4): Consequent changes.
16669
16670         * acinclude.m4 (GMP_INCLUDE_MPN): Using include_mpn(), replacing
16671         GMP_INCLUDE and GMP_SINCLUDE.
16672         * configure.in (gmp_m4postinc): Remove this scheme, use
16673         GMP_INCLUDE_MPN instead.
16674
16675         * configure.in (*-*-sco3.2v5*): Force ac_cv_archive_cmds_need_lc=no,
16676         until libtool does this itself.
16677         * gmp.texi (Known Build Problems): Remove SCO -lc problem.
16678
16679         * configure, INSTALL.autoconf, etc: Update to autoconf 2000-11-29.
16680         * acinclude.m4 (GMP_C_SIZES): Use AC_CHECK_SIZEOF.
16681         * gmp.texi (Known Build Problems): Remove version.c sed/config.h
16682         problem, fixed.
16683
16684         * ltmain.sh, aclocal.m4: Update to libtool 2000-11-25.
16685         * ltconfig: No longer required, but leave an empty dummy for automake.
16686         * gmp.texi (Known Build Problems): Remove SunOS native ar ranlib
16687         problem, fixed.
16688
16689         * */Makefile.in, aclocal.m4: Update to automake 2000-11-25.
16690         * mpbsd/tests/Makefile.am, mpfr/tests/Makefile.am (check_PROGRAMS):
16691         Remove dummy, no longer required.
16692         * mpbsd/tests/dummy.c, mpfr/tests/dummy.c: Remove files.
16693         * depcomp: Remove file, no longer required (with no-dependencies).
16694
16695         * texinfo.tex: Update to 2000-11-09.
16696         * gmp.texi (Build Options): Mention PDF from gmp.texi.
16697         * Makefile.am (MOSTLYCLEANFILES): Add gmp.tmp, from new texinfo.tex.
16698
16699         * gmp.texi (Build Options): List alphaev56, alphapca56, alphaev67,
16700         hppa2.0n and power among supported CPUs.
16701
16702 2000-11-30  Torbjorn Granlund  <tege@swox.com>
16703
16704         * mpz/tests/t-mul.c: Increase max operand size from 2^17 bits
16705         to 2^19 bits.  Misc cleanups.
16706
16707 2000-11-26  Kevin Ryde  <kevin@swox.se>
16708
16709         * tune/tuneup.c (FIB_THRESHOLD): Cope better with different speeds of
16710         odd and even sizes.
16711
16712         * longlong.h (alpha): Use udiv_qrnnd and count_leading_zeros on all
16713         compilers, not just gcc.
16714
16715         * pre_mod_1.c: Use conditional subtract to always skip a division.
16716         (UMUL_TIME, UDIV_TIME): Remove defaults, now in longlong.h.
16717
16718 2000-11-22  Torbjorn Granlund  <tege@swox.com>
16719
16720         * mpn/pa64w/gmp-mparam.h: Retune.
16721         * mpn/pa64/gmp-mparam.h: Retune.
16722         * mpn/sparc64/gmp-mparam.h: Retune.
16723
16724 2000-11-22  Kevin Ryde  <kevin@swox.se>
16725
16726         * gmp-impl.h (ABOVE_THRESHOLD, BELOW_THRESHOLD): New macros.
16727         * mpn/generic/gcdext.c: Use them.
16728
16729         * mpn/generic/gcdext.c [WANT_GCDEXT_ONE_STEP]: Force only one step.
16730         * tune/gcdextos.c, tune/gcdextod.c: New files, one step gcdext, single
16731         and double.
16732         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
16733         (TUNE_MPN_SRCS): Remove gcdext.c.
16734         * tune/speed.h, tune/common.c, tune/speed.c: Add measuring.
16735         * tune/tuneup.c: Use for GCDEXT_THRESHOLD, plus check if double limb
16736         is ever better.  Should be more accurate, and hopefully faster.
16737
16738         * tune/gcdext_single.c: New file, gcdext forced to single limbs.
16739         * tune/Makefile.am: Add it.
16740         * tune/speed.h, tune/common.c, tune/speed.c: Add measuring, and of
16741         invert_limb.
16742
16743         * tune/speed.h (speed_params r): Use mp_limb_t, not long.
16744         * tune/speed.h, tune/common.c: Don't "switch" on "r".
16745         * tune/speed.c (r_string): Accept limb sized constants.
16746         (choice scale): Add a scale factor (eg. "2.33*mpn_add_n").
16747         * tune/common.c (SPEED_ROUTINE_UDIV_QRNND_A): Default r to
16748         __mp_bases[10].big_base, being a full limb value.
16749
16750         * configure.in (alphapca56*-*-*): Use ev5 mpn path.
16751         (am29000*-*-*): Remove this, leave the canonical a29k.
16752         (z8k*-*-*, z8kx*-*-*): Changed from z8000, since z8k is canonical.
16753         (gmp_mpn_functions_optional): Add invert_limb, use for alpha and ia64.
16754
16755         * configure.in (alloca): Accept yes/no/detect, generate an error if
16756         "yes" but not available.
16757         * gmp.texi (Build Options): Update.
16758
16759         * acinclude.m4 (GMP_TRY_ASSEMBLE): Make conftest.out available.
16760         (GMP_ASM_ALIGN_FILL_0x90): Use it.
16761
16762         * acinclude.m4 (GMP_ASM_X86_MMX) [*-*-solaris*]: Check for solaris
16763         2.6 "as" movq bug.
16764         * gmp.texi (Notes for Particular Systems): Update x86 MMX note.
16765
16766 2000-11-21  Torbjorn Granlund  <tege@swox.com>
16767
16768         * tune/Makefile.am (EXTRA_DIST): List hppa2w.asm.
16769
16770         * tune/hppa2.asm: Change level directive to "2.0n".
16771         * tune/hppa2w.asm: New file.
16772         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Separate out hppa2.0w.
16773
16774         * mpn/pa64/gmp-mparam.h (BITS_PER_LONGINT): 64 => 32.
16775
16776 2000-11-21  Kevin Ryde  <kevin@swox.se>
16777
16778         * urandom.h (random): No prototype if glibc stdlib.h has already
16779         provided it (avoids an int32_t/long conflict).
16780
16781         * tune/Makefile.am (LDFLAGS): Use -all-static.
16782         (speed-dynamic): Dynamic linked version of speed.c.
16783         * tune/README: Update.
16784
16785         * mpn/generic/gcd.c (find_a): Use native version if available.
16786         * acconfig.h (HAVE_NATIVE_mpn_gcd_finda): Add #undef.
16787         * gmp-impl.h (mpn_gcd_finda): Add prototype and define.
16788         * mpn/asm-defs.m4 (mpn_gcd_finda): New define_mpn.
16789         * tune/gcd_finda_gen.c: #undef any HAVE_NATIVE_mpn_gcd_finda.
16790         * configure.in (gmp_mpn_functions_optional): Add gcd_finda.
16791         * mpn/x86/k6/gcd_finda.asm: New file.
16792
16793         * tune/tuneup.c (POWM_THRESHOLD): Slightly bigger size steps.
16794
16795         * gmp-impl.h (__GMP_IMPL_H__): Protect against multiple inclusion.
16796         * tune/gcd_bin.c, tune/powm_mod.c, tune/powm_redc.c: Use #undef after
16797         gmp-impl.h to force thresholds.
16798         * tune/tuneup.c (print_define, fft): No need for #ifndefs on
16799         thresholds any more.
16800
16801 2000-11-20  Torbjorn Granlund  <tege@swox.com>
16802
16803         * mpz/tests/t-powm.c: Analogous changes as made 2000-11-12 to t-mul.c.
16804         * mpz/tests/t-powm_ui.c: Likewise.
16805         * mpz/tests/t-pow_ui.c: Likewise.
16806         * mpz/tests/t-root.c: Likewise.
16807
16808         * configure.in [compiler switch]: Pass "-Aa -D_HPUX_SOURCE" to cc for
16809         all hppa versions.
16810
16811         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Reference data using PC relative
16812         addressing (was r19 relative addressing).
16813
16814 2000-11-18  Torbjorn Granlund  <tege@swox.com>
16815
16816         * rand.c: (__gmp_rand_lc_scheme): Convert strings to hexadecimal.
16817         (gmp_randinit): Expect strings in hexadecimal.
16818
16819 2000-11-18  Kevin Ryde  <kevin@swox.se>
16820
16821         * configfsf.guess, configfsf.sub: Update to 2000-11-16.
16822         * config.guess (alpha*-*-openbsd*): Do exact cpu detection.
16823
16824 2000-11-14  Torbjorn Granlund  <tege@swox.com>
16825
16826         * mpz/tests/t-fdiv.c: Analogous changes as made 2000-11-12 to t-mul.c.
16827         * mpz/tests/t-tdiv_ui.c: Likewise.
16828         * mpz/tests/t-fdiv_ui.c: Likewise.
16829         * mpz/tests/t-sqrtrem.c: Likewise.
16830         * mpz/tests/t-gcd.c: Likewise.
16831
16832 2000-11-13  Kevin Ryde  <kevin@swox.se>
16833
16834         * mpn/Makeasm.am: New file, splitting out assembler rules.
16835         * mpn/Makefile.am, tune/Makefile.am: Use it.
16836
16837         * mpn/Makefile.am (@CPP@): Remove this, automake already gives it.
16838
16839         * configure.in (AC_CHECK_LIBM): New test, and AC_SUBST it.
16840         * Makefile.am (MPFR_LIBADD_OPTION): Use it.
16841         * demos/Makefile.am (qcn_LDADD): Ditto.
16842         * tune/Makefile.am (libspeed_la_LIBADD): Ditto.
16843         * tests/rand/Makefile.am (libstat_la_LIBADD): Ditto.
16844
16845         * tune/time.c (timeval_diff_secs): Better calculation.
16846         (read_real_time): New measuring method for AIX power/powerpc.
16847         (speed_endtime): Protect against negative times.
16848         * tune/common.c (speed_measure): Protect against big reps.
16849         * tune/freq.c (speed_cpu_frequency_measure_one): Better timeval diff.
16850         * tune/speed.h (TIMEVAL_DIFF_SEC,USEC): Remove macros.
16851         * configure.in: (sys/systemcfg.h, read_real_time): New tests.
16852
16853 2000-11-13  Torbjorn Granlund  <tege@swox.com>
16854
16855         * mpz/tests/t-mul.c: Remove #include urandom.h.
16856         * mpz/tests/t-tdiv.c: Likewise.
16857
16858         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]:
16859         Declare hppa.asm as just 32 bits (cyclecounter_size=1).
16860
16861 2000-11-12  Torbjorn Granlund  <tege@swox.com>
16862
16863         * mpz/tests/t-mul.c
16864         (main): Generate random numbers using gmp_rand* functions.
16865         (main): Distribute random numbers non-uniformly.
16866         (main): Seed by current time if GMP_CHECK_RANDOMIZE is set.
16867         (_mpn_mul_classic): Streamline.
16868         * mpz/tests/t-tdiv.c: Analogous changes.
16869
16870         * demos/pexpr.c (HAVE_sigaltstack): Fix typo in testing for _UNICOS.
16871         Also test for __hpux.
16872
16873 2000-11-11  Torbjorn Granlund  <tege@swox.com>
16874
16875         * mpn/alpha/ev5/gmp-mparam.h: Retune.
16876
16877         * mpn/alpha/ev6/gmp-mparam.h: Retune.
16878
16879         * mpn/alpha/ev6/add_n.asm: Misc cleanups.
16880
16881         * mpn/alpha/ev6/sub_n.asm: New file.
16882
16883 2000-11-10  Torbjorn Granlund  <tege@swox.com>
16884
16885         * configure.in [path switch] (alphaev6*-*-*): Add alpha/ev5 to path.
16886
16887         * mpn/alpha/ev6/add_n.asm: New file.
16888
16889 2000-11-10  Kevin Ryde  <kevin@swox.se>
16890
16891         * mpz/powm.c (redc): Make global under WANT_REDC_GLOBAL.
16892         * tune/powm_mod.c, tune/powm_redc.c: New files.
16893         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
16894         * tune/*: Add measuring of redc, mpz_mod, mpz_powm_mod, mpz_powm_redc.
16895
16896         * tune/tuneup.c (POWM_THRESHOLD): Determine from redc and mpz_mod.
16897         * tune/Makefile.am (TUNE_MPZ_SRCS): Remove powm.
16898
16899 2000-11-10  Torbjorn Granlund  <tege@swox.com>
16900
16901         * mpn/mips3/gmp-mparam.h: Retune.
16902
16903         * configure.in (os_64bit): Rename to check_64bit_compiler.
16904
16905 2000-11-09  Torbjorn Granlund  <tege@swox.com>
16906
16907         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Choose hppa/hppa2 code
16908         depending on $CC64.
16909
16910 2000-11-09  Kevin Ryde  <kevin@swox.se>
16911
16912         * mpn/x86/pentium/mul_1.asm: Unroll 2x, saving 1 c/l when in L1.
16913         Add 1c entrypoint.
16914         * mpn/x86/pentium/aorsmul_1.asm: Add 1c entrypoints, shave a couple
16915         of cycles at entry and exit.
16916
16917         * configure.in (power1,2,2sc): Support these as synonyms for plain
16918         power.
16919
16920         * acinclude.m4 (GMP_ASM_X86_SHLDL_CL): GMP_DEFINE WANT_SHLDL_CL here.
16921         (GMP_ASM_X86_MMX, GMP_ASM_X86_SHLDL_CL): Add X86 into the names.
16922         * configure.in: Consequent changes.
16923
16924         * gmp.texi (Notes for Particular Systems): Remarks about power/powerpc.
16925         (Reentrancy): Remarks about simultaneous writing.
16926         (Reporting Bugs): Ask for configfsf.guess.
16927
16928 2000-11-08  Kevin Ryde  <kevin@swox.se>
16929
16930         * acinclude.m4 (GMP_FUNC_ALLOCA): New macro.
16931         * configure.in: Use it.
16932         * gmp-impl.h (alloca): Conditionals and setups as per autoconf
16933         (should make alloca available on more non-gcc compilers).
16934
16935         * acinclude.m4: Misc reformatting, simplify some quoting.
16936         (GMP_ASM_UNDERSCORE, GMP_ASM_X86_MCOUNT): Use $CC $CFLAGS $CPPFLAGS.
16937         (GMP_ASM_UNDERSCORE, GMP_ASM_ALIGN_FILL_0x90, GMP_ASM_RODATA): Put
16938         AC_REQUIREs outside AC_CACHE_CHECK.
16939         (GMP_C_SIZES): Use $srcdir/gmp.h, not -I; use $CPPFLAGS.
16940         (GMP_ASM_UNDERSCORE): Use "gmp_compile" variable, and only rm
16941         conftes1* conftes2*.
16942         (GMP_PROG_NM): New macro, require it in appropriate GMP_ASM_*.
16943         (GMP_TRY_ASSEMBLE): New macro, use it in various GMP_ASM_*.
16944         * configure.in: Use GMP_PROG_NM.
16945
16946         * mpn/tests/spinner.c (spinner_signal): Use RETSIGTYPE.
16947         (spinner_init): Force output to unbuffered.
16948
16949         * mpn/x86/README.family: Notes about GOT table and imul, misc updates.
16950         * mpn/x86/k7/diveby3.asm: Change to 3 operands for immediate imul.
16951         * mpn/x86/k6/diveby3.asm: Ditto.
16952
16953 2000-11-06  Torbjorn Granlund  <tege@swox.com>
16954
16955         * urandom.h: Simplify and make it work properly for 64-bit
16956         machines also in environments without `random'.
16957
16958 2000-11-04  Torbjorn Granlund  <tege@swox.com>
16959
16960         * configure.in [path switch]: Don't match rs6000-*-*, in
16961         particular don't assume POWER.
16962
16963         * tune/tuneup.c (fft): Remove usleep calls.
16964
16965         * config.guess: Don't pass "$@" when it is known to be empty.
16966
16967         * Makefile.am (EXTRA_DIST): List configfsf.guess and configfsf.sub.
16968
16969 2000-11-04  Kevin Ryde  <kevin@swox.se>
16970
16971         * configfsf.guess, configfsf.sub: Moved from config.guess and
16972         config.sub.
16973         * config.guess, config.sub: New files, wrappers around around
16974         configfsf versions.
16975         * configfsf.guess: Update to FSF 2000-10-23.
16976         * configfsf.sub: Update to FSF 2000-10-25.
16977
16978         * acinclude.m4 (GMP_ASM_POWERPC_R_REGISTERS): New macro.
16979         * mpn/powerpc32/powerpc-defs.m4: New file, regmap.m4 r0 etc macros
16980         conditionalized by GMP_ASM_POWERPC_R_REGISTERS.
16981         * mpn/powerpc32/regmap.m4: Remove file.
16982         * configure.in (powerpc*-*-*): Use all this.
16983
16984         * mpz/divegcd.c: New file, providing mpz_divexact_gcd.
16985         * Makefile.am, mpz/Makefile.am: Add it.
16986         * gmp-impl.h (mpz_divexact_gcd): Add prototype.
16987         * mpq/aors.c,canonicalize.c,div.c,mul.c: Use it.
16988
16989         * longlong.h [pentium] (count_leading_zeros): New macro.
16990         (__clz_tab): Always provide prototype.
16991         * acconfig.h (HAVE_TARGET_CPU_): Add x86s.
16992
16993         * tune/speed.[ch],common.c (count_leading_zeros,
16994         count_trailing_zeros, __udiv_qrnnd_c): Add measuring.
16995
16996         * configure.in (X86_PATTERN): Move from here ...
16997         * acinclude.m4 (X86_PATTERN): ... to here.
16998         (GMP_ASM_RODATA): Use it.
16999
17000         * configure.in (srandom): New test.
17001         * mpn/tests/try.c: Use it.
17002         * tune/speed.c: Ditto, and conditionalize getrusage and headers.
17003
17004 2000-11-02  Kevin Ryde  <kevin@swox.se>
17005
17006         * mpn/Makefile.am (nodist_libdummy_la_SOURCES): Add udiv_qrnnd.c
17007         and udiv_w_sdiv.c.
17008
17009         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Remove a duplicate
17010         subtract at the evaluate stage.
17011
17012 2000-11-01  Torbjorn Granlund  <tege@swox.com>
17013
17014         * configure.in [compiler switch] (sparc64-*-linux*): Spell
17015         gmp_xoptcflags_gcc properly, and pass same options as for other
17016         sparcv9 configs.
17017
17018         * tune/speed.h (SPEED_ROUTINE_MPN_GET_STR): Fix type of wsize.
17019
17020 2000-10-31  Torbjorn Granlund  <tege@swox.com>
17021
17022         * configure.in [compiler switch] (sparc64-*-linux*): Remove -mvis
17023         from gmp_xoptflags_gcc, this might not be an ultrasparc.
17024         Remove -m32 from gmp_cflags_gcc; add -Wa,-xarch=v8plus.
17025
17026 2000-10-29  Torbjorn Granlund  <tege@swox.com>
17027
17028         * mpn/ia64/lorrshift.asm: New file.
17029
17030         * configure.in: New mulfunc `lorrshift' for lshift and rshift.
17031
17032 2000-10-29  Kevin Ryde  <kevin@swox.se>
17033
17034         * mpn/generic/mul_n.c (mpn_kara_sqr_n): Delete code performing
17035         superfluous mpn_sub_n calls.
17036
17037         * configure.in (found_asm, M4): Account for SPEED_CYCLECOUNTER_OBJ,
17038         for the benefit of targets whose only .asm is a cycle counter.
17039
17040         * tune/tuneup.c (fft): Remove bogus usleep calls.
17041
17042 2000-10-28  Torbjorn Granlund  <tege@swox.com>
17043
17044         * mpn/ia64/invert_limb.asm: Get return value for 0x800...00 right.
17045
17046         * tune/Makefile.am (EXTRA_DIST): Add ia64.asm.
17047
17048         * tune/ia64.asm: Fix typo.
17049
17050         * add_n.asm addmul_1.asm mul_1.asm popcount.asm sub_n.asm:
17051         Preserve ar.lc as required by ABI.
17052         * longlong.h (ia64 udiv_qrnnd): New.
17053
17054         * configure.in [path switch] (ia64*-*-*): Set extra_functions.
17055         * mpn/ia64/invert_limb.asm: New file.
17056
17057 2000-10-27  Torbjorn Granlund  <tege@swox.com>
17058
17059         * configure.in [compiler switch]:
17060         Get rid of c89 for all hppa flavours--it is an evil compiler!
17061
17062         * tune/speed.h (SPEED_ROUTINE_MPN_SET_STR): Fix type of xp.
17063         (SPEED_ROUTINE_MPN_GET_STR): Fix type of wp.
17064
17065 2000-10-27  Kevin Ryde  <kevin@swox.se>
17066
17067         * gmp.texi (Fibonacci Number Algorithm): New section.
17068
17069         * mpz/tests/t-fib_ui.c: New file.
17070         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
17071
17072         * mpz/fib_ui.c: Rewrite, same formulas but using mpn functions and
17073         some lookup tables, much faster at small to moderate sizes.
17074         * gmp-impl.h (MPZ_FIB_SIZE): New macro.
17075         (FIB_THRESHOLD): Establish default here.
17076         * tune/tuneup.c (FIB_THRESHOLD): Start search after the new table
17077         data.
17078
17079         * mpn/x86/x86-defs.m4 (mcount_movl_GOT_ebx): Rename from movl_GOT_ebx,
17080         and don't use GSYM_PREFIX with _GLOBAL_OFFSET_TABLE_.
17081
17082         * tune/freq.c (speed_cpu_frequency_measure): New test comparing
17083         gettimeofday and speed_cyclecounter, should cover many systems.
17084
17085 2000-10-27  Torbjorn Granlund  <tege@swox.com>
17086
17087         * mpn/ia64/gmp-mparam.h: Retune.
17088
17089 2000-10-26  Torbjorn Granlund  <tege@swox.com>
17090
17091         * longlong.h (ia64): Set UMUL_TIME and UDIV_TIME.
17092
17093         * mpn/ia64/submul_1.c: Fix typo.
17094
17095 2000-10-25  Kevin Ryde  <kevin@swox.se>
17096
17097         * tune/freq.c (speed_cpu_frequency_sysctl): New test, supporting
17098         hw.model for BSD flavours.
17099         * configure.in (sysctl, sys/param.h): New tests.
17100
17101 2000-10-24  Torbjorn Granlund  <tege@swox.com>
17102
17103         * tune/freq.c: Explicitly #include config.h before other include files.
17104
17105         * mpz/tests/reuse.c (FAIL2): New #define.
17106         (main): Use FAIL2.  Now this test properly returns non-zero exit
17107         status when it fails.
17108
17109         * mpn/powerpc32/gmp-mparam.h: Retune.
17110         * mpn/powerpc64/gmp-mparam.h: Retune.
17111
17112 2000-10-24  Kevin Ryde  <kevin@swox.se>
17113
17114         * mpn/x86/k6/cross.pl: Support 8 and 16 byte code alignment.
17115
17116         * mpq/aors.c, mpq/canonicalize.c: Skip two mpz_divexact calls if
17117         gcd gives 1, which should be 60% of the time.
17118         * gmp-impl.h (MPZ_EQUAL_1_P): New macro.
17119         * mpq/mul.c, mpq/div.c: Use it, and a new DIV_OR_SET.
17120
17121         * tune/tuneup.c (xp_block, yp_block): Initialize these with random
17122         data.  Fixes GCD_ACCEL and GCDEXT thresholds, and latest POWM.
17123
17124 2000-10-23  Torbjorn Granlund  <tege@swox.com>
17125
17126         * configure.in [SPEED_CYCLECOUNTER_OBJS switch]: Add ia64 case.
17127
17128         * mpn/ia64/gmp-mparam.h: Fill in some parameters.
17129
17130         * mpn/ia64/submul_1.c: New file.
17131
17132         * tune/ia64.asm: New file.
17133
17134         * gmp-impl.h (union ieee_double_extract): Handle ia64.
17135
17136         * mpn/mp_bases.c: Decrease chars_per_bit_exactly for entry 1 to
17137         work around buggy ia64-linux.
17138
17139         * longlong.h (ia64 umul_ppmm): Update register flags to match new GCC.
17140
17141 2000-10-22  Torbjorn Granlund  <tege@swox.com>
17142
17143         * mpn/alpha/ev6/gmp-mparam.h (DC_THRESHOLD): Update.
17144         * mpn/alpha/ev6/submul_1.asm: New file.
17145
17146 2000-10-22  Kevin Ryde  <kevin@swox.se>
17147
17148         * tune/gcd_bin.c: New file.
17149         * tune/gcd_finda_gen.c: New file.
17150         * tune/Makefile.am (libspeed_la_SOURCES): Add them.
17151         * tune/speed.[ch],common.c (mpn_gcd_binary, find_a): Add measuring.
17152
17153         * * (__gmp_allocate_func etc): Rename from _mp_allocate_func etc.
17154         (__gmp_default_allocate etc): Rename from _mp_default_allocate etc.
17155         * gmp-impl.h (__GMP_REALLOCATE_FUNC_TYPE,
17156         __GMP_REALLOCATE_FUNC_LIMBS): New macros.
17157
17158         * gmp-impl.h (DC_THRESHOLD): Establish default here, set to 3*KARA
17159         since that's the measured average.
17160         * mpn/generic/dc_divrem_n.c, mpn/generic/tdiv_qr.c (DC_THRESHOLD):
17161         Remove default.
17162
17163 2000-10-21  Torbjorn Granlund  <tege@swox.com>
17164
17165         * mpn/Makefile.am (TARG_DIST): Add ia64.
17166
17167 2000-10-21  Kevin Ryde  <kevin@swox.se>
17168
17169         * *: Change BZ -> DC.
17170         * mpn/generic/dc_divrem_n.c: Renamed from bz_divrem_n.c.
17171
17172         * doc/multiplication: Remove file, now in the manual.
17173         * doc/assembly_code: Ditto.
17174         * tune/README: Remove some parts now in the manual.
17175
17176         * gmp.texi (@m etc): Add and use some new macros.
17177         (Integer Division - mpz_[cft]div_*): Merge descriptions, for brevity
17178         and to emphasise similarities.
17179         (Low-Level Functions - mpn_[lr]shift): Specify count as 1 to
17180         mp_bits_per_limb-1.
17181         (Algorithms): New chapter.
17182         (References): Add some papers.
17183
17184         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Remove some
17185         unused variables.
17186         * mpn/generic/mul_fft.c (mpn_fft_best_k): Ditto.
17187
17188         * tune/freq.c: New file, split from time.c.
17189         * tune/time.c: Rewrite, now more automated.
17190         * configure.in, tune/*: Consequent changes.
17191
17192 2000-10-20  Torbjorn Granlund  <tege@swox.com>
17193
17194         * mpn/ia64/default.m4: New file.
17195         * configure.in [config.m4 switch] (ia64*-*-*): Use ia64/default.m4.
17196
17197         * mpn/ia64/mul_1.asm: New file.
17198         * mpn/ia64/addmul_1.asm: New file.
17199         * mpn/ia64/add_n.asm: New file.
17200         * mpn/ia64/sub_n.asm: New file.
17201         * mpn/ia64/popcount.asm: New file.
17202         * mpn/ia64/README: New file.
17203
17204         * mpn/alpha/cntlz.asm: Override `.set noat' from ASM_START.
17205
17206         * configure.in (HAVE_TARGET_CPU_*): Support hppa1.0, hppa1.1, hppa2.0
17207         by sed'ing the period into `_'.
17208
17209         * acconfig.h: Add #undefs for hppa targets.
17210
17211         * longlong.h (udiv_qrnnd): Fix typo in last change.
17212
17213         * mpz/tstbit.c: Rewrite (partly to work around GCC 2.95.2 HPPA bug).
17214
17215         * configure.in [path switch]:
17216         (hppa2.0*-*-*): For non-CC64 case, update path.
17217
17218         * configure.in [compiler switch]:
17219         (hppa2.0w-*-*): Match with same regexp in both places.
17220         (hppa*-*-*): New case.
17221         (all hppa alternatives): Don't inherit default gmp_cflags_cc,
17222         gmp_cflags_c89.
17223
17224 2000-10-18  Torbjorn Granlund  <tege@swox.com>
17225
17226         * configure.in (alpha*-*-*): Define gmp_xoptcflags_gcc like for
17227         alpha*-*-osf*.
17228
17229         * longlong.h (x86 udiv_qrnnd): Change `d' => `dx' to avoid K&R C
17230         stringification.
17231
17232 2000-10-15  Kevin Ryde  <kevin@swox.se>
17233
17234         * doc/configuration: Updates.
17235
17236         * demos/calc.y: Remove some comments.
17237
17238 2000-10-14  Kevin Ryde  <kevin@swox.se>
17239
17240         * gmp.texi (Parameter Conventions, Memory Management): New sections
17241         split from "Variable Conventions".
17242         (Efficiency, Debugging, Profiling): New sections in "GMP Basics".
17243         (Reentrancy): Some rewording, add note on standard I/O.
17244         (Build options): Add --enable-assert and --enable-profiling.
17245
17246         * configure.in (--enable-profiling): New option.
17247         * acinclude.m4 (GMP_ASM_X86_MCOUNT): New macro, finding how to profile.
17248         * mpn/x86/x86-defs.m4 (PROLOGUE_cpu, call_mcount): Profiling support.
17249
17250         * acinclude.m4, configure.in (GMP_ASM_*): Rename from GMP_CHECK_ASM_*,
17251         to follow autoconf conventions.
17252
17253         * configure.in: Run GMP_CHECK_ASM tests only if needed.
17254         * acinclude.m4 (GMP_CHECK_ASM_MMX): Don't use GMP_CHECK_ASM_TEXT.
17255
17256         * mpn/x86/x86-defs.m4 (ASSERT): Allow no condition, to just emit code.
17257
17258 2000-10-13  Kevin Ryde  <kevin@swox.se>
17259
17260         * mpq/md_2exp.c: New file.
17261         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
17262         * Makefile.am (MPQ_OBJECTS): Ditto.
17263         * gmp.h (mpq_mul_2exp, mpq_div_2exp): Add prototypes.
17264         * gmp.texi (Rational Arithmetic): Add documentation.
17265
17266         * mpq/tests/t-md_2exp.c: New file.
17267         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
17268
17269         * mpn/generic/perfsqr.c: Add/amend some comments.
17270
17271         * gmp.texi (Known Build Problems): Note VERSION problem with old
17272         sed, do some minor rewording.
17273         (Build Options): Add cygwin and djgpp URLs, mention INSTALL.autoconf,
17274         mention HTML.
17275         (Getting the Latest Version of GMP): Move this ...
17276         (Introduction to GMP): ... to here.
17277         (Compatibility with older versions): Just refer to 2.x and 3.x, not
17278         every minor version.
17279         (Initializing Integers): Note restrictions on mpz_array_init'ed
17280         variables.
17281         (Integer Logic and Bit Fiddling): Note bits are numbered from 0.
17282
17283         * INSTALL.autoconf: New file.
17284         * Makefile.am (EXTRA_DIST): Add it.
17285
17286         * tune/Makefile.am, tune/tuneup.c, configure.in, gmp-impl.h: New
17287         scheme for recompiled objects used by tune program.  Don't use
17288         libgmptune.a, make better use of libtool, work with ansi2knr.
17289
17290         * tune/speed.h,common.c (SPEED_ROUTINE_MPZ_POWM): Use s->yp and
17291         s->xp_block, make exponent a fixed size.
17292
17293 2000-10-07  Torbjorn Granlund  <tege@swox.com>
17294
17295         * mpn/mips3/gmp-mparam.h: Retune.
17296
17297         * mpn/generic/mul_n.c (USE_MORE_MPN): Revert last change.
17298
17299 2000-10-06  Torbjorn Granlund  <tege@swox.com>
17300
17301         * mpn/mips3/add_n.s: Decrease carry recurrence from 4 to 3 cycles.
17302         * mpn/mips3/sub_n.s: Likewise.
17303
17304 2000-10-04  Torbjorn Granlund  <tege@swox.com>
17305
17306         * configure.in (sparc64-*-linux*): Set path according to CC64.
17307
17308 2000-10-04  Kevin Ryde  <kevin@swox.se>
17309
17310         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Use LABEL_SUFFIX, not a
17311         hard-coded ":".
17312
17313         * config.sub: Don't demand "86" in CPU name for SCO.
17314
17315         * configure.in (supersparc-*-*): Remove -DSUPERSPARC.
17316         * longlong.h: Use HAVE_TARGET_CPU_supersparc.
17317
17318         * configure.in (HAVE_TARGET_CPU_*): AC_DEFINE from $target_cpu.
17319         * acconfig.h: Add #undefs, but only for targets of interest.
17320
17321 2000-10-03  Torbjorn Granlund  <tege@swox.com>
17322
17323         * mpn/alpha/cntlz.asm: Rewrite.
17324
17325         * mp_clz_tab.c (__clz_tab): Half table size to 128 entires.
17326         * longlong.h (count_leading_zeros): Demand just 128 entries from
17327         __clz_tab.
17328
17329         * configure.in (mips-sgi-irix6.*): Pass -mips3 in addition to options
17330         for n32 ABI.
17331
17332         * longlong.h: Move NO_ASM test around all assembly code.
17333         From gcc:
17334         * longlong.h (count_leading_zeros): Sparclite scan instruction was
17335         being invoked incorrectly.
17336         Replace __mc68332__ with __mcpu32__.
17337         Add ARC support.
17338
17339 2000-10-02  Torbjorn Granlund  <tege@swox.com>
17340
17341         * mpn/mips3/gmp-mparam.h: Retune for both gcc and cc.
17342
17343         * mpn/generic/mul_n.c (USE_MORE_MPN): Remove exception for __mips.
17344         (interpolate3): Cast mp_limb_t variables to mp_limb_signed_t
17345         when testing sign bit.
17346
17347         * mpn/alpha/ev6/gmp-mparam.h: Retune.
17348         * mpn/powerpc32/gmp-mparam.h: Retune.
17349         * mpn/powerpc64/gmp-mparam.h: Retune.
17350         * mpn/x86/pentium/gmp-mparam.h: Retune.
17351         * mpn/x86/pentium/mmx/gmp-mparam.h: Retune.
17352         * mpn/sparc32/v9/gmp-mparam.h: Retune.
17353         * mpn/x86/k6/gmp-mparam.h: Retune.
17354         * mpn/x86/p6/gmp-mparam.h: Retune.
17355         * mpn/x86/k7/gmp-mparam.h: Retune.
17356         * mpn/sparc64/gmp-mparam.h: Retune.
17357
17358         * mpn/m68k/gmp-mparam.h: New file.
17359         * mpn/alpha/ev5/gmp-mparam.h: New file.
17360
17361         * gmp-impl.h (default MPN_COPY): Remove final `;'.
17362
17363         * tune/time.c (speed_endtime): Rewrite.
17364
17365         * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Set base to a large value,
17366         not 2.
17367
17368         * demos/pexpr.c (setup_error_handler): Fix typo.
17369
17370         * mpz/powm.c (redc): New function, based on old mpz_redc.  Don't
17371         multiply here.
17372         (mpz_redc): Remove.
17373         (mpz_powm): Major changes, partially reverting to mpn calls.
17374         Multiply before calling redc.
17375         (mpz_powm): Use TMP_ allocation.
17376         (mpz_powm): Refine calculation of k (width of exponent window).
17377         (mpz_powm): Cast constants to mp_limb_t before left shifting.
17378
17379         * longlong.h: Use ia64 count_leading_zeros just when __GNUC__.
17380
17381 2000-09-29  Kevin Ryde  <kevin@swox.se>
17382
17383         * acinclude.m4 (GMP_C_SIZES): New macro.
17384         * configure.in: Use it.
17385         * acconfig.in (BYTES_PER_MP_LIMB etc): Add #undefs.
17386         * mpn/generic/gmp-mparam.h (BYTES_PER_MP_LIMB etc): Remove #defines.
17387         * gmp.texi (Known Build Problems): Remove 64-bit generic C
17388         gmp-mparam.h problem, now fixed.
17389
17390         * configure.in: Only run GMP_PROG_M4 if it's actually needed.
17391
17392 2000-09-27  Torbjorn Granlund  <tege@swox.com>
17393
17394         * demos/pexpr.c: Clean up code for systems not supporting
17395         sigaltstack.  Handle old Linux without sigaltstack.  Properly
17396         disable all stuff related to sigaltstack under Unicos.
17397
17398         * mpn/alpha/ev6/addmul_1.asm: Use explicit offset for all load and
17399         store insns.  Helps old gas.
17400
17401         * longlong.h (count_leading_zeros): Define for ia64.
17402
17403 2000-09-27  Paul Zimmermann  <Paul.Zimmermann@loria.fr>
17404
17405         * mpn/generic/bz_divrem_n.c: Fix qhl handling, simplify.
17406
17407 2000-09-27  Kevin Ryde  <kevin@swox.se>
17408
17409         * mpn/Makefile.in (.SUFFIXES): Regenerate with patched automake to
17410         get .s before .c, which is needed to override ansi2knr .c rules.
17411
17412         * gmp.texi (mpn_sqrtrem): Fix r2p==NULL return value description
17413         to match the code (change by Torbjorn).
17414         (mpn_gcd, mpn_gcdext, mpn_sqrtrem, mpn_tdiv_qr): Note most
17415         significant limbs must be non-zero.
17416         (mpn_gcd, mpn_gcdext, mpn_sqrtrem): Clarify destination size
17417         requirements.
17418         (mpn_gcd_1): Clarify value must be non-zero, not just size.
17419
17420         * gmp-impl.h (mpn_zero_p): New inline function.
17421         * mpn/generic/inlines.c: Add gmp-impl.h.
17422         * mpf/integer.c, mpz/get_d.c, mpn/generic/mul_fft.c: Use it.
17423
17424         * mpn/generic/gcd.c: Use MPN_COPY_INCR not MPN_COPY.
17425         * mpf/add_ui.c: Ditto.
17426         * mpf/add.c: Ditto, and fix test to skip copy.
17427
17428 2000-09-26  Kevin Ryde  <kevin@swox.se>
17429
17430         * gmp-impl.h, longlong.h, mpn/generic/*.c: Add ASSERTs for various
17431         parameter restrictions.
17432
17433         * gmp-impl.h (UDIV_PREINV_TIME): New macro.
17434         * mpn/generic/sb_divrem_mn.c: Use it.
17435         * mpn/generic/perfsqr.c: Ditto.
17436         * mpn/x86/*/gmp-mparam.h (UDIV_PREINV_TIME): Add values.
17437
17438         * macos/Makefile.in: Add mpz/tests/t-get_si.c, mpf/tests/t-set_f.c,
17439         and new multi-function mpz and mpq files.
17440
17441 2000-09-25  Kevin Ryde  <kevin@swox.se>
17442
17443         * randlc.c, randlc2x.c, randsd.c, mpz/urandomb.c, mpz/urandomm.c:
17444         Use mpz_ptr and mpz_srcptr for parameters.
17445         * gmp.h (gmp_randinit_lc, gmp_randinit_lc_2exp, gmp_randseed,
17446         mpz_urandomb, mpz_urandomm): Corresponding change to prototypes.
17447         * randsdui.c: Remove wrong K&R parameters part.
17448
17449 2000-09-12  Kevin Ryde  <kevin@swox.se>
17450
17451         * gmp-impl.h (mpn_tdiv_qr): Move prototype from here ...
17452         * gmp.h (mpn_tdiv_qr): ... to here.
17453
17454         * gmp.texi (Miscellaneous Rational Functions): Comment-out and
17455         move version 1 compatibility note to "Compatibility" section.
17456         (Rational Number Functions): Ditto for canonicalization note.
17457
17458 2000-09-10  Kevin Ryde  <kevin@swox.se>
17459
17460         * mpn/x86/pentium/com_n.asm: New file.
17461
17462         * gmp.texi (Rational Arithmetic): Add mpq_abs.
17463         (Miscellaneous Rational Functions): Merge and simplify descriptions of
17464         mpq_get_num, mpq_get_den, mpq_set_num, mpq_set_den.
17465
17466         * mpq/abs.c: New file.
17467         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
17468         * Makefile.am (MPQ_OBJECTS): Add it.
17469         * gmp.h (mpq_abs): Add prototype.
17470
17471         * mpq/set_den.c: Don't discard sign when copying, this makes the
17472         code match the manual.
17473
17474 2000-09-07  Torbjorn Granlund  <tege@swox.com>
17475
17476         * tune/alpha.asm: Rewrite to actually work right.
17477
17478 2000-09-07  Kevin Ryde  <kevin@swox.se>
17479
17480         * tune/common.c,speed.[ch]: Add measuring of mpn_sqrtrem,
17481         mpn_get_str, mpn_set_str.
17482         * tune/README: Various updates.
17483
17484 2000-09-06  Torbjorn Granlund  <tege@swox.com>
17485
17486         * mpz/fits.c: Correct type of `data'.
17487
17488 2000-09-06  Kevin Ryde  <kevin@swox.se>
17489
17490         * gmp.texi (Build Options): Clarify where to find CFLAGS.
17491         (Known Build Problems): Note SCO -lc problem.
17492
17493         * tune/speed.h (SPEED_ROUTINE_MPN_GCD_CALL): Fix for sizes > 512 limbs.
17494
17495         * doc/multiplication: Corrections and additions suggested by Paul.
17496
17497         * tune/modlinv.c: New file with alternate modlimb_inverts.
17498         * tune/Makefile.am, tune/speed.[ch]: Add measuring of them.
17499         * tune/speed.c (FLAG_NODATA): New attribute, use for mpz_bin_uiui,
17500         mpz_fib_ui, mpz_fac_ui.
17501
17502         * mpn/x86/t-zdisp.sh: New file.
17503
17504         * tests/t-modlinv.c: New file.
17505         * tests/Makefile.am (check_PROGRAMS): Add it.
17506
17507         * mpq/tests/t-set_f.c: New file.
17508         * mpq/tests/Makefile.am (check_PROGRAMS): Add it.
17509
17510         * gmp-impl.h (MPQ_CHECK_FORMAT): New macro.
17511         * mpq/tests/t-get_d.c: Use it.
17512
17513         * mpq/set_f.c: New file.
17514         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
17515         * Makefile.am (MPQ_OBJECTS): Ditto.
17516         * gmp.h: Add prototype.
17517         * gmp.texi (Miscellaneous Rational Functions): Document mpq_set_f,
17518         correct return type of mpq_set_d.
17519
17520 2000-09-03  Kevin Ryde  <kevin@swox.se>
17521
17522         * mpz/aors_ui.c: New file merging add_ui.c and sub_ui.c, no object
17523         code changes.
17524         * mpz/add_ui.c, mpz/sub_ui.c: Remove files.
17525         * mpz/Makefile.am: Update.
17526
17527         * gmp-impl.h (MPZ_FITS_STYPE_SDT, MPZ_FITS_UTYPE_SDT): New macros.
17528         * mpz/fits.c: New file merging six separate fits*.c.
17529         * mpz/fits_sshort_p.c, fits_sint_p.c, fits_slong_p.c, fits_ushort_p.c,
17530         fits_uint_p.c, fits_ulong_p.c: Remove files
17531         * mpz/Makefile.am: Use new fits.c, change object names from
17532         fits_*_p.lo to fits_*.lo to avoid SunOS 4 native "ar" warnings.
17533         * Makefile.am (MPZ_OBJECTS): Change from fits_*_p.lo to fits_*.lo.
17534
17535         * acinclude.m4 (GMP_CHECK_ASM_RODATA): New macro, defining RODATA.
17536         * configure.in: Use it.
17537         * mpn/x86/k[67]/mmx/popham.asm: Use it.
17538
17539         * mpn/x86/*/*.asm: Use "TEXT" not ".text".
17540
17541 2000-09-02  Kevin Ryde  <kevin@swox.se>
17542
17543         * mpq/aors.c: New file merging add.c and sub.c, no object code changes.
17544         * mpq/add.c, mpq/sub.c: Remove files.
17545         * mpq/Makefile.am: Update.
17546
17547         * mpz/aors.c: New file merging add.c and sub.c, no object code changes.
17548         * mpz/add.c, mpz/sub.c: Remove files.
17549         * mpz/Makefile.am, mpbsd/Makefile.am: Update.
17550
17551         * configure.in: Re-apply "PROLOGUE.*" regexp change for the
17552         benefit of alpha PROLOGUE_GP, lost in path search reorganisation.
17553
17554         * mpn/x86/x86-defs.m4 (jadcl0, cmov_simulate, ASSERT,
17555         movl_text_address): Don't use "1:" style labels.
17556         (Zdisp): Rearrange a bit, switch to all hex.
17557         * mpn/x86/README.family: Note SCO "as" doesn't support "1:" style
17558         local labels, misc rewordings.
17559
17560 2000-08-29  Torbjorn Granlund  <tege@swox.com>
17561
17562         * demos/primes.c: Include string.h.
17563
17564         * config.guess (x86 variant recog code): Remove dummy*.o files
17565         generated by some compilers.
17566
17567 2000-08-28  Kevin Ryde  <kevin@swox.se>
17568
17569         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix Solaris 2.8
17570         warning message suppression, add notes about SCO.
17571
17572         * Makefile.am (MPZ_OBJECTS etc): Move some comments.
17573
17574 2000-08-25  Kevin Ryde  <kevin@swox.se>
17575
17576         * mpz/pprime_p.c (mpz_millerrabin): Fix a TMP_FREE.
17577
17578         * gmp.texi (Copying): Refer to Lesser not Library GPL.
17579         (GMP and Reentrancy): Note stack-alloc.c is not reentrant, and
17580         that SCO <ctype.h> is potentially not reentrant.
17581
17582         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Test by attempting to
17583         link with or without an underscore.
17584         * gmp.texi (Known Build Problems): Remove SunOS 4 native grep
17585         GSYM_PREFIX problem, now fixed.
17586
17587         * gmp-impl.h (MODLIMB_INVERSE_3): New constant.
17588         * mpn/generic/diveby3.c: Use it instead of own INVERSE_3.
17589         * mpn/generic/mul_n.c: Ditto.
17590         * tests/t-constants.c: Check it, and PP_INVERTED too.
17591
17592         * acinclude.m4 (GMP_GCC_MARCH_PENTIUMPRO): New macro.
17593         * configure.in [p6 and athlon] (gmp_optcflags_gcc): Use it to
17594         possibly add -march=pentiumpro.
17595
17596         * gmp-impl.h (MPZ_SET_STR_OR_ABORT, MPF_SET_STR_OR_ABORT): New macros.
17597         * mpz/tests/t-bin.c, mpz/tests/t-get_si.c, mpz/tests/t-jac.c,
17598         mpz/tests/t-misc.c: Use them.
17599         * mpf/tests/t-conv.c, mpf/tests/t-misc.c: Ditto.
17600         * mpz/tests/convert.c: Ditto and amend diagnostics slightly.
17601         * mpz/tests/t-misc.c (check_mpz_set_si): Remove a superfluous init.
17602         * mpz/tests/io.c: Differentiate between I/O and data conversion errors.
17603
17604         * mpn/generic/aors_n.c: New file merging add_n and sub_n, no
17605         object code changes.
17606         * mpn/generic/add_n.c: Remove file.
17607         * mpn/generic/sub_n.c: Remove file.
17608
17609         * mpn/generic/aorsmul_1.c: New file merging addmul_1 and submul_1,
17610         no object code changes.
17611         * mpn/generic/addmul_1.c: Remove file.
17612         * mpn/generic/submul_1.c: Remove file.
17613
17614         * mpn/generic/popham.c: New file merging popcount and hamdist, no
17615         object code changes.
17616         * mpn/generic/popcount.c: Remove file.
17617         * mpn/generic/hamdist.c: Remove file.
17618
17619 2000-08-24  Torbjorn Granlund  <tege@swox.com>
17620
17621         * gmp-impl.h (mpn_com_n): Fix typo.
17622
17623 2000-08-23  Torbjorn Granlund  <tege@swox.com>
17624
17625         * demos/primes.c (main): Don't call mpz_probab_prime_p for numbers
17626         that are known to be prime after sieving.
17627         (main): Declare and initialize max_s_prime_squared.
17628         (MAX_S_PRIME): Increase.
17629         (ST_SIZE): Increase.
17630
17631 2000-08-23  Kevin Ryde  <kevin@swox.se>
17632
17633         * gmp-impl.h (ASSERT_ALWAYS): Change to statement style.
17634         (JACOBI_TWO_U_BIT1): Remove ASSERT.
17635         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS as a statement.
17636
17637 2000-08-21  Torbjorn Granlund  <tege@swox.com>
17638
17639         * gmp-impl.h (ASSERT): Use do..while for dummy version.
17640
17641         * mpf/get_str.c: Don't set n_digits from digits_computed_so_far
17642         when the converted operand becomes zero.  Misc cleanups.
17643
17644 2000-08-21  Kevin Ryde  <kevin@swox.se>
17645
17646         * mpz/fdiv_r_2exp.c, mpz/lcm.c, mpz/urandomm.c: Add missing
17647         TMP_MARK/FREE, avoiding memory leak when using stack-alloc.c.
17648
17649 2000-08-20  Kevin Ryde  <kevin@swox.se>
17650
17651         * mpz/set.c [BERKELEY_MP] (move): Add conditionals to build as
17652         "move" for libmp.
17653         * mpbsd/Makefile.am: Use mpz/set.c, not move.c.
17654         * Makefile.am (MPBSD_OBJECTS): Corresponding change.
17655         * mpbsd/move.c: Remove file.
17656
17657         * mpn/Makefile.am, mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am,
17658         mpbsd/Makefile.am (-DOPERATION_foo): Use "foo" even for ansi2knr
17659         "foo_" objects.  Do this with the makefiles to keep the sources
17660         cleaner.
17661         * mpz/mul_siui.c, mpf/integer.c: Revert to plain OPERATION_* forms.
17662
17663         * mpn/lisp/gmpasm-mode.el (gmpasm-remove-from-list): Renamed from
17664         gmpasm-delete-from-list, because it's non-destructive.
17665         (gmpasm-font-lock-keywords): Add some more keywords.
17666
17667 2000-08-16  Kevin Ryde  <kevin@swox.se>
17668
17669         * tune/mul_n_mpn.c, tune/mul_n_open.c: New files, being forced
17670         open-coded and mpn #includes of mpn/generic/mul_n.c.
17671         * tune/*: Add measuring of them.
17672         * tune/speed.c: Print command line into *.gnuplot file.
17673
17674         * mpn/generic/mul_n.c (USE_MORE_MPN): Change to #if not #ifdef for
17675         using the value, add #ifndef for providing the default.
17676         * mpn/sparc64/gmp-mparam.h (USE_MORE_MPN): Add #ifndef.
17677
17678         * tests/t-constants.c: New file.
17679         * tests/Makefile.am (check_PROGRAMS): Add it.
17680
17681         * mpz/get_si.c: Use LONG_MAX, not BITS_PER_MP_LIMB, so the result
17682         doesn't depend on limb size when outside the range of a long
17683         (though such results are not actually documented).
17684         * mpz/tests/t-get_si.c: New file.
17685         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
17686
17687         * mpn/tests/try.c (call): Cast popcount and hamdist calls,
17688         for the benefit of long long limb.
17689
17690 2000-08-15  Kevin Ryde  <kevin@swox.se>
17691
17692         * mp.h (mp_set_memory_functions): Add missing #define.
17693         * mpbsd/tests/allfuns.c (mp_set_memory_functions): Verify its
17694         existence.
17695
17696         * mpf/tests/t-misc.c (check_mpf_getset_prec): New test, verifying
17697         reverted behaviour of mpf_get_prec.
17698
17699         * mpn/tests/ref.c (refmpn_strip_twos): Use refmpn_copyi, not
17700         MPN_COPY_INCR.
17701
17702         * mpz/mul_siui.c, mpf/integer.c: Recognise OPERATION_*_ forms
17703         produced under ansi2knr.
17704
17705         * configure.in (mpn_objects, mpn_objs_in_libgmp): Add $U to .c
17706         objects when ansi2knr in use.
17707
17708         * mpn/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
17709         (libdummy.la): Add this, not built, to create ansi2knr style rules
17710         for all potential .c files.
17711         * mpz/Makefile.am, mpq/Makefile.am, mpf/Makefile.am, mpfr/Makefile.am,
17712         mpbsd/Makefile.am, mpq/tests/Makefile.am, tests/Makefile.am
17713         (AUTOMAKE_OPTIONS): Enable ansi2knr (now everywhere).
17714         * Makefile.am (MPZ_OBJECTS, MPQ_OBJECTS, MPF_OBJECTS, MPFR_OBJECTS,
17715         MPBSD_OBJECTS, libmp_la_DEPENDENCIES): Add $U to all .lo filenames.
17716
17717 2000-08-03  Torbjorn Granlund  <tege@swox.com>
17718
17719         * mpn/alpha/ev6/addmul_1.asm: Correct number of cycles to 3.5/28.
17720
17721 2000-08-02  Torbjorn Granlund  <tege@swox.com>
17722
17723         * Version 3.1 released.
17724
17725         * gmp.texi: Rephrase mpf_urandomb documentation.
17726
17727         * mpn/alpha/ev6: New directory with ev6/21264 optimized code.
17728         * mpn/alpha/ev6/addmul_1.asm: New file.
17729         * mpn/alpha/ev6/gmp-mparam.h: New file.
17730
17731 2000-08-02  Kevin Ryde  <kevin@swox.se>
17732
17733         * demos/factorize.c (random): Don't use "inline".
17734
17735         * mpfr/log.c, mpfr/mul_ui.c, mpfr/round.c, mpfr/set.c, mpfr/set_d.c:
17736         Corrections to K&R parts.
17737
17738         * Makefile.am (EXTRA_HEADERS): Omit $(MPFR_HEADERS_OPTION).
17739         * mpfr/Makefile.am (EXTRA_DIST): Add mpfr.h.
17740
17741         * gmp.texi (Known Build Problems): Note problem stripping libgmp.a.
17742
17743 2000-08-02  Kent Boortz  <kent@swox.com>
17744
17745         * mpfr: Integrated experimental version of mpfr-0.4.
17746         * configure.in: Changes for option --enable-mpfr.
17747         * Makefile.am: Changes for option --enable-mpfr.
17748
17749 2000-08-01  Torbjorn Granlund  <tege@swox.com>
17750
17751         * mpn/generic/popcount.c: Disable SPARC v9 popc_limb pattern.
17752         * mpn/generic/hamdist.c: Likewise.
17753
17754 2000-08-01  Kevin Ryde  <kevin@swox.se>
17755
17756         * mpn/tests/try.c (try_init): Account for ALIGNMENTS when sizing
17757         source and dest regions.
17758
17759 2000-07-31  Torbjorn Granlund  <tege@swox.com>
17760
17761         * mpf/get_str.c: Develop three extra digits, not just one.
17762
17763 2000-07-31  Kevin Ryde  <kevin@swox.se>
17764
17765         * gmp.texi (References): Add URL for invariant division.
17766
17767 2000-07-30  Kevin Ryde  <kevin@swox.se>
17768
17769         * tune/time.c (speed_cpu_frequency_proc_cpuinfo): Add support for
17770         alpha linux "cycle frequency".
17771
17772         * mpn/sparc64/gmp-mparam.h: Re-run tune program for FFT thresholds.
17773
17774 2000-07-29  Kevin Ryde  <kevin@swox.se>
17775
17776         * gmp.texi (ABI and ISA): Add sparc64-*-linux*.
17777         * configure.in [sparc64-*-linux*] (gmp_cflags64_gcc): Same flags
17778         as under solaris.
17779
17780         * configure.in (--enable-fft): New option, default "no".
17781         * gmp.texi (Build Options): Describe it.
17782         * mpn/generic/mul.c, mpn/generic/mul_n.c [WANT_FFT]: Use it.
17783         * tune/tuneup.c [WANT_FFT]: By default don't probe FFTs if not enabled.
17784         * NEWS: Multiplication optionally using FFT.
17785
17786         * tune/README: Notes on FFT and GCD thresholds, other minor updates.
17787
17788         * Makefile.am: Expunge the macos generated files update stuff.
17789
17790 2000-07-28  Kevin Ryde  <kevin@swox.se>
17791
17792         * mpn/x86/*/gmp-mparam.h: Add some FFT thresholds.
17793
17794 2000-07-28  Kent Boortz  <kent@swox.se>
17795
17796         * macos/Asm*, macos/CmnObj, macos/Mp*: Delete directories.
17797         * macos/Makefile: Delete file.
17798         * macos/Makefile.cw: Delete file.
17799         * macos/config.h: Delete file.
17800         * macos/Asm/*.s: Delete files.
17801         * macos/configure: Create target directories. Don't transform
17802         '(C)' to '(;)' in a 'dnl' line comment in .asm file.
17803         * Makefile.am: Delete macos targets.
17804         * macos/README: Reflect that we reverted back to a build
17805         process that require ""macos/configure" to run on MacOS.
17806         This imply that MacPerl is needed for a build in MacOS.
17807
17808 2000-07-27  Kevin Ryde  <kevin@swox.se>
17809
17810         * mpn/generic/mul_fft.c: New file, by Paul Zimmermann, minor mods
17811         applied.
17812         * configure.in (gmp_mpn_functions): Add it.
17813         * mpn/generic/mul.c, mpn/generic/mul_n.c: Use it.
17814         * doc/multiplication: Describe it (briefly).
17815
17816         * gmp-impl.h (FFT_MUL_THRESHOLD etc): New thresholds.
17817         (mpn_fft_best_k, mpn_fft_next_size, mpn_mul_fft, mpn_mul_fft_full):
17818         New functions.
17819         (numberof, TMP_ALLOC_TYPE etc, _MP_ALLOCATE_FUNC_TYPE etc,
17820         UNSIGNED_TYPE_MAX etc): New macros.
17821
17822         * tune/*: Add FFT threshold tuning and speed measuring.
17823         * tune/common.c: Avoid huge macro expansions for umul and udiv.
17824
17825         * mpz/tests/t-bin.c, mpz/tests/t-jac.c, mpz/tests/t-misc.c,
17826         mpbsd/tests/t-misc.c, mpf/tests/t-misc.c, mpn/tests/try.c,
17827         mpn/tests/spinner.c: Use new gmp-impl.h macros.
17828
17829         * demos/Makefile.am (BUILT_SOURCES): Don't need calc.c etc under this.
17830
17831 2000-07-27  Torbjorn Granlund  <tege@swox.com>
17832
17833         * mpn/ia64/gmp-mparam.h: New file.
17834
17835 2000-07-26  Torbjorn Granlund  <tege@swox.com>
17836
17837         * demos/isprime.c: Handle any number of arguments and print
17838         classification for each.  Add `-q' option for old behaviour.
17839
17840 2000-07-26  Kevin Ryde  <kevin@swox.se>
17841
17842         * gmp.texi (Build Options): Mention djgpp stack size.
17843         (Notes for Package Builds): New section.
17844         (Compatibility with older versions): Update for 3.1, add mpf_get_prec.
17845
17846         * demos/factorize.c [__GLIBC__]: Don't declare random() under glibc.
17847
17848         * gmp.h (gmp_version): Add prototype and define.
17849
17850         * Makefile.am: Keep macos directory generated files up-to-date
17851         during development and on a "make dist".
17852
17853 2000-07-25  Torbjorn Granlund  <tege@swox.com>
17854
17855         * mpn/hppa/gmp-mparam.h: Update threshold values from new `tune' run.
17856
17857         * mpn/pa64/gmp-mparam.h: Fill in values from `make tune' run.
17858         * mpn/pa64w/gmp-mparam.h: Likewise.
17859         * mpn/mips3/gmp-mparam.h: Likewise.
17860
17861         * tune/hppa2.asm: Fix typo in .level directive.
17862
17863         * configure.in: Add sparc64-*-linux* support (from Jakub Jelinek).
17864         * configure: Regenerate.
17865
17866         * mpn/sparc64/rshift.asm: Use %g5 instead of volatile stack frame area
17867         for return value (from Jakub Jelinek).
17868         * mpn/sparc64/lshift.asm: Likewise.
17869
17870         * mpf/get_prc.c: Revert Aug 8, 1996 change.
17871
17872         * version.c: No longer static.
17873
17874         * mpn/pa64/gmp-mparam.h: Only #define *_THRESHOLD if not already
17875         defined.
17876         * mpn/pa64w/gmp-mparam.h: Likewise.
17877         * mpn/arm/gmp-mparam.h: Likewise.
17878         * mpn/mips3/gmp-mparam.h: Likewise.
17879
17880 2000-07-25  Kevin Ryde  <kevin@swox.se>
17881
17882         * INSTALL: It's "info -f ./gmp.info" to be sure of hitting the
17883         gmp.info in the current directory.
17884
17885         * Makefile.am (libmp_la_DEPENDENCIES): Add mpz/cmp.lo, for last
17886         mpz/powm.c fix.
17887
17888         * mpn/sparc64/addmul1h.asm, mpn/sparc64/submul1h.asm: Renamed from
17889         addmul_1h.asm, submul_1h.asm to avoid name conflicts on an 8.3
17890         filesystem.
17891         * mpn/sparc64/addmul_1.asm, mpn/sparc64/submul_1.asm,
17892         mpn/sparc64/mul_1.asm: Update include_mpn()s.
17893
17894 2000-07-24  Torbjorn Granlund  <tege@swox.com>
17895
17896         * Update header of all files previously under the Library GPL
17897         to instead be under the Lesser GPL.
17898
17899         * COPYING.LIB: Now Lesser GPL.
17900         * demos/primes.c: Change license to GPL (was Library GPL).
17901         * demos/isprime.c: Change license to GPL (was Library GPL).
17902
17903         * gmp.h (error code enum): Add GMP_ERROR_BAD_STRING (currently unused).
17904
17905         * mpz/tests/t-mul.c: Default SIZE to a function of TOOM3_MUL_THRESHOLD.
17906         Improve error messages.  Decrease reps.
17907
17908 2000-07-22  Kevin Ryde  <kevin@swox.se>
17909
17910         * tune/speed.h: Decrease the amount of data used for gcd and powm
17911         measuring, to make the tune go a bit faster.
17912
17913 2000-07-21  Kent Boortz  <kent@swox.se>
17914
17915         * macos/Asm*, macos/CmnObj, macos/Mp*: Directories no longer created
17916         from configure script, now part of dist.
17917         * macos/Makefile
17918         * macos/Makefile.cw
17919         * macos/config.h
17920         * macos/Asm/*.s
17921         New files and directories that is the output from configure. This way
17922         no Perl installation is required to build on MacOS, just MPW.
17923         * macos/configure: Added prefix '__g' to exported assembler labels.
17924         Changed to handle new m4 syntax instead of the old cpp syntax in asm.
17925         * macos/Makefile.in: Corrected 'clean' target, added 'distclean'
17926         and 'maintainer_clean'. Added "mpn/mp_bases.c" to build.
17927         * macos/README: Reflect the new build process without configure.
17928         Corrected the file structure for Apple MPW installation.
17929
17930 2000-07-21  Torbjorn Granlund  <tege@swox.com>
17931
17932         * mpf/tests/t-muldiv.c: Relax error limit.  Make precision depend
17933         on SIZE.  Misc changes.
17934
17935         * configure: Regenerate.
17936
17937 2000-07-20  Kent Boortz  <kent@swox.com>
17938
17939         * macos/Makefile.in: Removed hard coded targets, added special
17940         targets found in Makefile.am files.
17941         * macos/configure: Generate targets from top configure script and
17942         Makefile.am files. Made script runnable from Unix for testing.
17943         * macos/README: Notes about search paths for includes, contributed
17944         by Marco Bambini.
17945         * configure.in: Added comment about lines that the "macos/configure"
17946         script depend on.
17947
17948 2000-07-20  Torbjorn Granlund  <tege@swox.com>
17949
17950         * mpz/powm.c (mpz_powm): After final mpz_redc call, subtract `mod'
17951         from result if it is greater than `mod'.
17952
17953 2000-07-19  Torbjorn Granlund  <tege@swox.com>
17954
17955         * mpn/hppa/gmp-mparam.h: Fill in values from `make tune' run.
17956         * mpn/alpha/gmp-mparam.h: Likewise.
17957         * mpn/powerpc32/gmp-mparam.h: Likewise.
17958
17959         * tune/hppa.asm: New file.
17960         * tune/hppa2.asm: New file.
17961         * configure.in (SPEED_CYCLECOUNTER_OBJS): Set for hppa2*-*-* and
17962         hppa*-*-*.
17963         * tune/Makefile.am (EXTRA_DIST): Add hppa.asm and hppa2.asm.
17964
17965         * tune/speed.h (SPEED_ROUTINE_MPN_BZ_DIVREM_CALL): Declare `marker';
17966         invoke TMP_FREE.
17967
17968         * mpn/hppa/hppa1_1/udiv_qrnnd.S: Use "%" instead of "'" for
17969         reloc/symbol delimiter.
17970
17971 2000-07-16  Torbjorn Granlund  <tege@swox.com>
17972
17973         * mpn/powerpc64/gmp-mparam.h: Update with output from tune utility.
17974         * mpn/powerpc64/copyi.asm: New file.
17975         * mpn/powerpc64/copyd.asm: New file.
17976
17977 2000-07-16  Kevin Ryde  <kevin@swox.se>
17978
17979         * tune/*: Add measuring for umul_ppmm and udiv_qrnnd.
17980
17981 2000-07-14  Kevin Ryde  <kevin@swox.se>
17982
17983         * mpn/x86/k6/k62mmx: New directory.
17984         * configure.in (k6[23]*-*-*): Use it.
17985         * mpn/x86/k6/k62mmx/copyi.asm, mpn/x86/k6/k62mmx/copyd.asm: Move from
17986         mmx directory, improve code alignment a bit.
17987         * mpn/x86/k6/k62mmx/lshift.asm, mpn/x86/k6/k62mmx/rshift.asm: Ditto,
17988         and improve addressing modes for pre-CXT cores.
17989         * mpn/x86/x86-defs.m4 (Zdisp): Add an instruction.
17990         * mpn/x86/k6/mmx/lshift.asm, mpn/x86/k6/mmx/rshift.asm: New files,
17991         suiting plain K6.
17992         * mpn/x86/README, mpn/x86/k6/README: Updates.
17993         * mpn/x86/k6/mmx/*.asm: Update some comments.
17994
17995         * mpn/tests/Makefile.am: Use $(MAKE) in .asm rules, not "m".
17996         * tune/Makefile.am: Use $(EXEEXT) and libtool --config objdir, for
17997         the benefit of djgpp.
17998
17999         * */Makefile.in: Regenerate with patched automake that adds
18000         $(EXEEXT) to EXTRA_PROGRAMS.
18001
18002         * mpn/tests/try.c: Add #ifdef to SIGBUS, for the benefit of djgpp.
18003         * config.guess: Recognise pc:*:*:* as an x86, for djgpp.
18004
18005         * configure: Regenerate with patched autoconf to fix temp file
18006         ".hdr" which is invalid on a DOS 8.3 filesystem, and to fix two
18007         sed substitutes that clobbered a ":" in $srcdir (eg. a DOS drive
18008         spec).
18009
18010         * mpz/tests/io.c: Use one fp opened "w+", since separately opened
18011         input and output doesn't work on MS-DOS 6.21.
18012
18013         * tests/rand/Makefile.am (allprogs): Pseudo-target to build everything.
18014         (CLEANFILES): Add EXTRA_PROGRAMS and EXTRA_LTLIBRARIES.
18015         (manual-test, manual-bigtest): Add $(EXEEXT) to dependencies.
18016
18017         * tests/rand/*/Makefile.in: Regenerate with patched automake that adds
18018         $(EXEEXT) to EXTRA_PROGRAMS.
18019
18020 2000-07-13  Torbjorn Granlund  <tege@swox.com>
18021
18022         * mpz/tests/t-root.c: Also test mpz_perfect_power_p.
18023         Generate `nth' so that there will be fewer trivial values.
18024
18025         * mpz/root.c: Reverse return value in tests for detecting root of +1
18026         and -1.
18027
18028         * mpz/perfpow.c: Use TMP_ALLOC interface.
18029
18030 2000-07-12  Torbjorn Granlund  <tege@swox.com>
18031
18032         * mpz/perfpow.c (primes): Make it const.
18033
18034 2000-07-06  Kevin Ryde  <kevin@swox.se>
18035
18036         * mpn/x86/k6/cross.pl: New file.
18037
18038         * mpn/x86/*/gmp-mparam.h: Updates to thresholds, conditionalize
18039         all _TIME defines.
18040         * mpn/x86/pentium/mmx/gmp-mparam.h: New file.
18041         * mpn/sparc64/gmp-mparam.h: Update thresholds.
18042         * mpn/sparc32/v9/gmp-mparam.h: Ditto.
18043
18044 2000-07-04  Kevin Ryde  <kevin@swox.se>
18045
18046         * NEWS: Updates.
18047         * mpn/x86/*/README: Miscellaneous updates.
18048
18049         * tune/speed-ext.c: New file.
18050         * tune/Makefile.am: Add it.
18051         * tune/README: Updates.
18052         * tune/speed.h (SPEED_ROUTINE_MPN_DIVREM_2): Bug fixes.
18053
18054         * demos/calc.y,calclex.l: New files.
18055         * demos/calc.c,calc.h,calclex.c: New files, generated from .y and .l.
18056         * demos/Makefile.am: Add them.
18057
18058         * gmp.h (mpq_swap, mpf_swap): Add prototypes and defines.
18059
18060 2000-07-01  Kevin Ryde  <kevin@swox.se>
18061
18062         * gmp.texi (ABI and ISA): New section, bringing together ABI notes.
18063         (Build Options): Add MPN_PATH, various updates.
18064         (Build Options): Add note on setting CFLAGS when setting CC.
18065         (Notes for Particular Systems): Add -march=pentiumpro problem.
18066         (Known Build Problems): Note on gmp-mparam.h for 64-bit generic C.
18067         (GMP Variable Conventions): Add some info on user defined functions.
18068         (Reporting Bugs): Minor rewording.
18069
18070         * configure.in (MPN_PATH): Renamed from mpn_path.
18071
18072         * gmp-impl.h (ULONG_MAX,ULONG_HIGHBIT,...,SHORT_MAX): New defines.
18073         * mp[zf]/tests/t-misc.c: Use them.
18074
18075         * mpbsd/tests/t-misc.c: New file.
18076         * mpbsd/tests/Makefile.am: Add it.
18077
18078         * Makefile.am (LIBGMP_LT_*, LIBMP_LT_*): Bump version info.
18079         * gmp.h (__GNU_MP_VERSION_*): Bump to 3.1.
18080
18081         * mpf/tests/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
18082
18083         * Makefile.am (libmp_la_SOURCES): Add mp_set_fns.c, accidentally
18084         omitted in gmp 3.0.x.
18085         * gmp.texi (Custom Allocation): Note this is available in mpbsd,
18086         and some minor rewording.
18087
18088 2000-06-30  Torbjorn Granlund  <tege@swox.com>
18089
18090         * demos/factorize.c (random): New function, defined conditionally.
18091         (factor_using_pollard_rho): Use it, not mrand48.
18092
18093         * mpn/cray/README: New file.
18094
18095 2000-06-30  Kevin Ryde  <kevin@swox.se>
18096
18097         * mpn/x86/pentium/aorsmul_1.asm: Add MULFUNC_PROLOGUE.
18098
18099         * mpz/tests/t-jac.c: Test limbs on mpn_jacobi_base, not just ulongs.
18100
18101         * gmp-impl.h, mpn/tests/try.c, mpn/tests/spinner.c, tune/speed.c:
18102         Use config.h unconditionally, not under HAVE_CONFIG_H.
18103
18104         * demos/pexpr.c [__DJGPP__]: Patch by Richard Dawe to not use
18105         setup_error_handler on djgpp.
18106
18107         * tune/*: Locate data to help direct-mapped caches, add measuring
18108         of mpz_init/clear, mpz_add and mpz_bin_uiui, various cleanups.
18109         * configure.in (AC_CHECK_FUNCS): Add popen.
18110
18111 2000-06-29  Torbjorn Granlund  <tege@swox.com>
18112
18113         * mpf/mul_2exp.c: Streamline criterion for whether to use mpn_lshift or
18114         mpn_rshift.  Increase precision when exp is a multiple of
18115         BITS_PER_MP_LIMB primarily to make exp==0 be a noop.
18116         * mpf/div_2exp.c: Analogous changes.
18117
18118         * mpf/tests/t-dm2exp.c: Set u randomly in loop.  Perform more
18119         mpf_mul_2exp testing.
18120
18121         * configure.in: Recognize cray vector processors with a broad `*';
18122         move after alpha* not to match that.
18123
18124 2000-06-28  Kevin Ryde  <kevin@swox.se>
18125
18126         * mpz/tests/io.c: Use a disk file, not a pipe, switch to ansi2knr
18127         style, switch from MP_INT to mpz_t, add a couple of error checks.
18128         * mpz/tests/Makefile.am (CLEANFILES): Add io.tmp, in case io.c fails.
18129
18130 2000-06-27  Torbjorn Granlund  <tege@swox.com>
18131
18132         * mpf/tests/t-get_d.c: Be more lax about relative error, to handle Cray
18133         floating point format.
18134
18135         * mpq/tests/t-get_d.c: Decrease default reps to 1000.
18136
18137         * mpf/tests/t-conv.c: Correct type of `bexp'.
18138
18139         * configure.in (cray vector machines): Don't inherit gmp_cflags_cc.
18140
18141         * tune/Makefile.am (EXTRA_DIST): Delete sparc64.asm.
18142
18143         * configure.in (cray vector machines): Set extra_functions.
18144
18145         * mpn/cray/mulww.f: New file with vectorizing cray code.
18146         * mpn/cray/mulww.s: Generated from mulww.f.
18147         * mpn/cray/mul_1.c: New file.
18148         * mpn/cray/addmul_1.c: New file.
18149         * mpn/cray/submul_1.c: New file.
18150         * mpn/cray/add_n.c: New file.
18151         * mpn/cray/sub_n.c: New file.
18152
18153 2000-06-26  Kevin Ryde  <kevin@swox.se>
18154
18155         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_FILL_0x90): Fix so it actually
18156         detects solaris 2.6, and also suppress warning on solaris 2.8.
18157         * configure.in (SPEED_CYCLECOUNTER): Remove spurious "athlon" from
18158         sparc case.
18159
18160         * mpn/lisp/gmpasm-mode.el: Move keymap to the top of the docstring.
18161
18162 2000-06-21  Kevin Ryde  <kevin@swox.se>
18163
18164         * mpn/generic/mul_n.c (mpn_kara_mul_n, mpn_kara_sqr_n): Use
18165         mp_size_t for n2.
18166         (mpn_toom3_mul_n, mpn_toom3_sqr_n): Use mp_size_t for size
18167         parameters and "l" variables.
18168         * gmp-impl.h (mpn_toom3_mul_n, mpn_toom3_sqr_n): Update prototypes.
18169
18170         * mpbsd/itom.c, mpbsd/sdiv.c: Add casts for correct handling of
18171         -0x80...00 on systems with sizeof(short)==sizeof(int).
18172
18173         * mpz/tests/t-misc.c: Move "bin" test from here ...
18174         * mpz/tests/t-bin.c: ... to here, and add a new (2k,k) test too.
18175         * mpz/tests/Makefile.am (check_PROGRAMS): Add t-bin.
18176
18177         * mpz/bin_ui.c [_LONG_LONG_LIMB]: Use mpn_divrem_1, since kacc is
18178         a limb not a ulong.
18179         * mpz/bin_uiui.c [_LONG_LONG_LIMB]: Ditto, and use mpn_mul_1 too,
18180         since nacc is a limb.
18181
18182         * mpf/tests/t-misc.c (check_mpf_set_si, check_mpf_cmp_si):
18183         New file, testing mpf_set_si, mpf_init_set_si, and mpf_cmp_si.
18184         * mpf/tests/Makefile.am (check_PROGRAMS): Add it.
18185
18186         * mpz/tests/t-misc.c (check_mpz_set_si, check_mpz_cmp_si):
18187         New tests, for mpz_set_si, mpz_init_set_si, and mpz_cmp_si.
18188
18189         * mpz/set_si.c, mpz/iset_si.c, mpz/cmp_si.c [_LONG_LONG_LIMB]: Fix
18190         handling of -0x80..00.
18191         * mpf/set_si.c, mpf/iset_si.c, mpf/cmp_si.c [_LONG_LONG_LIMB]: Ditto.
18192
18193 2000-06-19  Torbjorn Granlund  <tege@swox.com>
18194
18195         * demos/primes.c: Properly handle arguments `m +n'.
18196
18197 2000-06-17  Torbjorn Granlund  <tege@swox.com>
18198
18199         * config.sub: Recognize k5 and k6 with common pattern.
18200
18201         * mpq/tests/t-get_d.c: Also test mpq_set_d.  Misc improvements.
18202
18203         * mpq/set_d.c: Special case 0.0.  Don't call mpn_rshift with 0 count.
18204         Allocate correct amount of memory for numerator.  Delete spurious
18205         ASSERT_ALWAYS(1).
18206
18207 2000-06-17  Kevin Ryde  <kevin@swox.se>
18208
18209         * mpz/perfsqr.c: Fix so that zero is considered a perfect square.
18210         (Was wrongly calling mpn_perfect_square_p with size==0.)
18211
18212 2000-06-16  Kevin Ryde  <kevin@swox.se>
18213
18214         * configure.in: Set k5*-*-* to use basic i386 code until there's
18215         something specific.  Add path=x86 as a default for x86s.
18216
18217         * acinclude.m4 (GMP_CHECK_ASM_ALIGN_LOG): Generate
18218         ALIGN_LOGARITHMIC setting, not a full ALIGN definition.
18219         (GMP_CHECK_ASM_ALIGN_FILL_0x90): New test.
18220         * configure.in [x86-*-*]: Use GMP_CHECK_ASM_ALIGN_FILL_0x90.
18221         * mpn/asm-defs.m4 (ALIGN): New macro.
18222         * mpn/x86/x86-defs.m4 (ALIGN): Remove supplementary definition.
18223
18224         * tune/*: Plain "unsigned" for speed_cyclecounter.
18225         * configure.in: Use tune/sparcv9.asm for 32 and 64 bit modes.
18226         * tune/sparc64.asm: Remove file.
18227
18228 2000-06-15  Torbjorn Granlund  <tege@swox.com>
18229
18230         * mpn/x86/k7/mmx/copyi.asm: Use `testb' instead of `test'.
18231         * mpn/x86/k7/mmx/copyd.asm: Likewise.
18232
18233         * mpn/x86/k7/mmx/lshift.asm: Avoid using `~' (Solaris as problems).
18234         * mpn/x86/k7/mmx/rshift.asm: Likewise.
18235         * mpn/x86/k6/aors_n.asm: Likewise.
18236         * mpn/x86/k7/aors_n.asm: Likewise.
18237         * mpn/x86/k7/mul_basecase.asm: Likewise.
18238
18239 2000-06-13  Torbjorn Granlund  <tege@swox.com>
18240
18241         * tune/sparcv9.asm: Tune, deleting two instructions.
18242
18243         * tune/alpha.asm: Update to unified speed_cyclecounter.
18244
18245 2000-06-11  Kevin Ryde  <kevin@swox.se>
18246
18247         * mpz/tests/reuse.c (FAIL): Add a K&R version.
18248         Use _PROTO on some typedefs.
18249         * mpz/tests/t-misc.c: Add gmp-impl.h for "const".
18250
18251         * configure.in: Rework mpn multi-function and optional files.
18252         Names standardized, no need for explicit declarations, all picked
18253         up in one $path traversal.
18254         * doc/configuration: Updates.
18255
18256         * tests/rand/t-rand.c (main): Change "usage" to work with K&R.
18257
18258 2000-06-10  Kevin Ryde  <kevin@swox.se>
18259
18260         * mpn/x86/pentium/mmx/popham.asm, mpn/x86/p6/mmx/popham.asm,
18261         mpn/x86/p6/p3mmx/popham.asm, mpn/x86/p6/diveby3.asm: Add
18262         MULFUNC_PROLOGUE for correct HAVE_NATIVE_* matching.
18263
18264         * mpn/x86/x86-defs.m4 (cmov_bytes_tttn): Use eval() on expressions.
18265         (cmov_available_p): Switch to list CPUs which do have cmov.
18266         * mpn/x86/p6/sqr_basecase.asm, mpn/x86/k6/sqr_basecase.asm,
18267         mpn/x86/k7/sqr_basecase.asm: Use eval() for multiplication.
18268         * mpn/x86/README.family: Various updates.
18269
18270 2000-06-09  Kevin Ryde  <kevin@swox.se>
18271
18272         * mpbsd/tests/allfuns.c (main): Call exit() instead of doing return.
18273
18274         * doc/tasks.html, doc/projects.html: Moved from projects directory.
18275         * doc/multiplication: New file.
18276         * Makefile.am (EXTRA_DIST): Remove projects, add doc.
18277
18278         * Makefile.am (libgmp_la_LIBADD, libmp_la_LIBADD): Remove
18279         unnecessary -lm.
18280         * INSTALL: Remove -lm from instructions.
18281         * demos/Makefile.am (qcn_LDADD): Add -lm.
18282
18283         * tune/*: Add measuring for mpn_divrem_2 and modlimb_invert,
18284         improve addsub_n.  Switch to unified speed_cyclecounter.
18285         * configure.in: Update configs for speed_cyclecounter.
18286
18287         * gmp-impl.h (MP_LIMB_T_MAX, MP_LIMB_T_HIGHBIT): New macros.
18288         * mpn/generic/diveby3.c, mpn/generic/mul_n.c, mpn/generic/gcd.c,
18289         tune/speed.c, mpn/tests/ref.c: Use them.
18290
18291         * mpn/tests/spinner.c: Remove setitimer, just alarm is enough.
18292         * configure.in (AC_CHECK_FUNCS): Remove setitimer.
18293         * mpn/tests/x86call.asm: Start with junk in %eax, %ecx, %edx.
18294         * mpn/tests/ref.[ch] (refmpn_addsub_nc): New function.
18295         * mpn/tests/try.c: Add some support for mpn_addsub_nc.
18296         * mpn/tests/Makefile.am (EXTRA_PROGRAMS): Remove addsub_n and
18297         addsub_n_2 which don't currently build.
18298         * mpn/tests/copy.c: Test MPN_COPY_INCR, not __gmpn_copy.
18299
18300         * tests/rand/Makefile.am (libstat_la_LIBADD): Add -lm, no longer on
18301         libgmp.la.
18302         (findlc_LDADD): Use libstat.la.
18303         (AUTOMAKE_OPTIONS): Use ansi2knr.
18304
18305 2000-06-08  Torbjorn Granlund  <tege@swox.com>
18306
18307         * configure.in (alpha*-*-osf*): Default `flavour' to ev6 for ev6 and
18308         higher.
18309         (alpha*-*-*): Likewise.
18310         (alpha*-*-osf*: gmp_optcflags_cc): Move -arch/-tune flags from
18311         gmp_xoptcflags_gcc.
18312
18313         * mpn/Makefile.am (TARG_DIST): Add pa64w.
18314
18315         * longlong.h: Wrap 64-bit hppa code in #ifndef LONGLONG_STANDALONE.
18316
18317 2000-06-07  Torbjorn Granlund  <tege@swox.com>
18318
18319         * mpz/remove.c: Fail for `src' being zero.
18320
18321         * mpz/tests/reuse.c: Test more functions.
18322         (FAIL): New define.
18323
18324         * mpz/tests/t-powm.c: Loop during operand generation while they
18325         are mathematically ill-defined (used to just skip such tests).
18326
18327         * mpz/powm.c (mpz_redc): Clean up argument declarations.
18328
18329         * configure.in (gmp_cflags64_gcc): Don't add bogus -mWHAT option.
18330         (sparcv9-*-solaris2.[7-9]], gmp_cflags64_gcc):
18331         Inherit from previous gmp_cflags64_gcc; pass `-m64 -mptr64'.
18332         (ia64*-*-*): New.
18333
18334         * mpn/generic/dump.c: Make it work when an mp_limb_t is not `long'.
18335
18336         * mpf/set_prc.c: MPN_COPY => MPN_COPY_INCR.
18337
18338 2000-06-06  Torbjorn Granlund  <tege@swox.com>
18339
18340         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n):
18341         Use mpn_incr_u for final carry propagation.
18342
18343         * mpz/tests/t-gcd.c: Add calls to mpz_gcdext with argument t == NULL.
18344
18345         * mpz/tests/reuse.c: Major rewrite; test many more functions.
18346
18347         * mpz/powm_ui.c: When exp is 0, change res assign order in order
18348         to handle argument overlap.
18349         * mpz/powm.c: When exp is 0, change res assign order in order
18350         to handle argument overlap.  Handle negative exp and mod arguments.
18351
18352         * mpz/gcdext.c: Rework code after mpn_gcdext call to handle
18353         argument overlap.
18354
18355         * mpz/fdiv_qr.c: Read dividend->_mp_size before calling mpz_tdiv_qr
18356         in order to handle argument overlap.
18357         * mpz/cdiv_qr.c: Likewise.
18358
18359         * mpf/tests/reuse.c: Fix typo that effectively disabled `dis_funcs'
18360         tests.  Clean up test for mpf_ui_div.
18361
18362 2000-06-06  Kevin Ryde  <kevin@swox.se>
18363
18364         * mpn/x86/p6/sqr_basecase.asm: New file.
18365         * mpn/x86/mod_1.asm: Avoid one conditional jump.
18366         * mpn/x86/p6/gmp-mparam.h: Update thresholds, #ifndef UMUL_TIME
18367         and UDIV_TIME, add COUNT_TRAILING_ZEROS_TIME.
18368
18369         * mp_minv_tab.c: New file.
18370         * Makefile.am (libgmp_la_SOURCES, libmp_la_SOURCES): Add it.
18371         * gmp-impl.h (modlimb_invert): New macro.
18372         * mpz/powm.c: Remove mpz_dmprepare, use modlimb_invert instead.
18373         * mpn/generic/bdivmod.c: Use modlimb_invert instead of a loop.
18374         * mpn/generic/gcd.c: Inline two small mpn_bdivmod calls, use
18375         MPN_COPY_INCR not MPN_COPY in one place.
18376
18377 2000-06-05  Torbjorn Granlund  <tege@swox.com>
18378
18379         * mpf/tests/reuse.c (dsi_funcs): Add mpf_mul_2exp and mpf_div_2exp.
18380         (main): Clean up test for mpf_div_ui.
18381
18382         * mpf/mul_2exp.c: Correct criterion for whether to use mpn_lshift or
18383         mpn_rshift.  MPN_COPY => MPN_COPY_INCR.  Coerce the two assignments to
18384         r->_mp_size.
18385
18386         * mpf/div_2exp.c: Use mpn_rshift instead of mpn_lshift when overlap
18387         so requires.  MPN_COPY => MPN_COPY_INCR.
18388
18389         * mpf/tests/t-dm2exp.c: Correct type of res_prec.
18390
18391 2000-06-04  Kevin Ryde  <kevin@swox.se>
18392
18393         * mpz/bin_uiui.c: Fix result for n==0 and n==k.
18394         * mpz/bin_ui.c: Fix result for k>n, add support for n<0.
18395         * gmp.texi (Number Theoretic Functions): Update mpz_bin_ui to
18396         note n<0 is supported.
18397
18398         * mpz/tests/t-misc.c: New file.
18399         * mpz/tests/Makefile.am (check_PROGRAMS): Add it.
18400
18401 2000-05-31  Kevin Ryde  <kevin@swox.se>
18402
18403         * tune/speed.* (FLAG_R_OPTIONAL): New option for routines, use on
18404         mpn_gcd_1 and mpn_mul_basecase.
18405         * tune/README: Update.
18406
18407         * tune/alpha.asm: New file, by Torbjorn.
18408         * tune/Makefile.am (EXTRA_DIST): Add it.
18409         * configure.in (alpha*-*-*): Use it.
18410
18411 2000-05-31  Linus Nordberg  <linus@swox.se>
18412
18413         * doc/configuration: New file.
18414
18415 2000-05-30  Torbjorn Granlund  <tege@swox.com>
18416
18417         * mpn/generic/mul_basecase.c: Call mpn_mul_2 and mpn_addmul_2
18418         if available.  Don't include longlong.h.
18419
18420         * doc/isa_abi_headache: New file.
18421
18422 2000-05-30  Linus Nordberg  <linus@swox.se>
18423
18424         * configure.in (NM): Use AC_PROG_NM rather than AC_CHECK_TOOL to
18425         find `nm'.  (AC_PROG_NM comes with Libtool and is needed to get
18426         the `-B' option (BSD compatible output) included in $NM.)
18427         (AR): Use AC_CHECK_PROG rather than AC_CHECK_TOOL to find `ar'.
18428         (Now that NM isn't a cross compilation tool, don't give the
18429         impression that we know how to cross compile.)
18430         (CCAS): Remove spurious comment.
18431
18432         * gmp.texi (Notes for Particular Systems): Remove comment about
18433         using GNU `nm' on AIX since system nm now works.
18434
18435 2000-05-29  Torbjorn Granlund  <tege@swox.com>
18436
18437         * mpn/power/mul_1.s: Remove [PR] from first word in function
18438         descriptor.
18439         * mpn/power/addmul_1.s: Likewise.
18440         * mpn/power/submul_1.s: Likewise.
18441
18442 2000-05-28  Kevin Ryde  <kevin@swox.se>
18443
18444         * configure.in, tune/*: Change pentium rdtsc cycle scheme to
18445         HAVE_SPEED_CYCLECOUNTER and SPEED_CYCLECOUNTER_OBJS.
18446         * tune/pentium.asm: Renamed and converted from rdtsc.asm.
18447         * tune/sparcv9.asm: New file, by Torbjorn.
18448         * tune/sparc64.asm: New file.
18449         * tune/tuneup.c: Put a limit on gcdext search.
18450
18451         * gmp.h (mp_set_memory_functions): Add extern "C".
18452         * mp.h (__GNU_MP__): Bump to "3".
18453         * mpz/add.c,mul.c,powm.c,sub.c,sqrtrem.c,tdiv_qr.c [BERKELEY_MP]:
18454         Include mp.h for mpbsd compile.
18455         * mpz/gcd.c: Ditto, and remove _mpz_realloc declaration.
18456
18457         * gmp.texi (Integer Functions): Flatten @subsections into @sections.
18458         (Floating-point Functions): Ditto.
18459         (Integer Random Numbers): Split from miscellaneous as a sep section.
18460         (Installing GMP): Make nodes for the sections.
18461         Add more "@cindex"s.
18462         (Known Build Problems): Remove SunOS get_d problem, believed fixed.
18463         (Notes for Particular Systems): Remove HPPA note since now PIC.
18464         (References): URL for Jebelean.
18465
18466 2000-05-27  Torbjorn Granlund  <tege@swox.com>
18467
18468         * mpn/pa64w: New directory, contents based on corresponding mpn/pa64
18469         files.
18470         * configure.in (hppa2.0w-*-*): New.
18471         * mpz/tests/io.c (_INCLUDE_POSIX_SOURCE): Define when __hpux before
18472         including stdio.h.
18473         * gmp-impl.h: Always define DItype and UDItype.
18474
18475 2000-05-27  Kevin Ryde  <kevin@swox.se>
18476
18477         * tune/common.c (speed_measure): Correction to array sorting,
18478         better diagnostic when measuring fails.
18479         * tune/time.c: Add microsecond accurate getrusage method.
18480
18481         * tune/time.c (speed_cpu_frequency_processor_info): New function.
18482         * configure.in (AC_CHECK_FUNCS): Add processor_info.
18483
18484 2000-05-26  Linus Nordberg  <linus@swox.se>
18485
18486         * gmp.texi (Installing GMP): Shared libraries work for AIX < 4.3
18487         if using GNU nm.
18488
18489 2000-05-26  Torbjorn Granlund  <tege@swox.com>
18490
18491         * tune/tuneup.c (SIGNED_TYPE_MAX): Shift `-1' instead of `1' to
18492         avoid signed overflow.
18493
18494         * demos/pexpr.c (setup_error_handler): Don't call sigaltstack on
18495         Unicos.
18496
18497 2000-05-25  Torbjorn Granlund  <tege@swox.com>
18498
18499         * insert-dbl.c: Work around GCC 2.8 bug.
18500         * extract-dbl.c: Likewise.
18501
18502         * config.sub: Allow i586, i686, i786 again.
18503
18504         * config.guess: Use X86CPU for lots more systems.
18505
18506 2000-05-25  Linus Nordberg  <linus@swox.se>
18507
18508         * mpbsd/tests/dummy.c (main): Call exit() instead of doing return
18509         (some old SysV machines don't get this correct, I've heard.)
18510
18511 2000-05-25  Kevin Ryde  <kevin@swox.se>
18512
18513         * mpf/iset_str.c: Initialize _mp_size and _mp_exp to 0, in case no
18514         digits in string, so it's the same as a separate init and set_str.
18515
18516 2000-05-24  Torbjorn Granlund  <tege@swox.com>
18517
18518         * mpz/tests/reuse.c: Use mpz_random2 instead of mpz_random.
18519
18520         * mpz/divexact.c: Read pointers after reallocation.
18521         Compare `quot' and `den' instead of `qp' and `dp' in overlap check.
18522         Use MPN_COPY_INCR for copying from `np'.
18523
18524         (*-*-aix4.[3-9]*): Disable shared libs just for problematic AIX
18525         versions.
18526         * configure.in (*-cray-unicos*): Disable asm syntax checking; set
18527         compiler explicitly.
18528         * configure.in (hppa*-*-*): Remove code disabling shared libs.
18529
18530 2000-05-24  Linus Nordberg  <linus@swox.se>
18531
18532         * acinclude.m4 (GMP_PROG_CC_WORKS): Don't report progress to user
18533         when doing the AIX specific test to avoid "nested output".
18534
18535 2000-05-22  Kevin Ryde  <kevin@swox.se>
18536
18537         * mp.h (_PROTO): Copy from gmp.h, use on prototypes.
18538         Add extern "C" too.
18539         * mpbsd/tests/Makefile.am (AUTOMAKE_OPTIONS): Enable ansi2knr.
18540         * mpbsd/tests/allfuns.c: Don't execute mout, just link to it.
18541         (main): ANSI style definition.
18542
18543         * gmp-impl.h (MP_BASE_AS_DOUBLE): Change the expression to
18544         something that works on SunOS native cc.  Seems to fix the
18545         mp*_get_d problems.
18546
18547         * mpn/tests/ref.c (refmpn_strip_twos): Use MPN_COPY_INCR.
18548         * mpn/tests/Makefile.am: Let .asm.o rules work with absolute $srcdir.
18549
18550 2000-05-21  Kevin Ryde  <kevin@swox.se>
18551
18552         * mpn/x86/k7/sqr_basecase.asm: Replace file with K7 specific code.
18553         * mpn/x86/k7/README: Update.
18554         * mpn/x86/k7/gmp-mparam.h: Tune thresholds.
18555         (COUNT_TRAILING_ZEROS_TIME): New define.
18556         * mpn/x86/k6/gmp-mparam.h: Ditto.
18557
18558         * mpn/x86/pentium/mmx/popham.asm: New file (include_mpn of K6 version).
18559         * mpn/x86/p6/diveby3.asm: New file (include_mpn of P5 version).
18560         * mpn/x86/p6/mmx/popham.asm: New file (include_mpn of K6 version).
18561         * mpn/x86/p6/p3mmx/popham.asm: New file (include_mpn of K7 version).
18562         * configure.in (pentium3-*-*): Add p3mmx to $path.
18563
18564         * gmp.texi (Integer Arithmetic): Clarify mpz_jacobi op2; add
18565         mpz_*_kronecker_*.
18566         (Miscellaneous Integer Functions): Add mpz_odd_p and mpz_even_p.
18567         (Low-level Functions): Put mpn_divmod_1 with mpn_divrem_1 and note
18568         it's now a macro.
18569         (References): Add Henri Cohen.
18570
18571         * gmp.h (mpn_addmul_1c, mpn_divrem_1c, mpn_mod_1c, mpn_mul_1c,
18572         mpn_submul_1c): Add prototypes.
18573         (mpz_odd_p, mpz_even_p): New macros.
18574
18575         * mpn/asm-defs.m4 (m4wrap_prepend): New macro.
18576         (m4_error): Use it.
18577         (m4_not_for_expansion): Corrections to OPERATION symbols.
18578         More comments about variations between m4 versions.
18579         * mpn/x86/x86-defs.m4 (PROLOGUE): Use m4wrap_prepend (fixes error
18580         exit under BSD m4, previously m4_error printed the message but the
18581         exit code was 0).
18582
18583         * gmp.h (mpn_divmod_1): Change to a macro calling mpn_divrem_1.
18584         * mpn/generic/divrem_1.c: Move divmod_1.c code to here, make it
18585         static and call it __gmpn_divmod_1_internal.
18586         * mpn/generic/divmod_1.c: Remove file.
18587         * configure.in (gmp_mpn_functions): Remove divmod_1.
18588         * mpn/asm-defs.m4 (define_mpn): Remove divmod_1 and divmod_1c.
18589         * compat.c (mpn_divmod_1): Add compatibility function.
18590         * tune/*: Remove mpn_divmod_1 measuring (leave just divrem_1).
18591
18592         * acconfig.h (HAVE_NATIVE_mpn_*): Add some missing carry-in
18593         variants, remove divmod_1.
18594
18595         * mpn/x86/diveby3.asm: Use imul, update comments.
18596
18597         * demos/qcn.c: New file.
18598         * demos/Makefile.am (EXTRA_PROGRAMS): Add it.
18599
18600         * mpz/tests/t-jac.c: New file.
18601         * mpz/tests/Makefile.am (check_PROGRAMS): Add it. Enable ansi2knr.
18602
18603         * mpz/kronsz.c: New file.
18604         * mpz/kronuz.c: New file.
18605         * mpz/kronzs.c: New file.
18606         * mpz/kronzu.c: New file.
18607         * mpz/Makefile.am (libmpz_la_SOURCES): Add them.
18608         * Makefile.am (MPZ_OBJECTS): Add them.
18609         * gmp-impl.h (JACOBI_*, MPN_STRIP_LOW_ZEROS_NOT_ZERO): New macros.
18610         * gmp.h (mpz_*_kronecker_*): New defines and prototypes.
18611
18612         * mpn/generic/jacbase.c: New file.
18613         * mpn/generic/mod_1_rs.c: New file.
18614         * configure.in (gmp_mpn_functions): Add them.
18615         * gmp.h (mpn_jacobi_base, mpn_mod_1_rshift): New defines and
18616         prototypes.
18617         * longlong.h (COUNT_TRAILING_ZEROS_TIME): New define.
18618         * mpn/tests/ref.c (refmpn_mod_1_rshift): New function.
18619         * mpn/tests/try.c: Add mpn_mod_1_rshift.
18620         * tune/*: Add measuring for mpn_jacobi_base.
18621
18622         * acinclude.m4 (GMP_FINISH): Add ifdefs to allow multiple
18623         inclusion of config.m4.
18624         (GMP_PROG_M4): Put "good" message through to config.log.
18625
18626         * mpz/powm.c: Use a POWM_THRESHOLD for where redc stops.
18627         * tune/*: Add mpz_powm measuring, and tune POWM_THRESHOLD.
18628         * gmp-impl.h [TUNE_PROGRAM_BUILD] (POWM_THRESHOLD): Conditional
18629         redefinition for use when tuning.
18630
18631         * mpz/powm_ui.c: Use DIVIDE_BY_ZERO.
18632
18633         * mpz/iset_str.c: Initialize _mp_size to 0, in case no digits in
18634         string; this makes it the same as a separate init and set_str.
18635
18636 2000-05-20  Kevin Ryde  <kevin@swox.se>
18637
18638         * mpn/asm-defs.m4: Note &,|,^ aren't bitwise in BSD m4 eval().
18639         * mpn/x86/k6/sqr_basecase.asm: Use "%" not "&" in m4 eval()s.
18640
18641         * mpn/x86/x86-defs.m4 (Zdisp): Yet more instruction forms.
18642
18643 2000-05-19  Linus Nordberg  <linus@swox.se>
18644
18645         * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't use shell variable
18646         `ac_compile' for our own compile command string since other
18647         Autoconf macros may depend on it.
18648
18649 2000-05-19  Kevin Ryde  <kevin@swox.se>
18650
18651         * mpn/generic/mul_n.c (mpn_toom3_mul_n, mpn_toom3_sqr_n): Fix
18652         carry propagation in final coefficient additions.
18653
18654 2000-05-18  Linus Nordberg  <linus@swox.se>
18655
18656         * configure.in: Set NM before looking for compiler since
18657         GMP_CHECK_CC_64BIT needs it.
18658
18659         * acinclude.m4 (GMP_CHECK_CC_64BIT): Don't execute on target.
18660         (GMP_PROG_CC_FIND): Before checking if the compiler knows how to
18661         produce 64-bit code, verify that it works at all.  The background
18662         is that /usr/ucb/cc on Solaris 7 successfully compiles in 64-bit
18663         mode but fails when doing final link.
18664         (GMP_PROG_CC_WORKS): Report to user what's happening.
18665
18666 2000-05-17  Linus Nordberg  <linus@swox.se>
18667
18668         * config.guess: Use X86CPU for x86 Cygwin.
18669
18670 2000-05-16  Kevin Ryde  <kevin@swox.se>
18671
18672         * mpn/x86/p6/mmx/divrem_1.asm: New file.
18673         * mpn/x86/p6/mmx/mod_1.asm: New file.
18674         * mpn/x86/p6/README: Update.
18675         * mpn/x86/divrem_1.asm: Update comments.
18676         * mpn/x86/mod_1.asm: Ditto.
18677
18678 2000-05-14  Kevin Ryde  <kevin@swox.se>
18679
18680         * tune/speed.h: Run gcd functions on a set of data.
18681
18682         * mpn/tests/try.c: New file.
18683         * mpn/tests/try.h: New file.
18684         * mpn/tests/spinner.c: New file.
18685         * mpn/tests/trace.c: New file.
18686         * mpn/tests/x86call.asm: New file.
18687         * mpn/tests/x86check.c: New file.
18688         * mpn/tests/ref.c (refmpn_hamdist): Allow size==0.
18689         (refmpn_gcd): New function, and other additions supporting it.
18690         * mpn/tests/ref.h: More prototypes.
18691         * mpn/tests/Makefile.am: Add try program, use ansi2knr.
18692
18693         * mpn/x86/k7/mmx/popham.asm: New file.
18694         * mpn/x86/k6/mmx/popham.asm: New file.
18695         * mpn/x86/k6/sqr_basecase.asm: Unroll the addmul, for approx 1.3x
18696         speedup above 15 limbs.
18697         * mpn/x86/k7/README: Update.
18698         * mpn/x86/k6/README: Update, and add notes on plain K6 and pre-CXT
18699         K6-2 problems.
18700         * configure.in (k6*-*-*, athlon-*-*): Add popham.
18701
18702         * mpn/x86/pentium/diveby3.asm: New file.
18703         * mpn/x86/pentium/README: Update.
18704
18705         * gmp.texi (Installing GMP): Add note on bad OpenBSD 2.6 m4.
18706         (Reporting Bugs): Ask for config.m4 if asm file related.
18707         (I/O of Rationals): New section, add mpq_out_str.
18708         (References): Add url for on-line gcc manuals.
18709         A few node and menu updates.
18710
18711         * INSTALL: Better command line argument checking for test progs.
18712         Change MP -> GMP.
18713
18714         * configure.in (WANT_ASSERT, USE_STACK_ALLOC, HAVE_PENTIUM_RDTSC):
18715         Put descriptions here, not in acconfig.h.
18716         (CALLING_CONVENTIONS_OBJS): New AC_SUBST (for mpn/tests/try).
18717         (HAVE_CALLING_CONVENTIONS): New AC_DEFINE.
18718         (AC_CHECK_HEADERS): Add sys/time.h.
18719         (AC_CHECK_FUNCS): Add getpagesize, setitimer.
18720         (KARATSUBA_SQR_THRESHOLD): Strip trailing comments from the
18721         #define when passing through to config.m4.
18722         * acconfig.h (PACKAGE, VERSION, WANT_ASSERT, USE_STACK_ALLOC,
18723         HAVE_PENTIUM_RDTSC): No need for #undefs, autoheader gets them
18724         from configure.in.
18725
18726         * acinclude.m4 (GMP_PROG_M4): Check for broken OpenBSD 2.6 m4
18727         eval(), put messages into config.log.
18728         * mpn/asm-defs.m4: Add notes and test for OpenBSD 2.6 m4.
18729
18730         * mpq/out_str.c: New file.
18731         * mpq/Makefile.am (libmpq_la_SOURCES): Add it.
18732         * Makefile.am (MPQ_OBJECTS): Ditto.
18733         * gmp.h (mpq_out_str): New define and prototype.
18734
18735 2000-05-12  Kevin Ryde  <kevin@swox.se>
18736
18737         * configure.in (CONFIG_TOP_SRCDIR): Fix to use $srcdir not
18738         $top_srcdir (which doesn't exist).
18739         * acinclude.m4 (GMP_C_ANSI2KNR): Fix setting U=_.
18740         * gmp-impl.h (mpn_com_n, MPN_LOGOPS_N_INLINE): Fix missing "do"
18741         (not currently used, probably no ill effect anyway).
18742
18743 2000-05-11  Torbjorn Granlund  <tege@swox.com>
18744
18745         * randraw.c (lc): Major overhaul (pending rewrite).
18746         (_gmp_rand): Rewrite.
18747
18748 2000-05-08  Torbjorn Granlund  <tege@swox.com>
18749
18750         * mpz/tests/convert.c: Call free via _mp_free_func.
18751         * mpf/tests/t-conv.c: Likewise.
18752
18753         * memory.c: Add code enabled for DEBUG that adds special patterns
18754         around allocated blocks.
18755
18756 2000-05-05  Linus Nordberg  <linus@swox.se>
18757
18758         * gmp.texi (Miscellaneous Float Functions): Correct parameter list
18759         for mpf_urandomb().
18760
18761         * configure.in: Invoke AC_REVISION.
18762
18763 2000-05-05  Kevin Ryde  <kevin@swox.se>
18764
18765         * gmp.texi: Use @dircategory and @direntry.
18766         (Installing GMP): Clarification for --target, updates on SunOS
18767         problems.
18768         (Integer Arithmetic): Add mpz_mul_si.
18769         (Initializing Rationals): Add mpq_swap.
18770         (Assigning Floats): Add mpf_swap.
18771         (Low-level Functions): Add mpn_divexact_by3c, and details of what
18772         the calculation actually gives.
18773         (Low-level Functions): Note extra space needed by mpn_gcdext,
18774         clarify the details a bit.
18775
18776         * compat.c: New file, entry points for upward binary compatibility.
18777         (mpn_divexact_by3): Compatibility function.
18778         * Makefile.am (libgmp_la_SOURCES): Add compat.c.
18779
18780         * mpn/tests/ref.c: Rearrange macros for ansi2knr.
18781         (div1): Renamed from div to avoid library function.
18782         (refmpn_divexact_by3c, refmpn_gcd_1, refmpn_popcount,
18783         refmpn_hamdist): New functions.
18784         * mpn/tests/ref.h: Add extern "C", add new prototypes.
18785
18786         * gmp.h (gmp_randinit, etc): Add extern "C".
18787         (_mpq_cmp_ui): Fix prototype name from mpq_cmp_ui.
18788         (mpn_divexact_by3): Now a macro calling mpn_divexact_by3c.
18789         (mpn_divexact_by3c): New prototype and define.
18790
18791         * mpn/x86/diveby3.asm: Change to mpn_divexact_by3c.
18792         * mpn/x86/k6/diveby3.asm: Ditto.
18793         * mpn/generic/diveby3.c: Ditto.
18794         * mpn/asm-defs.m4: Ditto on the define_mpn.
18795         * acconfig.h (HAVE_NATIVE_mpn_divexact_by3c): New define.
18796
18797         * mpq/swap.c: New file, derived from mpz/swap.c.
18798         * mpf/swap.c: Ditto.
18799         * mpq/Makefile.am: Add swap.c.
18800         * mpf/Makefile.am: Ditto.
18801         * Makefile.am: Add two new "swap.lo"s.
18802
18803         * mpn/x86/k6/mmx/com_n.asm: Fix an addressing bug (fortunately
18804         this code hasn't been used anywhere yet).
18805
18806         * mpn/x86/k7/mmx/divrem_1.asm: New file.
18807         * mpn/x86/k7/mmx/mod_1.asm: New file.
18808         * mpn/x86/k7/diveby3.asm: New file.
18809         * mpn/x86/k7/README: Update.
18810
18811         * mpn/x86/k7/aorsmul_1.asm: Use new cmovCC, no object code change.
18812         * mpn/x86/k7/mul_basecase.asm: Ditto.
18813         * mpn/x86/p6/aorsmul_1.asm: Ditto.
18814
18815         * mpn/x86/x86-defs.m4 (defframe_empty_if_zero): Eval the argument.
18816         (cmovCC): New macros, replacing individual cmovCC_reg_reg forms.
18817         (Zdisp): Recognise more instructions.
18818         (shldl,etc): Use m4_instruction_wrapper().
18819         (ASSERT, movl_text_address): New macros.
18820
18821         * mpn/asm-defs.m4: Add remarks on SunOS /usr/bin/m4 and new
18822         OpenBSD m4.
18823         (m4_assert_numargs_internal_check): Remove a spurious parameter.
18824         (m4_empty_if_zero): Eval the argument.
18825         (m4_assert, m4_assert_numargs_range, m4_config_gmp_mparam,
18826         m4_instruction_wrapper): New macros.
18827
18828 2000-05-04  Linus Nordberg  <linus@swox.se>
18829
18830         * gmp.texi (Reporting Bugs): Be explicit about output from running
18831         a command.
18832
18833 2000-05-02  Torbjorn Granlund  <tege@swox.com>
18834
18835         * mpn/generic/bz_divrem_n.c (mpn_bz_divrem_n): Handle non-zero return
18836         from first mpn_bz_div_3_halves_by_2 call.
18837         (mpn_bz_divrem_aux): Likewise.
18838
18839 2000-04-30  Kevin Ryde  <kevin@swox.se>
18840
18841         * tune/* (GCD_ACCEL_THRESHOLD, GCDEXT_THRESHOLD): Tune these.
18842
18843         * mpn/generic/gcdext.c (GCDEXT_THRESHOLD): Rename from THRESHOLD,
18844         use with >=, adjust default to 17 accordingly.
18845         Use new *_SWAP macros.
18846
18847         * mpn/generic/gcd.c (GCD_ACCEL_THRESHOLD): Rename from
18848         ACCEL_THRESHOLD, use with >=, adjust default to 5 accordingly.
18849         Use new *_SWAP macros.
18850
18851         * mpf/get_str.c, mpf/set_str.c, mpf/sub.c, mpz/add.c, mpz/ior.c,
18852         mpz/and.c, mpz/sub.c, mpz/xor.c, mpz/ui_pow_ui.c,
18853         mpn/generic/mul.c: Use new *_SWAP macros.
18854
18855         * stack-alloc.h: Add extern "C" around prototypes.
18856
18857         * gmp-impl.h: (MP_PTR_SWAP, etc): New macros.
18858         (_mp_allocate_func, etc): Use _PROTO.
18859         [TUNE_PROGRAM_BUILD]: More changes in tune program build part.
18860
18861 2000-04-28  Torbjorn Granlund  <tege@swox.com>
18862
18863         * mpn/pa64/add_n.s: Add `,entry' to export directive.
18864         * mpn/pa64/addmul_1.S, mpn/pa64/lshift.s, mpn/pa64/mul_1.S,
18865         mpn/pa64/rshift.s, mpn/pa64/sub_n.s, mpn/pa64/submul_1.S,
18866         mpn/pa64/umul_ppmm.S: Likewise.
18867         * mpn/hppa/hppa1_1/udiv_qrnnd.S: New name for udiv_qrnnd.s.
18868         Add PIC support.
18869
18870 2000-04-29  Kevin Ryde  <kevin@swox.se>
18871
18872         * gmp-impl.h [TUNE_PROGRAM_BUILD] (TOOM3_MUL_THRESHOLD_LIMIT): New
18873         define.
18874         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Use
18875         TOOM3_MUL_THRESHOLD_LIMIT, not a hard coded 500.
18876
18877         * memory.c: Use <stdlib.h> for malloc etc, and use _PROTO.
18878         * stack-alloc.c: Don't use C++ reserved word "this".
18879         * urandom.h: Put extern "C" around prototypes.
18880         * mpz/powm.c: Switch a couple of parameters to "const", which they
18881         are, to satisfy g++.
18882
18883         * randraw.c, stack-alloc.c, mpbsd/mout.c, mpbsd/mtox.c: Add casts to
18884         help g++.
18885
18886         * stack-alloc.c: Provide dual ANSI/K&R function definitions.
18887         * mpz/addmul_ui.c,get_d.c,inp_str.c,perfpow.c,powm.c,pprime_p.c,
18888         rrandomb.c,set_str.c,ui_pow_ui.c: Ditto.
18889         * mpf/integer.c,set_str.c: Ditto.
18890         * mpbsd/min.c,xtom.c: Ditto.
18891         * mpn/generic/bz_divrem_n.c,dump.c,gcd_1.c,get_str.c,hamdist.c,
18892         popcount.c,random.c,random2.c,set_str.c: Ditto.
18893
18894         * rand.c: Use <stdio.h> for NULL.
18895         * mpz/gcd_ui.c,gcdext.c,mul.c,perfpow.c,powm_ui.c,root.c,sqrt.c,
18896         sqrtrem.c: Ditto
18897         * mpf/sqrt.c,sqrt_ui.c: Ditto.
18898         * mpn/generic/perfsqr.c,sqrtrem.c: Ditto.
18899
18900         * gmp-impl.h (NULL, malloc, realloc, free): Don't define/declare.
18901         (extern "C"): Add around function prototypes.
18902         (mpn_kara_mul_n, mpn_kara_sqr_n, mpn_toom3_mul_n, mpn_toom3_sqr_n):
18903         Add prototypes.
18904         [TUNE_PROGRAM_BUILD] (FIB_THRESHOLD): Add necessary redefinitions for
18905         use by tune program.
18906         * mpn/generic/mul_n.c: Remove mpn_toom3_mul_n prototype.
18907
18908         * acinclude.m4 (GMP_C_ANSI2KNR): New macro.
18909         (GMP_CHECK_ASM_MMX, GMP_CHECK_ASM_SHLDL_CL): Fix to use
18910         $gmp_cv_check_asm_text which is what GMP_CHECK_ASM_TEXT sets.
18911         * configure.in (GMP_C_ANSI2KNR): Use this instead of AM_C_PROTOTYPES,
18912         for reasons described with its definition.
18913
18914         * demos/Makefile.am (ansi2knr): Use $(top_builddir) nor $(top_srcdir).
18915
18916         * mpz/fib_ui.c (FIB_THRESHOLD): Rename from FIB_THRES, for consistency.
18917         (FIB_THRESHOLD): Conditionalize so gmp-mparam.h can define a value.
18918         (mpz_fib_bigcase): Use >= FIB_THRESHOLD, same as main mpz_fib_ui.
18919         * tune/tuneup.c,Makefile.am (FIB_THRESHOLD): Tune this.
18920
18921         * configure.in (*-*-aix* gmp_m4postinc): Fix setting (don't overwrite
18922         a value just stored).
18923
18924 2000-04-26  Kevin Ryde  <kevin@swox.se>
18925
18926         * mpn/sparc32/udiv_fp.asm: Use mpn_udiv_qrnnd macro.
18927         * mpn/sparc32/udiv_nfp.asm: Ditto.
18928         * mpn/sparc32/v8/supersparc/udiv.asm: Ditto.
18929         * mpn/sparc32/umul.asm: Name the function mpn_umul_ppmm.
18930         * mpn/sparc32/v8/umul.asm: Ditto.
18931         * mpn/powerpc32/umul.asm: Ditto.
18932
18933         * mpn/x86/syntax.h: Remove file, since now unused.
18934
18935         * configure.in (x86): Remove -DBROKEN_ALIGN and -DOLD_GAS
18936         previously used by .S files.
18937         (x86 extra_functions): Add udiv and umul.
18938         (GMP_PROG_M4): Use this instead of AC_CHECK_PROG(M4,m4,...)
18939         (HAVE_NATIVE_*): Loosen up the regexp to "PROLOGUE.*" so as to
18940         accept PROLOGUE_GP on alpha.
18941
18942         * acconfig.h (HAVE_NATIVE_mpn_umul_ppmm, udiv_qrnnd, invert_limb):
18943         New template defines.
18944         * mpn/asm-defs.m4 (mpn_umul_ppmm, mpn_udiv_qrnnd): New define_mpn()s.
18945         * longlong.h (umul_ppmm, udiv_qrnnd): Use a library version if
18946         it's available and an asm macro isn't.
18947         * gmp-impl.h (invert_limb): Ditto.
18948
18949         * gmp-impl.h (ASSERT_NOREALLOC): Not a good idea, remove it.
18950
18951         * acinclude.m4 (GMP_PROG_M4): New macro.
18952
18953 2000-04-25  Linus Nordberg  <linus@swox.se>
18954
18955         * gmp.texi (Random State Initialization): Correct arguments to
18956         `gmp_randinit'.
18957
18958         * acinclude.m4 (GMP_VERSION): Change `eval' --> `m4_eval'.  Fix
18959         from Kevin.
18960         * aclocal.m4: Regenerate.
18961
18962 2000-04-25  Kevin Ryde  <kevin@swox.se>
18963
18964         * mpn/x86/aors_n.asm: Remove parentheses around an immediate that
18965         Solaris "as" doesn't like, change by Torbjorn.
18966
18967 2000-04-24  Kevin Ryde  <kevin@swox.se>
18968
18969         * configure.in (AC_CHECK_FUNCS): Add strtoul.
18970
18971         * mpn/generic/mul_n.c [TUNE_PROGRAM_BUILD] (mpn_mul_n): Bigger
18972         array for karatsuba temporary space for tune program build.
18973         (mpn_toom3_sqr_n) Remove an unused variable.
18974
18975         * demos/Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
18976         Add "allprogs:" pseudo-target.
18977         * demos/factorize.c, demos/isprime.c: Switch to ANSI functions,
18978         rely on ansi2knr.
18979
18980         * gmp.texi (Getting the Latest Version of GMP): Add reference to
18981         ftp.gnu.org mirrors list.
18982         * INSTALL: Add arg count check to example programs.
18983
18984         * mpn/x86/*/*.asm: Convert to FORTRAN ... or rather to
18985         FORTRAN-style "C" commenting to support Solaris "as".
18986         * mpn/x86/x86-defs.m4: Ditto, and add another Zdisp insn.
18987         * mpn/asm-defs.m4 (C): Update comments.
18988         * mpn/x86/README.family: Add a note on commenting, remove
18989         description of .S files.
18990
18991         * mpn/sparc64/addmul_1.asm, mul_1.asm, submul_1.asm: Use
18992         include_mpn().
18993
18994 2000-04-23  Torbjorn Granlund  <tege@swox.com>
18995
18996         * config.sub: Merge with FSF version of April 23.
18997
18998         * mpn/powerpc32: Use dnl/C instead of `#' for comments.
18999
19000         * config.guess: Get "model" limit between pentium 2 and pentium3 right.
19001         Get rid of code determining `_' prefix; use double labels instead.
19002         * config.guess: Partially merge with FSF version of April 22.
19003         (Don't bring over NetBSD changes for now.)
19004
19005 2000-04-23  Kevin Ryde  <kevin@swox.se>
19006
19007         * tune/Makefile.am, tune/README, tune/common.c, tune/rdtsc.asm,
19008         tune/speed.c, tune/speed.h, tune/time.c, tune/tuneup.c: New files.
19009         * tune/Makefile.in: New file, generated from Makefile.am.
19010
19011         * gmp-impl.h (ASSERT_NOREALLOC,TMP_ALLOC_LIMBS): New macros.
19012         [TUNE_PROGRAM_BUILD] Further mods for tune program builds.
19013
19014         * mpz/Makefile.am: Add -DOPERATION_$* for new mul_siui.c.
19015         Add rules to build mul_si and mul_ui from a common mul_siui.c.
19016         * mpz/mul_siui.c: New file, derived from and replacing mul_ui.c.
19017         * gmp.h (mpz_mul_si): New prototype and define.
19018
19019         * mpn/tests/*.c [__i386__] (CLOCK): Don't use floating point in
19020         CLOCK because cpp can't handle floats in #if's (TIMES is derived
19021         from CLOCK by default).
19022
19023         * mpn/asm-defs.m4 (include_mpn): New macro.
19024         (m4_assert_numargs) Changes to implementation.
19025
19026         * mpf/Makefile.am: Add -DOPERATION_$* for new integer.c.
19027         Remove explicit rules for floor.o etc.
19028         * mpf/integer.c: Use OPERATION_$* for floor/ceil/trunc.
19029
19030         * mpn/Makefile.am: Put "tests" in SUBDIRS.
19031         * mpn/tests/Makefile.am: New file providing rules to build test
19032         programs, nothing done in a "make all" or "make check" though.
19033         * mpn/tests/README: New file.
19034
19035         * acconfig.h (HAVE_PENTIUM_RDTSC): New define.
19036
19037         * configure.in (x86): Rearrange target cases.
19038         Add mulfunc aors_n and aorsmul_1 for x86 and pentium (now all x86s).
19039         Remove asm-syntax.h generation not needed.
19040         Remove now unused family=x86.
19041         (sparc) Remove unused family=sparc.
19042         (HAVE_PENTIUM_RDTSC) New AC_DEFINE and AM_CONDITIONAL.
19043         (AM_C_PROTOTYPES) New test, supporting ansi2knr.
19044         (AC_CHECK_HEADERS) Add getopt.h, unistd.h and sys/sysctl.h for
19045         tune progs.
19046         (AC_CHECK_FUNCS) Add getopt_long, sysconf and sysctlbyname for
19047         tune progs.
19048         (config.m4 CONFIG_TOP_SRCDIR) Renamed from CONFIG_SRCDIR.
19049         (config.m4 asm-defs.m4) Use CONFIG_TOP_SRCDIR and include().
19050         (gmp_m4postinc) Use include_mpn().
19051         (gmp_links) Omit asm-defs.m4/asm.m4 and gmp_m4postinc's.
19052         (MULFUNC_PROLOGUE) Fix regexps so all functions get AC_DEFINE'd.
19053         (PROLOGUE) Ditto (native copyi and copyd were unused in gmp 3).
19054         (KARATSUBA_SQR_THRESHOLD) Copy from gmp-mparam.h into config.m4.
19055         (AC_OUTPUT) Add tune/Makefile, mpn/tests/Makefile.
19056
19057         * Makefile.am (AUTOMAKE_OPTIONS): Add ansi2knr.
19058         (SUBDIRS): Add tune, reorder directories.
19059         (MPZ_OBJECTS): Add mpz/mul_si.lo.
19060         (libmp_la_SOURCES): Use this for top-level objects, not .lo's.
19061         * ansi2knr.c, ansi2knr.1: New files, provided by automake.
19062
19063         * mpn/x86/aors_n.asm: Convert add_n.S and sub_n.S to a
19064         multi-function aors_n.asm, no object code change.
19065         * mpn/x86/pentium/aors_n.asm: Ditto.
19066         * mpn/x86/aorsmul_1.asm: Ditto for addmul/submul.
19067         * mpn/x86/pentium/aorsmul_1.asm: Ditto.
19068
19069         * mpn/x86/lshift.asm, mpn/x86/mul_1.asm, mpn/x86/mul_basecase.asm,
19070         mpn/x86/rshift.asm: Convert from .S, no object code change.
19071         * mpn/x86/pentium/lshift.asm, mpn/x86/pentium/mul_1.asm,
19072         mpn/x86/pentium/mul_basecase.asm, mpn/x86/pentium/rshift.asm: Ditto.
19073
19074         * gmp.texi (Reporting Bugs): Itemize the list of things to include.
19075         (Miscellaneous Float Functions): Correct typo in mpf_ceil etc
19076         argument types.
19077         Change @ifinfo -> @ifnottex for benefit of makeinfo --html.
19078         Remove unnecessary @iftex's around @tex.
19079
19080 2000-04-22  Torbjorn Granlund  <tege@swox.com>
19081
19082         * config.guess: Generalize x86 cpu determination code.
19083         Now works on Solaris.
19084
19085         * mpz/nextprime.c: Rewrite still disabled code.
19086
19087         * configure.in: Specifically match freebsd[3-9].
19088
19089 2000-04-21  Torbjorn Granlund  <tege@swox.com>
19090
19091         * rand.c: Call mpz_clear for otherwise leaking mpz_t.
19092
19093         * mpz/pprime_p.c (mpz_probab_prime_p): Merge handling of negative
19094         n into code for handling small positive n.  Merge variables m and n.
19095         After dividing, simply call mpz_millerrabin.
19096         (isprime): Local variables now use attribute `long'.
19097         (mpz_millerrabin): New static function, based on code from
19098         mpz_probab_prime_p.
19099         (millerrabin): Now simple workhorse for mpz_millerrabin.
19100
19101 2000-04-19  Torbjorn Granlund  <tege@swox.com>
19102
19103         * gmp-impl.h: Fix parenthesis error in test for __APPLE_CC__.
19104
19105 2000-04-18  Linus Nordberg  <linus@swox.se>
19106
19107         * NEWS: Add info about shared libraries.  Remove reference to
19108         gmp_randinit_lc.
19109
19110 2000-04-17  Torbjorn Granlund  <tege@swox.com>
19111
19112         * Version 3.0 released.
19113
19114         * mpn/arm/add_n.S: New version from Robert Harley.
19115         * mpn/arm/addmul_1.S: Likewise.
19116         * mpn/arm/mul_1.S: Likewise.
19117         * mpn/arm/sub_n.S: Likewise.
19118
19119         * gmp.h (__GNU_MP_VERSION_PATCHLEVEL): Now 0.
19120
19121 2000-04-17  Linus Nordberg  <linus@swox.se>
19122
19123         * configure.in (hppa2.0*-*-*): Pass `+O3' to cc/c89 in 64-bit mode
19124         to avoid compiler bug.
19125         (ns32k*-*-*): Fix typo in path.  Change by Kevin.
19126         (alpha*-*-osf*): New case.  Pass assembly flags for architecture
19127         to gcc.
19128         (alpha*-*-*): Don't bother searching for cc.
19129         * configure: Regenerate.
19130
19131         * Makefile.am (EXTRA_DIST): Add `macos', `.gdbinit'.
19132         * Makefile.in: Regenerate.
19133         * mpn/Makefile.am (EXTRA_DIST): Add `m88k', `lisp'.
19134         * mpn/Makefile.in: Regenerate.
19135
19136 2000-04-16  Kevin Ryde  <kevin@swox.se>
19137
19138         * README: Updates, and don't duplicate the example in INSTALL.
19139         * INSTALL: Minor updates.
19140         * gmp.texi (Installing MP): Minor edits, restore CC/CFLAGS description.
19141
19142 2000-04-16  Linus Nordberg  <linus@swox.se>
19143
19144         * configure.in (*-*-cygwin*): Select BSD_SYNTAX to avoid
19145         .type/.size in PROLOGUE for ELF_SYNTAX.  Override ALIGN definition
19146         from x86/syntax.h.
19147         (gmp_xoptcflags_${CC}): New set of variables, indicating
19148         ``exclusive optional cflags''.
19149         (most sparcs): Use gmp_xoptcflags instead of gmp_optcflags to
19150         ensure that we pass CPU type to older gcc.
19151         (CFLAGS): CFLAGS on the command line was spoiled.
19152         * configure: Regenerate.
19153
19154 2000-04-16  Linus Nordberg  <linus@swox.se>
19155
19156         * configure.in: Invoke AC_PROG_LIBTOOL directly.
19157
19158         * acinclude.m4 (GMP_PROG_CC_FIND): Quote source variable when
19159         setting CC64 and CFLAGS64.
19160         (GMP_PROG_CC_SELECT): Cache result.
19161         (GMP_PROG_LIBTOOL): Remove.
19162
19163         * aclocal.m4: Regenerate.
19164         * configure: Regenerate.
19165
19166 2000-04-16  Linus Nordberg  <linus@swox.se>
19167
19168         * tests/rand/t-rand.c (main): Add non-ANSI function declaration.
19169         Don't use `const'.
19170
19171 2000-04-16  Torbjorn Granlund  <tege@swox.com>
19172
19173         * mpn/generic/dump.c: Suppress output of leadign zeros.
19174
19175         * mpz/inp_str.c: Fix memory leakage.
19176
19177         * mpz/tests/reuse.c (dss_func_division): Add a final 1.
19178
19179         * longlong.h (alpha count_leading_zeros): Wrap in __MPN.
19180         * mpn/alpha/cntlz.asm: Use __gmpn prefix (by means of __MPN).
19181
19182         * longlong.h (__umul_ppmm, __udiv_qrnnd): Wrap in __MPN.
19183         * mpn/alpha/udiv_qrnnd.S: Use __gmpn prefix.
19184         * mpn/hppa/udiv_qrnnd.s: Likewise.
19185         * mpn/hppa/hppa1_1/udiv_qrnnd.s: Likewise.
19186         * mpn/pa64/udiv_qrnnd.c: Likewise (by means of __MPN).
19187         * mpn/pa64/umul_ppmm.S: Likewise.
19188         * mpn/sparc32/udiv_fp.asm: Likewise (by means of MPN).
19189         * mpn/sparc32/udiv_nfp.asm: Likewise (by means of MPN).
19190         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise (by means of MPN).
19191
19192         * mpn/generic/tdiv_qr.c: Work around gcc 2.7.2.3 i386 register handling
19193         bug.
19194
19195         * mpn/generic/tdiv_qr.c: Use udiv_qrnnd instead of mpn_divrem_1
19196         when computing appropriate quotient; mpn_divrem_1 writes too
19197         many quotient limbs.
19198
19199         * mpn/asm-defs.m4: invert_normalized_limb => invert_limb.
19200         * mpn/alpha/invert_limb.asm: mpn_invert_normalized_limb =>
19201         mpn_invert_limb.
19202         * gmp.h: Likewise.
19203         * gmp-impl.h (alpha specific): invert_normalized_limb => invert_limb;
19204         wrap with __MPN.
19205         * longlong.h (alpha udiv_qrnnd): Likewise.
19206
19207 2000-04-16  Kevin Ryde  <kevin@swox.se>
19208
19209         * gmp.h (mp_set_memory_functions,mp_bits_per_limb,gmp_errno): Add
19210         #defines so the library symbols are __gmp_*.
19211         * errno.c: Include gmp.h.
19212         * gmp-impl.h (_mp_allocate_func,etc): Add #defines to __gmp_*.
19213         (__clz_tab): New #define to __MPN(clz_tab).
19214         * stack-alloc.c (__gmp_allocate_func,etc): Change from _mp_*.
19215
19216         * Makefile.am (libmp_la_DEPENDENCIES): Add some mpz files needed
19217         for new mpz_powm (pow in libmp).
19218         (EXTRA_DIST): Add projects directory.
19219
19220         * mpn/*: Change __mpn to __gmpn.
19221         * gmp.h (__MPN): Ditto.
19222         * stack_alloc.c,stack-alloc.h: Change __tmp to __gmp_tmp.
19223
19224         * mpn/generic/sb_divrem_mn.c (mpn_sb_divrem_mn): Avoid gcc 2.7.2.3
19225         i386 register handling bug (same as previously in mpn_divrem_classic).
19226
19227         * mpn/generic/divrem.c: Now contains mpn_divrem, which is not an
19228         internal function, so remove warning comment.
19229
19230         * gmp.texi (Compatibility with Version 2.0.x): Source level only.
19231
19232 2000-04-16  Linus Nordberg  <linus@swox.se>
19233
19234         * configure.in (hppa1.0*): Prefer c89 to cc.
19235         * configure: Regenerate.
19236
19237 2000-04-15  Linus Nordberg  <linus@swox.se>
19238
19239         * configure.in: If `mpn_path' is set by user on configure command
19240         line, use that as path.
19241         * configure: Regenerate.
19242
19243 2000-04-15  Linus Nordberg  <linus@swox.se>
19244
19245         * configure.in (hppa2.0*): Use path "hppa/hppa1_1 hppa" if no
19246         64-bit compiler was found.
19247         * configure: Regenerate.
19248
19249 2000-04-15  Linus Nordberg  <linus@swox.se>
19250
19251         * configure.in: Honor `CC' and `CFLAGS' set by user on configure
19252         command line.
19253         * acinclude.m4: (GMP_PROG_CC_SELECT): Set CFLAGS if not set already.
19254         * aclocal.m4: Regenerate.
19255         * configure: Regenerate.
19256
19257 2000-04-15  Linus Nordberg  <linus@swox.se>
19258
19259         * acinclude.m4 (GMP_PROG_CC_FIND): Remove debug output.  Remove
19260         commented out code.
19261         * aclocal.m4: Regenerate.
19262         * configure: Regenerate.
19263
19264         * configure.in: Make all `-mcpu' options to gcc optional.
19265         * configure: Regenerate.
19266
19267         * tests/rand/Makefile.am: Don't do anything for target 'all'.
19268         * tests/rand/Makefile.in: Regenerate.
19269
19270 2000-04-15  Kevin Ryde  <kevin@swox.se>
19271
19272         * README: Small updates.
19273         * NEWS: Add some things about 3.0.
19274
19275         * mpz/Makefile.am (EXTRA_DIST): Remove dmincl.c.
19276
19277         * Makefile.am: Use -version-info on libraries, not -release.
19278
19279         * mpz/tdiv_qr.c: Add mdiv function header #ifdef BERKELEY_MP.
19280         * mpbsd/Makefile.am: Use mpz/tdiv_qr.c, not mdiv.c.
19281         * Makefile.am (MPBSD_OBJECTS): Change mdiv.lo to tdiv_qr.lo.
19282         (libmp_la_DEPENDENCIES): Add mp_clz_tab.lo.
19283         * mpbsd/mdiv.c: Remove file.
19284
19285         * config/mt-linux,mt-m68k,mt-m88110,mt-ppc,mt-ppc64-aix,mt-pwr,
19286         mt-sprc8-gcc,mt-sprc9-gcc,mt-supspc-gcc,mt-vax,mt-x86,
19287         mpn/config/mt-pa2hpux,mt-sprc9,t-oldgas,t-ppc-aix,t-pwr-aix:
19288         Remove configure fragments not used since change to autoconf.
19289
19290         * mpn/generic/bz_divrem_n.c,sb_divrem_mn.c: Add comment that
19291         internal functions are changeable and shouldn't be used directly.
19292
19293 2000-04-15  Linus Nordberg  <linus@swox.se>
19294
19295         * configure.in: Remove debug output.
19296         * configure: Regenerate.
19297
19298 2000-04-15  Torbjorn Granlund  <tege@swox.com>
19299
19300         * mpn/generic/tdiv_qr.c: Don't use alloca directly.
19301
19302         * mpz/tdiv_qr.c: Fix typo.
19303         * mpz/tdiv_r.c: Fix typo.
19304         * mpz/tdiv_q.c: Fix typo.
19305
19306         * configure.in: Disable -march=pentiumpro due to apparent compiler
19307         problems.
19308
19309         * mpz/powm.c: Replace with new code from Paul Zimmermann.
19310
19311         * mpz/tdiv_q.c: Remove debug code.
19312
19313         * mpn/generic/divrem.c: Remove C++ style `//' commented-out code.
19314         * mpn/generic/sb_divrem_mn.c: Likewise.
19315
19316 2000-04-14  Torbjorn Granlund  <tege@swox.com>
19317
19318         * mpz/cdiv_q.c: Change temp allocation for new requirements of
19319         mpz_tdiv_qr.
19320         * mpz/fdiv_q.c: Likewise.
19321
19322         * mpn/sparc64/gmp-mparam.h: Set up parameters for TOOM3.
19323
19324         * mpz/dmincl.c: Delete file.
19325         * mpz/tdiv_qr.c: Rewrite using mpn_tdiv_qr.
19326         * mpz/tdiv_r.c: Likewise.
19327         * mpz/tdiv_q.c: Likewise.
19328
19329         * mpn/generic/tdiv_qr.c: New file.
19330         * mpn/generic/bz_divrem_n.c: New file.
19331         * mpn/generic/sb_divrem_mn.c: New file.
19332
19333         * gmp-impl.h (MPZ_REALLOC): New macro.
19334         (mpn_sb_divrem_mn): Declare.
19335         (mpn_bz_divrem_n): Declare.
19336         (mpn_tdiv_qr): Declare.
19337
19338         * configure.in (gmp_mpn_functions): Delete divrem_newt and divrem_1n;
19339         add tdiv_qr, bz_divrem_n, and sb_divrem_mn.
19340         * mpn/generic/divrem_newt.c: Delete file.
19341         * mpn/generic/divrem_1n.c: Delete file.
19342
19343         * gmp.h (mpn_divrem_newton): Remove declaration.
19344         (mpn_divrem_classic): Remove declaration.
19345
19346         * gmp.h (mpn_divrem): Remove function definition.
19347         * mpn/generic/divrem.c: Replace mpn_divrem_classic with a
19348         mpn_divrem wrapper.
19349
19350 2000-04-14  Kevin Ryde  <kevin@swox.se>
19351
19352         * mpf/dump.c, mpz/dump.c, mpn/generic/dump.c,
19353         mpn/generic/divrem.c, mpn/generic/divrem_1n.c,
19354         mpn/generic/divrem_2.c, mpn/generic/divrem_newt.c,
19355         mpn/generic/mul.c, mpn/generic/mul_basecase.c,
19356         mpn/generic/mul_n.c, mpn/generic/sqr_basecase.c,
19357         mpn/generic/udiv_w_sdiv.c: Add comment that internal functions are
19358         changeable and shouldn't be used directly.
19359
19360         * mpq/div.c: Use DIVIDE_BY_ZERO (previously didn't get an
19361         exception on zero divisor).
19362
19363         * mpf/tests/t-get_d.c, mpz/tests/reuse.c: Add K&R function
19364         definitions.
19365         * mpz/tests/t-2exp.c: Don't use ANSI-ism 2ul.
19366
19367         * gmp.texi (Installing MP): Build problem notes for GSYM_PREFIX
19368         and ranlib on native SunOS.
19369         Particular systems notes about AIX and HPPA shared libraries
19370         disabled.
19371         (MP Basics): Add that undocumented things shouldn't be used.
19372         (Introduction to MP): Add to CPUs listed.
19373
19374         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): Don't depend on C
19375         having "void".
19376
19377 2000-04-13  Linus Nordberg  <linus@swox.se>
19378
19379         * mpn/pa64/udiv_qrnnd.c (__udiv_qrnnd64): Add K&R function
19380         definition.
19381
19382         * configure.in: Disable shared libraries for hppa*.
19383         (mips-sgi-irix6.*): Fix flags for 64-bit gcc.
19384         (hppa2.0*-*-*): Prefer c89 to cc.
19385         * configure: Regenerate.
19386
19387         * gmp.h (gmp_randalg_t): Remove comma after last element.
19388
19389         * tests/rand/t-rand.c: Add copyright notice.
19390
19391 2000-04-13  Kevin Ryde  <kevin@swox.se>
19392
19393         * mpn/generic/mul_n.c, mpn/generic/gcdext.c, mpz/nextprime.c,
19394         mpz/remove.c, mpz/root.c: Add K&R function definitions.
19395         * mpz/rrandomb.c: Fix typo in K&R part.
19396         * stack-alloc.c: Add K&R style function pointer declarations.
19397
19398         * mpz/root.c: Use SQRT_OF_NEGATIVE on even roots of negatives.
19399         Use DIVIDE_BY_ZERO on a "zero'th" root.
19400
19401         * configure: Regenerate with autoconf backpatched to fix --srcdir
19402         absolute path wildcards that bash doesn't like, change by Linus.
19403
19404         * gmp.texi (Integer Arithmetic): Document mpz_nextprime.
19405         (Miscellaneous Integer Functions): Fix mpz_fits_* formatting.
19406         (Installing MP): Comment-out CC and CFLAGS description.
19407
19408 2000-04-13  Linus Nordberg  <linus@swox.se>
19409
19410         * rand.c (gmp_randinit): Don't combine va_alist with ordinary
19411         arguments for non STDC.
19412
19413 2000-04-13  Torbjorn Granlund  <tege@swox.com>
19414
19415         * mpz/nextprime.c: Use proper names of new random types and functions.
19416
19417         * mpz/rrandomb.c: New file.
19418         * mpz/Makefile.am: List it.
19419         * mpz/Makefile.in: Regenerate.
19420         * Makefile.am: Here too.
19421         * Makefile.in: Regenerate.
19422         * gmp.h: Declare mpz_rrandomb.
19423
19424 2000-04-12  Linus Nordberg  <linus@swox.se>
19425
19426         * Makefile.am, demos/Makefile.am, mpbsd/Makefile.am,
19427         mpbsd/tests/Makefile.am, mpf/Makefile.am, mpf/tests/Makefile.am,
19428         mpn/Makefile.am, mpq/Makefile.am, mpq/tests/Makefile.am,
19429         mpz/Makefile.am, mpz/tests/Makefile.am, tests/Makefile.am,
19430         tests/rand/Makefile.am (AUTOMAKE_OPTIONS): Add 'no-dependencies'.
19431
19432         * Makefile.in, demos/Makefile.in, mpbsd/Makefile.in,
19433         mpbsd/tests/Makefile.in, mpf/Makefile.in, mpf/tests/Makefile.in,
19434         mpn/Makefile.in, mpq/Makefile.in, mpq/tests/Makefile.in,
19435         mpz/Makefile.in, mpz/tests/Makefile.in, tests/Makefile.in,
19436         tests/rand/Makefile.in: Regenerate.
19437
19438 2000-04-12  Linus Nordberg  <linus@swox.se>
19439
19440         * randlc.c (gmp_randinit_lc): Disable function.
19441         * gmp.texi (Random State Initialization): Remove gmp_randinit_lc.
19442
19443         * acinclude.m4 (GMP_CHECK_CC_64BIT): Compiling an empty main
19444         successfully with `-n32' will have to suffice on irix6.
19445         * aclocal.m4: Regenerate.
19446
19447         * configure.in (sparc): Don't pass -D_LONG_LONG_LIMB to compiler.
19448         (mips-sgi-irix6.*): Use compiler option `-n32' rather than `-64'
19449         for 64-bit `cc'.  Add options for gcc.
19450         * configure: Regenerate.
19451
19452         * mpf/urandomb.c (mpf_urandomb): Add third parameter 'nbits'.  If
19453         'nbits' doesn't make even limbs, shift up result before
19454         normalizing.
19455
19456         * gmp.h (mpf_urandomb): Add parameter to prototype.
19457
19458         * mpf/urandom.c: Rename file to ...
19459         * mpf/urandomb.c: ... this.
19460         * Makefile.am (MPF_OBJECTS): Change urandom.lo --> urandomb.lo.
19461         * Makefile.in: Regenerate.
19462         * mpf/Makefile.am (libmpf_la_SOURCES): Change urandom.c --> urandomb.c.
19463         * mpf/Makefile.in: Regenerate.
19464
19465         * config.in: Regenerate for HAVE_DECL_OPTARG.
19466
19467         * randraw.c (_gmp_rand): Fix bug with _LONG_LONG_LIMB.
19468         (lc): Change return type.
19469         Use one temporary storage instead of two.
19470         Handle seed of size 0.
19471         Avoid modulus operation in some cases.
19472         Abort if M is not a power of 2.
19473         Fix bug with 64-bit limbs.
19474         Fix bug with small seed, small A and large M.
19475
19476         * tests/rand/gen.c (main): Include gmp.h.  Remove macros MIN, MAX.  Add
19477         option '-q'.  Don't demand argument N.  Change parameters in call
19478         to mpf_urandomb.
19479
19480         * tests/rand/t-rand.c: New file for testing random number generation.
19481
19482         * tests/rand/Makefile.am: Run t-rand for 'make check'.
19483         (test, bigtest): Rename to manual-test, manual-bigtest.
19484         * tests/rand/Makefile.in: Regenerate.
19485
19486 2000-04-12  Kevin Ryde  <kevin@swox.se>
19487
19488         * gmp-impl.h: Include config.h before TMP_ALLOC, so
19489         --disable-alloca works.
19490
19491         * mpbsd/Makefile.am: Don't recompile top-level sources here.
19492         * Makefile.am (libmp_la_DEPENDENCIES): Put objects here instead,
19493         add errno.lo and stack-alloc.lo.
19494
19495         * mpn/asm-defs.m4: Add a test and message for the unsuitable SunOS m4.
19496         * gmp.texi (Installing MP): Update note on SunOS m4 failure.
19497
19498         * acconfig.h: Add copyright notice using @TOP@.
19499
19500         * stack-alloc.c: Use _mp_allocate_func, not malloc.
19501         * gmp.texi (Installing MP): Note this under --disable-alloca.
19502
19503         * gmp.texi (Comparison Functions): mpz_cmp_abs => mpz_cmpabs.
19504         (Integer Arithmetic): mpz_prime_p not yet implemented, comment out.
19505         (Float Arithmetic): mpf_pow_ui now implemented, uncomment-out.
19506         (Miscellaneous Float Functions): Add mpf_ceil, mpf_floor, mpf_trunc.
19507         (Low-level Functions): Add mpn_random2, with mpn_random.
19508
19509         * mpn/m68k/mc68020/udiv.S: Rename from udiv.s.
19510         * mpn/m68k/mc68020/umul.S: Ditto.
19511
19512         * mpn/alpha/umul.asm: Rename from umul.s, remove .file and
19513         compiler identifiers.
19514
19515         * mpn/powerpc32/syntax.h: Removed, no longer used.
19516
19517         * mpn/a29k/udiv.s: Remove .file and compiler identifiers.
19518         * mpn/a29k/umul.s: Ditto.
19519
19520         * mpn/tests/ref.c: Use WANT_ASSERT.
19521         * mpn/tests/ref.h: Use _PROTO.
19522
19523         * mpbsd/configure.in: Removed, no longer required.
19524
19525         * mpf/div.c: Use DIVIDE_BY_ZERO.
19526         * mpf/div_ui.c: Ditto.
19527         * mpf/ui_div.c: Ditto.
19528         * mpq/inv.c: Ditto.
19529         * mpf/sqrt.c: Use SQRT_OF_NEGATIVE.
19530         * mpz/sqrt.c: Ditto.
19531         * mpz/sqrtrem.c: Ditto.
19532
19533         * gmp-impl.h (GMP_ERROR,SQRT_OF_NEGATIVE): New macros.
19534         (DIVIDE_BY_ZERO): Use GMP_ERROR.
19535         (__mp_bases): #define to __MPN(mp_bases).
19536
19537 2000-04-11  Linus Nordberg  <linus@swox.se>
19538
19539         * tests/rand/stat.c (main): Initialize `l1runs' at declaration.
19540
19541 2000-04-11  Kevin Ryde  <kevin@swox.se>
19542
19543         * mpz/fib_ui.c: Add K&R function definitions.
19544
19545         * mpbsd/tests/Makefile.am (TESTS): Add a dummy test to avoid a
19546         shell problem with an empty "for tst in $(TESTS) ; ...".
19547         * mpbsd/tests/dummy.c: New file.
19548
19549 2000-04-10  Torbjorn Granlund  <tege@swox.com>
19550
19551         * mpz/bin_uiui.c: Delete several unused variables.
19552         Add copyright notice.
19553         * mpz/bin_ui.c: Add copyright notice.
19554
19555         * longlong.h: Declare __count_leading_zeros for alpha.
19556
19557 2000-04-10  Linus Nordberg  <linus@swox.se>
19558
19559         * rand.c (gmp_randinit): Change parameter list to (rstate, alg, ...).
19560         * gmp.h: Change prototype accordingly.
19561         * mpz/pprime_p.c (millerrabin): Change call accordingly.
19562
19563         * configure.in: Check for `optarg'.
19564         * configure: Regenerate.
19565
19566         * mpn/Makefile.am: Remove incorrect comment.
19567         * mpn/Makefile.in: Regenerate.
19568
19569         * gmp.h: Rename most of the random number functions, structs and
19570           some of the struct members.
19571         * rand.c (gmp_randinit): Likewise.
19572         * randclr.c (gmp_randclear): Likewise.
19573         * randlc.c (gmp_randinit_lc): Likewise.
19574         * randlc2x.c (gmp_randinit_lc_2exp): Likewise.
19575         * randraw.c (lc): Likewise.
19576         (_gmp_rand_getraw): Likewise.
19577         * randsd.c (gmp_randseed): Likewise.
19578         * randsdui.c (gmp_randseed_ui): Likewise.
19579         * gmp.texi: Likewise.
19580
19581         * gmp.texi: Use three hyphens for a dash.
19582         (Low-level Functions): Remove documentation for gmp_rand_getraw.
19583         (Random Number Functions): Add info on where to find documentation
19584         on the random number functions.
19585
19586         * tests/rand/Makefile.am (test, bigtest): Quote argument to grep.
19587         * tests/rand/Makefile.in: Regenerate.
19588
19589         * tests/rand/gen.c: Declare optarg, optind, opterr if not already
19590         declared.
19591         (main): Use new names for the random stuff.
19592         (main): Don't use strtoul() if we don't have it.  Use strtol()
19593         instead, if we have it.  Otherwise, use atoi().
19594         (main): Use srandom/srandomdev for __FreeBSD__ only.
19595         (main): Use new parameter order to gmp_randinit().
19596
19597         * tests/rand/stat.c: Declare optarg, optind, opterr if not already
19598         declared.
19599
19600 2000-04-10  Torbjorn Granlund  <tege@swox.com>
19601
19602         * mpz/pprime_p.c: Pass 0L for mpz_scan1.  mpz_mmod => mpz_mod.
19603         (millerrabin): Use new random interface.
19604         (millerrabin): ... and don't forget to call gmp_randclear.
19605
19606         * mpz/nextprime.c: New file.
19607         * gmp.h: Declare mpz_nextprime.
19608         * mpz/Makefile.am: List nextprime.c.
19609         * mpz/Makefile.in: Regenerate.
19610         * Makefile.am: List mpz/nextprime.lo.
19611         * Makefile.in: Regenerate.
19612
19613 2000-04-10  Kevin Ryde  <kevin@swox.se>
19614
19615         * move-if-change, mpz/tests/move-if-change, mpq/tests/move-if-change,
19616         mpf/tests/move-if-change: Remove, no longer used.
19617
19618         * Makefile.am (SUBDIRS): Add tests, demos, mpbsd.
19619         (libmp.la): New target, conditional on WANT_MPBSD.
19620         (libgmp_la_LIBADD): Add -lm.
19621         (AUTOMAKE_OPTIONS): Add check-news.
19622         (include_HEADERS): Setup to install gmp.h and possibly mp.h.
19623         (DISTCLEANFILES): Add generated files.
19624         (check): Remove explicit target (now uses check-recursive).
19625
19626         * configure.in: Use AM_CONFIG_HEADER.
19627         Add --enable-mpbsd setting automake conditional WANT_MPBSD.
19628         Output demos/Makefile, mpbsd/Makefile and mpbsd/tests/Makefile.
19629
19630         * mpz/Makefile.am: Add SUBDIRS=tests, shorten INCLUDES since now
19631         using AM_CONFIG_HEADER.
19632         * mpq/Makefile.am: Ditto.
19633         * mpf/Makefile.am: Ditto, and add DISTCLEANFILES.
19634         * mpn/Makefile.am: Shorten INCLUDES, amend some comments.
19635         * mpz/tests/Makefile.am: Use TESTS and $(top_builddir).
19636         * mpf/tests/Makefile.am: Ditto.
19637         * mpq/tests/Makefile.am: Ditto.
19638         * demos/Makefile.am: New file.
19639
19640         * mpbsd/Makefile.am: New file, derived from old mpbsd/Makefile.in.
19641         * mpbsd/Makefile.in: Now generated from Makefile.am.
19642         * mpbsd/realloc.c: Removed, use mpz/realloc.c instead.
19643         * mpbsd/tests/Makefile.am: New file.
19644         * mpbsd/tests/Makefile.in: New file, generated from Makefile.am.
19645         * mpbsd/tests/allfuns.c: New file.
19646
19647         * gmp.texi (Top): Use @ifnottex, to help makeinfo --html.
19648         (Installing MP): Describe --enable-mpbsd and demo programs.
19649
19650         * tests/rand/statlib.c: mpz_cmp_abs => mpz_cmpabs.
19651
19652         * tests/rand/Makefile.am (LDADD): Don't need -lm (now in libgmp.la).
19653         (EXTRA_PROGRAMS): Not noinst_PROGRAMS.
19654         (INCLUDES): Shorten to -I$(top_srcdir) now using AM_CONFIG_HEADER.
19655
19656 2000-04-09  Torbjorn Granlund  <tege@swox.com>
19657
19658         * mpz/urandomm.c: Get type of count right.
19659         Simplify computation of nbits.
19660
19661 2000-04-08  Torbjorn Granlund  <tege@swox.com>
19662
19663         * mpz/urandomb.c: Fix reallocation condition.
19664         Simplify size computation.
19665
19666 2000-04-08  Linus Nordberg  <linus@swox.se>
19667
19668         * acinclude.m4 (GMP_CHECK_CC_64BIT): Add special handling for
19669         HPUX.
19670         (GMP_CHECK_ASM_W32): Ditto.
19671         * aclocal.m4: Regenerate.
19672
19673         * mpn/Makefile.am: Use $(CCAS) for assembling.
19674         (.asm.obj): Add rule.
19675         * mpn/Makefile.in: Regenerate.
19676
19677         * gmp.texi (Miscellaneous Integer Functions): Fix typos.
19678
19679         * configure.in: Never pass `-h' to grep.
19680         (mips-sgi-irix6.[2-9]*): Try to find 64-bit compiler.
19681         (hppa1.0*-*-*): New flag for cc.
19682         (hppa2.0*-*-*): Try to find 64-bit compiler.  Chose path, set
19683         CCAS.
19684         * configure: Regenerate.
19685
19686 2000-04-08  Torbjorn Granlund  <tege@swox.com>
19687
19688         * mpz/bin_ui.c: Don't depend on ANSI C features.
19689         * mpz/bin_uiui.c: Likewise.
19690
19691         * Makefile.am (MPZ_OBJECTS): mpz/cmp_abs* => mpz/cmpabs*.
19692         (MPQ_OBJECTS): Add mpq/set_d.lo.
19693         (MPZ_OBJECTS): Add mpz/fits*.lo.
19694         * Makefile.in: Regenerate.
19695
19696         * mpz/cmpabs.c: New name for mpz/cmp_abs.c.
19697         * mpz/cmpabs_ui.c: New name for mpz/cmp_abs_ui.c.
19698         * mpz/Makefile.am: Corresponding changes.
19699         * mpz/Makefile.in: Regenerate.
19700         * gmp.h: mpz_cmp_abs* => mpz_cmpabs*.
19701
19702         * mpz/addmul_ui.c (mpn_neg1): Don't depend on ANSI C features.
19703
19704         * mpz/invert.c: Use TMP_MARK since we invoke MPZ_TMP_INIT.
19705
19706         * gmp.h (mpq_set_d): Declare correctly.
19707         (mpz_root): Use _PROTO.
19708         (mpz_remove): Use _PROTO.
19709         (mpf_pow_iu): Use _PROTO.
19710
19711         * mpn/asm-defs.m4 (MPN_PREFIX): Revert previous change.
19712         * gmp.h (__MPN): Revert previous change.
19713
19714         * mpz/perfpow.c: De-ANSI-fy.  Add copyright notice.
19715
19716         * mpz/set_d.c: Misc cleanups.
19717
19718         * mpq/set_d: New file.
19719         * gmp.h: Declare mpq_set_d.
19720         * mpq/Makefile.am: List set_d.c.
19721         * mpq/Makefile.in: Regenerate.
19722
19723 2000-04-07  Torbjorn Granlund  <tege@swox.com>
19724
19725         * mpz/fits_sint_p.c: New file.
19726         * mpz/fits_slong_p.c: New file.
19727         * mpz/fits_sshort_p.c: New file.
19728         * mpz/fits_uint_p.c: New file.
19729         * mpz/fits_ulong_p.c: New file.
19730         * mpz/fits_ushort_p.c: New file.
19731         * gmp.h: Declare mpz_fits_*.
19732         * mpz/Makefile.am: List fits_* files.
19733         * mpz/Makefile.in: Regenerate.
19734
19735 2000-04-06  Kevin Ryde  <kevin@swox.se>
19736
19737         * gmp.texi (Installing MP): Add known build problem SunOS 4.1.4 m4
19738         failure.
19739
19740         * mpn/x86/pentium/gmp-mparam.h: Tune thresholds.
19741         * mpn/x86/p6/gmp-mparam.h: Ditto.
19742         * mpn/x86/k6/gmp-mparam.h: Tune thresholds, add UMUL_TIME, UDIV_TIME.
19743         * mpn/x86/k7/gmp-mparam.h: Tune thresholds, amend UMUL_TIME.
19744
19745         * mpn/generic/mul_n.c (mpn_kara_mul_n): Add an ASSERT.
19746         (mpn_kara_sqr_n): Add an ASSERT, use KARATSUBA_SQR_THRESHOLD.
19747         (mpn_toom3_sqr_n): Eliminate second evaluate3.
19748
19749         * gmp-impl.h (mpn_com_n,MPN_LOGOPS_N_INLINE): Don't allow size==0.
19750         (tune_mul_threshold,tune_sqr_threshold): Conditionalize
19751         declarations on TUNE_PROGRAM_BUILD.
19752
19753         * mpn/generic/sqr_basecase.c: Add an assert.
19754
19755 2000-04-05  Torbjorn Granlund  <tege@swox.com>
19756
19757         * gmp.h, mpn/asm-defs.m4: List the same functions for __MPN, but
19758         leave some commented out.
19759
19760         * gmp-impl.h (MPN_LOGOPS_N_INLINE): Optimize.
19761         (mpn_com_n): Optimize.
19762
19763         * gmp.h (__MPN): Make it use __gmpn instead of __mpn for consistency.
19764         * mpn/asm-defs.m4 (MPN_PREFIX): Likewise.
19765
19766         * gmp.h (GMP_ERROR_ALLOCATE): New errcode.
19767
19768         * gmp-impl.h (MPN_MUL_N_RECURSE): Delete.
19769         (MPN_SQR_RECURSE): Delete.
19770
19771         * gmp-impl.h (TARGET_REGISTER_STARVED): New define.
19772
19773         * gmp-impl.h (mpn_kara_sqr_n): Remap with __MPN.
19774         (mpn_toom3_sqr_n): Likewise.
19775         (mpn_kara_mul_n): Likewise.
19776         (mpn_toom3_mul_n): Likewise.
19777         (mpn_reciprocal): Likewise.
19778
19779         * gmp-impl.h (__gmpn_mul_n): Remove declaration.
19780         (__gmpn_sqr): Likewise.
19781         * gmp.h (mpn_sqr_n): Declare/remap.
19782         * mpn/generic/mul.c (mpn_sqr_n): New name for mpn_sqr.
19783
19784         * gmp.h (mpn_udiv_w_sdiv): Move __MPN remap from here...
19785         * gmp-impl.h: ...to here.
19786
19787 2000-04-05  Linus Nordberg  <linus@swox.se>
19788
19789         * gmp.texi (Top): Add `Random Number Functions' to menu.
19790         (Introduction to MP): Fix typo.
19791         (MP Basics): Create menu for all sections.  Move `Random Number
19792         Functions' to its own chapter.  Add nodes for all sections.
19793         (Function Classes): Mention random generation functions under
19794         miscellaneous.
19795         (Miscellaneous Integer Functions): Update mpz_urandomb,
19796         mpz_urandomm.
19797         (Low-level Functions): Remove mpn_rawrandom.
19798         (Random State Initialization): Update.
19799
19800         * mpf/urandom.c (mpf_urandomb): Remove SIZE parameter.  Normalize
19801         result correctly.
19802
19803         * gmp.h (mpf_urandomb): Remove SIZE parameter.
19804
19805         * randraw.c (gmp_rand_getraw): Handle the case where (1) the LC
19806         scheme doesn't generate even limbs and (2) more than one LC
19807         invocation is necessary to produce the requested number of bits.
19808
19809 2000-04-05  Torbjorn Granlund  <tege@swox.com>
19810
19811         * mpn/generic/mul_n.c (INVERSE_3): New name for THIRD, define for
19812         any BITS_PER_MP_LIMB.
19813         (MP_LIMB_T_MAX): New.
19814         (mpn_divexact3_n): Remove.
19815         (interpolate3): Use mpn_divexact_by3 instead of mpn_divexact3_n.
19816
19817 2000-04-05  Kevin Ryde  <kevin@swox.se>
19818
19819         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD<2): Remove cpp test.
19820         (tune_mul_threshold,tune_sqr_threshold): Add declarations, used in
19821         development only.
19822
19823         * mpn/x86/k7/sqr_basecase.asm: New file, only a copy of k6 for now.
19824
19825 2000-04-04  Torbjorn Granlund  <tege@swox.com>
19826
19827         * gmp-impl.h (TOOM3_MUL_THRESHOLD): Provide default.
19828         (TOOM3_SQR_THRESHOLD): Provide default.
19829
19830         * mpn/generic/mul_n.c: Rewrite (mostly by Robert Harley).
19831         * mpn/generic/mul.c: Rewrite (mostly by Robert Harley).
19832
19833         * configure.in (sparcv9 64-bit OS): Set extra_functions.
19834
19835 2000-04-04  Linus Nordberg  <linus@swox.se>
19836
19837         * mpn/generic/rawrandom.c: Remove file and replace with randraw.c
19838         on top level.
19839         (mpn_rawrandom): Rename to gmp_rand_getraw.
19840
19841         * randraw.c: New file; essentially a copy of
19842         mpn/generic/rawrandom.c.
19843         (gmp_rand_getraw): New function (formerly known as mpn_rawrandom).
19844
19845         * mpz/urandomb.c (mpz_urandomb): Change mpn_rawrandom -->
19846         gmp_rand_getraw.
19847         * mpz/urandomm.c (mpz_urandomb): Ditto.
19848         * mpf/urandom.c (mpf_urandomb): Ditto.
19849
19850         * gmp.h (gmp_rand_getraw): Add function prototype.
19851         (mpn_rawrandom): Remove function prototype.
19852
19853         * Makefile.am (libgmp_la_SOURCES): Add randraw.c.
19854         * Makefile.in: Regenerate.
19855
19856         * configure.in (gmp_mpn_functions): Remove rawrandom.
19857         * configure: Regenerate.
19858
19859 2000-04-04  Linus Nordberg  <linus@swox.se>
19860
19861         * gmp.h (GMP_ERROR enum): Remove comma after last enumeration
19862         since the AIX compiler (xlc) doesn't like that.
19863
19864         * randlc.c (gmp_rand_init_lc): Allocate enough space for seed to
19865         hold any upcoming seed.
19866         * randlc2x.c (gmp_rand_init_lc_2exp): Likewise.
19867
19868         * mpn/generic/rawrandom.c: Remove debugging code.
19869         (mpn_lc): Don't reallocate seed.
19870
19871         * mpz/urandomm.c (mpz_urandomm): Implement function.
19872
19873         * mpz/urandomb.c (mpz_urandomb): Fix typo in function definition.
19874
19875 2000-04-04  Kevin Ryde  <kevin@swox.se>
19876
19877         * make.bat: Removed (no longer works, no longer supported).
19878         * mpn/msdos/asm-syntax.h: Removed (was used only by make.bat).
19879
19880 2000-04-03  Torbjorn Granlund  <tege@swox.com>
19881
19882         * mpn/generic/brandom.c: New file, replacing random2.
19883
19884 2000-04-02  Torbjorn Granlund  <tege@swox.com>
19885
19886         * mpn/sparc32/v9/submul_1.asm: Change some carry-form instructions
19887         into their plain counterparts.
19888
19889         * mpn/sparc64/copyi.asm: Avoid executing ALIGN.
19890
19891         * mpn/sparc64/mul_1.asm: Handle overlap of rp/sp.
19892         * mpn/sparc64/addmul_1.asm: Likewise.
19893         * mpn/sparc64/submul_1.asm: Likewise.
19894
19895 2000-04-01  Linus Nordberg  <linus@swox.se>
19896
19897         * gmp.h: Fix function prototypes for randomization functions.
19898         (__gmp_rand_lc_scheme_struct): Replace `m' with `m2exp'. Remove
19899         unused `bits'.
19900         (__gmp_rand_data_lc): Add `m2exp' as another way of representing
19901         the modulus.
19902         (__gmp_rand_state_struct): Remove unused `size'.
19903
19904         * rand.c (__gmp_rand_scheme): Use better multipliers.  Remove test
19905         schemes.  Replace `m' with `m2exp'.
19906         (gmp_rand_init): Change parameters and return type.  Use `m2exp'
19907         instead of `m'.  Set `gmp_errno' on error.  Disable BBS algorithm.
19908
19909         * randlc.c (gmp_rand_init_lc): Don't use malloc().  Change
19910         parameters.
19911
19912         * randclr.c (gmp_rand_clear): Don't use free().  Disable BBS
19913         algorithm.  Set `gmp_errno' on error.
19914
19915         * randlc2x.c (gmp_rand_init_lc_2exp): New function.
19916         * randsd.c (gmp_rand_seed): New function.
19917         * randsdui.c (gmp_rand_seed_ui): New function.
19918         * randlcui.c: Remove unused file.
19919
19920         * mpn/generic/rawrandom.c (mpn_rawrandom): Rewrite.
19921         (mpn_lc): New static function.
19922
19923         * mpz/urandomb.c (mpz_urandomb): Use ABSIZ() instead of SIZ() for
19924         determining size of ROP.
19925
19926         * mpf/urandom.c (mpf_urandomb): Add third parameter, nbits.  (Not
19927         used yet!)
19928         Change parameter order to mpn_rawrandom().
19929
19930         * Makefile.am (libgmp_la_SOURCES): Add errno.c, randlc2x.c,
19931         randsd.c, randsdui.c.  Remove randui.c.
19932         (MPZ_OBJECTS): Rename urandom.lo --> urandomb.lo.  Add urandomm.lo.
19933         * Makefile.in: Regenerate.
19934
19935         * mpz/Makefile.am (libmpz_la_SOURCES): Change urandom.c -->
19936         urandomb.c.  Add urandomm.c.
19937         * mpz/Makefile.in: Regenerate.
19938
19939         * tests/rand/Makefile.am (noinst_PROGRAMS): Change findcl --> findlc.
19940         Add gen.static.
19941         * tests/rand/Makefile.in: Regenerate.
19942
19943         * tests/rand/gen.c (main): Add mpz_urandomm.  Add command line options
19944         `-C', `-m', extend `-a'.  Use *mp*_*rand*() with new parameters.  Call
19945         gmp_rand_seed().
19946
19947 2000-04-01  Kevin Ryde  <kevin@swox.se>
19948
19949         * acinclude.m4 (GMP_CHECK_ASM_DATA): Plain .data for hpux.
19950         * configure.in (CCAS): No CFLAGS, they're added when it's used.
19951         (CONFIG_SRCDIR): New define for config.m4.
19952         * mpn/sparc64/addmul_1.asm: Use it for an include().
19953         * mpn/sparc64/submul_1.asm: Ditto.
19954         * mpn/sparc64/mul_1.asm: Ditto.
19955
19956 2000-03-31  Linus Nordberg  <linus@swox.se>
19957
19958         * mpz/urandom.c: Rename to...
19959         * mpz/urandomb.c: ...this.
19960
19961         * mpz/urandomb.c (mpz_urandomb): Change operand order in call to
19962         mpn_rawrandom().  Use ABSIZ() instead of SIZ() when checking size
19963         of ROP.
19964
19965         * mpz/urandomm.c: New file.
19966
19967 2000-03-31  Kevin Ryde  <kevin@swox.se>
19968
19969         * acinclude.m4 (GMP_CHECK_ASM_MMX): Give a warning when mmx code
19970         will be omitted.
19971
19972 2000-03-30  Torbjorn Granlund  <tege@swox.com>
19973
19974         * mpn/sparc64/mul_1h.asm: New file.
19975         * mpn/sparc64/addmul_1h.asm: New file.
19976         * mpn/sparc64/submul_1h.asm: New file.
19977         * mpn/sparc64/mul_1.asm: Rewrite.
19978         * mpn/sparc64/addmul_1.asm: Rewrite.
19979         * mpn/sparc64/submul_1.asm: Rewrite.
19980
19981 2000-03-28  Torbjorn Granlund  <tege@swox.com>
19982
19983         * mpn/sparc32/v9/mul_1.asm: Fix typo in branch prediction.
19984         * mpn/sparc32/v9/addmul_1.asm: Likewise.
19985         * mpn/sparc32/v9/submul_1.asm: Likewise.
19986
19987 2000-03-25  Kevin Ryde  <kevin@swox.se>
19988
19989         * mpn/lisp/gmpasm-mode.el: Fix some comment detection, use custom,
19990         fontify more keywords, turn into a standalone mode.
19991
19992         * stamp-vti: New file, generated together with version.texi.
19993
19994         * acinclude.m4 (GMP_VERSION,GMP_HEADER_GETVAL): New macros.
19995         * configure.in (AM_INIT_AUTOMAKE): Use GMP_VERSION.
19996
19997 2000-03-24  Kevin Ryde  <kevin@swox.se>
19998
19999         * INSTALL: Updates for new configure system.
20000
20001         * configure.in: Add gmp_optcflags_gcc for the x86s, setting -mcpu
20002         and -march.
20003
20004 2000-03-23  Torbjorn Granlund  <tege@swox.com>
20005
20006         * demos/pexpr.c (mpz_eval_expr): Properly initialize rhs/lhs
20007         for ROOT.
20008
20009 2000-03-23  Kevin Ryde  <kevin@swox.se>
20010
20011         * config.guess (i?86:*:*:*): Use uname -m if detection program fails.
20012
20013         * mpn/x86/README: Remove remarks on the now implemented MMX shifts.
20014         * mpn/x86/k6/README: Add speed of mpn_divexact_by3, update mpn_mul_1.
20015
20016         * gmp.texi (Installing MP): Corrections to target CPUs.
20017
20018         * version.c: Use VERSION from config.h, add copyright comment,
20019         restore "const" somehow lost.
20020
20021         * configure.in (a29k*-*-*): Fix directory name.
20022
20023 2000-03-22  Torbjorn Granlund  <tege@swox.com>
20024
20025         * demos/pexpr.c (op_t): Add ROOT.
20026         (fns): Add ROOT.
20027         (mpz_eval_expr): Add ROOT.
20028
20029         * mpz/root.c: Handle roots of negative numbers.
20030         Fix other border cases.
20031         Fix rare memory leakage.
20032
20033         * errno.c: New file.
20034
20035 2000-03-21  Torbjorn Granlund  <tege@swox.com>
20036
20037         * gmp.h (error number enum): New anonymous enum.
20038         (gmp_errno): New.
20039
20040         * gmp.h (__GNU_MP_VERSION, __GNU_MP_VERSION_MINOR): Bump for GMP 3.0.
20041
20042 2000-03-20  Torbjorn Granlund  <tege@swox.com>
20043
20044         * mpn/alpha/unicos.m4 (FLOAT64): New define.
20045         * mpn/alpha/default.m4 (FLOAT64): New define.
20046         * mpn/alpha/invert_limb.asm (C36): Use FLOAT64.
20047
20048 2000-03-21  Kevin Ryde  <kevin@swox.se>
20049
20050         * mpn/x86/k6/diveby3.asm: Tiny speedup.
20051
20052         * acinclude.m4 (GMP_CHECK_ASM_SHLDL_CL): New macro.
20053         * configure.in: Use it, set WANT_SHLDL_CL in config.m4.
20054         * mpn/x86/x86-defs.m4 (shldl,shrdl,shldw,shrdw): New macros, using
20055         WANT_SHLDL_CL.
20056         * mpn/x86/k6/mmx/lshift.asm: Use shldl macro.
20057         * mpn/x86/k7/mmx/lshift.asm: Ditto.
20058         * mpn/x86/pentium/mmx/lshift.asm: Ditto.
20059         * mpn/x86/k6/mmx/rshift.asm: Use shrdl macro.
20060         * mpn/x86/k7/mmx/rshift.asm: Ditto.
20061         * mpn/x86/pentium/mmx/rshift.asm: Ditto.
20062         * mpn/x86/README.family: Add a note about this.
20063
20064 2000-03-20  Linus Nordberg  <linus@swox.se>
20065
20066         * mpn/generic/rawrandom.c (mpn_rawrandom): Handle seed value of 0
20067         correctly.
20068
20069         * configure.in: Fix detection of alpha flavour.
20070         Set compiler options for `sparcv8'.
20071         * configure: Regenerate.
20072
20073         * rand.c (__gmp_rand_scheme): Clean up some.  Use slightly better
20074         multipliers.
20075
20076         * configure.in (AC_OUTPUT): Add tests/Makefile and
20077         tests/rand/Makefile.
20078
20079         * acinclude.m4 (AC_CANONICAL_BUILD): Define to
20080         `_AC_CANONICAL_BUILD' to deal with incompabilities between
20081         Autoconf and Libtool.
20082         (AC_CHECK_TOOL_PREFIX): Likewise.
20083
20084         * Makefile.am (EXTRA_DIST): Add directory `tests'.
20085
20086         * mkinstalldirs: Update (Automake 2000-03-17).
20087         * ltconfig: Update (Libtool 2000-03-17).
20088         * ltmain.sh: Ditto.
20089
20090         * configure: Regenerate with new autoconf/-make/libtool suite.
20091         * aclocal.m4: Ditto.
20092         * config.in: Ditto.
20093         * all Makefile.in's: Ditto.
20094
20095 2000-03-20  Torbjorn Granlund  <tege@swox.com>
20096
20097         * demos/pexpr.c (main): Don't allow `-N' for base, require `-bN'.
20098
20099         * mpn/alpha/unicos.m4 (cvttqc): New define.
20100         * mpn/alpha/invert_limb.asm: Use new define for cvttqc.
20101
20102 2000-03-19  Kevin Ryde  <kevin@swox.se>
20103
20104         * mpn/x86/k6/sqr_basecase.asm: Tiny amendments for 3x3 case.
20105
20106         * gmp.texi: Use @include version.texi.
20107         Use @email and @uref.
20108         (Installing MP): Rewrite for new configure.
20109         (Low-level Functions): Add mpn_divexact_by3.
20110
20111         * configure.in (--enable-alloca): New option.
20112         * acconfig.h (USE_STACK_ALLOC): For --disable-alloca.
20113
20114 2000-03-18  Kent Boortz  <kent@swox.com>
20115
20116         * macos: New directory with macos port files.
20117
20118 2000-03-17  Torbjorn Granlund  <tege@swox.com>
20119
20120         * gmp-impl.h (union ieee_double_extract): Check _CRAYMPP.
20121
20122         * mpn/asm-defs.m4 (invert_normalized_limb): Define.
20123
20124         * mpn/alpha: Translate `.s' files to `.asm'.
20125
20126         * configure: Regenerate.
20127
20128         * mpn/alpha/invert_limb.asm: Replace dash in file name with underscore.
20129         * configure.in: Corresponding change.
20130
20131         * configure.in: Assign special "path" for alphaev6.
20132
20133         * mpn/alpha/unicos.m4: New file.
20134         * configure.in (alpha*-cray-unicos*): [This part of the change
20135         commited 2000-03-13 by linus]
20136         * mpn/alpha/default.m4: New file.
20137         * configure.in (alpha*-*-*): Use it.
20138
20139 2000-03-17  Kevin Ryde  <kevin@swox.se>
20140
20141         * mpn/x86/pentium/rshift.S: Use plain rcrl (not rcrl $1) for
20142         shift-by-1 case, significant speedup.
20143         * mpn/x86/pentium/README: Add shift-by-1 speed.
20144
20145 2000-03-16  Torbjorn Granlund  <tege@swox.com>
20146
20147         * config.guess: Handle Cray T3D/E.
20148
20149 2000-03-15  Kevin Ryde  <kevin@swox.se>
20150
20151         * mpn/generic/diveby3.c: New file.
20152         * mpn/x86/diveby3.asm: New file.
20153         * mpn/x86/k6/diveby3.asm: New file.
20154         * gmp.h (mpn_divexact_by3): Prototype and define.
20155         * mpn/asm-defs.m4: define_mpn(divexact_by3).
20156         * configure.in (gmp_mpn_functions): Add diveby3.
20157
20158         * mpn/x86/pentium/sqr_basecase.asm: A few better addressing modes.
20159
20160         * configure.in: Add AC_C_STRINGIZE and AC_CHECK_TYPES((void)).
20161         * gmp-impl.h (ASSERT): Use them.
20162
20163         * mpn/x86/k7/mmx/lshift.asm: New file.
20164         * mpn/x86/k7/mmx/rshift.asm: Rewrite simple loop and return value
20165         handling, add some pictures.
20166
20167 2000-03-14  Torbjorn Granlund  <tege@swox.com>
20168
20169         * mpn/sparc32/v8/mul_1.asm: Make PIC actually work.
20170         * mpn/sparc32/v8/addmul_1.asm: Likewise.
20171
20172         * mpn/sparc32/v8/mul_1.asm: Use m4 ifdef, not cpp #if.
20173         * mpn/sparc32/v8/addmul_1.asm: Likewise.
20174
20175         * mpn/asm-defs.m4 (C): New define for comments.
20176         * mpn/sparc32: Start comments with `C'.
20177
20178         * config.guess: Remove `SunOS 6' handling.
20179         Recognize sun4m and sun4d architectures under old SunOS.
20180
20181 2000-03-14  Linus Nordberg  <linus@swox.se>
20182
20183         * configure.in (gmp_srclinks): Set to list of links created by
20184         configure.
20185         * configure: Regenerate.
20186
20187         * Makefile.am (libgmp_la_LDFLAGS): Set version info.
20188         (DISTCLEANFILES): Include @gmp_srclinks@.
20189         * Makefile.in: Regenerate.
20190
20191 2000-03-13  Linus Nordberg  <linus@swox.se>
20192
20193         * configure.in: Remove some changequote's by quoting the strings
20194         containing `[]'.
20195         Add support for `alpha*-cray-unicos*'.
20196         AC_DEFINE `_LONG_LONG_LIMB' instead of passing it in CFLAGS.
20197         Conditionalize the assembler syntax checks.
20198         * configure: Regenerate.
20199         * config.in: Regenerate.
20200
20201         * acinclude.m4 (GMP_PROG_CCAS): Remove macro.
20202         * aclocal.m4: Regenerate.
20203
20204 2000-03-13  Kevin Ryde  <kevin@swox.se>
20205
20206         * mpn/x86/p6/README: New file.
20207
20208         * mpn/x86/k6/mul_1.asm: Rewrite, smaller and slightly faster.
20209
20210         * mpn/lisp/gmpasm-mode.el: Rewrite assembler comment detection and
20211         handling.
20212
20213         * configure.in: Separate mmx directories for each x86 flavour.
20214         * configure: Regenerate.
20215
20216 2000-03-12  Kevin Ryde  <kevin@swox.se>
20217
20218         * mpn/x86/x86-defs.m4 (ALIGN): Supplement definition from
20219         config.m4 so as to pad with nops not zeros on old gas.
20220
20221         * mpn/x86/k7/mmx/copyd.asm: Use plain emms (femms is just an alias
20222         for emms now).
20223         * mpn/x86/k7/mmx/copyi.asm: Ditto.
20224         * mpn/x86/k7/mmx/rshift.asm: Ditto.
20225         * mpn/x86/x86-defs.m4: Amend comments.
20226
20227         * mpn/x86/mod_1.asm: Add comments on speeds.
20228
20229         * mpn/x86/pentium/mmx/lshift.asm: New file.
20230         * mpn/x86/pentium/mmx/rshift.asm: New file.
20231         * mpn/x86/pentium/README: Add speeds of various routines.
20232
20233 2000-03-10  Linus Nordberg  <linus@swox.se>
20234
20235         * configure.in: Reorganize.
20236         Use AC_CHECK_TOOL to find `ar'.
20237         Add post-includes `regmap.m4' and `aix.m4' for AIX targets.
20238         asm-syntax.h is not needed for PPC or sparc anymore.
20239         (powerpc64-*-aix*): Compiler is always 64-bit. Use `-q64
20240         -qtune=pwr3' to xlc and `-maix64 -mpowerpc64' to gcc.  Pass `-X
20241         64' to `ar' and `nm'.
20242         (pentiummmx): Use GMP_CHECK_ASM_MMX and avoid MMX assembly path if
20243         assembler is not MMX capable.
20244         (pentium[23]): Likewise.
20245         (athlon): Likewise.
20246         (k6*): Likewise.
20247         * configure: Regenerate.
20248
20249         * acinclude.m4 (GMP_PROG_CC_WORKS): New macro.
20250         (GMP_PROG_CC_FIND): Use GMP_PROG_CC_WORKS instead of
20251         AC_TRY_COMPILER.  Make sure that the *first* working 32-bit
20252         compiler is used if no 64-bit compiler is found.
20253         (GMP_CHECK_ASM_MMX): New macro.
20254         * aclocal.m4: Regenerate.
20255
20256         * Makefile.in: Regenerate.  (CC_TEST removed.)
20257         * mpf/Makefile.in: Likewise.
20258         * mpn/Makefile.in: Likewise.
20259         * mpq/Makefile.in: Likewise.
20260         * mpz/Makefile.in: Likewise.
20261         * mpf/tests/Makefile.in: Likewise.
20262         * mpq/tests/Makefile.in: Likewise.
20263         * mpz/tests/Makefile.in: Likewise.
20264
20265         * acconfig.h (_LONG_LONG_LIMB): Add.
20266
20267         * gmp-impl.h: Include config.h only if HAVE_CONFIG_H is defined.
20268
20269 2000-03-09  Kevin Ryde  <kevin@swox.se>
20270
20271         * mpn/x86/pentium/mul_basecase.S: Small speedup by avoiding an AGI.
20272
20273         * mpn/x86/k7/mmx/copyd.asm: Tiny speedup by avoiding popl.
20274         * mpn/x86/k7/mmx/copyi.asm: Ditto.
20275         * mpn/x86/k7/mul_basecase.asm: Ditto.
20276
20277 2000-03-07  Torbjorn Granlund  <tege@swox.com>
20278
20279         * config.guess: Better recognize POWER/PowerPC processor type.
20280
20281 2000-03-07  Kevin Ryde  <kevin@swox.se>
20282
20283         * mpn/generic/addsub_n.c: Use HAVE_NATIVE_* now in config.h.
20284
20285         * mpn/asm-defs.m4: Add comments about SysV m4.
20286         (m4_log2): Don't use <<.
20287         (m4_lshift,m4_rshift): New macros.
20288
20289 2000-03-06  Torbjorn Granlund  <tege@swox.com>
20290
20291         * mpn/powerpc32/regmap.m4: Map cr0 => `0', etc.
20292
20293 2000-03-06  Kevin Ryde  <kevin@swox.se>
20294
20295         * mpn/tests/ref.c (refmpn_divexact_by3): New function.
20296         * mpn/tests/ref.h: Prototype.
20297
20298         * acconfig.h (WANT_ASSERT): New define.
20299         * configure.in (--enable-assert): Turn on WANT_ASSERT.
20300         * assert.c: New file.
20301         * Makefile.am: Add to build.
20302         * gmp-impl.h (ASSERT): New macro.
20303         (ASSERT_NOCARRY) Renamed from assert_nocarry.
20304         (MPZ_CHECK_FORMAT): Use ASSERT_ALWAYS.
20305         * mpn/tests/ref.c: Use ASSERT.
20306         * mpf/get_str.c: Use ASSERT_ALWAYS.
20307         * mpf/set_str.c: Remove old assert macro.
20308
20309         * mpn/x86/x86-defs.m4 (cmovnz_ebx_ecx): New macro.
20310         * mpn/x86/p6/aorsmul_1.asm: Use cmov.
20311
20312         * mpn/x86/lshift.S: Use %dl with testb, not %edx. No object code
20313         change, testb was still getting generated.
20314         * mpn/x86/rshift.S: Ditto.
20315
20316 2000-03-03  Torbjorn Granlund  <tege@swox.com>
20317
20318         * longlong.h: Add IA-64 support.
20319
20320         * mpn/powerpc32: Misc cleanups.
20321         * mpn/powerpc32/aix.m4: New file (mainly by Linus).
20322         * mpn/powerpc64/aix.m4: New file (mainly by Linus).
20323         * mpn/powerpc64: Translate `.S' files to `.asm'.
20324
20325         * configure.in: Fix tyops.
20326         * configure: Regenerate.
20327
20328 2000-03-02  Torbjorn Granlund  <tege@swox.com>
20329
20330         * mpn/powerpc32/regmap.m4: New file.
20331         * mpn/powerpc32: Translate `.S' files to `.asm'.
20332         * configure.in: Use mpn/powerpc32/regmap.m4 for powerpc targets
20333         except some weird ones.
20334
20335 2000-03-03  Kevin Ryde  <kevin@swox.se>
20336
20337         * mpn/lisp/gmpasm-mode.el: Suppress postscript comment prefixes in
20338         filladapt.
20339
20340         * mpn/x86/pentium/sqr_basecase.asm: New file.
20341         * mpn/x86/pentium/gmp-mparam.h (KARATSUBA_SQR_THRESHOLD): Update.
20342
20343         * configure.in: Add --enable-assert, enable k6 logops functions.
20344
20345         * mpn/x86/k6/mmx/copyi.asm: Use m4 for divide, not as.
20346         * mpn/x86/k6/mmx/copyd.asm: Ditto.
20347         * mpn/x86/README.family: Add a note on this.
20348
20349 2000-03-02  Kevin Ryde  <kevin@swox.se>
20350
20351         * mpn/x86/k6/aors_n.asm: Don't use stosl.
20352         * mpn/x86/copyi.asm: Use cld to clear direction flag.
20353         * mpn/x86/divrem_1.asm: Ditto.
20354         * mpn/x86/README.family: Add a note on this.
20355
20356         * mpn/x86/k6/mmx/copyi.asm: Rewrite.
20357         * mpn/x86/k6/mmx/copyd.asm: New file.
20358         * mpn/x86/k6/README: Update, and small amendments.
20359
20360         * mpn/x86/x86-defs.m4 (Zdisp): New macro.
20361         * mpn/asm-defs.m4 (m4_stringequal_p): New macro.
20362
20363         * mpn/x86/p6/aorsmul_1.asm: Use Zdisp to force zero displacements.
20364         * mpn/x86/k6/aorsmul_1.asm: Ditto.
20365         * mpn/x86/k6/mul_1.asm: Ditto.
20366         * mpn/x86/k6/mul_basecase.asm: Ditto.
20367         * mpn/x86/k7/aors_n.asm: Ditto.
20368         * mpn/x86/k7/aorsmul_1.asm: Ditto.
20369         * mpn/x86/k7/mul_1.asm: Ditto.
20370         * mpn/x86/k7/mul_basecase.asm: Ditto.
20371         * mpn/x86/README.family: Add a note on this.
20372
20373 2000-02-27  Kevin Ryde  <kevin@swox.se>
20374
20375         * mpn/generic/divrem.c (mpn_divrem_classic): Patch to avoid gcc
20376         2.7.2.3 i386 register handling bug.
20377
20378         * mpn/x86/k6/aors_n.asm: Rewrite.
20379         * mpn/x86/k6/mmx/lshift.asm: Rewrite.
20380         * mpn/x86/k6/mmx/rshift.asm: Rewrite.
20381         * mpn/x86/k6/README: Update.
20382
20383         * mpn/x86/k7/mmx/copyd.asm: Support size==0.
20384         * mpn/x86/k7/mmx/copyi.asm: Ditto.
20385         * mpn/x86/k6/mmx/copyi.asm: Ditto.
20386         * gmp-impl.h: Comment size==0 allowed in MPN_COPY_INCR and
20387         MPN_COPY_DECR.
20388         * configure.in: Enable x86 copyi, copyd; add k6 com_n.
20389
20390 2000-02-25  Torbjorn Granlund  <tege@swox.com>
20391
20392         * demos/pexpr.c (power): Move factorial handing code from `factor'
20393         to `power'.
20394
20395         * demos/factorize.c (factor_using_pollard_rho): Move resetting of `c'
20396         to before checking for a non-zero gcd.
20397
20398 2000-02-25  Kevin Ryde  <kevin@swox.se>
20399
20400         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro by Linus.
20401         * mpn/x86/k6/aors_n.asm: Use MULFUNC_PROLOGUE.
20402         * mpn/x86/k6/aorsmul_1.asm: Ditto.
20403         * mpn/x86/k7/aors_n.asm: Ditto.
20404         * mpn/x86/k7/aorsmul_1.asm: Ditto.
20405         * mpn/x86/p6/aorsmul_1.asm: Ditto.
20406
20407         * mpn/tests/ref.c (refmpn_copyi,refmpn_copyd): Allow size==0.
20408
20409         * gmp-impl.h: Move mpn_and_n, mpn_andn_n, mpn_com_n, mpn_ior_n,
20410         mpn_iorn_n, mpn_nand_n, mpn_nior_n, mpn_xor_n and mpn_xorn_n here
20411         from gmp.h.  Use HAVE_NATIVE_mpn_* to make these functions or
20412         inlines.
20413
20414         * gmp-impl.h: Move mpn_copyd, mpn_copyi here from gmp.h.
20415         * gmp-impl.h (MPN_COPY_INCR): Use mpn_copyi if available.
20416         * gmp-impl.h (MPN_COPY_DECR): Use mpn_copyd if available.
20417
20418         * mpn/x86/k6/mmx/com_n.asm: Moved into mmx subdirectory.
20419         * mpn/x86/k6/mmx/copyi.asm: Ditto.
20420         * mpn/x86/k6/mmx/lshift.asm: Ditto.
20421         * mpn/x86/k6/mmx/rshift.asm: Ditto.
20422         * mpn/x86/k7/mmx/rshift.asm: Ditto.
20423         * mpn/x86/k6/mmx/logops_n.asm: New file.
20424         * configure.in (k6*-*-*): Add logops_n.asm.
20425         * mpn/x86/k6/README: Update.
20426
20427         * mpn/x86/k7/mmx/copyi.asm: New file.
20428         * mpn/x86/k7/mmx/copyd.asm: New file.
20429         * mpn/x86/k7/README: Update.
20430
20431 2000-02-24  Kevin Ryde  <kevin@swox.se>
20432
20433         * mpn/x86/x86-defs.m4 (femms): Generate emms if 3dnow not available.
20434         * mpn/x86/x86-defs.m4 (FRAME_popl): New macro.
20435
20436         * Makefile.am: Add info_TEXINFOS = gmp.texi
20437
20438         * mpn/x86/divrem_1.asm: Moved from mpn/x86/k6, allow size==0,
20439         conditionalize loop versus decl/jnz.
20440         * mpn/x86/mod_1.asm: Ditto.
20441         * mpn/x86/divmod_1.asm: Removed.
20442         * gmp.texi (mpn_divrem_1,mpn_mod_1): Add that size==0 is allowed.
20443         * mpn/tests/ref.c (refmpn_divrem_1c,etc): Allow size==0.
20444
20445         * mpn/x86/k6/aors_n.asm: Avoid gas 1.92.3 leal displacement
20446         expression problem.
20447         * mpn/x86/k6/aorsmul_1.asm: Ditto.
20448         * mpn/x86/k6/mul_1.asm: Ditto.
20449         * mpn/x86/k6/mul_basecase.asm: Ditto
20450         * mpn/x86/k7/aors_n.asm: Ditto.
20451         * mpn/x86/k7/aorsmul_1.asm: Ditto.
20452         * mpn/x86/k7/mul_1.asm: Ditto.
20453         * mpn/x86/k7/mul_basecase.asm: Ditto.
20454         * mpn/x86/k7/rshift.asm: Ditto.
20455         * mpn/x86/p6/aorsmul_1.asm: Ditto.
20456         * mpn/x86/README.family: Describe problem.
20457
20458 2000-02-24  Linus Nordberg  <linus@swox.se>
20459
20460         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Add dummy symbol to
20461         testcase to avoid nm failure.  Try nm before piping to grep.
20462
20463         * acconfig.h: Undef HAVE_NATIVE_func for every mpn function found
20464         in gmp.h.
20465
20466         * configure.in: Invoke AC_CONFIG_HEADERS.
20467         Don't invoke AM_CONFIG_HEADER; it makes autoconf confused.
20468         Dig out entry points declared in assembly code and AC_DEFINE proper
20469         HAVE_NATIVE_func.
20470
20471         * mpn/asm-defs.m4 (MULFUNC_PROLOGUE): New macro.
20472
20473         * mpn/x86/p6/aorsmul_1.asm: Use MULFUNC_PROLOGUE.
20474         * mpn/x86/k6/aors_n.asm: Likewise.
20475
20476         * Makefile.am (EXTRA_DIST): Add config.in; needed when we don't
20477         use AM_CONFIG_HEADER in configure.in.
20478
20479         * mpn/Makefile.am (INCLUDES): Add `-I..' for config.h and
20480         gmp-mparam.h.
20481         * mpf/Makefile.am: Likewise.
20482         * mpq/Makefile.am: Likewise.
20483         * mpz/Makefile.am: Likewise.
20484
20485         * mpf/tests/Makefile.am (INCLUDES): Add `-I../..' for config.h and
20486         gmp-mparam.h.
20487         * mpq/tests/Makefile.am: Likewise.
20488         * mpz/tests/Makefile.am: Likewise.
20489
20490         * configure: Regenerate.
20491         * aclocal.m4: Regenerate.
20492         * config.in: Regenerate.
20493         * Makefile.in: Regenerate.
20494         * mpf/Makefile.in: Regenerate.
20495         * mpn/Makefile.in: Regenerate.
20496         * mpq/Makefile.in: Regenerate.
20497         * mpz/Makefile.in: Regenerate.
20498         * mpf/tests/Makefile.in: Regenerate.
20499         * mpq/tests/Makefile.in: Regenerate.
20500         * mpz/tests/Makefile.in: Regenerate.
20501
20502 2000-02-23  Kevin Ryde  <kevin@swox.se>
20503
20504         * mpn/x86/addmul_1.S: Amend comments, this code no longer used by
20505         PentiumPro.
20506         * mpn/x86/submul_1.S: Ditto.
20507
20508         * mpn/x86/k6/com_n.asm: Rewrite, smaller but same speed.
20509
20510         * mpn/x86/addmul_1.S: Add PROLOGUE and EPILOGUE to get .type and
20511         .size for ELF.  Rename #define size to n to avoid .size.
20512         * mpn/x86/lshift.S: Ditto.
20513         * mpn/x86/mul_1.S: Ditto.
20514         * mpn/x86/mul_basecase.S: Ditto.
20515         * mpn/x86/rshift.S: Ditto.
20516         * mpn/x86/submul_1.S: Ditto.
20517         * mpn/x86/udiv.S: Ditto.
20518         * mpn/x86/umul.S: Ditto.
20519         * mpn/x86/pentium/add_n.S: Ditto.
20520         * mpn/x86/pentium/addmul_1.S: Ditto.
20521         * mpn/x86/pentium/lshift.S: Ditto.
20522         * mpn/x86/pentium/mul_1.S: Ditto.
20523         * mpn/x86/pentium/mul_basecase.S: Ditto.
20524         * mpn/x86/pentium/rshift.S: Ditto.
20525         * mpn/x86/pentium/sub_n.S: Ditto.
20526         * mpn/x86/pentium/submul_1.S: Ditto.
20527
20528 2000-02-22  Linus Nordberg  <linus@swox.se>
20529
20530         * acinclude.m4 (GMP_INIT): Use temporary file cnfm4p.tmp for
20531         post-defines.
20532         (GMP_FINISH): Ditto.
20533         (GMP_DEFINE): Add third optional argument specifying location in
20534         outfile.
20535         (GMP_DEFINE_RAW): New macro.
20536         * aclocal.m4: Regenerate.
20537
20538         * configure.in: Add `HAVE_TARGET_CPU_$target_cpu' using
20539         GMP_DEFINE_RAW.
20540         * configure: Regenerate.
20541
20542         * mpz/tests/Makefile.am: New test t-root.
20543         * mpz/tests/Makefile.in: Regenerate.
20544
20545 2000-02-22  Torbjorn Granlund  <tege@swox.com>
20546
20547         * mpz/root.c: Complete rewrite; still primitive, but at least correct.
20548         * mpz/tests/t-root.c: New test.
20549
20550 2000-02-22  Kevin Ryde  <kevin@swox.se>
20551
20552         * mpn/x86/k7/mul_basecase.asm: New file.
20553         * mpn/x86/k7/README: Add mpn_mul_basecase speed.
20554         * mpn/x86/k7/gmp-mparam.h: New file.
20555
20556         * mpn/x86/x86-defs.m4 (loop_or_decljnz,cmov_bytes): New macros.
20557         * mpn/asm-defs.m4 (m4_ifdef_anyof_p): New macro.
20558
20559         * mpn/x86/k6/aorsmul_1.asm: New file.
20560         * mpn/x86/k6/addmul_1.S: Removed (was a copy of pentium version).
20561         * mpn/x86/k6/submul_1.S: Removed (was a copy of pentium version).
20562
20563         * mpn/x86/p6/aorsmul_1.asm: Use OPERATION_addmul_1 and
20564         OPERATION_submul_1.
20565         * mpn/x86/k6/aors_n.asm: Use OPERATION_add_n and OPERATION_sub_n.
20566         * configure.in: Declare multi-function files for k6 and p6.
20567
20568         * configure.in: Add HAVE_TARGET_CPU_$target_cpu for config.m4.
20569         * mpn/asm-defs.m4 (define_not_for_expansion): New macro.
20570
20571         * mpn/generic/divrem_1n.c (__gmpn_divrem_1n): New file, split from
20572         mpn/generic/divrem_1.c.
20573         * mpn/generic/divrem_1.c: Ditto.
20574         * configure.in (gmp_mpn_functions): Ditto.
20575
20576 2000-02-21  Torbjorn Granlund  <tege@swox.com>
20577
20578         * gmp.h: Undo 1996-10-06 NeXT change, it was clearly improperly
20579         written.
20580
20581 2000-02-21  Linus Nordberg  <linus@swox.se>
20582
20583         * configure.in: Link <src>/mpn/asm-defs.m4 to <build>mpn/asm.m4.
20584         * configure: Regenerate.
20585
20586 2000-02-21  Linus Nordberg  <linus@swox.se>
20587
20588         * mpn/x86/k7/aorsmul_1.asm: Change OPERATION_ADDMUL -->
20589         OPERATION_addmul_1.  Change OPERATION_SUBMUL -->
20590         OPERATION_submul_1.
20591
20592         * mpn/x86/k7/aors_n.asm: Change OPERATION_ADD --> OPERATION_add_n.
20593         Change OPERATION_SUB --> OPERATION_sub_n.
20594
20595         * mpn/Makefile.am: Pass -DOPERATION_$* to preprocessors.
20596         * mpn/Makefile.in: Regenerate.
20597
20598         * configure.in: Symlink mpn/asm-defs.m4 to build-dir/mpn.  Link
20599         multi-function files to mpn/<function>.asm and remove function
20600         name from `gmp_mpn_functions'.
20601         * configure: Regenerate.
20602
20603         * acinclude.m4 (GMP_FINISH): Tell user what we're doing.
20604         * aclocal.m4: Regenerate.
20605
20606 2000-02-21  Kevin Ryde  <kevin@swox.se>
20607
20608         * gmp-impl.h: Rename __gmpn_mul_basecase to mpn_mul_basecase and
20609         __gmpn_sqr_basecase to mpn_sqr_basecase, remove __gmpn prototypes.
20610         * mpn/x86/mul_basecase.S: Ditto.
20611         * mpn/x86/pentium/mul_basecase.S: Ditto.
20612
20613         * configure.in (gmp_m4postinc): Use x86-defs.m4 on athlon-*-* too.
20614
20615 2000-02-20  Kevin Ryde  <kevin@swox.se>
20616
20617         * acinclude.m4 (GSYM_PREFIX): Drop $1, change by Linus.
20618         * mpn/asm-defs.m4 (PROLOGUE,EPILOGUE): Use GSYM_PREFIX as a
20619         string, change by Linus.
20620         * mpn/x86/x86-defs.m4: Use GSYM_PREFIX as a string.
20621
20622         * mpn/x86/k6/gmp-mparam.h: New file.
20623         * mpn/asm-defs.m4 (m4_warning): New macro.
20624
20625         * mpn/x86/README: Amendments per new code and directories.
20626         * mpn/x86/README.family: New file.
20627         * mpn/x86/k6/README: New file.
20628         * mpn/x86/k7/README: New file.
20629
20630         * mpn/generic/mul_n.c: Rename __gmpn_mul_basecase to
20631         mpn_mul_basecase and __gmpn_sqr_basecase to mpn_sqr_basecase.
20632         * mpn/generic/mul_basecase.c: Ditto.
20633         * mpn/generic/sqr_basecase.c: Ditto.
20634         * mpn/generic/mul.c: Ditto.
20635
20636 2000-02-19  Linus Nordberg  <linus@swox.se>
20637
20638         * configure.in: Don't try to symlink more than one multi-func
20639         file.
20640         * configure: Regenerate.
20641
20642 2000-02-18  Linus Nordberg  <linus@swox.se>
20643
20644         * acinclude.m4 (GMP_CHECK_ASM_UNDERSCORE): GMP_DEFINE
20645         `GSYM_PREFIX'.  Run ACTIONs even when value is found in cache.
20646         (GMP_CHECK_ASM_ALIGN_LOG): GMP_DEFINE `ALIGN'.  Run ACTIONs even
20647         when value is found in cache.
20648         * aclocal.m4: Regenerate.
20649
20650         * configure.in: Don't define GSYM_PREFIX or ALIGN.
20651         Add mechanism for multi-function files.
20652         * configure: Regenerate.
20653
20654 2000-02-18  Kevin Ryde  <kevin@swox.se>
20655
20656         * configure.in (gmp_m4postinc): Enable x86-defs.m4.
20657         * mpn/x86/k7/mul_1.asm: Fix include.
20658         * mpn/x86/k6/mul_basecase.S: Removed (copy of the pentium version).
20659         * mpn/x86/k6/mul_basecase.asm: New file.
20660         * mpn/x86/k6/sqr_basecase.asm: New file.
20661         * mpn/x86/k6/com_n.asm: New file.
20662         * mpn/x86/k6/copyi.asm: New file.
20663         * gmp.texi (Low-level Functions): Clarify mpn overlaps permitted.
20664         * gmp-impl.h (MPN_OVERLAP_P): New macro.
20665         * gmp-impl.h (assert_nocarry): New macro.
20666         * mpn/tests/ref.c: New file, based in part on other mpn/tests/*.c.
20667         * mpn/tests/ref.h: New file.
20668
20669 2000-02-17  Linus Nordberg  <linus@swox.se>
20670
20671         * Makefile.am (dist-hook): Don't include any emacs backup files
20672         (*.~*) in dist.
20673         * Makefile.in: Regenerate.
20674
20675 2000-02-17  Torbjorn Granlund  <tege@swox.com>
20676
20677         * mpn/sparc32/v9/mul_1.asm: Use `rd' to get current PC; get rid of
20678         getpc function.
20679         * mpn/sparc32/v9/addmul_1.asm: Likewise.
20680         * mpn/sparc32/v9/submul_1.asm: Likewise.
20681
20682 2000-02-17  Kevin Ryde  <kevin@swox.se>
20683
20684         * gmp.h: Add prototypes and defines for mpn_and_n, mpn_andn_n,
20685         mpn_com_n, mpn_copyd, mpn_copyi, mpn_ior_n, mpn_iorn_n,
20686         mpn_mul_basecase, mpn_nand_n, mpn_nior_n, mpn_sqr_basecase,
20687         mpn_xor_n, mpn_xorn_n.
20688
20689         * mpn/asm-defs.m4: Many additions making up initial version.
20690         * mpn/asm-defs.m4 (L): Use defn(`LSYM_PREFIX').
20691         * mpn/x86/x86-defs.m4: New file.
20692         * mpn/x86/k6/aors_n.asm: New file.
20693         * mpn/x86/k6/divmod_1.asm: New file.
20694         * mpn/x86/k6/divrem_1.asm: New file.
20695         * mpn/x86/k6/lshift.S: Removed (was a copy of the pentium version).
20696         * mpn/x86/k6/lshift.asm: New file.
20697         * mpn/x86/k6/mod_1.asm: New file.
20698         * mpn/x86/k6/mul_1.S: Removed (was a copy of the pentium version).
20699         * mpn/x86/k6/mul_1.asm: New file.
20700         * mpn/x86/k6/rshift.S: Removed (was a copy of the pentium version).
20701         * mpn/x86/k6/rshift.asm: New file.
20702         * mpn/x86/k7/aors_n.asm: New file.
20703         * mpn/x86/k7/aorsmul_1.asm: New file.
20704         * mpn/x86/k7/mul_1.asm: New file.
20705         * mpn/x86/k7/rshift.asm: New file.
20706         * mpn/x86/p6/aorsmul_1.asm: New file.
20707         * mpn/x86/copyi.asm: New file.
20708         * mpn/x86/copyd.asm: New file.
20709         * mpn/lisp/gmpasm-mode.el: New file.
20710
20711 2000-02-16  Torbjorn Granlund  <tege@swox.com>
20712
20713         * mpn/sparc32/v9/mul_1.asm: Conditionalize for PIC.
20714         * mpn/sparc32/v9/addmul_1.asm: Likewise.
20715         * mpn/sparc32/v9/submul_1.asm: Likewise.
20716         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
20717         * mpn/sparc32/udiv_fp.asm: Likewise.
20718
20719 2000-02-16  Linus Nordberg  <linus@swox.se>
20720
20721         * configure.in: Add mechanism for including target specific
20722         m4-files in config.m4.
20723         * configure: Regenerate.
20724
20725         * acinclude.m4 (GMP_PROG_CCAS): Begin assembly lines (except
20726         labels) with a tab character.  HP-UX demands it.
20727         (GMP_CHECK_ASM_SIZE): Ditto.
20728         (GMP_CHECK_ASM_LSYM_PREFIX): Ditto.
20729         (GMP_CHECK_ASM_LABEL_SUFFIX): Set to empty string for HP-UX.
20730         (GMP_CHECK_ASM_GLOBL): Change `.xport' --> `.export'.
20731         * aclocal.m4: Regenerate.
20732
20733 2000-02-16  Linus Nordberg  <linus@swox.se>
20734
20735         * acinclude.m4 (GMP_CHECK_ASM_LSYM_PREFIX): Define LSYM_PREFIX as
20736         the prefix only, no argument.
20737         * aclocal.m4: Regenerate.
20738         * configure: Regenerate.
20739
20740         * mpn/asm-defs.m4 (L): No argument to LSYM_PREFIX.
20741
20742 2000-02-15  Linus Nordberg  <linus@swox.se>
20743
20744         * acinclude.m4: Prefix all temporary shell variables with
20745         `gmp_tmp_'.
20746         (GMP_PROG_CC_FIND): Use defaults if no arguments are passed.
20747         Quote use of arguments.
20748         (GMP_PROG_CCAS): New macro.
20749         (GMP_INIT): New macro.
20750         (GMP_FINISH): New macro.
20751         (GMP_INCLUDE): New macro.
20752         (GMP_SINCLUDE): New macro.
20753         (GMP_DEFINE): New macro.
20754         (GMP_CHECK_ASM_LABEL_SUFFIX): New macro.
20755         (GMP_CHECK_ASM_TEXT): New macro.
20756         (GMP_CHECK_ASM_DATA): New macro.
20757         (GMP_CHECK_ASM_GLOBL): New macro.
20758         (GMP_CHECK_ASM_TYPE): New macro.
20759         (GMP_CHECK_ASM_SIZE): New macro.
20760         (GMP_CHECK_ASM_LSYM_PREFIX): New macro.
20761         (GMP_CHECK_ASM_W32): New macro.
20762         * aclocal.m4: Regenerate.
20763
20764         * configure.in: Find m4 and nm for target.
20765         Use new macros to create config.m4.
20766         Prefix all temporary shell variables with `tmp_'.
20767         Pass `-X 64' to nm for 64-bit PPC target with 64-bit compiler.
20768         * configure: Regenerate.
20769
20770         * Makefile.am (dist-hook): *Really* remove all CVS dirs in
20771         dist.
20772         * Makefile.in: Regenerate.
20773
20774         * mpn/Makefile.am: Add target for building .lo and .o from
20775         .asm.
20776         Pass -DPIC to preprocessor (CPP/m4) when building .lo.
20777         Build .o a second time for target .lo, without -DPIC to
20778         preprocessor.
20779         (SUFFIX): Add `.asm'.
20780         (EXTRA_DIST): Add asm-defs.m4.
20781         * mpn/Makefile.in: Regenerate.
20782
20783         * mpf/Makefile.in: Regenerate.
20784         * mpf/tests/Makefile.in: Regenerate.
20785         * mpq/Makefile.in: Regenerate.
20786         * mpq/tests/Makefile.in: Regenerate.
20787         * mpz/Makefile.in: Regenerate.
20788         * mpz/tests/Makefile.in: Regenerate.
20789
20790 2000-02-15  Torbjorn Granlund  <tege@swox.com>
20791
20792         * mpn/sparc32/udiv_fp.asm: Change `RODATA' to `DATA'.
20793         * mpn/sparc32/v8/supersparc/udiv.asm: Likewise.
20794         * mpn/sparc32/v9/addmul_1.asm: Likewise.
20795         * mpn/sparc32/v9/submul_1.asm: Likewise.
20796         * mpn/sparc32/v9/mul_1.asm: Likewise.
20797
20798         * mpn/sparc32/add_n.asm: Rename `size' -> `n'.
20799         * mpn/sparc32/sub_n.asm: Likewise.
20800
20801         * sparc32: Rename `.s' and `.S' files to `.asm'.
20802         * sparc64: Rename `.s' and `.S' files to `.asm'.
20803
20804 2000-02-11  Torbjorn Granlund  <tege@swox.com>
20805
20806         * config.sub: Adopt to new config.guess sparc naming conventions.
20807
20808         * config.guess (sun4u:SunOS:5.*:*): Change `sparc9' to `sparcv9'.
20809         * config.guess (sun4m:SunOS:5.*:*): Change to sun4[md]:SunOS:5.*:* and
20810         change `sparc8' to `sparcv8'.
20811
20812         * mpn/x86/add_n.S: Use PROLOGUE/EPILOGUE.
20813         * mpn/x86/sub_n.S: Likewise.
20814
20815         * mpn/x86/syntax.h (PROLOGUE): New name for PROLOG.
20816         * mpn/x86/syntax.h (EPILOGUE): New name for EPILOG.
20817
20818 2000-02-11  Linus Nordberg  <linus@swox.se>
20819
20820         * configure.in: Better path for 64-bit sparc without 64-bit cc.
20821         Change sparc8 --> sparcv8.
20822         Change sparc9 --> sparcv9.
20823         * configure: Regenerate.
20824
20825 2000-02-10  Linus Nordberg  <linus@swox.se>
20826
20827         * configure.in: Use Autoconf.
20828         * Makefile.am: New file.
20829
20830         * AUTHORS: New file.
20831         * COPYING: New file.
20832         * acinclude.m4: New file.
20833         * acconfig.h: New file.
20834
20835         * configure: Generate.
20836         * Makefile.in: Generate.
20837         * aclocal.m4: Generate.
20838         * config.in: Generate.
20839
20840         * install.sh: Remove.
20841         * install-sh: New file from Automake.
20842         * missing: New file from Automake.
20843         * ltconfig: New file from Libtool.
20844         * ltmain.sh: New file from Libtool.
20845
20846         * mpf/Makefile.am: New file.
20847         * mpf/Makefile.in: Generate.
20848         * mpf/configure.in: Remove.
20849         * mpf/tests/Makefile.am: New file.
20850         * mpf/tests/Makefile.in: Generate.
20851         * mpf/tests/configure.in: Remove.
20852
20853         * mpn/Makefile.am: New file.
20854         * mpn/Makefile.in: Generate.
20855         * mpn/configure.in: Remove.
20856
20857         * mpq/Makefile.am: New file.
20858         * mpq/Makefile.in: Generate.
20859         * mpq/configure.in: Remove.
20860         * mpq/tests/Makefile.am: New file.
20861         * mpq/tests/Makefile.in: Generate.
20862         * mpq/tests/configure.in: Remove.
20863
20864         * mpz/Makefile.am: New file.
20865         * mpz/Makefile.in: Generate.
20866         * mpz/configure.in: Remove.
20867         * mpz/tests/Makefile.am: New file.
20868         * mpz/tests/Makefile.in: Generate.
20869         * mpz/tests/configure.in: Remove.
20870
20871 2000-02-10  Torbjorn Granlund  <tege@swox.com>
20872
20873         * mpn/x86/add_n.S: Don't use label L0 twice.
20874         * mpn/x86/sub_n.S: Likewise.
20875
20876 2000-01-20  Linus Nordberg  <linus@swox.se>
20877
20878         * demos/pexpr.c: Don't use setup_error_handler() in windoze.
20879
20880 2000-01-19  Torbjorn Granlund  <tege@swox.com>
20881
20882         * demos/pexpr.c (sigaltstack): #define to sigstack for AIX.
20883         (setup_error_handler): Don't write to ss_size and ss_flags
20884         on AIX.
20885
20886 2000-01-11  Torbjorn Granlund  <tege@swox.com>
20887
20888         * mpn/configure.in (hppa2.0*-*-*): Move assignment of
20889         target_makefile_frag to where it belongs.
20890
20891 1999-12-21  Torbjorn Granlund  <tege@swox.com>
20892
20893         * longlong.h (v9 umul_ppmm): New #define.
20894         (v9 udiv_qrnnd): New #define.
20895
20896 1999-12-14  Torbjorn Granlund  <tege@swox.com>
20897
20898         * mpn/generic/divmod_1.c: Use invert_limb.
20899         * mpn/generic/mod_1.c: Use invert_limb.
20900
20901         * gmp-impl.h (invert_limb): Put definition here.
20902         * mpn/generic/divrem.c (invert_limb): Delete definition.
20903         * mpn/generic/divrem_2.c (invert_limb): Delete definition.
20904
20905         * gmp.h (mpn_divrem): Inhibit for non-gcc.
20906         But declare (undo 1999-11-22 change).
20907
20908         * gmp-impl.h (DItype,UDItype): Do these also if _LONG_LONG_LIMB.
20909
20910         * longlong.h: Move 64-bit hppa code out of __GNUC__ conditional.
20911
20912         * stack-alloc.c (HSIZ): New #define.
20913         (__tmp_alloc): Use HSIZ instead of sizeof(tmp_stack).
20914
20915 1999-12-10  Torbjorn Granlund  <tege@swox.com>
20916
20917         * config.sub: Clean up handling of x86 CPUs: Properly recognize
20918         Amd CPUs as unique entities.  Use manufacturer's names of
20919         processors ("pentium", etc); still match ambiguous names like
20920         "i586", "i686", "p6" but be conservative in interpreting them.
20921
20922         * configure.in: Recognize x86 CPU types known by config.guess.
20923         * mpn/configure.in: Likewise.  Add x86/mmx path component as
20924         appropriate.
20925         (athlon-*-*): Fix typo.
20926
20927         * config.guess: Update x86 recog code to intiallly match
20928         more than just i386.
20929         Call K6-2 and K6-III for "k62" and "k63" respectively.
20930
20931         * config.guess: Recognize x86 CPU types.
20932         Update code for FreeBSD, NetBSD, OpenBSD, Linux.
20933
20934 1999-12-08  Torbjorn Granlund  <tege@swox.com>
20935
20936         * mpf/pow_ui.c: Avoid final squaring in loop.
20937
20938 1999-12-07  Torbjorn Granlund  <tege@swox.com>
20939
20940         * gmp-impl.h (udiv_qrnnd_preinv2gen): Prefix local variables with `_'.
20941         (udiv_qrnnd_preinv2norm): Likewise.
20942         From Kevin Ryde:
20943         (HAVE_ALLOCA): #define also if defined (alloca).
20944
20945 1999-12-04  Torbjorn Granlund  <tege@swox.com>
20946
20947         * mpn/tests/add_n.c: Set OPS from CLOCK.
20948         * mpn/tests/sub_n.c: Likewise.
20949         * mpn/tests/mul_1.c: Likewise.
20950         * mpn/tests/addmul_1.c: Likewise.
20951         * mpn/tests/submul_1.c: Likewise.
20952
20953         * mpn/tests/lshift.c: Update from add_n.c.
20954         * mpn/tests/rshift.c: Likewise.
20955
20956 1999-12-03  Torbjorn Granlund  <tege@swox.com>
20957
20958         * mpn/powerpc64/copy.S: New file.
20959
20960 1999-12-02  Torbjorn Granlund  <tege@swox.com>
20961
20962         * mpn/sparc64/copy.s: New file.
20963
20964         * mpn/tests/copy.c: New file.
20965
20966         * mpn/configure.in: Recognize more Amd CPUs; Set special paths for
20967         k7 CPU.
20968
20969         * configure.in: Recognize Amd x86 CPUs.
20970
20971         * mpz/fdiv_r_2exp.c: In rounding code, read in->_mp_size before
20972         writing to res->_mp_size.
20973
20974         * mpn/powerpc64/*.S: Clean up assembly syntax, add function headers.
20975         * mpn/powerpc64/gmp-mparam.h: (KARATSUBA_MUL_THRESHOLD): #define.
20976         (KARATSUBA_SQR_THRESHOLD): #define.
20977
20978         * mpn/tests/add_n.c (main): Only print test number if TIMES==1
20979         and not printing.
20980         (main): Don't run reference code if NOCHECK.
20981         * mpn/tests/sub_n.c: Likewise.
20982         * mpn/tests/mul_1.c: Likewise.
20983         * mpn/tests/addmul_1.c: Likewise.
20984         * mpn/tests/submul_1.c: Likewise.
20985
20986         * mpn/tests/lshift.c: (main): Only print test number if TIMES==1
20987         and not printing.
20988         * mpn/tests/rshift.c: Likewise.
20989
20990 1999-11-22  Torbjorn Granlund  <tege@swox.com>
20991
20992         * gmp.h (mpz_init_set_str): Declare using __gmp_const.
20993         (mpz_set_str): Likewise.
20994         (mpf_init_set_str): Likewise.
20995         (mpf_set_str): Likewise.
20996         (mpn_set_str): Likewise.
20997         (__gmp_0): Likewise.
20998         (mpn_divrem): Remove separate declaration; it's defined later in
20999         this file.
21000
21001         * gmp.h: Replace "defined (__STD__)' by (__STDC__-0) in
21002         expressions involving more than one term, to handle Sun's compiler
21003         that most helpfully sets __STDC__ to 0.
21004         * gmp-impl.h: Likewise.
21005         * longlong.h: Likewise.
21006
21007 1999-11-21  Torbjorn Granlund  <tege@swox.com>
21008
21009         * mpn/sparc64/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
21010         (KARATSUBA_SQR_THRESHOLD): #define.
21011
21012         * mpn/sparc64/lshift.s: Compensate stack references for odd stack ptr.
21013         * mpn/sparc64/rshift.s: Likewise.
21014
21015         * mpn/sparc64/addmul_1.s: Propagate carry properly.
21016         * mpn/sparc64/submul_1.s: Likewise.
21017
21018         * mpn/sparc64/sub_n.s: Rewrite.
21019
21020         * mpn/sparc64/sub_n.s: Get operand order for main subcc right
21021         (before scrapping this code for new code).
21022
21023 1999-11-20  Torbjorn Granlund  <tege@swox.com>
21024
21025         * mpn/sparc64/add_n.s: Rewrite.
21026
21027 1999-11-17  Torbjorn Granlund  <tege@swox.com>
21028
21029         * mpn/x86/syntax.h (PROLOG): New #define.
21030         (EPILOG): New #define.
21031
21032         * gmp.h (mpn_addsub_n): Declare.
21033         * gmp.h (mpn_add_nc): Declare.
21034         * gmp.h (mpn_sub_nc): Declare.
21035         * mpn/powerpc64/addsub_n.S: New file.
21036
21037 1999-11-17  Torbjorn Granlund  <tege@swox.com>
21038
21039         * mpn/alpha/gmp-mparam.h
21040         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
21041         (KARATSUBA_SQR_THRESHOLD): Likewise.
21042
21043 1999-11-14  Torbjorn Granlund  <tege@swox.com>
21044
21045         * mpn/x86/mul_1.S: Unroll and optimize for P6 and K7.
21046
21047 1999-11-09  Torbjorn Granlund  <tege@swox.com>
21048
21049         * mpn/x86/p6/gmp-mparam.h
21050         (KARATSUBA_MUL_THRESHOLD): Only #define #ifndef.
21051         (KARATSUBA_SQR_THRESHOLD): Likewise.
21052
21053 1999-11-05  Torbjorn Granlund  <tege@swox.com>
21054
21055         * mpn/generic/addsub_n.c: New file.
21056
21057 1999-11-02  Torbjorn Granlund  <tege@swox.com>
21058
21059         * config.guess: Handle alpha:FreeBSD with alpha:NetBSD.
21060
21061         * configure.in (vax*-*-*): New case.
21062         * config/mt-vax: New file.
21063         * mpn/vax/add_n.s: Rewrite.
21064         * mpn/vax/sub_n.s: Rewrite.
21065
21066 1999-10-31  Torbjorn Granlund  <tege@swox.com>
21067
21068         * mpn/vax/rshift.s: New file.
21069         * mpn/vax/lshift.s: New file.
21070
21071 1999-10-29  Torbjorn Granlund  <tege@swox.com>
21072
21073         * config.sub: Handle k5 and k6.
21074         * mpn/configure.in: Recognize k6.
21075
21076         * mpf/tests/t-get_d.c (LOW_BOUND, HIGH_BOUND): New #defines.
21077         (main): Tighten error bounds to 14 digits.
21078
21079         * longlong.h (default umul_ppmm, when smul_ppmm exists):
21080         Rename __m0 => __xm0, __m1 => __xm1.
21081         (default smul_ppmm): Likewise.
21082
21083 1999-10-11  Torbjorn Granlund  <tege@swox.com>
21084
21085         * config.guess: Reverse the test for POWER vs PowerPC.
21086         * config.guess (sun4m:SunOS:5.*:*): New case.
21087         * config.guess (sun4u:SunOS:5.*:*): New case.
21088
21089 1999-09-29  Torbjorn Granlund  <tege@swox.com>
21090
21091         * mpn/generic/divrem_2.c: Clean up comments.
21092
21093 1999-09-23  Torbjorn Granlund  <tege@swox.com>
21094
21095         * mpz/tests/Makefile.in: Use move-if-change when generating binaries.
21096         * mpf/tests/Makefile.in: Likewise.
21097         * mpq/tests/Makefile.in: Likewise.
21098         * mpz/tests/move-if-change: New file.
21099         * mpf/tests/move-if-change: New file.
21100         * mpq/tests/move-if-change: New file.
21101
21102         * gmp.h (mpn_incr_u): New macro (from mpn/generic/mul_n.c).
21103         (mpn_decr_u): New macro.
21104
21105         * mpn/generic/mul_n.c (mpn_incr): Delete.
21106         * mpn/generic/mul_n.c: Update usages mpn_incr => mpn_incr_u.
21107         * mpn/generic/divrem_newt.c: Use mpn_incr_u and mpn_decr_u instead of
21108         mpn_add_1 and mpn_sub_1.
21109         * mpn/generic/sqrtrem.c: Likewise.
21110         * mpz/cdiv_q_ui.c: Likewise.
21111         * mpz/cdiv_qr_ui.c: Likewise.
21112         * mpz/fdiv_q_ui.c: Likewise.
21113         * mpz/fdiv_qr_ui.c: Likewise.
21114
21115         * mpn/generic/sqrtrem.c: Start single-limb Newton iteration from 18
21116         bits.
21117
21118 1999-07-27  Torbjorn Granlund  <tege@swox.com>
21119
21120         * mpn/generic/divrem_1.c (__gmpn_divrem_1n): New function.
21121
21122         * mpn/generic/divrem_2.c: New file, code from divrem.c, `case 2:'.
21123         * mpn/Makefile.in: Compile divrem_2.c.
21124         * make.bat: Compile divrem_2.c.
21125         * mpn/configure.in (functions): Add divrem_2.
21126         * gmp.h: Declare mpn_divrem_2.
21127
21128         * mpn/generic/divrem.c: Delete special cases, handle just divisors
21129         of more than 2 limbs.
21130         * gmp.h (mpn_divrem): Call mpn_divrem_1, mpn_divrem_2, as appropriate.
21131
21132         * mpn/generic/divrem.c: Rework variable usage for better register
21133         allocation.
21134
21135 1999-07-26  Torbjorn Granlund  <tege@swox.com>
21136
21137         * mpn/alpha/ev5/add_n.s: Rewrite for better ev6 speed.
21138         * mpn/alpha/ev5/sub_n.s: Likewise.
21139
21140 1999-07-21  Torbjorn Granlund  <tege@swox.com>
21141
21142         * longlong.h (alpha): Define umul_ppmm for cc.
21143
21144         * gmp-impl.h (DItype, UDItype): Define for non-gcc if _LONGLONG is
21145         defined.
21146
21147 1999-07-15  Torbjorn Granlund  <tege@swox.com>
21148
21149         * longlong.h (powerpc64 count_leading_zeros): Fix typo.
21150         (powerpc64 add_ssaaaa): Fix typos.
21151         (powerpc64 sub_ddmmss): Fix typos.
21152
21153 1999-07-14  Torbjorn Granlund  <tege@swox.com>
21154
21155         * mpz/tests/Makefile.in: Pass XCFLAGS when linking.
21156         * mpf/tests/Makefile.in: Likewise.
21157         * mpq/tests/Makefile.in: Likewise.
21158         * mpn/Makefile.in (.S.o): Pass XCFLAGS.
21159
21160         * longlong.h: Add support for 64-bit PowerPC.
21161         * config.sub: Handle "powerpc64".
21162         * configure.in: Likewise.
21163         * mpn/configure.in: Suppress use of config/t-ppc-aix for now,
21164         it seems compiler passes proper options.
21165         * mpn/powerpc64/*.S: New files.
21166
21167         * Makefile.in (FLAGS_TO_PASS): Pass "AR=$(AR)".
21168
21169 1999-07-07  Torbjorn Granlund  <tege@swox.com>
21170
21171         * demos/pexpr.c (factor): Change alloca call to a malloc/free pair.
21172
21173         * mpn/powerpc32/syntax.h: Add #define's for crN.
21174
21175         * gmp.h (gmp_rand_algorithm): Remove spurious `,'.
21176
21177 1999-07-05  Torbjorn Granlund  <tege@swox.com>
21178
21179         * mpn/generic/divrem_1.c: Normalize divisor when needed.
21180
21181 1999-07-02  Torbjorn Granlund  <tege@swox.com>
21182
21183         * mpn/configure.in (powerpc*-apple-mach): New configuration.
21184         * mpn/powerpc32/*: Add support for apple-macho syntax.
21185         * mpn/powerpc32/syntax.h: New file.
21186         * gmp-impl.h: Don't use `__attribute__' syntax for Apple's perversion
21187         of GCC.
21188
21189 1999-05-26  Linus Nordberg  <linus@swox.se>
21190
21191         * rand.c (gmp_rand_init): Fix typo.
21192
21193         * mpn/generic/rawrandom.c (mpn_rawrandom): Count bits, not limbs,
21194         to keep track of how many rounds to do in loop.  Clean up
21195         temporary allocation.  Update `seedsize' inside loop.  Mask off
21196         the correct number of bits from final result.  Init `mcopyp' even
21197         when not normalizing `m'.
21198
21199         * randlc.c (gmp_rand_init_lc): Fix typo (don't call
21200         mpz_init_set_ui()).
21201
21202         * mpn/generic/rawrandom.c (mpn_rawrandom): Set SIZ(s->seed) when
21203         reallocating.
21204
21205         * tests/rand/Makefile (test, bigtest): Add 33-bit tests.
21206
21207         * tests/rand/gen.c (main): Set precision of variable passed to
21208         mpf_urandomb().  Add option `-p'.
21209
21210 1999-05-25  Linus Nordberg  <linus@swox.se>
21211
21212         * randcm.c: Remove.
21213         * randcmui.c: Remove.
21214         * Makefile.in: Remove randcm and randcmui.
21215         * make.bat: Ditto.
21216         * gmp-impl.h: Remove prototypes for __gmp_rand_init_common() and
21217         __gmp_rand_init_common_ui().
21218         * randlc.c (gmp_rand_init_lc): Don't call
21219         __gmp_rand_init_common().
21220
21221         * randlcui.c (gmp_rand_init_lc_ui): Don't call
21222         __gmp_rand_init_common_ui().
21223
21224         * gmp.h (__gmp_rand_state_struct): Remove unused member `maxval'.
21225         * randclr.c (gmp_rand_clear): Remove reference to s->maxval.
21226         * randcm.c (__gmp_rand_init_common): Ditto
21227
21228         * mpn/generic/rawrandom.c (mpn_rawrandom): Don't calculate nlimbs
21229         twice.
21230
21231         * gmp.h (__gmp_rand_dist): Remove.
21232
21233 1999-05-24  Linus Nordberg  <linus@swox.se>
21234
21235         * mpn/generic/rawrandom.c: Clean up comments.
21236
21237         * gmp.texi: Add documentation for random number generation.
21238
21239 1999-05-21  Linus Nordberg  <linus@swox.se>
21240
21241         * gmp.h: Typedef `gmp_rand_state' as an array with one element.
21242         Change prototypes accordingly.
21243         * gmp-impl.h: Change prototypes using `gmp_rand_state'.
21244         * rand.c (gmp_rand_init): Take `gmp_rand_state' as argument
21245         instead of a pointer to a `gmp_rand_state'.
21246         * mpf/urandom.c (mpf_urandomb): Ditto.
21247         * mpz/urandom.c (mpz_urandomb): Ditto.
21248         * mpn/generic/rawrandom.c (mpn_rawrandom): Ditto.
21249         * randcmui.c (__gmp_rand_init_common_ui): Ditto.
21250         * randlc.c (gmp_rand_init_lc): Ditto.
21251         * randlcui.c (gmp_rand_init_lc_ui): Ditto.
21252         * randui.c (gmp_rand_init_ui): Ditto.
21253         * randcm.c (__gmp_rand_init_common): Ditto.
21254         * randclr.c (gmp_rand_clear): Ditto.
21255
21256         * tests/rand/gen.c (main): Pass `s' to rand-funcs instead of address
21257         of `s'.
21258
21259 1999-05-20  Linus Nordberg  <linus@swox.se>
21260
21261         * Makefile.in: Rename randi.c --> rand.c, randi_lc.c --> randlc.c,
21262         randicom.c --> randcm.c.  Add randui.c, randcmui.c, randlcui.c.
21263         * make.bat: Ditto.
21264
21265         * gmp.h: Add prototypes for gmp_rand_init_ui() and
21266         gmp_rand_init_lc_ui().
21267         * gmp-impl.h: Add prototypes for __gmp_rand_init_common() and
21268         __gmp_rand_init_common_ui().
21269
21270         * randlc.c, randcm.c, randclr.c, rand.c: Change #include of
21271         <gmp.h> to "gmp.h".
21272         * randclr.c: Include stdlib.h for free().
21273         * rand.c: Include gmp-impl.h.
21274
21275 1999-05-12  Torbjorn Granlund  <tege@swox.com>
21276
21277         * mpn/configure.in: Put generic m68k alternative last.
21278
21279 1999-05-04  Torbjorn Granlund  <tege@swox.com>
21280
21281         * demos/pexpr.c (setup_error_handler): Use sigemptyset to create
21282         empty set (for portability).
21283         (fns): Fix typo '#if #if'.
21284         (mpz_eval_expr): Implement FERMAT and MERSENNE.
21285
21286         * demos/pexpr.c: Cast longjmp argument via long to silent warnings on
21287         64-bit hosts.
21288
21289 1999-05-03  Torbjorn Granlund  <tege@swox.com>
21290
21291         * demos/pexpr.c: Add #defines for GMP 1.x and 2.0 compatibility.
21292
21293         * demos/pexpr.c (setup_error_handler): New function; take signal
21294         handler setup code from main(), with major modifications to use modern
21295         signal interface.
21296         (main): Remove signal handler setup code; call setup_error_handler.
21297
21298 1999-04-29  Linus Nordberg  <linus@swox.se>
21299
21300         * tests/rand/findcl.c (main): Add option '-i' for interval factor.
21301         Separate v and merit lose figures.  Add '-v' for version.
21302
21303 1999-04-28  Linus Nordberg  <linus@swox.se>
21304
21305         * tests/rand/statlib.c: Change debugging stuff.
21306
21307         * tests/rand/gmpstat.h: Add debug values definitions.
21308
21309         * tests/rand/findcl.c (main): Print low and high merit on startup.
21310         Print version string on startup.  Catch SEGV and HUP.  Add option -d
21311         for debug.  Fix bug making test for v too hard.
21312         (sh_status): New function.
21313         (sh_status): Flush stdout.  Add RCSID.
21314
21315 1999-04-27  Linus Nordberg  <linus@swox.se>
21316
21317         * tests/rand/Makefile (clean): Add target.
21318
21319 1999-04-27  Linus Nordberg  <linus.nordberg@canit.se>
21320
21321         * tests/rand/stat.c: Include gmpstat.h.
21322         Add global int g_debug.
21323
21324         * tests/rand/spect.c: Include <unistd.h>.
21325
21326         * tests/rand/findcl.c (main): Input is `m', not all factors of `m'.
21327         Print only the very first matching multiplier.  Include <unistd.h>.
21328         Flush stdout.  Print "done." when done.
21329
21330         * tests/rand/spect.c: Move everything but main() to statlib.c.
21331
21332         * tests/rand/findcl.c: New file.
21333
21334         * tests/rand/gmpstat.h: New file.
21335
21336         * tests/rand/statlib.c (merit, merit_u, f_floor, vz_dot,
21337         spectral_test): New functions.
21338
21339 1999-04-27  Torbjorn Granlund  <tege@swox.com>
21340
21341         * mpn/configure.in: Fix typo, "sparc-*)" was "sparc)".
21342
21343 1999-04-21  Torbjorn Granlund  <tege@swox.com>
21344
21345         * config.sub: Recognize ev6.
21346
21347 1999-04-12  Linus Nordberg  <linus.nordberg@canit.se>
21348
21349         * urandom.c: Split up into randclr.c, randi.c, randi_lc.c,
21350         randicom.c.
21351         * randclr.c, randi.c, randi_lc.c, randicom.c: New files.
21352         * Makefile.in: Remove urandom.  Add randclr, randi, randi_lc,
21353         randicom.
21354         * make.bat: Ditto
21355
21356 1999-03-31  Torbjorn Granlund  <tege@matematik.su.se>
21357
21358         * configure.in (sparc9-*-solaris2.[789]*, etc): New alternative.
21359         * mpn/configure.in: Use mt-sprc9 also for ultrasparc*-*-solaris2*.
21360
21361 1999-03-30  Linus Nordberg  <linus.nordberg@canit.se>
21362
21363         * urandom.c (__gmp_rand_scheme): Change NULL->0.
21364         Include "gmp.h" instead of <gmp.h>.
21365
21366 1999-03-29  Linus Nordberg  <linus.nordberg@canit.se>
21367
21368         * gmp.h (__gmp_rand_data_lc): Now holds a, c, m instead of scheme
21369         struct.
21370         (__gmp_rand_lc_scheme_struct): Remove mpz_t's `a' and `m'.
21371
21372         * tests/rand/stat.c (f_freq): Don't print 2nd level results if doing
21373         1st level.
21374
21375         * tests/rand/gen.c (main): Set default algorithm to mpz_urandomb.
21376         (main): Add option -c.
21377
21378 1999-03-24  Linus Nordberg  <linus.nordberg@canit.se>
21379
21380         * tests/rand/Makefile (GMPINC): Rename to GMPH.
21381         (GMPH): Add gmp-mparam.h.
21382         (CFLAGS): Add -I$(GMPLIBDIR)/mpn
21383
21384 1999-03-23  Linus Nordberg  <linus.nordberg@canit.se>
21385
21386         * Makefile.in: Compile top-dir/urandom.c.
21387         * make.bat: Ditto.
21388
21389         * mpn/Makefile.in: Compile rawrandom.c.
21390         * make.bat: Ditto.
21391
21392         * mpn/configure.in (functions): Add rawrandom.
21393
21394         * gmp.h (__gmp_rand_scheme_struct): Rename to
21395         __gmp_rand_lc_scheme_struct.
21396         (__gmp_rand_data_lc): Remove member 'n'.  Allocate a
21397         __gmp_rand_lc_scheme_struct instead of a pointer to one.
21398         Add prototype for gmp_rand_init_lc(), mpn_rawrandom().
21399         New prototype for mpz_urandomb().
21400
21401         * urandom.c: New file.
21402         (__gmp_rand_init_common): New function.
21403         (gmp_rand_init_lc): New function.
21404         (gmp_rand_init): Don't init data_lc->n.  Call gmp_rand_init_lc()
21405         and __gmp_rand_init_common().
21406         (gmp_rand_clear): Remove reference to data_lc->n.
21407
21408         * mpz/urandom.c (gmp_rand_init, gmp_rand_clear): Move to new file
21409         urandom.c in top-dir.
21410         (mpz_urandomb): Add function parameter nbits.  Call mpn_rawrandom().
21411
21412         * mpf/urandom.c (mpf_urandomb): Call mpn_rawrandom().
21413
21414         * mpn/generic/rawrandom.c: New file.
21415         (mpn_rawrandom): New function.
21416
21417 1999-03-17  Torbjorn Granlund  <tege@matematik.su.se>
21418
21419         * extract-dbl.c: When packing result, adjust exp when sc == 0.
21420
21421         * mpf/tests/t-get_d.c: New file.
21422         * mpf/tests/Makefile.in: Compile t-get_d.c.
21423
21424 1999-03-16  Linus Nordberg  <linus.nordberg@canit.se>
21425
21426         * mpz/urandom.c (__gmp_rand_scheme): Add extra braces around the
21427         mpz_t members.
21428
21429         * make.bat: Compile mpz/urandom.c and mpf/urandom.c
21430
21431         * tests/rand/statlib.c (ks_table): Use mpf_pow_ui() and exp().
21432
21433         * tests/rand/gen.c: Include unistd.h for getopt.
21434
21435 1999-03-15  Linus Nordberg  <linus.nordberg@canit.se>
21436
21437         * mpz/urandom.c (gmp_rand_init): New function.
21438         (gmp_rand_clear): New function.
21439         (mpz_urandomb): New function.
21440
21441         * mpz/Makefile.in: Compile urandom.c
21442
21443         * mpf/urandom.c (mpf_urandomb): New function.
21444
21445         * mpf/Makefile.in: Compile urandom.c.
21446
21447         * gmp.h (__gmp_rand_state_struct, __gmp_rand_scheme_struct): New
21448         structs for randomization functions.
21449         (gmp_rand_dist, gmp_rand_alogrithm): New enums for randomization
21450         functions.
21451         (mpz_urandomb, mpf_urandomb): Add prototype.
21452         (gmp_rand_init, gmp_rand_clear): Add prototype.
21453
21454         * tests/rand/gen.c, stat.c, statlib.c, statlib.h: New files.
21455         * tests/rand/Makefile, tests/rand/ChangeLog: New files.
21456
21457 1999-03-15  Torbjorn Granlund  <tege@matematik.su.se>
21458
21459         * .gdbinit: New file.
21460
21461         * mpz/dump.c: New file.
21462         * mpz/Makefile.in: Compile dump.c.
21463         * make.bat: Likewise.
21464         * gmp.h (mpz_dump): Declare.
21465
21466 1999-03-14  Torbjorn Granlund  <tege@matematik.su.se>
21467
21468         * mpz/tests/reuse.c: Also test mpz_invert and mpz_divexact.
21469
21470         * mpz/tests/convert.c: Update to GMP 2 variable syntax.
21471
21472 1999-03-13  Torbjorn Granlund  <tege@matematik.su.se>
21473
21474         * mpf/README: New file.
21475         * mpz/README: New file.
21476
21477         * mpf/pow_ui.c: New file.
21478         * mpf/Makefile.in: Compile pow_ui.c.
21479         * make.bat: Likewise.
21480         * gmp.h (mpf_pow_ui): Declare.
21481
21482 1999-03-12  Torbjorn Granlund  <tege@matematik.su.se>
21483
21484         * mpn/configure.in: Stage 1 of rewrite.
21485         * mpn/underscore.h: New name for bsd.h.
21486         * mpn/sysv.h: Deleted.
21487
21488         * mpn/m68k/*: Don't include sysdep.h.
21489
21490         * mpn/pa64/README: New file.
21491
21492 1999-03-11  Torbjorn Granlund  <tege@matematik.su.se>
21493
21494         * mpn/powerpc32/add_n.S: Add support for both AIX and ELF syntax.
21495         Renamed from `.s'.
21496         * mpn/powerpc32/sub_n.S: Likewise.
21497         * mpn/powerpc32/lshift.S: Likewise.
21498         * mpn/powerpc32/rshift.S: Likewise.
21499         * mpn/powerpc32/mul_1.S: Likewise.
21500         * mpn/powerpc32/addmul_1.S: Likewise.
21501         * mpn/powerpc32/submul_1.S: Likewise.
21502
21503         * mpn/powerpc32/umul.S: New file.
21504         * mpn/sparc32/v8/umul.S: New file.
21505         * mpn/sparc32/umul.S: New file.
21506         * mpn/x86/umul.S: New file.
21507         * mpn/x86/udiv.S: New file.
21508
21509         * mpn/Makefile.in (mul_basecase.o): Delete rule.
21510
21511 1999-02-22  Torbjorn Granlund  <tege@matematik.su.se>
21512
21513         * configure.in (hppa2.0*-*-*): Force use of GCC.
21514
21515         * extract-dbl.c: Handle IEEE denormalized numbrs.  Clean up.
21516
21517 1998-12-02  Torbjorn Granlund  <tege@matematik.su.se>
21518
21519         * mpn/Makefile.in (CCAS): New macro.
21520         (.s.o): Use CCAS.
21521         (.S.o): Likewise.
21522
21523         * mpn/Makefile.in (mul_basecase.o): Add dependency.
21524         (sqr_basecase.o): Likewise.
21525         (mod_1.o): Likewise.
21526
21527         * demos/pexpr.c (cputime): Test also __hpux.
21528         (cleanup_and_exit): Check SIGXCPU only #ifdef LIMIT_RESOURCE_USAGE.
21529
21530         * mpz/tests/t-2exp.c: Use urandom, not random.
21531
21532         * mpn/configure.in (arm*-*-*): New alternative.
21533
21534 1998-11-30  Torbjorn Granlund  <tege@matematik.su.se>
21535
21536         * gmp-impl.h (union ieee_double_extract): Special case for
21537         little-endian arm.
21538         (LIMBS): Alias for PTR.
21539
21540 1998-11-26  Torbjorn Granlund  <tege@matematik.su.se>
21541
21542         * longlong.h (m68000 umul_ppmm): Use `muluw', not `mulu'.
21543         (m68k stuff): Clean up; add coldfire support.
21544
21545 1998-11-23  Torbjorn Granlund  <tege@matematik.su.se>
21546
21547         * mpn/mips3/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
21548         (KARATSUBA_SQR_THRESHOLD): #define.
21549
21550         * mpn/sparc32/v9/README: New file.
21551
21552 1998-11-20  Torbjorn Granlund  <tege@matematik.su.se>
21553
21554         * mpn/x86/README: New file.
21555
21556         * mpn/arm/gmp-mparam.h: New file.
21557         * mpn/pa64/gmp-mparam.h: New file.
21558         * mpn/hppa/gmp-mparam.h: New file.
21559         * mpn/x86/pentium/gmp-mparam.h: New file.
21560         * mpn/sparc32/v9/gmp-mparam.h: New file.
21561         * mpn/powerpc32/gmp-mparam.h: New file.
21562         * mpn/x86/p6/gmp-mparam.h: New file.
21563
21564         * mpn/alpha/gmp-mparam.h (KARATSUBA_MUL_THRESHOLD): #define.
21565         (KARATSUBA_SQR_THRESHOLD): #define.
21566
21567         * mpn/configure.in: Point to x86/p6 when appropriate.
21568
21569         * mpn/power/umul.s: New file.
21570         * mpn/power/sdiv.s: New file.
21571         * mpn/pa64/addmul_1.S: New file.
21572         * mpn/pa64/submul_1.S: New file.
21573         * mpn/pa64/mul_1.S: New file.
21574         * mpn/pa64/udiv_qrnnd.c: New file.
21575         * mpn/pa64/umul_ppmm.S: New file.
21576         * mpn/mips2/umul.s: New file.
21577         * mpn/m68k/mc68020/umul.s: New file.
21578         * mpn/m68k/mc68020/udiv.s: New file.
21579         * mpn/hppa/hppa1_1/umul.s: New file.
21580         * mpn/alpha/umul.s: New file.
21581         * mpn/a29k/udiv.s: New file.
21582         * mpn/a29k/umul.s: New file.
21583
21584 1998-11-17  Torbjorn Granlund  <tege@matematik.su.se>
21585
21586         * mpn/x86/mul_basecase.S: New file for non-pentiums.
21587         * mpn/x86/mul_basecase.S: Move to mpn/x86/pentium.
21588
21589 1998-11-16  Torbjorn Granlund  <tege@matematik.su.se>
21590
21591         * make.bat: Compile mul_basecase.c and sqr_basecase.c.
21592
21593 1998-11-10  Torbjorn Granlund  <tege@matematik.su.se>
21594
21595         * mpz/invert.c: Defer writing to parameter `invert' until
21596         end.
21597
21598 1998-11-03  Torbjorn Granlund  <tege@matematik.su.se>
21599
21600         * mpn/pa64/udiv_qrnnd.c: Handle more border cases.
21601
21602 1998-10-29  Torbjorn Granlund  <tege@matematik.su.se>
21603
21604         * insert-dbl.c: Special case biased exponents < 1; Get boundary for
21605         Inf right.
21606
21607         * longlong.h (COUNT_LEADING_ZEROS_NEED_CLZ_TAB): New #define.
21608
21609 1998-10-28  Torbjorn Granlund  <tege@matematik.su.se>
21610
21611         * mpn/powerpc32/submul_1.s: Rewrite, optimizing for PPC604.
21612         * mpn/powerpc32/addmul_1.s: Likewise.
21613         * mpn/powerpc32/lshift.s: Likewise.
21614
21615 1998-10-23  Torbjorn Granlund  <tege@matematik.su.se>
21616
21617         * config/mt-sprc9-gcc (XCFLAGS): Add -Wa,-xarch=v8plus.
21618
21619         * mpn/sparc32/v9/submul_1.s: New file.
21620
21621 1998-10-21  Torbjorn Granlund  <tege@matematik.su.se>
21622
21623         * mpn/config/mt-pa2hpux: New file.
21624         * mpn/configure.in (hppa2.0*-*-*): Use new 64-bit code.
21625
21626         * config.sub: Recognize hppa2.0 as CPU type.
21627
21628         * longlong.h (64-bit hppa): Add umul_ppmm and udiv_qrnnd.
21629         * mpn/pa64/mul_1.S: New file.
21630         * mpn/pa64/addmul_1.S: New file.
21631         * mpn/pa64/submul_1.S: New file.
21632         * mpn/pa64/umul_ppmm.S: New file.
21633         * mpn/pa64/udiv_qrnnd.c: New file.
21634
21635 1998-10-20  Torbjorn Granlund  <tege@matematik.su.se>
21636
21637         * mpz/pprime_p.c: Pass 1L, not 1, to mpz_cmp_ui.
21638
21639         * mpz/fdiv_q_2exp.c: Cast `long' argument to `mp_limb_t' for mpn calls.
21640         * mpz/gcd_ui.c: Likewise.
21641         * mpz/add_ui.c: Likewise.
21642         * mpz/sub_ui.c: Likewise.
21643
21644 1998-10-19  Torbjorn Granlund  <tege@matematik.su.se>
21645
21646         * mpn/generic/bdivmod.c: Avoid using switch statement with mp_limb_t
21647         index.
21648
21649 1998-10-17  Torbjorn Granlund  <tege@matematik.su.se>
21650
21651         * mpn/sparc32/v9/mul_1.s: Misc cleanups.
21652         * mpn/sparc32/v9/addmul_1.s: Misc cleanups.
21653
21654 1998-10-16  Torbjorn Granlund  <tege@matematik.su.se>
21655
21656         * mpn/tests/{add,sub,}mul_1.c: Print xlimb using mpn_print.
21657
21658         * mpz/tests/t-powm.c (SIZE): Increase to 50.
21659         (EXP_SIZE): New parameter; use it for computing exp_size.
21660
21661 1998-10-15  Torbjorn Granlund  <tege@matematik.su.se>
21662
21663         * mpn/generic/divrem_newt.c: Use TMP_ALLOC interface.
21664
21665         * mpn/generic/sqrtrem.c: Check BITS_PER_MP_LIMB before defining
21666         assembly variants of SQRT.
21667
21668 1998-10-14  Torbjorn Granlund  <tege@matematik.su.se>
21669
21670         * mpn/tests: Clean up timing routines.  Don't include longlong.h
21671         where it is not needed.
21672         (mpn_print): Handle printing when _LONG_LONG_LIMB.
21673         * mpn/tests/{add,sub,}mul_1.c: Generate xlimb with mpn_random2
21674         and do it whether TIMES != 1 or not.
21675
21676         * mpn/generic/mul_n.c: Delay assignment of `sign' for lower
21677         register pressure.
21678
21679         * mpn/sparc32/v9/mul_1.s: New file.
21680
21681         * config/mt-sprc9-gcc: New file.
21682         * configure.in: Use it.
21683
21684         * mpn/configure.in: Use sparc64 for Solaris 2.7 and later with a
21685         sparc v9 CPU.
21686         * mpn/configure.in: Use sparc32/v9 for Solaris 2.6 or earlier with
21687         a sparc v9 CPU.
21688
21689         * mpf/sub.c: In initial code for ediff == 0, limit precision
21690         before jumping to `normalize'.
21691
21692 1998-10-13  Torbjorn Granlund  <tege@matematik.su.se>
21693
21694         * mpn/hppa/hppa2_0/add_n.s: New file.
21695         * mpn/hppa/hppa2_0/sub_n.s: New file.
21696         * mpn/configure.in: Handle hppa2.0 (32-bit code for now).
21697
21698         * config.guess: Update from egcs 1.1.
21699         (9000/[3478]??:HP-UX:*:*): Properly return 2.0 for all known 2.0
21700         machines.
21701
21702 1998-10-07  Torbjorn Granlund  <tege@matematik.su.se>
21703
21704         * mpz/root.c (mpz_root): New file.
21705         * mpz/Makefile.in: Compile it.
21706         * make.bat: Likewise.
21707         * gmp.h (mpz_root): Declare.
21708
21709         * mpz/perfpow.c: New file.
21710         * mpz/Makefile.in: Compile it.
21711         * make.bat: Likewise.
21712         * gmp.h (mpz_perfect_power_p): Declare.
21713
21714         * mpz/remove.c: New file.
21715         * mpz/Makefile.in: Compile it.
21716         * make.bat: Likewise.
21717         * gmp.h (mpz_remove): Declare.
21718
21719         * mpz/bin_ui.c: New file.
21720         * mpz/Makefile.in: Compile it.
21721         * make.bat: Likewise.
21722         * gmp.h (mpz_bin_ui): Declare.
21723
21724         * mpz/bin_uiui.c: New file.
21725         * mpz/Makefile.in: Compile it.
21726         * make.bat: Likewise.
21727         * gmp.h (mpz_bin_uiui): Declare.
21728
21729 1998-09-16  Torbjorn Granlund  <tege@matematik.su.se>
21730
21731         * longlong.h: Test for __powerpc__ in addition to _ARCH_PPC.
21732
21733 Sat Sep  5 17:22:28 1998  Torbjorn Granlund  <tege@matematik.su.se>
21734
21735         * mpf/cmp_si.c: Compare most significant mantissa limb before
21736         trying to deduce anything from the limb count.
21737         * mpf/cmp_ui.c: Likewise.
21738
21739 Tue Aug 18 10:24:39 1998  Torbjorn Granlund  <tege@matematik.su.se>
21740
21741         * mpz/pprime_p.c (mpz_probab_prime_p): Add new code block
21742         for doing more dividing.
21743
21744 Sat Aug 15 18:43:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
21745
21746         * mpn/generic/divrem_newt.c: New name for divrem_newton.c.
21747         * mpn/Makefile.in: Corresponding changes.
21748         * mpn/configure.in: Likewise.
21749
21750 Wed Aug 12 23:07:09 1998  Torbjorn Granlund  <tege@matematik.su.se>
21751
21752         * config.guess: Handle powerpc for NetBSD.
21753
21754 Tue Jul 28 23:10:55 1998  Torbjorn Granlund  <tege@matematik.su.se>
21755
21756         * mpz/fib_ui.c: New file.
21757         * mpz/Makefile.in: Compile it.
21758         * make.bat: Likewise.
21759         * gmp.h (mpz_fib_ui): Declare.
21760
21761 Wed Jun 17 22:52:58 1998  Torbjorn Granlund  <tege@matematik.su.se>
21762
21763         * make.bat: Fix typo, `asm-synt.h' => `asm-syntax.h'.
21764
21765 Wed Jun  3 11:27:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
21766
21767         * config/mt-pwr: New file.
21768         * config/mt-ppc: New file.
21769         * configure.in: Use the new files.
21770
21771 Tue Jun  2 13:04:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
21772
21773         * mpn/sparc32/v9/addmul_1.s: New file.
21774         * mpn/config/mt-sprc9: New file.
21775         * mpn/configure.in: Use mt-sprc9.
21776
21777 Tue May 26 11:24:18 1998  Torbjorn Granlund  <tege@matematik.su.se>
21778
21779         * demos/factorize.c (factor_using_pollard_rho): Pass correct
21780         parameters in recursive calls; join the two recursion arms.
21781
21782         * mpf/set_q.c: Set result sign.
21783         When normalizing the numerator, don't allow it to increase in size
21784         beyond prec.
21785
21786 Tue May 19 17:28:14 1998  Torbjorn Granlund  <tege@matematik.su.se>
21787
21788         * demos/factorize.c (factor_using_division): Call fflush
21789         also for the factor 2.
21790
21791 Mon May 18 15:51:01 1998  Torbjorn Granlund  <tege@matematik.su.se>
21792
21793         * make.bat: Pass -fomit-frame-pointer.  Do not pass -g.
21794
21795 Tue May  5 01:42:50 1998  Torbjorn Granlund  <tege@matematik.su.se>
21796
21797         * mpz/Makefile.in (LOCAL_CC): Remove definition.
21798
21799         * gmp.h: Get rid of GMP_SMALL stuff.
21800         * mpz/Makefile.in: Likewise.
21801         * mpq/Makefile.in: Likewise.
21802         * mpf/Makefile.in: Likewise.
21803
21804         * mpz/invert.c: Fix typo in comment.
21805
21806 Mon May  4 23:05:32 1998  Torbjorn Granlund  <tege@matematik.su.se>
21807
21808         * mpn/generic/sqrtrem.c: Check that __arch64__ is not defined
21809         before defining sparc SQRT.
21810
21811 Mon Apr 20 19:16:17 1998  Torbjorn Granlund  <tege@matematik.su.se>
21812
21813         * mpn/generic/gcdext.c: Allow gp to be NULL.
21814
21815 1998-04-03  Torbjorn Granlund  <tege@matematik.su.se>
21816
21817         * mpn/configure.in: Recognize `alphaev5*', not `alphaev5'.
21818
21819         * config.guess: Handle CPU variants for NetBSD.
21820
21821 Mon Mar 16 13:07:54 1998  Torbjorn Granlund  <tege@matematik.su.se>
21822
21823         * mpz/pprime_p.c: Use mpn_mod_1/mpn_preinv_mod_1 for computing mod PP,
21824         not mpz_tdiv_r_ui (which expects an `unsigned long').
21825         (mpz_probab_prime_p): Change type of `r' to mp_limb_t.
21826
21827 Thu Mar 12 17:19:04 1998  Torbjorn Granlund  <tege@matematik.su.se>
21828
21829         * gmp.h (mpf_ceil, mpf_floor, mpf_trunc): Add declarations.
21830
21831         * config.guess: Update from FSF version.
21832         * config.sub: Likewise.
21833
21834         * config.guess: Add special handling of alpha-*-NetBSD.
21835
21836 Wed Mar 11 00:55:34 1998  Torbjorn Granlund  <tege@matematik.su.se>
21837
21838         * mpz/inp_str.c: Update from set_str.c.
21839         Properly increment `nread' when skipping minus sign.
21840
21841         * mpz/set_str.c: Check for empty string after having skipped
21842         leading zeros.
21843
21844 Mon Mar  9 19:28:00 1998  Torbjorn Granlund  <tege@matematik.su.se>
21845
21846         * mpz/set_str.c: Skip leading zeros.
21847
21848 Wed Mar  4 19:29:16 1998  Torbjorn Granlund  <tege@matematik.su.se>
21849
21850         * gmp.h (mpz_cmp_si): Cast argument before calling mpz_cmp_ui.
21851
21852         * demos/factorize.c: Rewrite.
21853
21854 1998-02-04  Torbjorn Granlund  <tege@matematik.su.se>
21855
21856         * configure.in (i[3456]86* etc): Check if using gcc before
21857         choosing mt-x86.
21858
21859         * configure.in (m68*-*-*): New alternative.
21860         * config/mt-m68k: New file.
21861
21862         * mpn/alpha/invert-limb.s: Put tables in text segment,
21863         since not all systems support "rdata".
21864
21865 Wed Feb  4 02:20:57 1998  Torbjorn Granlund  <tege@matematik.su.se>
21866
21867         * gmp.h (__GNU_MP_VERSION_SNAP): New #define.
21868         (__GNU_MP_VERSION_MINOR): Now 1.
21869
21870 Wed Jan 28 22:29:36 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
21871
21872         * longlong.h (alpha udiv_qrnnd): #define UDIV_NEEDS_NORMALIZATION.
21873
21874 Wed Jan 28 20:28:19 1998  Torbjorn Granlund  <tege@sophie.matematik.su.se>
21875
21876         * mpz/pprime_p.c (mpz_probab_prime_p): Delete 59 from tried divisors.
21877
21878 Mon Jan 26 01:39:02 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
21879
21880         * mpz/pprime_p.c (mpz_probab_prime_p): Major overhaul: Check small
21881         numers specifically; check small factors, then perform a fermat test.
21882
21883 Tue Jan 13 14:58:28 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
21884
21885         * longlong.h (alpha udiv_qrnnd): Call __mpn_invert_normalized_limb
21886         and udiv_qrnnd_preinv.
21887
21888 Wed Jan  7 01:52:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
21889
21890         * mpn/configure.in (alpha*, extra_functions): Add invert-limb and
21891         remove udiv_qrnnd.
21892
21893         * mpn/tests/divrem.c: Get allocations right.
21894
21895         * mpn/generic/divrem.c: Conditionally pre-invert most significant
21896         divisor limb.
21897
21898 Tue Jan  6 23:08:54 1998  Torbjorn Granlund  <tege@tunnis.tmg.se>
21899
21900         * mpn/generic/divrem_1.c: Rename variables to comply to conventions.
21901         Make `i' have type `mp_size_t'.
21902
21903 Tue Dec 30 22:21:42 1997  Torbjorn Granlund  <tege@matematik.su.se>
21904
21905         * mpz/tdiv_qr_ui.c: Return the remainder.
21906         * mpz/tdiv_r_ui.c: Likewise.
21907         * mpz/tdiv_q_ui.c: Likewise.
21908         * gmp.h: Change return type of mpz_tdiv_qr_ui, mpz_tdiv_r_ui,
21909         mpz_tdiv_q_ui.
21910
21911         * mpz/tdiv_ui.c: New file.
21912         * mpz/Makefile.in: Compile it.
21913         * make.bat: Likewise.
21914         * gmp.h (mpz_tdiv_ui): Declare.
21915
21916 Fri Nov  7 04:21:15 1997  Torbjorn Granlund  <tege@matematik.su.se>
21917
21918         * mpf/integer.c (FUNC_NAME): Fix bogus test for mpf_trunc.
21919
21920         * demos/isprime.c: New file.
21921
21922         Sat Nov  1 19:32:25 1997  Torbjorn Granlund  <tege@matematik.su.se>
21923
21924         * mpz/cmp_abs.c: New file.
21925         * mpz/Makefile.in: Compile it.
21926         * make.bat: Likewise.
21927         * gmp.h (mpz_cmp_abs): Declare.
21928
21929         * mpz/cmp_abs_ui.c: New file.
21930         * mpz/Makefile.in: Compile it.
21931         * make.bat: Likewise.
21932         * gmp.h (mpz_cmp_abs_ui): Declare.
21933
21934 Sat Sep 27 04:49:52 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
21935
21936         * mpz/fdiv_r_2exp.c: Get allocation for `tmp' right.
21937
21938         * mpz/fdiv_q_2exp.c: In final result adjustment code, handle
21939         that intermediate result is zero.
21940
21941         * mpz/tests/t-2exp.c: New file.
21942         * mpz/tests/Makefile.in: Handle t-2exp.c.
21943
21944 Fri Sep 26 16:29:21 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
21945
21946         * mpz/divexact.c: Fix typo in test for whether to copy numerator to
21947         quotient and move that statement to after handling quotient and
21948         denominator overlap.  Misc cleanups.
21949
21950         * mpn/generic/gcd.c: Change count argument of mpn_lshift/mpn_rshift
21951         calls to `unsigned int'.
21952         * mpz/divexact.c: Likewise.
21953
21954 Mon Sep 22 02:19:52 1997  Torbjorn Granlund  <tege@pro.tmg.se>
21955
21956         * mpz/tests/t-powm.c: Decrease `reps' to 2500.
21957
21958         * mpz/tests/t-pow_ui.c: New file.
21959         * mpz/tests/Makefile.in: Handle t-pow_ui.c.
21960
21961         * mpz/ui_pow_ui.c: Get special cases for exponent and base right.
21962
21963         * mpz/pow_ui.c: Increase temp space allocation by 1 limb.
21964         Split `rsize' into two variables; compute space allocation into
21965         `ralloc'.
21966
21967 Sun Sep  7 04:15:12 1997  Torbjorn Granlund  <tege@pro.tmg.se>
21968
21969         * mpn/pa64/lshift.s: New file.
21970         * mpn/pa64/rshift.s: New file.
21971         * mpn/pa64/sub_n.s: New file.
21972
21973 Sat Sep  6 19:14:13 1997  Torbjorn Granlund  <tege@gmp.tmg.se>
21974
21975         * mpn/pa64/add_n.s: New file.
21976         * mpn/pa64: New directory.
21977
21978 Tue Aug 19 16:17:09 1997  Torbjorn Granlund  <tege@pro.tmg.se>
21979
21980         * mpz/swap.c: New file.
21981         * mpz/Makefile.in: Compile it.
21982         * make.bat: Likewise.
21983         * gmp.h (mpz_swap): Declare.
21984
21985         * mpn/generic/mul_n.c: Push assignment of x and y pointers into the
21986         if/else clauses in several places.  (Decreases register pressure.)
21987
21988 Mon Aug 18 03:29:50 1997  Torbjorn Granlund  <tege@pro.tmg.se>
21989
21990         * mpn/thumb/add_n.s: New file.
21991         * mpn/thumb/sub_n.s: New file.
21992         * mpn/arm/add_n.s: New file.
21993         * mpn/arm/sub_n.s: New file.
21994
21995         * mpz/powm.c: After mpn_mul_n and mpn_mul calls, adjust product size
21996         if most significant limb is zero.
21997         * mpz/powm_ui.c: Likewise.
21998
21999 Fri Aug 15 02:13:57 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22000
22001         * mpn/arm/m/mul_1.s: New file.
22002         * mpn/arm/m/addmul_1.s: New file.
22003
22004         * mpn/powerpc32/mul_1.s: Rewrite.
22005
22006         * mpn/alpha/mul_1.s: Prefix labels with `.'.
22007
22008 Mon Aug 11 02:37:16 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22009
22010         * mpn/powerpc32/add_n.s: Rewrite.
22011         * mpn/powerpc32/sub_n.s: Rewrite.
22012
22013 Sun Aug 10 17:07:15 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22014
22015         * mpn/powerpc32/addmul_1.s: Delete obsolete comments.
22016         * mpn/powerpc32/submul_1.s: Likewise.
22017
22018 Fri Jul 25 20:07:54 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22019
22020         * mpz/addmul_ui.c: New file.
22021         * mpz/Makefile.in: Compile it.
22022         * make.bat: Likewise.
22023         * gmp.h (mpz_addmul_ui): Declare.
22024
22025         * mpz/setbit.c: Add missing code after final `else'.
22026
22027 Tue Jul 22 17:45:01 1997  Torbjorn Granlund  <tege@tunnis.tmg.se>
22028
22029         * mpn/sh/add_n.s: Fix typo.
22030         * mpn/sh/sub_n.s: Likewise.
22031
22032         * longlong.h (ns32k count_trailing_zeros): Fix typo.
22033
22034         * insert-dbl.c: Check for exponent overflow and return Inf.
22035
22036         * mpz/get_d.c: Rewrite to avoid rounding errors.
22037
22038 Thu May 29 11:51:07 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22039
22040         * mpq/add.c: Swap some usages of tmp1 and tmp2 to make sure
22041         their allocation suffices.
22042         * mpq/sub.c: Likewise.
22043
22044 Wed Apr 16 02:24:25 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22045
22046         * demos/pexpr.c: New file.
22047
22048         * mpn/generic/mul_n.c: Misc optimizations from Robert Harley.
22049
22050         * gmp-impl.h (MPZ_PROVOKE_REALLOC): New #define.
22051
22052 Sat Apr 12 17:54:04 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22053
22054         * mpz/tstbit.c: New file.
22055         * mpz/Makefile.in: Compile it.
22056         * make.bat: Likewise.
22057         * gmp.h (mpz_tstbit): Declare.
22058
22059         * mpz/tests/logic.c: Use MPZ_CHECK_FORMAT.
22060         * mpz/tests/bit.c: New test.
22061         * mpz/tests/Makefile.in: Handle bit.c.
22062
22063         * mpz/ior.c: In -OP2,+OP1 case, normalize OP2 after call to mpn_sub_1.
22064
22065         * gmp-impl.h (MPZ_CHECK_FORMAT): New #define.
22066
22067 Thu Apr 10 00:30:14 1997  Torbjorn Granlund  <tege@tmg.se>
22068
22069         * longlong.h (POWER/PowerPC): Test _ARCH_PWR instead of _IBMR2.
22070
22071 Wed Apr  9 18:23:31 1997  Torbjorn Granlund  <tege@pro.tmg.se>
22072
22073         * gmp-impl.h: Move defaulting of UMUL_TIME and UDIV_TIME from here...
22074         * longlong.h: ...to here.
22075
22076 Sun Mar 30 12:16:23 1997  Torbjorn Granlund  <tege@matematik.su.se>
22077
22078         * mpn/generic/next_prime.c: New file.
22079
22080         * mpn/generic/perfsqr.c: Remove definitions of PP and PP_INVERTED.
22081         * gmp-impl.h: Put them here.
22082
22083 Fri Mar 28 08:18:05 1997  Torbjorn Granlund  <tege@matematik.su.se>
22084
22085         * gmp-impl.h (MPN_COPY_INCR, MPN_COPY_DECR): Define as inline asm for
22086         for x86, but leave disabled for now.
22087
22088 Fri Feb 28 02:39:47 1997  Torbjorn Granlund  <tege@matematik.su.se>
22089
22090         * mpn/Makefile.in (.S.o): Pass SFLAGS and CFLAGS also to compiler
22091         for assembly phase.
22092         (.s.o): Pass SFLAGS.
22093
22094 Wed Feb 26 06:46:08 1997  Torbjorn Granlund  <tege@matematik.su.se>
22095
22096         * mpn/configure.in: For Pentium Pro, use default code, not Pentium
22097         optimized code.
22098
22099         * mpn/x86/addmul_1.S: Unroll and optimize for Pentium Pro.
22100         * mpn/x86/submul_1.S: Likewise.
22101
22102 Thu Feb 13 08:26:09 1997  Torbjorn Granlund  <tege@matematik.su.se>
22103
22104         * mpf/Makefile.in: Compile floor.o, ceil.o and trunc.o (from
22105         integer.c).
22106         * make.bat: Likewise.
22107
22108 Wed Feb  5 05:58:44 1997  Torbjorn Granlund  <tege@matematik.su.se>
22109
22110         * mpn/configure.in (alpha*): Add cntlz to extra_functions.
22111
22112 Wed Feb  4 03:30:45 1997  Torbjorn Granlund  <tege@matematik.su.se>
22113
22114         * mpf/integer.c: New file (supporting mpf_floor, mpf_ceil, mpf_trunc).
22115
22116 Mon Feb  3 14:21:36 1997  Torbjorn Granlund  <tege@matematik.su.se>
22117
22118         * make.bat: Fix typo, set_dfl_prc => set_dfl_prec.
22119
22120 Sun Feb  2 02:34:33 1997  Torbjorn Granlund  <tege@matematik.su.se>
22121
22122         * mpf/out_str.c: After outputting `-', decrement n_digits.
22123
22124 Wed Jan  8 02:50:20 1997  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22125
22126         * mpn/generic/divrem.c: qextra_limbs => qxn.
22127
22128 Wed Dec 18 07:50:46 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22129
22130         * mpz/tests/t-tdiv.c (SIZE): Increase to 200.
22131
22132 Tue Dec 17 19:32:48 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22133
22134         * mpn/generic/divrem.c (mpn_divrem_classic): New name for mpn_divrem.
22135         * gmp.h (mpn_divrem): New function.
22136         * mpn/generic/divrem_newton.c: New file.
22137         * mpn/configure.in (functions): Add divrem_newton.
22138         * make.bat: Likewise.
22139
22140 Thu Dec 12 17:55:13 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22141
22142         * gmp.h (_GMP_H_HAVE_FILE): Test also __dj_include_stdio_h_.
22143
22144 Sat Dec  7 09:40:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22145
22146         * mpn/alpha/invert-limb.s: New file.
22147
22148 Thu Dec  5 01:25:31 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22149
22150         * mpz/ui_pow_ui.c (mpz_pow2): New (static) function.
22151         (mpz_ui_pow_ui): Rewrite.
22152
22153         * make.bat: `pre_mod_1.c' => `pre_mod_.c'.  Fix typo in path to
22154         gmp-mpar.h.
22155
22156 Fri Nov 15 00:49:55 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22157
22158         * mpz/ui_pow_ui.c: Rewrite for better speed.
22159
22160 Fri Nov  1 16:36:56 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22161
22162         * Makefile.in (recursive make rules): Use `&&' instead of `;' as
22163         delimiter.
22164
22165 Fri Oct 25 17:12:36 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22166
22167         * gmp-impl.h (Cray/uxp MPN_COPY): Really declare as inline.
22168
22169 Thu Oct 24 15:08:19 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22170
22171         * mpn/fujitsu/rshift.c: Fix typo in loop boundaries.
22172
22173 Fri Oct 18 03:13:54 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22174
22175         * mpn/configure.in: Recognize `nextstep' for m68k variants; likewise
22176         for x86 variants.
22177
22178         * mpn/x86/syntax.h (INSND): New macro.
22179         * mpn/x86/[lr]shift.S: Use INSND.
22180         * mpn/x86/pentium/[lr]shift.S: Likewise.
22181         * mpn/config/t-oldgas (SFLAGS): Pass -DOLD_GAS.
22182
22183         * gmp-impl.h: In code for determining endianness, test also
22184         __BIG_ENDIAN__ and __hppa__.  Remove test of __NeXT__.
22185
22186 Wed Oct 16 03:50:34 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22187
22188         * mpf/set_str.c: Let `prec' determine precision used in
22189         exponentiation code; decrease allocation accordingly.
22190
22191         * mpn/vax: Change `jsob*' to `sob*' in all files.
22192
22193 Tue Oct 15 03:54:06 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22194
22195         * longlong.h (m88110 udiv_qrnnd): Change type of intermediate quotient
22196         to DImode (divu.d generates a 64-bit quotient).
22197
22198         * configure.in (m88110*): Fix typo.
22199
22200         * mpf/get_str.c: Compute exp_in_base using `double' to avoid overflow.
22201
22202         * gmp-impl.h (struct bases): Change type of chars_per_bit_exactly from
22203         float to double.
22204         * mpn/mp_bases.c (__mp_bases): Give 17 digits for chars_per_bit_exactly
22205         field.
22206
22207         * mpf/get_str.c: Let `prec' determine precision used in
22208         exponentiation code; decrease allocation accordingly.
22209
22210 Sun Oct 13 03:31:53 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22211
22212         * longlong.h: Major cleanup.
22213         (__udiv_qrnnd_c): Compute remainders using multiply and subtract,
22214         not explicit `%' operator.
22215         (C umul_ppmm): Get rid of a redundant __ll_lowpart.
22216
22217         * mpz/invert.c: Properly detect all operands that would yield an
22218         undefined inverse; make sure the inverse is always positive.
22219
22220         * mpz/xor.c: New file.
22221         * mpz/Makefile.in: Compile it.
22222         * make.bat: Likewise.
22223         * gmp.h (mpz_xor): Declare.
22224
22225         * mpz/tests/logic.c: Also test mpz_xor.
22226
22227         * mpz/lcm.c: Special case for when either operand equals 0.
22228
22229 Sat Oct 12 01:57:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22230
22231         * mpn/generic/gcd.c (find_a): Don't inline on x86.
22232
22233         * Makefile.in (CFLAGS): Default to just `-g'.
22234
22235         * configure.in: Recognize 386 and 486 wherever other x86 cpus are
22236         recognized.
22237         * configure.in: Use mt-x86 for all x86 cpus.
22238         * config/mt-x86: New file.
22239
22240         * mpn/alpha/cntlz.s: New file.
22241
22242 Tue Oct  8 00:16:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22243
22244         * longlong.h: Define smul_ppmm for Fujitsu vpp/uxp.
22245         Rewrite umul_ppmm to actually work on the hardware.
22246
22247         * mpn/x86/sub_n.S: Avoid parens around displacement of `leal'.
22248         * mpn/x86/add_n.S: Likewise.
22249
22250         * mpn/x86/syntax.h (R): Define differently depending on __STDC__.
22251
22252 Mon Oct  7 16:48:08 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22253
22254         * longlong.h: Don't test for __NeXT__ in outer 68k conditional;
22255         add test for __m68k__.
22256
22257 Sun Oct  6 00:59:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22258
22259         * gmp.h: Declare mpn_random.
22260         * make.bat: Compile mpn/generic/random.c.
22261
22262         * longlong.h: Define umul_ppmm for Fujitsu vpp/uxp.
22263
22264         * gmp-impl.h: Protect definitions using `__attribute__ ((mode (...)))'
22265         with test also for __GNUC_MINOR__.
22266
22267         * gmp.h: Don't define macros using __builtin_constant_p when using
22268         NeXT's compiler.
22269
22270 Fri Oct  4 16:53:50 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22271
22272         * mpz/lcm.c: New file.
22273         * mpz/Makefile.in: Compile it.
22274         * make.bat: Likewise.
22275         * gmp.h (mpz_lcm): Declare.
22276
22277 Wed Sep 25 00:06:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22278
22279         * mpq/tests/t-cmp_ui.c: Make sure numerator and denominator of `b' is
22280         within limits of an `unsigned long int'.
22281
22282         * mpz/tests/t-powm_ui.c: Change type of exp2 to `unsigned long int'.
22283
22284 Tue Sep 24 18:58:20 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22285
22286         * mpz/powm_ui.c: Make result always positive.
22287
22288         * urandom.h (urandom): Make it return mp_limb_t.
22289
22290         * gmp-impl.h (CNST_LIMB): New macro.
22291         * mpn/mp_bases.c: Use CNST_LIMB.
22292         * mpn/generic/hamdist.c (popc_limb): Likewise.
22293         * mpn/generic/popcount.c (popc_limb): Likewise.
22294         * mpn/generic/perfsqr.c: Likewise.
22295
22296 Fri Sep 20 03:08:10 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22297
22298         * mpz/pprime_p.c: When n <= 3, don't clear out n before using it.
22299
22300 Wed Sep 18 11:22:45 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22301
22302         * mpn/fujitsu/mul_1.c: New file.
22303         * mpn/fujitsu/addmul_1.c: New file.
22304         * mpn/fujitsu/sub_n.c: New file.
22305         * mpn/fujitsu/add_n.c: Mew file.
22306
22307 Sun Sep 15 03:13:02 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22308
22309         * mpn/generic/random.c: New file.
22310         * mpn/configure.in (functions): Add `random'.
22311
22312         * gmp-impl.h (MPN_COPY): Define as annotated inline function for
22313         Crays and Fujitsu VPPs.
22314
22315         * gmp.h (mp_size_t): Define as `int' for non-MPP Cray.
22316         (mp_exp_t): Likewise.
22317
22318         * configure.in: Add support for Fujitsu VPP machines.
22319         * mpn/configure.in: Likewise.
22320         * config.guess: Likewise.
22321         * config.sub: Likewise.
22322
22323         * mpn/fujitsu/rshift.c: New file.
22324         * mpn/fujitsu/lshift.c: New file.
22325         * mpn/fujitsu: New directory, for Fujitsu VPP machines.
22326
22327 Wed Sep 11 11:34:38 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22328
22329         * mpn/generic/mul_n.c (__gmpn_mul_n): New name for impn_mul_n.
22330         Call __gmpn_mul_basecase, not impn_mul_n_basecase; update parameter
22331         list to work with __gmpn_mul_basecase.
22332         (__gmpn_sqr): New name for impn_sqr_n.
22333         Call __gmpn_sqr_basecase, not impn_sqr_n_basecase; update parameter
22334         list to work with __gmpn_sqr_basecase.
22335         (mpn_mul_n): Update calls to match new names and parameter conventions.
22336         * gmp-impl.h (MPN_MUL_N_RECURSE): Likewise.
22337         (MPN_SQR_RECURSE): New name for MPN_SQR_N_RECURSE.
22338         Update calls to match new names and parameter conventions.
22339         * mpn/generic/mul.c: Never perform multiply explicitly here, call
22340         __gmpn_mul_basecase instead.
22341         Update calls to match new names and parameter conventions.
22342
22343         * mpn/x86/mul_basecase.S: New file.
22344         * mpn/generic/mul_basecase.c: New file.
22345         * mpn/generic/sqr_basecase.c: New file.
22346
22347 Wed Sep  4 02:59:21 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22348
22349         * mpz/set_str.c: Let `0b' and `0B' mean base 2.
22350
22351 Fri Aug 30 00:44:00 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22352
22353         * longlong.h (x86 umul_ppmm): Work around GCC bug that was
22354         triggered by Aug 28 change.
22355
22356         * mpbsd/min.c (digit_value_in_base): New function.
22357
22358         * mpz/set_str.c: Refine allocation size computation, use
22359         chars_per_bit_exactly instead of chars_per_limb.
22360
22361         * mpbsd/Makefile.in (.c.o): Add -D_mpz_realloc=_mp_realloc.
22362
22363 Wed Aug 28 02:52:14 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22364
22365         * longlong.h (x86 umul_ppmm): Don't cast result operands.
22366         (x86 udiv_qrnnd): Likewise.
22367         (default smul_ppmm): Fix typo, umul_ppmm => smul_ppmm.
22368         (default umul_ppmm): New #define using smul_ppmm.
22369         (vax smul_ppmm): New #define.
22370         (vax umul_ppmm): Delete.
22371         (POWER umul_ppmm): Delete.
22372         (IBM 370 smul_ppmm): New #define.
22373         (IBM 370 umul_ppmm): Delete.
22374         (IBM RT/ROMP smul_ppmm): New #define.
22375         (IBM RT/ROMP umul_ppmm): Delete.
22376
22377 Tue Aug 27 01:03:25 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22378
22379         * gmp-impl.h (__gmp_0): Make it `const'.
22380
22381         * mpn/Makefile.in (clean mostlyclean): Comment out recursive clean
22382         of `tests'.
22383
22384         * mpn/generic/mul.c: Identify when we do squaring, and call
22385         impn_sqr_n_basecase/impn_sqr_n as appropriate.  Use
22386         KARATSUBA_MUL_THRESHOLD and KARATSUBA_SQR_THRESHOLD.
22387         Don't #define KARATSUBA_THRESHOLD.
22388
22389         * mpn/generic/mul_n.c: Don't #define KARATSUBA_THRESHOLD.
22390         (impn_mul_n, impn_sqr_n): Rewrite, based on code contributed by
22391         Robert Harley.
22392         (impn_sqr_n_basecase): Rewrite.
22393
22394         * gmp-impl.h (KARATSUBA_MUL_THRESHOLD): New #define.
22395         (KARATSUBA_SQR_THRESHOLD): Likewise.
22396         (MPN_SQR_N_RECURSE): Use KARATSUBA_SQR_THRESHOLD.
22397         (MPN_MUL_N_RECURSE): Use KARATSUBA_MUL_THRESHOLD.
22398
22399         * configure.in: Fix typo in last change.
22400
22401 Mon Aug 26 22:25:18 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22402
22403         * mpn/generic/random2.c: Fix typo, `alpha__' => `__alpha'.
22404         * mpf/random2.c: Likewise.
22405
22406 Sun Aug 25 00:07:09 1996  Torbjorn Granlund  <tege@quiet.matematik.su.se>
22407
22408         * mpz/tests/t-mul.c: Also test squaring.
22409
22410 Fri Aug 16 05:12:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22411
22412         * mp_clz_tab.c (__clz_tab): Declare as `const'.
22413         * version.c (gmp_version): Likewise.
22414         * mpn/generic/sqrtrem.c (even_approx_tab, odd_approx_tab): Likewise.
22415
22416 Thu Aug 15 02:34:47 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22417
22418         * gmp.h: Fix typo, `mips__' => `__mips'.
22419
22420         * mpf/set_str.c: Allow a number to start with a period, if next
22421         position contains a digit.
22422
22423 Tue Aug 13 18:41:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22424
22425         * mpz/gcdext.c: Get cofactor sign right for negative input operands.
22426         Clean up code for computing tt.
22427
22428         * mpz/invert.c: Get rid of variable `rv'.
22429
22430         * mpz/divexact.c: Test for zero divisor in special case for zero
22431         dividend.
22432
22433 Mon Aug 12 18:04:07 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22434
22435         * mpz/?div_*_ui.c: Special case for division by 0.
22436         * mpz/tdiv_q.c: Likewise.
22437
22438 Sat Aug 10 14:45:26 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22439
22440         * mpz/dmincl.c: Special case for division by 0.
22441
22442         * mpz/tdiv_*_ui.c: Delete special case for dividend being 0; handle
22443         it when computing size after mpn_divmod_1 call.
22444
22445         * mp_bpl.c: (__gmp_junk): New variable.
22446         (__gmp_0): New constant.
22447
22448         * gmp-impl.h (DIVIDE_BY_ZERO): New #define.
22449
22450 Fri Aug  9 20:03:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22451
22452         * mpz/divexact.c: Test for dividend being zero before testing
22453         for small divisors.
22454
22455 Thu Aug  8 13:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22456
22457         * configure.in: Require operating system specification for cpus
22458         where assembly syntax differs between system.
22459
22460         * Makefile.in (many targets): Change `-' action prefix to `@'.
22461
22462         * mpn/Makefile.in: (distclean): Fix typo.
22463
22464         * mpq/cmp_ui.c: Rename function to _mpq_cmp_ui.
22465         (mpq_cmp_ui): #undef deleted.
22466         * mpz/cmp_si.c: Rename function to _mpz_cmp_si.
22467         (mpz_cmp_si): #undef deleted.
22468         * mpz/cmp_ui.c: Rename function to _mpz_cmp_ui.
22469         (mpz_cmp_ui): #undef deleted.
22470         * Makefile.in: Corresponding changes.
22471
22472         * mpf/get_prc.c: Return the *highest* precision achievable.
22473
22474         * mpf/get_str.c: Complete rewrite.
22475
22476         * mpf/set_str.c (swapptr): New #define.
22477         (assert): New #define.
22478         * mpf/set_str.c: Set prec to one more than the saved _mp_prec.
22479         Misc cleanups.
22480
22481         * mpz/set_str.c: #include string.h.
22482         * mpf/out_str.c: #include string.h.
22483         * mpbsd/xtom.c: #include string.h and ctype.h.
22484         * mpbsd/mout.c: #include string.h.
22485
22486 Wed Aug  7 11:46:04 EDT 1996  Ken Weber <kweber@mcs.kent.edu>
22487
22488         * mpn/generic/gcd.c: Reorder mpn_gcd argument list.
22489         * mpz/gcd.c: Change call to mpn_gcd.
22490         * gmp.texi: Update manual entry on mpn_gcd.
22491         * mpn/generic/bdivmod.c: Delete limb cache to make mpn_bdivmod
22492         reentrant.
22493
22494 Wed Aug  7 02:15:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22495
22496         * mpf/get_str.c: Rewrite code for converting integral part of a
22497         number with both an integral and fractional part.
22498
22499         * mpf/set_str.c: Get rid of variable xxx.  New variables madj and radj.
22500         In exp_in_base==0 case, add madj to msize for EXP field.
22501
22502         * mpz/tests/t-gcd.c: Test deleted.  Rename t-gcd2.c to t-gcd.c.
22503         Increase reps to 2000.
22504         * mpz/tests/t-gcd2.c: Get rid of mpz_refgcd.
22505
22506         * mpf/set_str.c: Ignore excess limbs in MP,MSIZE.
22507
22508 Thu Jul 25 04:39:10 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22509
22510         * mpn/configure.in: Fix typo in setting path, "sparc" => "sparc32".
22511
22512 Wed Jul 24 02:27:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22513
22514         * mpn/generic/gcdext.c: Reorganize and clean up.  Get rid of all
22515         signed limb arithmetic.
22516
22517 Mon Jul 22 02:39:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22518
22519         * mpn/generic/gcdext.c (mpn_gcdext): For large enough operands,
22520         work with most significant *two* limbs.
22521         (div2): New function (two variants).
22522         (THRESHOLD): New #define.
22523
22524         * mpz/gcdext.c: Fix typo in MPZ_TMP_INIT call.
22525
22526         * longlong.h (alpha UMUL_TIME): Now 30.
22527         (alpha UDIV_TIME): Now 350.
22528         (x86 UMUL_TIME): Now 10 (let Pentium decide).
22529         (SuperSPARC UDIV_TIME): Override default.
22530
22531         * extract-dbl.c (MP_BASE_AS_DOUBLE): Don't redefine here.
22532
22533         * extract-dbl.c: New name for extract-double.c.
22534         * insert-dbl.c: New name for insert-double.c.
22535         * Makefile.in: Corresponding changes.
22536         * make.bat: Likewise.
22537
22538         * mpz/Makefile.in (.c.o): Don't pass non-portable `-f' to cp.
22539         * mpq/Makefile.in: Likewise.
22540         * mpf/Makefile.in: Likewise.
22541
22542 Sat Jul 20 01:35:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22543
22544         * mpz/getlimbn.c: Take ABS of integer->_mp_size.
22545
22546         * mpz/divexact.c: Use mpn_divmod_1 if divisor is a single limb.
22547
22548 Thu Jul 18 00:31:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22549
22550         * mpn/generic/popcount.c (popc_limb): Use different masking trick
22551         for first step (due to David Seal).
22552         * mpn/generic/hamdist.c (popc_limb): Likewise.
22553
22554 Wed Jul 17 23:21:48 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22555
22556         * mpn/generic/divrem.c: In MPN_COPY_DECR call, copy dsize - 1 limbs.
22557
22558 Sun Jul 14 17:47:46 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22559
22560         * configure.in: Handle sparc9, sparc64, and ultrasparc like sparc8.
22561
22562 Thu Jul 11 14:05:54 1996  J.T. Conklin  <jtc@rtl.cygnus.com>
22563
22564         * longlong.h (mc680x0): Define umul_ppmm, udiv_qrnnd, sdiv_qrnnd
22565         for the '020, '030, '040, and '332.  Define count_leading_zeros
22566         for the '020, '030, '040, and '060.
22567
22568 Sun Jul 14 15:24:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22569
22570         From Joe Keane:
22571         * mpq/equal.c: Take ABS of num1_size before passing it to mpn_cmp.
22572
22573 Fri Jul 12 17:11:17 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22574
22575         * mpn/generic/sqrtrem.c (SQRT): New asm for x86, but leave it
22576         disabled for now.
22577
22578         * mpn/generic/sqrtrem.c: Use MP_BASE_AS_DOUBLE.
22579
22580 Wed Jul 10 03:17:45 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22581
22582         * cre-mparam.c: Delete obsolete file.
22583
22584         * gmp.h: #define _LONG_LONG_LIMB if __mips && _ABIN32.
22585         * longlong.h: Test __mips instead of __mips__.
22586
22587 Sun Jul  7 23:19:13 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22588
22589         * longlong.h (_PROTO): Define, unless already defined.
22590         (alpha __udiv_qrnnd): Declare using _PROTO.
22591         (hppa __udiv_qrnnd): Likewise.
22592         (sparc __udiv_qrnnd): Likewise.
22593
22594 Mon Jul  1 01:44:30 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22595
22596         * config.guess: Update from master version; add Cray x90 handling.
22597
22598 Wed Jun 26 05:35:02 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22599
22600         * mpn/power/add_n.s (__mpn_add_n): Work around GAS bug.
22601         * mpn/power/sub_n.s (__mpn_sub_n): Likewise.
22602
22603         * insert-double.c: Rework loop to avoid potential overflow.
22604
22605         * mpq/get_d.c: For vax, if qsize > N_QLIMBS, ignore excess limbs.
22606
22607         * mpq/tests/t-get_d.c (SIZE): Special case for vax.
22608
22609         * gmp.h (mpX_cmp_ui): #define also when ! __GNUC__.
22610
22611 Mon Jun 24 17:13:21 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22612
22613         * longlong.h (vax sdiv_qrnnd): Fix typo.
22614
22615 Sat Jun 15 01:33:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22616
22617         * gmp.h: Support `small' and `large' type and function variants,
22618         controlled by GMP_SMALL.
22619
22620         * mpz/Makefile.in (.c.o): Compile each function twice, for small and
22621         large variant.
22622         (MPZS_OBJS): New variable.
22623         (libmpz.a): Include MPZS_OBJS in archive.
22624         * mpf/Makefile.in: Analogous changes.
22625         * mpq/Makefile.in: Analogous changes.
22626
22627         * gmp.h: Prefix all functions with __gmp, to allow namespace-clean
22628         internal calls.
22629
22630         * mp.h: Rip out __MP_SMALL__ stuff.
22631         (__mpz_struct): mp_size_t => int.
22632
22633         * mpz/invert.c: #include "gmp-impl.h".
22634         Use MPZ_TMP_INIT, not mpz_init.
22635
22636         * mpz/gcdext.c: Rewrite to call mpn_gcdext.
22637
22638 Fri Jun 14 18:05:29 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22639
22640         * mpn/generic/gcdext.c (s0size): New parameter.
22641         * gmp.h (mpn_gcdext): Update prototype.
22642
22643         * mpn/generic/gcdext.c: Major rewrite.
22644
22645 Mon Jun 10 00:14:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22646
22647         * mpn/generic/dump.c: Add missing `else'.
22648
22649 Fri Jun  7 03:35:12 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22650
22651         * Makefile.in (gmp_toc.html): Pass -expandinfo to texi2html.
22652
22653 Thu Jun  6 19:00:53 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22654
22655         * Version 2.0.2 released.
22656
22657         * install.sh: New file.
22658         * Makefile.in (INSTALL): Use install.sh.
22659         (install-normal): New name for target `install'.
22660         (install): New dummy target.
22661
22662         * mpz/pow_ui.c: Swap tests for (e == 0) and (bsize == 0).
22663         * mpz/ui_pow_ui.c: Swap tests for (e == 0) and (blimb == 0).
22664
22665         * config/mt-linux (AR_FLAGS): New file.
22666         * configure.in: Use config/mt-linux for all linux systems.
22667
22668 Tue Jun  4 03:42:18 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22669
22670         * Version 2.0.1 released.
22671
22672         * mpf/tests/ref.c: Cast result of TMP_ALLOC to the right pointer type.
22673
22674         * extract-double.c: Test _GMP_IEEE_FLOATS with #if, not plain if.
22675
22676         * insert-double.c: Don't #include stdlib.h.
22677
22678         * gmp-impl.h (union ieee_double_extract): Test sparc and __sparc.
22679         Do not test __sparc__.
22680
22681         * mpf/reldiff.c: Change declaration to work around irix5 compiler bug.
22682         * mpq/equal.c: Likewise.
22683
22684         * mpn/generic/gcd.c: Delete spurious comma at end of enumeration.
22685
22686         * mpn/generic/gcdext.c: Add K&R declaration syntax.
22687         * stack-alloc.h: Likewise.
22688         * insert-double.c: Likewise.
22689         * extract-double.c: Likewise.
22690         * mpf/tests/reuse.c: Likewise.
22691         * mpz/tests/reuse.c: Likewise.
22692         * mpf/tests/t-sub.c: Likewise.
22693         * mpf/tests/t-add.c: Likewise.
22694         * mpf/tests/t-muldiv.c: Likewise.
22695         * mpf/tests/t-conv.c: Likewise.
22696         * mpf/tests/ref.c: Likewise.
22697
22698         * mpn/config/t-oldgas: Renamed from t-freebsd.
22699         * mpn/configure.in: Use t-oldgas for freebsd, netbsd, and some linux
22700         configurations.
22701
22702         * mpn/powerpc32/mul_1.s: Really clear cy before entering loop.
22703         * mpn/powerpc32/*.s: Fix power/powerpc syntax issues.
22704
22705         * mpn/config/t-ppc-aix: New file.
22706         * mpn/configure.in: Use t-ppc-aix for powerpc like t-pwr-aix for power.
22707
22708 Wed May 29 02:07:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22709
22710         * gmp.h (mp_bits_per_limb): Change qualifier from `const' to
22711         __gmp_const.
22712
22713         * gmp.h (mpf_init_set_str): Add `const' qualifier for 2nd parameter.
22714         * mpf/iset_str.c: Likewise.
22715
22716 Mon May 27 00:15:58 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22717
22718         * gmp-impl.h: Declare __gmp_extract_double.
22719
22720         * mpz/set_q.c: Delete unused variables.
22721
22722         * gmp.h (mpq_equal): Declare.
22723
22724         * mpf/eq.c: mpf_cmp2 -> mpf_eq.
22725
22726 Fri May 24 03:20:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22727
22728         * mpz/iset_d.c: Don't include <math.h>.
22729
22730         * insert-double.c (__gmp_scale2): New name for scal2.
22731         * mpz/get_d.c: Corresponding change.
22732         * mpf/get_d.c: Likewise.
22733         * mpq/get_d.c: Likewise.
22734         * gmp-impl.h: Declare __gmp_scale2.
22735
22736         * mpn/generic/scan0.c: Clarify comment.
22737
22738         * mpz/set_q.c: New file.
22739         * Makefile.in: Compile it.
22740         * make.bat: Likewise.
22741         * gmp.h: Declare mpz_set_q.
22742
22743         * insert-double.c: New file.
22744         * Makefile.in: Compile it.
22745         * make.bat: Likewise.
22746
22747         * mpz/get_d.c: New file.
22748         * mpz/Makefile.in: Compile it.
22749         * make.bat: Likewise.
22750         * gmp.h: Declare mpz_get_d.
22751
22752         * mpf/get_d.c: New file.
22753         * mpf/Makefile.in: Compile it.
22754         * make.bat: Likewise.
22755         * gmp.h: Declare mpf_get_d.
22756
22757         * make.bat: Compile things in alphabetical order.
22758
22759         * gmp-impl.h (MP_BASE_AS_DOUBLE): New #define.
22760         (LIMBS_PER_DOUBLE): New #define.
22761
22762         * extract-double.c: New file.
22763         * Makefile.in: Compile it.
22764         * make.bat: Likewise.
22765         * mpz/set_d.c: Rewrite to use __gmp_extract_double.
22766         * mpf/set_d.c: Likewise.
22767
22768         * mpn/configure.in: Use t-pwr-aix also for aix 3.2.4 and up.
22769
22770 Wed May 22 02:48:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22771
22772         * gmp-impl.h: Rework code for defining ieee_double_extract.
22773         (IEEE_DOUBLE_BIG_ENDIAN): Macro removed.
22774         (_GMP_IEEE_FLOATS): New macro.
22775         * mpn/vax/gmp-mparam.h: Delete.
22776
22777         * mpn/config/t-pwr-aix: New file.
22778         * mpn/configure.in: Use t-pwr-aix for aix 4 and later.
22779
22780 Mon May 20 16:30:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22781
22782         * gmp.h: In code for setting _GMP_H_HAVE_FILE, test more symbols.
22783
22784         * mpf/tests/t-add.c (oo): Add some `l' printf modifiers.
22785         * mpf/tests/t-sub.c (oo): Likewise.
22786         * mpf/tests/t-conv.c (oo): Likewise.
22787         * mpf/tests/t-sqrt.c (oo): Likewise.
22788
22789         * mpz/tests/t-mul.c (_mpn_mul_classic): Remove unused variables.
22790
22791         * mpn/{pyr,i960,clipper}/*.s: Add missing copyright headers.
22792
22793 Fri May 17 02:24:43 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22794
22795         * mpz/set_d.c: Call _mpz_realloc.
22796
22797         * mpq/set_z.c: New file.
22798         * mpq/Makefile.in: Compile it.
22799         * make.bat: Likewise.
22800         * gmp.h: Declare mpq_set_z.
22801
22802         * mp?/Makefile.in (libmp?.a): Depend on Makefile, not Makefile.in.
22803         * mpf/Makefile.in (test): Delete spurious target.
22804         * mpq/Makefile.in (test): Likewise.
22805
22806         * mpf/out_str.c: Use `e' to separate exponent when base <= 10.
22807
22808         * mpn/configure.in: Treat ultrasparc just like sparc v8,
22809         until 64-bit compilers are ready.
22810
22811         * mpf/set_d.c: Make it work for 64-bit machines.
22812
22813 Thu May 16 20:53:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22814
22815         * gmp-impl.h: Set IEEE_DOUBLE_BIG_ENDIAN to 0 for little-endian
22816         machines.
22817         * mpn/x86/gmp-mparam.h: Delete file.
22818
22819         * configure.in: Treat microsparc like sparc8.
22820
22821         * urandom.h: Test __alpha instead of __alpha__, since the former
22822         is the standard symbol.
22823         * mpn/generic/random2.c: Likewise.
22824         * mpf/random2.c: Likewise.
22825
22826 Tue May 14 13:42:39 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
22827
22828         * mpz/set_f.c: New file.
22829         * mpz/Makefile.in: Compile it.
22830         * gmp.h: Declare mpz_set_f.
22831
22832         * mpf/set_q.c: Simplify expression in rsize == nsize if-then-else arms.
22833
22834 Tue May 14 13:03:07 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
22835
22836         * make.bat: Add all new files.
22837
22838 Sun May 12 22:24:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22839
22840         * mpf/set_z.c: New file.
22841         * mpf/Makefile.in: Compile it.
22842         * gmp.h: Declare mpf_set_z.
22843
22844 Sat May 11 19:26:25 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22845
22846         * gmp.h: Declare mpf_set_q.
22847
22848         * mpf/set_q.c: Compute prec-1 limbs in mpn_divrem call.
22849
22850 Fri May 10 17:37:38 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22851
22852         * mpf/set_q.c: New file.
22853         * mpf/Makefile.in: Compile it.
22854
22855         * config.sub: Recognize sparc8.
22856
22857 Wed May  8 09:19:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22858
22859         * mpf/tests/t-dm2exp.c: New file.
22860
22861         * mpf/tests/t-add.c: Correct header comment.
22862         * mpf/tests/t-sub.c: Likewise.
22863         * mpf/tests/t-sqrt.c: Likewise.
22864
22865         * mpf/div.c: Misc variable name cleanups.
22866         * mpf/div_ui.c: Base more closely on mpf/div.c.
22867         * mpf/ui_div.c: Likewise.
22868
22869         * mpz/tests/Makefile.in (check): Depend on Makefile.
22870         * mpq/tests/Makefile.in (check): Likewise.
22871         * mpf/tests/Makefile.in (check): Likewise.
22872
22873         * mpf/tests/t-muldiv.c: New file.
22874         * mpf/tests/Makefile.in: Compile and run `t-muldiv'.
22875         (t-ref.o): Delete spurious rule.
22876
22877         * mpf/sqrt.c: Properly detect negative input operand.
22878
22879         * mpf/sqrt_ui.c: Delete spurious header comment.
22880         * mpf/sqrt.c: Likewise.
22881         * mpz/sqrt.c: Likewise.
22882
22883         * mpz/tests/reuse.c (main): Read `reps' from command line.
22884
22885         * mpf/tests/reuse.c: New file.
22886         * mpf/tests/Makefile.in: Compile and run `reuse'.
22887
22888         * mpf/mul_ui.c: Disable code for removing low zero limbs.
22889
22890         * mpf/div.c: Fix condition for when vp and qp overlaps.
22891
22892         * mpf/add_ui.c: When sum equals u, copy up to prec+1 limbs.
22893
22894         * mpf/out_str.c: Don't output '\n' after exponent.
22895
22896         * mpf/add_ui.c: New special case for when U is completely cancelled.
22897
22898 Wed Apr 24 05:33:28 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22899
22900         * Version 2.0 released.
22901
22902         * All files: Update FSF's address.
22903
22904         * Makefile.in (gmp_toc.html): New name for gmp.html.
22905         (TAGS): Depend on force.
22906
22907         * mpf/tests/t-conv.c: Pass -base to mpf_set_str.
22908
22909 Sat Apr 20 03:54:06 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22910
22911         * Makefile.in (ps): New target, depend on gmp.ps.
22912
22913 Fri Apr 19 14:03:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22914
22915         * mpf/out_str.c: Print `@' before exponent, not `e'.
22916
22917         * make.bat: Update from Makefiles.
22918
22919 Thu Apr 18 01:22:05 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22920
22921         * mpf/set_str.c: If parameter `base' is negative, expect exponent
22922         to be decimal, otherwise in the same base as the mantissa.
22923
22924 Wed Apr 17 17:28:36 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22925
22926         * mpf/set_dfl_prec.c: Don't return anything.
22927         * gmp.h: Corresponding changes.
22928
22929         * mpf/set_dfl_prec.c: Use `unsigned long int' for bit counts.
22930         * mpf/init2.c: Likewise.
22931         * mpf/get_prc.c: Likewise.
22932         * mpf/set_prc.c: Likewise.
22933         * mpf/set_prc_raw.c: Likewise.
22934         * mpz/popcount.c: Likewise.
22935         * mpz/hamdist.c: Likewise.
22936         * mpz/scan1.c: Likewise.
22937         * mpz/scan0.c: Likewise.
22938         * mpn/generic/popcount.c: Likewise.
22939         * mpn/generic/hamdist.c: Likewise.
22940         * mpn/generic/scan1.c: Likewise.
22941         * mpn/generic/scan0.c: Likewise.
22942         * gmp.h: Likewise.
22943
22944         * mpf/eq.c: New file, based on mpf/diff.c.
22945         * mpf/diff.c: Delete.
22946         * mpf/Makefile.in: Corresponding changes.
22947         * gmp.h: Likewise.
22948
22949         * mpf/reldiff.c: New file.
22950         * mpf/Makefile.in: Compile it.
22951         * gmp.h: Declare mpf_reldiff.
22952
22953         * mpz/iset_d.c: New file.
22954         * mpz/Makefile.in: Compile it.
22955         * gmp.h: Declare mpz_init_set_d.
22956
22957 Tue Apr 16 16:28:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22958
22959         * Makefile.in (gmp.html): Pass -acc to texi2html.
22960
22961 Mon Apr 15 16:20:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22962
22963         * mpf/set_str.c: Switch off code for defaulting the base from the
22964         leading characters.
22965
22966         * gmp.h (mp?_sign): Delete.
22967         (mp?_sgn): New macros.
22968
22969 Fri Apr 12 17:23:33 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22970
22971         * Makefile.in (gmp.dvi): Delete tmp.* at end of rule.
22972
22973 Wed Apr 10 22:52:02 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
22974
22975         * mpf/random2.c: Change of `exp' param, mp_size_t => mp_exp_t.
22976         * gmp.h: Corresponding change.
22977
22978         * gmp.h (mp_bits_per_limb): Make it const.
22979
22980 Sat Mar 30 01:20:23 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
22981
22982         * configure.in: Re-enable recognition of with_gcc.
22983
22984         * mpf/Makefile.in (.c.o): Pass XCFLAGS.
22985         * mpn/Makefile.in (.c.o): Likewise.
22986         * mpz/Makefile.in (.c.o): Likewise.
22987         * mpq/Makefile.in (.c.o): Likewise.
22988         * mpbsd/Makefile.in (.c.o): Likewise.
22989         * mpf/tests/Makefile.in (.c.o): Likewise.
22990         * mpz/tests/Makefile.in (.c.o): Likewise.
22991         * mpq/tests/Makefile.in (.c.o): Likewise.
22992
22993         * Makefile.in (XCFLAGS): Default to empty.
22994         (FLAGS_TO_PASS): Pass on XCFLAGS.
22995         (.c.o): Pass XCFLAGS.
22996
22997         * config/mt-m88110 (XCFLAGS): Define instead of CC.
22998         * config/mt-sprc8-gcc (XCFLAGS): Likewise.
22999         * config/mt-supspc-gcc (XCFLAGS): Likewise.
23000
23001         * configure: Don't default CC to "gcc -O2" is -with-gcc=no was
23002         specified.
23003
23004 Mon Mar 25 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23005
23006         * urandom.h: Test for __SVR4 in addition to __svr4__.
23007
23008         * mp_bpl.c (mp_bits_per_limb): Declare as `const'.
23009
23010         * Makefile.in (CFLAGS): `-O2' => `-O'.
23011         * mpn/Makefile.in (CFLAGS): Likewise.
23012
23013         * gmp-impl.h: Get rid of obsolete field access macros.
23014
23015         * mpn/mp_bases.c (__mp_bases): 1e39 => 1e38 to work around Solaris
23016         cc compiler bug.
23017
23018         * gmp.h (__MPN): Make it work also for non-ANSI compilers.
23019
23020 Thu Mar 21 01:07:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23021
23022         * mpf/sub.c: New special case for ediff <= 1 before generic code.
23023         Simplify generic code for ediff == 0.
23024         Rename uexp => exp.
23025
23026 Mon Mar 11 18:24:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23027
23028         * mpf/tests/*.c: Use ref_mpf_sub for error calculation.
23029         * mpf/tests/Makefile.in: Link ref.o to all executables.
23030
23031         * mpf/tests/t-sub.c: Make u = v + 1 with 50% probability.
23032
23033 Sun Mar 10 21:03:17 1996  Torbjorn Granlund  (tege@tiny.matematik.su.se)
23034
23035         * mpf/get_str.c: In digit development loop for fractions, change
23036         loop condition from `<' to `<='.
23037
23038 Thu Mar  7 04:58:11 1996  Torbjorn Granlund  <tege@tiny.matematik.su.se>
23039
23040         * mpn/mp_bases.c (__mp_bases): 1e100 => 1e39 to avoid overflow warning.
23041
23042 Wed Mar  6 01:10:42 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23043
23044         * mpf/tests/t-sqrt.c: New file.
23045         * mpf/tests/Makefile.in: Corresponding changes.
23046
23047         * mpf/sqrt.c: Special case for square root of zero.
23048
23049         * mpq/add.c: Clean up variable names.
23050         * mpq/sub.c: Update from mpq/add.c.
23051
23052         * mpz/divexact.c: abs => ABS.
23053         * mpz/gcd.c: Likewise.  Rewrite final fixup code, to decrease
23054         allocation.  Misc cleanups.
23055
23056 Tue Mar  5 22:24:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
23057
23058         * mpn/configure.in: Recognize linuxoldld as a synonym for linuxaout.
23059
23060         * gmp.h (mpn_add, mpn_add_1, mpn_sub, mpn_sub_1): Add prototypes.
23061
23062         * mpn/configure.in: Use t-freebsd also for netbsd.
23063
23064 Mon Mar  4 15:13:28 1996  Torbjorn Granlund  <tege@matematik.su.se>
23065
23066         * mpq/Makefile.in (cmp.o): Depend on longlong.h.
23067
23068         * mpq/equal.c: New file.
23069         * mpq/Makefile.in: Corresponding changes.
23070
23071         * mpf/tests/t-add.c: New file.
23072         * mpf/tests/t-sub.c: Renamed from t-addsub.c.
23073         * mpf/tests/ref.c: New file.
23074         * mpf/tests/Makefile.in: Corresponding changes.
23075
23076         * gmp-impl.h (SIZ, ABSIZ, PTR, EXP, PREC, ALLOC): New #defines.
23077
23078 Sun Mar  3 07:45:46 1996  Torbjorn Granlund  <tege@matematik.su.se>
23079
23080         * mpf/set_str.c: In exponentiation code, allocate 3 extra
23081         limbs, not just 2.
23082
23083         * mpf/get_str.c: Allocate sufficient space for tstr.
23084         When calculating exp_in_base, round result down.
23085
23086         * mpf/tests/t-conv.c: New file.
23087         * mpf/tests/Makefile.in: Corresponding changes.
23088
23089         * mp_bpl.c: New file.
23090         * gmp.h: Declare it.
23091         * Makefile.in: Corresponding changes.
23092
23093 Sat Mar  2 06:27:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
23094
23095         * mpf/set_prc_raw.c: New file.
23096         * mpf/set_prc.c: Renamed from set_prec.c.
23097         * mpf/get_prc.c: New file.
23098         * mpf/Makefile.in: Corresponding changes.
23099         * gmp.h: Declare new functions.
23100
23101         * mpn/generic/gcdext.c: Add copyright header.
23102
23103 Fri Mar  1 01:22:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
23104
23105         * mpn/configure.in: For ppc601, search "power" before "powerpc32".
23106
23107         * mp?/Makefile.in (AR_FLAGS): New variable.
23108         (libmp?.a): Use it.
23109
23110         * make.bat: New file.
23111         * mpn/msdos: New directory.
23112         * mpn/msdos/asm-syntax.h: New file.
23113
23114         * mpn/Makefile.in (distclean maintainer-clean): Delete asm-syntax.h.
23115
23116         * config.sub: Recognize [ctj]90-cray.
23117
23118         * mpn/configure.in: Recognize [ctj]90-cray-unicos*.
23119
23120         * mpn/generic/gcdext.c: Don't use alloca directly, use TMP_* macros.
23121
23122         * mpn/generic/gcd.c: Split increment from use of USIZE to avoid
23123         undefined behaviour.
23124
23125 Thu Feb 29 04:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
23126
23127         * Makefile.in (install-info-files): Update for new install-info
23128         behaviour.
23129
23130         * mpn/power/add_n.s: Rewrite.
23131         * mpn/power/sub_n.s: Rewrite.
23132
23133 Wed Feb 28 01:34:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
23134
23135         * mpz/pow_ui.c: Compute allocation more aggressively for small bases.
23136         * mpz/ui_pow_ui.c: Likewise.
23137
23138         * mpn/mp_bases.c (__mp_bases): Put huge value in 2nd field for index 1.
23139
23140         * mpn/generic/sqrtrem.c: sizeof (mp_limb_t) => BYTES_PER_MP_LIMB.
23141         * mpn/generic/gcd.c: Likewise.
23142         (SIGN_BIT): Compute differently.
23143
23144 Mon Feb 26 00:07:36 1996  Torbjorn Granlund  <tege@matematik.su.se>
23145
23146         * All files: mp_limb => mp_limb_t, mp_limb_signed => mp_limb_signed_t.
23147
23148         * Makefile.in (install, install-bsdmp, install-info-files): Depend
23149         on installdirs.  chmod all installed files.
23150
23151 Sun Feb 25 01:47:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
23152
23153         * mpbsd/configure.in: Delete debugging code.
23154
23155         * All Makefile.in: Update clean targets.
23156
23157         * Makefile.in (AR_FLAGS): New variable.
23158         (libgmp.a): Use it.
23159         (libmp.a): Likewise.
23160
23161         * VERSION: Delete file.
23162
23163         * Makefile.in (installdirs): New target.
23164         * mkinstalldirs: New file (from the texinfo package).
23165
23166         * Makefile.in (INSTALL, INSTALL_DATA, INSTALL_PROGRAM): New variables.
23167         (MAKEINFO, MAKEINFOFLAGS, TEXI2DVI): New variables.
23168         (install-info): New target.
23169         (install, install-bsdmp): Depend on install-info.
23170         ($(srcdir)/gmp.info): Changed from plain gmp.info; put info files
23171         into source directory.
23172         (distclean, mostlyclean): New targets.
23173         (maintainer-clean): New name for realclean.
23174         (uninstall): New target.
23175         (TAGS): New target.
23176         (info, dvi): New targets.
23177         (.PHONY): Assign.
23178
23179         * Makefile.in (install, install-bsdmp): Use INSTALL_DATA.
23180
23181         * mp{n,z,f,bsd}/move-if-change: Delete.
23182
23183         * mpbsd/Makefile.in (stamp-stddefh): Delete target.
23184
23185         * Makefile.in (.c.o): Pass CFLAGS last.
23186         * mpbsd/Makefile.in (.c.o): Likewise.
23187         * mpf/Makefile.in (.c.o): Likewise.
23188         * mpq/Makefile.in (.c.o): Likewise.
23189         * mpz/Makefile.in (.c.o): Likewise.
23190         * mpn/Makefile.in (.c.o): Likewise.
23191         (.S.o): Likewise.
23192
23193         * memory.c: Change allocation error message.
23194
23195         * Makefile.in (install): Prefix gmp.h with $(srcdir).
23196         (install-bsdmp): Prefix mp.h with $(srcdir).
23197
23198         * mp{n,z,f,bsd}/{configure,config.sub}: Delete.
23199
23200         * Makefile.in (gmp.dvi): Set TEXINPUTS also for 2nd tex invocation
23201         (install targets): Install gmp.info-N.
23202
23203 Sat Feb 24 03:36:52 1996  Torbjorn Granlund  <tege@matematik.su.se>
23204
23205         * mpf/get_str.c: Fix typo.
23206
23207         * mpz/legendre.c: Clarify expression with extra parens.
23208
23209         * version.c (gmp_version): Not static.
23210
23211         * mpf/iset_str.c: Properly return error code.
23212
23213         * mpf/add.c: Delete unused variables.
23214         * mpf/inp_str.c: Likewise.
23215         * mpq/get_d.c: Likewise.
23216
23217         * mpn/generic/dump.c: #include <stdio.h>.
23218         * mpf/dump.c: Likewise.
23219         * mpf/set_str.c: #include <ctype.h>.
23220         (strtol): Declare.
23221
23222         * gmp.h: mpn_sqrt => mpn_sqrtrem.
23223
23224         * Makefile.in (clean, realclean): Clean in mpbsd.
23225         (check): Test in mpf.
23226
23227         * mpf/Makefile.in (clean): Clean in tests.
23228         * mpq/Makefile.in (clean): Clean in tests.
23229
23230         * mpf/tests/Makefile.in: New file.
23231         * mpf/tests/configure.in: New file.
23232         * mpf/tests/t-addsub.c: New file.
23233
23234         * mpf/sub_ui.c: Simply call mpf_sub for now.
23235
23236         * mpf/sub.c: Increase prec by 1.
23237         * mpf/ui_sub.c: Likewise.
23238
23239 Fri Feb 23 00:59:54 1996  Torbjorn Granlund  <tege@matematik.su.se>
23240
23241         * mpf/ui_sub.c: Fix typos.
23242
23243         * mpf/get_str.c: When allocating space for tmp, allow for an extra
23244         limb.  In code for fraction conversion, add special case for bases
23245         that are a power of 2.
23246
23247         * mpf/out_str.c: Output leading "0.".
23248         Default base to 10, before computing string allocation.
23249
23250         * mpf/get_str.c: Make variables for string size have type size_t.
23251         * gmp.h: Corresponding change.
23252
23253         * mpf/random2.c: Allow creation of prec+1 large mantissas.
23254
23255         * mpf/add_ui.c: Don't abort if u < 0; special case for u <= 0.
23256         Fix typo in MPN_COPY offset.
23257         * mpf/sub_ui.c: Analogous changes.
23258
23259         * mpf/set_prec.c: Rewrite.
23260
23261         * mpf/init2.c: Compute precision as in set_prec.c.
23262
23263         * mpf/div_2exp.c: Special case for u == 0.
23264         * mpf/mul_2exp.c: Likewise.  Write r->_mp_size always.
23265
23266         * mpf/sqrt_ui.c: mpn_sqrt => mpn_sqrtrem.
23267         * mpf/sqrt.c: Likewise.  When computing new exponent, round quotient
23268         towards -infinity.
23269
23270         * mpf/add.c: Fix typos.
23271         * mpf/sub.c: Fix typos.
23272
23273 Thu Feb 22 00:24:48 1996  Torbjorn Granlund  <tege@matematik.su.se>
23274
23275         * mpz/Makefile.in (stamp-stddefh): Delete target.
23276         (test): Delete target.
23277         * Makefile.in (stamp-stddefh): Delete target.
23278         (cre-stddefh.o): Delete target.
23279         (gmp.dvi): Set TEXINPUTS before invoking tex.
23280
23281         * cre-stddefh.c: Delete.
23282
23283         * mpz/sqrt.c: Fix typo.
23284
23285         * mpz/powm.c: Special case for mod == 0.
23286         * mpz/powm_ui.c: Likewise.
23287
23288         * mpz/get_si.c: Handle -0x80000000 correctly.
23289
23290         * mpz/inp_str.c: Now returns size_t.
23291         Make it return number of bytes read or error indication.
23292         * mpf/inp_str.c: Likewise.
23293
23294         * mpz/out_raw.c: Replace by mpz/out_binary.c, with modifications.
23295         * mpz/inp_raw.c: Rewrite, using mpz/inp_binary as a base.
23296         * mpz/inp_binary.c: Delete.
23297
23298         * mpn/Makefile.in (XCFLAGS): Remove variable.
23299         (.c.o): Don't pass XCFLAGS.
23300         (SFLAGS): Set to nothing.
23301         (.S.o): Pass SFLAGS, not XCFLAGS.
23302
23303         * mpn/config/t-freebsd (SFLAGS): New name for XCFLAGS.
23304
23305         * mpf/out_str.c: Make return number of bytes written or error
23306         indication.
23307         * mpz/out_str.c: Likewise.
23308         * gmp.h: Corresponding changes.
23309
23310         * gmp.h (__mpz_struct): mp_size_t => int.
23311         (__mpq_struct): Likewise.
23312         (__mpf_struct): Likewise.
23313         (mp_size_t): int => long int.
23314
23315         * mpn/cray: New directory.
23316         * mpn/cray/gmp-mparam.h: New file.
23317         * mpn/configure.in: Recognize cray variants.
23318
23319         * Makefile.in: Set defaults for prefix, libdir, etc.
23320         (install): New target.
23321         (install-bsdmp): New target.
23322         (gmp.html): New target.
23323
23324         * stack-alloc.c (__tmp_alloc): Cast void ptrs to char * in comparison.
23325
23326 Wed Feb 21 04:35:02 1996  Torbjorn Granlund  <tege@matematik.su.se>
23327
23328         * gmp.h: Sort mpn declarations.
23329         (mpn_gcdext): Add declaration.
23330
23331         * mpn/generic/divrem_1.c: New file.
23332         * mpn/Makefile.in (divrem_1.o): New rule.
23333         * configure.in (functions): Add divrem_1.
23334
23335         * mpn/generic/divmod.c: Delete file.
23336         * mpn/configure.in (functions): Delete divmod.
23337         * Makefile.in (divmod.o): Delete rule.
23338         * gmp.h (mpn_divmod): New #define.
23339
23340         * gmp.h (mpn_next_bit_set): Delete spurious declaration.
23341
23342         * mpn/generic/divrem.c (default case): In code assigning
23343         most_significant_q_limb, move reassignment of n0 into if statement.
23344
23345         * gmp.h (mpf_inp_str): Fix typo.
23346         (mpf_out_str): Make prototype match reality.
23347         * mpf/inp_str.c: New file.
23348         * mpf/out_str.c: New file.
23349         * mpf/Makefile.in: Compile new files.
23350
23351         * mpn/Makefile.in (dump.o): Fix dependency path.
23352         (inlines.o): Likewise.
23353
23354         * mpn/configure.in: Make m68060 be the same as m68000.  Clean up
23355         m68k configs.
23356
23357 Tue Feb 20 01:35:11 1996  Torbjorn Granlund  <tege@matematik.su.se>
23358
23359         * mpn/generic/sqrtrem.c: Renamed from sqrt.
23360         * mpn/configure.in (functions): Corresponding change.
23361         * mpn/Makefile.in: Likewise.
23362         * mpz/sqrtrem.c: Likewise.
23363         * mpz/sqrt.c: Likewise.
23364         * mpn/generic/perfsqr.c: Likewise.
23365
23366         * Makefile.in (clean): Also remove libmp.a.
23367         Don't compile cre-conv-tab.c or mp_bases.c.
23368         cre-conv-tab.c: Delete file.
23369         (gmp.ps): New rule.
23370
23371         * mpn/mp_bases.c: New file.
23372         * mpn/Makefile.in: Compile mp_bases.c.
23373
23374         * mpz/set_str.c: Skip initial whitespace.
23375         * mpf/set_str.c: Likewise.
23376         * mpbsd/xtom.c: Likewise.
23377
23378         * gmp.h: Add missing mpz declarations.
23379         Delete all formal parameter names from declarations.
23380
23381         * mpn/Makefile.in: Add dependencies for .c files.
23382
23383         * Makefile.in (check): Write recursive make calls separately, not as
23384         a loop.
23385         (FLAGS_TO_PASS): New variable.  Use it for most recursive makes.
23386
23387 Mon Feb 19 01:02:20 1996  Torbjorn Granlund  <tege@matematik.su.se>
23388
23389         * mpn/Makefile.in (.S.o): Pipe cpp output to grep in order to delete
23390         lines starting with #.
23391         (CPP): Set to $(CC) -E to avoid gcc dependency.
23392
23393         * mpn/m68k/syntax.h (moveql): Define to moveq for MIT_SYNTAX.
23394
23395         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: Fix typo in s1_ptr alignment
23396         code.
23397         * mpn/hppa/hppa1_1/pa7100/submul_1.S: Likewise.
23398
23399         * gmp.h: Fix typos in #defines of recently added mpn functions.
23400
23401         * mpz/inp_str.c: Skip all whitespace, not just plain space.
23402         * mpbsd/min.c: Likewise.
23403
23404         * mpn/configure.in (functions): Add gcdext.
23405         * mpn/generic/gcdext.c: New file.
23406
23407         * mpz/legendre.c: mpz_div_2exp => mpz_tdiv_q_2exp.
23408
23409         * gmp.h: Surround mpn declarations with extern "C" { ... }.
23410
23411         * Makefile.in (check): New target.
23412
23413         * mpq/get_d.c: Update comments.  Use rsize instead of dsize + N_QLIMBS
23414         when possible.  Add special case for nsize == 0.
23415
23416         * gmp.h (mpq_get_d): Add declaration.
23417         (mpq_canonicalize): Likewise.
23418         (mpq_cmp_ui): Likewise.
23419         (mpf_diff): Likewise.
23420         (mpf_ui_sub): Likewise.
23421         (mpf_set_prec): Likewise.
23422         (mpf_random2): Likewise.
23423
23424         * gmp.h (mpz_cmp_ui): New #define.
23425         (mpz_cmp_si): New #define.
23426         (mpq_cmp_ui): New #define.
23427         (mpz_sign): New #define.
23428         (mpq_sign): New #define.
23429         (mpf_sign): New #define.
23430         (mpq_numref): New #define.
23431         (mpq_denref): New #define.
23432
23433         * mpq/set_z.c: File deleted.
23434         * mpq/Makefile.in: Corresponding changes.
23435
23436 Sun Feb 18 01:34:47 1996  Torbjorn Granlund  <tege@matematik.su.se>
23437
23438         * mpbsd/sdiv.c: Use _mp_realloc, not _mpz_realloc.
23439
23440         * mpz/inp_binary.c: Default stream to stdin.
23441         * mpz/inp_str.c: Likewise.
23442         * mpz/inp_raw.c: Likewise.
23443         * mpz/out_binary.c: Default stream to stdout.
23444         * mpz/out_raw.c: Likewise.
23445         * mpz/out_str.c: Likewise.
23446
23447         * mpbsd/realloc.c: New file.
23448         * mpbsd/Makefile.in: Corresponding changes.
23449
23450         * mpbsd/min.c: Rewrite (base on mpz/inp_str.c).
23451         * mpbsd/mtox.c: Rewrite (base on mpz/get_str.c).
23452
23453         * mpbsd/mout.c: Rewrite (base on mpz/out_str) but make it output
23454         spaces in each 10th position.
23455         * mpbsd/xtom.c: Rewrite (base on mpz/set_str).
23456
23457         * mpq/tests/Makefile.in (st-cmp): New file.
23458         * mpq/tests/configure.in (srcname): New file.
23459
23460         * mpz/tests/configure.in (srcname): Fix typo.
23461
23462         * mpq/cmp.c: Add check using number of significant bits, to avoid
23463         general multiplication.
23464
23465 Sat Feb 17 11:58:30 1996  Torbjorn Granlund  <tege@matematik.su.se>
23466
23467         * mpq/cmp_ui.c: Store cy_limb after the mpn_mul_1 calls.
23468
23469         * mpq/tests: New directory.
23470         * mpq/tests/t-cmp.c: New file.
23471         * mpq/tests/t-cmp_ui.c: New file.
23472
23473         * mpz/tests/dive.c (main): Generate zero numerator.
23474         (get_random_size) : Delete.
23475
23476         * mpz/divexact.c: Add special case for 0/x.
23477
23478         * gmp.h (mpz_mod): Add declaration.
23479
23480 Fri Feb 16 18:18:39 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
23481
23482         * mpn/m68k/*: Rewrite code not to use the INSN macros.
23483         (L): New macro to properly prefix local labels for ELF.
23484
23485 Fri Feb 16 00:20:56 1996  Torbjorn Granlund  <tege@matematik.su.se>
23486
23487         * gmp-impl.h (ieee_double_extract): Use plain `unsigned int' for
23488         fields.
23489         * mpn/generic/inlines.c (_FORCE_INLINES): New #define.  Delete
23490         conditional __GNUC__.
23491         * gmp.h (mpn_add, mpn_sub, mpn_add_1, mpn_sub_1):
23492         Only define these if __GNUC__ || _FORCE_INLINES.
23493         * mpf/random2.c: Add missing parameter in non-ANSI header.
23494         * mpn/generic/gcd.c (SIGN_BIT): Do as #define to work around bug
23495         in AIX compilers.
23496         * mpq/get_d.c: #define N_QLIMBS.
23497         * mpz/divexact.c: Obscure division by 0 to silent compiler warnings.
23498         * stack-alloc.c: Cast void* pointer to char* before doing arithmetic
23499         on it.
23500
23501         * Makefile.in (mpbsd/libmpbsd.a): New rule.
23502         * configure.in (configdirs): Add mpbsd.
23503
23504         * gmp.h: Add declarations for a few missing mpn functions.
23505
23506         * Makefile.in (libmp.a): New rule.
23507
23508         * mpbsd/mdiv.c: #include "dmincl.c", not "mpz_dmincl.c"
23509         * gmp.h: Move #define of __GNU_MP__ into the `#if __GNU_MP__' block.
23510         * mp.h: Likewise.  Update typedefs from gmp.h.
23511         * mpbsd/configure.in: New file.
23512         * mpbsd/Makefile.in: New file.
23513         * mpbsd/configure: Link to master configure.
23514         * mpbsd/config.sub: Link to master config.sub.
23515
23516         * Makefile.in: Set RANLIB_TEST.
23517         * (libgmp.a): Use it.
23518         * (libgmp.a): Do ranlib before moving the libgmp.a to the build
23519         directory.
23520         * mp?/Makefile.in: Don't use or set RANLIB.
23521
23522 Thu Feb 15 16:38:41 1996  Torbjorn Granlund  <tege@matematik.su.se>
23523
23524         * mpz/add_ui.c: MP_INT => mpz_t.
23525         * mpz/cmp_ui.c: Likewise.
23526         * mpz/fac_ui.c: Likewise.
23527         * mpz/inp_binary.c: Likewise.
23528         * mpz/inp_raw.c: Likewise.
23529         * mpz/legendre.c: Likewise.
23530         * mpz/jacobi.c: Likewise.
23531         * mpz/out_binary.c: Likewise.
23532         * mpz/out_raw.c: Likewise.
23533         * mpz/random2.c: Likewise.
23534         * mpz/random.c: Likewise.
23535         * mpz/realloc.c: Likewise.
23536
23537         * mpz/legendre.c: __mpz_2factor(X) => mpz_scan1(X,0),
23538         __mpz_odd_less1_2factor => mpz_scan1(X,1).
23539         * mpz/ntsup.c: File deleted.
23540         * mpz/Makefile.in: Corresponding changes.
23541
23542         * mpz/pprime_p: Use mpz_scan1 to avoid looping.
23543
23544         * mpz/fac_ui.c: Type of `k' and `p' is `unsigned long'.
23545         * mpz/pprime_p.c: Pass long to *_ui functions.
23546         * mpz/gcdext.c: Likewise.
23547         * mpz/fdiv_r_2exp.c: Likewise.
23548         * mpz/fac_ui.c: Likewise.
23549
23550         * mpz/powm.c: Don't use mpn_rshift when mod_shift_cnt is 0.
23551
23552         * mpz/tests/Makefile.in (st-sqrtrem): Fix typo.
23553
23554         * mpz/cmp_ui.c: #undef mpz_cmp_ui.
23555         * mpz/cmp_si.c: #undef mpz_cmp_si.
23556         * gmp.h (mpz_cmp_ui): New #define.
23557         (mpz_cmp_si): New #define.
23558
23559 Wed Feb 14 22:11:24 1996  Torbjorn Granlund  <tege@matematik.su.se>
23560
23561         * gmp.h: Test __cplusplus in addition to __STDC__.
23562         * gmp-impl.h: Likewise.
23563
23564         * gmp.h: Surround declarations with extern "C" { ... }.
23565
23566 Tue Feb 13 15:20:45 1996  Torbjorn Granlund  <tege@matematik.su.se>
23567
23568         * mpz/fdiv_r_2exp.c: Use MPN_NORMALIZE.
23569         * mpz/tdiv_r_2exp.c: Likewise.
23570
23571         * mpz/fdiv_r_2exp.c: New file.
23572         * mpz/fdiv_q_2exp.c: New file.
23573         * mpz/tdiv_r_2exp.c: Renamed from mpz/mod_2exp.c.
23574         * mpz/tdiv_q_2exp.c: Renamed from mpz/div_2exp.c
23575         * mpz/Makefile.in: Corresponding changes.
23576
23577         * mpz/scan0.c,scan1.c: New files.
23578         * mpz/Makefile.in: Compile them.
23579
23580         * gmp.h (mpn_normal_size): Delete.
23581
23582         * config.guess: Update from Cygnus version.
23583
23584         * mpn/m68k/rshift.S: Use INSN2 macro for lea instructions.
23585         * mpn/m68k/lshift.S: Likewise.
23586
23587         * mpn/configure.in: Fix configuration for plain 68000.
23588
23589 Mon Feb 12 01:06:06 1996  Torbjorn Granlund  <tege@matematik.su.se>
23590
23591         * mpz/tests/t-powm.c: Generate negative BASE operand.
23592
23593         * mpz/powm.c: Make result always positive.
23594
23595 Sun Feb 11 01:44:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23596
23597         * mpz/tests/*.c: Add t- prefix.
23598         * mpz/tests/Makefile.in: Corresponding changes.
23599         * mpz/tests/configure.in: Update srctrigger.
23600
23601         * mpz/tests/gcd.c: Generate negative operands.
23602         * mpz/tests/gcd2.c: Likewise.
23603
23604         * mpz/gcdext.c: At end, if G is negative, negate all G, S, and T.
23605
23606 Thu Feb  8 17:16:12 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
23607
23608         * mp{z,n}/gcd.c: Change mpn_gcd interface.
23609         * gmp.h: Ditto.
23610         * gmp.texi: update documentation.
23611
23612 Mon Feb  7 23:58:43 1996  Andreas Schwab  <schwab@informatik.uni-dortmund.de>
23613
23614         * mpn/m68k/{lshift,rshift}.S: New files.
23615         * mpn/m68k/syntax.h: New ELF_SYNTAX macros.
23616         (MEM_INDX, R, PROLOG, EPILOG): New macros.
23617         * mpn/m68k/*.S: Use R macro with register name.  Use PROLOG and EPILOG
23618         macros.  Rename `size' to `s_size' or s1_size to avoid clash with ELF
23619         .size directive.
23620         * mpn/configure.in: New target m68k-*-linux*.
23621
23622 Wed Feb  7 07:41:31 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23623
23624         * Makefile.in (cre-conv-tab): Workaround for SunOS make.
23625
23626         * mpz/tests/reuse.c: New file.
23627         * mpz/tests/Makefile.in: Handle reuse.c.
23628
23629 Tue Feb  6 11:56:24 UTC 1996 Ken Weber <kweber@mat.ufrgs.br>
23630
23631         * mpz/gcd.c: Fix g->size when one op is 0 and g == other op.
23632
23633 Tue Feb  6 01:36:39 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23634
23635         * gmp.h (mpz_divexact): Delete parameter names.
23636         (mpz_lcm): Delete spurious declaration.
23637
23638         * mpz/dmincl.c: Fix typo.
23639
23640 Mon Feb  5 01:11:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23641
23642         * mpn/generic/gcd.c (gcd_2): Declare consistently.
23643
23644         * mpz/tdiv_q.c: Optimize division by a single-limb divisor.
23645         * mpz/dmincl.c: Likewise.
23646
23647         * mpz/add.c: Use MPN_NORMALIZE instead of mpn_normal_size.
23648         * mpz/sub.c: Likewise.
23649         * mpn/generic/sqrt.c: Likewise.
23650
23651         * mpn/tests/{add_n,sub_n,lshift,rshift}.c: Put garbage in the
23652         destination arrays.
23653
23654 Fri Feb  2 02:21:27 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23655
23656         * mpz/{jacobi.c,legendre.c,ntsup.c,invert.c}: New files.
23657         * mpz/Makefile.in: Compile them.
23658
23659         * mpn/Makefile.in (INCLUDES): Don't search in `generic'.
23660
23661 Thu Feb  1 02:15:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23662
23663         Change from Ken Weber:
23664         * mpz/divexact.c: Make it work when quot is identical to either input.
23665
23666         * mpf/ui_sub.c: New file.
23667         * mpf/Makefile.in: Compile it.
23668
23669         * gmp-impl.h (MPZ_TMP_INIT): alloca -> TMP_ALLOC.
23670         * mpz/{c,f}div_{q,qr,r}.c: Use TMP_DECL/TMP_MARK/TMP_FREE since
23671         these use MPZ_TMP_INIT.
23672         * mpz/mod.c: Likewise.
23673         * mpq/{add,sub}.c: Likewise.
23674         * mpq/canonicalize: Likewise.
23675
23676         * mpq/{add,sub,mul,div}.c: Use mpz_divexact. MP_INT -> mpz_t.
23677         * mpq/canonicalize.c: Likewise.
23678
23679 Wed Jan 31 01:45:00 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23680
23681         * mpn/generic/gcd.c: Misc changes from Ken.
23682
23683         * mpz/tests/gcd2.c: New file.
23684         * mpz/tests/Makefile.in: Handle gcd2.c.
23685
23686         * mpn/generic/gcd.c (mpn_gcd): When GCD == ORIG_V, return vsize,
23687         not orig_vsize.  Fix parameter declaration.
23688
23689         * mpz/mod_ui.c: Delete file.
23690         * mpz/Makefile.in: Don't try to compile mod_ui.
23691
23692         * mpz/cdiv_*_ui.c): Make them work right.
23693         * gmp.h: Declare cdiv*.
23694
23695 Tue Jan 30 02:22:56 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23696
23697         * mpz/{cdiv_q.c,cdiv_q_ui.c,cdiv_qr.c,cdiv_qr_ui.c,cdiv_r.c,
23698         cdiv_r_ui.c,cdiv_ui.c}: New files.
23699         * mpz/Makefile.in: Compile them.
23700
23701         * All files: Make file permissions right.
23702
23703         Changes from Ken Weber:
23704         * mpn/generic/accelgcd.c: Delete.
23705         * mpn/generic/bingcd.c: Delete.
23706         * mpn/generic/numbits.c: Delete.
23707         * mpn/generic/gcd.c: New file.
23708         * mpn/configure.in (functions): Update accordingly.
23709         * mpz/divexact.c: New file.
23710         * mpz/Makefile.in: Compile divexact.c.
23711         * mpz/gcd.c: Rewrite to accommodate for gcd changes in mpn.
23712         * gmp.h: declare new functions, delete obsolete declarations.
23713         * mpz/tests/dive.c: New file.
23714         * mpz/tests/Makefile.in: Handle dive.c.
23715
23716 Mon Jan 29 03:53:24 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23717
23718         * mpz/random.c: Handle negative SIZE parameter.
23719
23720         * mpz/tests/tdiv(_ui).c: New name for tst-dm(_ui).c.
23721         * mpz/tests/tst-mdm(_ui).c: Delete.
23722         * mpz/tests/fdiv(_ui).c: New test based in tst-mdm(_ui).
23723         * mpz/tests/*.c: Get rid of tst- prefix for DOS 8+3 naming.
23724         * mpz/tests/Makefile.in: Corresponding changes.
23725         * mpz/tests/configure.in: Update srctrigger.
23726
23727         * mpn/generic/divmod.c: Update from divrem.
23728         * mpn/generic/divrem.c: Misc cleanups.
23729
23730 Sun Jan 28 03:25:08 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23731
23732         * All files: Use new TMP_ALLOC interface.
23733
23734         * mpz/powm_ui.c: Make Jan 25 changes to powm.c also here.
23735
23736         * mpz/tests/powm_ui.c: New file.
23737         * mpz/tests/Makefile.in: Add rules for tst-powm and tst-powm_ui.
23738
23739         * Makefile.in: Update dependency list.
23740         * mpf/Makefile.in: Likewise.
23741         * mpz/Makefile.in: Likewise.
23742         * mpq/Makefile.in: Likewise.
23743         * Makefile.in: Set RANLIB simply to ranlib, and allow configure
23744         to override it.
23745
23746         * mpz/Makefile.in (conf): Delete spurious target.
23747         (mp_bases.c): Delete.
23748         (cre-conv-tab rules): Delete.
23749
23750         * Makefile.in (cre-conv-tab): Greatly simplify.
23751
23752 Sat Jan 27 13:38:15 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23753
23754         * stack-alloc.c: New file.
23755         * stack-alloc.h: New file.
23756
23757         * gmp.h (__gmp_inline): Define using __inline__.
23758
23759 Thu Jan 25 00:28:37 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23760
23761         * mpn/generic/scan0.c: New file.
23762         * mpn/generic/scan1.c: Renamed from next_bit.c.
23763         * mpn/configure.in (functions): Include scan0 and scan1.
23764
23765         * mpn/m68k/*: #include sysdep.h.  Use C_GLOBAL_NAME.
23766
23767         * configure: Update from Cygnus version.
23768         * config.guess: Likewise.
23769         * config.sub: Likewise.
23770         * configure: Pass --nfp to recursive configures.
23771
23772         * mpz/tests/tst-*.c: Adjust SIZE and reps.
23773
23774         * mpz/powm.c: Move esize==0 test earlier.
23775         In final reduction of rp,rsize, don't call mpn_divmod unless
23776         reduction is really needed.
23777
23778         * mpz/tests/tst-powm.c: Fix thinko in checking code.
23779
23780         * All files: Get rid of `__' prefix from mpn_* calls and declarations.
23781         * gmp.h: #define __MPN.
23782         * gmp.h: Use __MPN in #defines for mpn calls.
23783
23784         * mpn/generic/mul_n.c: Prepend `i' to internal routines.
23785         * gmp-impl.h: Add #defines using __MPN for those internal routines.
23786
23787         * mpn/generic/sqrt.c: Change call to mpn_mul to mpn_mul_n.
23788
23789 Wed Jan 24 13:28:19 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23790
23791         * mpn/sparc32/udiv_fp.S: New name for udiv_qrnnd.S.
23792         * mpn/sparc32/udiv_nfp.S: New name for v8/udiv_qrnnd.S.
23793         * mpn/sparc32/v8/supersparc: New directory.
23794         * mpn/sparc32/v8/supersparc/udiv.S: New file.
23795
23796 Tue Jan 23 01:10:11 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23797
23798         This major contribution is from Ken Weber:
23799         * mpn/generic/accelgcd.c: New file.
23800         * mpn/generic/bdivmod.c: New file.
23801         * mpn/generic/bingcd.c: New file.
23802         * mpn/generic/gcd_1.c: Rewrite.
23803         * mpn/generic/numbits.c: New file (to go away soon).
23804         * mpz/gcd.c: Rewrite.
23805         * mpz/tests/tst-gcd.c (SIZE): Now 128.
23806         * gmp.h: Declare new functions.
23807         * mpn/configure.in (functions): List new files.
23808         * gmp-impl.h (MPN_SWAP): Delete.
23809         (MPN_LESS_BITS_LIMB, MPN_LESS_BITS, MPN_MORE_BITS): Delete.
23810         (MPN_COMPL_INCR, MPN_COMPL): Delete.
23811
23812 Mon Jan 22 02:04:59 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23813
23814         * gmp.h (mpn_name): New #define.
23815
23816         * mpn/m88k/mc88110/addmul_1.s: New file.
23817         * mpn/m88k/mc88110/add_n.S: New file.
23818         * mpn/m88k/mc88110/sub_n.S: New file.
23819
23820         * mpn/m88k/sub_n.s: Correctly initialize carry.
23821
23822         * mpn/sparc32/{add_n.S,sub_n.S,lshift.S,rshift.S): `beq' => `be'.
23823
23824 Sun Jan 21 00:04:35 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23825
23826         * mpn/sparc64/addmul_1.s: New file.
23827         * mpn/sparc64/submul_1.s: New file.
23828         * mpn/sparc64/rshift.s: New file.
23829
23830 Sat Jan 20 00:32:54 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23831
23832         * mpz/iset.c: Fix typo introduced Dec 25.
23833
23834 Wed Jan 17 13:16:44 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23835
23836         * config/mt-sprc8-gcc: New name for mt-sparc8-gcc.
23837         * config/mt-sparcv8-gcc: Delete.
23838         * configure.in: Corresponding changes.
23839
23840 Tue Jan 16 16:31:01 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23841
23842         * gmp-impl.h: #include alloca.h when necessary.
23843
23844         * longlong.h: Test __alpha instead of __alpha__, since the former
23845         is the standard symbol.
23846
23847 Mon Jan 15 18:06:57 1996  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23848
23849         * mpn/sparc64/mul_1.s: Swap operands of mulx instructions.
23850         * mpn/sparc64/lshift.s: New file.
23851
23852 Fri Dec 29 17:34:03 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23853
23854         * mpn/x86/pentium/add_n.S: Get rid of #defines for register names.
23855         * mpn/x86/pentium/sub_n.S: Likewise.
23856
23857 Thu Dec 28 03:16:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23858
23859         * mpn/x86/pentium/mul_1.S: Rework loop to avoid AGI between update
23860         of loop induction variable and load insn at beginning of loop.
23861         * mpn/x86/pentium/addmul_1.S: Likewise.
23862         * mpn/x86/pentium/submul_1.S: Likewise.
23863
23864 Mon Dec 25 23:22:55 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23865
23866         * All files: Prefix user-visible structure fields with _mp_.
23867
23868 Fri Dec 22 20:42:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23869
23870         * mpn/configure.in (m68k configs): Terminate path variable with
23871         plain "m68k".
23872
23873 Fri Dec 22 03:29:33 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23874
23875         * mpn/sparc32/add_n.S: Update from sub_n.S to fix bugs, and to
23876         clean things up.
23877
23878         * mpn/configure.in (m68k configs): Update #include path for new
23879         mpn directory organization.
23880
23881 Tue Dec 12 02:53:02 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23882
23883         * gmp.h: Prefix all structure field with _mp_.
23884         * gmp-impl.h: Define access macros for these fields.
23885
23886 Sun Dec 10 00:47:17 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23887
23888         * mpn/alpha/addmul_1.s: Prefix labels with `.'.
23889         * mpn/alpha/submul_1.s: Likewise.
23890         * mpn/alpha/[lr]shift.s: Likewise.
23891         * mpn/alpha/udiv_qrnnd.S: Likewise.
23892         * mpn/alpha/ev5/[lr]shift.s: Likewise.
23893
23894         * mpn/alpha/ev5/lshift.s: Fix typos.
23895
23896 Fri Dec  1 14:28:20 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23897
23898         * mpn/Makefile.in (.SUFFIXES): Define.
23899
23900 Wed Nov 29 23:11:57 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23901
23902         * mpn/sparc64/{add_n.s, sub_n.s}: New files.
23903
23904 Tue Nov 28 06:03:13 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23905
23906         * mpn/x86/syntax.h: Handle ELF_SYNTAX.
23907         Rename GAS_SYNTAX => BSD_SYNTAX.
23908
23909         * mpn/configure.in: Handle linuxelf and SysV for x86 variants.
23910
23911 Mon Nov 27 01:32:12 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23912
23913         * mpn/hppa/hppa1_1/pa7100/submul_1.S: New file.
23914
23915 Sun Nov 26 04:30:47 1995  Torbjorn Granlund  <tege@noisy.matematik.su.se>
23916
23917         * mpn/hppa/hppa1_1/pa7100/addmul_1.S: New file.
23918
23919         * mpn/sparc32/add_n.S: Rewrite to use 64 bit loads/stores.
23920         * mpn/sparc32/sub_n.S: Likewise.
23921
23922 Fri Nov 17 00:18:46 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23923
23924         * mpn/configure.in: Handle m68k on NextStep.
23925
23926 Thu Nov 16 02:30:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23927
23928         * mpn: Reorganize machine-specific directories.
23929         * mpn/configure.in: Corresponding changes.
23930         (sh, sh2): Handle these.
23931         (m68k targets): Create asm-syntax.h.
23932
23933 Thu Nov  9 02:20:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23934
23935         * mpn/generic/mul_n.c (____mpn_sqr_n): Delete code that calls abort.
23936         (____mpn_mul_n): Likewise.
23937
23938 Tue Nov  7 03:25:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23939
23940         * mpf/get_str.c: In exponentiation code (two places), don't swap
23941         input and output areas when calling mpn_mul_1.
23942         * mpf/set_str.c: Likewise.
23943
23944 Fri Nov  3 02:35:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23945
23946         * mpf/Makefile.in: Make sure all objects are listed in dependency list;
23947         delete spurious entries.
23948
23949         * mpf/mul.c: Handle U or V being 0.  Allow prec+1 for result precision.
23950
23951         * mpf/set_prec.c: New computation of limb precision.
23952         * mpf/set_dfl_prec.c: Likewise.
23953
23954         * mpf/random2.c: Fix typo computing exp.
23955         * mpf/get_str.c: In (uexp > usize) case, set n_limbs as a function of
23956         the user-requested number of digits, n_digits.
23957
23958 Thu Nov  2 16:25:07 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23959
23960         * mpn/generic/divrem.c (case 2): Don't move np vector back, it is
23961         never read.
23962         (default case): Put most significant limb from np in new variable n2;
23963         decrease size argument for MPN_COPY_DECR; use n2 instead of np[dsize].
23964
23965 Wed Nov  1 02:59:53 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23966
23967         * mpn/sparc/[lr]shift.S: New files.
23968
23969 Tue Oct 31 00:08:12 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23970
23971         * mpz/gcd_ui.c: Set w->size unconditionally when v is zero.
23972
23973         * gmp-impl.h (assert): Delete definition.
23974
23975         * mpf/sub.c: Delete all assert calls.  Delete variable `cy'.
23976
23977         * mpf/neg.c: Use prec+1 as precision.  Optimize for when arguments
23978         are the same.
23979         * mpf/abs.c: Likewise.
23980         * mpf/{set,neg,abs}.c: Make structure and variable names similar.
23981
23982 Mon Oct 30 12:45:26 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23983
23984         * mpf/random2.c (random): Test __SVR4 in addition to __svr4__.
23985         * mpn/generic/random2.c (random): Likewise.
23986
23987 Sun Oct 29 01:54:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
23988
23989         * mpf/div.c: Special handle U or V being 0.
23990
23991         * mpf/random2.c: New file.
23992
23993         * longlong.h (i860 rshift_rhlc): Define.
23994         (i960 udiv_qrnnd): Define.
23995         (i960 count_leading_zeros): Define.
23996         (i960 add_ssaaaa): Define.
23997         (i960 sub_ddmmss): Define.
23998         (i960 rshift_rhlc): Define.
23999
24000 Sat Oct 28 19:09:15 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24001
24002         * mpn/pentium/rshift.S: Fix and generalize condition for when to use
24003         special code for shift by 1.
24004         * mpn/pentium/lshift.S: Likewise.
24005
24006 Thu Oct 26 00:02:56 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24007
24008         * gmp.h: #undef __need_size_t.
24009         * mp.h: Update from gmp.h.
24010
24011 Wed Oct 25 00:17:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24012
24013         * mpf/Makefile.in: Compile set_prec.c.
24014         * mpf/realloc.c: Delete this file.
24015         * mpf/Makefile.in: Delete mentions of realloc.c.
24016
24017         * gmp.h (__mpf_struct): Get rid of `alloc' field.
24018         * mpf/clear.c: Likewise.
24019         * mpf/init*.c: Likewise.
24020         * mpf/set_prec.c: Likewise.
24021         * mpf/iset*.c: Likewise.
24022
24023         * mpf/iset_str.c: New file.
24024
24025         * mpn/configure.in: Handle pyramid.
24026
24027         * mpf/set.c: Use prec+1 as precision.
24028
24029         * mpf/set_prec.c: New file.
24030
24031 Tue Oct 24 00:56:41 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24032
24033         * mpn/generic/divrem.c: New file.  Will replace mpn/generic/divmod.c
24034         when rest of source is converted.
24035         * mpn/configure.in (functions): Add `divrem'
24036         * mpn/generic/set_str.c: Never call __mpn_mul_1 with zero size.
24037
24038         * mpf/get_str.c: Completely rewritten.
24039         * mpf/add.c: Fix several problems.
24040         * mpf/sub.c: Compare operands from most significant end until
24041         first difference, exclude skipped limbs from computation.
24042         Accordingly simplify normalization code.
24043         * mpf/set_str.c: Fix several problems.
24044         * mpf/dump.c: New file.
24045         * mpf/Makefile.in: Compile dump.c.
24046         * mpf/init2.c: Set prec field correctly.
24047
24048 Sun Oct 22 03:02:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24049
24050         * cre-conv-tab.c: #include math.h; don't declare log and floor.
24051
24052 Sat Oct 21 23:04:10 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24053
24054         * mpf/mul_ui.c: Handle U being 0.
24055
24056 Wed Oct 18 19:39:27 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24057
24058         * mpn/generic/set_str.c: Correctly handle input like "000000000000".
24059         Misc cleanups.
24060
24061 Tue Oct 17 15:14:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24062
24063         * longlong.h: Define COUNT_LEADING_ZEROS_0 for machines where
24064         appropriate.
24065
24066 Mon Oct 16 19:14:43 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24067
24068         * mpf/add.c: Rewrite.
24069         * mpf/set_str.c: New file.  Needs more work.
24070
24071 Sat Oct 14 00:14:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24072
24073         * mpf/div_2exp.c: Vastly simplify.
24074         * mpf/mul_2exp.c: Likewise.
24075
24076         * mpf/sub.c: Rewrite.
24077
24078         * gmp-impl.h (udiv_qrnnd_preinv2gen): Terminate comment.
24079
24080         * mpf/dump.c: Free allocated memory.
24081
24082         * gmp-impl.h (assert): Define.
24083
24084 Wed Oct 11 13:31:00 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24085
24086         * mpn/pentium/rshift.S: Install new code to optimize shift-by-1.
24087
24088 Tue Oct 10 00:37:21 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24089
24090         * mpn/pentium/lshift.S: Install new code to optimize shift-by-1.
24091
24092         * mpn/powerpc32/{lshift.s,rshift.s}: New files.
24093
24094         * configure.in: Fix typo.
24095
24096 Sat Oct  7 08:17:09 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24097
24098         * longlong.h (smul_ppmm): Correct type of __m0 and __m1.
24099
24100 Wed Oct  4 16:31:28 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24101
24102         * mpn/configure.in: Handle alphaev5.
24103         * mpn/ev4: New name for alpha subdir.
24104         * mpn/ev5: New subdir.
24105         * mpn/ev5/lshift.s: New file.
24106
24107 Tue Oct  3 15:06:45 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24108
24109         * mpn/alpha/mul_1.s: Avoid static increments of pointers; use
24110         corresponding offsets in ldq and stq instructions instead.
24111         (Loop): Swap cmpult and stq to save one cycle on EV5.
24112
24113         * mpn/tests/{add_n.s,sub_n.s,lshift.s,rshift.s,mul_1.s,addmul_1.s,
24114         submul_1.s}: Don't check results if NOCHECK is defined.
24115
24116 Mon Oct  2 11:40:18 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24117
24118         * longlong.h (mips umul_ppmm [32 and 64 bit versions]):
24119         Make new variants, based on GCC version number, that use `l' and `h'
24120         constraints instead of explicit mflo and mfhi instructions
24121
24122 Sun Oct  1 00:17:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24123
24124         * mpn/mc88100/add_n.s: Decrease unrolling factor from 16 to 8.
24125         * mpn/mc88100/sub_n.s: Likewise.
24126
24127         * config/mt-m88110: New file.
24128         * configure.in: Use it.
24129
24130         * mpn/mc88110/mul_1.s: Fix thinko.
24131
24132 Sat Sep 30 21:28:19 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24133
24134         * mpz/set_d.c: Declare `size' at function start.
24135
24136         * experimental: New directory for mpx and mpz2.
24137
24138         * mpz/tdiv_q.c: Clarify comments.
24139         * mpz/{mod.c,mod_ui.c}: New file, for math mod function.
24140
24141         * mpn/sh2/{mul_1.s,addmul_1.s,submul_1.s}: New files.
24142
24143         * mpn/sh/{add_n.s,sub_n.s}: New files.
24144
24145         * mpn/pyr/{add_n.s,sub_n.s,mul_1.s,addmul_1.s}: New files.
24146
24147         * mpn/i960/{add_n.s,sub_n.s}: New files.
24148
24149         * mpn/alpha/addmul_1.s (Loop): Move decrement of r18 to before umulh,
24150         to save cycles on EV5.
24151         * mpn/alpha/submul_1.s: Ditto.
24152         * mpn/alpha/mul_1.s: Ditto.
24153
24154 Thu Sep 28 02:48:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24155
24156         * gmp.h (mp_limb, mp_limb_signed): Define as `long long' if
24157         _LONG_LONG_LIMB is defined.
24158
24159         * longlong.h (m88110): Test __m88110__, not __mc88110__
24160
24161         * mpn/mc88110/mul_1.s: Rewrite.
24162
24163 Tue Sep 26 23:29:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24164
24165         * config.sub: Update from current Cygnus version.
24166
24167         * mpn/configure.in: Recognize canonical m88*, not mc88*.
24168
24169 Fri Sep 22 14:58:05 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24170
24171         * mpz/set_d.c: New file.
24172         * mpz/Makefile.in: Build new files.
24173
24174         * mpq/get_d.c: Replace usage of scalbn with ldexp.
24175
24176         * mpn/{vax,i386}/gmp-mparam.h: New files.
24177         * gmp-impl.h (ieee_double_extract): Define here.
24178         * mpf/set_d.c (ieee_double_extract): Not here.
24179
24180 Thu Sep 21 00:56:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24181
24182         * longlong.h (C umul_ppmm): Use UWtype, not USItype for temps.
24183         (udiv_qrnnd): For cases implemented with call to __udiv_qrnnd,
24184         protect with new symbol LONGLONG_STANDALONE.
24185         (68000 umul_ppmm): Use %# prefix for immediate constants.
24186
24187 Wed Sep 20 15:36:23 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24188
24189         * mpn/generic/divmod_1.c: Handle
24190         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
24191         specifically also when normalization_steps != 0.
24192
24193 Mon Sep 18 15:42:30 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24194
24195         * mpq/get_d.c: New file.
24196
24197 Sun Sep 17 02:04:36 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24198
24199         * longlong.h (pyr): Botch up for now.
24200
24201 Sat Sep 16 00:11:50 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24202
24203         * mpn/clipper/mul_1.s: New file.
24204         * mpn/clipper/add_n.s: New file.
24205         * mpn/clipper/sub_n.s: New file.
24206         * mpn/configure.in: Handle clipper*-*-*.
24207
24208         * mpn/configure.in: Recognize rs6000-*-*.
24209
24210 Fri Sep 15 00:41:34 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24211
24212         * mpn/alpha/add_n.s: New file.
24213         * mpn/alpha/sub_n.s: New file.
24214
24215         * mpn/mips3: New name for mpn/r4000.
24216         * mpn/mips2: New name for mpn/r3000.
24217         * mpn/configure.in: Corresponding changes.
24218
24219         * mpn/generic/perfsqr.c (primes): Delete.
24220         (residue_map): Delete.
24221
24222 Thu Sep 14 00:07:58 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24223
24224         * mpn/r3000/sub_n.s: Fix typo.
24225
24226         * dm_trunc.c: Delete spurious file.
24227
24228         * mpz/out_binary.c: Fix typo.
24229
24230         * mpn/configure.in (per-target): Make mips*-*-irix6* imply r4000.
24231
24232         * gmp-impl.h: For sparc and sgi, include alloca.h.
24233
24234         * mpn/z8000/mul_1.s: Replace `test r' with `and r,r'.  Replace
24235         `ldk r,#0' with `xor r,r'.
24236
24237 Wed Sep  6 00:58:38 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24238
24239         * mpz/inp_binary.c: New file.
24240         * mpz/out_binary.c: New file.
24241         * mpz/Makefile.in: Build new files.
24242
24243 Tue Sep  5 22:53:51 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24244
24245         * gmp.h (__mpz_struct): Change `long int' => `mp_size_t' for alloc
24246         and size fields.
24247
24248 Sat Sep  2 17:47:59 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24249
24250         * mpn/r4000/{add_n.s,sub_n.s}: Optimize away some pointer arithmetic.
24251         * mpn/r3000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files,
24252         derived from r4000 code.
24253
24254 Fri Sep  1 05:35:52 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24255
24256         * mpn/r3000/mul_1.s: Fix typo.
24257
24258         * mpn/powerpc32: Fix some old vs new mnemonic issues.
24259
24260         * mpn/powerpc32/{add_n.s,sub_n.s}: New files.
24261         * mpn/r4000/{add_n.s,sub_n.s,lshift.s,rshift.s}: New files.
24262
24263 Wed Aug 30 10:43:47 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24264
24265         * mpn/r3000/mul_1.s ($LC1): Use addiu for immediate add.
24266         * mpn/r4000/{mul_1.s,addmul_1.s,submul_1.s}: New files.
24267
24268         * config.guess: Update to latest FSF revision.
24269
24270 Mon Aug 28 02:18:13 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24271
24272         * mpz/out_str.c: Cast str to char * in fputs call.
24273
24274         * gmp-impl.h: Define UQItype, SItype, and USItype also
24275         when not __GNUC__.
24276
24277 Fri Aug 25 01:45:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24278
24279         * mpn/i386/syntax.h: Renamed from asm-syntax.h.
24280         * mpn/mc68020/syntax.h: Renamed from asm-syntax.h.
24281         * mpn/configure.in: Corresponding changes.
24282
24283 Sun Aug 13 19:20:04 1995  Torbjorn Granlund  <tege@bozo.matematik.su.se>
24284
24285         * mpn/generic/random2.c: Test __hpux, not hpux.
24286
24287 Sat Apr 15 20:50:33 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24288
24289         * mpn/sparc/add_n.S: Make it work for PIC.
24290         * mpn/sparc/sub_n.s: Likewise.
24291         * mpn/sparc8/addmul_1.S: Likewise.
24292         * mpn/sparc8/mul_1.S: Likewise.
24293         * mpn/i386/add_n.S: Likewise.
24294         * mpn/i386/sub_n.S: Likewise.
24295
24296 Thu Apr 13 23:15:03 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24297
24298         * mpn/configure.in: Don't search power subdir for generic ppc configs.
24299         Add some ppc cpu-specific configs.  Misc clean up.
24300
24301 Mon Apr 10 00:16:35 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24302
24303         * mpz/ui_pow_ui.c: Delete spurious code to handle negative results.
24304
24305 Sun Apr  9 12:38:11 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24306
24307         * longlong.h (SPARC v8 udiv_qrnnd): Generate remainder in C,
24308         not in asm.
24309
24310         * mpn/generic/sqrt.c (SQRT): Test for __SOFT_FLOAT.
24311
24312 Tue Mar 28 00:19:52 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24313
24314         * mpn/generic/hamdist.c (popc_limb): Make Mar 16 change here too.
24315
24316 Fri Mar 17 23:29:22 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24317
24318         * longlong.h (SH umul_ppmm): Define.
24319
24320 Thu Mar 16 16:40:44 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24321
24322         * mpn/generic/popcount.c (popc_limb): Rearrange 32 bit case
24323         to help CSE.
24324
24325 Fri Mar 10 20:03:49 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24326
24327         * mpn/powerpc32/mul_1.s: Clear cy before entering loop.
24328         Rearrange loop to save a cycle.
24329         * mpn/powerpc32/addmul_1.s: New file.
24330         * mpn/powerpc32/submul_1.s: New file.
24331
24332 Fri Feb 17 22:44:45 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24333
24334         * mpn/configure.in: Set target_makefile_frag for freebsd
24335         in new case stmt.
24336         * mpn/config/t-freebsd: New file.
24337         * mpn/Makefile.in: Add #### for frag insertion.
24338         (XCFLAGS): Clear by default.
24339         (.c.o, .S.o rules): Pass XCFLAGS.
24340
24341 Tue Feb  7 16:27:50 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24342
24343         * longlong.h (68000 umul_ppmm): Merge improvements from henderson.
24344
24345 Tue Jan 24 04:23:20 1995  Torbjorn Granlund  (tege@tiny.cygnus.com)
24346
24347         * longlong.h (default umul_ppmm): Store input parameters in temporaries
24348         to avoid reading them twice.
24349         (default smul_ppmm): New definition.
24350
24351 Thu Dec 29 04:20:07 1994  Jim Meyering  (meyering@comco.com)
24352
24353         * generic/perfsqr.c (__mpn_perfect_square_p): Remove declaration
24354         of unused variable.
24355         * generic/pre_mod_1.c (__mpn_preinv_mod_1): Likewise.
24356         * mpz/powm.c (pow): Likewise.
24357
24358         * mpz/and.c (mpz_and): Use {} instead of `;' for empty else clause
24359         to placate `gcc -Wall'.
24360         * mpz/ior.c (mpz_ior): Likewise.
24361
24362 Wed Dec 28 13:31:40 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24363
24364         * mpn/m*68*/*.S: #include asm-syntax.h, not asm.h.
24365
24366 Mon Dec 26 17:15:36 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24367
24368         * longlong.h: Test for more symbols, in __mc68000__ case.
24369
24370         * mpn/mpn/config.sub: Recognize m68060.
24371         * mpn/configure.in: Change mc* to m* for 68k targets.
24372         * mpn/Makefile.in (.S.o): Delete spurious creation of temp .c file.
24373
24374 Mon Dec 19 01:56:30 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24375
24376         * config.sub: Recognize pentium as a valid CPU.
24377         * mpn/configure.in: Handle pentium specifically, to use new assembly
24378         code.
24379
24380 Mon Dec 19 00:13:01 1994  Jim Meyering  (meyering@comco.com)
24381
24382         * gmp.h: Define _GMP_H_HAVE_FILE if FILE, __STDIO_H__, or H_STDIO
24383         is defined.
24384         * gmp.h: test _GMP_H_HAVE_FILE instead of FILE everywhere else.
24385
24386 Mon Dec 19 00:04:54 1994  Kent Boortz  (boortz@sics.se)
24387
24388         * Makefile.in (recursive makes): Pass CFLAGS.
24389
24390 Sun Dec 18 22:34:49 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24391
24392         * mpn/pentium: New directory.
24393
24394         * mpz/pprime.c: Make sure to mpz_clear all temporaries.
24395
24396         * longlong.h: Don't use udiv instruction when SUPERSPARC is defined.
24397         * configure.in: Handle supersparc*-.
24398         * config/mt-supspc-gcc: New file.
24399         * config/mt-sparc8-gcc: New name for mt-sparcv8-gcc.
24400
24401 Mon Dec 12 22:22:10 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24402
24403         * mpn/i386/*.S: #include "asm-syntax.h", not "asm.h".
24404         #include sysdep.h before asm-syntax.h.
24405
24406         * mpn/mc68020/asm-syntax.h: #undef ALIGN before defining it.
24407         * mpn/i386/asm-syntax.h: Likewise.
24408
24409         * mpn/mc68020/asm-syntax.h: New name for asm.h.
24410         * mpn/i386/asm-syntax.h: New name for asm.h.
24411
24412 Tue Dec  6 21:55:25 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24413
24414         * mpz/array_init.c: Fix typo in declaration.
24415
24416 Fri Nov 18 19:50:52 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24417
24418         * mpn/Makefile.in (.S.o): Pass CFLAGS and INCLUDES.
24419
24420 Mon Nov 14 00:34:12 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24421
24422         * mpn/generic/random2.c (random): Test for __svr4__.
24423
24424 Wed Oct 12 23:28:16 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24425
24426         * cre-conv-tab.c (main): Avoid upper-case X in printf format string.
24427
24428 Tue Aug 23 17:16:35 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24429
24430         * mpz/perfsqr.c: Use mpn_perfect_square_p.
24431         * mpn/generic/perfsqr.c: New file.
24432
24433 Wed Jul  6 13:46:51 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24434
24435         * mpz/array_init.c: New file.
24436         * mpz/Makefile.in: Compile array_init.
24437         * gmp.h: Declare mpz_array_init.
24438
24439 Mon Jul  4 01:10:03 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24440
24441         * mpz/add.c: Fix bogus comment.
24442         * mpz/sub.c: Likewise.
24443
24444 Sat Jul  2 02:14:56 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24445
24446         * mpn/generic/pre_mod_1.c: New file.
24447         * mpz/perfsqr.c: Use __mpn_preinv_mod_1 when faster.
24448
24449 Fri Jul 01 22:10:19 1994  Richard Earnshaw (rwe11@cl.cam.ac.uk)
24450
24451         * longlong.h (arm umul_ppmm): Fix typos in last change.  Mark
24452         hard-coded registers with "%|"
24453
24454 Thu Jun 30 03:59:33 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24455
24456         * mpz/perfsqr.c: Define PP, etc, for machines with 64 bit limbs.
24457         Use __mpn_mod_1.
24458         * mpz/perfsqr.c: Don't clobber REM in quadratic residue check loop.
24459
24460 Wed Jun 29 18:45:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24461
24462         * mpn/generic/sqrt.c (SQRT): New asm for IBM POWER2.
24463
24464         * mpz/gcd_ui.c: Return 0 if result does not fit an unsigned long.
24465
24466         * gmp.h: Use "defined (__STDC__)" consistently.
24467
24468 Tue Jun 28 18:44:58 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24469
24470         * gmp.h (mpz_get_si): Don't use "signed" keyword for return type.
24471
24472         * mpz/tests/Makefile.in: Use CFLAGS for linking.
24473
24474         * Makefile.in (CFLAGS): Use -O2 here.
24475         * mpn/Makefile (CFLAGS): Not here.
24476
24477         * mpq/cmp_ui.c: Fix typo.
24478         * mpq/canonicalize.c: Fix typo.
24479         * mpz/gcd_ui.c: Handle gcd(0,v) and gcd(u,0) correctly.
24480         * mpn/generic/gcd_1.c: Fix braino in last change.
24481
24482 Mon Jun 27 16:10:27 1994  Torbjorn Granlund  (tege@rtl.cygnus.com)
24483
24484         * mpz/gcd_ui.c: Change return type and return result.
24485         Allow destination param to be NULL.
24486         * gmp.h: Corresponding change.
24487         * mpn/generic/gcd_1.c: Handle zero return from mpn_mod_1.
24488
24489 Tue Jun 14 02:17:43 1994  Torbjorn Granlund  (tege@tiny.cygnus.com)
24490
24491         * mpn/i386/asm.h (ALIGN): Make it take a parameter.
24492         * mpn/i386/*.S: Use ALIGN to align all loops.
24493
24494         * mpn/i386/*.S: Move colon inside C_GLOBAL_NAME expression.
24495         (Makes old versions of GAS happy.)
24496
24497 Sat May 28 01:43:54 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24498
24499         * Many files: Delete unused variables and labels.
24500         * mpn/generic/dump.c: cast printf width argument to int.
24501
24502 Wed May 25 00:42:37 1994  Torbjorn Granlund  (tege@thepub.cygnus.com)
24503
24504         * mpz/gcd.c (mpz_gcd): Normalize after __mpn_sub calls.
24505         (xmod): Ignore return value of __mpn_divmod.
24506         (xmod): Improve normalization code.
24507
24508 Sat May 21 01:30:09 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24509
24510         * mpz/gcdext.c: Cosmetic changes.
24511
24512         * mpz/fdiv_ui.c: New file.
24513
24514 Fri May 20 00:24:53 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24515
24516         * mpz/tests/Makefile.in: Use explicit rules for running tests,
24517         not a shell loop.
24518         (clean): Delete stmp-*.
24519
24520         * mpz/Makefile.in: Update.
24521
24522         * mpz/div_ui.c: Don't include longlong.h.
24523         * mpz/dm_ui.c: Likewise.
24524
24525         * mpz/fdiv_q.c, mpz/fdiv_q_ui.c, mpz/fdiv_qr.c, mpz/fdiv_qr_ui.c,
24526         mpz/fdiv_r.c, mpz/fdiv_r_ui.c: New files.  Code partly from deleted
24527         mdm.c, mdm_ui.c, etc, partly rewritten.
24528         * mpz/dm_floor_ui.c, mpz/dm_floor.c: Delete.
24529         * mpz/mdm.c, mpz/mdm_ui.c, mpz/mdiv.c, mpz/mdiv_ui.c, mpz/mmod.c,
24530         mpz/mmod_ui.c: Delete.
24531
24532         * mpz/tdiv_q.c, mpz/tdiv_q_ui.c, mpz/tdiv_qr.c, mpz/tdiv_qr_ui.c,
24533         mpz/tdiv_r.c, mpz/tdiv_r_ui.c:
24534         New names for files implementing truncating division.
24535         * mpz/div_ui.c, mpz/dm_ui.c, mpz/mod_ui.c: Simplify.
24536
24537         * mpn/Makefile.in (.S.o): Don't rely on CPP being defined, use CC
24538         instead.
24539         (clean): Delete tmp-*.
24540
24541 Thu May 19 01:37:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24542
24543         * mpz/cmp.c: Call __mpn_cmp.
24544
24545         * mpz/popcount.c: Fix typo.
24546
24547         * mpz/powm_ui.c: Simplify main loop.  Keep principal operand size
24548         smaller than MSIZE when possible.
24549         * mpz/powm.c: Likewise.
24550
24551         * mpn/generic/sqrt.c: Move alloca calls into where the memory is
24552         needed.  Simplify.
24553
24554         * gmp.h: (_PROTO): New macro.
24555         Add many function declarations; use _PROTO macro in all declarations.
24556
24557         * mpf/*.c: Prepend mpn calls with __.
24558
24559 Wed May 18 20:57:06 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24560
24561         * mpf/*ui*.c: Make ui argument `long' for consistency with mpz
24562         functions.
24563
24564         * mpf/div_ui.c: Simplify.
24565
24566 Tue May 17 01:05:14 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24567
24568         * mpz/*.c: Prepend mpn calls with __.
24569
24570         * mpz/mul_ui.c: Use mpn_mul_1.
24571
24572 Mon May 16 17:19:41 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24573
24574         * mpn/i386/mul_1.S: Use C_GLOBAL_NAME.
24575         * mpn/i386/mul_1.S, mpn/i386/addmul_1.S, mpn/i386/submul_1.S:
24576         Nuke use of LAB.
24577
24578 Sat May 14 14:21:02 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24579
24580         * gmp-impl.h: Don't define abort here.
24581
24582         * mpz/pow_ui.c: Increase temporary allocation.
24583         * mpz/ui_pow_ui.c: Likewise.
24584
24585         * gmp.h (mpz_add_1, mpz_sub_1): Don't call memcpy.
24586
24587         * All Makefile.in: Delete spurious -I arguments.
24588         Update dependencies.
24589
24590         * mpz/popcount.c: New file.
24591         * mpz/hamdist.c: New file.
24592
24593         * All configure: Latest version from Cygnus.
24594
24595         * mpq/Makefile.in: New file.
24596         * mpq/configure.in: New file.
24597         * Makefile.in, configure.in: Enable compilation of mpq.
24598
24599         * mpq/set_z.c: Fix typos.
24600         * mpq/canonicalize.c: Fix typos.
24601         * mpq/cmp_ui.c: Fix typos.
24602
24603         * mpf/add_ui.c: Read U->D into UP always.  Delete spurious MPN_COPY.
24604         * mpf/sub_ui.c: Likewise.
24605
24606         * gmp-impl.h: Don't redefine alloca.
24607
24608         * COPYING.LIB: Renamed from COPYING.
24609
24610 Wed May 11 01:45:44 1994  Torbjorn Granlund  (tege@adder.cygnus.com)
24611
24612         * mpz/powm_ui.c: When shifting E left by C+1, handle out-of-range
24613         shift counts.  Fix typo when testing negative_result.
24614         * mpz/powm.c: Likewise.
24615
24616         * mpz/ui_pow_ui.c: New file.
24617         * mpz/Makefile.in: Update.
24618
24619         * mpz/pow_ui.c: Call __mpn_mul_n instead of __mpn_mul when possible.
24620
24621         * mpz/div.c, mpz/div_ui.c, mpz/gcd.c: Prefix external mpn calls.
24622         * mpz/gcd.c: Declare mpn_xmod.
24623
24624         * mpz/powm.c: Major changes to accommodate changed mpn semantics.
24625         * mpz/powm_ui.c: Update from mpz/powm.c.
24626
24627         * mpz/tests/tst-io.c: New file.
24628         * mpz/tests/tst-logic: New file.
24629         * mpz/tests/Makefile.in: Update.
24630
24631         * mpz/inp_str.c: Get base right when checking for first digit.
24632         * mpz/inp_str.c: Allocate more space for DEST when needed.
24633
24634         * mpz/com.c: Use mpn_add_1 and mpn_sub_1.
24635         * mpz/and.c, mpz/ior.c: Likewise.  Simplify somewhat.
24636
24637         * mpz/add_ui.c: Use mpn_add_1 and mpn_sub_1.
24638         Rename parameters to be consistent with mpz/sub_ui.
24639         General simplifications.
24640         * mpz/sub_ui.x: Likewise.
24641
24642 Tue Aug 10 19:41:16 1993  Torbjorn Granlund  (tege@prudens.matematik.su.se)
24643
24644         * mpf: New directory.
24645         * mpf/*.c: Merge basic set of mpf functions.
24646
24647         * Many logs missing...
24648
24649 Sun Apr 25 18:40:26 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
24650
24651         * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
24652         * bsd/xtom.c: Likewise.
24653
24654         * mpz/div.c: Remove free_me and free_me_size and their usage.
24655         Use mpn_divmod for division; corresponding changes in return value
24656         convention.
24657         * mpz/powm.c: `carry_digit' => `carry_limb'.
24658         * bsd/sdiv.c: Clearify comment.
24659
24660 Sun Apr 25 00:31:28 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
24661
24662         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
24663
24664 Sat Apr 24 16:23:33 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
24665
24666         * longlong.h (__udiv_qrnnd_c): Make all variables `unsigned long int'.
24667
24668         * gmp-impl.h: #define ABS.
24669         * (Many files): Use ABS instead of abs.
24670
24671         * mpn/generic/sqrt.c, mpz/clrbit.c, mpz/get_si.c, mpz/mod_2exp.c,
24672         mpz/pow_ui.c: Cast 1 to mp_limb before shifting.
24673
24674         * mpz/perfsqr.c: Use #if, not plain if for exclusion of code for
24675         non-32-bit machines.
24676
24677 Tue Apr 20 13:13:58 1993  Torbjorn Granlund  (tege@du.nada.kth.se)
24678
24679         * mpn/generic/sqrt.c: Handle overflow for intermediate quotients by
24680         rounding them down to fit.
24681
24682         * mpz/perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
24683
24684         * mpz/inp_str.c (char_ok_for_base): New function.
24685         (mpz_inp_str): Use it.
24686
24687 Sun Mar 28 21:54:06 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
24688
24689         * mpz/inp_raw.c: Allocate x_index, not xsize limbs.
24690
24691 Mon Mar 15 11:44:06 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
24692
24693         * mpz/pprime.c: Declare param `const'.
24694         * gmp.h: Add declarations for mpz_com.
24695
24696 Thu Feb 18 14:10:34 1993  Torbjorn Granlund  (tege@pde.nada.kth.se)
24697
24698         * mpq/add.c, mpq/sub.c: Call mpz_clear for t.
24699
24700 Fri Feb 12 20:27:34 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
24701
24702         * mpz/inp_str.c: Recog minus sign as first character.
24703
24704 Wed Feb  3 01:36:02 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
24705
24706         * mpz/iset.c: Handle 0 size.
24707
24708 Tue Feb  2 13:03:33 1993  Torbjorn Granlund  (tege@cyklop.nada.kth.se)
24709
24710         * mpz/mod_ui.c: Initialize dividend_size before it's used.
24711
24712 Mon Jan  4 09:11:15 1993  Torbjorn Granlund  (tege@sics.se)
24713
24714         * bsd/itom.c: Declare param explicitly 'signed'.
24715         * bsd/sdiv.c: Likewise.
24716
24717         * mpq/cmp.c: Remove unused variable tmp_size.
24718         * mpz/powm_ui.c: Fix typo in esize==0 if stmt.
24719         * mpz/powm.c: Likewise.
24720
24721 Sun Nov 29 01:16:11 1992  Torbjorn Granlund  (tege@sics.se)
24722
24723         * mpn/generic/divmod_1.c (mpn_divmod_1): Handle
24724         divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
24725         specifically.
24726
24727         * Reorganize sources.  New directories mpn, mpn/MACH, mpn/generic,
24728         mpz, mpq, bsd.  Use full file name for change logs hereafter.
24729
24730 Wed Oct 28 17:40:04 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
24731
24732         * longlong.h (__hppa umul_ppmm): Fix typos.
24733         (__hppa sub_ddmmss): Swap input arguments.
24734
24735         * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
24736         initializator.
24737
24738 Sun Oct 25 20:30:06 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
24739
24740         * mpz_pprime.c (mpz_probab_prime_p): Handle numbers <= 3
24741         specifically (used to consider all negative numbers prime).
24742
24743         * mpz_powm_ui: `carry_digit' => `carry_limb'.
24744
24745         * sdiv: Handle zero dividend specifically.  Replace most code in
24746         this function with a call to mpn_divmod_1.
24747
24748 Fri Sep 11 22:15:55 1992  Torbjorn Granlund  (tege@tarrega.sics.se)
24749
24750         * mpq_clear: Don't free the MP_RAT!
24751
24752         * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
24753
24754 Thu Sep  3 01:47:07 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
24755
24756         * All files: Remove leading _ from mpn function names.
24757
24758 Wed Sep  2 22:21:16 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
24759
24760         Fix from Jan-Hein Buhrman:
24761         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
24762
24763         * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
24764         life.
24765
24766 Sun Aug 30 18:37:15 1992  Torbjorn Granlund  (tege@jupiter.sics.se)
24767
24768         * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
24769         * _mpz_get_str: Don't remove leading zeros.  Abort if there are some.
24770
24771 Wed Mar  4 17:56:56 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24772
24773         * gmp.h: Change definition of MP_INT to make the & before params
24774         optional.  Use typedef to define it.
24775         * mp.h: Use typedef to define MINT.
24776
24777 Tue Feb 18 14:38:39 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24778
24779         longlong.h (hppa umul_ppmm): Add missing semicolon.  Declare type
24780         of __w1 and __w0.
24781
24782 Fri Feb 14 21:33:21 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24783
24784         * longlong.h: Make default count_leading_zeros work for machines >
24785         32 bits.  Prepend `__' before local variables to avoid conflicts
24786         with users' variables.
24787
24788         * mpn_dm_1.c: Remove udiv_qrnnd_preinv ...
24789         * gmp-impl.h: ... and put it here.
24790         * mpn_mod_1: Use udiv_qrnnd_preinv if it is faster than udiv_qrnnd.
24791
24792 Tue Feb 11 17:20:12 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24793
24794         * mpn_mul: Enhance base case by handling small multiplicands.
24795         * mpn_dm_1.c: Revert last change.
24796
24797 Mon Feb 10 11:55:15 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24798
24799         * mpn_dm_1.c: Don't define udiv_qrnnd_preinv unless needed.
24800
24801 Fri Feb  7 16:26:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24802
24803         * mpn_mul: Replace code for base case.
24804
24805 Thu Feb  6 15:10:42 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24806
24807         * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
24808         pre-inverting divisor.
24809
24810 Sun Feb  2 11:10:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24811
24812         * longlong.h: Make __LLDEBUG__ work differently.
24813         (_IBMR2): Reinsert old code.
24814
24815 Sat Feb  1 16:43:00 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24816
24817         * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
24818         using floating point operations.  Don't define
24819         UDIV_NEEDS_NORMALIZATION any longer.
24820
24821 Fri Jan 31 15:09:13 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24822
24823         * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
24824         * longlong.h (#ifdef __hppa): Define umul_ppmm.
24825
24826 Wed Jan 29 16:41:36 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24827
24828         * mpn_cmp: Only one length parameter, assume operand lengths are
24829         the same.  Don't require normalization.
24830         * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
24831         new mpn_cmp definition.
24832
24833 Tue Jan 28 11:18:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24834
24835         * _mpz_get_str: Fix typo in comment.
24836
24837 Mon Jan 27 09:44:16 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24838
24839         * Makefile.in: Add new files.
24840
24841         * mpn_dm_1.c: New file with function _mpn_divmod_1.
24842         * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
24843         * mpz_div_ui: Likewise.
24844
24845         * mpn_mod_1.c: New file with function _mpn_mod_1.
24846         * mpz_mod_ui: Use _mpn_mod_1.
24847
24848 Thu Jan 23 18:54:09 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24849
24850         Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
24851         * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
24852         Handle dividend == 0.
24853
24854 Wed Jan 22 12:02:26 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24855
24856         * mpz_pprime.c: Use "" for #include.
24857
24858 Sun Jan 19 13:36:55 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24859
24860         * mpn_rshiftci.c (header): Correct comment.
24861
24862 Wed Jan 15 18:56:04 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24863
24864         * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
24865         to make space for ignored quotient at the end.  (The quotient might
24866         always be an extra limb.)
24867
24868 Tue Jan 14 21:28:48 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24869
24870         * mpz_powm_ui: Fix comment.
24871         * mpz_powm: Likewise.
24872
24873 Mon Jan 13 18:16:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24874
24875         * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
24876
24877 Sun Jan 12 13:54:28 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24878
24879         Fixes from Kazumaro Aoki:
24880         * mpz_out_raw: Take abs of size to handle negative values.
24881         * mpz_inp_raw: Reallocate before reading ptr from X.
24882         * mpz_inp_raw: Store, don't read, size to x->size.
24883
24884 Tue Jan  7 17:50:25 1992  Torbjorn Granlund  (tege@zevs.sics.se)
24885
24886         * gmp.h, mp.h: Remove parameter names from prototypes.
24887
24888 Sun Dec 15 00:09:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24889
24890         * tests/Makefile.in: Prepend "./" to file names when executing
24891         tests.
24892
24893         * Makefile.in: Fix many problems.
24894
24895 Sat Dec 14 01:00:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24896
24897         * mpn_sqrt.c: New file with _mpn_sqrt.
24898         * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
24899         * msqrt.c: Delete.  Create from mpz_sqrtrem.c in Makefile.in.
24900         * mpz_do_sqrt.c: Delete.
24901         * Makefile.in: Update to reflect these changes.
24902
24903         * Makefile.in, configure, configure.subr: New files
24904         (from bothner@cygnus.com).
24905         * dist-Makefile: Delete.
24906
24907         * mpz_fac_ui: Fix comment.
24908
24909         * mpz_random2: Rewrite a bit to make it possible for the most
24910         significant limb to be == 1.
24911
24912         * mpz_pprime.c (mpz_probab_prime_p): Remove \t\n.
24913
24914 Fri Dec 13 23:10:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24915
24916         * mpz_do_sqrt: Simplify special case for U == 0.
24917         * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
24918           Rename _mpz_impl_sqrt to _mpz_do_sqrt.
24919
24920 Fri Dec 13 12:52:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24921
24922         * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
24923
24924 Thu Dec 12 22:17:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24925
24926         * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
24927         variables to mp_size.
24928
24929 Wed Dec 11 22:00:34 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24930
24931         * mpn_rshift.c: Fix header comments.
24932
24933 Mon Dec  9 17:46:10 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24934
24935         Released 1.2.
24936
24937         * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
24938
24939         * dist-Makefile: Add missing dependency for cre-mparam.
24940
24941         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
24942           mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
24943
24944         * dist-Makefile (clean): clean in tests subdir too.
24945         * tests/Makefile: Define default values for ROOT and SUB.
24946
24947         * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
24948         2 constraint.
24949
24950 Mon Nov 11 00:06:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24951
24952         * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
24953
24954 Sat Nov  9 23:47:38 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24955
24956         Released 1.1.94.
24957
24958         * dist-Makefile, Makefile, tests/Makefile: Merge tests into
24959         distribution.
24960
24961 Fri Nov  8 22:57:19 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24962
24963         * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
24964
24965 Thu Nov  7 22:06:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24966
24967         * longlong.h: Cosmetic changes to keep it identical to gcc2 version
24968         of longlong.h.
24969         * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
24970         sub_ddmmss.
24971
24972 Mon Nov  4 00:36:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24973
24974         * mpn_mul: Fix indentation.
24975
24976         * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
24977         4294967296.0).
24978         * mpz_do_sqrt: Handle overflow in conversion from double returned
24979         by SQRT to mp_limb.
24980
24981         * gmp.h: Add missing function definitions.
24982
24983 Sun Nov  3 18:25:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
24984
24985         * mpz_pow_ui: Change type of `i' to int.
24986
24987         * ChangeLog: Add change log entry.
24988         * ChangeLog: Add change log entry.
24989         * ChangeLog: Add change log entry.
24990         * ChangeLog: Add change log entry.
24991         * ChangeLog: Add change log entry.
24992         * ChangeLog: Add change log entry.
24993         * ChangeLog: Add change log entry.
24994         * ChangeLog: Add change log entry.
24995 Stack overflow.
24996
24997         * mpz_pow_ui.c: Fix typo in comment.
24998
24999         * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
25000         * mpz_powm_ui.c: Add code for rpow.
25001         * rpow.c: Delete this file.  The rpow function is now implemented
25002         in mpz_powm_ui.c.
25003
25004         * mpz_fac_ui.c: New file.
25005         * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
25006
25007         Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
25008         * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
25009         the first argument not smaller than the second.
25010
25011 Tue Oct 29 13:56:55 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25012
25013         * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
25014         header text.
25015
25016 Mon Oct 28 00:35:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25017
25018         * mpz_random2: Handle size == 0.
25019
25020         * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
25021         chars_per_bit_exactly, and change its definition.
25022         * cre-conv-tab.c (main): Output field according to its new
25023         definition.
25024         * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
25025         Use chars_per_bit_exactly.
25026
25027         * mpz_random2: Change the loop termination condition in order to
25028         get a large most significant limb with higher probability.
25029
25030         * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
25031         * mpz_get_si.c: New file.
25032         * dist-Makefile: Add mpz_random2 and mpz_get_si.
25033
25034         * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
25035         power of 2, giving exact result.
25036
25037         * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
25038         * mpn_mul: New macro KARATSUBA_THRESHOLD.
25039         * mpn_mul (karatsuba's algorithm): Don't write intermediate results
25040         to prodp, use temporary pp instead.  (Intermediate results can be
25041         larger than the final result, possibly writing into hyperspace.)
25042         * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
25043         shortcut algorithm.
25044         * mpn_mul: Fix typo, cy instead of xcy.  Unify carry handling code.
25045
25046 Sun Oct 27 19:57:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25047
25048         * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
25049         when usize > 1.5 vsize.
25050
25051         * mpn_mul: Break between classical and Karatsuba's algorithm at
25052         KARATSUBA_THRESHOLD, if defined.  Default to 8.
25053
25054         * mpn_div: Kludge to fix stray memory read.
25055
25056 Sat Oct 26 20:06:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25057
25058         * mpz_gcdext: Handle a = b = 0.  Remove memory leakage by calling
25059         mpz_clear for all temporary variables.
25060
25061         * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
25062         function's argument constraints.  Compute wsize correctly.
25063
25064         * mpz_gcd: Fix typo in comment.
25065
25066         * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
25067         abort if allocation fails, don't just exit.
25068
25069 Fri Oct 25 22:17:20 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25070
25071         * mpz_random2.c: New file.
25072
25073 Thu Oct 17 18:06:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25074
25075         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
25076         * mpq_cmp: Take sign into account, don't just compare the
25077         magnitudes.
25078         * mpq_cmp: Call _mpn_mul in the right way, with the first argument
25079         not smaller than the second.
25080
25081 Wed Oct 16 19:27:32 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25082
25083         * mpz_random: Ensure the result is normalized.
25084
25085 Tue Oct 15 14:55:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25086
25087         * mpz_clrbit: Support non-ANSI compilers.
25088
25089 Wed Oct  9 18:03:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25090
25091         * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
25092
25093 Tue Oct  8 17:42:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25094
25095         * mpz_mdm_ui: Add comments.
25096
25097         * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
25098         * mpz_init_ui: Change spacing and header comment.
25099
25100 Thu Oct  3 18:36:13 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25101
25102         * dist-Makefile: Prepend `./' before some filenames.
25103
25104 Sun Sep 29 14:02:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25105
25106         Released 1.1 (public).
25107
25108         * mpz_com: New name of mpz_not.
25109         * dist-Makefile: Change mpz_not to mpz_com.
25110
25111 Tue Sep 24 12:44:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25112
25113         * longlong.h: Fix header comment.
25114
25115 Mon Sep  9 15:16:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25116
25117         Released 1.0.92.
25118
25119         * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
25120         case.
25121
25122         * longlong.h (m68000 umul_ppmm): Clobber one register less by
25123         slightly rearranging the code.
25124
25125 Sun Sep  1 18:53:25 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25126
25127         * dist-Makefile (stamp-stddefh): Fix typo.
25128
25129 Sat Aug 31 20:41:31 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25130
25131         Released 1.0.91.
25132
25133         * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
25134           mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
25135         * gmp.h, gmp.texi: Define the new functions.
25136
25137 Fri Aug 30 08:32:56 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25138
25139         * mpz_gcdext: Compute t argument from the other quantities at the
25140           end, of the function, not in the loop.  New feature: Allow t to be
25141           NULL.
25142
25143         * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
25144           include "mp.h".  Use type name `MP_INT' always.
25145
25146         * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
25147
25148 Wed Aug 28 00:45:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25149
25150         * dist-Makefile (documentation): Go via tmp.texi to avoid the
25151           creation of gmp.dvi if any errors occur.  Make tex read input
25152           from /dev/null.
25153
25154 Fri Aug 23 15:58:52 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25155
25156         * longlong.h (68020, i386): Don't define machine-dependent
25157           __umulsidi3 (so the default definition is used).
25158         * longlong.h (all machines): Cast all operands, sources and
25159           destinations, to `unsigned long int'.
25160         * longlong.h: Add gmicro support.
25161
25162 Thu Aug 22 00:28:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25163
25164         * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
25165         * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
25166         * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
25167         * _mpz_get_str.c: Add code to do division by big_base using only
25168           umul_qrnnd, if that is faster.  Use UMUL_TIME and UDIV_TIME to
25169           decide which variant to use.
25170
25171 Wed Aug 21 15:45:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25172
25173         * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
25174           nops.  (Saves two insn.)
25175
25176         * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
25177           branch, and to permit input/output register overlap.
25178
25179         * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
25180         * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
25181           asm statements (gives better code if either the upper or lower
25182           part of the product is unused.
25183
25184 Tue Aug 20 17:57:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25185
25186         * _mpz_get_str.c (outside of functions): Remove
25187           num_to_ascii_lower_case and num_to_ascii_upper_case.  Use string
25188           constants in the function instead.
25189
25190 Mon Aug 19 00:37:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25191
25192         * cre-conv-tab.c (main): Output table in hex.  Output 4 fields, not
25193           3, for components 0 and 1.
25194
25195         * gmp.h: Add declaration of mpq_neg.
25196
25197         Released 1.0beta.13.
25198
25199         * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
25200           comparing to enum literals SPC and EOF.  This makes the code work
25201           for compilers where `char' is unsigned.  (Bug found by Brian
25202           Beuning).
25203
25204         Released 1.0beta.12.
25205
25206         * mpz_mod_ui: Remove references to quot.  Remove quot_ptr, quot_size
25207           declarations and assignment code.
25208
25209 Sun Aug 18 14:44:26 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25210
25211         * mpz_mod_ui: Handle dividend < 0.
25212
25213         Released 1.0beta.11.
25214
25215         * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
25216           general structure, variable names, etc.
25217
25218         * sdiv: Un-normalize the remainder in n1 before it is negated.
25219
25220         * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
25221           udiv_qrnnd.
25222
25223         * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
25224           the quotient size if the dividend size is incremented.  (Bug found
25225           by Brian Beuning.)
25226
25227         * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
25228           (Bug found by Brian Beuning.)
25229
25230         * mpz_mod_ui: Replace "digit" by "limb".
25231
25232         * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
25233           for non-32-bit machines (PP is hardwired for such machines).
25234         * mpz_perfsqr.c (outside of functions): Define PP value with an L.
25235
25236         * mpn_mul.c (_mpn_mul): Add verification code that is activated if
25237           DEBUG is defined.  Replace "digit" by "limb".
25238         * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
25239           after the addition.
25240         * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
25241           and v0_size, and according to the result, swap arguments in
25242           recursive call.  (Don't violate mpn_mul's own argument
25243           constraints.)
25244
25245 Fri Aug 16 13:47:12 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25246
25247         Released 1.0beta.10.
25248
25249         * longlong.h (IBMR2): Add udiv_qrnnd.
25250
25251         * mpz_perfsqr: Remove unused variables.
25252
25253         * mpz_and (case for different signs): Initialize loop variable i!
25254
25255         * dist-Makefile: Update automatically generated dependencies.
25256         * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
25257           etc to dependency file lists.
25258
25259         * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
25260           `unsigned long int'.
25261         * longlong.h: Add `int' after `unsigned' and `long' everywhere.
25262
25263 Wed Aug 14 18:06:48 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25264
25265         * longlong.h: Add ARM, i860 support.
25266
25267         * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
25268
25269 Tue Aug 13 21:57:43 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25270
25271         * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
25272           mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
25273         * gmp-impl.h: Put it here, and make it `const'.
25274         * cre-conv-tab.c (main): Make struct __mp_bases `const'.
25275
25276 Mon Aug 12 17:11:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25277
25278         * cre-conv-tab.c (main): Use %lu in printf for long ints.
25279
25280         * dist-Makefile: Fix cre-* dependencies.
25281
25282         * cre-conv-tab.c (main): Output field big_base_inverted.
25283
25284         * gmp-impl.h (struct bases): New field big_base_inverted.
25285         * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
25286           to float (in order to keep the structure smaller).
25287
25288         * mp.h, gmp.h: Change names of macros for avoiding multiple
25289           includes.
25290
25291 Fri Aug  9 18:01:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25292
25293         * _mpz_get_str: Only shift limb array if normalization_steps != 0
25294           (optimization).
25295
25296         * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
25297         * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
25298           and m1 (overlap between output and input operands did not work).
25299         * longlong.h: Add VAX, ROMP and HP-PA support.
25300         * longlong.h: Sort the machine dependent code in alphabetical order
25301           on the CPU name.
25302         * longlong.h: Hack comments.
25303
25304 Thu Aug  8 14:13:36 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25305
25306         Released 1.0beta.9.
25307
25308         * longlong.h: Define BITS_PER_LONG to 32 if it's not already
25309           defined.
25310         * Define __BITS4 to BITS_PER_LONG / 4.
25311         * Don't assume 32 bit word size in "count_leading_zeros" C macro.
25312           Use __BITS4 and BITS_PER_LONG instead.
25313
25314         * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
25315
25316         * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
25317           even for plain mc68000.
25318
25319         * mpq_div: Flip the sign of the numerator *and* denominator of the
25320           result if the intermediate denominator is negative.
25321
25322         * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
25323
25324         * mpz_and.c: Compute the result size more conservatively.
25325         * mpz_ior.c: Likewise.
25326
25327         * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
25328
25329         * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
25330           BSDMP_SRCS.
25331
25332         * dist-Makefile: Create mult.c from mpz_mul.c.
25333         * mult.c: Delete this file.
25334
25335         * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
25336           not done properly if the input string had many leading zeros).
25337
25338 Sun Aug  4 16:54:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25339
25340         * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
25341           work with VPATH and GNU MP.
25342
25343         * mpz_gcd: Don't call mpz_set; inline its functionality.
25344
25345         * mpq_mul, mpq_div: Fix several serious typos.
25346
25347         * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
25348           zero.
25349
25350         * mpq_neg.c: New file.
25351
25352         * dist-Makefile: Remove obsolete dependencies.
25353
25354         * mpz_sub: Fix typo.
25355
25356         Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
25357         * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
25358           is just 1.
25359         * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
25360
25361 Sat Aug  3 23:45:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25362
25363         * longlong.h: Clean up comments.
25364         * longlong.h: #undef internal macros.
25365
25366 Fri Aug  2 18:29:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25367
25368         * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
25369         * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
25370
25371         * mpz_dmincl.c: Normalize the remainder before shifting it back.
25372
25373         * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
25374
25375         * mpn_div.c: Fix comment.
25376
25377         * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
25378           type, in order to work for both GNU and Berkeley functions.
25379
25380         * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
25381           madd.c from mpz_add.c, msub.c from mpz_sub.c.
25382           respectively.
25383         * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
25384         * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
25385           Berkeley function name variants.
25386         * dist-Makefile: Add created files to "clean" target.
25387
25388 Tue Jul 16 15:19:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25389
25390         * mpq_get_den: No need for absolute value of the size, the
25391           denominator is always positive.
25392
25393         * mpz_get_ui: If the operand is zero, return zero.  Don't read the
25394           limb array!
25395
25396         * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
25397           is the size of the remainder.
25398
25399 Mon Jul 15 11:08:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25400
25401         * Several files: Remove unused variables and functions.
25402
25403         * gmp-impl.h: Declare _mpz_impl_sqrt.
25404
25405         * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
25406           UDIV_NEEDS_NORMALIZATION.  (Fix from Brian Beuning.)
25407
25408         * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
25409
25410         * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
25411         * mpz_ior: Add missing else statement in OP1 | -OP2 case.
25412         * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
25413         * mpz_ior: Duplicate _mpz_realloc code.
25414
25415         * mpz_and: Add missing else statement in -OP1 & -OP2 case.
25416         * mpz_and: Rewrite OP1 & -OP2 case.
25417         * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
25418
25419         * mpz_gcdext: Loop in d1.size (not b->size).  (Fix from Brian
25420           Beuning.)
25421
25422         * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call.  (Fix from
25423           Brian Beuning.)
25424
25425 Fri Jul 12 17:10:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25426
25427         * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
25428           mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
25429           New files.
25430
25431         * mpz_dmincl.c: Remove second re-allocation of rem->d.  It
25432           was never executed.
25433
25434         * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
25435           some unixes' test doesn't have the -r option).
25436
25437         * *.*: Cast allocated pointers to the appropriate type (makes old C
25438           compilers happier).
25439
25440         * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
25441           after conversion to double.  (Kludge for broken C compilers.)
25442
25443         * dist-Makefile (stamp-stddefh): New target.  Test if "stddef.h"
25444           exists in the system and creates a minimal one if it does not
25445           exist.
25446         * cre-stddefh.c: New file.
25447         * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
25448         * dist-Makefile (clean): Add some more.
25449         * gmp.h, mp.h: Unconditionally include "stddef.h".
25450
25451 Thu Jul 11 10:08:21 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25452
25453         * min: Do ungetc of last read character.
25454         * min.c: include stdio.h.
25455
25456         * dist-Makefile: Go via tmp- files for cre* redirection.
25457         * dist-Makefile: Add tmp* to "clean" target.
25458
25459         * dist-Makefile: Use LOCAL_CC for cre*, to simplify cross
25460           compilation.
25461
25462         * gmp.h, mp.h: Don't define NULL here.
25463         * gmp-impl.h: Define it here.
25464
25465 Wed Jul 10 14:13:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25466
25467         * mpz_mod_2exp: Don't copy too much, overwriting most significant
25468           limb.
25469
25470         * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
25471           reallocating res, if op[12]_ptr got their value from alloca.
25472
25473         * mpz_and, mpz_ior: Clear up comments.
25474
25475         * cre-mparam.c: Output parameters for `short int' and `int'.
25476
25477         * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
25478
25479 Tue Jul  9 18:40:30 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25480
25481         * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
25482           (Fix for Sun lossage.)
25483
25484         * gmp.h: Add declaration of mpq_clear.
25485
25486         * dist-Makefile: Chack if "ranlib" exists, before using it.
25487         * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
25488         * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
25489
25490 Fri Jul  5 19:08:09 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25491
25492         * move: Remove incorrect comment.
25493
25494         * mpz_free, mpq_free: Rename to *_clear.
25495         * dist-Makefile: Likewise.
25496         * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
25497
25498         * mpz_dmincl.c: Don't call "move", inline its functionality.
25499
25500 Thu Jul  4 00:06:39 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25501
25502         * Makefile: Include dist-Makefile.  Fix dist target to include
25503           dist-Makefile (with the name "Makefile" in the archive).
25504
25505         * dist-Makefile: New file made from Makefile.  Add new mpz_...
25506           functions.
25507
25508         * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
25509           functionality.  Avoids code duplication.
25510         * pow.c, mpz_powm.c: Include mpz_powincl.c
25511
25512         * mpz_dmincl.c: New file containing general division code.  Avoids
25513           code duplication.
25514         * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
25515           mpz_dmincl.c.
25516
25517         * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
25518           Instead, write the overlapping memory copying inline.
25519
25520         * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
25521
25522         * longlong.h: Don't use #elif.
25523         * mpz_do_sqrt.c: Likewise.
25524
25525         * longlong.h: Use __asm__ instead of asm.
25526         * longlong.h (sparc udiv_qrnnd): Make it to one string over several
25527           lines.
25528
25529         * longlong.h: Preend __ll_ to B, highpart, and lowpart.
25530
25531         * longlong.h: Move array t in count_leading_zeros to the new file
25532           mp_clz_tab.c.  Rename the array __clz_tab.
25533         * All files: #ifdef for traditional C compatibility.
25534
25535 Wed Jul  3 11:42:14 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25536
25537         * mpz_and: Initialize res_ptr always (used to be initialized only
25538           when reallocating).
25539
25540         * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
25541           `unsigned int', and cast the multiplications.  This way
25542           compilers more easily can choose cheaper multiplication
25543           instructions.
25544
25545         * mpz_mod_2exp: Handle input argument < modulo argument.
25546         * mpz_many: Make sure mp_size is the type for sizes, not int.
25547
25548         * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
25549           mpq_div: Change mpz_init* interface.  Structure pointer as first
25550           arg to initialization function, no longer *return* struct.
25551
25552 Sun Jun 30 19:21:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25553
25554         * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
25555           character file name length limit.
25556
25557         * Most files: Rename MINT to MP_INT.  Rename MRAT to MP_RAT.
25558         * mpz_sizeinb.c: New file with function mpz_sizeinbase.
25559         * mp_bases.c: New file, with array __mp_bases.
25560         * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
25561           __mp_bases instead.
25562         * mout, mpz_out_str: Use array __mp_bases instead of function
25563           _mpz_get_cvtlen.
25564         * mpz_get_cvtlen.c: Remove.
25565         * Makefile: Update.
25566
25567 Sat Jun 29 21:57:28 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25568
25569         * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
25570         * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
25571         * longlong.h (__sparc__): Don't call .umul; expand asm instead.
25572           Don't define __umulsidi3 (i.e. use default definition).
25573
25574 Mon Jun 24 17:37:23 1991  Torbjorn Granlund  (tege@amon.sics.se)
25575
25576         * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
25577           Swap 't' and 's'.
25578
25579 Sat Jun 22 13:54:01 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25580
25581         * mpz_gcdext.c: New file.
25582
25583         * mpn_mul: Handle carry and unexpected operand sizes in last
25584           additions/subtractions.  (Bug trigged when v1_size == 1.)
25585
25586         * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
25587         * mpq_*: Call mpz_init*.
25588
25589         * mpz_pow_ui, rpow: Use _mpn_mul instead of mult.  Restructure.
25590
25591 Wed May 29 20:32:33 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25592
25593         * mpz_get_cvtlen: multiply by size.
25594
25595 Sun May 26 15:01:15 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
25596
25597         Alpha-release 0.95.
25598
25599         Fixes from Doug Lea (dl@g.oswego.edu):
25600         * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE).  Adjust PROD_SIZE
25601           correctly.
25602         * mpz_div: Prepend _ to mpz_realloc.
25603         * mpz_set_xs, mpz_set_ds: Fix typos in function name.
25604
25605 Sat May 25 22:51:16 1991  Torbjorn Granlund  (tege@bella.nada.kth.se)
25606
25607         * mpz_divmod_ui: New function.
25608
25609         * sdiv: Make the sign of the remainder correct.
25610
25611 Thu May 23 15:28:24 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25612
25613         * Alpha-release 0.94.
25614
25615         * mpz_mul_ui: Include longlong.h.
25616
25617         * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
25618           of msqrt.
25619
25620         * mpz_impl_sqrt: Don't call "move", inline its functionality.
25621
25622         * mdiv: Use MPN_COPY instead of memcpy.
25623         * rpow, mpz_mul, mpz_mod_2exp: Likewise.
25624         * pow.c: Likewise, and fix bug in the size arg.
25625
25626         * xtom: Don't use mpz_alloc, inline needed code instead.  Call
25627           _mpz_set_str instead of mpz_set_str.
25628
25629         * Makefile: Make two libraries, libmp.a and libgmp.a.
25630
25631 Thu May 22 20:25:29 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25632
25633         * Add manual to distribution.
25634         * Fold in many missing routines descibed in the manual.
25635         * Update Makefile.
25636
25637 Wed May 22 13:48:46 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25638
25639         * mpz_set_str: Make it handle 0x prefix OK.
25640
25641 Sat May 18 18:31:02 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25642
25643         * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
25644           arguments.
25645         * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
25646         * min: Likewise.
25647
25648 Thu May 16 20:43:05 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25649
25650         * memory.c: Make the default allocations functions global.
25651         * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
25652           default memory function.
25653
25654 Wed May  8 20:02:42 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25655
25656         * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
25657           even if no normalization is needed.
25658         * mpz_div: Rework reallocation scheme, to avoid excess copying.
25659
25660         * mpz_sub_ui.c, mpz_add_ui.c: New files.
25661
25662         * mpz_cmp.c, mpz_cmp_ui.c: New files.
25663
25664         * mpz_mul_2exp: Handle zero input MINT correctly.
25665
25666         * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
25667
25668         * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
25669
25670 Tue May  7 15:44:58 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25671
25672         * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
25673         * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
25674         * gcd, mpz_gcd: Likewise.
25675
25676         * gcd, mpz_gcd: Handle common 2 factors correctly.
25677
25678 Mon May  6 20:22:59 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25679
25680         * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
25681
25682         * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
25683
25684 Sun May  5 15:16:23 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25685
25686         * mpz_div: Remove test for QUOT == 0.
25687
25688 Sun Apr 28 20:21:04 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25689
25690         * pow: Don't make MOD normalization in place, as it's a bad idea to
25691           write on an input parameter.
25692         * pow: Reduce BASE if it's > MOD.
25693         * pow, mult, mpz_mul: Simplify realloc code.
25694
25695 Sat Apr 27 21:03:11 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25696
25697         * Install multiplication using Karatsuba's algorithm as default.
25698
25699 Fri Apr 26 01:03:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25700
25701         * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
25702
25703         * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
25704           left, respectively.
25705         * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
25706
25707         * mlshift.c, mrshift.c: Remove.
25708
25709 Wed Apr 24 21:39:22 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25710
25711         * mpn_mul: Check only for m2_size == 0 in function header.
25712
25713 Mon Apr 22 01:31:57 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25714
25715         * karatsuba.c: New file for Karatsuba's multiplication algorithm.
25716
25717         * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
25718
25719         * mpn_cmp: Fix header comment.
25720
25721 Sun Apr 21 00:10:44 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25722
25723         * pow: Switch off initial base reduction.
25724
25725 Sat Apr 20 22:06:05 1991  Torbjorn Granlund  (tege@echnaton.sics.se)
25726
25727         * mpz_get_str: Don't generate initial zeros for initial word.
25728           Used to write outside of allocated storage.
25729
25730 Mon Apr 15 15:48:08 1991  Torbjorn Granlund  (tege@zevs.sics.se)
25731
25732         * _mpz_realloc: Make it accept size in number of mp_digits.
25733         * Most functions: Use new _mpz_realloc definition.
25734
25735         * mpz_set_str: Remove calls _mp_free_func.
25736
25737         * Most functions: Rename mpn_* to _mpn_*.  Rename mpz_realloc to
25738           _mpz_realloc.
25739         * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
25740         * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
25741         * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
25742
25743 Sat Apr  6 14:05:16 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
25744
25745         * mpn_mul: Multiply by the first digit in M2 in a special
25746           loop instead of zeroing the product area.
25747
25748         * mpz_abs.c: New file.
25749
25750         * sdiv: Implement as mpz_div_si for speed.
25751
25752         * mpn_add: Make it work for second source operand == 0.
25753
25754         * msub: Negate the correct operand, i.e. V before swapping, not
25755           the smaller of U and V!
25756         * madd, msub: Update abs_* when swapping operands, and not after
25757           (optimization).
25758
25759 Fri Apr  5 00:19:36 1991  Torbjorn Granlund  (tege@black.nada.kth.se)
25760
25761         * mpn_sub: Make it work for subtrahend == 0.
25762
25763         * madd, msub: Rewrite to minimize mpn_cmp calls.  Ensure
25764           mpn_cmp is called with positive sizes (used to be called
25765           incorrectly with negative sizes sometimes).
25766
25767         * msqrt: Make it divide by zero if fed with a negative number.
25768         * Remove if statement at end of precision calculation that was
25769           never true.
25770
25771         * itom, mp.h: The argument is of type short, not int.
25772
25773         * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
25774
25775         * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
25776
25777         * Add COPYING to distribution.
25778
25779         * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
25780
25781 Fri Mar 15 00:26:29 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
25782
25783         * Add Copyleft headers to all files.
25784
25785         * mpn_mul.c, mpn_div.c: Add header comments.
25786         * mult.c, mdiv.c: Update header comments.
25787
25788         * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
25789           mpq_free.c: New files for rational arithmetics.
25790
25791         * mpn_lshift.c: Avoid writing the most significant word if it is 0.
25792
25793         * mdiv.c: Call mpn_lshift for the normalization.
25794         * mdiv.c: Remove #ifdefs.
25795
25796         * Makefile: Add ChangeLog to DISTFILES.
25797
25798         * mpn_div.c: Make the add_back code work (by removing abort()).
25799         * mpn_div.c: Make it return if the quotient is size as compared
25800           with the difference NSIZE - DSIZE.  If the stored quotient is
25801           larger than that, return 1, otherwise 0.
25802         * gmp.h: Fix mpn_div declaration.
25803         * mdiv.c: Adopt call to mpn_div.
25804         * mpz_div.c: New file (developed from mdiv.c).
25805
25806         * README: Update routine names.
25807
25808 Thu Mar 14 18:45:28 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
25809
25810         * mpq_mul.c: New file for rational multiplication.
25811
25812         * gmp.h: Add definitions for rational arithmetics.
25813
25814         * mpn_div: Kludge the case where the high numerator digit > the
25815           high denominator digit.  (This code is going to be optimized later.)
25816
25817         * New files: gmp.h for GNU specific functions, gmp-common.h for
25818           definitions common for mp.h and gmp.h.
25819
25820         * Ensure mp.h just defines what BSD mp.h defines.
25821
25822         * pow.c: Fix typo for bp allocation.
25823
25824         * Rename natural number functions to mpn_*, integer functions to
25825           mpz_*.
25826
25827 Tue Mar  5 18:47:04 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
25828
25829         * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
25830           "n0 >= r" to "n0 > r".
25831
25832         * msqrt: Tune the increasing precision scheme, to do fewer steps.
25833
25834 Tue Mar  3 18:50:10 1991  Torbjorn Granlund  (tege@musta.nada.kth.se)
25835
25836         * msqrt: Use the low level routines.  Use low precision in the
25837         beginning, and increase the precision as the result converges.
25838         (This optimization gave a 6-fold speedup.)