diff --git a/doc/diagnostics/CallingConventions.md b/doc/diagnostics/CallingConventions.md index 3c429816f52..f9afa6f78da 100644 --- a/doc/diagnostics/CallingConventions.md +++ b/doc/diagnostics/CallingConventions.md @@ -239,3 +239,23 @@ Useful links: * [z/Architecture Principles of Operation](http://publibfi.boulder.ibm.com/epubs/pdf/dz9zr008.pdf) * [z/Architecture Reference Summary](http://publibfi.boulder.ibm.com/epubs/pdf/dz9zs006.pdf) +# AArch64 (64-bit Arm) + +Scratch registers are not preserved across calls, while non-volatile registers are preserved by called functions. + +|Register|Linux System linkage| +|--|--| +|R0|1st argument / return value| +|R1-7|2nd-8th arguments| +|R8-15|Scratch| +|R16-17|Scratch; Intra-Procedure-Call Registers (IP0-1)| +|R18|Scratch; Platform Register| +|R19-28|Non-volatile| +|R29|System Frame Pointer (FP)| +|R30|Link Register (LR)| +|SP|System Stack Pointer (SP)| +|PC|Program Counter (PC)| +|V0|1st floating point argument / floating point return value| +|V1-7|2nd-8th floating point argument| +|V8-15|Non-volatile| +|V16-31|Scratch|