This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Add sqrt performance test
- From: Steve Ellcey <sellcey at mips dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>, Carlos O'Donell <carlos at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 10 Oct 2013 13:35:48 -0700
- Subject: [PATCH] Add sqrt performance test
- Authentication-results: sourceware.org; auth=none
- References: <cf183992-8b0e-4439-b651-f3da33cda74d at BAMAIL02 dot ba dot imgtec dot org> <CAAHN_R0wRumvcBkfeCAjP5MTbqOpoqXBPoJMdJY4jCyDaant8g at mail dot gmail dot com> <524E3C70 dot 4070800 at redhat dot com> <CAAHN_R1by6DgiWMqUL1sBzQt5FLRewanfQA0JNg43hT=5EZbJg at mail dot gmail dot com> <Pine dot LNX dot 4 dot 64 dot 1310041507420 dot 28946 at digraph dot polyomino dot org dot uk>
After reading the replies to my email about adding a sqrt performance
test here is the patch I came up with. Since I am not willing to do
the amount of analysis that Siddhesh proposed (analyzing the various
branch points in the sqrt routine) and since many chips just use a sqrt
instruction anyway, I just took the 'normal' inputs from the sqrt
correctness test and used them as the input for the sqrt performance test.
I had to update the patch to account for changes to the benchtests Makefile
and I tested this on MIPS to verify that it ran OK.
OK to checkin?
2013-10-10 Steve Ellcey <sellcey@mips.com>
* benchtests/Makefile (bench): Add sqrt.
(LDLIBS-bench-sqrt): New.
* benchtests/sqrt-input: New.
diff --git a/benchtests/Makefile b/benchtests/Makefile
index aec395a..768591b 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 sqrt tan tanh
# String function benchmarks.
string-bench := bcopy bzero memccpy memchr memcmp memcpy memmem memmove \
@@ -48,6 +48,7 @@ LDLIBS-bench-pow = -lm
LDLIBS-bench-rint = -lm
LDLIBS-bench-sin = -lm
LDLIBS-bench-sinh = -lm
+LDLIBS-bench-sqrt = -lm
LDLIBS-bench-tan = -lm
LDLIBS-bench-tanh = -lm
LDLIBS-bench-sincos = -lm
diff --git a/benchtests/sqrt-inputs b/benchtests/sqrt-inputs
new file mode 100644
index 0000000..370bc05
--- /dev/null
+++ b/benchtests/sqrt-inputs
@@ -0,0 +1,10 @@
+## args: double
+## ret: double
+## includes: math.h
+0.25
+0.75
+2.0
+4.0
+2209.0
+6642.25
+15190.5625