machinst/x64: teach regalloc what FP instructions are moves;

and cosmetic changes after #1665 landed.
This commit is contained in:
Benjamin Bouvier
2020-06-10 18:37:45 +02:00
parent 0303834082
commit ef5de04d32
3 changed files with 9 additions and 9 deletions

View File

@@ -315,9 +315,7 @@ impl ABIBody for X64ABIBody {
from_reg.to_reg(), from_reg.to_reg(),
Writable::<Reg>::from_reg(to_reg.to_reg()), Writable::<Reg>::from_reg(to_reg.to_reg()),
)) ))
} else if to_reg.get_class() == RegClass::V128 } else if to_reg.get_class() == RegClass::V128 {
|| to_reg.get_class() == RegClass::V128
{
ret.push(Inst::xmm_r_r( ret.push(Inst::xmm_r_r(
SSE_Op::SSE2_Movsd, SSE_Op::SSE2_Movsd,
from_reg.to_reg(), from_reg.to_reg(),

View File

@@ -811,6 +811,11 @@ impl MachInst for Inst {
// %reg. // %reg.
match self { match self {
Self::Mov_R_R { is_64, src, dst } if *is_64 => Some((*dst, *src)), Self::Mov_R_R { is_64, src, dst } if *is_64 => Some((*dst, *src)),
Self::XMM_R_R { op, src, dst }
if *op == SSE_Op::SSE_Movss || *op == SSE_Op::SSE2_Movsd =>
{
Some((*dst, *src))
}
_ => None, _ => None,
} }
} }

View File

@@ -137,13 +137,10 @@ impl<I: VCodeInst> VCodeBuilder<I> {
/// Set the type of a VReg. /// Set the type of a VReg.
pub fn set_vreg_type(&mut self, vreg: VirtualReg, ty: Type) { pub fn set_vreg_type(&mut self, vreg: VirtualReg, ty: Type) {
if self.vcode.vreg_types.len() <= vreg.get_index() { if self.vcode.vreg_types.len() <= vreg.get_index() {
self.vcode.vreg_types.resize( self.vcode
self.vcode.vreg_types.len() .vreg_types
+ ((vreg.get_index() + 1) - self.vcode.vreg_types.len()), .resize(vreg.get_index() + 1, ir::types::I8);
ir::types::I8,
)
} }
self.vcode.vreg_types[vreg.get_index()] = ty; self.vcode.vreg_types[vreg.get_index()] = ty;
} }