apple to improve compiler code

Posted:
in Future Apple Hardware edited January 2014
Apple is looking to hire some software engineers to improve the gcc compiler and its optimizations for PowerPC:

http://www.compilerjobs.com/jobs/apple.php



They are also wanting to improve compile time.



I'd say this is good news. GCC is not well optimized for PowerPC. I have seen this first hand on IBM JS20 servers. IBM's Visualage XLC compiler generates code that is noticeably faster on the PowerPC 970 than GCC.



What I really think Apple should do, and I don't understand why they haven't, is team with IBM to put objective C into XLC. Ah, nevermind, it looks like IBM is doing that:

http://64.233.167.104/search?q=cache...ient=firefox-a



So, shouldn't Apple license IBM's compilers? I think it would make a huge performance difference on the G5 machines. Compiling OS X and its frameworks with XLC would be a boon to all G5 users, as well as a boon to G4 and G3 users, although to a lesser extent.
«134

Comments

  • Reply 1 of 68
    pbpb Posts: 4,255member
    Quote:

    Originally posted by unixguru



    So, shouldn't Apple license IBM's compilers?




    Actually I am a bit surprised that they did not already in Tiger, but then who knows what IBM would charge them for that?
  • Reply 2 of 68
    Tiger is compiled with the GCC4 specs, and they say that 4.1 should bring a major speed increase (Some say 30%, give or take) compared to 4.0. It should also include auto-vectorisation and auto-altivecoptimizations.
  • Reply 3 of 68
    mr. memr. me Posts: 3,221member
    Quote:

    Originally posted by unixguru

    ....



    So, shouldn't Apple license IBM's compilers? I think it would make a huge performance difference on the G5 machines. Compiling OS X and its frameworks with XLC would be a boon to all G5 users, as well as a boon to G4 and G3 users, although to a lesser extent.




    Last time I heard, gcc was open source and XLC was not. Apple is committed to using open source tools to build MacOS X. You can rest assured that an XLC-compiled MacOS X would be a lot more expensive. Having said that, Apple strongly supports XLC. Recently, I attended an Apple high-performance computing presentation in which the engineers talked extensively about XLC and its performance advantages over gcc.
  • Reply 4 of 68
    jasenj1jasenj1 Posts: 923member
    As a G3 owner, this is the sort of thing that both encourages and discourages me. On the one hand, OS X gets faster with each release and it's great to see Apple improving performance on an already snappy OS. On the other hand, why hasn't Apple used a better optimized compiler a long time ago? How much performance is being wasted in all Macs due to inefficient compilation?



    - Jasen.
  • Reply 5 of 68
    programmerprogrammer Posts: 3,458member
    Quote:

    Originally posted by T'hain Esh Kelch

    Tiger is compiled with the GCC4 specs, and they say that 4.1 should bring a major speed increase (Some say 30%, give or take) compared to 4.0. It should also include auto-vectorisation and auto-altivecoptimizations.



    GCC 4 already includes these things, plus a lot of other improvements that improve the PPC code generation. It puts in place a major new architecture for implementing optimizations, considerably modernizing GCC. Future versions will continue to bring new improvements.



    Prior to this Apple primarily used Metrowerk's compiler, and before that they used "MrC" which originated from IBM (if I recall correctly). Their use of GCC has been only since OSX arrived on the scene, and since then they have been making continuous improvements to it.
  • Reply 6 of 68
    imiloaimiloa Posts: 187member
    Quote:

    Originally posted by PB

    Actually I am a bit surprised that they did not already in Tiger, but then who knows what IBM would charge them for that?



    actually, given that IBM is in the biz of selling CPUs, apple could probably work a decent licensing agreement with them.



    logic: faster OS and apps --> better "real world" benchmarks --> better rep for IBM CPUs



    and likely by-product: more macs sold due to less perception of performance gap --> more IBM CPUs sold --> more ROI for IBM.



    that said, sounds like programmer has a good handle on the state of GCC4, and that it's narrowing the gap.
  • Reply 7 of 68
    Quote:

    Originally posted by Programmer

    "MrC" [?] originated from IBM (if I recall correctly).



    It was a collaborative effort between Apple and Symantec, according to DrunkenBlog.
  • Reply 8 of 68
    shadowshadow Posts: 373member
    Or Apple wants to optimise for cell?
  • Reply 9 of 68
    mdriftmeyermdriftmeyer Posts: 7,503member
    GCC is free and will see significant improvements from Apple that include dynamic libstdc++, along-side intentionally breaking C/ObjC to fix a lot of hidden flaws in earlier revisions of GCC (GCC 4.1 is expected to see ObjC++ and all the fixes/optimations for the general GCC branch).



    Key change with the bison parser:



    http://gcc.gnu.org/gcc-4.1/changes.html



    XLC is not free and I believe is > $500 per seat. To add ObjC support means that folks who want something unique that XLC offers for Tiger will pay for it.



    For clarification: ObjC++ did not make it in the the GCC branch, but is of course in Apple's modified GCC 4.0, along-side the dynamic libstdc++. What 4.1 will bring with the clean-up between C/ObjC and the bison parser will merge all these Apple additions into the general GCC 4.1 branch. With the heavy work done the optimization work on PPC can be focused more heavily and for folks who use GNUstep and ObjC who have been waiting for ObjC++, GCC 4.1 will be the first version in the 4 series they can use, whether on PPC, x86, so on and so forth.
  • Reply 10 of 68
    onlookeronlooker Posts: 5,252member
    Quote:

    Originally posted by shadow

    Or Apple wants to optimise for cell?



    I think they should look into the way the Mac is handling OGL with graphics cards while they do this. I'd like to see the option of better plug and play with PC cards at some extent. Quadro drivers work in Linux. That should be easy enough right?
  • Reply 11 of 68
    Quote:

    Originally posted by Mr. Me

    Last time I heard, gcc was open source and XLC was not. Apple is committed to using open source tools to build MacOS X. You can rest assured that an XLC-compiled MacOS X would be a lot more expensive. Having said that, Apple strongly supports XLC. Recently, I attended an Apple high-performance computing presentation in which the engineers talked extensively about XLC and its performance advantages over gcc.



    I don't think the "free" nature of GCC is why Apple was/is using it. At the time work started on OS X, the only compiler that could compile Objective C on the PowerPC was (I believe) GCC. Most other compilers have dropped ObjC support.



    C'mon, you're telling me that Steve Jobs, salesman of the century, couldn't sell IBM on a deal to license XLC? IBM would be stupid to turn down the revenue. I really think Apple could make an agreement for compiling OS X and Apple applications with XLC that wouldn't break the bank.



    I'd say the performance benefits of XLC would be well worth the costs. Performance on all Macs would increase appreciably.
  • Reply 12 of 68
    Quote:

    Originally posted by mdriftmeyer



    Key change with the bison parser:



    http://gcc.gnu.org/gcc-4.1/changes.html

    With the heavy work done the optimization work on PPC can be focused more heavily and for folks who use GNUstep and ObjC who have been waiting for ObjC++, GCC 4.1 will be the first version in the 4 series they can use, whether on PPC, x86, so on and so forth.




    That's very interesting. It says there that 4.1 uses a hand-written parser. I'll have to check that out. I thought all modern compilers probably used parser generators.
  • Reply 13 of 68
    mr. memr. me Posts: 3,221member
    Quote:

    Originally posted by unixguru

    I don't think the "free" nature of GCC is why Apple was/is using it. At the time work started on OS X, the only compiler that could compile Objective C on the PowerPC was (I believe) GCC. Most other compilers have dropped ObjC support.



    C'mon, you're telling me that Steve Jobs, salesman of the century, couldn't sell IBM on a deal to license XLC? IBM would be stupid to turn down the revenue. I really think Apple could make an agreement for compiling OS X and Apple applications with XLC that wouldn't break the bank.



    I'd say the performance benefits of XLC would be well worth the costs. Performance on all Macs would increase appreciably.




    You don't seem to understand that Apple is a business. Look around the software industry. You see no comparable commercial software project that is not substantially more expensive than MacOS X. Apple's business model makes an OS of the quality of MacOS X available for $129, $69 edu. This is a major reason why Apple replaced Display PostScript with Quartz. This is a major reason why Apple bundles TrueType fonts with its OS rather than PostScript fonts. Essential to the success of Apple's current business model is the use of opensource tools. XCode, arguably the best development system on the planet, is available for every new Mac at no extra charge.



    If Apple is a business, IBM is really a business. It is not a charity. Currently, you can get XLC for $400/seat at education prices, which is a 33.3% discount on the standard $600/seat price. Even if IBM reduced the price of XLC by another 75% of the academic price, that would represent a $100 increase in the price of MacOS X in its current configuration. How many people are willing to pay $230 ($170 edu) for MacOS X?



    In the final analysis, you proposal makes no sense for Apple. It makes no sense for IBM. It makes no sense for their customers.



    Edit: Corrected the mistake in which I called XCode by the name Xtools, which a completely different product.
  • Reply 14 of 68
    Quote:

    Originally posted by Mr. Me

    You don't seem to understand that Apple is a business. Look around the software industry. You see no comparable commercial software project that is not substantially more expensive than MacOS X. Apple's business model makes an OS of the quality of MacOS X available for $129, $69 edu. This is a major reason why Apple replaced Display PostScript with Quartz. This is a major reason why Apple bundles TrueType fonts with its OS rather than PostScript fonts. Essential to the success of Apple's current business model is the use of opensource tools. Xtools, arguably the best development system on the planet, is available for every new Mac at no extra charge.



    If Apple is a business, IBM is really a business. It is not a charity. Currently, you can get XLC for $400/seat at education prices, which is a 33.3% discount on the standard $600/seat price. Even if IBM reduced the price of XLC by another 75% of the academic price, that would represent a $100 increase in the price of MacOS X in its current configuration. How many people are willing to pay $230 ($170 edu) for MacOS X?



    In the final analysis, you proposal makes no sense for Apple. It makes no sense for IBM. It makes no sense for their customers.




    You don't seem to understand how compilers are licensed. A compiler is a translator. It translates from a high level language like C, ObjC or C++ to assembly language. Compilers are (usually) licensed based on the number of "seats" that may be compiling with it at any one time. Once the compilation is done, there are no royalties on the compiled software, because the compiler is not beng used after that. It has done its job; software is not compiled again when it is used. Display Postscript is quite different. In display postscript, the OS would be actively running Postscript code while in use, hence Adobe can collect royalties.



    Are you trying to tell me that if I were to compile an app with MS Visual Studio that I would have to pay MS $500+ for every copy of the program I distribute? How can anyone sell software for less than $500 then?



    The only thing that could cause the price of Mac OS to go up by $100+ is if Apple were to actually ship the XLC compiler with every copy of Mac OS. It is quite possible to compile the OS and core libraries with XLC, but still ship GCC as the default compiler for XCode, as is currently done. For example, Windows is compiled with Microsoft's compiler, but you can run programs on it that were compiled with Borland or GCC.



    In conclusion, what you've just said is one of the most insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I award you no points, and may God have mercy on your soul.



    P.S. What is Xtools? Do you mean the XCode IDE?
  • Reply 15 of 68
    onlookeronlooker Posts: 5,252member
    Quote:

    Originally posted by Mr. Me





    If Apple is a business, IBM is really a business. It is not a charity. Currently, you can get XLC for $400/seat at education prices, which is a 33.3% discount on the standard $600/seat price. Even if IBM reduced the price of XLC by another 75% of the academic price, that would represent a $100 increase in the price of MacOS X in its current configuration. How many people are willing to pay $230 ($170 edu) for MacOS X?







    Quote:

    Originally posted by unixguru





    The only thing that could cause the price of Mac OS to go up by $100+ is if Apple were to actually ship the XLC compiler with every copy of Mac OS.




    That is obviously exactly what he is saying. Even an educational seat for the compiler is big $$$, and more than Apples charges for their OS. Apple can't purchase one copy of it, and distribute it freely with every version of Mac OS X in Xcode like they would need to. Don't you think that may be why they are hiring developers to better GCC for them?
  • Reply 16 of 68
    jrgjrg Posts: 58member
    Quote:

    Originally posted by onlooker

    That is obviously exactly what he is saying. Even an educational seat for the compiler is big $$$, and more than Apples charges for their OS. Apple can't purchase one copy of it, and distribute it freely with every version of Mac OS X in Xcode like they would need to. Don't you think that may be why they are hiring developers to better GCC for them?



    That is one strong reason. Another is that Apple's code could be heavily reliant on extensions, quirks or implementation details within GCC. If it was it would be difficult, time consuming and expensive to port the codebase to another compiler.



    Maintaining GCC gives them access to a compiler that can never be taken away from them, and that can be made as great as they need it to be.
  • Reply 17 of 68
    mr. memr. me Posts: 3,221member
    Quote:

    Originally posted by unixguru

    You don't seem to understand how compilers are licensed. A compiler is a translator....



    To the contrary, I understand perfectly.



    Quote:

    Originally posted by unixguru

    The only thing that could cause the price of Mac OS to go up by $100+ is if Apple were to actually ship the XLC compiler with every copy of Mac OS. It is quite possible to compile the OS and core libraries with XLC, but still ship GCC as the default compiler for XCode, as is currently done. For example, Windows is compiled with Microsoft's compiler, but you can run programs on it that were compiled with Borland or GCC.



    Currently, Apple makes gcc available with every copy of MacOS X at no extra cost. Apple gives its users the same compiler that it uses for its own development. This practice allows every Mac user to be a developer if he or she has the skills and desire to do so. It baffles me that you consider bifurcating Apple's development tools as a viable option. This would be a bad idea if it were possible, which it is not. As I said before, to switch from gcc to XLC would add a minimum of $100 to the price of the present configuration of MacOS X.



    Quote:

    Originally posted by unixguru

    In conclusion, what you've just said is one of the most insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I award you no points, and may God have mercy on your soul.



    It is inappropriate to get personal.



    Quote:

    Originally posted by unixguru

    P.S. What is Xtools? Do you mean the XCode IDE?



    My bad. I meant XCode.
  • Reply 18 of 68
    cubistcubist Posts: 954member
    I disagree completely with you guys. I would have no objection whatsoever if Apple compiled Mac OS X itself with XLC, but then distributed gcc with XCode. I would also like the option of buying XCode Pro for $400 or whatever it is. I think the percentage of Mac users who write code with XCode is fairly low - well below 1% - but it is very nice that Apple includes XCode.



    Consider a different example. Sun sells Solaris 9 without a compiler. You don't get any compiler at all. You can download gcc for it and write applications. Sun doesn't use gcc to write Solaris, they use their own compiler. That compiler costs $500 IIRC. You can use gcc, or you can buy their compiler. The choice is yours.



    If Apple compiled Tiger with XLC, it would be 10-20% faster at everything right away. Instant speed boost with no negatives at all. No additional costs to end users. All positives, no negatives. XCode can use gcc, be free and still work fine. What, in this picture, is not to like?
  • Reply 19 of 68
    dave jdave j Posts: 84member
    Quote:

    Originally posted by cubist

    I If Apple compiled Tiger with XLC, it would be 10-20% faster at everything right away.



    You seem pretty sure of the numbers. What chance - and I speak as a strict non-programmer - is there for decompilation back to high level and then recompilation with XLC? If zero, I assume getting a copy of Tiger in C++ or whatever it's written in is also zero?
  • Reply 20 of 68
    I thought Apple used AIX for their compiler? As do the few big companies able to afford it; Adobe, and Microsoft.



    Of course last time I remember reading about was a couple of years ago so I suppose they could have switched?



    They should always compile with the fastest possible compiler because it does make a huge speed difference and Window compilers are better. i.e. assuming a 1 GHz G4 is equal to to a 1 GHz P3 in all respects the G4 would wind up around 70%-80% of the speed in actually running stuff due to inferior compilers.
Sign In or Register to comment.