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>
83 lines
1.5 KiB
Plaintext
83 lines
1.5 KiB
Plaintext
; Test code generation for WebAssembly i64 comparison operators.
|
|
test compile
|
|
|
|
target aarch64
|
|
target x86_64 haswell
|
|
|
|
function %i64_eqz(i64) -> i32 {
|
|
block0(v0: i64):
|
|
v1 = icmp_imm eq v0, 0
|
|
v2 = uextend.i32 v1
|
|
return v2
|
|
}
|
|
|
|
function %i64_eq(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp eq v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_ne(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp ne v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_lt_s(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp slt v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_lt_u(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp ult v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_gt_s(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp sgt v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_gt_u(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp ugt v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_le_s(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp sle v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_le_u(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp ule v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_ge_s(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp sge v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|
|
|
|
function %i64_ge_u(i64, i64) -> i32 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp uge v0, v1
|
|
v3 = uextend.i32 v2
|
|
return v3
|
|
}
|