comparison doc/manual/callconvs/callconv_sparc64.tex @ 499:fc614cb865c6

- doc and disasexample additions specific to non-trivial C++ aggregates as return values (incl. fixes to doc and additional LSB specific PPC32 section)
author Tassilo Philipp
date Mon, 04 Apr 2022 15:50:52 +0200
parents 6c72cb768099
children 9d0eefb0e0f0
comparison
equal deleted inserted replaced
498:fd9ba3a6d348 499:fc614cb865c6
82 \item single precision floats (using half of the slot) use even numbered \%f* registers when they occupy the left half, odd numbered ones otherwise (no register skipping logic applied within a slot) 82 \item single precision floats (using half of the slot) use even numbered \%f* registers when they occupy the left half, odd numbered ones otherwise (no register skipping logic applied within a slot)
83 \item splitting struct fields between registers and stack is allowed 83 \item splitting struct fields between registers and stack is allowed
84 \end{itemize} 84 \end{itemize}
85 \item unions \textless=\ 16 bytes passed by-value are passed like integers in left-justified 8-byte slots (either via \%o* registers or the stack) 85 \item unions \textless=\ 16 bytes passed by-value are passed like integers in left-justified 8-byte slots (either via \%o* registers or the stack)
86 \item aggregates (struct, union) and types \textgreater\ 16 bytes are passed indirectly, as a pointer to a correctly aligned copy of the data (that copy can be avoided under certain conditions) 86 \item aggregates (struct, union) and types \textgreater\ 16 bytes are passed indirectly, as a pointer to a correctly aligned copy of the data (that copy can be avoided under certain conditions)
87 \item {\it non-trivial} C++ aggregates (as defined by the language) of any size, are passed indirectly via a pointer to a copy of the aggregate
87 % from spec: 88 % from spec:
88 %Structure or union types up to eight bytes in size are assigned to one parameter array word, and align to eight-byte 89 %Structure or union types up to eight bytes in size are assigned to one parameter array word, and align to eight-byte
89 %boundaries. 90 %boundaries.
90 %Structure or union types larger than eight bytes, and up to sixteen bytes in size are assigned to two consecutive 91 %Structure or union types larger than eight bytes, and up to sixteen bytes in size are assigned to two consecutive
91 %parameter array words, and align according to the alignment requirements of the structure or at least to an eight-byte 92 %parameter array words, and align according to the alignment requirements of the structure or at least to an eight-byte
110 \paragraph{Return values} 111 \paragraph{Return values}
111 112
112 \begin{itemize} 113 \begin{itemize}
113 \item results are expected by caller to be returned in \%o0-\%o3 (after reg window restore, meaning callee writes to \%i0-\%i3) for integers 114 \item results are expected by caller to be returned in \%o0-\%o3 (after reg window restore, meaning callee writes to \%i0-\%i3) for integers
114 \item \%d0,\%d2,\%d4,\%d6 are used for floating point values 115 \item \%d0,\%d2,\%d4,\%d6 are used for floating point values
116 \item for {\it non-trivial} C++ aggregates, the caller allocates space, passes pointer to it to the callee as a hidden first param
117 (meaning in \%o0), and callee writes return value to this space; the ptr to the aggregate is returned in the same register (after reg window restore)
115 \item the fields of aggregates (struct, union) \textless= 32 bytes are returned via registers mentioned above (which are 118 \item the fields of aggregates (struct, union) \textless= 32 bytes are returned via registers mentioned above (which are
116 assigned following the same logic as when passing the aggregate as a first argument to a function) 119 assigned following the same logic as when passing the aggregate as a first argument to a function)
117 \item aggregates (struct, union) \textgreater 32 bytes are returned in a space allocated by the caller, with a pointer to it 120 \item aggregates (struct, union) \textgreater 32 bytes are returned in a space allocated by the caller, with a pointer to it
118 passed as first parameter to the function called (meaning in \%o0) 121 passed as first parameter to the function called (meaning in \%o0)
119 % from spec: 122 % from spec: