gcc autovectorize

Tom Burdick tburdi1 at uic.edu
Mon Dec 11 17:01:47 CET 2006


I thought it worthy of mentioning, that in all of the newest GCC's (4.x and 
higher) there is an autovectorizing option. I've been using this in a project 
of my own and its made certain loops significantly faster. I'd suggest 
possibly trying krita with the flags this way to see what gcc vectorizes or 
not. Notably, it will automatically take a loop like

for(int i = 0; i < 64; i++) {
	a[i]  = b[i]*c[i];
}

and instead use whatever simd instructions you have to eliminate a good number 
of iterations.

If you've already tried this out, or are already using the simd instructions 
disregard!

-Tom


More information about the kimageshop mailing list