winch: Small clean-up for x64 (#5691)

This commit contains a small set of clean up items for x64.

Notably:

* Adds filetests
* Documents why 16 for the arg base offset abi implementation, for clarity.
* Fixes a bug in the spill implementation caught while anlyzing the
filetests results. The fix consists of emitting a load instead of a store into
the scratch register before spiiling its value.
* Remove dead code for pretty printing registers which is not needed anymore
since we now have proper disassembly.
This commit is contained in:
Saúl Cabrera
2023-02-02 11:40:31 -05:00
committed by GitHub
parent 446337c746
commit f5f517e811
8 changed files with 82 additions and 102 deletions

View File

@@ -134,9 +134,7 @@ impl RegAlloc {
.get_local(*index)
.expect("valid local at slot");
let addr = context.masm.local_address(&slot);
context
.masm
.store(RegImm::reg(self.scratch), addr, slot.ty.into());
context.masm.load(addr, self.scratch, slot.ty.into());
let offset = context.masm.push(self.scratch);
*v = Val::Memory(offset);
}