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: Chris Subject: Re: why only 6 params passed in registers? Date: 2000/01/14 Message-ID: <387EEFA6.3CD3F398@dtn.ntl.com>#1/1 X-Deja-AN: 572491934 Content-Transfer-Encoding: 7bit References: <85hhsi$lkj$1@nnrp1.deja.com> <85hs78$3a7$1@news.telekabel.nl> <85iba2$fcs$2@nserve1.acs.ucalgary.ca> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@net.ntl.com X-Trace: nclient3-gui.server.dtn.ntl.com 947843116 14206 212.250.69.73 (14 Jan 2000 09:45:16 GMT) Organization: Man Mime-Version: 1.0 NNTP-Posting-Date: 14 Jan 2000 09:45:16 GMT Newsgroups: comp.os.linux.alpha You would make the code much more efficient and faster by writing the code to put all the args in a structure, then passing a pointer to it. Voila, only a single register needed and you only have to add an element to the structure, not change the function declaration, if you need to add more args later. I would never pass more than a couple of args to any function... Rgrds, Chris Serguei Patchkovskii wrote: > > Martin Sinot (martin@spase.nl) wrote: > : Umm, how often do you have a function with 18 parameters? Or even six? > > In numerical codes, it is not uncommon to have functions with half a > dozen parameters; I'd also seen function interfaces with more than > twenty parameters, with each one being there for a good reason. Of > course, such functions tend to perform a fair bit of processing of > their own - so that parameter passing style is not even a second-order > effect for them. The number of scratch registers, available for > intermediate results, is, on the other hand, very important for > such functions... > > Cheers, > > /Serge.P > > -- > home page: http://www.cobalt.chem.ucalgary.ca/ps/