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

            Bug ID: 28963
           Summary: AVX512: Update __vectorcall calling conventions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: wenzel.ja...@epfl.ch
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Clang supports the __vectorcall calling convention which can be used to
directly invoke functions which accept SIMD vectors in registers. This works
great for SSE and AVX vectors, but it looks like the calling convention wasn't
yet updated to the new AVX512 512 bit vectors:

Consider the following simple passthrough functions:

struct Wrapper256 { __m256 x; };
struct Wrapper512 { __m512 x; };

Wrapper256 __vectorcall test1(Wrapper256 x) { return x; }
Wrapper512 __vectorcall test2(Wrapper512 x) { return x; }

Using Clang trunk (clang -O3 -mavx512f -fomit-frame-pointer test.cpp -S), this
assembles to:

__Z4add110Wrapper256:                   ## @_Z4add110Wrapper256
    retq

__Z4add210Wrapper512:                   ## @_Z4add210Wrapper512
    pushq    %rbp
    movq    %rsp, %rbp
    andq    $-64, %rsp
    subq    $64, %rsp
    vmovaps    16(%rbp), %ymm0
    vmovaps    48(%rbp), %ymm1
    vmovaps    %ymm1, 32(%rdi)
    vmovaps    %ymm0, (%rdi)
    movq    %rdi, %rax
    movq    %rbp, %rsp
    popq    %rbp
    retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to