-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There's seemingly no way to construct a __m128i in a const fn #403
Comments
I'm having trouble connecting the dots in your issue, so I'll just vomit out two things and see what sticks. :-)
Ignoring the "const" part of your request, I would use
I think the way to do this (right now at least) is via a union union u8x16 {
vector: __m128i,
bytes: [u8; 16],
}
const ZERO: __m128i = unsafe { (u8x16 { bytes: [0; 16] }).vector }; |
Yes, in the future |
I think I'm missing a step here. How do |
Oh sorry, |
I think this has basically been resolved, so closing |
My ideal case would be to take a
&[u8]
and "fill up" a__m128
:However, 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 fromu8x16
and friends.The intrinsics are not
const
, so they cannot be used in aconst fn
context.The closest I could find was
but
into_bits
is likewise notconst
.The text was updated successfully, but these errors were encountered: