Add RISC-V encodings for copy instructions.

This commit is contained in:
Jakob Stoklund Olesen
2017-06-14 15:36:25 -07:00
parent 96f1228211
commit 3e1e2b6e5e
4 changed files with 25 additions and 1 deletions

View File

@@ -182,6 +182,18 @@ fn recipe_iret<CS: CodeSink + ?Sized>(func: &Function, inst: Inst, sink: &mut CS
sink);
}
fn recipe_icopy<CS: CodeSink + ?Sized>(func: &Function, inst: Inst, sink: &mut CS) {
if let InstructionData::Unary { arg, .. } = func.dfg[inst] {
put_i(func.encodings[inst].bits(),
func.locations[arg].unwrap_reg(),
0,
func.locations[func.dfg.first_result(inst)].unwrap_reg(),
sink);
} else {
panic!("Expected Unary format: {:?}", func.dfg[inst]);
}
}
/// U-type instructions.
///
/// 31 11 6