3 ms·
I will say that most of the time, when you want to pull out the intrinsics, you really want to use the autovectorizer instead and "restrict" will get you everyt
by klodolph 7y ago
I will say that most of the time, when you want to pull out the intrinsics, you really want to use the autovectorizer instead and "restrict" will get you everything you want.
The main use cases for vector intrinsics, in my opinion, are when you are doing something clever shuffling the vectors around or packing / unpacking them. If you’re not being especially clever, just let the compiler do the heavy lifting and make it happen by putting "restrict" in a couple places.
If you are being especially clever, at least give the compiler a shot and benchmark the different versions against each other.
- nwallin 7y agoOr if you're me and your project is compiled with MSVC. My personal projects are are beautifully simple loops that compile to vectorized AVX or SSE instructions. My work projects have a lot of `//todo: rewrite this with intrinsics` or `//don't fuck up the alignment there's a bunch of SIMD intrinsics under here`.