<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:manojgupta@google.com" title="Manoj Gupta <manojgupta@google.com>"> <span class="fn">Manoj Gupta</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - ARM: Builtins should use AAPCS ABI for non-windows platforms"
   href="https://bugs.llvm.org/show_bug.cgi?id=33030">bug 33030</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>INVALID
           </td>
           <td>---
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>RESOLVED
           </td>
           <td>REOPENED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - ARM: Builtins should use AAPCS ABI for non-windows platforms"
   href="https://bugs.llvm.org/show_bug.cgi?id=33030#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - ARM: Builtins should use AAPCS ABI for non-windows platforms"
   href="https://bugs.llvm.org/show_bug.cgi?id=33030">bug 33030</a>
              from <span class="vcard"><a class="email" href="mailto:manojgupta@google.com" title="Manoj Gupta <manojgupta@google.com>"> <span class="fn">Manoj Gupta</span></a>
</span></b>
        <pre>Please note that I am referring only to builtins (__aeabi_* functions generally
provided in libgcc) that need aapcs ABI.
Other functions can use aapcs_vfp ABI, just not these builtins.

Here is an example to illustrate it.

$ cat arm_dltoul.c 
unsigned long long convert(double a) {
  return (unsigned long long)a;
}

$ bin/clang -target armv7a-unknown-linux-gnueabihf arm_dltoul.c -c -O2

$ objdump -d arm_dltoul.o 

arm_dltoul.o:     file format elf32-littlearm

Disassembly of section .text:

00000000 <convert>: // Convert function itself uses aapcs_vfp ABI. Arg is in d0
   0:   e92d4800        push    {fp, lr}
   4:   e1a0b00d        mov     fp, sp
   8:   ec510b10        vmov    r0, r1, d0 // d0 is moved to r0 and r1
   c:   ebfffffe        bl      0 <__aeabi_d2ulz> // __aebi_d2ulz expects args
in r0 and r1 using AAPCS ABI.
  10:   e8bd8800        pop     {fp, pc}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>