gcc auto vectorization

Programming, for all ages and all languages.
Post Reply
blound
Member
Member
Posts: 70
Joined: Sat Dec 01, 2007 1:36 pm

gcc auto vectorization

Post 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?
User avatar
bluecode
Member
Member
Posts: 202
Joined: Wed Nov 17, 2004 12:00 am
Location: Germany
Contact:

Re: gcc auto vectorization

Post 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.
Post Reply