AArch64 Calling Conventions Explained: How Registers Are Saved Across Function Calls
AArch64, ARM's 64-bit architecture introduced with Armv8-A, has 31 general-purpose registers plus a stack pointer and 32 SIMD/floating-point registers, each assigned specific roles by the Application Binary Interface (ABI). The ABI divides registers into caller-saved and callee-saved categories, determining which party is responsible for preserving register values across function calls. Crucially, these are software-level conventions enforced by agreement between compiled functions, not behaviors built into the CPU hardware itself. The processor does not automatically save or restore any register during a function call — the BL instruction has no awareness of register preservation rules. Understanding this distinction helps developers and compiler engineers reason about why compilers choose specific registers and how to write code that is both correct and performant on AArch64 systems.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in