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>
155 lines
2.4 KiB
Plaintext
155 lines
2.4 KiB
Plaintext
test run
|
|
target aarch64
|
|
target s390x
|
|
target x86_64
|
|
target riscv64
|
|
|
|
function %i8_iconst_0() -> i8 {
|
|
block0:
|
|
v1 = iconst.i8 0
|
|
return v1
|
|
}
|
|
; run: %i8_iconst_0() == 0
|
|
|
|
function %i8_iconst_1() -> i8 {
|
|
block0:
|
|
v1 = iconst.i8 1
|
|
return v1
|
|
}
|
|
; run: %i8_iconst_1() == 1
|
|
|
|
function %i8_iconst_neg_one() -> i8 {
|
|
block0:
|
|
v1 = iconst.i8 -1
|
|
return v1
|
|
}
|
|
; run: %i8_iconst_neg_one() == -1
|
|
|
|
|
|
function %i16_iconst_0() -> i16 {
|
|
block0:
|
|
v1 = iconst.i16 0
|
|
return v1
|
|
}
|
|
; run: %i16_iconst_0() == 0
|
|
|
|
function %i16_iconst_1() -> i16 {
|
|
block0:
|
|
v1 = iconst.i16 1
|
|
return v1
|
|
}
|
|
; run: %i16_iconst_1() == 1
|
|
|
|
function %i16_iconst_neg_one() -> i16 {
|
|
block0:
|
|
v1 = iconst.i16 -1
|
|
return v1
|
|
}
|
|
; run: %i16_iconst_neg_one() == -1
|
|
|
|
|
|
function %i32_iconst_0() -> i32 {
|
|
block0:
|
|
v1 = iconst.i32 0
|
|
return v1
|
|
}
|
|
; run: %i32_iconst_0() == 0
|
|
|
|
function %i32_iconst_1() -> i32 {
|
|
block0:
|
|
v1 = iconst.i32 1
|
|
return v1
|
|
}
|
|
; run: %i32_iconst_1() == 1
|
|
|
|
function %i32_iconst_neg_one() -> i32 {
|
|
block0:
|
|
v1 = iconst.i32 -1
|
|
return v1
|
|
}
|
|
; run: %i32_iconst_neg_one() == -1
|
|
|
|
|
|
function %i64_iconst_0() -> i64 {
|
|
block0:
|
|
v1 = iconst.i64 0
|
|
return v1
|
|
}
|
|
; run: %i64_iconst_0() == 0
|
|
|
|
function %i64_iconst_1() -> i64 {
|
|
block0:
|
|
v1 = iconst.i64 1
|
|
return v1
|
|
}
|
|
; run: %i64_iconst_1() == 1
|
|
|
|
function %i64_iconst_neg_one() -> i64 {
|
|
block0:
|
|
v1 = iconst.i64 -1
|
|
return v1
|
|
}
|
|
; run: %i64_iconst_neg_one() == -1
|
|
|
|
|
|
|
|
function %i8_iconst_false() -> i8 {
|
|
block0:
|
|
v1 = iconst.i8 0
|
|
return v1
|
|
}
|
|
; run: %i8_iconst_false() == 0
|
|
|
|
function %i8_iconst_true() -> i8 {
|
|
block0:
|
|
v1 = iconst.i8 1
|
|
return v1
|
|
}
|
|
; run: %i8_iconst_true() == 1
|
|
|
|
|
|
function %i16_iconst_false() -> i16 {
|
|
block0:
|
|
v1 = iconst.i16 0
|
|
return v1
|
|
}
|
|
; run: %i16_iconst_false() == 0
|
|
|
|
function %i16_iconst_true() -> i16 {
|
|
block0:
|
|
v1 = iconst.i16 1
|
|
return v1
|
|
}
|
|
; run: %i16_iconst_true() == 1
|
|
|
|
|
|
function %i32_iconst_false() -> i32 {
|
|
block0:
|
|
v1 = iconst.i32 0
|
|
return v1
|
|
}
|
|
; run: %i32_iconst_false() == 0
|
|
|
|
function %i32_iconst_true() -> i32 {
|
|
block0:
|
|
v1 = iconst.i32 1
|
|
return v1
|
|
}
|
|
; run: %i32_iconst_true() == 1
|
|
|
|
|
|
function %i64_iconst_false() -> i64 {
|
|
block0:
|
|
v1 = iconst.i64 0
|
|
return v1
|
|
}
|
|
; run: %i64_iconst_false() == 0
|
|
|
|
; this verifies that returning i64 immediates does not result in a segmentation fault, see https://github.com/bytecodealliance/cranelift/issues/911
|
|
function %i64_iconst_true() -> i64 {
|
|
block0:
|
|
v1 = iconst.i64 1
|
|
return v1
|
|
}
|
|
; run: %i64_iconst_true() == 1
|