Skip to content

Commit 91dbf5e

Browse files
authored
Merge pull request MicrosoftDocs#1887 from corob-msft/cr-arm64-fix2
Update ARM64 ABI return values per feedback
2 parents fd221c5 + 98080f4 commit 91dbf5e

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

docs/build/arm64-windows-abi-conventions.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -181,27 +181,21 @@ Integral values are returned in x0.
181181

182182
Floating-point values are returned in s0/d0/v0 as appropriate.
183183

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,
185185

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
189187
- 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,
197189

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:
199191

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.
201195

202-
### C++ return style
196+
All other types use this convention:
203197

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.
205199

206200
## Stack
207201

0 commit comments

Comments
 (0)