diff doc/manual/callconvs/callconv_sparc.tex @ 157:49549739228c

- sparc callback asm and args code (still some stack alignment issues, currently) - doc improvements for sparc callconv
author cslag
date Wed, 28 Dec 2016 16:48:35 -0600
parents 9e99918065e6
children 164cf1663b7c
line wrap: on
line diff
--- a/doc/manual/callconvs/callconv_sparc.tex	Fri Nov 25 18:59:26 2016 +0000
+++ b/doc/manual/callconvs/callconv_sparc.tex	Wed Dec 28 16:48:35 2016 -0600
@@ -36,7 +36,7 @@
 \item 32 32-bit integer/pointer registers
 \item 32 floating point registers (usable as 8 quad precision, 16 double precision or 32 single precision registers)
 \item 32 registers are accessible at a time (8 are global ones (g*), whereas the rest forms a register window with 8 input (i*), 8 output (o*) and 8 local (l*) ones)
-\item invoking a function shifts the register window, the old output registers become the new input registers (old local and input ones are not accessible anymore)
+\item calling a function shifts the register window, the old output registers become the new input registers (old local and input ones are not accessible anymore)
 \end{itemize}
 
 \begin{table}[h]
@@ -55,13 +55,17 @@
 
 \paragraph{Parameter passing}
 \begin{itemize}
-\item Stack parameter order: right-to-left
-\item Caller cleans up the stack @@@ really?
-\item Stack always aligned to 8 bytes.
+\item stack grows down
+\item stack parameter order: right-to-left
+\item caller cleans up the stack
+\item stack always aligned to 8 bytes
 \item first 6 integers and floats are passed independently in registers using \%o0-\%o5
 \item for every other argument the stack is used
-\item @@@ what about floats, 64bit integers, etc.?
-\item results are returned in \%i0, and structs/unions pass a pointer to them as a hidden stack parameter (see below)
+\item all arguments <= 32 bit are passed as 32 bit values
+\item 64 bit arguments are passed like two consecutive <= 32 bit values
+\item minimum stack size is 64 bytes, b/c stack pointer must always point at enough space to store all \%i* and \%l* registers, used when running out of register windows
+\item if needed, register spill area is adjacent to parameters
+\item results are expected by caller to be returned in \%o0\%o1 (after reg window restore, meaning callee writes to \%i0\%i1) for integers, \%f0/\%f1 for floats, and for structs/unions a pointer to them is used as a hidden stack parameter (see below)
 \end{itemize}
 
 \paragraph{Stack layout}