Auto-vectorization of dot-product

Christoph Bartoschek bartoschek@gmx.de
Sun Mar 30 12:00:00 GMT 2008


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



More information about the Gcc-help mailing list