Mercurial > pub > dyncall > dyncall
comparison doc/manual/callconvs/callconv_arm32.tex @ 148:12729fd52ab7
- performance improvement and more correct handling of arm32 armhf calls, not copying bogus data just to reserve spill area space
- added armhf callconv stack layout diagram to doc
author | cslag |
---|---|
date | Sun, 11 Sep 2016 01:19:27 +0200 |
parents | 4a64b733dc76 |
children | 8402121e1737 |
comparison
equal
deleted
inserted
replaced
147:8ce75240a0f1 | 148:12729fd52ab7 |
---|---|
331 \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 | 331 \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 |
332 \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 | 332 \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 |
333 \item parameters \textless=\ 32 bits are passed as 32 bit words | 333 \item parameters \textless=\ 32 bits are passed as 32 bit words |
334 \item structures and unions are passed by value, with the first four words of the parameters in r0-r3 @@@?check doc | 334 \item structures and unions are passed by value, with the first four words of the parameters in r0-r3 @@@?check doc |
335 \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}) | 335 \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}) |
336 \item callee spills, caller reserves spill area space, though | |
336 \end{itemize} | 337 \end{itemize} |
337 | 338 |
338 \paragraph{Return values} | 339 \paragraph{Return values} |
339 \begin{itemize} | 340 \begin{itemize} |
340 \item non floating point return values \textless=\ 32 bits use r0 | 341 \item non floating point return values \textless=\ 32 bits use r0 |
342 \item single precision floating point return value uses s0 | 343 \item single precision floating point return value uses s0 |
343 \item double precision floating point return value uses d0 | 344 \item double precision floating point return value uses d0 |
344 \item if return value is a structure, the caller allocates space for the return value on the stack in its frame and passes a pointer to it in r0 | 345 \item if return value is a structure, the caller allocates space for the return value on the stack in its frame and passes a pointer to it in r0 |
345 \end{itemize} | 346 \end{itemize} |
346 | 347 |
347 | 348 \paragraph{Stack layout} |
349 | |
350 Stack directly after function prolog:\\ | |
351 | |
352 \begin{figure}[h] | |
353 \begin{tabular}{5|3|1 1} | |
354 \hhline{~-~~} | |
355 & \vdots & & \\ | |
356 \hhline{~=~~} | |
357 register save area & \hspace{4cm} & & \mrrbrace{6}{caller's frame} \\ | |
358 \hhline{~-~~} | |
359 local data & & & \\ | |
360 \hhline{~-~~} | |
361 \mrlbrace{7}{parameter area} & r0-r3 & \mrrbrace{1}{spill area (if needed)} & \\ | |
362 \hhline{~-~~} | |
363 & \ldots & \mrrbrace{3}{stack parameters} & \\ | |
364 & \ldots & & \\ | |
365 & \ldots & & \\ | |
366 \hhline{~=~~} | |
367 register save area (with return address) & & & \mrrbrace{3}{current frame} \\ | |
368 \hhline{~-~~} | |
369 local data & & & \\ | |
370 \hhline{~-~~} | |
371 parameter area & \vdots & & \\ | |
372 \hhline{~-~~} | |
373 \end{tabular} | |
374 \caption{Stack layout on arm32 armhf} | |
375 \end{figure} | |
376 | |
377 | |
378 \newpage | |
348 | 379 |
349 | 380 |
350 \subsubsection{Architectures} | 381 \subsubsection{Architectures} |
351 | 382 |
352 The ARM architecture family contains several revisions with capabilities and | 383 The ARM architecture family contains several revisions with capabilities and |