machinst x64: fix implementation of *reduce;

They should just generate a plain move, since the high bits are then
ignored, and not an extended move.
This commit is contained in:
Benjamin Bouvier
2020-07-03 14:43:12 +02:00
parent 41e1300247
commit 22892466e7
2 changed files with 34 additions and 21 deletions

View File

@@ -356,6 +356,14 @@ impl Inst {
}
}
/// A convenience function to be able to use a RegMem as the source of a move.
pub(crate) fn mov64_rm_r(src: RegMem, dst: Writable<Reg>) -> Inst {
match src {
RegMem::Reg { reg } => Self::mov_r_r(true, reg, dst),
RegMem::Mem { addr } => Self::mov64_m_r(addr, dst),
}
}
pub(crate) fn movsx_rm_r(ext_mode: ExtMode, src: RegMem, dst: Writable<Reg>) -> Inst {
debug_assert!(dst.to_reg().get_class() == RegClass::I64);
Inst::MovSX_RM_R { ext_mode, src, dst }