aph pointed out that signals make a mess of my idea of writing below r1 and protecting later, but I realised that you know in advance how much stack a method will use so you can just set up the stack for that before you call it. Of course, all that has to be in assembler, so I can’t use my funky StackFrame class :( I decided it’s high time I made a table of register usage across ABIs to aid me in writing this:

  ppc ppc64
r0 Volatile register which may be modified during function linkage
r1 Stack frame pointer
r2 Reserved TOC pointer
r3 Volatile registers used for parameter-passing and return values
r4    
r5-r10 Volatile registers used for parameter-passing
r11 Volatile registers which may be modified during function linkage Volatile register used in calls by pointer and/or as an environment pointer
r12 Volatile register used in function linkage and exception handling
r13 Small data area pointer System thread ID
r14-r30 Non-volatile registers used for local variables
r31 Non-volatile register used for local variables or as an environment pointer  

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.