Skip to content

Commit

Permalink
Add 32-bit Arm and AArch64 to CallingConventions.md
Browse files Browse the repository at this point in the history
This commit adds sections for 32-bit Arm and AArch64 to CallingConventions.md.

Signed-off-by: KONNO Kazuhiro <[email protected]>
  • Loading branch information
knn-k committed Jun 15, 2020
1 parent 1db16ee commit d619476
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions doc/diagnostics/CallingConventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,44 @@ 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)

# 32-bit Arm

## Linux

Scratch registers are not preserved across calls, while non-volatile registers are preserved by called functions.
Usage of the VFP registers depends on the floating-point ABI of the target system.

|Register|System Linkage|
|--|--|
|R0|1st argument / return value|
|R1|2nd argument / return value|
|R2-3|3rd-4th arguments|
|R4-10|Non-volatile|
|R11|System Frame Pointer (FP)|
|R12|Scratch; Intra-Procedure-Call Register (IP)|
|R13|System Stack Pointer (SP)|
|R14|Link Register (LR)|
|R15|Program Counter (PC)|

# AArch64 (64-bit Arm)

## Linux

Scratch registers are not preserved across calls, while non-volatile registers are preserved by called functions.

|Register|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|
|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|

0 comments on commit d619476

Please sign in to comment.