what optimization can be expected?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Where can I read about g++ automatic sse optimizations? For instance one question I have is:

Can loops with a non-unit stride be automagically optimized by compiler with SSE?

template <int nComp>
void norm(double *result, double *data, size_t n)
{
 double *pDat=data;
 double *pRes=result;

 for (size_t i=0; i<n; ++i)
 {
   *pRes=*pDat**pDat;
   for (int j=1; j<nComp; ++j)
   {
     *pRes+=pDat[j]*pDat[j];
   }
   *pRes=sqrt(*pRes);

   pRes+=1;
   pDat+=nComp;
 }
}
What about if nComp is a function argument? or if the data and result arrays are accessed using (hopefully) in-lined function accessors?

What I found re: g++ and sse are ducmentation of the x86 built ins, but not about what g++ does on its own.

Thanks
Burlen




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux