Hi, I'm trying to learn about SIMD, and am quite confused about a lot of stuff. I have a few questions about SIMD and
- When people call SIMD a compiler intrinsic does that mean that its like a "compile time abstraction" i.e.
Simd<[T; N]>is the same as a
[T; N]under the hood? The fact that you can transmute an array into a
Simdsuggests so, but I'm not very familiar with the
- If I have an array of
u32s, is there any benefit in storing them as a
[Simd<[u32; N]>]rather than storing them simply as a
[u32]and just transmuting when I need to calculate something? I assume if I were to store them as a
[u32]I would have to pad the array to be a multiple of
- How can I work with
Vec<u32>? Is the best way to just use slices or can I somehow convert it into a
Vec<Simd<[u32; N]>>? As with the question above, is there any benefit in storing them as a
- If I have an array of references (i.e.
Vec<&mut u32>)) can I perform SIMD calculations?
- I can't use SIMD with new types (e.g.
Health(pub u32)) right?
I came across this blog post which suggests there is a benefit to storing things as a
Simd. Thanks in advance for any answers.