Files
wasmtime/cranelift/filetests/filetests/runtests/simd-logical.clif
Trevor Elliott 32a7593c94 cranelift: Remove booleans (#5031)
Remove the boolean types from cranelift, and the associated instructions breduce, bextend, bconst, and bint. Standardize on using 1/0 for the return value from instructions that produce scalar boolean results, and -1/0 for boolean vector elements.

Fixes #3205

Co-authored-by: Afonso Bordado <afonso360@users.noreply.github.com>
Co-authored-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Co-authored-by: Chris Fallin <chris@cfallin.org>
2022-10-17 16:00:27 -07:00

126 lines
2.2 KiB
Plaintext

test run
target aarch64
target s390x
set enable_simd
target x86_64 has_sse3 has_ssse3 has_sse41
function %bnot() -> i32 {
block0:
v0 = vconst.i32x4 [-1 -1 -1 0]
v1 = bnot v0
v2 = extractlane v1, 3
return v2
}
; run
function %band_not() -> i8 {
block0:
v0 = vconst.i16x8 [1 0 0 0 0 0 0 0]
v1 = vconst.i16x8 [0 0 0 0 0 0 0 0]
v2 = band_not v0, v1
v3 = extractlane v2, 0
v4 = icmp_imm eq v3, 1
return v4
}
; run
function %vany_true_i8x16() -> i8, i8 {
block0:
v0 = vconst.i8x16 [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
v1 = vany_true v0
v2 = vconst.i8x16 [0 0 0 1 0 0 0 0 0 0 42 0 0 0 0 0]
v3 = vany_true v2
return v1, v3
}
; run: %vany_true_i8x16() == [0, 1]
function %vany_true_i16x8() -> i8, i8 {
block0:
v0 = vconst.i16x8 [0 0 0 0 0 0 0 0]
v1 = vany_true v0
v2 = vconst.i16x8 [0 0 42 0 0 0 0 0]
v3 = vany_true v2
return v1, v3
}
; run: %vany_true_i16x8() == [0, 1]
function %vany_true_i32x4() -> i8, i8 {
block0:
v0 = vconst.i32x4 [0 0 0 0]
v1 = vany_true v0
v2 = vconst.i32x4 [0 42 0 0]
v3 = vany_true v2
return v1, v3
}
; run: %vany_true_i32x4() == [0, 1]
function %vany_true_i64x2() -> i8, i8 {
block0:
v0 = vconst.i64x2 [0 0]
v1 = vany_true v0
v2 = vconst.i64x2 [0 1]
v3 = vany_true v2
return v1, v3
}
; run: %vany_true_i64x2() == [0, 1]
function %vany_true_f32x4() -> i8, i8 {
block0:
v0 = vconst.f32x4 [0.0 0.0 0.0 0.0]
v1 = vany_true v0
v2 = vconst.f32x4 [0.0 0x4.2 0.0 0.0]
v3 = vany_true v2
return v1, v3
}
; run: %vany_true_f32x4() == [0, 1]
function %vany_true_f64x2() -> i8, i8 {
block0:
v0 = vconst.f64x2 [0.0 0.0]
v1 = vany_true v0
v2 = vconst.f64x2 [0.0 0x1.0]
v3 = vany_true v2
return v1, v3
}
; run: %vany_true_f64x2() == [0, 1]
function %vany_true_i32x4_imm() -> i8 {
block0:
v0 = vconst.i32x4 [0 0 0 0]
v1 = vany_true v0
v2 = uextend.i32 v1
v3 = icmp_imm eq v2, 0
return v3
}
; run
function %vall_true_i16x8() -> i8 {
block0:
v0 = vconst.i16x8 [1 0 0 0 0 0 0 0]
v1 = vall_true v0
v2 = uextend.i32 v1
v3 = icmp_imm eq v2, 0
return v3
}
; run
function %vall_true_i32x4() -> i8 {
block0:
v0 = vconst.i32x4 [-1 -1 -1 -1]
v1 = vall_true v0
return v1
}
; run