There's seemingly no way to construct a __m128i in a const fn #403
Closed
Description
My ideal case would be to take a &[u8] and "fill up" a __m128:
let needle: __m128i = bytes.collect(); // Takes the first 16 bytes, zero-initialized otherwise
// or
let mut needle = __m128i::default(); // zero-initialize
needle.extend(bytes); // Takes the first 16 bytesHowever, none of the "nice" traits are implemented for these types, and I've gotten the feeling that is no accident. Basically, I can use an intrinsic function to set it (e.g. _mm_setzero_si128), or I can convert from u8x16 and friends.
The intrinsics are not const, so they cannot be used in a const fn context.
The closest I could find was
u8x16::new(
x0, x1, x2, x3, x4, x5, x6, x7,
x8, x9, x10, x11, x12, x13, x14, x15,
).into_bits()but into_bits is likewise not const.
Metadata
Assignees
Labels
No labels
Activity