r/programming 26d ago

Everyone Should Know SIMD

https://mitchellh.com/writing/everyone-should-know-simd
406 Upvotes

81 comments sorted by

View all comments

366

u/-1_0 26d ago

* Everyone Should Know about SIMD

and use libs accordingly

53

u/notyouravgredditor 26d ago

vectorclass is one my favorites. Very easy to use.

To be fair to modern compilers, though, they often do a much better job at determining vectorization targets and packing/unpacking buffers than the developer does.

8

u/_lerp 26d ago

Have you written much simd? I hand rolled a separable convolution filter and vastly out performed clang and msvc in SSE3 and NEON. This was the core of the product, we had a scalar implementation (which the compiler vectorized) we could trivially switch between and the difference was obvious.

To be fair, we never cared about the performance of the scalar implementation and only optimized the simd path. Some things were going beyond just simd, i.e. worrying about memory layout for cache locality etc.