help-gplusplus
[Top][All Lists]
Advanced

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

Vectorization in gcc 4.1.1


From: rameshk
Subject: Vectorization in gcc 4.1.1
Date: Mon, 02 Jul 2007 14:27:11 -0700
User-agent: G2/1.0

Hi,

I was trying to get gcc to vectorize a simple loop:

#include <vector>

int test(double *x , int size);

int test(double *x, int size)
{

        int ret = 1;
        std::vector<double>     v;
        v.resize(size);
        double  *a = &v[0];

        for(int i = 0;i < size; ++i )
        {
                a[i ] = 1/x[i];
        }

}

I get the following message:

test.cpp:13: note: not vectorized: can't determine dependence between
*D.11390_169 and *D.11389_164
test.cpp:13: note: vectorized 0 loops in function.

The details of my Compiler BUILD:

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /sbcimp/build/pd-rhel3/gcc/gcc-4.1.1/configure --
prefix=/sbcimp/run/pd/gcc/4.1.1-32bit --with-gnu-as --with-as=/sbcimp/
run/pd/binutils/2.16.1-32bit/bin/as --with-gnu-ld --with-ld=/sbcimp/
run/pd/binutils/2.16.1-32bit/bin/ld --enable-shared --enable-
threads=posix --with-cpu=i686 --with-tune=i686 --with-arch=i686 --
enable-languages=c,c++ --disable-checking --enable-version-specific-
runtime-libs --enable-__cxa_atexit
Thread model: posix
gcc version 4.1.1

I was a bit surprised as I believe it is a fairly simple loop to
optimize and vectorize. I would appreciate the help.

Regards,
Ramesh



reply via email to

[Prev in Thread] Current Thread [Next in Thread]