Port widening ops to ISLE (AArch64) (#4751)

Ported the existing implementations of the following opcodes for AArch64
to ISLE, and implemented support for 64-bit vectors (per the docs):
- `SwidenLow`
- `SwidenHigh`
- `UwidenLow`
- `UwidenHigh`

Also ported `WideningPairwiseDotProductS` as-is.

Copyright (c) 2022 Arm Limited
This commit is contained in:
Damian Heaton
2022-08-23 17:42:11 +01:00
committed by GitHub
parent da1fb305a3
commit 3b68d76905
10 changed files with 250 additions and 161 deletions

View File

@@ -24,3 +24,45 @@ block0(v0: i32x2, v1: i32x2):
}
; run: %iaddp_i32x2([1 2], [5 6]) == [3 11]
; run: %iaddp_i32x2([4294967290 5], [100 100]) == [4294967295 200]
function %swiden_i8x8(i8x8) -> i16x4 {
block0(v0: i8x8):
v1 = swiden_low v0
v2 = swiden_high v0
v3 = iadd_pairwise v1, v2
return v3
}
; run: %swiden_i8x8([1 2 3 4 5 6 7 8]) == [3 7 11 15]
; run: %swiden_i8x8([-1 2 -3 4 -5 6 -7 8]) == [1 1 1 1]
; run: %swiden_i8x8([127 1 126 2 125 3 124 4]) == [128 128 128 128]
function %uwiden_i8x8(i8x8) -> i16x4 {
block0(v0: i8x8):
v1 = uwiden_low v0
v2 = uwiden_high v0
v3 = iadd_pairwise v1, v2
return v3
}
; run: %uwiden_i8x8([17 18 19 20 21 22 23 24]) == [35 39 43 47]
; run: %uwiden_i8x8([2 254 3 253 4 252 5 251]) == [256 256 256 256]
function %swiden_i16x4(i16x4) -> i32x2 {
block0(v0: i16x4):
v1 = swiden_low v0
v2 = swiden_high v0
v3 = iadd_pairwise v1, v2
return v3
}
; run: %swiden_i16x4([1 2 3 4]) == [3 7]
; run: %swiden_i16x4([-1 2 -3 4]) == [1 1]
; run: %swiden_i16x4([127 1 126 2]) == [128 128]
function %uwiden_i16x4(i16x4) -> i32x2 {
block0(v0: i16x4):
v1 = uwiden_low v0
v2 = uwiden_high v0
v3 = iadd_pairwise v1, v2
return v3
}
; run: %uwiden_i16x4([17 18 19 20]) == [35 39]
; run: %uwiden_i16x4([2 254 3 253]) == [256 256]