Skip to content

Commit c9b6dca

Browse files
committed
Rollup merge of rust-lang#48369 - newpavlov:rdrand, r=nagisa
Rename rdrnd target feature to rdrand Plus minor cleanup. Related stdsimd [issue](rust-lang/stdarch#325).
2 parents f28931f + a33c1da commit c9b6dca

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/librustc_trans/llvm_util.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,25 @@ unsafe fn configure_llvm(sess: &Session) {
7575
llvm_args.as_ptr());
7676
}
7777

78-
// WARNING: the features must be known to LLVM or the feature
79-
// detection code will walk past the end of the feature array,
80-
// leading to crashes.
78+
// WARNING: the features after applying `to_llvm_feature` must be known
79+
// to LLVM or the feature detection code will walk past the end of the feature
80+
// array, leading to crashes.
8181

8282
const ARM_WHITELIST: &'static [&'static str] = &["neon", "v7", "vfp2", "vfp3", "vfp4"];
8383

8484
const AARCH64_WHITELIST: &'static [&'static str] = &["neon", "v7"];
8585

86-
const X86_WHITELIST: &'static [&'static str] = &["avx", "avx2", "bmi", "bmi2", "sse",
87-
"sse2", "sse3", "sse4.1", "sse4.2",
88-
"ssse3", "tbm", "lzcnt", "popcnt",
89-
"sse4a", "rdrnd", "rdseed", "fma",
90-
"xsave", "xsaveopt", "xsavec",
91-
"xsaves", "aes", "pclmulqdq",
92-
"avx512bw", "avx512cd",
93-
"avx512dq", "avx512er",
94-
"avx512f", "avx512ifma",
95-
"avx512pf", "avx512vbmi",
96-
"avx512vl", "avx512vpopcntdq",
97-
"mmx", "fxsr"];
86+
const X86_WHITELIST: &'static [&'static str] = &["aes", "avx", "avx2", "avx512bw",
87+
"avx512cd", "avx512dq", "avx512er",
88+
"avx512f", "avx512ifma", "avx512pf",
89+
"avx512vbmi", "avx512vl", "avx512vpopcntdq",
90+
"bmi", "bmi2", "fma", "fxsr",
91+
"lzcnt", "mmx", "pclmulqdq",
92+
"popcnt", "rdrand", "rdseed",
93+
"sse", "sse2", "sse3", "sse4.1",
94+
"sse4.2", "sse4a", "ssse3",
95+
"tbm", "xsave", "xsavec",
96+
"xsaveopt", "xsaves"];
9897

9998
const HEXAGON_WHITELIST: &'static [&'static str] = &["hvx", "hvx-double"];
10099

@@ -108,6 +107,7 @@ const MIPS_WHITELIST: &'static [&'static str] = &["msa"];
108107
pub fn to_llvm_feature(s: &str) -> &str {
109108
match s {
110109
"pclmulqdq" => "pclmul",
110+
"rdrand" => "rdrnd",
111111
s => s,
112112
}
113113
}

0 commit comments

Comments
 (0)