This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add sqrt performance test
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Steve Ellcey <sellcey at mips dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, 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 23:13:51 +0200
- Subject: Re: [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> <1381437348 dot 31594 dot 14 dot camel at ubuntu-sellcey>
On Thu, Oct 10, 2013 at 01:35:48PM -0700, Steve Ellcey wrote:
> 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?
>
You can cover most of branches by following generator, if you measure
performance for indiviudal inputs you can infer where are branch points.
int main(){
double d;
d=1.0;
while (finite(d)){
printf("%a\n",d);
d*=1.1;
}
d=1.0;
while (d>d/1.1){
printf("%a\n",d);
d/=1.1;
}
d=-1.0;
while (finite(d)){
printf("%a\n",d);
d*=1.1;
}
d=-1.0;
while (d<d/1.1){
printf("%a\n",d);
d/=1.1;
}
return 0;
}