Skip to content

Commit 1fd7539

Browse files
authored
Unrolled build for #140766
Rollup merge of #140766 - sayantn:stabilize-keylocker, r=traviscross,tgross35 Stabilize keylocker This PR stabilizes the feature flag `keylocker_x86` (tracking issue #134813). # Public API The 2 `x86` target features `kl` and `widekl`, and the associated intrinsics in stdarch. These target features are very specialized, and are only used to signal the presence of the corresponding CPU instruction. They don't have any nontrivial interaction with the ABI (contrary to something like AVX), and serve the only purpose of enabling 11 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update. Also, these were added way back in LLVM12, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! # Associated PRs - #134814 - rust-lang/stdarch#1706 - #136831 (stdarch submodule update) - rust-lang/stdarch#1795 (stabilizing the runtime detection and intrinsics) - #141964 (stdarch submodule update for the stabilization of the runtime detection and intrinsics) As all of the required tasks have been done (adding the target features to rustc, implementing their runtime detection in std_detect and implementing the associated intrinsics in core_arch), these target features can be stabilized now. cc ````@rust-lang/lang```` cc ````@rust-lang/libs-api```` for the intrinsics and runtime detection I don't think anyone else worked on this feature, so no one else to ping, maybe cc ````@Amanieu.```` I will send the reference pr soon.
2 parents c6a9554 + cd7533a commit 1fd7539

File tree

6 files changed

+4
-24
lines changed

6 files changed

+4
-24
lines changed

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ declare_features! (
259259
/// Allows some increased flexibility in the name resolution rules,
260260
/// especially around globs and shadowing (RFC 1560).
261261
(accepted, item_like_imports, "1.15.0", Some(35120)),
262+
// Allows using the `kl` and `widekl` target features and the associated intrinsics
263+
(accepted, keylocker_x86, "CURRENT_RUSTC_VERSION", Some(134813)),
262264
/// Allows `'a: { break 'a; }`.
263265
(accepted, label_break_value, "1.65.0", Some(48594)),
264266
/// Allows `let...else` statements.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,6 @@ declare_features! (
546546
(incomplete, inherent_associated_types, "1.52.0", Some(8995)),
547547
/// Allows using `pointer` and `reference` in intra-doc links
548548
(unstable, intra_doc_pointers, "1.51.0", Some(80896)),
549-
// Allows using the `kl` and `widekl` target features and the associated intrinsics
550-
(unstable, keylocker_x86, "1.86.0", Some(134813)),
551549
// Allows setting the threshold for the `large_assignments` lint.
552550
(unstable, large_assignments, "1.52.0", Some(83518)),
553551
/// Allow to have type alias types for inter-crate use.

compiler/rustc_target/src/target_features.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
443443
("fma", Stable, &["avx"]),
444444
("fxsr", Stable, &[]),
445445
("gfni", Stable, &["sse2"]),
446-
("kl", Unstable(sym::keylocker_x86), &["sse2"]),
446+
("kl", Stable, &["sse2"]),
447447
("lahfsahf", Unstable(sym::lahfsahf_target_feature), &[]),
448448
("lzcnt", Stable, &[]),
449449
("movbe", Stable, &[]),
@@ -471,7 +471,7 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
471471
("tbm", Unstable(sym::tbm_target_feature), &[]),
472472
("vaes", Stable, &["avx2", "aes"]),
473473
("vpclmulqdq", Stable, &["avx", "pclmulqdq"]),
474-
("widekl", Unstable(sym::keylocker_x86), &["kl"]),
474+
("widekl", Stable, &["kl"]),
475475
("x87", Unstable(sym::x87_target_feature), &[]),
476476
("xop", Unstable(sym::xop_target_feature), &[/*"fma4", */ "avx", "sse4a"]),
477477
("xsave", Stable, &[]),

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@
190190
#![feature(aarch64_unstable_target_feature)]
191191
#![feature(arm_target_feature)]
192192
#![feature(hexagon_target_feature)]
193-
#![feature(keylocker_x86)]
194193
#![feature(loongarch_target_feature)]
195194
#![feature(mips_target_feature)]
196195
#![feature(powerpc_target_feature)]

tests/ui/feature-gates/feature-gate-keylocker_x86.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/ui/feature-gates/feature-gate-keylocker_x86.stderr

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)