Technical question about the Core 2 Duo and Mac OS X

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Technical question about the Core 2 Duo and Mac OS X

Post by Tord Romstad »

Hello,

I am considering replacing my first-generation Core Duo MacBook with one of the new Core 2 Duo MacBooks (they got a minor speed bump a few days ago). Before I buy, I have a very basic technical question:

I've been told that the AMD 64-bit CPUs require a 64-bit OS in order to run in 64-bit mode. Is the same true for the Intel Core 2 Duo? If yes, is Mac OS X 10.4 a 64-bit OS?

If I can't run my program in 64-bit mode on the Core 2 Duo, I'll wait for OS X 10.5 before buying a new machine.

Tord
Vempele

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Vempele »

Yes to both.

[Edit] Actually, it's not fully 64-bit.

http://developer.apple.com/macosx/64bit.html
It is important to note that in Tiger, the support for 64-bit programming does not extend throughout the entire set of APIs available on Mac OS X. Most notably, the Cocoa and Carbon GUI application frameworks are not ready for 64-bit programming. In practical terms, this means that the "heavy lifting" of an application that needs 64-bit support can be done by a background process which communicates with a front-end 32-bit GUI process via a variety of mechanisms including IPC and shared memory.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Tord Romstad »

Hello Teemu,

Thanks for the information!
Vempele wrote:Yes to both.

[Edit] Actually, it's not fully 64-bit.

http://developer.apple.com/macosx/64bit.html
This page appears to be somewhat outdated; it only talks about the old PowerPC Macs. I hope that all the information about the G5 also applies to the Core 2 Duo.

The limitation that GUI apps can only be 32-bit does not worry me, of course. I don't mind at all if my GUI must run in 32-bit mode, as long as I can use 64-bit operations in my engine.

How much faster is the 2.16 GHz Core 2 Duo compared to the 2 GHz Core Duo for chess programs?

Tord
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Technical question about the Core 2 Duo and Mac OS X

Post by hgm »

My guess is that, apart from the factor 1.08 you gain in clock frequency, it might be 20-25% faster. The upper limit to seems 33%, as you can do 4 uOps per clock in stead of 3. But pipeline stalls due to branch mispredicts aren't any shorter, and this will probably prevent you from reaping the full benefit.

I have a Core 2 Duo now, (2.4GHz E6600), and I could run a benchmark for you if you want me to.
Tord Romstad
Posts: 1808
Joined: Wed Mar 08, 2006 9:19 pm
Location: Oslo, Norway

Re: Technical question about the Core 2 Duo and Mac OS X

Post by Tord Romstad »

hgm wrote:My guess is that, apart from the factor 1.08 you gain in clock frequency, it might be 20-25% faster. The upper limit to seems 33%, as you can do 4 uOps per clock in stead of 3. But pipeline stalls due to branch mispredicts aren't any shorter, and this will probably prevent you from reaping the full benefit.
Does this 33% limit include the benefits of 64-bit arithmetics (I use bitboards), or can I add an extra 20-30% for 64-bit? If 33% is the best I can hope for, I think I'll pass.
I have a Core 2 Duo now, (2.4GHz E6600), and I could run a benchmark for you if you want me to.
Thanks, but I think there are too many other differences (different compiler, different OS) to make it a meaningful comparison.

Tord
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Technical question about the Core 2 Duo and Mac OS X

Post by hgm »

This estimate is for the same (32-bit) binary. For 64-bit you get an extra acceleration, which of course strongly depends on how much 64-bit arithmetic you do compared to 32-bit stuff. For the 64-bit stuff itself it could be more than a factor 2.
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Technical question about the Core 2 Duo and Mac OS X

Post by sje »

The day will eventually come when Apple will say "no more 32 bit support" and so the Core Solo/Core Duo machines will no longer have OS level software maintenance while the Core 2 Duo and later models will still be on the train. When will this happen? It's hard to say, but it's fairly certain that the PowerPC G3 machines are getting the boot this October (OS/X 10.5); for some of these, that's less than four fears after they were last sold.

For Core 2 Duo, the CPU is so similar to the Xeon Woodcrest CPUs in the workstation model line that I suspect that support will be around until 2015 or so. This is in line with the length of support given for PowerPC G4 CPUs, one of which is running the 2000 box I'm using to type this.

Also, the Mac Pro Book is expected to be updated in a week or so. The new model is supposed to have LED vs fluorescent backlighting along with onboard flash memory for power/speed optimization.
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Technical question about the Core 2 Duo and Mac OS X

Post by bob »

Tord Romstad wrote:Hello,

I am considering replacing my first-generation Core Duo MacBook with one of the new Core 2 Duo MacBooks (they got a minor speed bump a few days ago). Before I buy, I have a very basic technical question:

I've been told that the AMD 64-bit CPUs require a 64-bit OS in order to run in 64-bit mode. Is the same true for the Intel Core 2 Duo? If yes, is Mac OS X 10.4 a 64-bit OS?

If I can't run my program in 64-bit mode on the Core 2 Duo, I'll wait for OS X 10.5 before buying a new machine.

Tord
You _must_ run a 64 bit OS. Otherwise the32 bit OS will not know about the extra registers and context-switches would wreck a program. In fact, a 32 bit O/S won't even enable the 64 bit extensions at all so it will be a 32 bit CPU. Fast, but still 32 bits.

There are plenty of linux distros that run in 64 bit mode as well as the windows 64 bit version. Surely Apple has done this as well...
User avatar
sje
Posts: 4675
Joined: Mon Mar 13, 2006 7:43 pm

Re: Technical question about the Core 2 Duo and Mac OS X

Post by sje »

bob wrote:There are plenty of linux distros that run in 64 bit mode as well as the windows 64 bit version. Surely Apple has done this as well...
My understanding is that Leopard (Mac OS/X 10.5) will run both 32 bit and 64 bit programs. Of course, the 64 programs will require a Core 2 Duo, Xeon Woodcrest, or a PowerPC G5. To make this work, there's a need for two copies (32/64) of each shared library along with extra support in the kernel. So it's possible that there might be a small performance hit with mixed mode application mixes.

The Mac OS/X 10.5 programming model is said to be "LP64" where long integers and pointers are 64 bits long. Will "long long int" items still be 64 bits long? Will a lot of legacy programs fail to survive 64 bit recompilation when a "long int" or a pointer doubles in size?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Technical question about the Core 2 Duo and Mac OS X

Post by bob »

sje wrote:
bob wrote:There are plenty of linux distros that run in 64 bit mode as well as the windows 64 bit version. Surely Apple has done this as well...
My understanding is that Leopard (Mac OS/X 10.5) will run both 32 bit and 64 bit programs. Of course, the 64 programs will require a Core 2 Duo, Xeon Woodcrest, or a PowerPC G5. To make this work, there's a need for two copies (32/64) of each shared library along with extra support in the kernel. So it's possible that there might be a small performance hit with mixed mode application mixes.

The Mac OS/X 10.5 programming model is said to be "LP64" where long integers and pointers are 64 bits long. Will "long long int" items still be 64 bits long? Will a lot of legacy programs fail to survive 64 bit recompilation when a "long int" or a pointer doubles in size?
As far as running 32 bit apps on 64 bit linux, My linux distros do this as well. You can (although I don't know why one would want to) compile 32 bit apps on a 64 bit O/S. Intel even supports this with ICC...