[llvm-bugs] [Bug 48797] New: armv7 neon inline assembly parameter passing results in invalid assembly

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 18 21:02:12 PST 2021


            Bug ID: 48797
           Summary: armv7 neon inline assembly parameter passing results
                    in invalid assembly
           Product: new-bugs
           Version: 11.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: bero at lindev.ch
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24397
  --> https://bugs.llvm.org/attachment.cgi?id=24397&action=edit
test case

Building the following test code (also attached):

#include <arm_neon.h>

void test() {
    int32x4_t sv0;
    int x;

    __asm__ __volatile__ (
        "vld1.s32 %h[sv0], [%[lin0]]"
        : [sv0] "=w" (sv0)
        : [lin0] "r" (x)

on armv7hnl with clang results in a blank first parameter to vld1.s32:

$ clang -mfpu=neon-vfpv4 -o test.o -c test.c 
test.c:9:9: error: invalid operand in inline asm: 'vld1.s32 ${0:h}, [$1]'
        "vld1.s32 %h[sv0], [%[lin0]]"
test.c:9:9: error: unexpected token in operand
<inline asm>:1:11: note: instantiated into assembly here
        vld1.s32 , [r0]
2 errors generated.

Building the same code with gcc works as expected.:

$ gcc -mfpu=neon-vfpv4 -o test.o -c test.c
$ objdump -D test.o
00000000 <test>:
   0:   f84d 7d04       str.w   r7, [sp, #-4]!
   4:   b087            sub     sp, #28
   6:   af00            add     r7, sp, #0
   8:   697b            ldr     r3, [r7, #20]
   a:   f963 0a8f       vld1.32 {d16-d17}, [r3]
   e:   f947 0adf       vst1.64 {d16-d17}, [r7 :64]
  12:   bf00            nop
  14:   f107 071c       add.w   r7, r7, #28
  18:   46bd            mov     sp, r7
  1a:   f85d 7b04       ldr.w   r7, [sp], #4
  1e:   4770            bx      lr

The code is extracted from pulseaudio 14.2.

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/20210119/74ca8453/attachment.html>

More information about the llvm-bugs mailing list