Main | Response to Guardian's "License to Drive a Computer" »

IBM's Compilers on Mac OS X

August 29, 2003

Well, there has been a major announcement - IBM has just released beta versions of their XL compilers on the Mac.

As to why this is important...

G4/G5 CPUs are unusual beasts. As are most CPUs. Each of the mainstream CPUs diverges from 'orthagonal' purist CPU design in a variety of ways; generally to get specific optimizations.

The most common compiler in use today is GCC; it runs on and builds code for a wide range of platforms - many more than most people have ever actually used in their daily lives. It's the standard compiler on which most people tend to think in and use; the most commonly used compiler suite on the planet, in all likelihood.
And yet, it suffers from poor performance. Not because it's a poor compiler - it's one of the best compilers on the market - but because it's a universal infrastructure, that models an orthagonal, generic CPU design.


Real CPUs don't look like the internal CPU representation that gcc uses to generate fast, efficient, optimized code. As a result, the code gets the job done, but can be wasteful in terms of time and efficiency (and size, for that matter). Jack of all trades, master of none.
So, application developers looking to use the best their hardware has to offer - from geneticists running BLAST to search for genomes to mathematicians in Mathematica, from graphic designers in Photoshop to web monkeys in Dreamweaver, are generally using code compiled not with GCC, but with a vendor-specific compiler.
Intel users often end up using the Intel compiler; it generates more efficient, and higher quality, code than the competition, by a sizeable amount. On large runs, this can mean differences in runtime of anywhere from seconds to *hours* of real-world twiddling-of-thumbs time.

Traditionally, MacOS/X is a GCC box, as is Linux. Our Operating System is compiled using it, as are all of our applications; we rely on GCC to provide us with the quality and support that GCC has traditionally offered, and rely on application authors to hand-tune their code to work on our systems using either assembly language subroutines or pseudocode like the AltiVec extensions on G4/G5 systems.

This announcement means that the Mac OS is headed for a kind of parity that it's not traditionally had; while historically G4 AltiVec performance has trounced that of its Intel competition, even with the GCC compiler in comparison to 'native' compilers on those platforms, that we're about to see a new kind of compiler that has the promise of really using more of the CPU we already have in our machines; in other words, change compilers and your applications run faster on existing hardware.

More importantly, these compilers, as well as more accurately modelling our G4/G5 CPUs than GCC, often offer features that, right now, you just can't get in GCC. The most promising of these is called OpenMP - it's a language extension which allows you to write parallel code at a low level easily. What this means for us is that it will become very easy, using IBM's compiler, to turn algorithms in applications, even if they don't know anything about threads, into applications that, for those computation-intensive times, know how to use the fact that many of the Macs shipping today ship with more than one CPU. It means that multiple CPUs will get used more often, and that means a lot less thumb-twiddle time.

Today is a good day for mac developers; it promises to make tomorrow a good day for mac users. Today, we should be thanking IBM; tomorrow, your investment may have just become a better value for money.

Current GCC vs XLC performance comparisons show optimized GCC vs optimized XLC compiles showing improvements of anywhere from 11% to 51% on SPECint2000 scores. For floating point performance, the difference is even more extreme - more of the numbers are over the 50% mark than under; the G4/G5 have always had stronger floating point, and now the compiler backs that up with the appropriate optimizations to make use of the unique features of the architecture that enables that to be true.

For more information, have a look at IBM's presentation on their current and future compiler features along with some performance notes on how they got there. While not an example of how this will perform on a Mac, it's definitely a sign of just how much can be accomplished by moving to native compilers - something we can all look forward to in future releases of software on our embattled platform.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Article

This page contains an article posted on August 29, 2003 3:32 PM.

The next post in this blog is Response to Guardian's "License to Drive a Computer".

Many more can be found on the home page or by looking through the full article list.

www.flickr.com
gblock's items Go to gblock's photostream
Creative Commons License
This weblog is licensed under a Creative Commons License.

PS3 ID: CTOForADay
Wii: 1974 6313 6054 0208