Skip to content

Commit f1b7c54

Browse files
committed
impl i2f conversion instruction translation
1 parent 7461e5d commit f1b7c54

File tree

1 file changed

+8
-8
lines changed
  • crates/wasmi/src/engine/translator/func2

1 file changed

+8
-8
lines changed

crates/wasmi/src/engine/translator/func2/visit.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,39 +1141,39 @@ impl<'a> VisitOperator<'a> for FuncTranslator {
11411141
}
11421142

11431143
fn visit_f32_convert_i32_s(&mut self) -> Self::Output {
1144-
todo!()
1144+
self.translate_unary::<i32, f32>(Instruction::f32_convert_i32_s, wasm::f32_convert_i32_s)
11451145
}
11461146

11471147
fn visit_f32_convert_i32_u(&mut self) -> Self::Output {
1148-
todo!()
1148+
self.translate_unary::<u32, f32>(Instruction::f32_convert_i32_u, wasm::f32_convert_i32_u)
11491149
}
11501150

11511151
fn visit_f32_convert_i64_s(&mut self) -> Self::Output {
1152-
todo!()
1152+
self.translate_unary::<i64, f32>(Instruction::f32_convert_i64_s, wasm::f32_convert_i64_s)
11531153
}
11541154

11551155
fn visit_f32_convert_i64_u(&mut self) -> Self::Output {
1156-
todo!()
1156+
self.translate_unary::<u64, f32>(Instruction::f32_convert_i64_u, wasm::f32_convert_i64_u)
11571157
}
11581158

11591159
fn visit_f32_demote_f64(&mut self) -> Self::Output {
11601160
todo!()
11611161
}
11621162

11631163
fn visit_f64_convert_i32_s(&mut self) -> Self::Output {
1164-
todo!()
1164+
self.translate_unary::<i32, f64>(Instruction::f64_convert_i32_s, wasm::f64_convert_i32_s)
11651165
}
11661166

11671167
fn visit_f64_convert_i32_u(&mut self) -> Self::Output {
1168-
todo!()
1168+
self.translate_unary::<u32, f64>(Instruction::f64_convert_i32_u, wasm::f64_convert_i32_u)
11691169
}
11701170

11711171
fn visit_f64_convert_i64_s(&mut self) -> Self::Output {
1172-
todo!()
1172+
self.translate_unary::<i64, f64>(Instruction::f64_convert_i64_s, wasm::f64_convert_i64_s)
11731173
}
11741174

11751175
fn visit_f64_convert_i64_u(&mut self) -> Self::Output {
1176-
todo!()
1176+
self.translate_unary::<u64, f64>(Instruction::f64_convert_i64_u, wasm::f64_convert_i64_u)
11771177
}
11781178

11791179
fn visit_f64_promote_f32(&mut self) -> Self::Output {

0 commit comments

Comments
 (0)