2 ms·
If you’re processing N things at a time and your “scalar tail” is N-1 why can’t you put in a dummy value for the last entry, run one last SIMD iteration, and di
by cobbzilla 3mo ago
If you’re processing N things at a time and your “scalar tail” is N-1 why can’t you put in a dummy value for the last entry, run one last SIMD iteration, and discard the dummy return value?
- saagarjha 3mo agoYou can, but usually the code may have problems with this. For example, storing out of bounds is often going to give you a bad time. Some platforms that are all SIMD all the time will support masked operations for this kind of thing.
- spider-mario 3mo agoThere is some discussion of the possible options here: https://github.com/google/highway#strip-mining-loops https://github.com/google/highway#strip-mining-loops