On Fri, 2006-15-09 at 10:08 -0700, [EMAIL PROTECTED] wrote: > On Fri, Sep 15, 2006 at 04:47:14PM +0000, Duncan wrote: > > > I'm unclear as to what "vectorization" means as used here. My > > understanding of "vector" is as a synonym for "line", thus implying loop > > unrolling of some form or another, which will increase size. As I > > explained in the grandparent, I believe such optimizations to be > > counterproductive on modern processors due to the extreme cost of cache > > misses as opposed to slight cycle inefficiencies. > > > > I am however aware that vectorization has a somewhat different meaning in > > programming terms than the above, but am not sufficiently educated on the > > topic to make an informed choice, so I've simply left gcc to go with its > > default choice given my overall stated intention of -Os. > > > > If you can sufficiently explain the concept to me such that I > > understand enough about it to feel comfortable going with other than the > > default (which means I can explain why I chose it and why it won't > > interfere with my overall strategy as outlined in the grandparent, or is > > worth it even if it does), I'd be very grateful! =8^) > > Back in the day, vectorization was, I believe, a supercomputer SIMD > (single instruction multiple data) concept, where instruction operands > were pointers to data, so it would, for instance, add two arrays of > numbers to produce a third array. Isn't this what the Altivec > instructions do?
That's exactly what it means. On x86/amd64 some MMX, SSE/SSE2 and 3dnow operations are SIMD operations. Vectorizing a loop means that if you try to add two tables of lets say 12000 elements, instead of doing the loops 12000 times for 1 element each time, it will do the loop lets say 3000 times with 4 element each time. Which should be faster... (but isn't always depending if the vector ops have been implemented properly). -- Olivier CrĂȘte [EMAIL PROTECTED] Gentoo Developer -- [email protected] mailing list
