1 diff -r -x CVS -N -U 3 dist/ansi2knr.c dist.orig/ansi2knr.c
2 --- dist/ansi2knr.c 2011-04-04 12:19:46.000000000 +0200
3 +++ dist.orig/ansi2knr.c 2011-06-20 07:53:13.000000000 +0200
5 /* Copyright (C) 1989, 2000 Aladdin Enterprises. All rights reserved. */
7 -/*$Id: ansi2knr.c,v 1.14 2003/09/06 05:36:56 eggert Exp $*/
8 +/*$Id: ansi2knr.c,v 1.1.1.1 2011/06/20 05:53:13 mrg Exp $*/
9 /* Convert ANSI C function definitions to K&R ("traditional C") syntax */
12 diff -r -x CVS -N -U 3 dist/asin.c dist.orig/asin.c
13 --- dist/asin.c 2011-04-04 12:19:18.000000000 +0200
14 +++ dist.orig/asin.c 2011-07-06 21:53:24.000000000 +0200
17 compared = mpfr_cmp_ui (xp, 1);
19 + MPFR_SAVE_EXPO_MARK (expo);
21 if (MPFR_UNLIKELY (compared >= 0))
24 if (compared > 0) /* asin(x) = NaN for |x| > 1 */
26 + MPFR_SAVE_EXPO_FREE (expo);
31 inexact = -mpfr_const_pi (asin, MPFR_INVERT_RND(rnd_mode));
32 MPFR_CHANGE_SIGN (asin);
34 - mpfr_div_2ui (asin, asin, 1, rnd_mode); /* May underflow */
36 + mpfr_div_2ui (asin, asin, 1, rnd_mode);
40 - MPFR_SAVE_EXPO_MARK (expo);
44 /* Compute exponent of 1 - ABS(x) */
45 mpfr_ui_sub (xp, 1, xp, MPFR_RNDD);
46 MPFR_ASSERTD (MPFR_GET_EXP (xp) <= 0);
48 inexact = mpfr_set (asin, xp, rnd_mode);
53 MPFR_SAVE_EXPO_FREE (expo);
54 return mpfr_check_range (asin, inexact, rnd_mode);
55 diff -r -x CVS -N -U 3 dist/atan.c dist.orig/atan.c
56 --- dist/atan.c 2011-04-04 12:19:18.000000000 +0200
57 +++ dist.orig/atan.c 2011-07-06 21:53:24.000000000 +0200
59 MPFR_GROUP_CLEAR (group);
61 MPFR_SAVE_EXPO_FREE (expo);
62 - return mpfr_check_range (arctgt, inexact, rnd_mode);
63 + return mpfr_check_range (atan, inexact, rnd_mode);
65 diff -r -x CVS -N -U 3 dist/config.guess dist.orig/config.guess
66 --- dist/config.guess 2011-04-04 12:19:46.000000000 +0200
67 +++ dist.orig/config.guess 2012-07-19 21:34:26.000000000 +0200
69 sparc:Linux:*:* | sparc64:Linux:*:*)
70 echo ${UNAME_MACHINE}-unknown-linux-gnu
73 + echo ${UNAME_MACHINE}-unknown-linux-gnu
76 echo ${UNAME_MACHINE}-dec-linux-gnu
78 diff -r -x CVS -N -U 3 dist/Makefile.in dist.orig/Makefile.in
79 --- dist/Makefile.in 2011-04-04 12:19:46.000000000 +0200
80 +++ dist.orig/Makefile.in 2011-06-21 06:03:33.000000000 +0200
82 $(SHELL) ./config.status --recheck
84 $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
85 + @echo "NOT REBUILDING $@"
86 +NetBSD_DISABLED_configure:
87 $(am__cd) $(srcdir) && $(AUTOCONF)
88 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
89 + @echo "NOT REBUILDING $@"
90 +NetBSD_DISABLED_aclocal:
91 $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
92 $(am__aclocal_m4_deps):
93 mparam.h: $(top_builddir)/config.status $(srcdir)/mparam_h.in
95 # should not be a problem in practice, in particular because "make dist"
96 # automatically rebuilds get_patches.c before generating the archives.
97 $(srcdir)/get_patches.c: PATCHES get_patches.sh
98 + @echo "NOT REBUILDING $@"
99 +NetBSD_DISABLED_get_patches.c:
100 (cd $(srcdir) && ./get_patches.sh) > $@ || rm -f $@
103 diff -r -x CVS -N -U 3 dist/mpfr.h dist.orig/mpfr.h
104 --- dist/mpfr.h 2011-04-04 12:19:18.000000000 +0200
105 +++ dist.orig/mpfr.h 2011-07-06 21:53:24.000000000 +0200
107 #define MPFR_VERSION_MAJOR 3
108 #define MPFR_VERSION_MINOR 0
109 #define MPFR_VERSION_PATCHLEVEL 1
110 -#define MPFR_VERSION_STRING "3.0.1"
111 +#define MPFR_VERSION_STRING "3.0.1-p4"
113 /* Macros dealing with MPFR VERSION */
114 #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
115 diff -r -x CVS -N -U 3 dist/PATCHES dist.orig/PATCHES
116 --- dist/PATCHES 2011-04-04 12:19:18.000000000 +0200
117 +++ dist.orig/PATCHES 2011-07-06 21:53:24.000000000 +0200
123 diff -r -x CVS -N -U 3 dist/rec_sqrt.c dist.orig/rec_sqrt.c
124 --- dist/rec_sqrt.c 2011-04-04 12:19:18.000000000 +0200
125 +++ dist.orig/rec_sqrt.c 2011-07-06 21:53:24.000000000 +0200
126 @@ -375,20 +375,37 @@
127 MPFR_ASSERTD(un == ln + 1 || un == ln + 2);
128 /* the high un-ln limbs of u will overlap the low part of {x+ln,xn},
129 we need to add or subtract the overlapping part {u + ln, un - ln} */
130 + /* Warning! th may be 0, in which case the mpn_add_1 and mpn_sub_1
131 + below (with size = th) mustn't be used. In such a case, the limb
132 + (carry) will be 0, so that this is semantically a no-op, but if
133 + mpn_add_1 and mpn_sub_1 are used, GMP (currently) still does a
134 + non-atomic read/write in a place that is not always allocated,
135 + with the possible consequences: a crash if the corresponding
136 + address is not mapped, or (rather unlikely) memory corruption
137 + if another process/thread writes at the same place; things may
138 + be worse with future GMP versions. Hence the tests carry != 0. */
143 cy = mpn_add (x + ln, x + ln, xn, u + ln, un - ln);
145 - cy += mpn_add_1 (x + un, x + un, th, cu);
148 + MPFR_ASSERTD (th != 0);
149 + cy += mpn_add_1 (x + un, x + un, th, cu);
152 else /* negative case */
154 /* subtract {u+ln, un-ln} from {x+ln,un} */
155 cy = mpn_sub (x + ln, x + ln, xn, u + ln, un - ln);
156 /* carry cy is at x+un, like cu */
157 - cy = mpn_sub_1 (x + un, x + un, th, cy + cu); /* n - un = th */
160 + MPFR_ASSERTD (th != 0);
161 + cy = mpn_sub_1 (x + un, x + un, th, cy + cu); /* n - un = th */
163 /* cy cannot be zero, since the most significant bit of Xh is 1,
164 and the correction is bounded by 2^{-h+3} */
165 MPFR_ASSERTD(cy == 0);
166 diff -r -x CVS -N -U 3 dist/tests/tasin.c dist.orig/tests/tasin.c
167 --- dist/tests/tasin.c 2011-04-04 12:19:17.000000000 +0200
168 +++ dist.orig/tests/tasin.c 2011-07-06 21:53:24.000000000 +0200
174 +reduced_expo_range (void)
176 + mpfr_exp_t emin, emax;
179 + unsigned int flags, ex_flags;
181 + emin = mpfr_get_emin ();
182 + emax = mpfr_get_emax ();
184 + mpfr_inits2 (4, x, y, ex_y, (mpfr_ptr) 0);
185 + mpfr_set_str (x, "-0.1e1", 2, MPFR_RNDN);
189 + mpfr_clear_flags ();
190 + inex = mpfr_asin (y, x, MPFR_RNDA);
191 + flags = __gmpfr_flags;
192 + mpfr_set_emin (emin);
193 + mpfr_set_emax (emax);
195 + mpfr_set_str (ex_y, "-0.1101e1", 2, MPFR_RNDN);
197 + ex_flags = MPFR_FLAGS_INEXACT;
199 + if (SIGN (inex) != ex_inex || flags != ex_flags ||
200 + ! mpfr_equal_p (y, ex_y))
202 + printf ("Error in reduced_expo_range\non x = ");
204 + printf ("Expected y = ");
205 + mpfr_out_str (stdout, 2, 0, ex_y, MPFR_RNDN);
206 + printf ("\n inex = %d, flags = %u\n", ex_inex, ex_flags);
207 + printf ("Got y = ");
208 + mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
209 + printf ("\n inex = %d, flags = %u\n", SIGN (inex), flags);
213 + mpfr_clears (x, y, ex_y, (mpfr_ptr) 0);
223 + reduced_expo_range ();
225 test_generic (2, 100, 15);
227 diff -r -x CVS -N -U 3 dist/tests/tatan.c dist.orig/tests/tatan.c
228 --- dist/tests/tatan.c 2011-04-04 12:19:17.000000000 +0200
229 +++ dist.orig/tests/tatan.c 2011-07-06 21:53:24.000000000 +0200
231 mpfr_clears (a, x, y, (mpfr_ptr) 0);
234 +/* http://websympa.loria.fr/wwsympa/arc/mpfr/2011-05/msg00008.html
235 + * Incorrect flags (in debug mode on a 32-bit machine, assertion failure).
238 +reduced_expo_range (void)
240 + mpfr_exp_t emin, emax;
243 + unsigned int flags, ex_flags;
245 + emin = mpfr_get_emin ();
246 + emax = mpfr_get_emax ();
248 + mpfr_inits2 (12, x, y, ex_y, (mpfr_ptr) 0);
249 + mpfr_set_str (x, "0.1e-5", 2, MPFR_RNDN);
251 + mpfr_set_emin (-5);
252 + mpfr_set_emax (-5);
253 + mpfr_clear_flags ();
254 + inex = mpfr_atan (y, x, MPFR_RNDN);
255 + flags = __gmpfr_flags;
256 + mpfr_set_emin (emin);
257 + mpfr_set_emax (emax);
259 + mpfr_set_str (ex_y, "0.1e-5", 2, MPFR_RNDN);
261 + ex_flags = MPFR_FLAGS_INEXACT;
263 + if (SIGN (inex) != ex_inex || flags != ex_flags ||
264 + ! mpfr_equal_p (y, ex_y))
266 + printf ("Error in reduced_expo_range\non x = ");
268 + printf ("Expected y = ");
269 + mpfr_out_str (stdout, 2, 0, ex_y, MPFR_RNDN);
270 + printf ("\n inex = %d, flags = %u\n", ex_inex, ex_flags);
271 + printf ("Got y = ");
272 + mpfr_out_str (stdout, 2, 0, y, MPFR_RNDN);
273 + printf ("\n inex = %d, flags = %u\n", SIGN (inex), flags);
277 + mpfr_clears (x, y, ex_y, (mpfr_ptr) 0);
281 main (int argc, char *argv[])
285 atan2_bug_20071003 ();
286 atan2_different_prec ();
287 + reduced_expo_range ();
289 test_generic_atan (2, 200, 17);
290 test_generic_atan2 (2, 200, 17);
291 diff -r -x CVS -N -U 3 dist/tests/texp.c dist.orig/tests/texp.c
292 --- dist/tests/texp.c 2011-04-04 12:19:17.000000000 +0200
293 +++ dist.orig/tests/texp.c 2011-07-06 21:53:24.000000000 +0200
295 mpfr_set_prec (x, prec);
296 mpfr_set_prec (y, prec);
297 mpfr_set_prec (z, prec);
298 - mpfr_urandomb (x, RANDS);
300 + mpfr_urandomb (x, RANDS);
301 + while (MPFR_IS_ZERO (x)); /* 0 is handled by mpfr_exp only */
303 mpfr_exp_2 (y, x, rnd);
304 mpfr_exp_3 (z, x, rnd);
305 diff -r -x CVS -N -U 3 dist/VERSION dist.orig/VERSION
306 --- dist/VERSION 2011-04-04 12:19:18.000000000 +0200
307 +++ dist.orig/VERSION 2011-07-06 21:53:24.000000000 +0200
311 diff -r -x CVS -N -U 3 dist/version.c dist.orig/version.c
312 --- dist/version.c 2011-04-04 12:19:18.000000000 +0200
313 +++ dist.orig/version.c 2011-07-06 21:53:24.000000000 +0200
316 mpfr_get_version (void)