Search code examples
c++coptimizationgcccompiler-flags

gcc optimization flags for Xeon?


I'd want your input which gcc compiler flags to use when optimizing for Xeons?

There's no 'xeon' in mtune or march so which is the closest match?


Solution

  • Xeon is a marketing term, as such it covers a long list of processors with very different internals.

    If you meant the newer Nehalem processors (Core i7) then this slide indicates that as of 4.3.1 gcc should be use -march=generic (though your own testing of your own app may find other settings that outperform this). The 4.3 series also added -msse4.2 if you wish to optimize that aspect of FP maths.

    Here is some discussion comparing tuning in Intel's compiler versus some gcc flags.