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 std::mem::transmute:
- 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 aSimdsuggests so, but I'm not very familiar with thetransmutefunction. - 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 ofN. - How can I work with
Vec<u32>? Is the best way to just use slices or can I somehow convert it into aVec<Simd<[u32; N]>>? As with the question above, is there any benefit in storing them as aVec<Simd<[u32; N]>>? - If I have an array of references (i.e.
[&mut u32](orVec<&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.