summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorsbd <sbd@pkgsrc.org>2013-04-01 07:35:03 +0000
committersbd <sbd@pkgsrc.org>2013-04-01 07:35:03 +0000
commita021665ac6a6be65462be616573be34febfce124 (patch)
tree5e9cc3f11dac8e87bf62b1a88cc0a403bf43483c /benchmarks
parent74677fd2b3c7cea4cde867195b44859750d78ef6 (diff)
downloadpkgsrc-a021665ac6a6be65462be616573be34febfce124.tar.gz
Use pre-processing to make the changes introduced by patch-aa & patch-ac
as the original code is needed for linux.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/zelibm/distinfo6
-rw-r--r--benchmarks/zelibm/patches/patch-aa69
-rw-r--r--benchmarks/zelibm/patches/patch-ac36
3 files changed, 75 insertions, 36 deletions
diff --git a/benchmarks/zelibm/distinfo b/benchmarks/zelibm/distinfo
index 863de43bb9f..97c6940f680 100644
--- a/benchmarks/zelibm/distinfo
+++ b/benchmarks/zelibm/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.4 2005/12/28 13:19:26 joerg Exp $
+$NetBSD: distinfo,v 1.5 2013/04/01 07:35:03 sbd Exp $
SHA1 (zelibm.tar.gz) = 2fc4366ed466d766042b59c1ce303a1b53f722d3
RMD160 (zelibm.tar.gz) = 5c070996216f2a91f4c0b496662210d44b0ac517
Size (zelibm.tar.gz) = 17616 bytes
-SHA1 (patch-aa) = 117b5146284ff0becd918a2a81cc33ca0c1b6a93
+SHA1 (patch-aa) = bfd4a0952d5b71ca99fb159be159862749b60a15
SHA1 (patch-ab) = 066bfcb106c946fd706d221d5e5b8dd8e9c9ece8
-SHA1 (patch-ac) = d7384d0c8878536057024253b281e9dd77936ea5
+SHA1 (patch-ac) = b87613411e77f15efbcef0f8f52b4c1c369594e4
SHA1 (patch-ad) = 24cc1d6d60a283d1f3922fb1b5223f4f01caacf5
SHA1 (patch-ae) = 0043a7c313b2b24b9168dd4463f88df933b0c6c5
diff --git a/benchmarks/zelibm/patches/patch-aa b/benchmarks/zelibm/patches/patch-aa
index b8d3d9cd0f5..ab5606bca83 100644
--- a/benchmarks/zelibm/patches/patch-aa
+++ b/benchmarks/zelibm/patches/patch-aa
@@ -1,78 +1,107 @@
-$NetBSD: patch-aa,v 1.2 2005/08/02 14:53:25 drochner Exp $
+$NetBSD: patch-aa,v 1.3 2013/04/01 07:35:04 sbd Exp $
---- dbl2mpq.c.orig 1998-11-24 06:06:54.000000000 +0100
+--- dbl2mpq.c.orig 1998-11-24 05:06:54.000000000 +0000
+++ dbl2mpq.c
-@@ -5,7 +5,8 @@
+@@ -5,7 +5,12 @@
#include <float.h>
#include <gmp.h>
--#include <ieee754.h>
++#ifdef __linux__
+ #include <ieee754.h>
++#else
+#include <sys/types.h>
+#include <machine/ieee.h>
++#endif
#include <stdlib.h>
#include "zelibm.h"
-@@ -14,50 +15,50 @@
+@@ -14,50 +19,89 @@
void
extract_double (mpq_t r, double d)
{
-- union ieee754_double u;
++#ifdef __linux__
+ union ieee754_double u;
++#else
+ union ieee_double_u u;
++#endif
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;
++#ifdef __linux__
+ u.d = d;
++#else
+ u.dblu_d = d;
++#endif
mpq_init (r);
/* Set the high word and the denominator to 1. */
-- val = u.ieee.mantissa0;
-- if (u.ieee.exponent != 0)
++#ifdef __linux__
+ val = u.ieee.mantissa0;
+ if (u.ieee.exponent != 0)
++#else
+ val = u.dblu_dbl.dbl_frach;
+ if (u.dblu_dbl.dbl_exp != 0)
++#endif
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);
++#ifdef __linux__
+ mpz_add_ui (mpq_numref (r), mpq_numref (r), u.ieee.mantissa1);
-- if (u.ieee.exponent == 0)
-+ if (u.dblu_dbl.dbl_exp == 0)
+ if (u.ieee.exponent == 0)
{
-- if (u.ieee.mantissa0 != 0 && u.ieee.mantissa1 != 0)
+ if (u.ieee.mantissa0 != 0 && u.ieee.mantissa1 != 0)
++#else
++ mpz_add_ui (mpq_numref (r), mpq_numref (r), u.dblu_dbl.dbl_fracl);
++
++ if (u.dblu_dbl.dbl_exp == 0)
++ {
+ if (u.dblu_dbl.dbl_frach != 0 && u.dblu_dbl.dbl_fracl != 0)
++#endif
{
/* 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)
++#ifdef __linux__
+ else if (u.ieee.exponent >= IEEE754_DOUBLE_BIAS + DBL_MANT_DIG)
++#else
+ else if (u.dblu_dbl.dbl_exp >= DBL_EXP_BIAS + DBL_MANT_DIG)
++#endif
{
/* 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)));
++#ifdef __linux__
+ (u.ieee.exponent
+ - (IEEE754_DOUBLE_BIAS + DBL_MANT_DIG - 1)));
++#else
+ (u.dblu_dbl.dbl_exp
+ - (DBL_EXP_BIAS + DBL_MANT_DIG - 1)));
++#endif
}
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));
++#ifdef __linux__
+ ((IEEE754_DOUBLE_BIAS + DBL_MANT_DIG - 1)
+ - u.ieee.exponent));
++#else
+ ((DBL_EXP_BIAS + DBL_MANT_DIG - 1)
+ - u.dblu_dbl.dbl_exp));
++#endif
}
-- if (u.ieee.negative)
++#ifdef __linux__
+ if (u.ieee.negative)
++#else
+ if (u.dblu_dbl.dbl_sign)
++#endif
mpq_neg (r, r);
}
diff --git a/benchmarks/zelibm/patches/patch-ac b/benchmarks/zelibm/patches/patch-ac
index fcc9b938c41..581a248f03f 100644
--- a/benchmarks/zelibm/patches/patch-ac
+++ b/benchmarks/zelibm/patches/patch-ac
@@ -1,35 +1,45 @@
-$NetBSD: patch-ac,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+$NetBSD: patch-ac,v 1.2 2013/04/01 07:35:04 sbd Exp $
---- zerandom.c.orig 2004-04-16 21:53:15.000000000 +0200
-+++ zerandom.c 2004-04-16 21:57:46.000000000 +0200
-@@ -3,7 +3,7 @@
+--- zerandom.c.orig 1998-11-24 05:08:12.000000000 +0000
++++ zerandom.c
+@@ -3,7 +3,11 @@
As a special restriction the file must not be used in this or a modified
form on Microsoft and Be systems. */
--#include <ieee754.h>
++#ifdef __linux__
+ #include <ieee754.h>
++#else
+#include <machine/ieee.h>
++#endif
#include <stdlib.h>
#include "zelibm.h"
-@@ -15,15 +15,15 @@
+@@ -15,15 +19,28 @@ zerandom (double low, double high)
/* Get two 31 bit random numbers for the initial mantissa. */
unsigned int r1 = random ();
unsigned int r2 = random ();
-- union ieee754_double u;
++#ifdef __linux__
+ union ieee754_double u;
++#else
+ union ieee_double_u u;
++#endif
double res;
-- u.ieee.negative = 0;
-- u.ieee.exponent = IEEE754_DOUBLE_BIAS - 1;
-- u.ieee.mantissa0 = r1 >> 1;
-- u.ieee.mantissa1 = r2 | r1 << 31;
++#ifdef __linux__
+ u.ieee.negative = 0;
+ u.ieee.exponent = IEEE754_DOUBLE_BIAS - 1;
+ u.ieee.mantissa0 = r1 >> 1;
+ u.ieee.mantissa1 = r2 | r1 << 31;
+
+ res = low + 2 * (u.d - 0.5) * (high - low);
++#else
+ u.dblu_dbl.dbl_sign = 0;
+ u.dblu_dbl.dbl_exp = DBL_EXP_BIAS - 1;
+ u.dblu_dbl.dbl_frach = r1 >> 1;
+ u.dblu_dbl.dbl_fracl = r2 | r1 << 31;
-
-- res = low + 2 * (u.d - 0.5) * (high - low);
++
+ res = low + 2 * (u.dblu_d - 0.5) * (high - low);
++#endif
while (res > high)
res /= 2.0;