about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-08-09 16:58:48 +0800
committerkennytm <kennytm@gmail.com>2018-08-10 01:01:20 +0800
commit7f886cf12b39e4079a9db1f3c5075b40de574a67 (patch)
tree4c459bf147b429448d508efc8abd5c5372e9bb25 /src
parent23601d08e6e3f52fec722e42362f727971475ced (diff)
parentc92db3665622f1775358efe7eeb57d0db31cf6db (diff)
downloadrust-7f886cf12b39e4079a9db1f3c5075b40de574a67.tar.gz
rust-7f886cf12b39e4079a9db1f3c5075b40de574a67.zip
Rollup merge of #53179 - gnzlbg:patch-3, r=alexcrichton
Whitelist wasm32 simd128 target feature

r? @alexcrichton
Diffstat (limited to 'src')
-rw-r--r--src/librustc_codegen_llvm/llvm_util.rs6
-rw-r--r--src/libsyntax/feature_gate.rs1
-rw-r--r--src/test/ui/target-feature-gate.rs1
-rw-r--r--src/test/ui/target-feature-gate.stderr2
4 files changed, 9 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs
index 441fff5f08c..ff26e0f35f0 100644
--- a/src/librustc_codegen_llvm/llvm_util.rs
+++ b/src/librustc_codegen_llvm/llvm_util.rs
@@ -169,6 +169,10 @@ const MIPS_WHITELIST: &[(&str, Option<&str>)] = &[
     ("msa", Some("mips_target_feature")),
 ];
 
+const WASM_WHITELIST: &[(&str, Option<&str>)] = &[
+    ("simd128", Some("wasm_target_feature")),
+];
+
 /// When rustdoc is running, provide a list of all known features so that all their respective
 /// primtives may be documented.
 ///
@@ -181,6 +185,7 @@ pub fn all_known_features() -> impl Iterator<Item=(&'static str, Option<&'static
         .chain(HEXAGON_WHITELIST.iter().cloned())
         .chain(POWERPC_WHITELIST.iter().cloned())
         .chain(MIPS_WHITELIST.iter().cloned())
+        .chain(WASM_WHITELIST.iter().cloned())
 }
 
 pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
@@ -228,6 +233,7 @@ pub fn target_feature_whitelist(sess: &Session)
         "hexagon" => HEXAGON_WHITELIST,
         "mips" | "mips64" => MIPS_WHITELIST,
         "powerpc" | "powerpc64" => POWERPC_WHITELIST,
+        "wasm32" => WASM_WHITELIST,
         _ => &[],
     }
 }
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 65eeaff3f10..976708ae788 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -452,6 +452,7 @@ declare_features! (
     (active, mmx_target_feature, "1.27.0", Some(44839), None),
     (active, sse4a_target_feature, "1.27.0", Some(44839), None),
     (active, tbm_target_feature, "1.27.0", Some(44839), None),
+    (active, wasm_target_feature, "1.30.0", Some(44839), None),
 
     // Allows macro invocations of the form `#[foo::bar]`
     (active, proc_macro_path_invoc, "1.27.0", Some(38356), None),
diff --git a/src/test/ui/target-feature-gate.rs b/src/test/ui/target-feature-gate.rs
index c2dc927c4b5..8a045884cae 100644
--- a/src/test/ui/target-feature-gate.rs
+++ b/src/test/ui/target-feature-gate.rs
@@ -23,6 +23,7 @@
 // gate-test-hexagon_target_feature
 // gate-test-mips_target_feature
 // gate-test-mmx_target_feature
+// gate-test-wasm_target_feature
 // min-llvm-version 6.0
 
 #[target_feature(enable = "avx512bw")]
diff --git a/src/test/ui/target-feature-gate.stderr b/src/test/ui/target-feature-gate.stderr
index 24141d0064f..f18bebc0c29 100644
--- a/src/test/ui/target-feature-gate.stderr
+++ b/src/test/ui/target-feature-gate.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
-  --> $DIR/target-feature-gate.rs:28:18
+  --> $DIR/target-feature-gate.rs:29:18
    |
 LL | #[target_feature(enable = "avx512bw")]
    |                  ^^^^^^^^^^^^^^^^^^^