<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 --- - _mm512_mask_i64gather_ps has incorrect signature"
   href="https://llvm.org/bugs/show_bug.cgi?id=31329">31329</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>_mm512_mask_i64gather_ps has incorrect signature
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>Headers
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@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>Hi,

according to Intel, the intrinsic has the following signature.

__m256 _mm512_mask_i64gather_ps (__m256 src, __mmask8 k, __m512i vindex, void
const* base_addr, int scale)

In particular, note that a void const * pointer is accepted for the 'base_addr'
argument.

However, in avf512intri.h we have

 8182 #define _mm512_i64gather_ps(index, addr, scale) __extension__ ({ \
 8183   (__m256)__builtin_ia32_gatherdiv16sf((__v8sf)_mm256_undefined_ps(), \
 8184                                        (float const *)(addr), \
 8185                                        (__v8di)(__m512i)(index),
(__mmask8)-1, 
 8186                                        (int)(scale)); })
 8187
 8188 #define _mm512_mask_i64gather_ps( __v1_old, __mask, __index,\
 8189                                   __addr, __scale) __extension__({\
 8190 __builtin_ia32_gatherdiv16sf ((__v8sf) __v1_old,\
 8191                               __addr,(__v8di) __index, __mask, __scale);\
 8192 })

Note how the _mm512_i64gather_ps intrinsic casts the argument to float const*,
while the _mm512_mask_i64gather_ps intrinsic does not.

In practice, this means that Clang quits with an type checker error message
when trying to invoke _mm512_mask_i64gather_ps with a void const* argument.

It would be great if this could be fixed!

Thanks,
Wenzel</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>