comparison doc/manual/callconvs/callconv_arm64.tex @ 372:bac52ab8869f

- updated manual platform support overview - added win/ARM64 info to manual cconv reference
author Tassilo Philipp
date Fri, 25 Dec 2020 18:45:57 +0100
parents 276eb8c87aa0
children 524fdca405bf
comparison
equal deleted inserted replaced
371:451299d50c1a 372:bac52ab8869f
1 %////////////////////////////////////////////////////////////////////////////// 1 %//////////////////////////////////////////////////////////////////////////////
2 % 2 %
3 % Copyright (c) 2014-2019 Daniel Adler <dadler@uni-goettingen.de>, 3 % Copyright (c) 2014-2020 Daniel Adler <dadler@uni-goettingen.de>,
4 % Tassilo Philipp <tphilipp@potion-studios.com> 4 % Tassilo Philipp <tphilipp@potion-studios.com>
5 % 5 %
6 % Permission to use, copy, modify, and distribute this software for any 6 % Permission to use, copy, modify, and distribute this software for any
7 % purpose with or without fee is hereby granted, provided that the above 7 % purpose with or without fee is hereby granted, provided that the above
8 % copyright notice and this permission notice appear in all copies. 8 % copyright notice and this permission notice appear in all copies.
28 The word size is defined to be 32 bits, a dword 64 bits. Note that this is due to historical reasons (terminology didn't change from ARM32).\\ 28 The word size is defined to be 32 bits, a dword 64 bits. Note that this is due to historical reasons (terminology didn't change from ARM32).\\
29 For more details, take a look at the Procedure Call Standard for the ARM 64-bit Architecture \cite{AAPCS64}.\\ 29 For more details, take a look at the Procedure Call Standard for the ARM 64-bit Architecture \cite{AAPCS64}.\\
30 30
31 \paragraph{\product{dyncall} support} 31 \paragraph{\product{dyncall} support}
32 32
33 The \product{dyncall} library supports the ARM 64-bit AArch64 PCS ABI, as well as Apple's convention derived from it, for calls and callbacks. 33 The \product{dyncall} library supports the ARM 64-bit AArch64 PCS ABI, as well as Apple's and Microsoft's conventions which are derived from it, for both, calls and callbacks.
34 34
35 \subsubsection{AAPCS64 Calling Convention} 35 \subsubsection{AAPCS64 Calling Convention}
36 36
37 \paragraph{Registers and register usage} 37 \paragraph{Registers and register usage}
38 38
120 \end{figure} 120 \end{figure}
121 121
122 \newpage 122 \newpage
123 123
124 124
125 \subsubsection{Apple's ARM64 Function Calling Conventions} 125 \subsubsection{Apple's ARM64 Function Calling Convention}
126 126
127 \paragraph{Overview} 127 \paragraph{Overview}
128 128
129 Apple's ARM64 calling convention is based on the AAPCS64 standard, however, diverges in some ways. 129 Apple's ARM64 calling convention is based on the AAPCS64 standard, however, diverges in some ways.
130 Only the differences are listed here, for more details, take a look at Apple's official documentation \cite{AppleARM64}. 130 Only the differences are listed here, for more details, take a look at Apple's official documentation \cite{AppleARM64}.
131 131
132 \begin{itemize} 132 \begin{itemize}
133 \item arguments passed via stack use only the space they need, but are subject to the type alignment requirements (which is 1 byte for char and bool, 2 for short, 4 for int and 8 for every other type) 133 \item arguments passed via stack use only the space they need, but are subject to type alignment requirements (which is 1 byte for char and bool, 2 for short, 4 for int and 8 for every other type)
134 \item caller is required to sign and zero-extend arguments smaller than 32bits 134 \item caller is required to sign and zero-extend arguments smaller than 32bits
135 \end{itemize} 135 \end{itemize}
136 136
137
138 \subsubsection{Microsoft's ARM64 Function Calling Convention}
139
140 \paragraph{Overview}
141
142 Microsoft's ARM64 calling convention is based on the AAPCS64 standard, however, diverges for variadic functions.
143 Only the differences are listed here, for more details, take a look at Microsoft's official documentation \cite{MicrosoftARM64}.
144
145 \begin{itemize}
146 \item variadic function calls do not use any SIMD or floating point registers (for fixed and variable args), meaning first 8 params are passed via x0-x7, the rest via the stack
147 \end{itemize}
148