Subject: Re: shocking speed performance!
To: Reinoud Zandijk <zandijk@cs.utwente.nl>
From: Richard Earnshaw <rearnsha@arm.com>
List: port-arm32
Date: 05/20/1999 11:07:03
> <snip>
> 
> > > Why is not environment variables or standard configuration files used
> > > to make gcc/egcs use that as standard directives, like they do in other
> > > systems?
> > 
> > The official egcs distribution supports specifying the cpu type during 
> > configure, you then get a compiler that will target that cpu by default.  
> > But don't forget that any code that you then build with it may not port to 
> > other machines with older processors.  The default configuration is to go 
> > for portability.
> > 
> > I've seen installations where the compiler looks at the machine its 
> > running on and then generates code for that type of machine by default.  
> > They suck.  It causes no end of support issues when you ship a binary to a 
> > customer with a different configuration.
> 
> May I recapitulate this to :
>   "`rebuild world' for your own machine if you really want performance ?" 
> 
> sounds fair to me !
> 

Well, yes.  But I was in this case referring to the official egcs 
distributions from egcs.cygnus.com, not the tree in the NetBSD area.  At 
this level this becomes important because the Makefiles in the official 
distribution aren't used by the NetBSD build system.  I'm not sure what 
magic runes you should cast to build the standard NetBSD compiler in this 
way.

Note for RISC PC usesrs:
Using the configure script in egcs with the --with-cpu=strongarm will not 
work.  This tells the compiler that it is ok to use the ldrh instructions 
(which it isn't).  There is no way to specify the tuning parameter as 
distinct from the instruction selection parameter.

When running the compiler itself, RISCPC+strongarm users will get best 
code if they use the options

  -march=armv3m -mtune=strongarm

This allows the compiler to use the umul and smul instructions (but not 
ldrh), but then tells it to schedule the instructions for optimal 
performance on a strongarm.

If you just use

  -mtune=strongarm

then you will get portable code that is tuned for best performance on a 
strongarm (this is probably the best selection to use for most port-arm32 
people since it means your code will still run on everything).

Richard.