Runtime stack
The runtime stack begins quadword aligned for both 32-bit and 64-bit processes.
The runtime stack begins quadword aligned for both 32-bit and 64-bit processes. The conventions that are discussed in the four following paragraphs are defined for stack save areas for VRs, as well as conventions for vector parameters passed on the stack.
VRSAVE is not recognized by the AIX® ABI, and should not be used or altered by ABI-compliant programs. The VRSAVE runtime stack save location remains reserved for compatibility with legacy compiler linkage convention.
The alignment padding space will be either 0, 4, 8, or 12 bytes as necessary to align the vector save area to a quadword boundary. Before use, any non-volatile VR must be saved in its VR save area on the stack, beginning with VR31, continuing down to VR20. Local variables of vector data type that need to be saved to memory are saved to the same stack frame region used for local variables of other types, but on a 16-byte boundary.
The stack floor remains at 220 bytes for 32-bit mode and 288 bytes for 64-bit mode. In the event that a function needs to save non-volatile general purpose resgisters (GPRs), floating-point registers (FPRs), and VRs totaling more than the respective mode's floor size, the function must first atomically update the stack pointer prior to saving the non-volatile VRs.
Any vector variables within the local variable region must be aligned to a 16-byte boundary.
The 32-bit runtime stack looks like the following (pre-prolog):
Item | Description |
---|---|
Sp -> | Back chain |
FPR31 (if needed) | |
... | |
-nFPRs*8 | ... |
GPR31 (if needed) | |
... | |
-nGPRs*4 | ... |
VRSAVE | |
Alignment padding (to 16-byte boundary) | |
VR31 (if needed) | |
-nVRs*16 | ... |
-220(max) | ... |
Local variables | |
NF+24 | Parameter List Area |
NF+20 | Saved TOC |
NF+16 | Reserved (binder) |
NF+12 | Reserved (compiler) |
NF+8 | Saved LR |
NF+4 | Saved CR |
NF -> | Sp (after NF-newframe allocated) |
The 64-bit runtime stack looks like the following (pre-prolog):
Item | Description |
---|---|
Sp -> | Back chain |
FPR31 (if needed) | |
... | |
-nFPRs*8 | ... |
GPR31 (if needed) | |
... | |
-nGPRs*8 | ... |
VRSAVE | |
Alignment padding (to 16-byte boundary) | |
VR31 (if needed) | |
-nVRs*16 | ... |
-288(max) | ... |
Local variables | |
NF+48 | Parameter List Area |
NF+40 | Saved TOC |
NF+32 | Reserved (binder) |
NF+24 | Reserved (compiler) |
NF+16 | Saved LR |
NF+8 | Saved CR |
NF -> | Sp (after NF-newframe allocated) |