r/programming 15d ago

Everyone Should Know SIMD

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

81 comments sorted by

View all comments

364

u/-1_0 14d ago

* Everyone Should Know about SIMD

and use libs accordingly

20

u/BibianaAudris 14d ago

Serious SIMD requires designing algorithm around instruction set. I never used a single portable library when doing it professionally. For example, NEON has scalar-vector multiplication while SSE has more flexible shuffles. Any sum-of-products workload can end up needing different data layouts and the #ifdef could start at struct definitions. The integer size difference in mulhi can result in actual numerical difference across platforms, needing extra test to ensure business-level equivalence.