|compiling for mips environment firstname.lastname@example.org (simon) (1999-06-27)|
|Re: compiling for mips environment email@example.com (Zalman Stern) (1999-06-29)|
|Re: compiling for mips environment firstname.lastname@example.org (James Jones) (1999-06-29)|
|Re: compiling for mips environment email@example.com (Chris Dodd) (1999-06-29)|
|Re: compiling for mips environment firstname.lastname@example.org (Matt Postiff) (1999-07-01)|
|Re: compiling for mips environment email@example.com (Michael Meissner) (1999-07-11)|
|From:||Zalman Stern <firstname.lastname@example.org>|
|Date:||29 Jun 1999 02:59:27 -0400|
simon <email@example.com> wrote:
: It seems stack usage convention for mips in C environment dictate
: caller reserve space in stack for routine to save arguments a0..a3 if
: it needs to.
This is to support calling C routines that use stdarg (or vararg
historically) to access a variable size argument list. It is much
easier for the compiler point of view to have all the arguments at
contiguous addresses. So the stdarg callee can just save a0-a3 to the
four locations the caller left on the stack and then use the common
"bunch of macros" implementation for va_start and va_next.
Note that for non-stdarg routines, a0-a3 may never be saved to those
locations so the only cost is 16 bytes in the stack frame. There isn't
any execution overhead really.
The number of argument passing registers varies from calling
convention to calling convention. Most RISCs allow more than
4. (E.g. PowerPC uses 7 or 8, SPARC uses 8.)
Return to the
Search the comp.compilers archives again.