Skip to content

Commit 05e32d4

Browse files
authored
Complete the remaining neon instructions (#1230)
1 parent e95bdf1 commit 05e32d4

File tree

10 files changed

+12096
-5263
lines changed

10 files changed

+12096
-5263
lines changed

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

+8,909-5,115
Large diffs are not rendered by default.

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

+36-1
Original file line numberDiff line numberDiff line change
@@ -2985,7 +2985,24 @@ pub unsafe fn vsliq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
29852985
static_assert_imm4!(N);
29862986
transmute(vsliq_n_s16_(transmute(a), transmute(b), N))
29872987
}
2988-
2988+
/// Shift Left and Insert (immediate)
2989+
#[inline]
2990+
#[target_feature(enable = "neon,aes")]
2991+
#[cfg_attr(test, assert_instr(sli, N = 1))]
2992+
#[rustc_legacy_const_generics(2)]
2993+
pub unsafe fn vsli_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
2994+
static_assert!(N: i32 where N >= 0 && N <= 63);
2995+
transmute(vsli_n_s64_(transmute(a), transmute(b), N))
2996+
}
2997+
/// Shift Left and Insert (immediate)
2998+
#[inline]
2999+
#[target_feature(enable = "neon,aes")]
3000+
#[cfg_attr(test, assert_instr(sli, N = 1))]
3001+
#[rustc_legacy_const_generics(2)]
3002+
pub unsafe fn vsliq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
3003+
static_assert!(N: i32 where N >= 0 && N <= 63);
3004+
transmute(vsliq_n_s64_(transmute(a), transmute(b), N))
3005+
}
29893006
/// Shift Right and Insert (immediate)
29903007
#[inline]
29913008
#[target_feature(enable = "neon")]
@@ -3166,6 +3183,24 @@ pub unsafe fn vsriq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
31663183
static_assert!(N: i32 where N >= 1 && N <= 16);
31673184
transmute(vsriq_n_s16_(transmute(a), transmute(b), N))
31683185
}
3186+
/// Shift Right and Insert (immediate)
3187+
#[inline]
3188+
#[target_feature(enable = "neon,aes")]
3189+
#[cfg_attr(test, assert_instr(sri, N = 1))]
3190+
#[rustc_legacy_const_generics(2)]
3191+
pub unsafe fn vsri_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
3192+
static_assert!(N: i32 where N >= 1 && N <= 64);
3193+
transmute(vsri_n_s64_(transmute(a), transmute(b), N))
3194+
}
3195+
/// Shift Right and Insert (immediate)
3196+
#[inline]
3197+
#[target_feature(enable = "neon,aes")]
3198+
#[cfg_attr(test, assert_instr(sri, N = 1))]
3199+
#[rustc_legacy_const_generics(2)]
3200+
pub unsafe fn vsriq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
3201+
static_assert!(N: i32 where N >= 1 && N <= 64);
3202+
transmute(vsriq_n_s64_(transmute(a), transmute(b), N))
3203+
}
31693204

31703205
#[cfg(test)]
31713206
mod tests {

crates/core_arch/src/arm/neon.rs

+52-1
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,32 @@ pub unsafe fn vsliq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
10471047
int16x8_t(n, n, n, n, n, n, n, n),
10481048
))
10491049
}
1050-
1050+
/// Shift Left and Insert (immediate)
1051+
#[inline]
1052+
#[target_feature(enable = "neon,v7,aes")]
1053+
#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
1054+
#[rustc_legacy_const_generics(2)]
1055+
pub unsafe fn vsli_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
1056+
static_assert!(N : i32 where 0 <= N && N <= 63);
1057+
transmute(vshiftins_v1i64(
1058+
transmute(a),
1059+
transmute(b),
1060+
int64x1_t(N as i64),
1061+
))
1062+
}
1063+
/// Shift Left and Insert (immediate)
1064+
#[inline]
1065+
#[target_feature(enable = "neon,v7,aes")]
1066+
#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
1067+
#[rustc_legacy_const_generics(2)]
1068+
pub unsafe fn vsliq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
1069+
static_assert!(N : i32 where 0 <= N && N <= 63);
1070+
transmute(vshiftins_v2i64(
1071+
transmute(a),
1072+
transmute(b),
1073+
int64x2_t(N as i64, N as i64),
1074+
))
1075+
}
10511076
/// Shift Right and Insert (immediate)
10521077
#[inline]
10531078
#[target_feature(enable = "neon,v7")]
@@ -1292,6 +1317,32 @@ pub unsafe fn vsriq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
12921317
int16x8_t(n, n, n, n, n, n, n, n),
12931318
))
12941319
}
1320+
/// Shift Right and Insert (immediate)
1321+
#[inline]
1322+
#[target_feature(enable = "neon,v7,aes")]
1323+
#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
1324+
#[rustc_legacy_const_generics(2)]
1325+
pub unsafe fn vsri_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1_t {
1326+
static_assert!(N : i32 where 1 <= N && N <= 64);
1327+
transmute(vshiftins_v1i64(
1328+
transmute(a),
1329+
transmute(b),
1330+
int64x1_t(-N as i64),
1331+
))
1332+
}
1333+
/// Shift Right and Insert (immediate)
1334+
#[inline]
1335+
#[target_feature(enable = "neon,v7,aes")]
1336+
#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
1337+
#[rustc_legacy_const_generics(2)]
1338+
pub unsafe fn vsriq_n_p64<const N: i32>(a: poly64x2_t, b: poly64x2_t) -> poly64x2_t {
1339+
static_assert!(N : i32 where 1 <= N && N <= 64);
1340+
transmute(vshiftins_v2i64(
1341+
transmute(a),
1342+
transmute(b),
1343+
int64x2_t(-N as i64, -N as i64),
1344+
))
1345+
}
12951346

12961347
#[cfg(test)]
12971348
mod tests {

crates/core_arch/src/arm_shared/crypto.rs

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ extern "unadjusted" {
5151
#[cfg(test)]
5252
use stdarch_test::assert_instr;
5353

54-
// TODO: Use AES for ARM when the minimum LLVM version includes b8baa2a9132498ea286dbb0d03f005760ecc6fdb
55-
5654
/// AES single round encryption.
5755
#[inline]
5856
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]

0 commit comments

Comments
 (0)