Page 1 of 1

gcc auto vectorization

Posted: Sun Apr 20, 2008 1:18 am
by blound
I dont follow gcc-dev or anything, but I found out about this while browsing the gentoo forums waiting for a reply:

http://gcc.gnu.org/projects/tree-ssa/vectorization.html

Apparently gcc since 4.1 has supported parrelism with auto vectoriazation of loops if you give it the -ftree-vectorize flag and -msse{2,3,4}. I tested it out on my laptop and made a simple C program that summed up 200000 array elements in a nested loop and without vectorization it took 55 seconds and with it it took 25! so in my contrived example i got a 2x speedup just for a gcc flag.

Its not stable yet, but when it gets stable ( hoped for in 4.3.0 ) the -03 will imply vectorization.

If you want to see the vectorization code its in bad form breaking ebuilds you can read this long gentoo thread I was reading:
http://forums.gentoo.org/viewtopic-t-51 ... art-0.html

Maybe some brave people will test it on their kernels?

Re: gcc auto vectorization

Posted: Sun Apr 20, 2008 2:39 am
by bluecode
blound wrote:IIts not stable yet, but when it gets stable ( hoped for in 4.3.0 ) the -03 will imply vectorization.
Gcc 4.3.0 is already out (for a few weeks now) and from what I can read here it is not yet in O3.