Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ARM to C calling convention, NEON registers to save

Tags:

abi

arm

neon

There is a similar post that covers regular registers. What about NEON registers. As far as I remember either top half or bottom half of registers have to be preserved across function calls. I can't find that info anywhere, can somebody clarify that?

thanks

From the AAPCS, §5.1.1 Core registers:

  • r0-r3 are the argument and scratch registers; r0-r1 are also the result registers
  • r4-r8 are callee-save registers
  • r9 might be a callee-save register or not (on some variants of AAPCS it is a special register)
  • r10-r11 are callee-save registers
  • r12-r15 are special registers

From the AAPCS, §5.1.2.1 VFP register usage conventions (VFP v2, v3 and the Advanced SIMD Extension):

  • s16–s31 (d8–d15, q4–q7) must be preserved
  • s0–s15 (d0–d7, q0–q3) and d16–d31 (q8–q15) do not need to be preserved
like image 1000
Pavel P Avatar asked Mar 13 '11 08:03

Pavel P


People also ask

What registers are the caller saved registers?

The registers RAX, RCX, RDX, R8, R9, R10, R11 are considered volatile (caller-saved). The registers RBX, RBP, RDI, RSI, RSP, R12, R13, R14, and R15 are considered nonvolatile (callee-saved).

What are saved registers?

Callee-saved registers (AKA non-volatile registers, or call-preserved) are used to hold long-lived values that should be preserved across calls.

What are NEON registers?

The NEON and floating-point register file is a collection of registers which can be accessed as 32-bit, 64-bit, or 128-bit registers. Which registers are available for an instruction depends on whether it is a NEON instruction or VFP instruction.

Which register does arm use as the static base pointer SB )?

Register R9 has a role that is specific to a particular environment. It can be used as the static base register (SB) to point to position-independent data, or as the thread register (TR) where thread-local storage is used.


1 Answers

From the AAPCS, §5.1.2.1:

  • s16–s31 (d8–d15, q4–q7) must be preserved
  • s0–s15 (d0–d7, q0–q3) and d16–d31 (q8–q15) do not need to be preserved
like image 112
kennytm Avatar answered Sep 28 '22 07:09

kennytm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!