Implement WideningPairwiseDotProductS for interpreter

Implemented `WideningPairwiseDotProductS` to perform sign-extending
length-doubling multiplication on corresponding elements from two
`i16x8` SIMD vectors, performing a pairwise add on the results (thus
returning `i32x4`).

Copyright (c) 2021, Arm Limited
This commit is contained in:
dheaton-arm
2021-09-06 15:03:32 +01:00
parent 164835ecf5
commit 3b9bfc8187
2 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
test interpret
test run
target aarch64
set enable_simd
target x86_64
function %wpdps(i16x8, i16x8) -> i32x4 {
block0(v0: i16x8, v1: i16x8):
v2 = widening_pairwise_dot_product_s v0, v1
return v2
}
; run: %wpdps([1 2 3 4 5 6 7 8], [8000 7000 6000 5000 4000 3000 2000 1000]) == [22000 38000 38000 22000]
; run: %wpdps([1 -2 3 -4 5 -6 7 -8], [32767 32767 32767 32767 -32768 -32768 -32768 -32768]) == [-32767 -32767 32768 32768]
; run: %wpdps([-32768 -32768 32767 32767 -32768 -32768 32767 32767], [-32768 -32768 32767 32767 32767 32767 -32768 -32768]) == [2147483648 2147352578 -2147418112 -2147418112]