From c00d493a0001cbc9ebc0c02197ae70d921242b22 Mon Sep 17 00:00:00 2001 From: Koakuma Date: Thu, 2 Jun 2022 23:28:11 +0700 Subject: [PATCH] stage2: sparc64: Add some notes about stack space allocation --- src/arch/sparc64/abi.zig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/arch/sparc64/abi.zig b/src/arch/sparc64/abi.zig index 6cdd183b36..a26ab9a20b 100644 --- a/src/arch/sparc64/abi.zig +++ b/src/arch/sparc64/abi.zig @@ -13,6 +13,11 @@ pub const stack_bias = 2047; // The first 128 bytes of the stack is reserved for register saving purposes. // The ABI also requires to reserve space in the stack for the first six // outgoing arguments, even though they are usually passed in registers. +// TODO Don't allocate the argument space in leaf functions +// TODO Save an RO copy of outgoing arguments in reserved area when building in Debug +// TODO Should we also save it in ReleaseSafe? Solaris and OpenBSD binaries seem to ship +// with argument copying enabled and it doesn't seem to give them big slowdowns so +// I guess it would be okay to do in ReleaseSafe? pub const stack_reserved_area = 128 + 48; // There are no callee-preserved registers since the windowing