Skip to content

Commit 0a658ba

Browse files
committed
Add vmull_p64 on arm
1 parent b81c7f8 commit 0a658ba

File tree

4 files changed

+281
-69
lines changed

4 files changed

+281
-69
lines changed

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4094,19 +4094,6 @@ pub unsafe fn vmull_high_u32(a: uint32x4_t, b: uint32x4_t) -> uint64x2_t {
40944094
vmull_u32(a, b)
40954095
}
40964096

4097-
/// Polynomial multiply long
4098-
#[inline]
4099-
#[target_feature(enable = "neon,crypto")]
4100-
#[cfg_attr(test, assert_instr(pmull))]
4101-
pub unsafe fn vmull_p64(a: p64, b: p64) -> p128 {
4102-
#[allow(improper_ctypes)]
4103-
extern "C" {
4104-
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.pmull64")]
4105-
fn vmull_p64_(a: p64, b: p64) -> int8x16_t;
4106-
}
4107-
transmute(vmull_p64_(a, b))
4108-
}
4109-
41104097
/// Polynomial multiply long
41114098
#[inline]
41124099
#[target_feature(enable = "neon")]
@@ -11389,15 +11376,6 @@ mod test {
1138911376
assert_eq!(r, e);
1139011377
}
1139111378

11392-
#[simd_test(enable = "neon")]
11393-
unsafe fn test_vmull_p64() {
11394-
let a: p64 = 15;
11395-
let b: p64 = 3;
11396-
let e: p128 = 17;
11397-
let r: p128 = transmute(vmull_p64(transmute(a), transmute(b)));
11398-
assert_eq!(r, e);
11399-
}
11400-
1140111379
#[simd_test(enable = "neon")]
1140211380
unsafe fn test_vmull_high_p8() {
1140311381
let a: i8x16 = i8x16::new(1, 2, 9, 10, 9, 10, 11, 12, 9, 10, 11, 12, 13, 14, 15, 16);

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6062,6 +6062,34 @@ pub unsafe fn vmull_p8(a: poly8x8_t, b: poly8x8_t) -> poly16x8_t {
60626062
vmull_p8_(a, b)
60636063
}
60646064

6065+
/// Polynomial multiply long
6066+
#[inline]
6067+
#[cfg(target_arch = "arm")]
6068+
#[target_feature(enable = "neon,crypto,v8")]
6069+
#[cfg_attr(all(test, target_arch = "arm"), assert_instr(vmull))]
6070+
pub unsafe fn vmull_p64(a: p64, b: p64) -> p128 {
6071+
#[allow(improper_ctypes)]
6072+
extern "C" {
6073+
#[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vmullp.v2i64")]
6074+
fn vmull_p64_(a: int64x1_t, b: int64x1_t) -> int64x2_t;
6075+
}
6076+
transmute(vmull_p64_(transmute(a), transmute(b)))
6077+
}
6078+
6079+
/// Polynomial multiply long
6080+
#[inline]
6081+
#[cfg(target_arch = "aarch64")]
6082+
#[target_feature(enable = "neon,crypto")]
6083+
#[cfg_attr(all(test, target_arch = "aarch64"), assert_instr(pmull))]
6084+
pub unsafe fn vmull_p64(a: p64, b: p64) -> p128 {
6085+
#[allow(improper_ctypes)]
6086+
extern "C" {
6087+
#[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.pmull64")]
6088+
fn vmull_p64_(a: p64, b: p64) -> int8x16_t;
6089+
}
6090+
transmute(vmull_p64_(a, b))
6091+
}
6092+
60656093
/// Vector long multiply with scalar
60666094
#[inline]
60676095
#[target_feature(enable = "neon")]
@@ -17890,6 +17918,15 @@ mod test {
1789017918
assert_eq!(r, e);
1789117919
}
1789217920

17921+
#[simd_test(enable = "neon")]
17922+
unsafe fn test_vmull_p64() {
17923+
let a: p64 = 15;
17924+
let b: p64 = 3;
17925+
let e: p128 = 17;
17926+
let r: p128 = transmute(vmull_p64(transmute(a), transmute(b)));
17927+
assert_eq!(r, e);
17928+
}
17929+
1789317930
#[simd_test(enable = "neon")]
1789417931
unsafe fn test_vmullh_n_s16() {
1789517932
let a: i16x4 = i16x4::new(1, 2, 3, 4);

crates/stdarch-gen/neon.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2065,8 +2065,11 @@ target = crypto
20652065

20662066
aarch64 = pmull
20672067
link-aarch64 = pmull64:p64:p64:p64:int8x16_t
2068+
arm = vmull
2069+
link-arm = vmullp.v2i64:int64x1_t:int64x1_t:int64x1_t:int64x2_t
20682070
generate p64:p64:p128
20692071

2072+
20702073
/// Polynomial multiply long
20712074
name = vmull_high
20722075
no-q

0 commit comments

Comments
 (0)