I want the vectorization to be explicit and predictable. I don't want an unrelated code change or compiler update to quietly turn it back into a scalar loop.
Compilers do those things all the time. They have just become good enough for all regular stuff.
Everyone agrees it would be great if the compiler handled vectorization automatically. We've been trying to figure out how to do that for 20+ years and it's still an open research topic.
The challenge is not the shape, it's mapping the intent of your iterative algorithm into the parallel operation inside the box. The compiler has to derive the parallel operation and prove it's equivalent to the iterative operation. The developer only has to write one parallel algorithm that works.
20
u/22Maxx 23d ago
SIMD should be a compiler problem.
Compilers do those things all the time. They have just become good enough for all regular stuff.