Fix stability attributes for ARM crypto intrinsics

This commit is contained in:
Amanieu d'Antras 2023-10-26 12:07:27 +01:00
parent 1dcafa2caf
commit bde97f485d
2 changed files with 78 additions and 56 deletions

View file

@ -58,12 +58,13 @@ use stdarch_test::assert_instr;
#[target_feature(enable = "aes")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(aese))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vaeseq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
vaeseq_u8_(data, key)
@ -76,12 +77,13 @@ pub unsafe fn vaeseq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
#[target_feature(enable = "aes")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(aesd))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vaesdq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
vaesdq_u8_(data, key)
@ -94,12 +96,13 @@ pub unsafe fn vaesdq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
#[target_feature(enable = "aes")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(aesmc))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vaesmcq_u8(data: uint8x16_t) -> uint8x16_t {
vaesmcq_u8_(data)
@ -112,12 +115,13 @@ pub unsafe fn vaesmcq_u8(data: uint8x16_t) -> uint8x16_t {
#[target_feature(enable = "aes")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(aesimc))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vaesimcq_u8(data: uint8x16_t) -> uint8x16_t {
vaesimcq_u8_(data)
@ -130,12 +134,13 @@ pub unsafe fn vaesimcq_u8(data: uint8x16_t) -> uint8x16_t {
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha1h))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha1h_u32(hash_e: u32) -> u32 {
vsha1h_u32_(hash_e)
@ -148,12 +153,13 @@ pub unsafe fn vsha1h_u32(hash_e: u32) -> u32 {
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha1c))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha1cq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t {
vsha1cq_u32_(hash_abcd, hash_e, wk)
@ -166,12 +172,13 @@ pub unsafe fn vsha1cq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) ->
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha1m))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha1mq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t {
vsha1mq_u32_(hash_abcd, hash_e, wk)
@ -184,12 +191,13 @@ pub unsafe fn vsha1mq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) ->
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha1p))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha1pq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) -> uint32x4_t {
vsha1pq_u32_(hash_abcd, hash_e, wk)
@ -202,12 +210,13 @@ pub unsafe fn vsha1pq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) ->
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha1su0))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha1su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t, w8_11: uint32x4_t) -> uint32x4_t {
vsha1su0q_u32_(w0_3, w4_7, w8_11)
@ -220,12 +229,13 @@ pub unsafe fn vsha1su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t, w8_11: uint32x4_
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha1su1))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha1su1q_u32(tw0_3: uint32x4_t, w12_15: uint32x4_t) -> uint32x4_t {
vsha1su1q_u32_(tw0_3, w12_15)
@ -238,12 +248,13 @@ pub unsafe fn vsha1su1q_u32(tw0_3: uint32x4_t, w12_15: uint32x4_t) -> uint32x4_t
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha256h))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha256hq_u32(
hash_abcd: uint32x4_t,
@ -260,12 +271,13 @@ pub unsafe fn vsha256hq_u32(
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha256h2))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha256h2q_u32(
hash_efgh: uint32x4_t,
@ -282,12 +294,13 @@ pub unsafe fn vsha256h2q_u32(
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha256su0))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha256su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t) -> uint32x4_t {
vsha256su0q_u32_(w0_3, w4_7)
@ -300,12 +313,13 @@ pub unsafe fn vsha256su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t) -> uint32x4_t
#[target_feature(enable = "sha2")]
#[cfg_attr(target_arch = "arm", target_feature(enable = "v8"))]
#[cfg_attr(test, assert_instr(sha256su1))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(
feature = "aarch64_neon_crypto_intrinsics",
since = "CURRENT_RUSTC_VERSION"
)
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub unsafe fn vsha256su1q_u32(
tw0_3: uint32x4_t,

View file

@ -71,6 +71,14 @@ mod crypto;
// NEON intrinsics are currently broken on big-endian, so don't expose them. (#1484)
#[cfg(target_endian = "little")]
#[cfg(any(target_arch = "aarch64", target_feature = "v7", doc))]
#[cfg_attr(
target_arch = "arm",
unstable(feature = "stdarch_arm_neon_intrinsics", issue = "111800")
)]
#[cfg_attr(
not(target_arch = "arm"),
stable(feature = "aarch64_neon_crypto_intrinsics", since = "1.72.0")
)]
pub use self::crypto::*;
// NEON intrinsics are currently broken on big-endian, so don't expose them. (#1484)