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: patchkov@acs1.acs.ucalgary.ca (Serguei Patchkovskii) Subject: Re: why only 6 params passed in registers? Date: 2000/01/14 Message-ID: <85n8st$kmm$1@nserve1.acs.ucalgary.ca>#1/1 X-Deja-AN: 572553391 References: <85hhsi$lkj$1@nnrp1.deja.com> <85hs78$3a7$1@news.telekabel.nl> <85iba2$fcs$2@nserve1.acs.ucalgary.ca> <387EEFA6.3CD3F398@dtn.ntl.com> X-Complaints-To: news@ucalgary.ca X-Trace: nserve1.acs.ucalgary.ca 947857117 21206 136.159.34.221 (14 Jan 2000 13:38:37 GMT) Organization: University of Calgary NNTP-Posting-Date: 14 Jan 2000 13:38:37 GMT Newsgroups: comp.os.linux.alpha Chris (quattro_net@dtn.ntl.com) wrote: : 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. You win nothing doing this. The situation typical in numerical codes is that most of the quantities have no "natural" association - they are needed in different combinations for different fucntion calls. So, you'll either end up passing huge structures unnecesarily, or you'll end up stuffing your parameters into Yet Another Meaningless Struct all the time - take your pick. The things are not helped by the fact that most numerical codes are written in Fortran, with substantial parts coming from many years back and requiring the Fortran-77 interface style. As you probably know Fortran-77 does not even *have* structures as a part of the language - so it is kinda hard to use them ;-p) : I would never pass more than a couple of args to any function... Well, welcome to the real world. Cheers, /Serge.P -- home page: http://www.cobalt.chem.ucalgary.ca/ps/