Skip to content

Commit f955dec

Browse files
committed
interpreter: add dest register to function calls
1 parent 8a6296c commit f955dec

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

interpreter/src/ir.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ pub type MemArg = (Reg, NonLocal);
9494
pub type JumpArg = Label;
9595
pub type RetArg = MaybeImm;
9696
pub type BranchArg = (MaybeImm, Label, Label);
97-
pub type CallArgs = (Reg, Reg, NonLocal);
97+
pub type CallArgs = (Reg, Reg, Reg, NonLocal);
9898
pub type OutputCallArgs = (Reg, Reg, Command, Option<Redirection>);
99-
pub type IndCallArgs = (Reg, Reg, Reg);
99+
pub type IndCallArgs = (Reg, Reg, Reg, Reg);
100100

101101
#[repr(u8)]
102102
#[derive(Clone, Copy, Debug)]
@@ -195,17 +195,18 @@ impl Display for Instruction {
195195
Self::Return(src) => {
196196
write!(f, "{op} {src}")
197197
}
198-
Self::IntrinsicCall((dest, code, args)) | Self::IndirectCall((dest, code, args)) => {
199-
write!(f, "{dest} <- {op} {code}, {args}")
198+
Self::IntrinsicCall((dest, start, end, fun))
199+
| Self::IndirectCall((dest, start, end, fun)) => {
200+
write!(f, "{dest} <- {op} {fun}, {start}..{end}")
200201
}
201202
Self::OutputCall((start, end, call, Some(redir))) => {
202203
write!(f, "{call}{redir:?} {start}..{end}")
203204
}
204205
Self::OutputCall((start, end, call, None)) => {
205206
write!(f, "{call} {start}..{end}")
206207
}
207-
Self::UserCall((dest, src, args)) => {
208-
write!(f, "{dest} <- {op} {src}, {args}")
208+
Self::UserCall((dest, start, end, fun)) => {
209+
write!(f, "{dest} <- {op} {fun}, {start}..{end}")
209210
}
210211
}
211212
}

0 commit comments

Comments
 (0)