Skip to content

Commit

Permalink
Rollup merge of rust-lang#53179 - gnzlbg:patch-3, r=alexcrichton
Browse files Browse the repository at this point in the history
Whitelist wasm32 simd128 target feature

r? @alexcrichton
  • Loading branch information
cramertj committed Aug 8, 2018
2 parents acbe0ad + 2cdaf3b commit 369642b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/librustc_codegen_llvm/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
_ => &[],
}
}
Expand Down
1 change: 1 addition & 0 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,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),
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/target-feature-gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit 369642b

Please sign in to comment.