views:

594

answers:

3

Hi all,

I'm interested in knowing how GCC differs from Intel's ICC in terms of the optimization levels and catering to specific processor architecture. I'm using GCC 4.1.2 20070626 and ICC v11.1 for Linux.

How does ICC's optimization levels (O1 to O3) differ from GCC, if they differ at all?

The ICC is able to cater specifically to different architectures (IA-32, intel64 and IA-64). I've read that GCC has the -march compiler option which I think is similar, but I can't find a list of the options to use. I'm using Intel Xeon X5570, which is 64-bit. Are there any other GCC compiler options I could use that would cater my applications for 64-bit Intel CPUs?

Thank you.

Regards, Rayne

+1  A: 

See section 3.17.15 in the GCC manual, ie386 and x86-64 Options for the full list and description of all the options applicable to those architectures (IA-64 is Itanium, and it's unlikely you have one of those).

The most important options in this context are:

  • -m64 Generate 64-bit code;
  • -march= Generate instructions for a specific CPU type; and
  • -mtune= Tune the code for a specific CPU type.
caf
A: 

tune options, disassemble the code and see the difference

Alexander Solonsky
not a very useful answer, since this will only apply to the code he already has, and not to the code he may write in the future.
Nathan Fellman
and how do you measure the effectiveness of the GCC or ICC optimizer of the non existent code ?
Alexander Solonsky