summaryrefslogtreecommitdiff
path: root/benchmarks/zelibm/patches/patch-aa
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks/zelibm/patches/patch-aa')
-rw-r--r--benchmarks/zelibm/patches/patch-aa77
1 files changed, 77 insertions, 0 deletions
diff --git a/benchmarks/zelibm/patches/patch-aa b/benchmarks/zelibm/patches/patch-aa
new file mode 100644
index 00000000000..edd2a02c646
--- /dev/null
+++ b/benchmarks/zelibm/patches/patch-aa
@@ -0,0 +1,77 @@
+$NetBSD: patch-aa,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+
+--- dbl2mpq.c.orig 2004-04-16 21:29:16.000000000 +0200
++++ dbl2mpq.c 2004-04-16 21:52:52.000000000 +0200
+@@ -5,7 +5,7 @@
+
+ #include <float.h>
+ #include <gmp.h>
+-#include <ieee754.h>
++#include <machine/ieee.h>
+ #include <stdlib.h>
+
+ #include "zelibm.h"
+@@ -14,50 +14,50 @@
+ void
+ extract_double (mpq_t r, double d)
+ {
+- union ieee754_double u;
++ union ieee_double_u u;
+ unsigned int val;
+
+ /* Make the floating point value available in the broken down form. We
+ cannot use casting of pointers and other ugly ways to access the bits.
+ Using the union is the only half-way clean method. */
+- u.d = d;
++ u.dblu_d = d;
+
+ mpq_init (r);
+
+ /* Set the high word and the denominator to 1. */
+- val = u.ieee.mantissa0;
+- if (u.ieee.exponent != 0)
++ val = u.dblu_dbl.dbl_frach;
++ if (u.dblu_dbl.dbl_exp != 0)
+ val |= 1 << (DBL_MANT_DIG - 32 - 1);
+ mpq_set_ui (r, val, 1);
+ /* Shift in the right position. */
+ mpz_mul_2exp (mpq_numref (r), mpq_numref (r), 32);
+ /* Add the lower word. */
+- mpz_add_ui (mpq_numref (r), mpq_numref (r), u.ieee.mantissa1);
++ mpz_add_ui (mpq_numref (r), mpq_numref (r), u.dblu_dbl.dbl_fracl);
+
+- if (u.ieee.exponent == 0)
++ if (u.dblu_dbl.dbl_exp == 0)
+ {
+- if (u.ieee.mantissa0 != 0 && u.ieee.mantissa1 != 0)
++ if (u.dblu_dbl.dbl_frach != 0 && u.dblu_dbl.dbl_fracl != 0)
+ {
+ /* The number is a denormalized. */
+ mpz_mul_2exp (mpq_denref (r), mpq_denref (r),
+ -DBL_MIN_EXP + DBL_MANT_DIG + 1);
+ }
+ }
+- else if (u.ieee.exponent >= IEEE754_DOUBLE_BIAS + DBL_MANT_DIG)
++ else if (u.dblu_dbl.dbl_exp >= DBL_EXP_BIAS + DBL_MANT_DIG)
+ {
+ /* We have to multiply the numerator with the exponent. */
+ mpz_mul_2exp (mpq_numref (r), mpq_numref (r),
+- (u.ieee.exponent
+- - (IEEE754_DOUBLE_BIAS + DBL_MANT_DIG - 1)));
++ (u.dblu_dbl.dbl_exp
++ - (DBL_EXP_BIAS + DBL_MANT_DIG - 1)));
+ }
+ else
+ {
+ /* Set denominator to the appropriate power of 2. */
+ mpz_mul_2exp (mpq_denref (r), mpq_denref (r),
+- ((IEEE754_DOUBLE_BIAS + DBL_MANT_DIG - 1)
+- - u.ieee.exponent));
++ ((DBL_EXP_BIAS + DBL_MANT_DIG - 1)
++ - u.dblu_dbl.dbl_exp));
+ }
+
+- if (u.ieee.negative)
++ if (u.dblu_dbl.dbl_sign)
+ mpq_neg (r, r);
+ }