Skip to content

Commit abe96ca

Browse files
authored
re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 (#842)
* re-stabilize the AVX-512 features that were stabilized in Rust 1.27.0 #739 added per-feature stabilization of runtime CPU feature detection. In so doing, it de-stabilized some detection features that had been stable since Rust 1.27.0, breaking some published crates (on nightly). This commit re-stabilizes the subset of AVX-512 detection features that were included in 1.27.0 (that is, the pre-Ice-Lake subset). Other instruction sets (MMX in particular) remain de-stabilized, pending a decision about whether should ever stabilize them. See rust-lang/rust#68905. * add a comment explaining feature detection stability * adjust stabilizations to match most recent proposal rust-lang/rust#68905 (comment)
1 parent dea5752 commit abe96ca

File tree

1 file changed

+14
-10
lines changed
  • crates/std_detect/src/detect/arch

1 file changed

+14
-10
lines changed

crates/std_detect/src/detect/arch/x86.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ features! {
9292
/// RDSEED
9393
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] tsc: "tsc";
9494
/// TSC (Time Stamp Counter)
95-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] mmx: "mmx";
95+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] mmx: "mmx";
9696
/// MMX (MultiMedia eXtensions)
9797
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] sse: "sse";
9898
/// SSE (Streaming SIMD Extensions)
@@ -106,27 +106,31 @@ features! {
106106
/// SSE4.1 (Streaming SIMD Extensions 4.1)
107107
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] sse4_2: "sse4.2";
108108
/// SSE4.2 (Streaming SIMD Extensions 4.2)
109-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] sse4a: "sse4a";
109+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] sse4a: "sse4a";
110110
/// SSE4a (Streaming SIMD Extensions 4a)
111111
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] sha: "sha";
112112
/// SHA
113113
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx: "avx";
114114
/// AVX (Advanced Vector Extensions)
115115
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx2: "avx2";
116116
/// AVX2 (Advanced Vector Extensions 2)
117-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512f: "avx512f" ;
117+
// Detection for the AVX-512 features below was accidentally stabilized in
118+
// Rust 1.27.0, even though the corresponding intrinsics are still unstable
119+
// or unimplemeted. There are stable callers who rely on detection support,
120+
// e.g. to call AVX-512 C code via FFI.
121+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512f: "avx512f" ;
118122
/// AVX-512 F (Foundation)
119-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512cd: "avx512cd" ;
123+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512cd: "avx512cd" ;
120124
/// AVX-512 CD (Conflict Detection Instructions)
121-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512er: "avx512er";
125+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512er: "avx512er";
122126
/// AVX-512 ER (Expo nential and Reciprocal Instructions)
123-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512pf: "avx512pf";
127+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512pf: "avx512pf";
124128
/// AVX-512 PF (Prefetch Instructions)
125-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512bw: "avx512bw";
129+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512bw: "avx512bw";
126130
/// AVX-512 BW (Byte and Word Instructions)
127-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512dq: "avx512dq";
131+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512dq: "avx512dq";
128132
/// AVX-512 DQ (Doubleword and Quadword)
129-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512vl: "avx512vl";
133+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512vl: "avx512vl";
130134
/// AVX-512 VL (Vector Length Extensions)
131135
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] avx512ifma: "avx512ifma";
132136
/// AVX-512 IFMA (Integer Fused Multiply Add)
@@ -161,7 +165,7 @@ features! {
161165
/// BMI2 (Bit Manipulation Instructions 2)
162166
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] lzcnt: "lzcnt";
163167
/// ABM (Advanced Bit Manipulation) / LZCNT (Leading Zero Count)
164-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] tbm: "tbm";
168+
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] tbm: "tbm";
165169
/// TBM (Trailing Bit Manipulation)
166170
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] popcnt: "popcnt";
167171
/// POPCNT (Population Count)

0 commit comments

Comments
 (0)