diff doc/manual/callconvs/callconv_arm32.tex @ 404:524fdca405bf

- some doc/manual callconv clarifications for arm
author Tassilo Philipp
date Wed, 07 Apr 2021 18:39:46 +0200
parents 06c9adae114d
children b47168dacba6
line wrap: on
line diff
--- a/doc/manual/callconvs/callconv_arm32.tex	Wed Apr 07 17:55:59 2021 +0200
+++ b/doc/manual/callconvs/callconv_arm32.tex	Wed Apr 07 18:39:46 2021 +0200
@@ -91,7 +91,7 @@
 \item if the callee takes the address of one of the parameters and uses it to address other parameters (e.g. varargs) it has to copy - in its prolog - the first four words to a reserved stack area adjacent to the other parameters on the stack
 \item parameters \textless=\ 32 bits are passed as 32 bit words
 \item 64 bit parameters are passed as two 32 bit parts (even partly via the register and partly via the stack, although this doesn't seem to be specified in the ATPCS)
-\item structures and unions are passed by value, with the first four words of the parameters in r0-r3
+\item structures and unions are passed by value (after rounding up the size to the nearest multiple of 4), as a sequence of words
 \item if return value is a structure, a pointer pointing to the return value's space is passed in r0, the first parameter in r1, etc... (see {\bf return values})
 \item keeping the stack eight-byte aligned can improve memory access performance and is required by LDRD and STRD on ARMv5TE processors which are part of the ARM32 family, so, in order to avoid problems one should always align the stack (tests have shown, that GCC does care about the alignment when using the ellipsis)
 \end{itemize}
@@ -181,7 +181,7 @@
 \item if the callee takes the address of one of the parameters and uses it to address other parameters (e.g. varargs) it has to copy - in its prolog - the first four words to a reserved stack area adjacent to the other parameters on the stack
 \item parameters \textless=\ 32 bits are passed as 32 bit words
 \item 64 bit parameters are passed as two 32 bit parts (even partly via the register and partly via the stack), although this doesn't seem to be specified in the ATPCS)
-\item structures and unions are passed by value, with the first four words of the parameters in r0-r3
+\item structures and unions are passed by value (after rounding up the size to the nearest multiple of 4), as a sequence of words
 \item if return value is a structure, a pointer pointing to the return value's space is passed in r0, the first parameter in r1, etc. (see {\bf return values})
 \item keeping the stack eight-byte aligned can improve memory access performance and is required by LDRD and STRD on ARMv5TE processors which are part of the ARM32 family, so, in order to avoid problems one should always align the stack (tests have shown, that GCC does care about the alignment when using the ellipsis)
 \end{itemize}
@@ -377,7 +377,7 @@
 \item float and double vararg function parameters (no matter if in ellipsis part of function, or not) are passed like int or long long parameters, vfp registers aren't used
 \item if the callee takes the address of one of the parameters and uses it to address other parameters (e.g. varargs) it has to copy - in its prolog - the first four words (for first 4 integer arguments) to a reserved stack area adjacent to the other parameters on the stack
 \item parameters \textless=\ 32 bits are passed as 32 bit words
-\item structures and unions are passed by value, with the first four words of the parameters in r0-r3
+\item structures and unions are passed by value (after rounding up the size to the nearest multiple of 4), as a sequence of words
 \item if return value is a structure, a pointer pointing to the return value's space is passed in r0, the first parameter in r1, etc. (see {\bf return values})
 \item callee spills, caller reserves spill area space, though
 \end{itemize}