Add std_detect::detect::features() API that returns iterator of target-features and reject unstable features in feature-detection macros#739
Merged
gnzlbg merged 5 commits intorust-lang:masterfrom Sep 16, 2019
Conversation
Contributor
|
Do you plan to rebase this? I could use something like this to map the env var content to the features. |
Contributor
Author
|
Yep, I'll merge this today. |
lu-zero
approved these changes
Sep 16, 2019
Contributor
lu-zero
left a comment
There was a problem hiding this comment.
It looks fine and I'd use it
Contributor
|
It rebases cleanly but if I try to build it I get: |
Contributor
Author
|
Damn I forgot about this. |
Contributor
|
Actually I had a problem with my local repo and origin/master was pointing to the wrong place, so a rebase isn't immediate :) (if you have time to rebase and push would be great) |
7665f09 to
938b6dd
Compare
Contributor
|
If it survives I guess it should be good to go pending some shuffling/amending. |
Contributor
Author
|
Gonna update stdarch upstream and do a crater run. There might be code in the wild accidentally relying on some of the unstable features. |
oconnor663
added a commit
to oconnor663/stdsimd
that referenced
this pull request
Feb 27, 2020
rust-lang#739 added per-feature stabilization of runtime CPU feature detection. In so doing, it de-stabilized some detection features that had been stable since Rust 1.27.0, breaking some published crates (on nightly). This commit re-stabilizes the subset of AVX-512 detection features that were included in 1.27.0 (that is, the pre-Ice-Lake subset). Other instruction sets (MMX in particular) remain de-stabilized, pending a decision about whether should ever stabilize them. See rust-lang/rust#68905.
Amanieu
pushed a commit
that referenced
this pull request
Mar 19, 2020
…#842) * re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 #739 added per-feature stabilization of runtime CPU feature detection. In so doing, it de-stabilized some detection features that had been stable since Rust 1.27.0, breaking some published crates (on nightly). This commit re-stabilizes the subset of AVX-512 detection features that were included in 1.27.0 (that is, the pre-Ice-Lake subset). Other instruction sets (MMX in particular) remain de-stabilized, pending a decision about whether should ever stabilize them. See rust-lang/rust#68905. * add a comment explaining feature detection stability * adjust stabilizations to match most recent proposal rust-lang/rust#68905 (comment)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements an unstable
features()function instd::detectthat returns an iterator over the target features, returning a tuple of the target-feature name, and whether it is enabled or disabled in the current host.This can be used to implement a solution to rust-lang/rust#54688 using our own run-time feature detection system.
The refactor required to implement this also allows us to close #667