comparison doc/manual/callconvs/callconv_mips32.tex @ 304:6869d834a847

- mips32 doc
author Tassilo Philipp
date Wed, 23 May 2018 11:39:40 +0200
parents d55f9d508074
children b104c5beec8b
comparison
equal deleted inserted replaced
303:c81374ac9fba 304:6869d834a847
123 \begin{tabular*}{0.95\textwidth}{lll} 123 \begin{tabular*}{0.95\textwidth}{lll}
124 Name & Alias & Brief description\\ 124 Name & Alias & Brief description\\
125 \hline 125 \hline
126 {\bf \$0} & {\bf \$zero} & hardware zero \\ 126 {\bf \$0} & {\bf \$zero} & hardware zero \\
127 {\bf \$1} & {\bf \$at} & assembler temporary \\ 127 {\bf \$1} & {\bf \$at} & assembler temporary \\
128 {\bf \$2-\$3} & {\bf \$v0-\$v1} & return value (only integer, on hard-float targets), scratch \\ 128 {\bf \$2-\$3} & {\bf \$v0-\$v1} & return value (only integer on hard-float targets), scratch \\
129 {\bf \$4-\$7} & {\bf \$a0-\$a3} & first arguments (only integer, on hard-float targets), scratch\\ 129 {\bf \$4-\$7} & {\bf \$a0-\$a3} & first arguments (only integer on hard-float targets), scratch\\
130 {\bf \$8-\$15,\$24} & {\bf \$t0-\$t7,\$t8} & temporaries, scratch \\ 130 {\bf \$8-\$15,\$24} & {\bf \$t0-\$t7,\$t8} & temporaries, scratch \\
131 {\bf \$25} & {\bf \$t9} & temporary, hold the address of the called function for all PIC calls (by convention) \\ 131 {\bf \$25} & {\bf \$t9} & temporary, holds address of called function for PIC calls (by convention) \\
132 {\bf \$16-\$23} & {\bf \$s0-\$s7} & preserved \\ 132 {\bf \$16-\$23} & {\bf \$s0-\$s7} & preserved \\
133 {\bf \$26,\$27} & {\bf \$k0,\$k1} & reserved for kernel \\ 133 {\bf \$26,\$27} & {\bf \$k0,\$k1} & reserved for kernel \\
134 {\bf \$28} & {\bf \$gp} & global pointer, preserved by caller \\ 134 {\bf \$28} & {\bf \$gp} & global pointer, preserved by caller \\
135 {\bf \$29} & {\bf \$sp} & stack pointer, preserve \\ 135 {\bf \$29} & {\bf \$sp} & stack pointer, preserve \\
136 {\bf \$30} & {\bf \$fp} & frame pointer, preserve \\ 136 {\bf \$30} & {\bf \$fp} & frame pointer, preserve \\
156 \item subsequent parameters are passed vie the stack 156 \item subsequent parameters are passed vie the stack
157 \item 64-bit params passed via registers are passed using either two registers (starting at an even register number, skipping an odd one if necessary), or via the stack using an 8-byte alignment 157 \item 64-bit params passed via registers are passed using either two registers (starting at an even register number, skipping an odd one if necessary), or via the stack using an 8-byte alignment
158 \item only on hard-float targets: if the very first call argument is a float, up to 2 floats or doubles can be passed via \$f12 and \$f14, respectively, for first and second argument 158 \item only on hard-float targets: if the very first call argument is a float, up to 2 floats or doubles can be passed via \$f12 and \$f14, respectively, for first and second argument
159 \item only on hard-float targets: if any arguments are passed via float registers, skip \$a0-\$a3 for subsequent arguments as if the values were passed via them 159 \item only on hard-float targets: if any arguments are passed via float registers, skip \$a0-\$a3 for subsequent arguments as if the values were passed via them
160 \item only on hard-float targets: note that if the first argument is not a float, but the second, it'll get passed via the \$a? registers 160 \item only on hard-float targets: note that if the first argument is not a float, but the second, it'll get passed via the \$a? registers
161 \item results are returned in \$v0 and \$v1, with \$v0 for all values < 64bit (only integer, on hard-float targets) 161 \item results are returned in \$v0 and \$v1, with \$v0 for all values < 64bit (only integer on hard-float targets)
162 \item only on hard-float targets: floating point results are returned in \$f0 (32-bit float), or \$f0 and \$f3 (64bit float) 162 \item only on hard-float targets: floating point results are returned in \$f0 (32-bit float), or \$f0 and \$f3 (64bit float)
163 \item single precision float parameters (32 bit) are right-justified in their 8-byte slot on the stack on big endian targets, as they aren't promoted @@@
163 \end{itemize} 164 \end{itemize}
164 165
165 \paragraph{Stack layout} 166 \paragraph{Stack layout}
166 167
167 Stack directly after function prolog:\\ 168 Stack directly after function prolog:\\