pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/benchmarks/zelibm import "zelibm", a tool to check the...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6de2e0d8fea3
branches:  trunk
changeset: 497415:6de2e0d8fea3
user:      drochner <drochner%pkgsrc.org@localhost>
date:      Wed Jul 27 17:06:53 2005 +0000

description:
import "zelibm", a tool to check the accuracy of some libm functions,
by Ulrich Drepper

diffstat:

 benchmarks/zelibm/DESCR            |   8 +++
 benchmarks/zelibm/Makefile         |  21 ++++++++++
 benchmarks/zelibm/PLIST            |   2 +
 benchmarks/zelibm/distinfo         |   9 ++++
 benchmarks/zelibm/patches/patch-aa |  77 ++++++++++++++++++++++++++++++++++++++
 benchmarks/zelibm/patches/patch-ab |  21 ++++++++++
 benchmarks/zelibm/patches/patch-ac |  35 +++++++++++++++++
 benchmarks/zelibm/patches/patch-ad |  28 +++++++++++++
 benchmarks/zelibm/patches/patch-ae |  17 ++++++++
 9 files changed, 218 insertions(+), 0 deletions(-)

diffs (254 lines):

diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/DESCR   Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,8 @@
+A little program I wrote can be used to analyze the quality of the math
+library implementation. It simply computes the real result with a high
+precision and determines from this the error of the value the libm
+implementation produced. Very easy.
+To make the time waiting for the result a bit more interesting the program
+displays the error graphically in an updated window. Once the program is
+done it writes the plot in a GIF file which then can be used for later
+reference.
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/Makefile        Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+#
+
+DISTNAME=              zelibm
+PKGNAME=               zelibm-0
+CATEGORIES=            benchmarks
+MASTER_SITES=          http://people.redhat.com/drepper/libm/
+
+MAINTAINER=            tech-pkg%NetBSD.org@localhost
+HOMEPAGE=              http://people.redhat.com/drepper/libm/
+COMMENT=               Visual Math Library Quality Check
+
+USE_TOOLS+=            gmake
+
+do-install:
+       ${INSTALL_PROGRAM} ${WRKSRC}/libmtest ${PREFIX}/bin
+
+.include "../../mk/x11.buildlink3.mk"
+.include "../../devel/gmp/buildlink3.mk"
+.include "../../graphics/gd/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/PLIST   Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+bin/libmtest
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/distinfo        Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+
+SHA1 (zelibm.tar.gz) = 2fc4366ed466d766042b59c1ce303a1b53f722d3
+Size (zelibm.tar.gz) = 17616 bytes
+SHA1 (patch-aa) = f6ed33fc79d547cc559ba2343c160f18dd88e94d
+SHA1 (patch-ab) = 066bfcb106c946fd706d221d5e5b8dd8e9c9ece8
+SHA1 (patch-ac) = d7384d0c8878536057024253b281e9dd77936ea5
+SHA1 (patch-ad) = 24cc1d6d60a283d1f3922fb1b5223f4f01caacf5
+SHA1 (patch-ae) = 2ab8860c538040c040540529b5d2101c42b7b1eb
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/patches/patch-aa
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/patches/patch-aa        Wed Jul 27 17:06:53 2005 +0000
@@ -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);
+ }
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/patches/patch-ab
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/patches/patch-ab        Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-ab,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+
+--- libmtest.c.orig    2004-04-16 21:22:20.000000000 +0200
++++ libmtest.c 2004-04-16 21:23:56.000000000 +0200
+@@ -4,7 +4,6 @@
+    form on Microsoft and Be systems.  */
+ 
+ #include <errno.h>
+-#include <error.h>
+ #include <float.h>
+ #include <gmp.h>
+ #include <math.h>
+@@ -214,7 +213,7 @@
+   /* Allocate the memory for the result.  */
+   result = (double *) calloc (n,  2 * sizeof (double));
+   if (result == NULL)
+-    error (EXIT_FAILURE, errno, "cannot create array for result");
++    exit (EXIT_FAILURE);
+ 
+   for (cnt = 0; cnt < nprocs; ++cnt)
+     {
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/patches/patch-ac        Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-ac,v 1.1.1.1 2005/07/27 17:06:53 drochner 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 @@
+    As a special restriction the file must not be used in this or a modified
+    form on Microsoft and Be systems.  */
+ 
+-#include <ieee754.h>
++#include <machine/ieee.h>
+ #include <stdlib.h>
+ 
+ #include "zelibm.h"
+@@ -15,15 +15,15 @@
+   /* Get two 31 bit random numbers for the initial mantissa.  */
+   unsigned int r1 = random ();
+   unsigned int r2 = random ();
+-  union ieee754_double u;
++  union ieee_double_u u;
+   double res;
+ 
+-  u.ieee.negative = 0;
+-  u.ieee.exponent = IEEE754_DOUBLE_BIAS - 1;
+-  u.ieee.mantissa0 = r1 >> 1;
+-  u.ieee.mantissa1 = r2 | r1 << 31;
++  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);
+ 
+   while (res > high)
+     res /= 2.0;
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/patches/patch-ad
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/patches/patch-ad        Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,28 @@
+$NetBSD: patch-ad,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+
+--- image.c.orig       1998-11-25 03:55:32.000000000 +0100
++++ image.c    2004-04-16 22:30:55.000000000 +0200
+@@ -4,7 +4,6 @@
+    form on Microsoft and Be systems.  */
+ 
+ #include <errno.h>
+-#include <error.h>
+ #include <math.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -128,12 +127,12 @@
+ 
+   /* Write out the result.  */
+   strcpy (outname, name);
+-  strcat (outname, ".gif");
++  strcat (outname, ".png");
+   outfile = fopen (outname, "w");
+   if (outfile == NULL)
+-    error (EXIT_FAILURE, errno, "cannot open output file `%s'", outname);
++    exit (EXIT_FAILURE);
+ 
+-  gdImageGif (im_out, outfile);
++  gdImagePng (im_out, outfile);
+ 
+   fclose (outfile);
+ 
diff -r 4141304bb394 -r 6de2e0d8fea3 benchmarks/zelibm/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/benchmarks/zelibm/patches/patch-ae        Wed Jul 27 17:06:53 2005 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-ae,v 1.1.1.1 2005/07/27 17:06:53 drochner Exp $
+
+--- Makefile.orig      1998-11-30 03:37:23.000000000 +0100
++++ Makefile   2004-04-16 22:14:53.000000000 +0200
+@@ -3,9 +3,9 @@
+              zecos.c zecos_d.c zesinh.c zesinh_d.c zecosh.c zecosh_d.c \
+              zesqrt.c zesqrt_d.c zetan.c zetan_d.c zetanh.c zetanh_d.c
+ 
+-CFLAGS = -O -g -D_GNU_SOURCE -Wall
+-INCLUDES = -I. -I/usr/local/include -I/usr/X11R6/include -I/happy/clown/H-egcs-i686-linux-gnu/include
+-LDFLAGS = -L/usr/local/lib -L/usr/X11R6/lib
++#CFLAGS = -O -g -D_GNU_SOURCE -Wall
++INCLUDES = -I.
++#LDFLAGS = -L/usr/local/lib -L/usr/X11R6/lib
+ 
+ COMPILE = $(CC) -c -o $@ $(CFLAGS) $(INCLUDES) $<
+ 



Home | Main Index | Thread Index | Old Index