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>
43 lines
882 B
Plaintext
43 lines
882 B
Plaintext
test interpret
|
|
test run
|
|
target aarch64
|
|
target x86_64
|
|
target riscv64
|
|
target s390x
|
|
|
|
function %icmp_eq_i8(i8, i8) -> i8 {
|
|
block0(v0: i8, v1: i8):
|
|
v2 = icmp eq v0, v1
|
|
return v2
|
|
}
|
|
; run: %icmp_eq_i8(0, 0) == 1
|
|
; run: %icmp_eq_i8(1, 0) == 0
|
|
; run: %icmp_eq_i8(-1, -1) == 1
|
|
|
|
function %icmp_eq_i16(i16, i16) -> i8 {
|
|
block0(v0: i16, v1: i16):
|
|
v2 = icmp eq v0, v1
|
|
return v2
|
|
}
|
|
; run: %icmp_eq_i16(0, 0) == 1
|
|
; run: %icmp_eq_i16(1, 0) == 0
|
|
; run: %icmp_eq_i16(-1, -1) == 1
|
|
|
|
function %icmp_eq_i32(i32, i32) -> i8 {
|
|
block0(v0: i32, v1: i32):
|
|
v2 = icmp eq v0, v1
|
|
return v2
|
|
}
|
|
; run: %icmp_eq_i32(0, 0) == 1
|
|
; run: %icmp_eq_i32(1, 0) == 0
|
|
; run: %icmp_eq_i32(-1, -1) == 1
|
|
|
|
function %icmp_eq_i64(i64, i64) -> i8 {
|
|
block0(v0: i64, v1: i64):
|
|
v2 = icmp eq v0, v1
|
|
return v2
|
|
}
|
|
; run: %icmp_eq_i64(0, 0) == 1
|
|
; run: %icmp_eq_i64(1, 0) == 0
|
|
; run: %icmp_eq_i64(-1, -1) == 1
|