<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [GlobalISel][AArch64] Calling convention for HFAs incorrect on big-endian targets"
   href="https://bugs.llvm.org/show_bug.cgi?id=35359">35359</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[GlobalISel][AArch64] Calling convention for HFAs incorrect on big-endian targets
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>GlobalISel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>oliver.stannard@arm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Global-isel generates incorrect code when targeting big-endian AArch64 for this
code:
  struct foo {
    float first;
    float second;
  };
  float get_first(foo p) {
    return p.first;
  }

This is the code that global-isel currently generates:
  // /work/llvm/build/bin/clang --target=aarch64--none-eabi -march=armv8-a -c
callees.cpp -O0 -mllvm -global-isel=true -mllvm -global-isel-abort=0
-mbig-endian -o - -S
  _Z9get_first3foo:                       // @_Z9get_first3foo
  // BB#0:                                // %entry
          sub     sp, sp, #16             // =16
                                          // implicit-def: %X8
          fmov    w9, s0
          mov     w10, w9
          bfxil   x8, x10, #0, #32
          fmov    w9, s1
          mov     w10, w9
          bfi     x8, x10, #32, #32
          add     x10, sp, #8             // =8
          str     x8, [sp, #8]
          ldr     w9, [x10]
          fmov    s0, w9
          add     sp, sp, #16             // =16
          ret

When run on a big-endian target, this incorrectly returns the second member of
the struct, instead of the first.</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>