Add a return_reg instruction to the base instruction set.

Register-style return is used by all RISC architectures, so it is
natural to have a shared instruction representation.
This commit is contained in:
Jakob Stoklund Olesen
2017-02-21 13:05:17 -08:00
parent 74eb13c17a
commit 20ff2f0025
6 changed files with 75 additions and 4 deletions

View File

@@ -239,6 +239,13 @@ fn write_instruction(w: &mut Write,
writeln!(w, " {}", data.varargs)
}
}
ReturnReg { ref data, .. } => {
if data.varargs.is_empty() {
writeln!(w, "{}", data.arg)
} else {
writeln!(w, "{}, {}", data.arg, data.varargs)
}
}
}
}