Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
+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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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