15

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
Community
  • 1
  • 1
Pavel P
  • 15,789
  • 11
  • 79
  • 128
  • What about FPSCR and FPEXC? – Sven Oct 13 '18 at 00:27
  • I'm not even sure about these. For example `5.1.2.1 VFP register usage conventions (VFP v2, v3 and the Advanced SIMD Extension)` covers `FPSCR`, but it's not clear if you should do anything to preserve it or not. – Pavel P Oct 17 '18 at 21:02

1 Answers1

13

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
Pavel P
  • 15,789
  • 11
  • 79
  • 128
kennytm
  • 510,854
  • 105
  • 1,084
  • 1,005