Skip to content

Commit 97f5c32

Browse files
adamgemmellAmanieu
authored andcommitted
Replace the crypto feature with aes in generated intrinsics for aarch64
This allows us to deprecate the crypto target_feature in favour of its subfeatures. We cannot do this yet for ARM targets as LLVM requires the crypto feature. This was fixed in llvm/llvm-project@b8baa2a
1 parent 6f39dc2 commit 97f5c32

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

crates/core_arch/src/aarch64/neon/generated.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4672,7 +4672,7 @@ pub unsafe fn vmull_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
46724672

46734673
/// Polynomial multiply long
46744674
#[inline]
4675-
#[target_feature(enable = "neon,crypto")]
4675+
#[target_feature(enable = "neon,aes")]
46764676
#[cfg_attr(test, assert_instr(pmull))]
46774677
pub unsafe fn vmull_p64(a: p64, b: p64) -> p128 {
46784678
#[allow(improper_ctypes)]
@@ -4695,7 +4695,7 @@ pub unsafe fn vmull_high_p8(a: poly8x16_t, b: poly8x16_t) -> poly16x8_t {
46954695

46964696
/// Polynomial multiply long
46974697
#[inline]
4698-
#[target_feature(enable = "neon,crypto")]
4698+
#[target_feature(enable = "neon,aes")]
46994699
#[cfg_attr(test, assert_instr(pmull))]
47004700
pub unsafe fn vmull_high_p64(a: poly64x2_t, b: poly64x2_t) -> p128 {
47014701
vmull_p64(simd_extract(a, 1), simd_extract(b, 1))

crates/core_arch/src/arm_shared/neon/generated.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ pub unsafe fn vcreate_p16(a: u64) -> poly16x4_t {
20862086

20872087
/// Insert vector element from another vector element
20882088
#[inline]
2089-
#[target_feature(enable = "neon,crypto")]
2089+
#[target_feature(enable = "neon,aes")]
20902090
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
20912091
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop))]
20922092
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop))]
@@ -13212,7 +13212,7 @@ pub unsafe fn vset_lane_p16<const LANE: i32>(a: p16, b: poly16x4_t) -> poly16x4_
1321213212

1321313213
/// Insert vector element from another vector element
1321413214
#[inline]
13215-
#[target_feature(enable = "neon,crypto")]
13215+
#[target_feature(enable = "neon,aes")]
1321613216
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
1321713217
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
1321813218
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]
@@ -13344,7 +13344,7 @@ pub unsafe fn vsetq_lane_p16<const LANE: i32>(a: p16, b: poly16x8_t) -> poly16x8
1334413344

1334513345
/// Insert vector element from another vector element
1334613346
#[inline]
13347-
#[target_feature(enable = "neon,crypto")]
13347+
#[target_feature(enable = "neon,aes")]
1334813348
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
1334913349
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(nop, LANE = 0))]
1335013350
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(nop, LANE = 0))]

crates/stdarch-gen/neon.spec

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ arm = nop
851851
generate u64:int8x8_t, u64:int16x4_t: u64:int32x2_t, u64:int64x1_t
852852
generate u64:uint8x8_t, u64:uint16x4_t: u64:uint32x2_t, u64:uint64x1_t
853853
generate u64:poly8x8_t, u64:poly16x4_t
854-
target = crypto
854+
target = aes
855855
generate u64:poly64x1_t
856856

857857
/// Insert vector element from another vector element
@@ -2238,7 +2238,7 @@ no-q
22382238
a = 15
22392239
b = 3
22402240
validate 17
2241-
target = crypto
2241+
target = aes
22422242

22432243
aarch64 = pmull
22442244
link-aarch64 = pmull64:p64:p64:p64:int8x16_t
@@ -2269,7 +2269,7 @@ multi_fn = vmull-noqself-noext, {simd_extract, a, 1}, {simd_extract, b, 1}
22692269
a = 1, 15
22702270
b = 1, 3
22712271
validate 17
2272-
target = crypto
2272+
target = aes
22732273

22742274
aarch64 = pmull
22752275
generate poly64x2_t:poly64x2_t:p128
@@ -4582,7 +4582,7 @@ generate u8:uint8x8_t:uint8x8_t, u16:uint16x4_t:uint16x4_t
45824582
generate u32:uint32x2_t:uint32x2_t, u64:uint64x1_t:uint64x1_t
45834583
generate p8:poly8x8_t:poly8x8_t, p16:poly16x4_t:poly16x4_t
45844584

4585-
target = crypto
4585+
target = aes
45864586
generate p64:poly64x1_t:poly64x1_t
45874587

45884588
/// Insert vector element from another vector element
@@ -4604,7 +4604,7 @@ generate u8:uint8x16_t:uint8x16_t, u16:uint16x8_t:uint16x8_t
46044604
generate u32:uint32x4_t:uint32x4_t, u64:uint64x2_t:uint64x2_t
46054605
generate p8:poly8x16_t:poly8x16_t, p16:poly16x8_t:poly16x8_t
46064606

4607-
target = crypto
4607+
target = aes
46084608
generate p64:poly64x2_t:poly64x2_t
46094609

46104610
/// Insert vector element from another vector element

crates/stdarch-gen/src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ enum TargetFeature {
379379
Default,
380380
ArmV7,
381381
FPArmV8,
382-
Crypto,
382+
AES,
383383
}
384384

385385
fn type_to_global_type(t: &str) -> &str {
@@ -891,7 +891,7 @@ fn gen_aarch64(
891891
Default => "neon",
892892
ArmV7 => "v7",
893893
FPArmV8 => "fp-armv8,v8",
894-
Crypto => "neon,crypto",
894+
AES => "neon,aes",
895895
};
896896
let current_fn = if let Some(current_fn) = current_fn.clone() {
897897
if link_aarch64.is_some() {
@@ -1341,13 +1341,13 @@ fn gen_arm(
13411341
Default => "neon",
13421342
ArmV7 => "neon",
13431343
FPArmV8 => "neon",
1344-
Crypto => "neon,crypto",
1344+
AES => "neon,aes",
13451345
};
13461346
let current_target_arm = match target {
13471347
Default => "v7",
13481348
ArmV7 => "v7",
13491349
FPArmV8 => "fp-armv8,v8",
1350-
Crypto => "crypto,v8",
1350+
AES => "crypto,v8", // TODO: Replace with AES when the minimum LLVM version has b8baa2a9132498ea286dbb0d03f005760ecc6fdb
13511351
};
13521352

13531353
let current_fn = if let Some(current_fn) = current_fn.clone() {
@@ -2552,7 +2552,7 @@ mod test {
25522552
Some(input) => match input.as_str() {
25532553
"v7" => ArmV7,
25542554
"fp-armv8" => FPArmV8,
2555-
"crypto" => Crypto,
2555+
"aes" => AES,
25562556
_ => Default,
25572557
},
25582558
_ => Default,

0 commit comments

Comments
 (0)