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

Michael Meissner meissner@linux.vnet.ibm.com
Tue Jan 6 22:50:00 GMT 2009

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

Michael Meissner, IBM
4 Technology Place Drive, MS 2203A, Westford, MA, 01886, USA

More information about the Gcc-help mailing list