You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build/arm64-windows-abi-conventions.md
+9-15Lines changed: 9 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,27 +181,21 @@ Integral values are returned in x0.
181
181
182
182
Floating-point values are returned in s0/d0/v0 as appropriate.
183
183
184
-
Types returned by value are handled differently depending on whether they have certain properties.
184
+
Types returned by value are handled differently depending on whether they have certain properties. Types which have all of these properties,
185
185
186
-
Types are given a "C" return style if they are aggregate by the C++14 standard definition. That is,
187
-
188
-
- they have no user-provided constructors, no private or protected non-static data members, no base classes, and no virtual functions,
186
+
- they're *aggregate* by the C++14 standard definition, that is, they have no user-provided constructors, no private or protected non-static data members, no base classes, and no virtual functions, and
189
187
- they have a trivial copy constructor, and
190
-
- they have a trivial destructor.
191
-
192
-
All other types are given a "C++" return style.
193
-
194
-
### C return style
195
-
196
-
Types less than or equal to 8 bytes are returned in x0.
188
+
- they have a trivial destructor,
197
189
198
-
Types less than or equal to 16 bytes are returned in x0 and x1, with x0 containing the lower-order 8 bytes.
190
+
use the following return style:
199
191
200
-
For types greater than 16 bytes, the caller shall reserve a block of memory of sufficient size and alignment to hold the result. The address of the memory block shall be passed as an additional argument to the function in x8. The callee may modify the result memory block at any point during the execution of the subroutine. The callee isn't required to preserve the value stored in x8.
192
+
- Types less than or equal to 8 bytes are returned in x0.
193
+
- Types less than or equal to 16 bytes are returned in x0 and x1, with x0 containing the lower-order 8 bytes.
194
+
- For types greater than 16 bytes, the caller shall reserve a block of memory of sufficient size and alignment to hold the result. The address of the memory block shall be passed as an additional argument to the function in x8. The callee may modify the result memory block at any point during the execution of the subroutine. The callee isn't required to preserve the value stored in x8.
201
195
202
-
### C++ return style
196
+
All other types use this convention:
203
197
204
-
The caller shall reserve a block of memory of sufficient size and alignment to hold the result. The address of the memory block shall be passed as an additional argument to the function in x0, or x1 if $this is passed in x0. The callee may modify the result memory block at any point during the execution of the subroutine. The callee returns the address of the memory block in x0.
198
+
-The caller shall reserve a block of memory of sufficient size and alignment to hold the result. The address of the memory block shall be passed as an additional argument to the function in x0, or x1 if $this is passed in x0. The callee may modify the result memory block at any point during the execution of the subroutine. The callee returns the address of the memory block in x0.
0 commit comments