[bugweek] A script to detect -mtune=i386 libraries

Vladimir Makarov vmakarov at redhat.com
Mon Sep 27 17:20:06 UTC 2004


Dax Kelson wrote:

>On Sat, 2004-09-25 at 18:09, Alan Cox wrote:
>  
>
>>On Sat, Sep 25, 2004 at 11:09:42PM +0200, Arjan van de Ven wrote:
>>    
>>
>>>in theory we compile all of fedora core with -mtune=i686 (or
>>>-mtune=pentium4 nowadays). however that only actually happens if
>>>packages propagate the RPM_OPT_FLAGS into the CFLAGS properly; almost
>>>all but not quite not all packages actually do this.
>>>      
>>>
>>I noticed a curiosity playing with this that perhaps the gcc folks can
>>explain the right choice for - on Dothan -mtune=i686 is a lot faster than
>>tuning for pentium4.
>>    
>>
I don't think that -mtune=i686 is a lot faster in average (as I remeber 
the difference was 1-2% for SPECInt2000).  Although some benchmarks 
(with few hot spots in loops) could be a lot faster.  E.g. the 
difference between -mtune=nocona (em64t) and -mtune=k8 (amd64) on Xeon 
(nocona core) is really big (up to 20% for SPECInt2000).

 -mtune=i686 means tunning for pentiumpro core (core of pentium2 and 
pentium3 processors).  As I know pentium-m design was based on this core 
(although intel used some implementations from P4 cores too).  Of course 
the code tunned with -mtune=i686 will work better for pentium-m than 
code tunned with -mtune=pentium4.  The factor  which  has the biggest 
impact is that Pentium-M is more sensitive to code alignment (function, 
loop, label alignment) than pentium4.  Therefore code generated with 
-mtune=i686 has bigger alignments and as consequence the generated code 
with this option is bigger.  Also latency time of pentium4 and pentium-m 
are differrent.  Penium-M has more constraints in issuing several insns 
on the same cycle than pentium4 does.  Therefore insn scheduling is more 
important for pentium-m than pentium4.  There are a few other different 
parameters which gcc takes into account when it tunnes code for pentium-m.

>AFAIK there's a -march=pentium-m in gcc 3.4.x. Does that imply that
>-mtune=pentium-m exists?
>  
>
There is no difference between tunning for pentium-m and i686 (or 
pentiumpro) in gcc-3.4.  It is just another alias.

Vlad






More information about the fedora-devel-list mailing list