[llvm-bugs] [Bug 28963] New: AVX512: Update __vectorcall calling conventions

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Aug 13 05:16:02 PDT 2016


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: unassignedbugs at nondot.org
          Reporter: wenzel.jakob at epfl.ch
                CC: llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160813/c87c7c59/attachment-0001.html>


More information about the llvm-bugs mailing list