3 ms·
> Compilers are tools. They can reliably vectorize code if it is written in an amenable-to-vectorization form. This goes for regular scalar code as well, it's
by magicalhippo 3y ago
> Compilers are tools. They can reliably vectorize code if it is written in an amenable-to-vectorization form.
This goes for regular scalar code as well, it's just less obvious in mature compilers with ton of work put into them.
I've long since given up handwriting scalar assembly code for speed. Instead I've studied the output of the compilers I use, and through iteration learned how to write optimization-friendly code.
If I have a hot spot that matters in my code I check just to be sure. Sometimes the most innocent looking changes can cause issues.