<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - ABI incompatibilities between Clang and GCC (calling conventions for AVX512 vector arguments)"
   href="https://llvm.org/bugs/show_bug.cgi?id=28975">28975</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ABI incompatibilities between Clang and GCC (calling conventions for AVX512 vector arguments)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>wenzel.jakob@epfl.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Consider the following simple program:

------------------------

#include <immintrin.h>

float test_float(float x)    { return x; }
double test_double(double x) { return x; }

__m128 test_m128(__m128 x)   { return x; }
__m256 test_m256(__m256 x)   { return x; }
__m512 test_m512(__m512 x)   { return x; }

------------------------

GCC trunk compiles this to the following optimized assembly (labels stripped
away for readability):

$ gcc test.c -O3 -Wall -Wabi -mavx512f -fomit-frame-pointer -o - -S

_test_f1:
    ret
_test_f4:
    ret
_test_f8:
    ret
_test_f16:
    ret

In other words, everything is passed via registers. On the other hand, clang
uses registers for everything *except* AVX512 SIMD registers:

$ clang test.c -O3 -Wall -Wabi -mavx512f -fomit-frame-pointer -o - -S

_test_f1:
    retq

_test_f4:
    retq

_test_f8:
    retq

_test_f16:
    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

It would be desirable if Clang would match GCC's behavior here.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>