This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Auto-vectorization of dot-product
- From: Christoph Bartoschek <bartoschek at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Sun, 30 Mar 2008 14:01:59 +0200
- Subject: 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