32 bit ABI
|
64 bit ABI
|
The callee's arguments are stored in the caller's stack frame. Note that the address of %sp must be kept 8-byte aligned for the 32 bit ABI, and 16-byte aligned for 64 bit.
For the 64-bit frame, the 2047
offset is called the BIAS, and it allow system libs to know which ABI is
in effect (if 1 in last binary digit, 64 bit). Integers are stored in
64 bit slots, with the last 4 bytes holding the good value. Therefore, to
load an int stored at 176 you do a ldsw [%sp+2047+176+4], reg
.
For the 32-bit ABIs, floating point args are passed in the integer regs (2 regs for double) and floating point functions return their value in %f0.
For the 64 bit v9 ABI, there is a complicated memory-slot/register mapping which determines how things are passed in registers, as shown in 2 (note that after the callee executes the save statement, the %o registers will of course be the %i registers). Note that v9a is just v9 with VIS extensions, and v9b also includes some UltraSPARC-III extensions, so all v9 ABIs are the same for the information discussed here.
Clint Whaley 2012-07-10