diff --git a/interpreter/src/ir.rs b/interpreter/src/ir.rs index 0a9b889..c762e7f 100644 --- a/interpreter/src/ir.rs +++ b/interpreter/src/ir.rs @@ -77,7 +77,7 @@ pub enum Instruction { StoreRecord(BinaryArg), IntrinsicCall(CallArgs), OutputCall(OutputCallArgs), - UserCall(IndCallArgs), + UserCall(CallArgs), IndirectCall(CallArgs), Jump(JumpArg), Return(RetArg), @@ -94,9 +94,9 @@ pub type MemArg = (Reg, NonLocal); pub type JumpArg = Label; pub type RetArg = MaybeImm; pub type BranchArg = (MaybeImm, Label, Label); -pub type CallArgs = (Reg, Reg, NonLocal); +pub type CallArgs = (Reg, Reg, Reg, NonLocal); pub type OutputCallArgs = (Reg, Reg, Command, Option); -pub type IndCallArgs = (Reg, Reg, Reg); +pub type IndCallArgs = (Reg, Reg, Reg, Reg); #[repr(u8)] #[derive(Clone, Copy, Debug)] @@ -195,8 +195,9 @@ impl Display for Instruction { Self::Return(src) => { write!(f, "{op} {src}") } - Self::IntrinsicCall((dest, code, args)) | Self::IndirectCall((dest, code, args)) => { - write!(f, "{dest} <- {op} {code}, {args}") + Self::IntrinsicCall((dest, start, end, fun)) + | Self::IndirectCall((dest, start, end, fun)) => { + write!(f, "{dest} <- {op} {fun}, {start}..{end}") } Self::OutputCall((start, end, call, Some(redir))) => { write!(f, "{call}{redir:?} {start}..{end}") @@ -204,8 +205,8 @@ impl Display for Instruction { Self::OutputCall((start, end, call, None)) => { write!(f, "{call} {start}..{end}") } - Self::UserCall((dest, src, args)) => { - write!(f, "{dest} <- {op} {src}, {args}") + Self::UserCall((dest, start, end, fun)) => { + write!(f, "{dest} <- {op} {fun}, {start}..{end}") } } } diff --git a/interpreter/src/vm.rs b/interpreter/src/vm.rs index e0cfa58..af1c5d0 100644 --- a/interpreter/src/vm.rs +++ b/interpreter/src/vm.rs @@ -213,12 +213,12 @@ impl Interpreter<'_> { Instruction::StoreRecord(_) => todo!(), Instruction::StoreBuiltinScalar((_dest, _imm, _src)) => todo!(), Instruction::StoreBuiltinArray((_dest, _src, _start, _end)) => todo!(), - Instruction::IntrinsicCall((_dest, _code, _args)) => todo!(), + Instruction::IntrinsicCall((_dest, _start, _end, _fun)) => todo!(), Instruction::OutputCall((start, end, fun, redir)) => { self.intrinsic_print(start, end, fun, redir); } - Instruction::UserCall((_dest, _code, _args)) => todo!(), - Instruction::IndirectCall((_dest, _code, _args)) => todo!(), + Instruction::UserCall((_dest, _start, _end, _fun)) => todo!(), + Instruction::IndirectCall((_dest, _start, _end, _fun)) => todo!(), Instruction::Jump(Label(label)) => { self.program_counter = label as _; continue;