<div dir="ltr"><div><div><div>Hi Chris,<br><br>I think it is hard to find a real authoritative documentation for this convention. But GCC itself provides the option &#39; -mxl-compat/-mno-xl-compat&#39; [1]) (was &#39;-mxl-call/-mno-xl-call in older GCC versions prior to 3.4 [2]) which state:<br>
<br>...<br>Produce code that conforms more closely to IBM XL compiler semantics when using AIX-compatible ABI.  <b>Pass floating-point arguments to prototyped functions beyond the register save area (RSA) on the stack in addition to argument FPRs</b>. Do not assume that most significant double in 128-bit long double value is properly rounded when comparing values and converting to double.  Use XL symbol names for long double support routines.<br>
<br><b>The AIX calling convention was extended but not initially documented to handle an obscure K&amp;R C case of calling a function that takes the address of its arguments with fewer arguments than declared.  IBM XL compilers access floating point arguments which do not fit in the RSA from the stack when a subroutine is compiled without optimization</b>. Because always storing floating-point arguments on the stack is inefficient and rarely needed, this option is not enabled by default and only is necessary when calling subroutines compiled by IBM XL compilers without optimization.<span class=""></span><span class=""></span><br>
...<br><br></div>I think that&#39;s basically the reason why we&#39;ve adapted the calling conventions as well in order to be on the safe side:)<br><br></div>Regards,<br></div>Volker<br><br>[1] <a href="http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/RS_002f6000-and-PowerPC-Options.html">http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/RS_002f6000-and-PowerPC-Options.html</a><br>
[2] <a href="http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/RS_002f6000-and-PowerPC-Options.html">http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/RS_002f6000-and-PowerPC-Options.html</a><br><br></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Mon, Sep 9, 2013 at 9:26 PM, Chris Plummer <span dir="ltr">&lt;<a href="mailto:chris.plummer@oracle.com" target="_blank">chris.plummer@oracle.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hi Goetz,<br>
      <br>
      From what I&#39;ve read of both 32-bit and 64-bit PPC calling
      conventions, arguments passed in registers are not also placed on
      the stack.<br>
      <br>
<a href="http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#PARAM-PASS" target="_blank">http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#PARAM-PASS</a><br>
      <br>
      Can you please explain when you think an FP argument can end up
      both in a register and on the stack? Is there some supporting
      documentation for this?<br>
      <br>
      thanks,<br>
      <br>
      Chris<div><div class="h5"><br>
      <br>
      On 9/9/13 2:41 AM, Lindenmaier, Goetz wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      
      
      
      <div>
        <p class="MsoNormal"><span lang="EN-US">Hi,<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">On PPC, the first 13
            floating point arguments are passed in<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">floating point
            registers. Also, all but the first 8 arguments<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">are passed on the stack.
            So there can be floating point<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">arguments that are
            passed on the stack and in a register.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">This change adapts the
            c_calling_conventions() to this.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">We duplicate the regs
            datastructure passed to c_calling_convention().<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">This change adapts all
            the signatures of this function, which is
            <u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">defined in a shared
            file, but implemented platform dependent.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">How we use this can be
            seen in the ppc64 sharedRuntime file in
            <u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">function
            c_calling_convention() and the stub generators.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><a href="http://hg.openjdk.java.net/ppc-aix-port/stage/hotspot/file/bdd155477289/src/cpu/ppc/vm/sharedRuntime_ppc.cpp" target="_blank">http://hg.openjdk.java.net/ppc-aix-port/stage/hotspot/file/bdd155477289/src/cpu/ppc/vm/sharedRuntime_ppc.cpp</a><u></u><u></u></span></p>

        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Please review and test
            this change.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><a href="http://cr.openjdk.java.net/%7Egoetz/webrevs/8024344-stackArg/" target="_blank">http://cr.openjdk.java.net/~goetz/webrevs/8024344-stackArg/</a><u></u><u></u></span></p>

        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">Best regards,<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US">  Goetz.<u></u><u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
      </div>
    </blockquote>
    <br>
  </div></div></div>


</blockquote></div><br></div>