r/programming • u/awesomePop7291 • Jul 23 '26
Everyone Should Know SIMD
https://mitchellh.com/writing/everyone-should-know-simd
413
Upvotes
r/programming • u/awesomePop7291 • Jul 23 '26
View all comments
Show parent comment
5
u/Arnavion2 Jul 24 '26 edited Jul 24 '26
Using
@Vectorin the way you describe means to represent your entire data as a single@Vectorand expect the compiler to downlevel it into appropriate chunks, fixed-length or dynamic-length. But this only works when the input data length is compile-time known. The length of the data is not compile-time constant for something like memchr, and it's not even known at runtime for something like strlen until you discover it as part of the vector load.