This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC 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]

Auto-vectorization of dot-product


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]