This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: What inputs to use for sqrt perf testing

While making a sqrt performance improvement for MIPS I noticed that there
was no sqrt performance test in the 'make bench' tests and Joseph suggested
that we should have one.  It looks like adding it is trivial (see patch),
but the real question is what input to use.  I just threw in 1.9 and 10000.0
to test this patch, but I don't think those are necessarily good choices.

Are there any math experts out there could suggest a better selection of
inputs for sqrt to use in the performance tests?

Here is my strawman patch, I don't expect this to get checked in as it
is, I am just including it for reference purposes.

Steve Ellcey

2013-10-03  Steve Ellcey  <>

	* benchtests/Makefile (bench): Add sqrt.
	(sqrt-ARGLIST): New.
	(sqrt-RET): New.
	(LDLIBS-bench-sqrt): New.
	* benchtests/sqrt-input: New.

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 4f4bd54..bc36374 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -21,7 +21,7 @@
 subdir := benchtests
 bench := acos acosh asin asinh atan atanh cos cosh exp log modf pow rint sin \
-	 sincos sinh tan tanh
+	 sincos sinh tan tanh sqrt
 # String function benchmarks.
 string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \
@@ -90,6 +90,10 @@ sinh-ARGLIST = double
 sinh-RET = double
 LDLIBS-bench-sinh = -lm
+sqrt-ARGLIST = double
+sqrt-RET = double
+LDLIBS-bench-sqrt = -lm
 tan-ARGLIST = double
 tan-RET = double
 LDLIBS-bench-tan = -lm
diff --git a/benchtests/sqrt-inputs b/benchtests/sqrt-inputs
index e69de29..5ee9960 100644
--- a/benchtests/sqrt-inputs
+++ b/benchtests/sqrt-inputs
@@ -0,0 +1,2 @@

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]