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@xxxxxxxxxxxxxxxxxx