zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit c3042cbe12dec72c07e021a76f7e5438a03dc854 (tree)
parent 8470652f10a07f03b24746ffd786f6f5f4aabccc
Author: Jacob Young <jacobly0@users.noreply.github.com>
Date:   Mon, 25 Sep 2023 01:35:44 -0400

x86_64: add missing caller preserved regs

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

Diffstat:
Msrc/arch/x86_64/abi.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

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