From aa44e8b2e3e7a765dbe2726d712e72d91a891b8d Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Tue, 26 May 2020 11:38:29 -0700 Subject: [PATCH] Translate Wasm's I64x2Mul to Cranelift's imul.i64x2 --- cranelift/wasm/src/code_translator.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cranelift/wasm/src/code_translator.rs b/cranelift/wasm/src/code_translator.rs index db9bef59837f..d11d1fb442dc 100644 --- a/cranelift/wasm/src/code_translator.rs +++ b/cranelift/wasm/src/code_translator.rs @@ -1383,7 +1383,7 @@ pub fn translate_operator( 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)) } @@ -1544,8 +1544,7 @@ pub fn translate_operator( 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 @@ -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 { .. }