Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cranelift: Fix invalid trampoline when returning boolean vectors #3341

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cranelift/filetests/filetests/runtests/simd-vconst.clif
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ block0:
return v8
}
; run


function %vconst_b16x8() -> b16x8 {
block0:
v0 = vconst.b16x8 [true false true false true false true true]
return v0
}
; run: %vconst_b16x8() == [true false true false true false true true]
7 changes: 5 additions & 2 deletions cranelift/filetests/src/function_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,11 @@ fn make_trampoline(signature: &ir::Signature, isa: &dyn TargetIsa) -> Function {
let results = builder.func.dfg.inst_results(call).to_vec();
for ((i, value), param) in results.iter().enumerate().zip(&signature.returns) {
// Before storing return values, we convert booleans to their integer representation.
let value = if param.value_type.lane_type().is_bool() {
let ty = param.value_type.lane_type().as_int();
let value = if param.value_type.is_bool_vector() {
let ty = param.value_type.as_int();
builder.ins().raw_bitcast(ty, *value)
} else if param.value_type.is_bool() {
let ty = param.value_type.as_int();
builder.ins().bint(ty, *value)
} else {
*value
Expand Down