[11/28] benchtests: Add isnan/isinf/isfinite benchmark
Commit Message
Checked on powerpc-linux-gnu (built without --with-cpu, with
--with-cpu=power4 and with --with-cpu=power5+ and --disable-multi-arch),
powerpc64-linux-gnu (built without --with-cp and with --with-cpu=power5+
and --disable-multi-arch).
* benchtests/Makefile (bench-math): Add isnan, isinf, and isfinite.
(CFLAGS-bench-isnan.c, CFLAGS-bench-isinf.c,
CFLAGS-bench-isfinite.c): New rule.
* benchtests/isnan-input: New file.
* benchtests/isinf-input: New file.
* benchtests/isfinite-input: New file.
---
benchtests/Makefile | 5 ++++-
benchtests/isfinite-inputs | 21 +++++++++++++++++++++
benchtests/isinf-inputs | 21 +++++++++++++++++++++
benchtests/isnan-inputs | 21 +++++++++++++++++++++
4 files changed, 67 insertions(+), 1 deletion(-)
create mode 100644 benchtests/isfinite-inputs
create mode 100644 benchtests/isinf-inputs
create mode 100644 benchtests/isnan-inputs
Comments
On Fri, Mar 29 2019, Adhemerval Zanella wrote:
>
> * benchtests/Makefile (bench-math): Add isnan, isinf, and isfinite.
> (CFLAGS-bench-isnan.c, CFLAGS-bench-isinf.c,
> CFLAGS-bench-isfinite.c): New rule.
> * benchtests/isnan-input: New file.
> * benchtests/isinf-input: New file.
> * benchtests/isfinite-input: New file.
Looks good to me. Thanks for doing this.
Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
@@ -24,7 +24,7 @@ include ../Makeconfig
bench-math := acos acosh asin asinh atan atanh cos cosh exp exp2 log log2 \
modf pow rint sin sincos sinh sqrt tan tanh fmin fmax fminf \
fmaxf powf trunc truncf expf exp2f logf log2f sincosf sinf \
- cosf
+ cosf isnan isinf isfinite
bench-pthread := pthread_once thread_create
@@ -88,6 +88,9 @@ CFLAGS-bench-fmax.c += -fno-builtin
CFLAGS-bench-fmaxf.c += -fno-builtin
CFLAGS-bench-trunc.c += -fno-builtin
CFLAGS-bench-truncf.c += -fno-builtin
+CFLAGS-bench-isnan.c += -fsignaling-nans
+CFLAGS-bench-isinf.c += -fsignaling-nans
+CFLAGS-bench-isfinite.c += -fsignaling-nans
ifeq (${BENCHSET},)
bench-malloc := malloc-thread malloc-simple
new file mode 100644
@@ -0,0 +1,21 @@
+## includes: math.h
+## args: double
+## ret: int
+0.9
+2.3
+3.7
+3.9
+4.0
+4.7
+5.9
+0x1.000000cf4a2a1p0
+0x1.0000010b239a8p0
+0x1.00000162a932ap0
+0x1.000002d452a11p0
+0x1.000005bc7d86cp0
+## name: INF
+__builtin_inf ()
+-__builtin_inf ()
+## name: NAN
+__builtin_nan ("")
+__builtin_nans ("")
new file mode 100644
@@ -0,0 +1,21 @@
+## includes: math.h
+## args: double
+## ret: int
+0.9
+2.3
+3.7
+3.9
+4.0
+4.7
+5.9
+0x1.000000cf4a2a1p0
+0x1.0000010b239a8p0
+0x1.00000162a932ap0
+0x1.000002d452a11p0
+0x1.000005bc7d86cp0
+## name: INF
+__builtin_inf ()
+-__builtin_inf ()
+## name: NAN
+__builtin_nan ("")
+__builtin_nans ("")
new file mode 100644
@@ -0,0 +1,21 @@
+## includes: math.h
+## args: double
+## ret: int
+0.9
+2.3
+3.7
+3.9
+4.0
+4.7
+5.9
+0x1.000000cf4a2a1p0
+0x1.0000010b239a8p0
+0x1.00000162a932ap0
+0x1.000002d452a11p0
+0x1.000005bc7d86cp0
+## name: INF
+__builtin_inf ()
+-__builtin_inf ()
+## name: NAN
+__builtin_nan ("")
+__builtin_nans ("")