authorgravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-09-25 01:35:44-04:00
committergravatar for jacobly@ziglang.orgJacob Young <jacobly@ziglang.org> 2023-10-01 15:09:52-04:00
logc3042cbe12dec72c07e021a76f7e5438a03dc854
tree02b0ec10e7cb2c0ebdc26f71b5e6c046f3b2593f
parent8470652f10a07f03b24746ffd786f6f5f4aabccc

x86_64: add missing caller preserved regs

All allocatable registers have to be either callee preserved or caller preserved.

1 files changed, 2 insertions(+), 2 deletions(-)

src/arch/x86_64/abi.zig+2-2
...@@ -444,7 +444,7 @@ pub const SysV = struct {...@@ -444,7 +444,7 @@ pub const SysV = struct {
444 /// These registers need to be preserved (saved on the stack) and restored by the caller before444 /// These registers need to be preserved (saved on the stack) and restored by the caller before
445 /// the caller relinquishes control to a subroutine via call instruction (or similar).445 /// the caller relinquishes control to a subroutine via call instruction (or similar).
446 /// In other words, these registers are free to use by the callee.446 /// In other words, these registers are free to use by the callee.
447 pub const caller_preserved_regs = [_]Register{ .rax, .rcx, .rdx, .rsi, .rdi, .r8, .r9, .r10, .r11 };447 pub const caller_preserved_regs = [_]Register{ .rax, .rcx, .rdx, .rsi, .rdi, .r8, .r9, .r10, .r11 } ++ sse_avx_regs;
448448
449 pub const c_abi_int_param_regs = [_]Register{ .rdi, .rsi, .rdx, .rcx, .r8, .r9 };449 pub const c_abi_int_param_regs = [_]Register{ .rdi, .rsi, .rdx, .rcx, .r8, .r9 };
450 pub const c_abi_int_return_regs = [_]Register{ .rax, .rdx };450 pub const c_abi_int_return_regs = [_]Register{ .rax, .rdx };
...@@ -457,7 +457,7 @@ pub const Win64 = struct {...@@ -457,7 +457,7 @@ pub const Win64 = struct {
457 /// These registers need to be preserved (saved on the stack) and restored by the caller before457 /// These registers need to be preserved (saved on the stack) and restored by the caller before
458 /// the caller relinquishes control to a subroutine via call instruction (or similar).458 /// the caller relinquishes control to a subroutine via call instruction (or similar).
459 /// In other words, these registers are free to use by the callee.459 /// In other words, these registers are free to use by the callee.
460 pub const caller_preserved_regs = [_]Register{ .rax, .rcx, .rdx, .r8, .r9, .r10, .r11 };460 pub const caller_preserved_regs = [_]Register{ .rax, .rcx, .rdx, .r8, .r9, .r10, .r11 } ++ sse_avx_regs;
461461
462 pub const c_abi_int_param_regs = [_]Register{ .rcx, .rdx, .r8, .r9 };462 pub const c_abi_int_param_regs = [_]Register{ .rcx, .rdx, .r8, .r9 };
463 pub const c_abi_int_return_regs = [_]Register{.rax};463 pub const c_abi_int_return_regs = [_]Register{.rax};