Skip to content

Commit b6eccef

Browse files
authored
Unrolled build for rust-lang#134814
Rollup merge of rust-lang#134814 - sayantn:keylocker, r=oli-obk Add `kl` and `widekl` target features, and the feature gate This is an effort towards rust-lang#134813. This PR adds the target-features and the feature gate to `rustc` <!-- ```@rustbot``` label O-x86_64 O-x86_32 A-target-feature r? compiler -->
2 parents c705b7d + dc49fdd commit b6eccef

File tree

6 files changed

+26
-0
lines changed

6 files changed

+26
-0
lines changed

compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,8 @@ declare_features! (
529529
(unstable, inline_const_pat, "1.58.0", Some(76001)),
530530
/// Allows using `pointer` and `reference` in intra-doc links
531531
(unstable, intra_doc_pointers, "1.51.0", Some(80896)),
532+
// Allows using the `kl` and `widekl` target features and the associated intrinsics
533+
(unstable, keylocker_x86, "CURRENT_RUSTC_VERSION", Some(134813)),
532534
// Allows setting the threshold for the `large_assignments` lint.
533535
(unstable, large_assignments, "1.52.0", Some(83518)),
534536
/// Allow to have type alias types for inter-crate use.

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,7 @@ symbols! {
11481148
iterator,
11491149
iterator_collect_fn,
11501150
kcfi,
1151+
keylocker_x86,
11511152
keyword,
11521153
kind,
11531154
kreg,

compiler/rustc_target/src/target_features.rs

+2
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ const X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
409409
("fma", Stable, &["avx"]),
410410
("fxsr", Stable, &[]),
411411
("gfni", Unstable(sym::avx512_target_feature), &["sse2"]),
412+
("kl", Unstable(sym::keylocker_x86), &["sse2"]),
412413
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
413414
("lzcnt", Stable, &[]),
414415
("movbe", Stable, &[]),
@@ -435,6 +436,7 @@ const X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
435436
("tbm", Unstable(sym::tbm_target_feature), &[]),
436437
("vaes", Unstable(sym::avx512_target_feature), &["avx2", "aes"]),
437438
("vpclmulqdq", Unstable(sym::avx512_target_feature), &["avx", "pclmulqdq"]),
439+
("widekl", Unstable(sym::keylocker_x86), &["kl"]),
438440
("x87", Unstable(sym::x87_target_feature), &[]),
439441
("xop", Unstable(sym::xop_target_feature), &[/*"fma4", */ "avx", "sse4a"]),
440442
("xsave", Stable, &[]),

tests/ui/check-cfg/target_feature.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
127127
`isa-68881`
128128
`isa-68882`
129129
`jsconv`
130+
`kl`
130131
`lahfsahf`
131132
`lasx`
132133
`lbt`
@@ -271,6 +272,7 @@ LL | cfg!(target_feature = "_UNEXPECTED_VALUE");
271272
`vsx`
272273
`wfxt`
273274
`wide-arithmetic`
275+
`widekl`
274276
`x87`
275277
`xop`
276278
`xsave`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ only-x86_64
2+
#[target_feature(enable = "kl")]
3+
//~^ ERROR: currently unstable
4+
unsafe fn foo() {}
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error[E0658]: the target feature `kl` is currently unstable
2+
--> $DIR/feature-gate-keylocker_x86.rs:2:18
3+
|
4+
LL | #[target_feature(enable = "kl")]
5+
| ^^^^^^^^^^^^^
6+
|
7+
= note: see issue #134813 <https://github.com/rust-lang/rust/issues/134813> for more information
8+
= help: add `#![feature(keylocker_x86)]` to the crate attributes to enable
9+
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+
error: aborting due to 1 previous error
12+
13+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)