This commit is contained in:
2026-07-18 16:39:35 -04:00
parent c062993130
commit 3cbd50e619
5 changed files with 148 additions and 98 deletions
+23 -3
View File
@@ -28,7 +28,27 @@ impl Arch for X86_64 {
}
}
pub struct CallConv {
volatile: Vec<Reg>,
nonvolatile: Vec<Reg>,
pub enum CallConv {
SystemV,
}
impl CallConv {
pub fn param(&self) -> &[Reg] {
use regs::*;
match self {
Self::SystemV => &[rdi, rsi, rdx, rcx, r8, r9],
}
}
pub fn scratch(&self) -> &[Reg] {
use regs::*;
match self {
Self::SystemV => &[rax, rdi, rsi, rdx, rcx, r8, r9, r10, r11],
}
}
pub fn ret(&self) -> &[Reg] {
use regs::*;
match self {
Self::SystemV => &[rax, rdx],
}
}
}