Is there a list of registers that, on aarch64 Linux/BSD, the callee absolutely must save/restore if the callee is going to use them? The ABI documentation seemed muddled on this point. Or at least, it's nowhere as clear as the ABI documentation for other ISAs.
I'm asking for a list of specific 64-bit registers that need to be saved by the callee if they are going to be modified by the callee.
Linux follows the AAPCS64 ABI, which mandates:
A subroutine invocation must preserve the contents of the registers r19-r29 and SP. All 64 bits of each value stored in r19-r29 must be preserved, even when using the ILP32 data model [...].
And for SIMD/floating-point:
Registers v8-v15 must be preserved by a callee across subroutine calls; [...]. Additionally, only the bottom 64 bits of each value stored in v8-v15 need to be preserved; it is the responsibility of the caller to preserve larger values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With