Skip to content

Commit 84c246d

Browse files
authored
Rollup merge of rust-lang#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
2 parents 65cc2e6 + a3f0af2 commit 84c246d

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

src/librustc_codegen_llvm/llvm_util.rs

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ const X86_WHITELIST: &[(&str, Option<&str>)] = &[
147147
("fxsr", None),
148148
("lzcnt", None),
149149
("mmx", Some("mmx_target_feature")),
150+
("movbe", Some("movbe_target_feature")),
150151
("pclmulqdq", None),
151152
("popcnt", None),
152153
("rdrand", None),

src/librustc_typeck/collect.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2205,6 +2205,7 @@ fn from_target_feature(
22052205
Some("wasm_target_feature") => rust_features.wasm_target_feature,
22062206
Some("cmpxchg16b_target_feature") => rust_features.cmpxchg16b_target_feature,
22072207
Some("adx_target_feature") => rust_features.adx_target_feature,
2208+
Some("movbe_target_feature") => rust_features.movbe_target_feature,
22082209
Some(name) => bug!("unknown target feature gate {}", name),
22092210
None => true,
22102211
};

src/libsyntax/feature_gate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ declare_features! (
394394
(active, wasm_target_feature, "1.30.0", Some(44839), None),
395395
(active, adx_target_feature, "1.32.0", Some(44839), None),
396396
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
397+
(active, movbe_target_feature, "1.34.0", Some(44839), None),
397398

398399
// Allows macro invocations on modules expressions and statements and
399400
// procedural macros to expand to non-items.

src/test/ui/target-feature-gate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// gate-test-wasm_target_feature
2323
// gate-test-adx_target_feature
2424
// gate-test-cmpxchg16b_target_feature
25+
// gate-test-movbe_target_feature
2526
// min-llvm-version 6.0
2627

2728
#[target_feature(enable = "avx512bw")]

src/test/ui/target-feature-gate.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
2-
--> $DIR/target-feature-gate.rs:27:18
2+
--> $DIR/target-feature-gate.rs:28:18
33
|
44
LL | #[target_feature(enable = "avx512bw")]
55
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)