-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Whitelist pclmulqdq x86 feature flag #48126
Conversation
Relevant `stdsimd` [issue](rust-lang/stdarch#318).
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Thanks @newpavlov! From our discussion on rust-lang/stdarch#320 I think that we may want to rename this to I think there may wish to be a few things we'd like to change as part of this:
And... I think that's it! I think it's fine to define pub fn target_feature_to_llvm_feature(s: &str) -> String {
match s {
"pclmulqdq" => "pclmul".to_string(),
s => s.to_string()
}
} and we can continue to make it more robust as needed |
AMD also refers to it as |
@alexcrichton
If I understand correctly null termination is needed for calling |
Ah yeah no need to worry about that, I can guarantee it won't show up in any profiles :) |
@bors: r+ Thanks! |
📌 Commit 7c6adb4 has been approved by |
src/librustc_trans/llvm_util.rs
Outdated
.iter() | ||
.filter(|feature| { | ||
let llvm_feature = to_llvm_feature(feature); | ||
let ptr = CString::new(llvm_feature).unwrap().as_ptr(); |
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.
This is a dangling pointer. See temporary_cstring_as_ptr.
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.
Yes, thank you for noticing!
@bors: r+ |
📌 Commit c2a31de has been approved by |
Could we maybe just have a hashmap from rust feature name to llvm feature name, and if a feature is not in the hashmap, we just use the rust feature name as llvm's feature name ? EDIT: Ah, I see you have a match statement, that looks good for me :) |
…hitelist pclmulqdq x86 feature flag Relevant `stdsimd` [issue](rust-lang/stdarch#318).
@bors: rollup |
Whitelist pclmulqdq x86 feature flag Relevant `stdsimd` [issue](rust-lang/stdarch#318).
Whitelist pclmulqdq x86 feature flag Relevant `stdsimd` [issue](rust-lang/stdarch#318).
Relevant
stdsimd
issue.