Implement SqmulRoundSat for interpreter

Implemented `SqmulRoundSat` for the Cranelift interpreter, performing
QN-format fixed point multiplication for 16 and 32-bit integers in
SIMD vectors.

Copyright (c) 2021, Arm Limited
This commit is contained in:
dheaton-arm
2021-09-08 09:18:38 +01:00
parent 1a5a2c7c5d
commit 02ff19f2fc
3 changed files with 53 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
test interpret
test run
target aarch64
;; x86_64 hasn't implemented this for `i32x4`
function %sqmulrs_i32x4(i32x4, i32x4) -> i32x4 {
block0(v0: i32x4, v1: i32x4):
v2 = sqmul_round_sat v0, v1
return v2
}
; run: %sqmulrs_i32x4([1000 2000 3000 4000], [10000 100000 1000000 10000000]) == [0 0 1 19]
; run: %sqmulrs_i32x4([2147483647 -2147483648 -2147483648 0], [2147483647 -2147483648 2147483647 0]) == [2147483646 2147483647 -2147483647 0]