mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-22 06:07:49 +00:00
357c8c3fbe
Add patchset for MPFR 2.4.0 and 2.4.1, from upstream. /trunk/config/gmp_mpfr/mpfr.in | 8 6 2 0 + /trunk/patches/mpfr/2.4.0/100-printf-hh-ll.patch | 359 359 0 0 +++++++++++++++++++++++++++++ /trunk/patches/mpfr/2.4.0/110-mpfr_snprintf.patch | 176 176 0 0 ++++++++++++++ /trunk/patches/mpfr/2.4.1/100-remainder-neg.patch | 123 123 0 0 ++++++++++ /trunk/patches/mpfr/2.4.1/110-assert.patch | 45 45 0 0 ++++ 5 files changed, 709 insertions(+), 2 deletions(-)
124 lines
3.4 KiB
Diff
124 lines
3.4 KiB
Diff
diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
|
|
--- mpfr-2.4.1-a/PATCHES 2009-02-20 09:43:17.000000000 +0000
|
|
+++ mpfr-2.4.1-b/PATCHES 2009-02-27 16:56:29.000000000 +0000
|
|
@@ -0,0 +1 @@
|
|
+remainder-neg
|
|
diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
|
|
--- mpfr-2.4.1-a/VERSION 2009-02-25 16:16:08.000000000 +0000
|
|
+++ mpfr-2.4.1-b/VERSION 2009-02-27 16:55:37.000000000 +0000
|
|
@@ -1 +1 @@
|
|
-2.4.1
|
|
+2.4.1-p1
|
|
diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
|
|
--- mpfr-2.4.1-a/mpfr.h 2009-02-25 16:16:08.000000000 +0000
|
|
+++ mpfr-2.4.1-b/mpfr.h 2009-02-27 16:55:38.000000000 +0000
|
|
@@ -27,7 +27,7 @@
|
|
#define MPFR_VERSION_MAJOR 2
|
|
#define MPFR_VERSION_MINOR 4
|
|
#define MPFR_VERSION_PATCHLEVEL 1
|
|
-#define MPFR_VERSION_STRING "2.4.1"
|
|
+#define MPFR_VERSION_STRING "2.4.1-p1"
|
|
|
|
/* Macros dealing with MPFR VERSION */
|
|
#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
|
|
diff -Naurd mpfr-2.4.1-a/rem1.c mpfr-2.4.1-b/rem1.c
|
|
--- mpfr-2.4.1-a/rem1.c 2009-02-20 09:43:17.000000000 +0000
|
|
+++ mpfr-2.4.1-b/rem1.c 2009-02-27 16:55:15.000000000 +0000
|
|
@@ -170,7 +170,12 @@
|
|
}
|
|
|
|
if (mpz_cmp_ui (r, 0) == 0)
|
|
- inex = mpfr_set_ui (rem, 0, GMP_RNDN);
|
|
+ {
|
|
+ inex = mpfr_set_ui (rem, 0, GMP_RNDN);
|
|
+ /* take into account sign of x */
|
|
+ if (signx < 0)
|
|
+ mpfr_neg (rem, rem, GMP_RNDN);
|
|
+ }
|
|
else
|
|
{
|
|
if (rnd_q == GMP_RNDN)
|
|
@@ -190,6 +195,9 @@
|
|
*quo += 1;
|
|
}
|
|
}
|
|
+ /* take into account sign of x */
|
|
+ if (signx < 0)
|
|
+ mpz_neg (r, r);
|
|
inex = mpfr_set_z (rem, r, rnd);
|
|
/* if ex > ey, rem should be multiplied by 2^ey, else by 2^ex */
|
|
MPFR_EXP (rem) += (ex > ey) ? ey : ex;
|
|
@@ -198,13 +206,6 @@
|
|
if (quo)
|
|
*quo *= sign;
|
|
|
|
- /* take into account sign of x */
|
|
- if (signx < 0)
|
|
- {
|
|
- mpfr_neg (rem, rem, GMP_RNDN);
|
|
- inex = -inex;
|
|
- }
|
|
-
|
|
mpz_clear (mx);
|
|
mpz_clear (my);
|
|
mpz_clear (r);
|
|
diff -Naurd mpfr-2.4.1-a/tests/tremquo.c mpfr-2.4.1-b/tests/tremquo.c
|
|
--- mpfr-2.4.1-a/tests/tremquo.c 2009-02-20 09:43:15.000000000 +0000
|
|
+++ mpfr-2.4.1-b/tests/tremquo.c 2009-02-27 16:55:15.000000000 +0000
|
|
@@ -25,6 +25,36 @@
|
|
|
|
#include "mpfr-test.h"
|
|
|
|
+static void
|
|
+bug20090227 (void)
|
|
+{
|
|
+ mpfr_t x, y, r1, r2;
|
|
+ int inex1, inex2;
|
|
+
|
|
+ mpfr_init2 (x, 118);
|
|
+ mpfr_init2 (y, 181);
|
|
+ mpfr_init2 (r1, 140);
|
|
+ mpfr_init2 (r2, 140);
|
|
+ mpfr_set_si (x, -1, GMP_RNDN);
|
|
+ mpfr_set_str_binary (y, "1.100100100001111110110101010001000100001011010001100001000110100110001001100011001100010100010111000000011011100000111001101000100101001000000100100111000001000100010100110011111010");
|
|
+ inex1 = mpfr_remainder (r1, x, y, GMP_RNDU);
|
|
+ /* since the quotient is -1, r1 is the rounding of x+y */
|
|
+ inex2 = mpfr_add (r2, x, y, GMP_RNDU);
|
|
+ if (mpfr_cmp (r1, r2))
|
|
+ {
|
|
+ printf ("Error in mpfr_remainder (bug20090227)\n");
|
|
+ printf ("Expected ");
|
|
+ mpfr_dump (r2);
|
|
+ printf ("Got ");
|
|
+ mpfr_dump (r1);
|
|
+ exit (1);
|
|
+ }
|
|
+ mpfr_clear (x);
|
|
+ mpfr_clear (y);
|
|
+ mpfr_clear (r1);
|
|
+ mpfr_clear (r2);
|
|
+}
|
|
+
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
@@ -50,6 +80,8 @@
|
|
|
|
tests_start_mpfr ();
|
|
|
|
+ bug20090227 ();
|
|
+
|
|
mpfr_init (x);
|
|
mpfr_init (y);
|
|
mpfr_init (r);
|
|
diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
|
|
--- mpfr-2.4.1-a/version.c 2009-02-25 16:16:08.000000000 +0000
|
|
+++ mpfr-2.4.1-b/version.c 2009-02-27 16:55:38.000000000 +0000
|
|
@@ -25,5 +25,5 @@
|
|
const char *
|
|
mpfr_get_version (void)
|
|
{
|
|
- return "2.4.1";
|
|
+ return "2.4.1-p1";
|
|
}
|