Updated the list of white-listed target features for x86
This PR both adds in-source documentation on what to look out for when adding a new (X86) feature set and adds all that are detectable at run-time in Rust stable as of 1.27.0. This should only enable the use of the corresponding LLVM intrinsics. Actual intrinsics need to be added separately in rust-lang/stdarch. It also re-orders the run-time-detect test statements to be more consistent with the actual list of intrinsics whitelisted and removes underscores not present in the actual names (which might be mistaken as being part of the name)
This commit is contained in:
@@ -137,6 +137,8 @@ pub fn time_trace_profiler_finish(file_name: &str) {
|
||||
// WARNING: the features after applying `to_llvm_feature` must be known
|
||||
// to LLVM or the feature detection code will walk past the end of the feature
|
||||
// array, leading to crashes.
|
||||
// To find a list of LLVM's names, check llvm-project/llvm/include/llvm/Support/*TargetParser.def
|
||||
// where the * matches the architecture's name
|
||||
pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
|
||||
let arch = if sess.target.arch == "x86_64" { "x86" } else { &*sess.target.arch };
|
||||
match (arch, s) {
|
||||
@@ -144,6 +146,9 @@ pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
|
||||
("x86", "rdrand") => "rdrnd",
|
||||
("x86", "bmi1") => "bmi",
|
||||
("x86", "cmpxchg16b") => "cx16",
|
||||
("x86", "avx512vaes") => "vaes",
|
||||
("x86", "avx512gfni") => "gfni",
|
||||
("x86", "avx512vpclmulqdq") => "vpclmulqdq",
|
||||
("aarch64", "fp") => "fp-armv8",
|
||||
("aarch64", "fp16") => "fullfp16",
|
||||
(_, s) => s,
|
||||
|
||||
Reference in New Issue
Block a user