Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Quant-X Alpha Linux Support <stefan@sime.com>
To: rth@cygnus.com
Cc: axp-list@redhat.com
Subject: Re: Function call oddity
Date: Mon, 13 Jul 1998 07:32:54 +0200	[thread overview]
Message-ID: <199807130532.HAA04465@stefan.sime.com> (raw)
In-Reply-To: <19980712214344.A19657@dot.cygnus.com> (message from Richard Henderson on Sun, 12 Jul 1998 21:43:44 -0700)

Hi Richard !

> Ok, so what.  That's not the real problem.  The real problem is that
> extra bis.  Better would be
> 
> 	ldq	$27,a($29)	e0
>  	jsr	$26,($27),a	e1
> 	ldah	$29,0($26)	e0
>  	cmple	$9,$10,$1	.. e1
> 	lda	$29,0($29)	e0
>  	addl	$9,1,$9		.. e1
>  	bne	$1,$L4		e1
> 
> Which is two cycles less than with your nop.  I missed whatever message
> had the example code, so I can't figure out what the compiler might 
> think it is doing.

> > I hope Richard Henderson reads this, too ;-}}
> 
> Better than hoping would be to actually send it to me.  I do little more
> than scan the lists these days.

Sorry, but for that you replied really fast...

Here the code, I've used egcs shipped with RH5.1 (egcs-2.90.27 980315). 
I've only used -O2 to compile. (UX board, 533MHz)
The "global" variable seems useless, but when making it volatile
the WITH_ARG version is somewhat slower (2.26 : 3.95)
Using the code like here, WITH_ARG defined gives 2.07 and
undefined gives 2.26 and so "#define WITH_ARG" faster.
Maybe the "volatile" stuff is even more interesting; but
I go to bed now (it's ~7:30am here).
--------------------------------------------------
/* #define WITH_ARG */

int global = 0;

#ifdef WITH_ARG
int a(int dummy) { return ++global; }
#else
void a(void) { ++global; }
#endif

main(void)
{
  int i=0;

  while(i++ < 100000000)
    a(
#ifdef WITH_ARG
      0
#endif
     );
}
--------------------------------------------------

-- 

Quant-X Service &                         Ph:  (+43) 4212 6004-0
Consulting Ges.m.b.H.                     Fax: (+43) 4212 600420
http://www.quant-x.com                    Email: support@quant-x.com


      reply	other threads:[~1998-07-13  5:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-12 18:56 Function call oddity Dave Gilbert
1998-07-13  1:06 ` Quant-X Alpha Linux Support
1998-07-13  4:43   ` Richard Henderson
1998-07-13  5:32     ` Quant-X Alpha Linux Support [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox