Skip to content

Commit 0a58f7e

Browse files
committed
Stabilize sha512, sm3 and sm4 intrinsics and runtime detection
1 parent 9eb15e2 commit 0a58f7e

File tree

2 files changed

+13
-13
lines changed
  • crates

2 files changed

+13
-13
lines changed

crates/core_arch/src/x86/sha.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ pub fn _mm_sha256rnds2_epu32(a: __m128i, b: __m128i, k: __m128i) -> __m128i {
146146
#[inline]
147147
#[target_feature(enable = "sha512,avx")]
148148
#[cfg_attr(test, assert_instr(vsha512msg1))]
149-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
149+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
150150
pub fn _mm256_sha512msg1_epi64(a: __m256i, b: __m128i) -> __m256i {
151151
unsafe { transmute(vsha512msg1(a.as_i64x4(), b.as_i64x2())) }
152152
}
@@ -159,7 +159,7 @@ pub fn _mm256_sha512msg1_epi64(a: __m256i, b: __m128i) -> __m256i {
159159
#[inline]
160160
#[target_feature(enable = "sha512,avx")]
161161
#[cfg_attr(test, assert_instr(vsha512msg2))]
162-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
162+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
163163
pub fn _mm256_sha512msg2_epi64(a: __m256i, b: __m256i) -> __m256i {
164164
unsafe { transmute(vsha512msg2(a.as_i64x4(), b.as_i64x4())) }
165165
}
@@ -175,7 +175,7 @@ pub fn _mm256_sha512msg2_epi64(a: __m256i, b: __m256i) -> __m256i {
175175
#[inline]
176176
#[target_feature(enable = "sha512,avx")]
177177
#[cfg_attr(test, assert_instr(vsha512rnds2))]
178-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
178+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
179179
pub fn _mm256_sha512rnds2_epi64(a: __m256i, b: __m256i, k: __m128i) -> __m256i {
180180
unsafe { transmute(vsha512rnds2(a.as_i64x4(), b.as_i64x4(), k.as_i64x2())) }
181181
}
@@ -188,7 +188,7 @@ pub fn _mm256_sha512rnds2_epi64(a: __m256i, b: __m256i, k: __m128i) -> __m256i {
188188
#[inline]
189189
#[target_feature(enable = "sm3,avx")]
190190
#[cfg_attr(test, assert_instr(vsm3msg1))]
191-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
191+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
192192
pub fn _mm_sm3msg1_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
193193
unsafe { transmute(vsm3msg1(a.as_i32x4(), b.as_i32x4(), c.as_i32x4())) }
194194
}
@@ -201,7 +201,7 @@ pub fn _mm_sm3msg1_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
201201
#[inline]
202202
#[target_feature(enable = "sm3,avx")]
203203
#[cfg_attr(test, assert_instr(vsm3msg2))]
204-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
204+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
205205
pub fn _mm_sm3msg2_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
206206
unsafe { transmute(vsm3msg2(a.as_i32x4(), b.as_i32x4(), c.as_i32x4())) }
207207
}
@@ -219,7 +219,7 @@ pub fn _mm_sm3msg2_epi32(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
219219
#[target_feature(enable = "sm3,avx")]
220220
#[cfg_attr(test, assert_instr(vsm3rnds2, IMM8 = 0))]
221221
#[rustc_legacy_const_generics(3)]
222-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
222+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
223223
pub fn _mm_sm3rnds2_epi32<const IMM8: i32>(a: __m128i, b: __m128i, c: __m128i) -> __m128i {
224224
static_assert!(
225225
IMM8 == (IMM8 & 0x3e),
@@ -235,7 +235,7 @@ pub fn _mm_sm3rnds2_epi32<const IMM8: i32>(a: __m128i, b: __m128i, c: __m128i) -
235235
#[inline]
236236
#[target_feature(enable = "sm4,avx")]
237237
#[cfg_attr(test, assert_instr(vsm4key4))]
238-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
238+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
239239
pub fn _mm_sm4key4_epi32(a: __m128i, b: __m128i) -> __m128i {
240240
unsafe { transmute(vsm4key4128(a.as_i32x4(), b.as_i32x4())) }
241241
}
@@ -247,7 +247,7 @@ pub fn _mm_sm4key4_epi32(a: __m128i, b: __m128i) -> __m128i {
247247
#[inline]
248248
#[target_feature(enable = "sm4,avx")]
249249
#[cfg_attr(test, assert_instr(vsm4key4))]
250-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
250+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
251251
pub fn _mm256_sm4key4_epi32(a: __m256i, b: __m256i) -> __m256i {
252252
unsafe { transmute(vsm4key4256(a.as_i32x8(), b.as_i32x8())) }
253253
}
@@ -259,7 +259,7 @@ pub fn _mm256_sm4key4_epi32(a: __m256i, b: __m256i) -> __m256i {
259259
#[inline]
260260
#[target_feature(enable = "sm4,avx")]
261261
#[cfg_attr(test, assert_instr(vsm4rnds4))]
262-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
262+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
263263
pub fn _mm_sm4rnds4_epi32(a: __m128i, b: __m128i) -> __m128i {
264264
unsafe { transmute(vsm4rnds4128(a.as_i32x4(), b.as_i32x4())) }
265265
}
@@ -271,7 +271,7 @@ pub fn _mm_sm4rnds4_epi32(a: __m128i, b: __m128i) -> __m128i {
271271
#[inline]
272272
#[target_feature(enable = "sm4,avx")]
273273
#[cfg_attr(test, assert_instr(vsm4rnds4))]
274-
#[unstable(feature = "sha512_sm_x86", issue = "126624")]
274+
#[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")]
275275
pub fn _mm256_sm4rnds4_epi32(a: __m256i, b: __m256i) -> __m256i {
276276
unsafe { transmute(vsm4rnds4256(a.as_i32x8(), b.as_i32x8())) }
277277
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ features! {
157157
/// AVX (Advanced Vector Extensions)
158158
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx2: "avx2";
159159
/// AVX2 (Advanced Vector Extensions 2)
160-
@FEATURE: #[unstable(feature = "sha512_sm_x86", issue = "126624")] sha512: "sha512";
160+
@FEATURE: #[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")] sha512: "sha512";
161161
/// SHA512
162-
@FEATURE: #[unstable(feature = "sha512_sm_x86", issue = "126624")] sm3: "sm3";
162+
@FEATURE: #[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")] sm3: "sm3";
163163
/// SM3
164-
@FEATURE: #[unstable(feature = "sha512_sm_x86", issue = "126624")] sm4: "sm4";
164+
@FEATURE: #[stable(feature = "sha512_sm_x86", since = "CURRENT_RUSTC_VERSION")] sm4: "sm4";
165165
/// SM4
166166
@FEATURE: #[stable(feature = "simd_x86", since = "1.27.0")] avx512f: "avx512f" ;
167167
/// AVX-512 F (Foundation)

0 commit comments

Comments
 (0)