This is the mail archive of the libc-alpha@sourceware.org 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]

Re: [PATCH] Add sqrt performance test


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;
}


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