24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

processing, and the fifth doubleword is reserved <strong>for</strong> future use. The last<br />

doubleword (doubleword 6) is reserved <strong>for</strong> use by the global linkage routines that<br />

are used when calling routines in other object modules (<strong>for</strong> example, in shared<br />

libraries).<br />

The Input Parameter Area<br />

In a 32-bit environment, the input parameter area is a contiguous piece of storage<br />

reserved by the calling program to represent the register image of the input<br />

parameters of the callee. The input parameter area is double-word aligned and is<br />

located on the stack directly following the caller’s link area. This area is at least 8<br />

words in size. If more than 8 words of parameters are expected, they are stored as<br />

register images that start at positive offset 56 from the incoming stack pointer.<br />

The first 8 words only appear in registers at the call point, never in the stack.<br />

Remaining words are always in the stack, and they can also be in registers.<br />

In a 64-bit environment, the input parameter area is a contiguous piece of storage<br />

reserved by the calling program to represent the register image of the input<br />

parameters of the callee. The input parameter area is double-word aligned and is<br />

located on the stack directly following the caller’s link area. This area is at least 8<br />

doublewords in size. If more than 8 doublewords of parameters are expected, they<br />

are stored as register images that start at positive offset 112 from the incoming<br />

stack pointer.<br />

The first 8 doublewords only appear in registers at the call point, never in the<br />

stack. Remaining words are always in the stack, and they can also be in registers.<br />

The Register Save Area<br />

The register save area is double-word aligned. It provides the space that is needed<br />

to save all nonvolatile FPRs and GPRs used by the callee program. The FPRs are<br />

saved next to the link area. The GPRs are saved above the FPRs (in lower<br />

addresses). The called function may save the registers here even if it does not need<br />

to allocate a new stack frame. The system-defined stack floor includes the<br />

maximum possible save area:<br />

32-bit plat<strong>for</strong>ms:<br />

64-bit plat<strong>for</strong>ms:<br />

18*8 <strong>for</strong> FPRs + 19*4 <strong>for</strong> GPRs<br />

18*8 <strong>for</strong> FPRs + 19*8 <strong>for</strong> GPRs<br />

Locations at a numerically lower address than the stack floor should not be<br />

accessed.<br />

A callee needs only to save the nonvolatile registers that it actually uses. It always<br />

saves register 31 in the highest<br />

v addressed word (in a 32-bit environment)<br />

v addressed doubleword (in a 64-bit environment)<br />

The Local Stack Area<br />

The local stack area is the space that is allocated by the callee procedure <strong>for</strong> local<br />

variables and temporaries.<br />

The Output Parameter Area<br />

The output parameter area (P1...Pn) must be large enough to hold the largest<br />

parameter list of all procedures that the procedure that owns this stack frame calls.<br />

360 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!