I guess everyone should know SIMD but I would argue that not everyone needs to know SIMD. Most programmers work on much higher levels of abstractions where this is not only not needed but would also constitute as premature optimization.
I think it's still valuable to know what SIMD can and can't do, at least. Even if you're programming in a high-level language, the relative performance of the primitives you're using still depends on how they're implemented. Simply knowing that something is optimized with good SIMD tells you that it likely has the same performance on 1-16 bytes, that you might get a small benefit from data alignment, that the length of the input in bytes determines performance more than the raw count (e.g. if you can choose between 8-bit and 16-bit values), and that compiling for AVX instead of using the default settings will likely double your performance. That's already pretty useful!
One thing I really don't understand in the example is why it's using u32 for each lane when u8 is enough precision and range for all the steps? @mitchellh?
payne | an hour ago
I guess everyone should know SIMD but I would argue that not everyone needs to know SIMD. Most programmers work on much higher levels of abstractions where this is not only not needed but would also constitute as premature optimization.
purplesyringa | 37 minutes ago
I think it's still valuable to know what SIMD can and can't do, at least. Even if you're programming in a high-level language, the relative performance of the primitives you're using still depends on how they're implemented. Simply knowing that something is optimized with good SIMD tells you that it likely has the same performance on 1-16 bytes, that you might get a small benefit from data alignment, that the length of the input in bytes determines performance more than the raw count (e.g. if you can choose between 8-bit and 16-bit values), and that compiling for AVX instead of using the default settings will likely double your performance. That's already pretty useful!
0x2ba22e11 | 23 minutes ago
One thing I really don't understand in the example is why it's using u32 for each lane when u8 is enough precision and range for all the steps? @mitchellh?
Sarcasm | 9 minutes ago
Feel like Zig make this more pleasant to work with than some other languages.
Sometimes I contemplate using SIMD but then I wonder:
Well, picking the baseline target at compile time may not be such a bad idea after all, it makes writing SIMD straightforward.