Skip to content

Commit ccacf13

Browse files
authored
Unrolled build for #140767
Rollup merge of #140767 - sayantn:stabilize-sha512, r=traviscross,tgross35 Stabilize `sha512`, `sm3` and `sm4` for x86 This PR stabilizes the feature flag `sha512_sm_x86` (tracking issue #126624). # Public API The 3 `x86` target features `sha512`, `sm3` and `sm4`, 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 10 stdarch intrinsics, all of which have been implemented and propagated to rustc via a stdarch submodule update. Also, these were added in LLVM17, and as the minimum LLVM required for rustc is LLVM19, we are safe in that front too! # Associated PRs - #126704 - rust-lang/stdarch#1592 - rust-lang/stdarch#1790 - #140389 (stdarch submodule update) - rust-lang/stdarch#1796 (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 00b5262 + 632396e commit ccacf13

File tree

6 files changed

+5
-25
lines changed

6 files changed

+5
-25
lines changed

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ declare_features! (
382382
(accepted, self_in_typedefs, "1.32.0", Some(49303)),
383383
/// Allows `Self` struct constructor (RFC 2302).
384384
(accepted, self_struct_ctor, "1.32.0", Some(51994)),
385+
/// Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics
386+
(accepted, sha512_sm_x86, "CURRENT_RUSTC_VERSION", Some(126624)),
385387
/// Shortern the tail expression lifetime
386388
(accepted, shorter_tail_lifetimes, "1.84.0", Some(123739)),
387389
/// Allows using subslice patterns, `[a, .., b]` and `[a, xs @ .., b]`.

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,8 +627,6 @@ declare_features! (
627627
(unstable, return_type_notation, "1.70.0", Some(109417)),
628628
/// Allows `extern "rust-cold"`.
629629
(unstable, rust_cold_cc, "1.63.0", Some(97544)),
630-
/// Allows use of x86 SHA512, SM3 and SM4 target-features and intrinsics
631-
(unstable, sha512_sm_x86, "1.82.0", Some(126624)),
632630
/// Allows the use of SIMD types in functions declared in `extern` blocks.
633631
(unstable, simd_ffi, "1.0.0", Some(27731)),
634632
/// Allows specialization of implementations (RFC 1210).

compiler/rustc_target/src/target_features.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,9 @@ static X86_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
455455
("rdseed", Stable, &[]),
456456
("rtm", Unstable(sym::rtm_target_feature), &[]),
457457
("sha", Stable, &["sse2"]),
458-
("sha512", Unstable(sym::sha512_sm_x86), &["avx2"]),
459-
("sm3", Unstable(sym::sha512_sm_x86), &["avx"]),
460-
("sm4", Unstable(sym::sha512_sm_x86), &["avx2"]),
458+
("sha512", Stable, &["avx2"]),
459+
("sm3", Stable, &["avx"]),
460+
("sm4", Stable, &["avx2"]),
461461
// This cannot actually be toggled, the ABI always fixes it, so it'd make little sense to
462462
// stabilize. It must be in this list for the ABI check to be able to use it.
463463
("soft-float", Stability::Unstable(sym::x87_target_feature), &[]),

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@
197197
#![feature(riscv_target_feature)]
198198
#![feature(rtm_target_feature)]
199199
#![feature(s390x_target_feature)]
200-
#![feature(sha512_sm_x86)]
201200
#![feature(sse4a_target_feature)]
202201
#![feature(tbm_target_feature)]
203202
#![feature(wasm_target_feature)]

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

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

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

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

0 commit comments

Comments
 (0)