Skip to content

Commit

Permalink
Translate Wasm's I64x2Mul to Cranelift's imul.i64x2
Browse files Browse the repository at this point in the history
  • Loading branch information
abrown committed Jun 3, 2020
1 parent 1ea0908 commit aa44e8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cranelift/wasm/src/code_translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,7 +1383,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
let a = pop1_with_bitcast(state, type_of(op), builder);
state.push1(builder.ins().ineg(a))
}
Operator::I16x8Mul | Operator::I32x4Mul => {
Operator::I16x8Mul | Operator::I32x4Mul | Operator::I64x2Mul => {
let (a, b) = pop2_with_bitcast(state, type_of(op), builder);
state.push1(builder.ins().imul(a, b))
}
Expand Down Expand Up @@ -1544,8 +1544,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
let a = pop1_with_bitcast(state, I32X4, builder);
state.push1(builder.ins().fcvt_from_sint(F32X4, a))
}
Operator::I64x2Mul
| Operator::I32x4TruncSatF32x4S
Operator::I32x4TruncSatF32x4S
| Operator::I32x4TruncSatF32x4U
| Operator::F32x4ConvertI32x4U
| Operator::I8x16Abs
Expand Down Expand Up @@ -2069,7 +2068,8 @@ fn type_of(operator: &Operator) -> Type {
| Operator::I64x2ShrS
| Operator::I64x2ShrU
| Operator::I64x2Add
| Operator::I64x2Sub => I64X2,
| Operator::I64x2Sub
| Operator::I64x2Mul => I64X2,

Operator::F32x4Splat
| Operator::F32x4ExtractLane { .. }
Expand Down

0 comments on commit aa44e8b

Please sign in to comment.