]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
In fbench, compute sin/cos/sqrt from "first principles", so that the
authorJulian Seward <jseward@acm.org>
Wed, 28 Dec 2005 04:18:20 +0000 (04:18 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 28 Dec 2005 04:18:20 +0000 (04:18 +0000)
program more uniformly measures the speed of FP +/-/* load/store
across different architectures.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5455

perf/Makefile.am
perf/fbench.c

index de0384b771dae2d59be0273e2763119b2305cc02..ba8d3225d49a28cd2dc9d3aac8eb9460acc3bb48 100644 (file)
@@ -21,6 +21,6 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_builddir)/include
 AM_CXXFLAGS = $(AM_CFLAGS)
 
 # Extra stuff
-fbench_LDADD   = -lm
+fbench_CFLAGS   = -g -O2
+fbench_LDADD   = 
 ffbench_LDADD  = -lm
-
index 83e573fe33b7d0154fc630b39fae20e84832e62b..79bbb3ec5e19aada4fb6511116115e8284442cbe 100644 (file)
@@ -8,6 +8,16 @@
 //   site is in the public domain and may be used in any manner without
 //   permission, restriction, attribution, or compensation."
 
+/* This program can be used in two ways.  If INTRIG is undefined, sin,
+   cos, tan, etc, will be used as supplied by <math.h>.  If it is
+   defined, then the program calculates all this stuff from first
+   principles (so to speak) and does not use the libc facilities.  For
+   benchmarking purposes it seems better to avoid the libc stuff, so
+   that the inner loops (sin, sqrt) present a workload independent of
+   libc implementations on different platforms.  Hence: */
+
+#define INTRIG 1
+
 
 /*
 
 
 */
 
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -289,7 +300,7 @@ int itercount;                         /* The iteration counter for the main loop
                                      tracing code. */
 
 #ifndef ITERATIONS
-#define ITERATIONS /*1000*/ /*500000*/ 125000
+#define ITERATIONS /*1000*/ /*500000*/ 80000
 #endif
 int niter = ITERATIONS;           /* Iteration counter */