Skip to content

Commit 63d5fc7

Browse files
committed
impl unary f{32,64} translation
1 parent 49e69ac commit 63d5fc7

File tree

1 file changed

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

1 file changed

+14
-14
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -945,31 +945,31 @@ impl<'a> VisitOperator<'a> for FuncTranslator {
945945
}
946946

947947
fn visit_f32_abs(&mut self) -> Self::Output {
948-
todo!()
948+
self.translate_unary::<f32, f32>(Instruction::f32_abs, wasm::f32_abs)
949949
}
950950

951951
fn visit_f32_neg(&mut self) -> Self::Output {
952-
todo!()
952+
self.translate_unary::<f32, f32>(Instruction::f32_neg, wasm::f32_neg)
953953
}
954954

955955
fn visit_f32_ceil(&mut self) -> Self::Output {
956-
todo!()
956+
self.translate_unary::<f32, f32>(Instruction::f32_ceil, wasm::f32_ceil)
957957
}
958958

959959
fn visit_f32_floor(&mut self) -> Self::Output {
960-
todo!()
960+
self.translate_unary::<f32, f32>(Instruction::f32_floor, wasm::f32_floor)
961961
}
962962

963963
fn visit_f32_trunc(&mut self) -> Self::Output {
964-
todo!()
964+
self.translate_unary::<f32, f32>(Instruction::f32_trunc, wasm::f32_trunc)
965965
}
966966

967967
fn visit_f32_nearest(&mut self) -> Self::Output {
968-
todo!()
968+
self.translate_unary::<f32, f32>(Instruction::f32_nearest, wasm::f32_nearest)
969969
}
970970

971971
fn visit_f32_sqrt(&mut self) -> Self::Output {
972-
todo!()
972+
self.translate_unary::<f32, f32>(Instruction::f32_sqrt, wasm::f32_sqrt)
973973
}
974974

975975
fn visit_f32_add(&mut self) -> Self::Output {
@@ -1001,31 +1001,31 @@ impl<'a> VisitOperator<'a> for FuncTranslator {
10011001
}
10021002

10031003
fn visit_f64_abs(&mut self) -> Self::Output {
1004-
todo!()
1004+
self.translate_unary::<f64, f64>(Instruction::f64_abs, wasm::f64_abs)
10051005
}
10061006

10071007
fn visit_f64_neg(&mut self) -> Self::Output {
1008-
todo!()
1008+
self.translate_unary::<f64, f64>(Instruction::f64_neg, wasm::f64_neg)
10091009
}
10101010

10111011
fn visit_f64_ceil(&mut self) -> Self::Output {
1012-
todo!()
1012+
self.translate_unary::<f64, f64>(Instruction::f64_ceil, wasm::f64_ceil)
10131013
}
10141014

10151015
fn visit_f64_floor(&mut self) -> Self::Output {
1016-
todo!()
1016+
self.translate_unary::<f64, f64>(Instruction::f64_floor, wasm::f64_floor)
10171017
}
10181018

10191019
fn visit_f64_trunc(&mut self) -> Self::Output {
1020-
todo!()
1020+
self.translate_unary::<f64, f64>(Instruction::f64_trunc, wasm::f64_trunc)
10211021
}
10221022

10231023
fn visit_f64_nearest(&mut self) -> Self::Output {
1024-
todo!()
1024+
self.translate_unary::<f64, f64>(Instruction::f64_nearest, wasm::f64_nearest)
10251025
}
10261026

10271027
fn visit_f64_sqrt(&mut self) -> Self::Output {
1028-
todo!()
1028+
self.translate_unary::<f64, f64>(Instruction::f64_sqrt, wasm::f64_sqrt)
10291029
}
10301030

10311031
fn visit_f64_add(&mut self) -> Self::Output {

0 commit comments

Comments
 (0)