aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-03-27 14:10:13 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2019-06-12 11:46:30 -0300
commit2731a326b10ba6d1646043cf28290584238b7ce4 (patch)
tree24dc0352077ff79918d620ef779fa47b88f9811b
parente41d66e41ae0626156b3eace8e15aecff3044695 (diff)
downloadglibc-2731a326b10ba6d1646043cf28290584238b7ce4.tar.gz
glibc-2731a326b10ba6d1646043cf28290584238b7ce4.tar.xz
glibc-2731a326b10ba6d1646043cf28290584238b7ce4.zip
benchtests: Add isnan/isinf/isfinite benchmark
* 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. Reviewed-by: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
-rw-r--r--ChangeLog7
-rw-r--r--benchtests/Makefile5
-rw-r--r--benchtests/isfinite-inputs21
-rw-r--r--benchtests/isinf-inputs21
-rw-r--r--benchtests/isnan-inputs21
5 files changed, 74 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 13f027309e1..59a64842966 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2019-06-12 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * 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.
+
* sysdeps/powerpc/fpu/s_copysign.c: New file.
* sysdeps/powerpc/fpu/s_copysignf.c: Likewise.
* sysdeps/powerpc/powerpc32/fpu/s_copysign.S: Remove file.
diff --git a/benchtests/Makefile b/benchtests/Makefile
index b8ac9ead334..ef400a8e489 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -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
diff --git a/benchtests/isfinite-inputs b/benchtests/isfinite-inputs
new file mode 100644
index 00000000000..35a887c9df7
--- /dev/null
+++ b/benchtests/isfinite-inputs
@@ -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 ("")
diff --git a/benchtests/isinf-inputs b/benchtests/isinf-inputs
new file mode 100644
index 00000000000..35a887c9df7
--- /dev/null
+++ b/benchtests/isinf-inputs
@@ -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 ("")
diff --git a/benchtests/isnan-inputs b/benchtests/isnan-inputs
new file mode 100644
index 00000000000..35a887c9df7
--- /dev/null
+++ b/benchtests/isnan-inputs
@@ -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 ("")