[PATCH] Add sqrt performance test
Ondřej Bílka
neleai@seznam.cz
Thu Oct 10 21:13:00 GMT 2013
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;
}
More information about the Libc-alpha
mailing list