Xref: news2.mv.net comp.os.msdos.djgpp:3422 From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: register calling convention Date: Fri, 3 May 1996 10:27:15 +0100 Organization: The University of York, UK Lines: 29 Message-ID: NNTP-Posting-Host: tower.york.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <199605021311.NAA26091@aux.epita.fr> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Thu, 2 May 1996, frank denis wrote: > Hello ! In a previous mail, our friend Eli Zaretskii said : > Use the -mregparm=n (where n is a number [1..3]). Look it up in the GCC > docs. Note that you will have to rebuild the libraries you use (including > the libraries which come with DJGPP) with that same switch to be > consistent with that parameter-passing mechanism. > > May someone recompile these libraries and make them available for > everyone on a ftp ? I tried but all the programs crashed with the new It's unfortunately not as simple as just recompiling libc, because if you change the calling convention you will have to alter all the asm code that uses it. There is quite a bit of asm code in libc (off the top of my head, all the _dpmi_* wrapper functions take parameters on the stack), so converting it to the register calling convention would be a non-trivial task. I'm also unsure how much speed increase you would get. The 80x86 has so few registers, if you pass parameters in them the compiler is going to have to push other things onto the stack instead, to make room... /* * Shawn Hargreaves. Why is 'phonetic' spelt with a ph? * Check out Allegro and FED on http://www.york.ac.uk/~slh100/ */