Support wasm select instruction with V128-typed operands on AArch64.

* this requires upgrading to wasmparser 0.67.0.

* There are no CLIF side changes because the CLIF `select` instruction is
  polymorphic enough.

* on aarch64, there is unfortunately no conditional-move (csel) instruction on
  vectors.  This patch adds a synthetic instruction `VecCSel` which *does*
  behave like that.  At emit time, this is emitted as an if-then-else diamond
  (4 insns).

* aarch64 implementation is otherwise straightforwards.
This commit is contained in:
Julian Seward
2020-11-11 17:09:57 +01:00
committed by julian-seward1
parent 9ced345aed
commit 41e87a2f99
15 changed files with 122 additions and 18 deletions

View File

@@ -47,3 +47,17 @@ block0:
; nextln: mov sp, fp
; nextln: ldp fp, lr, [sp], #16
; nextln: ret
function %f4(i32, i8x16, i8x16) -> i8x16 {
block0(v0: i32, v1: i8x16, v2: i8x16):
v3 = select v0, v1, v2
return v3
}
; check: stp fp, lr, [sp, #-16]!
; nextln: mov fp, sp
; nextln: subs wzr, w0, wzr
; nextln: vcsel v0.16b, v0.16b, v1.16b, ne (if-then-else diamond)
; nextln: mov sp, fp
; nextln: ldp fp, lr, [sp], #16
; nextln: ret