Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* flags for egcs on alpha
@ 1998-07-15 21:47 Jon Harman
  1998-07-16  0:38 ` Richard Henderson
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Harman @ 1998-07-15 21:47 UTC (permalink / raw)
  To: axp-list

Hi,

I just loaded egcs 1.0.3a and want to get the best floating
point performance from it on my Alpha.  What optimization flags 
should I use??

Thanks,
Jon


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: flags for egcs on alpha
  1998-07-15 21:47 flags for egcs on alpha Jon Harman
@ 1998-07-16  0:38 ` Richard Henderson
  1998-07-16  1:20   ` Kurt Garloff
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 1998-07-16  0:38 UTC (permalink / raw)
  To: axp-list

On Wed, Jul 15, 1998 at 02:47:41PM -0700, Jon Harman wrote:
> I just loaded egcs 1.0.3a and want to get the best floating
> point performance from it on my Alpha.  What optimization flags 
> should I use??

In general?  -O2.

r~


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: flags for egcs on alpha
  1998-07-16  0:38 ` Richard Henderson
@ 1998-07-16  1:20   ` Kurt Garloff
  1998-07-16 15:26     ` Quant-X Alpha Linux Support
  0 siblings, 1 reply; 4+ messages in thread
From: Kurt Garloff @ 1998-07-16  1:20 UTC (permalink / raw)
  To: Richard Henderson, axp-list

On Wed, Jul 15, 1998 at 05:38:08PM -0700, Richard Henderson wrote:
> > I just loaded egcs 1.0.3a and want to get the best floating
> > point performance from it on my Alpha.  What optimization flags 
> > should I use??
> 
> In general?  -O2.

I use -O3 -ffast-math -fomit-frame-pointer -fno-exceptions -fno-rtti.
Consider specifying your cpu if your compiler doesn't default to it:
-mcpu=ev5

-- 
Kurt Garloff, Dortmund 
<K.Garloff@ping.de>
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: flags for egcs on alpha
  1998-07-16  1:20   ` Kurt Garloff
@ 1998-07-16 15:26     ` Quant-X Alpha Linux Support
  0 siblings, 0 replies; 4+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-07-16 15:26 UTC (permalink / raw)
  To: axp-list; +Cc: rth

Hi !

> On Wed, Jul 15, 1998 at 05:38:08PM -0700, Richard Henderson wrote:
> > > I just loaded egcs 1.0.3a and want to get the best floating
> > > point performance from it on my Alpha.  What optimization flags 
> > > should I use??
> > 
> > In general?  -O2.
> 
> I use -O3 -ffast-math -fomit-frame-pointer -fno-exceptions -fno-rtti.
> Consider specifying your cpu if your compiler doesn't default to it:
> -mcpu=ev5

No compiler can make perfect code. It's a hard to
make egcs faster, just because it is fast. 
Non-optimal code is acceptable for very special cases and because
a fix maybe would slow down more common situations.
I've included an example for such a case.
Okay, no fp code, but "-O2" and a align fix is faster than a big
command-line. I found that ".align 5" is not optimal for all
cases but a wrong ".align 4" may dramatically decrase the performance.

 
Here the results: (make run)
----------------------------------------------------------------------
gcc -O3 -ffast-math -fomit-frame-pointer -fno-exceptions -fno-rtti \
 -o opt opt.c
gcc -O2 -S -o - opt.c | \
sed -e 's/[ \t]*\.align[ \t]*5/\.align 4/g' > opt.s
gcc -o opt_asm opt.s
time ./opt
11.66user 0.00system 0:11.67elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (56major+13minor)pagefaults 0swaps
time ./opt_asm
11.54user 0.00system 0:11.55elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (56major+13minor)pagefaults 0swaps
rm opt.s
----------------------------------------------------------------------


----------------------------------------------------------------------
/* opt.c */
#define E ++p; *p=0; do { 
#define L } while(++*p < 3); p--;

int main() {
  unsigned loop[20], *p = loop;

  E E E E E E E E E E E E E E E E E E
  L L L L L L L L L L L L L L L L L L

  return 0;
};
----------------------------------------------------------------------


----------------------------------------------------------------------
# Makefile

T=opt

all: $(T) $(T)_asm

run: all
	time ./$(T)
	time ./$(T)_asm

%.s:%.c ; gcc -O2 -S -o - $< | \
	sed -e 's/[ \t]*\.align[ \t]*5/\.align 4/g' > $@

%:%.c ; gcc -O3 -ffast-math -fomit-frame-pointer -fno-exceptions -fno-rtti \
	 -o $@ $<

%_asm:%.s ; gcc -o $@ $<

clean: 
	rm -f $(T){,_asm,.o,.s,.c~} core

----------------------------------------------------------------------

-- 

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-07-16 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-07-15 21:47 flags for egcs on alpha Jon Harman
1998-07-16  0:38 ` Richard Henderson
1998-07-16  1:20   ` Kurt Garloff
1998-07-16 15:26     ` Quant-X Alpha Linux Support

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