Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: hobbs@steven.zko.dec.com (Steven Hobbs)
Subject: Re: why only 6 params passed in registers?
Date: 2000/01/14	[thread overview]
Message-ID: <85lsaj$o6m$1@mailint03.im.hou.compaq.com> (raw)
In-Reply-To: 85hhsi$lkj$1@nnrp1.deja.com


In article <85hhsi$lkj$1@nnrp1.deja.com>, david_morse@my-deja.com writes:
>On alpha unixen the first 6 parameters are passed in registers, and
>further arguments are passed on the stack.  There are a total of 18
>registers that are not saved across calls, why not allow them all to
>contain parameters?  Functions that acutally used > 18 parameters +
>scratch registers would still have stack activity, but the others would
>not.
>
>Just wondering...

Consider the example of a varargs function, like printf in C.  On
entry to printf, the routine does not know whether it has just 1
argument or 18 arguments or even more until it has decoded the format
string argument.  It also does not not know whether the arguments are
in the floating registers or in the integer registers.  With the
current calling standard printf needs to save 5 integer registers and
and 5 floating registers until it has decoded the format string.  If
the calling standard passed 18 arguments in registers then printf
would need to save 17 integer registers and 17 floating registers.
This is a lot of overhead, given that most varargs routines (including
printf) rarely use these many arguments.




  parent reply	other threads:[~2000-01-14  5:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-12  5:00 why only 6 params passed in registers? david_morse
2000-01-12  5:00 ` Martin Sinot
2000-01-12  5:00   ` Serguei Patchkovskii
2000-01-14  5:00     ` Chris
2000-01-14  5:00       ` Serguei Patchkovskii
2000-01-14  5:00         ` Chris
2000-01-15  5:00       ` Greg Lindahl
2000-01-15  5:00         ` Chris
2000-01-15  5:00           ` Serguei Patchkovskii
2000-01-16  5:00             ` Chris
2000-01-16  5:00               ` Serguei Patchkovskii
2000-01-12  5:00 ` Alex Rhomberg
2000-01-14  5:00 ` Steven Hobbs [this message]
2000-01-14  5:00   ` Martin Sinot
2000-01-14  5:00     ` Steven Hobbs
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox