Effect of -mtune=* on x86 or x86-64 systems?

Wirawan Purwanto wirawan0@gmail.com
Wed Jan 7 15:21:00 GMT 2009


Hi Michael,

Thanks for the answer. I would  like to know if someone has investigated 
this issue for some benchmark or real-world cases. Is there any 
write-up/report/paper on this thing?

Thanks,
Wirawan

On Tue, 6 Jan 2009, Michael Meissner wrote:

> On Tue, Jan 06, 2009 at 03:28:06PM -0500, Wirawan Purwanto wrote:
>> Hi,
>>
>> What is, and how much is, the effect of -mtune (or its implication in
>> -march) switch of gcc (version 4.3, that is)? Suppose I use
>> -march=pentium4 and then run the binary on pentium M machine (both support
>> MMX, SSE, and SSE2), what kind of penalty will I get? I don't have a
>> particular code in mind, but think of a numerical-type code with lots of
>> double precision math.
>
> It really depends on what your code is, what machine you specified in the
> -mtune= option, and what machine you are running on.  Some code will not see an
> appreciable difference, some will see a huge difference.  If you are compiling
> code to run on the machine you are going to be running on, consider using
> -mtune=native.  The default tunings are an attempt to run reasonably well on
> both modern Intel and AMD machines.  However, it is a compromise tuning, in
> that there are some things that could be faster if compiled for a specific
> machine.
>
> -- 
> Michael Meissner, IBM
> 4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA
> meissner@linux.vnet.ibm.com
>



More information about the Gcc-help mailing list