diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-10-07 11:51:24 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-10-07 11:51:25 +0530 |
commit | a357259bf854478d154727bbc9e39f89c952f6cc (patch) | |
tree | 11e1d64d36fbfb9c3ed40215ac7cebfee6f6e004 /benchtests | |
parent | 9ec1b13d0162034464202b06d81b9daa9fe840e7 (diff) | |
download | glibc-a357259bf854478d154727bbc9e39f89c952f6cc.zip glibc-a357259bf854478d154727bbc9e39f89c952f6cc.tar.gz glibc-a357259bf854478d154727bbc9e39f89c952f6cc.tar.bz2 |
Add more directives to benchmark input files
This patch adds some more directives to the benchmark inputs file,
moving functionality from the Makefile and making the code generation
script a bit cleaner. The function argument and return types that
were earlier added as variables in the makefile and passed to the
script via command line arguments are now the 'args' and 'ret'
directive respectively. 'args' should be a colon separated list of
argument types (skipped if the function doesn't accept any arguments)
and 'ret' should be the return type.
Additionally, an 'includes' directive may have a comma separated list
of headers to include in the source. For example, the pow input file
now looks like this:
42.0, 42.0
1.0000000000000020, 1.5
I did this to unclutter the benchtests Makefile a bit and eventually
eliminate dependency of the tests on the Makefile and have tests
depend on their respective include files only.
Diffstat (limited to 'benchtests')
-rw-r--r-- | benchtests/Makefile | 51 | ||||
-rw-r--r-- | benchtests/README | 35 | ||||
-rw-r--r-- | benchtests/acos-inputs | 3 | ||||
-rw-r--r-- | benchtests/acosh-inputs | 3 | ||||
-rw-r--r-- | benchtests/asin-inputs | 3 | ||||
-rw-r--r-- | benchtests/asinh-inputs | 3 | ||||
-rw-r--r-- | benchtests/atan-inputs | 3 | ||||
-rw-r--r-- | benchtests/atanh-inputs | 3 | ||||
-rw-r--r-- | benchtests/cos-inputs | 3 | ||||
-rw-r--r-- | benchtests/cosh-inputs | 3 | ||||
-rw-r--r-- | benchtests/exp-inputs | 3 | ||||
-rw-r--r-- | benchtests/log-inputs | 3 | ||||
-rw-r--r-- | benchtests/pow-inputs | 3 | ||||
-rw-r--r-- | benchtests/rint-inputs | 3 | ||||
-rw-r--r-- | benchtests/sin-inputs | 3 | ||||
-rw-r--r-- | benchtests/sinh-inputs | 3 | ||||
-rw-r--r-- | benchtests/tan-inputs | 3 | ||||
-rw-r--r-- | benchtests/tanh-inputs | 3 |
18 files changed, 67 insertions, 67 deletions
diff --git a/benchtests/Makefile b/benchtests/Makefile index 4f4bd54..aec395a 100644 --- a/benchtests/Makefile +++ b/benchtests/Makefile @@ -34,70 +34,22 @@ string-bench-all := $(string-bench) $(string-bench-ifunc) benchset := $(string-bench-all) -acos-ARGLIST = double -acos-RET = double LDLIBS-bench-acos = -lm - -acosh-ARGLIST = double -acosh-RET = double LDLIBS-bench-acosh = -lm - -asin-ARGLIST = double -asin-RET = double LDLIBS-bench-asin = -lm - -asinh-ARGLIST = double -asinh-RET = double LDLIBS-bench-asinh = -lm - -atan-ARGLIST = double -atan-RET = double LDLIBS-bench-atan = -lm - -atanh-ARGLIST = double -atanh-RET = double LDLIBS-bench-atanh = -lm - -cos-ARGLIST = double -cos-RET = double LDLIBS-bench-cos = -lm - -cosh-ARGLIST = double -cosh-RET = double LDLIBS-bench-cosh = -lm - -exp-ARGLIST = double -exp-RET = double LDLIBS-bench-exp = -lm - -log-ARGLIST = double -log-RET = double LDLIBS-bench-log = -lm - -pow-ARGLIST = double:double -pow-RET = double LDLIBS-bench-pow = -lm - -rint-ARGLIST = double -rint-RET = double LDLIBS-bench-rint = -lm - -sin-ARGLIST = double -sin-RET = double LDLIBS-bench-sin = -lm - -sinh-ARGLIST = double -sinh-RET = double LDLIBS-bench-sinh = -lm - -tan-ARGLIST = double -tan-RET = double LDLIBS-bench-tan = -lm - -tanh-ARGLIST = double -tanh-RET = double LDLIBS-bench-tanh = -lm - LDLIBS-bench-sincos = -lm @@ -171,6 +123,5 @@ $(objpfx)bench-%.c: %-inputs $(bench-deps) { if [ -n "$($*-INCLUDE)" ]; then \ cat $($*-INCLUDE); \ fi; \ - $(..)scripts/bench.pl $(patsubst %-inputs,%,$<) \ - $($*-ARGLIST) $($*-RET); } > $@-tmp + $(..)scripts/bench.pl $(patsubst %-inputs,%,$<); } > $@-tmp mv -f $@-tmp $@ diff --git a/benchtests/README b/benchtests/README index 045b7a6..5faca53 100644 --- a/benchtests/README +++ b/benchtests/README @@ -40,23 +40,24 @@ one to add `foo' to the bench tests: - Append the function name to the bench variable in the Makefile. -- Define foo-ARGLIST as a colon separated list of types of the input - arguments. Use `void' if function does not take any inputs. Put in quotes - if the input argument is a pointer, e.g.: - - malloc-ARGLIST: "void *" - -- Define foo-RET as the type the function returns. Skip if the function - returns void. One could even skip foo-ARGLIST if the function does not - take any inputs AND the function returns void. - -- Make a file called `foo-inputs` with one input value per line, an input - being a comma separated list of arguments to be passed into the function. - See pow-inputs for an example. - - The script that parses the -inputs file treats lines beginning with a single - `#' as comments. Lines beginning with two hashes `##' are treated specially - as `directives'. +- Make a file called `foo-inputs` to provide the definition and input for the + function. The file should have some directives telling the parser script + about the function and then one input per line. Directives are lines that + have a special meaning for the parser and they begin with two hashes '##'. + The following directives are recognized: + + - args: This should be assigned a colon separated list of types of the input + arguments. This directive may be skipped if the function does not take any + inputs. + - ret: This should be assigned the type that the function returns. This + directive may be skipped if the function does not return a value. + - includes: This should be assigned a comma separated list of headers that + need to be included to provide declarations for the function and types it + may need. + - name: See following section for instructions on how to use this directive. + + Lines beginning with a single hash '#' are treated as comments. See + pow-inputs for an example of an input file. Multiple execution units per function: ===================================== diff --git a/benchtests/acos-inputs b/benchtests/acos-inputs index b527af3..080a4e9 100644 --- a/benchtests/acos-inputs +++ b/benchtests/acos-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.5 0.1 0.2 diff --git a/benchtests/acosh-inputs b/benchtests/acosh-inputs index 3c8c546..84a603d 100644 --- a/benchtests/acosh-inputs +++ b/benchtests/acosh-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.1 0.2 0.3 diff --git a/benchtests/asin-inputs b/benchtests/asin-inputs index b527af3..080a4e9 100644 --- a/benchtests/asin-inputs +++ b/benchtests/asin-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.5 0.1 0.2 diff --git a/benchtests/asinh-inputs b/benchtests/asinh-inputs index 3c8c546..84a603d 100644 --- a/benchtests/asinh-inputs +++ b/benchtests/asinh-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.1 0.2 0.3 diff --git a/benchtests/atan-inputs b/benchtests/atan-inputs index 4a2cf3a..e88e384 100644 --- a/benchtests/atan-inputs +++ b/benchtests/atan-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0x1.000000c5cba86p0 0x1.000001883003ap0 0x1.00000dfb2b674p0 diff --git a/benchtests/atanh-inputs b/benchtests/atanh-inputs index 3c8c546..84a603d 100644 --- a/benchtests/atanh-inputs +++ b/benchtests/atanh-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.1 0.2 0.3 diff --git a/benchtests/cos-inputs b/benchtests/cos-inputs index 82a4060..c7bbaad 100644 --- a/benchtests/cos-inputs +++ b/benchtests/cos-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0x1.000000cf4a2a1p0 0x1.0000010b239a8p0 0x1.00000162a932ap0 diff --git a/benchtests/cosh-inputs b/benchtests/cosh-inputs index 3c8c546..84a603d 100644 --- a/benchtests/cosh-inputs +++ b/benchtests/cosh-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.1 0.2 0.3 diff --git a/benchtests/exp-inputs b/benchtests/exp-inputs index e9d33a3..593ad7c 100644 --- a/benchtests/exp-inputs +++ b/benchtests/exp-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 42 # Slowest path with computation in 768 bit precision. # Implemented in: sysdeps/ieee754/dbl-64/mpexp.c diff --git a/benchtests/log-inputs b/benchtests/log-inputs index 713c222..c92d78c 100644 --- a/benchtests/log-inputs +++ b/benchtests/log-inputs @@ -1 +1,4 @@ +## args: double +## ret: double +## includes: math.h 42.0 diff --git a/benchtests/pow-inputs b/benchtests/pow-inputs index dad6505..96b1b6c 100644 --- a/benchtests/pow-inputs +++ b/benchtests/pow-inputs @@ -1,3 +1,6 @@ +## args: double:double +## ret: double +## includes: math.h 42.0, 42.0 # pow slowest path at 768 bits # Implemented in sysdeps/ieee754/dbl-64/slowpow.c diff --git a/benchtests/rint-inputs b/benchtests/rint-inputs index a5f83dc..e9001f9 100644 --- a/benchtests/rint-inputs +++ b/benchtests/rint-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 78.5 -78.5 4503599627370497.0 diff --git a/benchtests/sin-inputs b/benchtests/sin-inputs index 08192d8..ae452a8 100644 --- a/benchtests/sin-inputs +++ b/benchtests/sin-inputs @@ -1,3 +1,6 @@ +## includes: math.h +## args: double +## ret: double 0.9 2.3 3.7 diff --git a/benchtests/sinh-inputs b/benchtests/sinh-inputs index 3c8c546..84a603d 100644 --- a/benchtests/sinh-inputs +++ b/benchtests/sinh-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.1 0.2 0.3 diff --git a/benchtests/tan-inputs b/benchtests/tan-inputs index 629414f..f489ddd 100644 --- a/benchtests/tan-inputs +++ b/benchtests/tan-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0x1.dffffffffff1ep-22 # tan slowest path at 768 bits # Implemented in sysdeps/ieee754/dbl-64/mptan.c diff --git a/benchtests/tanh-inputs b/benchtests/tanh-inputs index 3c8c546..84a603d 100644 --- a/benchtests/tanh-inputs +++ b/benchtests/tanh-inputs @@ -1,3 +1,6 @@ +## args: double +## ret: double +## includes: math.h 0.1 0.2 0.3 |