1

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.

1 Answer 1

2

-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.

4
  • +1 for the hint to open64 which is interesting, however in this case it's only to setup make.conf on gentoo. ;-)
    – hurikhan77
    Commented Mar 19, 2010 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
    Commented Mar 20, 2010 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
    Commented Mar 22, 2010 at 15:08
  • I am glad that it works well.
    – spowers
    Commented Mar 22, 2010 at 22:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .