The Apple Mac OS X.3 Panther 64-bitness question.

Eug

Lifer
Mar 11, 2000
24,055
1,697
126
So just how 64-bit enabled do you consider X.3 Panther to be? The G5 PPC 970 is a 64-bit chip, and Panther has some mods to allow some 64-bitness with it, but the most sought after feature is not supported. ie. Panther does not yet directly support single processes over over 4 GB, even though the OS can directly support up to 16 GB total in both hardware and software. So what do you think? How hard will it be for Apple to implement this feature? Apparently there are ways of modifying apps to make them see more than 4 GB, but I dunno if this requires partitioning the memory into 4 GB chunks or something like you have to do in other 32-bit OSes. See here:

Subject: Apple on 64-bit-ness
To: scitech@lists.apple.com
From: Ernest Prabhakar <prabhaka@apple.com>
Date: Wed, 10 Sep 2003 12:10:08 -0700

Hi all,

There seems to be a bit of confusion on this topic. The short answer is
* The PowerPC G5 processor is fully 64-bit
* Mac OS X supports many, but not all, services using 64-bit integers
* Currently, sizeof(void *) == 4

I realize that some people take a rigid position that 64-bit computing -> 64-bit OS -> sizeof(void *) == 8. Which may be understandable given their problem space, but reality - especially when dealing with mass-market personal computers, not speciality workstations - is a bit more complicated, and different people benefit from Mac OS X's level of 64-bit support in different ways.

A more official explanation is below. Please let me know if there's any confusion about this.

Sincerely,
Ernest Prabhakar
Product Manager, UNIX & Open Source
Apple
----------------------------------------
Mac OS X Jaguar (10.2.7 and later) features a redesigned kernel and updated system software math libraries specifically for the 64-bit PowerPC G5 processor. The updated kernel delivers the most substantial benefits of 64-bit computing by breaking through the 4GB physical memory barrier enabling the kernel to use all the RAM that can be added to the new Power Mac G5 (currently 8GB). [Eug's comment: The hardware and OS supports 16 GB with 2 GB DIMMs in the 8 slots, but Apple doesn't sell 2 GB DIMMs.]

The key functions of the system math and vector libraries have been hand tuned to make maximum advantage of new and faster math functions that the 64-bit G5 is capable of. This is a great because unmodified applications that use the system math functions will get an automatic speed up when run on the G5. For example, the square root function is implemented as a software algorithm when run on a G3 or G4 but on a G5 when a square root calculation is requested the math library uses the super-fast hardware instruction that the G5 has.

This approach brings the maximum benefit of 64-bit processing to the desktop personal computer market and does so with full native-speed compatibility with existing 32-bit applications. Because the PowerPC instruction set was designed initially with 64-bit instructions in mind, this transition is a smooth and simple one for our developers and customers.

Apple has also supplied a new compiler, GCC version 3.3 which generates optimal code for the new G5 machine model. Importantly, this compiler produces code that executes efficiently on G5, G4 and G3 systems so a single Mac OS X application runs on each of our support processor architectures. This allows developers to build and qualify a single version of their applications for the 32-bit and 64-bit Mac systems.

Mac OS X Panther takes the same approach to the G5 as Jaguar but will be able to optimized additional math functions based on feedback from the developer community.

== References ===
Optimizing for the Power Mac G5
< http://developer.apple.com/performance/g5optimization.html > ):
Technical Note TN2086: Tuning for the G5: A Practical Guide
< http://developer.apple.com/technotes/tn/tn2086.html >
Technical Note TN2087: PowerPC G5 Performance Primer
< http://developer.apple.com/technotes/tn/tn2087.html >
Technical Note TN2090: Driver Tuning on Panther or G5 (Of interest only if you have written a device driver)
< http://developer.apple.com/technotes/tn/tn2090.html >
Power Mac G5 Performance White Paper (PDF)
http://www.apple.com/powermac/pdf/PowerMacG5_Perf_WP_071503.pdf

== Default Sizes ===
sizeof (char) == 1
sizeof (short) == 2
sizeof (int) == 4
sizeof (long) == 4
sizeof (long long) == 8
sizeof (void *) == 4
sizeof (void (*)(void)) == 4
sizeof (float) == 4
sizeof (double) == 8
sizeof (long double) == 8* [may change in the future]
sizeof (size_t) == 4
sizeof (off_t) == 8

== G5-Related Flags for GCC ===
-mcpu=970
This allows the compiler to use instructions only available on the G5 (also known as 970) processor.

-mtune=970
This tells the compiler to tune code as optimally as it can for the G5. This flag can be safely used by itself on code that may run on processors other than the G5, because code compatibility is not changed.

-mpowerpc64
In combination with the above flags, this flag tells the compiler to enable the G5's native 64-bit long long support for greatly enhanced performance when working with long longs. At times, the -force_cpusubtype_ALL flag may also be needed.