Should I use -march=nocona or -march=core2 when compiling binaries for this processor with gcc 4.3?

vendor_id       : GenuineIntel
cpu family      : 6
model           : 15
model name      : Intel(R) Xeon(R) CPU           X3220  @ 2.40GHz
stepping        : 8
cpuid level     : 10
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss syscall nx lm constant_tsc arch_perfmon pebs bts rep_good pni ssse3 cx16 lahf_lm

I cannot really find if this CPU is already core2 architecture... Only find information about the quad core variants, but this CPU is only dual core.


-march=core2 should be the correct one. you could always benchmark the code with each. Also, you may find that the open64 compiler might be better at optimizing your code. gcc is great because it works on so many platforms, however it isn't the most powerful when it comes to producing super optimized code. I am guessing that is really what you are going for, otherwise you would just use i686 for the arch.

  • +1 for the hint to open64 which is interesting, however in this case it's only to setup make.conf on gentoo. ;-) – hurikhan77 Mar 19 '10 at 23:53
  • Ok, fairly sure that march=core2 is the correct choice. Really the big part is it selects all the extensions like SSE3 and the such. – spowers Mar 20 '10 at 0:01
  • Accepted, as the systems works flawlessly with it. However, I did no benchmarks to prove it's really better - just feeling more comfortable now. ;-) – hurikhan77 Mar 22 '10 at 15:08
  • I am glad that it works well. – spowers Mar 22 '10 at 22:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.