You are not logged in.

#1 2009-12-25 03:52:57

kaizoku
Member
Registered: 2009-01-09
Posts: 62

[Solved] Core Duo vs Core 2 Duo?

I am trying to figure out my CFLAGS, due to intel naming convention, I am very confused.

/proc/cpuinfo

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Pentium(R) Dual  CPU  E2200  @ 2.20GHz
stepping    : 13
cpu MHz        : 1200.000
cache size    : 1024 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm
bogomips    : 4399.99
clflush size    : 64
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 15
model name    : Intel(R) Pentium(R) Dual  CPU  E2200  @ 2.20GHz
stepping    : 13
cpu MHz        : 1200.000
cache size    : 1024 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fdiv_bug    : no
hlt_bug        : no
f00f_bug    : no
coma_bug    : no
fpu        : yes
fpu_exception    : yes
cpuid level    : 10
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm
bogomips    : 4399.87
clflush size    : 64
power management:
Pentium 4/Prescott/Celeron 'D'/Pentium 'D'/Core Solo/Core Duo

    * i686 

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

    * x86-64 

CHOST="x86_64-unknown-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

[edit] Core 2 Duo/Quad/Xeon

    * i686 

CHOST="i686-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"

    * x86-64 

CHOST="x86_64-unknown-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CXXFLAGS="${CFLAGS}"

    * Add +1 per extra core to MAKEFLAGS, i.e.: 

MAKEFLAGS="-j3"

for multi core CPUs

Which one should I use?

Last edited by kaizoku (2009-12-25 07:17:54)

Offline

#2 2009-12-25 04:19:24

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [Solved] Core Duo vs Core 2 Duo?

I would suggest you use "-march=native" which will pick the correct type based on the instruction sets supported by your CPU. For more details see `man gcc' (search for "Intel 386 and AMD x86-64 Options").

Offline

#3 2009-12-25 04:24:27

kaizoku
Member
Registered: 2009-01-09
Posts: 62

Re: [Solved] Core Duo vs Core 2 Duo?

-march=native results in -march=generic which makes bad codes. I read it somewhere.

Offline

#4 2009-12-25 04:54:25

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [Solved] Core Duo vs Core 2 Duo?

kaizoku wrote:

-march=native results in -march=generic which makes bad codes. I read it somewhere.

-march=native will not result in -march=generic. And, -march=generic will produce code that's just fine; It'll just produce a larger binary.

Offline

#5 2009-12-25 05:40:01

kaizoku
Member
Registered: 2009-01-09
Posts: 62

Re: [Solved] Core Duo vs Core 2 Duo?

http://en.gentoo-wiki.com/wiki/CFLAGS

However the side effects, like larger binary size, affects everything. Larger binaries use more memory, load slower, cause more disc I/O, etc.

Can you just tell me do I have Core Duo or Core 2 Duo CPU? Thanks.

Offline

#6 2009-12-25 05:54:01

takedown
Member
From: Argentina
Registered: 2008-08-31
Posts: 219

Re: [Solved] Core Duo vs Core 2 Duo?

Offline

#7 2009-12-25 05:59:52

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [Solved] Core Duo vs Core 2 Duo?

kaizoku is trying to figure out if it's a Core 2 Duo or a Core Duo. According to many, many search hits it's a Core 2 Duo.

Also from the gentoo page, echoed in the GCC docs:

If you are using gcc-4.2.2 or newer you can also use
-march=native or -mtune=native.
See gcc doc. This comes especially handy if you have an Intel Core* CPU and are planning switching between gcc-4.2 and gcc-4.3.

Offline

#8 2009-12-25 07:17:37

kaizoku
Member
Registered: 2009-01-09
Posts: 62

Re: [Solved] Core Duo vs Core 2 Duo?

Thanks for replies, I appreciate it, will benchmark both to see which is better, thanks again.

Offline

Board footer

Powered by FluxBB