From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,f6dda81e7269c676 X-Google-Attributes: gid111c93,public From: hobbs@steven.zko.dec.com (Steven Hobbs) Subject: Re: why only 6 params passed in registers? Date: 2000/01/14 Message-ID: <85lsaj$o6m$1@mailint03.im.hou.compaq.com>#1/1 X-Deja-AN: 572360627 Distribution: world References: <85hhsi$lkj$1@nnrp1.deja.com> X-Complaints-To: usenet@mailint03.im.hou.compaq.com X-Trace: mailint03.im.hou.compaq.com 947811475 24790 16.31.32.149 (14 Jan 2000 00:57:55 GMT) Organization: Compaq Computer Corp Reply-To: steven.hobbs@compaq.com NNTP-Posting-Date: 14 Jan 2000 00:57:55 GMT Newsgroups: comp.os.linux.alpha 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.