[llvm-bugs] [Bug 35360] New: [GlobalISel][AArch64] Calling convention for vectors incorrect on big-endian targets

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Nov 20 03:00:59 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35360

            Bug ID: 35360
           Summary: [GlobalISel][AArch64] Calling convention for vectors
                    incorrect on big-endian targets
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: GlobalISel
          Assignee: unassignedbugs at nondot.org
          Reporter: oliver.stannard at arm.com
                CC: llvm-bugs at lists.llvm.org

Global-isel generates incorrect code when targeting big-endian AArch64 for this
code:
  #include <arm_neon.h>
  int32x2_t load_vector(int32x2_t *p) {
    return *p;
  }

Global-isel generates this:
  // armclang --target=aarch64-arm-none-eabi -march=armv8-a -c callees.cpp -O0
-Wall -std=c++11 -mllvm -global-isel=true -mllvm -global-isel-abort=0
-mbig-endian -o - -S
  _Z11load_vectorP11__Int32x2_t:          // @_Z11load_vectorP11__Int32x2_t
  // BB#0:                                // %entry
          sub     sp, sp, #16             // =16
          str     x0, [sp, #8]
          ldr     x0, [sp, #8]
          ld1     { v0.2s }, [x0]
          add     sp, sp, #16             // =16
          ret

With global-isel off, there is a rev64 instruction between the ld1 and the add,
which fixes up the endianness of the vector.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171120/1973b97f/attachment.html>


More information about the llvm-bugs mailing list