[haiku] Re: Ang: Re: gcc4 hibryd

  • From: Nick <tonestone57@xxxxxxxxxxx>
  • To: <haiku@xxxxxxxxxxxxx>
  • Date: Mon, 9 Mar 2009 09:24:04 -0600

> From: Christian.Packmann@xxxxxx

> If you want to tune for modern CPUs, you should follow the GCC manual and 
> use -mtune=generic.


I just looked over the GCC manual for mtune=generic.


Produce code optimized for the most common IA32/AMD64/EM64T processors. 
If you know the CPU on which your code will run, then you should use the 

corresponding -mtune option instead of -mtune=generic.


....indicates the processor (or, in this case, collection of processors) for 

the code is optimized.

A little further down it says ( only other place generic appears ):


Same as generic, but when used as march option, PentiumPro instruction
set will be used, so the code will run on all i686 family chips.


So, it seems to me that mtune=generic=i686 (pentium pro)




I guess i686 is the safest choice because it would provide benefit to

most CPUs (P2,P3,Athlons,P4s,Core2s) out there but not really sure if it would

be good or bad for the Atom, VIA C3, C7.


> Using -mtune=pentium may actually give acceptable code for Atom, as it is 
> also an dual-issue in-order design. The pairing rules for parallel 
> execution will be different, and floating point code will likely not be 
> optimized as the Pentiums FPU wasn't pipelined. But overall it may be 
> better than scheduling for "normal" CPUs. The real solution will only come 
> when GCC adds -mtune=atom.

I actually use an Atom system so I will have to pay closer attention to march

& mtune flags.  I am very sure that when I chose -march=native to compile

a program that gcc actually substitued in core2 ( for my Atom system ).  Maybe

because of the instructions it supports, ie: SSSE3?  I will recheck but 

feel very sure this is what happened.


march=native lets gcc determine the proper CPU arch. to optimize for.


> Using good code in the first place is the better solution.




Experience all of the new features, and Reconnect with your life.

Other related posts: