Skip to content

Commit df3618d

Browse files
Olasunkanmi OlayinkaAmanieu
Olasunkanmi Olayinka
authored andcommitted
feat: stabilization for stdarch_aarch64_crc32
1 parent bffd44f commit df3618d

File tree

3 files changed

+89
-12
lines changed

3 files changed

+89
-12
lines changed

crates/core_arch/src/arm_shared/crc.rs

+80-10
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ 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(
62+
target_arch = "arm",
63+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
64+
)]
65+
#[cfg_attr(
66+
not(target_arch = "arm"),
67+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
68+
)]
6269
pub unsafe fn __crc32b(crc: u32, data: u8) -> u32 {
6370
crc32b_(crc, data as u32)
6471
}
@@ -70,7 +77,14 @@ pub unsafe fn __crc32b(crc: u32, data: u8) -> u32 {
7077
#[target_feature(enable = "crc")]
7178
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
7279
#[cfg_attr(test, assert_instr(crc32h))]
73-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
80+
#[cfg_attr(
81+
target_arch = "arm",
82+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
83+
)]
84+
#[cfg_attr(
85+
not(target_arch = "arm"),
86+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
87+
)]
7488
pub unsafe fn __crc32h(crc: u32, data: u16) -> u32 {
7589
crc32h_(crc, data as u32)
7690
}
@@ -82,7 +96,14 @@ pub unsafe fn __crc32h(crc: u32, data: u16) -> u32 {
8296
#[target_feature(enable = "crc")]
8397
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
8498
#[cfg_attr(test, assert_instr(crc32w))]
85-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
99+
#[cfg_attr(
100+
target_arch = "arm",
101+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
102+
)]
103+
#[cfg_attr(
104+
not(target_arch = "arm"),
105+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
106+
)]
86107
pub unsafe fn __crc32w(crc: u32, data: u32) -> u32 {
87108
crc32w_(crc, data)
88109
}
@@ -94,7 +115,14 @@ pub unsafe fn __crc32w(crc: u32, data: u32) -> u32 {
94115
#[target_feature(enable = "crc")]
95116
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
96117
#[cfg_attr(test, assert_instr(crc32cb))]
97-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
118+
#[cfg_attr(
119+
target_arch = "arm",
120+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
121+
)]
122+
#[cfg_attr(
123+
not(target_arch = "arm"),
124+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
125+
)]
98126
pub unsafe fn __crc32cb(crc: u32, data: u8) -> u32 {
99127
crc32cb_(crc, data as u32)
100128
}
@@ -106,7 +134,14 @@ pub unsafe fn __crc32cb(crc: u32, data: u8) -> u32 {
106134
#[target_feature(enable = "crc")]
107135
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
108136
#[cfg_attr(test, assert_instr(crc32ch))]
109-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
137+
#[cfg_attr(
138+
target_arch = "arm",
139+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
140+
)]
141+
#[cfg_attr(
142+
not(target_arch = "arm"),
143+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
144+
)]
110145
pub unsafe fn __crc32ch(crc: u32, data: u16) -> u32 {
111146
crc32ch_(crc, data as u32)
112147
}
@@ -118,7 +153,14 @@ pub unsafe fn __crc32ch(crc: u32, data: u16) -> u32 {
118153
#[target_feature(enable = "crc")]
119154
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
120155
#[cfg_attr(test, assert_instr(crc32cw))]
121-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
156+
#[cfg_attr(
157+
target_arch = "arm",
158+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
159+
)]
160+
#[cfg_attr(
161+
not(target_arch = "arm"),
162+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
163+
)]
122164
pub unsafe fn __crc32cw(crc: u32, data: u32) -> u32 {
123165
crc32cw_(crc, data)
124166
}
@@ -130,7 +172,14 @@ pub unsafe fn __crc32cw(crc: u32, data: u32) -> u32 {
130172
#[target_feature(enable = "crc")]
131173
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
132174
#[cfg_attr(test, assert_instr(crc32x))]
133-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
175+
#[cfg_attr(
176+
target_arch = "arm",
177+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
178+
)]
179+
#[cfg_attr(
180+
not(target_arch = "arm"),
181+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
182+
)]
134183
pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
135184
crc32x_(crc, data)
136185
}
@@ -142,7 +191,14 @@ pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
142191
#[target_feature(enable = "crc")]
143192
#[cfg(target_arch = "arm")]
144193
#[cfg_attr(test, assert_instr(crc32w))]
145-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
194+
#[cfg_attr(
195+
target_arch = "arm",
196+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
197+
)]
198+
#[cfg_attr(
199+
not(target_arch = "arm"),
200+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
201+
)]
146202
pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
147203
// On 32-bit ARM this intrinsic emits a chain of two `crc32_w` instructions
148204
// and truncates the data to 32 bits in both clang and gcc
@@ -159,7 +215,14 @@ pub unsafe fn __crc32d(crc: u32, data: u64) -> u32 {
159215
#[target_feature(enable = "crc")]
160216
#[cfg(any(target_arch = "aarch64", target_arch = "arm64ec"))]
161217
#[cfg_attr(test, assert_instr(crc32cx))]
162-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
218+
#[cfg_attr(
219+
target_arch = "arm",
220+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
221+
)]
222+
#[cfg_attr(
223+
not(target_arch = "arm"),
224+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
225+
)]
163226
pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
164227
crc32cx_(crc, data)
165228
}
@@ -171,7 +234,14 @@ pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
171234
#[target_feature(enable = "crc")]
172235
#[cfg(target_arch = "arm")]
173236
#[cfg_attr(test, assert_instr(crc32cw))]
174-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
237+
#[cfg_attr(
238+
target_arch = "arm",
239+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
240+
)]
241+
#[cfg_attr(
242+
not(target_arch = "arm"),
243+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
244+
)]
175245
pub unsafe fn __crc32cd(crc: u32, data: u64) -> u32 {
176246
// On 32-bit ARM this intrinsic emits a chain of two `crc32_cw` instructions
177247
// and truncates the data to 32 bits in both clang and gcc

crates/core_arch/src/arm_shared/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ mod hints;
6161
pub use self::hints::*;
6262

6363
mod crc;
64-
#[unstable(feature = "stdarch_arm_crc32", issue = "117215")]
64+
#[cfg_attr(
65+
target_arch = "arm",
66+
unstable(feature = "stdarch_aarch32_crc32", issue = "125085")
67+
)]
68+
#[cfg_attr(
69+
not(target_arch = "arm"),
70+
stable(feature = "stdarch_aarch64_crc32", since = "1.80.0")
71+
)]
6572
pub use crc::*;
6673

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

crates/intrinsic-test/src/main.rs

+1-1
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)