Skip to content

Commit 38a30f4

Browse files
authored
Rollup merge of rust-lang#60060 - mtak-:rtm-x86-feature, r=petrochenkov
whitelist RTM x86 target cpu feature This PR adds support for intels restricted transactional memory cpu feature. I mostly copied what was done for the [movbe](rust-lang#57999) feature. rust-lang/stdarch#718
2 parents 38b51a3 + 365a48a commit 38a30f4

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
@@ -154,6 +154,7 @@ const X86_WHITELIST: &[(&str, Option<&str>)] = &[
154154
("popcnt", None),
155155
("rdrand", None),
156156
("rdseed", None),
157+
("rtm", Some("rtm_target_feature")),
157158
("sha", None),
158159
("sse", None),
159160
("sse2", None),

src/librustc_typeck/collect.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,7 @@ fn from_target_feature(
24322432
Some("cmpxchg16b_target_feature") => rust_features.cmpxchg16b_target_feature,
24332433
Some("adx_target_feature") => rust_features.adx_target_feature,
24342434
Some("movbe_target_feature") => rust_features.movbe_target_feature,
2435+
Some("rtm_target_feature") => rust_features.rtm_target_feature,
24352436
Some(name) => bug!("unknown target feature gate {}", name),
24362437
None => true,
24372438
};

src/libsyntax/feature_gate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ declare_features! (
402402
(active, adx_target_feature, "1.32.0", Some(44839), None),
403403
(active, cmpxchg16b_target_feature, "1.32.0", Some(44839), None),
404404
(active, movbe_target_feature, "1.34.0", Some(44839), None),
405+
(active, rtm_target_feature, "1.35.0", Some(44839), None),
405406

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

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

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// gate-test-adx_target_feature
2424
// gate-test-cmpxchg16b_target_feature
2525
// gate-test-movbe_target_feature
26+
// gate-test-rtm_target_feature
2627
// min-llvm-version 6.0
2728

2829
#[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
2-
--> $DIR/target-feature-gate.rs:28:18
2+
--> $DIR/target-feature-gate.rs:29:18
33
|
44
LL | #[target_feature(enable = "avx512bw")]
55
| ^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)