cranelift: Support boolean arguments larger than b1 in trampoline (#4323)
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
test interpret
|
||||
test run
|
||||
target aarch64
|
||||
target x86_64
|
||||
target s390x
|
||||
|
||||
function %bextend_b1_b8(b1) -> b8 {
|
||||
block0(v0: b1):
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
test interpret
|
||||
test run
|
||||
target aarch64
|
||||
target x86_64
|
||||
target s390x
|
||||
|
||||
function %breduce_b8_b1(b8) -> b1 {
|
||||
block0(v0: b8):
|
||||
|
||||
@@ -308,7 +308,14 @@ fn make_trampoline(signature: &ir::Signature, isa: &dyn TargetIsa) -> Function {
|
||||
// that we are using the architecture's canonical boolean representation (presumably
|
||||
// comparison will emit this).
|
||||
if param.value_type.is_bool() {
|
||||
builder.ins().icmp_imm(IntCC::NotEqual, loaded, 0)
|
||||
let b = builder.ins().icmp_imm(IntCC::NotEqual, loaded, 0);
|
||||
|
||||
// icmp_imm always produces a `b1`, `bextend` it if we need a larger bool
|
||||
if param.value_type.bits() > 1 {
|
||||
builder.ins().bextend(param.value_type, b)
|
||||
} else {
|
||||
b
|
||||
}
|
||||
} else if param.value_type.is_bool_vector() {
|
||||
let zero_constant = builder.func.dfg.constants.insert(vec![0; 16].into());
|
||||
let zero_vec = builder.ins().vconst(ty, zero_constant);
|
||||
|
||||
Reference in New Issue
Block a user