Language Implementation
7-15
7
The standard i960 processor calling convention places an absolute
minimum overhead on simple, commonly called functions with few
parameters. This is done by passing information between the calling
function and the called function in the i960 architecture's global registers
as much as possible.
Definitions
call-preserved register The register must have the same value
upon exit from a function as it did upon
entry to the function.
call-scratch register The register may have a different value
upon exit from a function than it did
upon entry to the function.
The following list summarizes usage of the global registers
g0 through
g15 and the floating-point registers fp0-fp3.
g0...g7 These eight registers pass parameters into the
called function from the calling function. If the
return value of the function is four words or less
in size, then the return value is passed back to the
calling function in registers
g0 through g3. If the
function returns a long double and generates
code for the KB or SB processor and
compatibility with ic960 R2.0 is requested, then
registers
g0 through g7 are call-scratch registers.
g8...g11 These four registers may be used for parameter
passing in addition to
g0 through g7. If a
parameter or a piece of a parameter is passed in
one of these registers, that register is considered
a call-scratch register. That register is
considered a call-preserved register otherwise. If
the called function can not be sure that a register
has had a parameter passed in it, then the register
must be considered a call-preserved register.