Topic
7 replies Latest Post - ‏2011-04-22T17:24:37Z by SystemAdmin
SystemAdmin
SystemAdmin
706 Posts
ACCEPTED ANSWER

Pinned topic Power Assembly

‏2011-04-22T11:02:26Z |
Hi,

Its my first time posting in an IBM forum. I dont know If it goes here so apologies if Im wrong.

Well, Im starting using Linux under Power architecture but Im confused about which software use. I have GCC but want to try other toolkits to know more. So

1) Is there any opensource version of the XL C/C++ compiler for Power? Or any good Power compiler (well optimized for this architecture)?

2) I also have been looking for Power assembler (but not the GNU As). I have seen the AIX Assembler but as far as I know It comes with AIX, which I have to pay for. Its a little bit confusing going around IBM website for the amount of info you can find so I havent found anything better. Does IBM provide a Linux Power Assembler for free?

Just wanna say thanks if anybody can help me. I have been almost 2 months looking for this info and never found it and I finally found this forum.

Regards!
Updated on 2011-04-22T17:24:37Z at 2011-04-22T17:24:37Z by SystemAdmin
  • jscheel
    jscheel
    31 Posts
    ACCEPTED ANSWER

    Re: Power Assembly

    ‏2011-04-22T12:07:32Z  in response to SystemAdmin
    You've come to the correct place, Farresito, and brought a great question. Thanks.

    You are correct that there are a couple choices of compilers for Linux on Power. Before I help with your decision, let me summarize the list of choices one practically has:

    1. The gnu compilers provided with the Linux distribution. These compilers generally provide very good performance on Linux for Power. However, one needs to remember that they are forked from mainline FSF at the beginning of the major release and only minor updates are applied during the lifecycle of that release. This means that old versions of Linux operating systems (RHEL 5 and SLES 10) will have older compilers than the newer operating systems (RHEL 6 and SLES 11). Depending on the target system type, this may or may not make a difference. For example, using a SLES 10 compiler on a POWER6 system will give pretty good performance while using it on the newer POWER7 system will likely miss hardware specific features for the new architecture since the compiler pre-dates the hardware.

    2. The gnu compilers provided by IBM. IBM's Linux Technology Center has bundled and tested a set of gnu tools (compilers, libraries, etc.) that provide the latest compiler versions (not yet available from the distributions, but upstream in the FSF development trees) and the traditional open source tools -- gcc, glibc, gdb, oprofile, valgrind. We call this our Advanced Toolchain. It can be put on your system, used along with the distribution provided tools, and then removed if not needed. Further, IBM provides support under our standard Linux support contract for these compilers just as if they came with the distribution. If you are looking for the best performing open source compilers for Power, I suggest that you look into these. The most recent version of Advanced Toolchain is 4.0 and we've documented the basics on it's use (http://www.ibm.com/developerworks/wikis/display/hpccentral/How+to+use+Advance+Toolchain+for+Linux+on+POWER). We've done some comparisons of AT 3.0 to the distribution compilers you might find interesting (https://www.ibm.com/developerworks/wikis/display/LinuxP/Advance+Toolchain+3.0+performance+improvements).

    3. The Rational Compilers for Power. IBM also has the XL compilers for Power which support both AIX and Linux (http://www-01.ibm.com/software/awdtools/xlcpp/). These compilers provide optimization levels (-O4 and -O5) not obtainable with gnu compilers. Use of them greatly facilitates common source between AIX and Linux on Power. They do not support Linux on Intel. Some compatibility with gcc syntax exists, but may not support all compiler intrinsics.

    The way I help people select which compiler to use is a simple question: What is the heritage and long range plans for the application you're using? If you trying to leverage Linux for its value of single source, multiple platform support, then you should use the gnu compilers. If you are simply looking for an application that goes between AIX and Linux on the Power platform or if you are willing to invest in source code changes to obtain the last possible bit of performance from an application, then the IBM XL compilers are recommended.

    I hope that helps. Happy compiling! Feel free to post more questions as needed.
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: Power Assembly

    ‏2011-04-22T12:13:06Z  in response to SystemAdmin
    This is the place to ask.

    • fwiw.. There is work going on to make information about Linux on Power more accessible. Several LTC teams leverage the DeveloperWorks wiki pages for information, but in general we find that vehicle a little unwieldy, a bit messy to manage, and not particularly good at providing us feedback on usage. This Performance page is an example.

    For the compilers, starting with gcc is fine. gcc and XL C/C++ have similar performance characteristics for most people. gcc has an advantage of usage across architectures, IBM XL C/C++ has advantages in more aggressive optimizations available (-O4 and -O5).

    If you're leveraging the latest IBM Power7 systems, the latest distros are recommended: RHEL6 and SLES11sp1.

    There is a product called the Advance Toolchain on the Power systems which provides the latest gcc and toolchain components. An example write-up of the advantages are listed in this article.

    The IBM XL C/C++ compilers are the same compilers used across AIX, RedHat, and SLES operating systems. They are not available in open-source.

    A post later this morning is expected to address your question on the assembler.

    Feel free to ask more questions!
  • SystemAdmin
    SystemAdmin
    706 Posts
    ACCEPTED ANSWER

    Re: Power Assembly

    ‏2011-04-22T14:44:21Z  in response to SystemAdmin
    Well, first of all, thanks a lot for both answers. I didn't expected such a good response. You have been very clear. I think I will go for GNU Advance Toolchain because fits my needs. GNUs Optimization Levels are more than enough and XL Compiler is expensive for my needs.

    Just one question: Does XL Compiler come with an assembler? What about XL Assembler (if comes) with GNU Advance Toolchain's assembler? Are they both equivalent? Do they have the same performance/optimization? Because as far as I know it depends of if they are multi-passing, if they they shorten jumps... etc.

    Thanks a lot for your support. Its really awesome :)

    Regards!
    • SystemAdmin
      SystemAdmin
      706 Posts
      ACCEPTED ANSWER

      Re: Power Assembly

      ‏2011-04-22T15:45:50Z  in response to SystemAdmin
      +2) I also have been looking for Power assembler (but not the GNU As). +

      So just curious, why wouldn't the GNU assembler be used? The assembler should already have the Power support built-in. Is there something special you're trolling for?

      In the meantime, we've sent the question to the IBM compiler team. Seems to me they just use the assembler that comes with the system, but I don't know that for sure.
      • SystemAdmin
        SystemAdmin
        706 Posts
        ACCEPTED ANSWER

        Re: Power Assembly

        ‏2011-04-22T16:11:48Z  in response to SystemAdmin
        Thanks for the reply, Bill.

        I dont know why but always Im concerned about performance, but dont give it importance. Just stupid things I have in my head.

        For what I have found, It seems that Advance Toolchain comes with the GAS Assembler but XL Assembler was just curiosity. Its just curious to see only the AIX Assembler on the website and any assembler more.

        Regards!
    • bergner
      bergner
      1 Post
      ACCEPTED ANSWER

      Re: Power Assembly

      ‏2011-04-22T16:30:05Z  in response to SystemAdmin
      Your only choice of an assembler on Linux on Power that I know of is the GNU assembler. Although the XL compilers generate object files directly and have a builtin assembler, there is no way for you to access it that I know of. If you pass an assembler file to the XL compilers, it will just call the GNU assembler to assemble it for you. Why wouldn't you want to use the GNU assembler?

      As for your question about do they have the same performance/optimization, I have no idea what you are talking about. Can you explain. Normally, the assembler doesn't do any optimizations. Optimizations are done in the compiler and in some cases (eg, Large-TOC reference optimizations), in the linker.

      As for shortening jumps (ie, branches), the assembler has no idea how far a branch might or go. Only the linker knows that, and it is up to the linker to insert a trampoline in the case a single branch cannot reach its intended destination or a PLT call stub for a call to a shared library routine which could be a long way off.
      • SystemAdmin
        SystemAdmin
        706 Posts
        ACCEPTED ANSWER

        Re: Power Assembly

        ‏2011-04-22T17:24:37Z  in response to bergner
        Thanks for replying.

        As far as I know, an assembler not only converts the mnemonic code to the appropriate opcode but also tries to make the jumps shorter, does encoding... etc. So there are assemblers which shorten jumps better and all this stuff. Maybe Im wrong. Im not very good in theory so apologies if that is the case.

        So, I will definitely go for Advance Toolchain. It fits my needs.

        Thanks a lot for answering.