Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Auto-vectorization

Name: Anonymous 2007-02-03 23:05

So I decided to mess around with the auto-vectorization in gcc and I must say, it sucks balls. I certainly didn't expect it to generate decent code, but I kinda expected to, you know, vectorize easily vectorizable loops? Like

for(i=0; i<512; i++)
    samples[i] *= window[i];

Seriously, it doesn't get much simpler than this. And gcc leaves it as scalar. So, /prog/, is auto-vectorization good for anything now other than marketing fodder?

Name: Anonymous 2007-02-04 13:37

>>5
Altivec too, if you're on PPC like me.

>>7
I haven't used Ocaml before, but from my googling, I've only found stuff that indicates that Ocaml doesn't do any vectorization. Do you have any links to show it does?

Rewriting the library to Ocaml isn't really feasible though, I was only really interested in auto-vectorization because I found that writing a bunch of simple loops like the one in >>1 in Altivec resulted in a 20% speed gain (more including some complex loops that I wouldn't expect any compiler to vectorize well), so I figured that if gcc could vectorize them, I'd have most of the speed gain without cluttering the source with both SSE and Altivec code for each simple loop. But if I have to spend a ton of time coaxing the C code into a form that gcc will recognize as vectorizable, I might as well just write the vector code myself.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List