Add x86 implentation of 8x16 ishl
This involves some large mask tables that may hurt code size but reduce the number of instructions. See https://github.com/WebAssembly/simd/issues/117 for a more in-depth discussion on this.
This commit is contained in:
@@ -18,6 +18,22 @@ block0:
|
||||
return v2
|
||||
}
|
||||
|
||||
function %ishl_i8x16() -> i8x16 {
|
||||
block0:
|
||||
v0 = iconst.i32 1
|
||||
v1 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
|
||||
v2 = ishl v1, v0
|
||||
; check: v3 = bitcast.i64x2 v0
|
||||
; nextln: v4 = raw_bitcast.i16x8 v1
|
||||
; nextln: v5 = x86_psll v4, v3
|
||||
; nextln: v6 = raw_bitcast.i8x16 v5
|
||||
; nextln: v7 = const_addr.i64 const1
|
||||
; nextln: v8 = ishl_imm v0, 4
|
||||
; nextln: v9 = load_complex.i8x16 v7+v8
|
||||
; nextln: v2 = band v6, v9
|
||||
return v2
|
||||
}
|
||||
|
||||
function %ishl_i32x4() -> i32x4 {
|
||||
block0:
|
||||
v0 = iconst.i32 1
|
||||
|
||||
@@ -51,6 +51,19 @@ block0:
|
||||
}
|
||||
; run
|
||||
|
||||
function %ishl_i8x16() -> b1 {
|
||||
block0:
|
||||
v0 = iconst.i32 1
|
||||
v1 = vconst.i8x16 [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15]
|
||||
v2 = ishl v1, v0
|
||||
|
||||
v3 = vconst.i8x16 [0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30]
|
||||
v4 = icmp eq v2, v3
|
||||
v5 = vall_true v4
|
||||
return v5
|
||||
}
|
||||
; run
|
||||
|
||||
function %ushr_i64x2() -> b1 {
|
||||
block0:
|
||||
v0 = iconst.i32 1
|
||||
|
||||
Reference in New Issue
Block a user