summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-01-31 02:10:49 +0100
committerGitHub <noreply@github.com>2019-01-31 02:10:49 +0100
commitbb91a192c0b3b56d1cf88a1db13b767aa3c890d0 (patch)
tree3fc1df65a23466e4b26f90b4858a42d0472607f1
parentdfc8ff549fdcfadd67f7cd74b572e7ba7f17296f (diff)
parenta3f0af2e672055cddef1e87b56caff763322e6d9 (diff)
downloadrust-bb91a192c0b3b56d1cf88a1db13b767aa3c890d0.tar.gz
Rollup merge of #57999 - jethrogb:jb/movbe-feature, r=alexcrichton
Add MOVBE x86 CPU feature I have no idea if this is correct. I basically copied the ADX feature. I verified the feature is also called `movbe` in LLVM. I marked this to become stable immediately, as part of the RFC 2045. r? @alexcrichton
-rw-r--r--src/librustc_codegen_llvm/llvm_util.rs1
-rw-r--r--src/librustc_typeck/collect.rs1
-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
5 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs
index e2d0e558d3b..b46e6ef84b9 100644
--- a/src/librustc_codegen_llvm/llvm_util.rs
+++ b/src/librustc_codegen_llvm/llvm_util.rs
@@ -147,6 +147,7 @@ const X86_WHITELIST: &[(&str, Option<&str>)] = &[
("fxsr", None),
("lzcnt", None),
("mmx", Some("mmx_target_feature")),
+ ("movbe", Some("movbe_target_feature")),
("pclmulqdq", None),
("popcnt", None),
("rdrand", None),
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index 120467cbd13..4275022c4f6 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -2205,6 +2205,7 @@ fn from_target_feature(
Some("wasm_target_feature") => rust_features.wasm_target_feature,
Some("cmpxchg16b_target_feature") => rust_features.cmpxchg16b_target_feature,
Some("adx_target_feature") => rust_features.adx_target_feature,
+ Some("movbe_target_feature") => rust_features.movbe_target_feature,
Some(name) => bug!("unknown target feature gate {}", name),
None => true,
};
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 28209248246..9dd17b420aa 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -394,6 +394,7 @@ declare_features! (
(active, wasm_target_feature, "1.30.0", Some(44839), None),
(active, adx_target_feature, "1.32.0", Some(44839), None),
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
+ (active, movbe_target_feature, "1.34.0", Some(44839), None),
// Allows macro invocations on modules expressions and statements and
// procedural macros to expand to non-items.
diff --git a/src/test/ui/target-feature-gate.rs b/src/test/ui/target-feature-gate.rs
index 30fb534dbb5..84300301b76 100644
--- a/src/test/ui/target-feature-gate.rs
+++ b/src/test/ui/target-feature-gate.rs
@@ -22,6 +22,7 @@
// gate-test-wasm_target_feature
// gate-test-adx_target_feature
// gate-test-cmpxchg16b_target_feature
+// gate-test-movbe_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 8dfb4f65f98..24141d0064f 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:27:18
+ --> $DIR/target-feature-gate.rs:28:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^