Port AvgRound & SqmulRoundSat to ISLE (AArch64) (#4639)

Ported the existing implementations of the following opcodes on AArch64
to ISLE:
- `AvgRound`
  - Also introduced support for `i64x2` vectors, as per the docs.
- `SqmulRoundSat`

Copyright (c) 2022 Arm Limited
This commit is contained in:
Damian Heaton
2022-08-08 19:35:43 +01:00
committed by GitHub
parent 47a67d752b
commit e463890f26
9 changed files with 369 additions and 56 deletions

View File

@@ -0,0 +1,81 @@
test compile precise-output
set unwind_info=false
target aarch64
function %average_rounding_i8x8(i8x8, i8x8) -> i8x8 {
block0(v0: i8x8, v1: i8x8):
v2 = avg_round v0, v1
return v2
}
; block0:
; urhadd v0.8b, v0.8b, v1.8b
; ret
function %average_rounding_i8x16(i8x16, i8x16) -> i8x16 {
block0(v0: i8x16, v1: i8x16):
v2 = avg_round v0, v1
return v2
}
; block0:
; urhadd v0.16b, v0.16b, v1.16b
; ret
function %average_rounding_i16x4(i16x4, i16x4) -> i16x4 {
block0(v0: i16x4, v1: i16x4):
v2 = avg_round v0, v1
return v2
}
; block0:
; urhadd v0.4h, v0.4h, v1.4h
; ret
function %average_rounding_i16x8(i16x8, i16x8) -> i16x8 {
block0(v0: i16x8, v1: i16x8):
v2 = avg_round v0, v1
return v2
}
; block0:
; urhadd v0.8h, v0.8h, v1.8h
; ret
function %average_rounding_i32x2(i32x2, i32x2) -> i32x2 {
block0(v0: i32x2, v1: i32x2):
v2 = avg_round v0, v1
return v2
}
; block0:
; urhadd v0.2s, v0.2s, v1.2s
; ret
function %average_rounding_i32x4(i32x4, i32x4) -> i32x4 {
block0(v0: i32x4, v1: i32x4):
v2 = avg_round v0, v1
return v2
}
; block0:
; urhadd v0.4s, v0.4s, v1.4s
; ret
function %average_rounding_i64x2(i64x2, i64x2) -> i64x2 {
block0(v0: i64x2, v1: i64x2):
v2 = avg_round v0, v1
return v2
}
; block0:
; movz x6, #1
; dup v6.2d, x6
; orr v17.16b, v0.16b, v1.16b
; and v19.16b, v17.16b, v6.16b
; ushr v21.2d, v0.2d, #1
; ushr v23.2d, v1.2d, #1
; add v25.2d, v21.2d, v23.2d
; add v0.2d, v19.2d, v25.2d
; ret