[haiku] Re: Ang: Re: gcc4 hibryd

  • From: Nick <tonestone57@xxxxxxxxxxx>
  • To: <haiku@xxxxxxxxxxxxx>
  • Date: Sun, 8 Mar 2009 22:28:21 -0600

> From: holmqvist.fredrik@xxxxxxxxxxxx
> 
> For reference here is what I've landed on when compiling 'optimized builds':
> '-O3 -march=i586 -mtune=i586 -fthread-jumps -fforce-addr 
> -frerun-cse-after-loop -frerun-loop-opt -fexpensive-
> optimizations -falign-functions=4 -falign-jumps=4'
> I used to use i686, but people were using K6 cpus and it does not support 
> i686 it seems. Also I don't know how many 
> bugs I've found just because I've been trying different optimizations. It can 
> help find bugs as well, not just create 
> interesting new ones...
> 
> (I know mtune and march is basically the same)
> /Fredrik Holmqvist, TQH

 

Ok, I want to point this out first:

 

-march=cpu-type
Generate instructions for the machine type cpu-type (gcc manual).

 

-march provides: CPU instructions, ABI & scheduling = greater performance

 

-mtune=cpu-type
Tune to cpu-type everything applicable about the generated code, except for 

the ABI and the set of available instructions (gcc manual).

 

-mtune provides: CPU scheduling ONLY.

 

-march & -mtune are not the same.  You'll get way better performance 

with -march switch compared to slight improvement with mtune/mcpu.

 

2nd,

You use too many compile flags.  All you really need for gcc4 is

-O2 -fomit-frame-pointer -march=i586 -mtune=core2

 

for gcc2

-O2 -fomit-frame-pointer -march=i586 -mcpu=i686

 

If your system has lots of RAM - you can also add in -pipe to speed the

build up.

 

You can also change -O2 to -O3 if you think stability is not affected.  You

can change mtune to a lesser CPU ( =pentium3, pentium-m, athlon-xp, etc. ) 

but I believe many are getting or using Core2s these days.  Maybe

mtune=pentium3 or athlon-xp would be the safer choices?

 

Using other specific flags could cause the build to become unstable and 

are meant for hardcore tweakers.  Play it safe by sticking with the options

I listed above - just my suggestion.

 

Regards,

_________________________________________________________________
Share photos with friends on Windows Live Messenger
http://go.microsoft.com/?linkid=9650734

Other related posts: