|
1 | 1 | use super::{ControlFrame, ControlFrameKind, FuncTranslator, LocalIdx};
|
2 | 2 | use crate::{
|
3 |
| - core::{wasm, TrapCode, F32, F64}, |
| 3 | + core::{wasm, TrapCode, F32, F64, ValType}, |
4 | 4 | engine::{
|
5 | 5 | translator::func2::{
|
6 | 6 | stack::{AcquiredTarget, IfReachability},
|
@@ -1093,7 +1093,23 @@ impl<'a> VisitOperator<'a> for FuncTranslator {
|
1093 | 1093 | }
|
1094 | 1094 |
|
1095 | 1095 | fn visit_i64_extend_i32_u(&mut self) -> Self::Output {
|
1096 |
| - todo!() |
| 1096 | + bail_unreachable!(self); |
| 1097 | + // Note: this Wasm operation is a no-op, we only have to change the types on the stack. |
| 1098 | + match self.stack.pop() { |
| 1099 | + Operand::Local(input) => { |
| 1100 | + debug_assert!(matches!(input.ty(), ValType::I32)); |
| 1101 | + todo!() // do we need a copy or should we allow to manipulate a local's type? |
| 1102 | + } |
| 1103 | + Operand::Temp(input) => { |
| 1104 | + debug_assert!(matches!(input.ty(), ValType::I32)); |
| 1105 | + self.stack.push_temp(ValType::I64, None)?; |
| 1106 | + } |
| 1107 | + Operand::Immediate(input) => { |
| 1108 | + let input = u32::from(input.val()); |
| 1109 | + self.stack.push_immediate(u64::from(input))?; |
| 1110 | + } |
| 1111 | + } |
| 1112 | + Ok(()) |
1097 | 1113 | }
|
1098 | 1114 |
|
1099 | 1115 | fn visit_i64_trunc_f32_s(&mut self) -> Self::Output {
|
|
0 commit comments