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
+10-16Lines changed: 10 additions & 16 deletions
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,
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
187
+
- they have a trivial copy-assignment operator, and
188
+
- they have a trivial destructor,
187
189
188
-
- they have no user-provided constructors, no private or protected non-static data members, no base classes, and no virtual functions,
189
-
- they have a trivial copy constructor, and
190
-
- they have a trivial destructor.
190
+
use the following return style:
191
191
192
-
All other types are given a "C++" return style.
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.
193
195
194
-
### C return style
196
+
All other types use this convention:
195
197
196
-
Types less than or equal to 8 bytes are returned in x0.
197
-
198
-
Types less than or equal to 16 bytes are returned in x0 and x1, with x0 containing the lower-order 8 bytes.
199
-
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.
201
-
202
-
### C++ return style
203
-
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