about summary refs log tree commit diff
diff options
context:
space:
mode:
authornewpavlov <newpavlov@gmail.com>2018-02-20 16:05:25 +0300
committernewpavlov <newpavlov@gmail.com>2018-02-20 16:05:25 +0300
commit98d8fc192dc03945b5a09288fb6e12d688489928 (patch)
tree7f167930fb2aae8a5914a6be4eae459fcaa9ac2b
parent27a046e9338fb0455c33b13e8fe28da78212dedc (diff)
downloadrust-98d8fc192dc03945b5a09288fb6e12d688489928.tar.gz
rust-98d8fc192dc03945b5a09288fb6e12d688489928.zip
added rdrand feature and removed rdrnd feature
-rw-r--r--src/librustc_trans/llvm_util.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs
index b25562252e7..4969f724128 100644
--- a/src/librustc_trans/llvm_util.rs
+++ b/src/librustc_trans/llvm_util.rs
@@ -75,9 +75,9 @@ unsafe fn configure_llvm(sess: &Session) {
                                  llvm_args.as_ptr());
 }
 
-// WARNING: the features must be known to LLVM or the feature
-// detection code will walk past the end of the feature array,
-// leading to crashes.
+// WARNING: the features after aplpying `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.
 
 const ARM_WHITELIST: &'static [&'static str] = &["neon", "v7", "vfp2", "vfp3", "vfp4"];
 
@@ -86,7 +86,7 @@ const AARCH64_WHITELIST: &'static [&'static str] = &["neon", "v7"];
 const X86_WHITELIST: &'static [&'static str] = &["avx", "avx2", "bmi", "bmi2", "sse",
                                                  "sse2", "sse3", "sse4.1", "sse4.2",
                                                  "ssse3", "tbm", "lzcnt", "popcnt",
-                                                 "sse4a", "rdrnd", "rdseed", "fma",
+                                                 "sse4a","fma", "rdrand", "rdseed",
                                                  "xsave", "xsaveopt", "xsavec",
                                                  "xsaves", "aes", "pclmulqdq",
                                                  "avx512bw", "avx512cd",
@@ -108,6 +108,7 @@ const MIPS_WHITELIST: &'static [&'static str] = &["msa"];
 pub fn to_llvm_feature(s: &str) -> &str {
     match s {
         "pclmulqdq" => "pclmul",
+        "rdrand" => "rdrnd",
         s => s,
     }
 }