From 98d8fc192dc03945b5a09288fb6e12d688489928 Mon Sep 17 00:00:00 2001 From: newpavlov Date: Tue, 20 Feb 2018 16:05:25 +0300 Subject: [PATCH 1/3] added rdrand feature and removed rdrnd feature --- src/librustc_trans/llvm_util.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs index b25562252e72e..4969f72412838 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, } } From 4c6b9bcaa9eeca8e764b53a080dd6fa94c86e592 Mon Sep 17 00:00:00 2001 From: newpavlov Date: Tue, 20 Feb 2018 16:08:22 +0300 Subject: [PATCH 2/3] features in alphabetic order --- src/librustc_trans/llvm_util.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs index 4969f72412838..be3d92020ab7d 100644 --- a/src/librustc_trans/llvm_util.rs +++ b/src/librustc_trans/llvm_util.rs @@ -83,18 +83,17 @@ const ARM_WHITELIST: &'static [&'static str] = &["neon", "v7", "vfp2", "vfp3", " 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","fma", "rdrand", "rdseed", - "xsave", "xsaveopt", "xsavec", - "xsaves", "aes", "pclmulqdq", - "avx512bw", "avx512cd", - "avx512dq", "avx512er", - "avx512f", "avx512ifma", - "avx512pf", "avx512vbmi", - "avx512vl", "avx512vpopcntdq", - "mmx", "fxsr"]; +const X86_WHITELIST: &'static [&'static str] = &["aes", "avx", "avx2", "avx512bw", + "avx512cd", "avx512dq", "avx512er", + "avx512f", "avx512ifma", "avx512pf", + "avx512vbmi", "avx512vl", "avx512vpopcntdq", + "bmi", "bmi2", "fma", "fxsr", + "lzcnt", "mmx", "pclmulqdq", + "popcnt", "rdrand", "rdseed", + "sse", "sse2", "sse3", "sse4.1", + "sse4.2", "sse4a", "ssse3", + "tbm", "xsave", "xsavec", + "xsaveopt", "xsaves"]; const HEXAGON_WHITELIST: &'static [&'static str] = &["hvx", "hvx-double"]; From a33c1da861bed9dddd69f971131c4797eb6ebfeb Mon Sep 17 00:00:00 2001 From: Artyom Pavlov Date: Wed, 21 Feb 2018 09:59:28 +0300 Subject: [PATCH 3/3] typo fix --- src/librustc_trans/llvm_util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_trans/llvm_util.rs b/src/librustc_trans/llvm_util.rs index be3d92020ab7d..6271dcdfb2433 100644 --- a/src/librustc_trans/llvm_util.rs +++ b/src/librustc_trans/llvm_util.rs @@ -75,7 +75,7 @@ unsafe fn configure_llvm(sess: &Session) { llvm_args.as_ptr()); } -// WARNING: the features after aplpying `to_llvm_feature` must be known +// 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.