winch(x64): Improve ABI support in trampolines (#6204)

This commit improves ABI support in Winch's trampolines mainly by:

* Adding support for the `fastcall` calling convention.
* By storing/restoring callee-saved registers.

One of the explicit goals of this change is to make tests available in the x86_64 target
as a whole and remove the need exclude the windows target.

This commit also introduces a `CallingConvention` enum, to better
reflect the subset of calling conventions that are supported by Winch.
This commit is contained in:
Saúl Cabrera
2023-04-14 17:13:23 -04:00
committed by GitHub
parent 9e1ff9726c
commit 9dd0b59c2a
11 changed files with 340 additions and 89 deletions

View File

@@ -3,7 +3,7 @@ use crate::{
abi::ABI,
codegen::{CodeGen, CodeGenContext},
frame::{DefinedLocals, Frame},
isa::{Builder, TargetIsa},
isa::{Builder, CallingConvention, TargetIsa},
masm::MacroAssembler,
regalloc::RegAlloc,
regset::RegSet,
@@ -92,7 +92,7 @@ impl TargetIsa for Aarch64 {
let mut masm = Aarch64Masm::new(self.shared_flags.clone());
let stack = Stack::new();
let abi = abi::Aarch64ABI::default();
let abi_sig = abi.sig(sig);
let abi_sig = abi.sig(sig, &CallingConvention::Default);
let defined_locals = DefinedLocals::new(&mut body, validator)?;
let frame = Frame::new(&abi_sig, &defined_locals, &abi)?;