Skip to content

Commit 804455d

Browse files
author
Olasunkanmi Olayinka
committed
feat: stabilization for stdarch_aarch64_crc32
1 parent dee4c16 commit 804455d

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

crates/core_arch/src/arm_shared/crc.rs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ use stdarch_test::assert_instr;
5858
#[target_feature(enable = "crc")]
5959
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
6060
#[cfg_attr(test, assert_instr(crc32b))]
61-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
61+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
62+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
6263
pub unsafe fn __crc32b(crc: u32, data: u8) -> u32 {
6364
crc32b_(crc, data as u32)
6465
}
@@ -70,7 +71,8 @@ pub unsafe fn __crc32b(crc: u32, data: u8) -> u32 {
7071
#[target_feature(enable = "crc")]
7172
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
7273
#[cfg_attr(test, assert_instr(crc32h))]
73-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
74+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
75+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
7476
pub unsafe fn __crc32h(crc: u32, data: u16) -> u32 {
7577
crc32h_(crc, data as u32)
7678
}
@@ -82,7 +84,8 @@ pub unsafe fn __crc32h(crc: u32, data: u16) -> u32 {
8284
#[target_feature(enable = "crc")]
8385
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
8486
#[cfg_attr(test, assert_instr(crc32w))]
85-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
87+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
88+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
8689
pub unsafe fn __crc32w(crc: u32, data: u32) -> u32 {
8790
crc32w_(crc, data)
8891
}
@@ -94,7 +97,8 @@ pub unsafe fn __crc32w(crc: u32, data: u32) -> u32 {
9497
#[target_feature(enable = "crc")]
9598
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
9699
#[cfg_attr(test, assert_instr(crc32cb))]
97-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
100+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
101+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
98102
pub unsafe fn __crc32cb(crc: u32, data: u8) -> u32 {
99103
crc32cb_(crc, data as u32)
100104
}
@@ -106,7 +110,8 @@ pub unsafe fn __crc32cb(crc: u32, data: u8) -> u32 {
106110
#[target_feature(enable = "crc")]
107111
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
108112
#[cfg_attr(test, assert_instr(crc32ch))]
109-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
113+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
114+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
110115
pub unsafe fn __crc32ch(crc: u32, data: u16) -> u32 {
111116
crc32ch_(crc, data as u32)
112117
}
@@ -118,7 +123,8 @@ pub unsafe fn __crc32ch(crc: u32, data: u16) -> u32 {
118123
#[target_feature(enable = "crc")]
119124
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
120125
#[cfg_attr(test, assert_instr(crc32cw))]
121-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
126+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
127+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
122128
pub unsafe fn __crc32cw(crc: u32, data: u32) -> u32 {
123129
crc32cw_(crc, data)
124130
}
@@ -130,7 +136,8 @@ pub unsafe fn __crc32cw(crc: u32, data: u32) -> u32 {
130136
#[target_feature(enable = "crc")]
131137
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
132138
#[cfg_attr(test, assert_instr(crc32x))]
133-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
139+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
140+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
134141
pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
135142
crc32x_(crc, data)
136143
}
@@ -142,7 +149,8 @@ pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
142149
#[target_feature(enable = "crc")]
143150
#[cfg(target_arch = "arm")]
144151
#[cfg_attr(test, assert_instr(crc32w))]
145-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
152+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
153+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
146154
pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
147155
// On 32-bit ARM this intrinsic emits a chain of two `crc32_w` instructions
148156
// and truncates the data to 32 bits in both clang and gcc
@@ -159,7 +167,8 @@ pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
159167
#[target_feature(enable = "crc")]
160168
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
161169
#[cfg_attr(test, assert_instr(crc32cx))]
162-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
170+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
171+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
163172
pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
164173
crc32cx_(crc, data)
165174
}
@@ -171,7 +180,8 @@ pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
171180
#[target_feature(enable = "crc")]
172181
#[cfg(target_arch = "arm")]
173182
#[cfg_attr(test, assert_instr(crc32cw))]
174-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
183+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
184+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
175185
pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
176186
// On 32-bit ARM this intrinsic emits a chain of two `crc32_cw` instructions
177187
// and truncates the data to 32 bits in both clang and gcc

crates/core_arch/src/arm_shared/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ mod hints;
6161
pub use self::hints::*;
6262

6363
mod crc;
64-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
64+
#[cfg_attr(target_arch = "arm", unstable(feature = "stdarch_aarch32_crc32", issue = "125085"))]
65+
#[cfg_attr(not(target_arch = "arm"), stable(feature = "stdarch_aarch64_crc32", since = "1.80.0"))]
6566
pub use crc::*;
6667

6768
// NEON intrinsics are currently broken on big-endian, so don't expose them. (#1484)

crates/intrinsic-test/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ fn generate_rust_program(notices: &str, intrinsic: &Intrinsic, a32: bool) -> Str
186186
r#"{notices}#![feature(simd_ffi)]
187187
#![feature(link_llvm_intrinsics)]
188188
#![cfg_attr(target_arch = "arm", feature(stdarch_arm_neon_intrinsics))]
189-
#![feature(stdarch_arm_crc32)]
189+
#![cfg_attr(target_arch = "arm", feature(stdarch_aarch32_crc32)]
190190
#![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_fcma))]
191191
#![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_dotprod))]
192192
#![cfg_attr(any(target_arch = "aarch64", target_arch = "arm64ec"), feature(stdarch_neon_i8mm))]

0 commit comments

Comments
 (0)