I have seen that it's rather simple in C to access values in a __m128 register by index. However, it is not possible to do that in rust. How can I access those values?
Concretely, I am calculating four values at once, then I compare them using _mm_cmplt_ps. I use that return register as a mask for further computation.
There are SIMD instructions precisely for this, e.g. such as
_mm_extract_epi32, but they often require newer versions of SIMD than just SSE2.I think the easiest way to do this using foolproof safe Rust is using the
bytemuckcrate, in your example:Now
cmp_arr[0],cmp_arr[1], ..., contain your results.