Skip to content

Commit

Permalink
cranelift: Reduce directly from i128 to i32 in Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
afonso360 committed Jul 22, 2022
1 parent b06935d commit c3a9c40
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cranelift/frontend/src/switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,6 @@ impl Switch {
bx.switch_to_block(new_block);

// Cast to i32, as br_table is not implemented for i64/i128
let discr = if bits > 64 {
bx.ins().isplit(discr).0
} else {
discr
};
bx.ins().ireduce(types::I32, discr)
}
bits if bits < 32 => bx.ins().uextend(types::I32, discr),
Expand Down Expand Up @@ -677,9 +672,8 @@ block4:
jump block5
block5:
v2, v3 = isplit.i128 v0
v4 = ireduce.i32 v2
br_table v4, block3, jt0"
v2 = ireduce.i32 v0
br_table v2, block3, jt0"
);
}
}

0 comments on commit c3a9c40

Please sign in to comment.