www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/06/28/07:07:21

Message-ID: <19990628130650.A31847@tabor.ta.jcu.cz>
Date: Mon, 28 Jun 1999 13:06:50 +0200
From: Jan Hubicka <hubicka AT ta DOT jcu DOT cz>
To: djgpp-workers AT delorie DOT com
Subject: Re: Regparm....
References: <19990628010734 DOT 59338 AT atrey DOT karlin DOT mff DOT cuni DOT cz> <37771452 DOT D2436E7C AT taniwha DOT org>
Mime-Version: 1.0
X-Mailer: Mutt 0.93i
In-Reply-To: <37771452.D2436E7C@taniwha.org>; from Bill Currie on Mon, Jun 28, 1999 at 06:21:06PM +1200
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, Jun 28, 1999 at 06:21:06PM +1200, Bill Currie wrote:
> Jan Hubicka wrote:
> > So please let me know your ideas.
> 
> This is all good stuff, but the library really should be usable
> independently of the -mregparm given to gcc.  This can be accomplished
> through __attribute__((regparm=X)) IIRC.
Well, I would preffer to make libraries compilable in regparm modes. 
Having regparm(0) in all prototypes of function calls should be solution as well,
but it will force you to use slower libraries and require you to use includes
for all called functions. But this is probably not purpose, because you need to
include stdio to make printf working as well (varargs parameters are always pushed,
but gcc must know, they they are varargs). So simple hello world w/o including stdio
don't work. 
Maybe I can do some work on this in egcs later (according to the docs, first varargs parameters
are in registers, but this don't seems to be true).
Other purpose is, that string functions and other builtins _must_ be compiled with same
regparm as rest of code, because gcc use internal prototype w/o regparm attribute, so it
will not link (this took me two hours figure out, why startup code is crasing because of
this behaviour)

Having library compiled with regparm=3 by default is inacceptable, because it is non standard,
debugging and profiling don't work (and I believe it will require changes at both library
and compiler side). Also I would expect big red sign "experimental" on the regparm library
for a year or so, until compiler proves to be stable enought. Making reparm work really wasn't
easy step for egcs folks.
Also debugging of such hybrid programs is impossible IMO, because gdb don't know where function
parameters comes from.

So having multiple libraries is IMO only way. But I am open to all ideas. I would love to
get this into oficial djgpp soon, so I am ready to follow your opinions :)
Looking forward for regparmized allegro :)
> 
> > Just last information that might interest you is the size of stripped
> > libc compiled in various regparms:
> > -mregparm=0  326kb
> > -mregparm=3  320kb
> 
> Hmmm, 6kb savings.  Not a lot, but not bad either.  What sort of speed
The savings can slightly increase once __asmlinkage is killed (for example dpmi stubs
can be much smaller)
> differences do you get?
Didn't tested much yet...  I would expect them to be bigger than size savings, but not too
large anyway.
But there certainly are programs, where function calling overhead is important
and such feature should help. It let's gcc schedule prologues/epilogues better.
(current version of prologue have AGI stall. When parameters are on the stack, gcc don't
know how to get them before all pushes are done. With registers this will not be problem,
so prologue can be scheduled into function code).
Only I've measured is sorting of integers using library qsort, where calling overhead
is really important and I've god more than 100% speedup.
In normal cases change is not really important...IMO
I would love to know results on the compiler itself, but it will probably take some time
until this get's stable enought to compile it. I really don't have any idea how stable
current version really is.
> 
> > Honza
> 
> Just curious, but what does this mean?  See you, bye, later?
Honza is just another version of my name Jan. Jan = John and Hanz in german.
So thats where Czech Honza comes from (it is easier to pronounce than Jan, so it is
popular)
See you, bye and later is in czech "nashledanou" or "ahoj" or "cau"

Honza
> 
> Bill
> -- 
> Leave others their otherness.

- Raw text -


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