[codegen] Add a pinned register that's entirely under the control of the user;

This commit is contained in:
Benjamin Bouvier
2019-08-28 17:33:45 +02:00
parent d1d2e790b9
commit 660b8b28b8
15 changed files with 229 additions and 30 deletions

View File

@@ -676,6 +676,26 @@ impl<'a> Verifier<'a> {
self.verify_value_list(inst, args, errors)?;
}
NullAry {
opcode: Opcode::GetPinnedReg,
}
| Unary {
opcode: Opcode::SetPinnedReg,
..
} => {
if let Some(isa) = &self.isa {
if !isa.flags().enable_pinned_reg() {
return fatal!(
errors,
inst,
"GetPinnedReg/SetPinnedReg cannot be used without enable_pinned_reg"
);
}
} else {
return fatal!(errors, inst, "GetPinnedReg/SetPinnedReg need an ISA!");
}
}
// Exhaustive list so we can't forget to add new formats
Unary { .. }
| UnaryImm { .. }