delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/10/16:20:35

Message-Id: <m0w45NG-000S1pC@natacha.inti.edu.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT edu DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT natacha DOT inti DOT edu DOT ar>
Organization: INTI
To: djgpp AT delorie DOT com
Date: Mon, 10 Mar 1997 16:57:56 +0000
MIME-Version: 1.0
Subject: Re: register based calling

About the register calling convetion thread:

> Ian Mausolus wrote:
> > 
> > Does anyone know how to do register based calling under DJGPP?
> 
> You should use '__attribute__ ((regparm(n)))' where n is the
> number of registers to be used. Example:
> 
> static void __attribute__ ((regparm(1))) test_func(int a);

  As you can see (Ian) is not so hard the problem is that YOU must say how many 
register will be used and YOU must choose what functions will use it.
  The Dhrystone Benchmark return a much better result if the most silly 
routines uses registers as parameters. Of course is very hard to oredict if it 
will be better or worst because you don't know how the registers are 
distributed and GCC doesn't choose the number of registers and what functions 
are suitable for it.

Disclamer:
For Robert: Forget about the Dhrystone sentence is just for fun like the games 
;-)
For Eli: I don't want a reply explaining that is better what GCC does regarding 
to the register calling convention because I'm just explaining a suitation, isn't 
a critic and doesn't have in count the posibility to use the switch to make ALL 
the callings through registers by the GCC criteria because is hard to use if we 
use libc. ;-)

SET

 
--------------- 0 --------------------------------
Salvador Eduardo Tropea (SET).
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019