Skip to content

Commit

Permalink
Rollup merge of rust-lang#60060 - mtak-:rtm-x86-feature, r=petrochenkov
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Centril authored Apr 19, 2019
2 parents eb95caa + 365a48a commit a667ae6
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ const X86_WHITELIST: &[(&str, Option<&str>)] = &[
("popcnt", None),
("rdrand", None),
("rdseed", None),
("rtm", Some("rtm_target_feature")),
("sha", None),
("sse", None),
("sse2", None),
Expand Down
1 change: 1 addition & 0 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2432,6 +2432,7 @@ fn from_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("rtm_target_feature") => rust_features.rtm_target_feature,
Some(name) => bug!("unknown target feature gate {}", name),
None => true,
};
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 @@ -402,6 +402,7 @@ declare_features! (
(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),
(active, rtm_target_feature, "1.35.0", Some(44839), None),

// Allows macro invocations on modules expressions and statements and
// procedural macros to expand to non-items.
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-adx_target_feature
// gate-test-cmpxchg16b_target_feature
// gate-test-movbe_target_feature
// gate-test-rtm_target_feature
// min-llvm-version 6.0

#[target_feature(enable = "avx512bw")]
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/target-feature-gate.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: the target feature `avx512bw` is currently unstable
--> $DIR/target-feature-gate.rs:28:18
--> $DIR/target-feature-gate.rs:29:18
|
LL | #[target_feature(enable = "avx512bw")]
| ^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit a667ae6

Please sign in to comment.