x64: remove Inst::XmmLoadConst (#4876)

This is a cherry-pick of a long-ago commit, 2d46637. The original
message reads:

> Now that `SyntheticAmode` can refer to constants, there is no longer a
> need for a separate instruction format--standard load instructions will
> work.

Since then, the transition to ISLE and the use of `XmmLoadConst` in many
more places makes this change a larger diff than the original. The basic
idea is the same, though: the extra indirection of `Inst::XMmLoadConst`
is removed and replaced by a direct use of `VCodeConstant` as a
`SyntheticAmode`. This has no effect on codegen, but the CLIF output is
now clearer in that the actual instruction is displayed (e.g., `movdqu`)
instead of a made-up instruction (`load_const`).
This commit is contained in:
Andrew Brown
2022-09-07 12:52:13 -07:00
committed by GitHub
parent e694a6f5d4
commit f063082474
14 changed files with 53 additions and 61 deletions

View File

@@ -519,6 +519,12 @@ impl Into<SyntheticAmode> for Amode {
}
}
impl Into<SyntheticAmode> for VCodeConstant {
fn into(self) -> SyntheticAmode {
SyntheticAmode::ConstantOffset(self)
}
}
impl PrettyPrint for SyntheticAmode {
fn pretty_print(&self, _size: u8, allocs: &mut AllocationConsumer<'_>) -> String {
match self {
@@ -527,7 +533,7 @@ impl PrettyPrint for SyntheticAmode {
SyntheticAmode::NominalSPOffset { simm32 } => {
format!("rsp({} + virtual offset)", *simm32 as i32)
}
SyntheticAmode::ConstantOffset(c) => format!("const({:?})", c),
SyntheticAmode::ConstantOffset(c) => format!("const({})", c.as_u32()),
}
}
}