aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-09-25 01:35:44 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2023-10-01 15:09:52 -0400
commitc3042cbe12dec72c07e021a76f7e5438a03dc854 (patch)
tree02b0ec10e7cb2c0ebdc26f71b5e6c046f3b2593f /src
parent8470652f10a07f03b24746ffd786f6f5f4aabccc (diff)
downloadzig-c3042cbe12dec72c07e021a76f7e5438a03dc854.tar.gz
zig-c3042cbe12dec72c07e021a76f7e5438a03dc854.zip
x86_64: add missing caller preserved regs
All allocatable registers have to be either callee preserved or caller preserved.
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86_64/abi.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/arch/x86_64/abi.zig b/src/arch/x86_64/abi.zig
index 7809c4559c..1794abeb0b 100644
--- 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};