-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add missing #[target_feature(enable = "simd128")]
#1609
Conversation
@@ -33,6 +33,7 @@ types! { | |||
/// type in WebAssembly. Operations on `v128` can only be performed with the | |||
/// functions in this module. | |||
// N.B., internals here are arbitrary. | |||
#[target_feature(enable = "simd128")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this doesn't work on types.
I guess we also don't want to add cfg(target_feature)
here because otherwise using it would require build-std
.
7536645
to
6abab4e
Compare
I believe these were intentionally omitted to allow using SIMD type constructors in a const context. |
And in the end, just using the SIMD types doesn't require the feature to be available, the compiler will just fall back to treating it as an array of scalars. |
Ah yes at the time this wasn't possible due to the usage of |
Does |
Right yeah, the |
I see, thanks! |
This is a resubmission of rust-lang#1609 which was ruled optional but not necessary at the time but it's now necessary. These weren't originally applied as they weren't allowed in a `const` context but that's no longer applicable. At the same time though be sure to add some small tests to ensure that these intrinsics can be used in a `const` context.
This is a resubmission of #1609 which was ruled optional but not necessary at the time but it's now necessary. These weren't originally applied as they weren't allowed in a `const` context but that's no longer applicable. At the same time though be sure to add some small tests to ensure that these intrinsics can be used in a `const` context.
I believe that adding these was missed in #874 and adding this now should not be a breaking change.
Cc @alexcrichton.