[llvm-bugs] [Bug 39501] New: Unsupported vector mode is passed incorrectly

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 30 08:58:38 PDT 2018


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

            Bug ID: 39501
           Summary: Unsupported vector mode is passed incorrectly
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: hjl.tools at gmail.com
                CC: llvm-bugs at lists.llvm.org

[hjl at gnu-cfl-1 tmp]$ cat x.c
typedef int __attribute__((mode(QI))) qi;
typedef qi __attribute__((vector_size (32))) v32qi;

v32qi foo (int x)
{
 v32qi y = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',
         '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
 return y;
}
[hjl at gnu-cfl-1 tmp]$ clang -mno-avx -S -O2 x.c


        movaps  .LCPI0_0(%rip), %xmm0   # xmm0 =
[48,49,50,51,52,53,54,55,56,57,97,98,99,100,101,102]
        movaps  %xmm0, %xmm1
        retq

-mno-avx should pass v32qi as before AVX was enabled.  For example,

[hjl at gnu-cfl-1 tmp]$ cat z.c
typedef int __attribute__((mode(SI))) si;
typedef si __attribute__((vector_size (128))) v;

v
foo (int x)
{
 v y = {'0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f',
         '0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'};
 return y;
}
[hjl at gnu-cfl-1 tmp]$ clang -S -O2 z.c
...
        movaps  .LCPI0_0(%rip), %xmm0   # xmm0 = [99,100,101,102]
        movaps  %xmm0, 112(%rdi)
        movaps  .LCPI0_1(%rip), %xmm1   # xmm1 = [56,57,97,98]
        movaps  %xmm1, 96(%rdi)
        movaps  .LCPI0_2(%rip), %xmm2   # xmm2 = [52,53,54,55]
        movaps  %xmm2, 80(%rdi)
        movaps  .LCPI0_3(%rip), %xmm3   # xmm3 = [48,49,50,51]
        movaps  %xmm3, 64(%rdi)
        movaps  %xmm0, 48(%rdi)
        movaps  %xmm1, 32(%rdi)
        movaps  %xmm2, 16(%rdi)
        movaps  %xmm3, (%rdi)
        movq    %rdi, %rax
        retq

If there were AVX1024, clang would have passed y in vector register. When
AVX1024 were disabled, clang would have passed y in memory and issued an
ABI change warning.

-- 
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/20181030/322f0089/attachment.html>


More information about the llvm-bugs mailing list