Auto-vectorization of dot-product

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

 



Hi,

I have a simple implementation of a dot-product:

inline double dot(int dim, 
                  double const * __restrict x, 
                  double const * __restrict y)
{
   double sum = 0.0;
   for (int i = 0; i < dim; ++i) {
      sum += x[i] * y[i];
   }
   return sum;
}

Although the Auto-vectorization site 
http://gcc.gnu.org/projects/tree-ssa/vectorization.html mentions that GCC 
supports auto-vectorization of the dot-product, I get the following 
information from GCC 4.3 

dot.C:63: note: not vectorized: unsupported use in stmt.

Other simpler loops get vectorized.

What could be wrong?

Christoph

[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