<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - vget_lane_p64 triggers -Wvector-conversion diagnostic"
   href="https://bugs.llvm.org/show_bug.cgi?id=48257">48257</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>vget_lane_p64 triggers -Wvector-conversion diagnostic
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>clang@evan.coeusgroup.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>vget_lane_p64 is defined in arm_neon.h as:

  #define vget_lane_p64(__p0, __p1) __extension__ ({ \
    poly64x1_t __s0 = __p0; \
    poly64_t __ret; \
    __ret = (poly64_t) __builtin_neon_vget_lane_i64((poly64x1_t)__s0, __p1); \
    __ret; \
  })

Note the cast on the first argument to __builtin_neon_vget_lane_i64;
vget_lane_i64 takes an int64x1_t, not a poly64x1_t, so code which calls this
macro ends up emitting a -Wvector-conversion diagnostic:

  error: incompatible vector types passing 'poly64x1_t' (vector of 1 'poly64_t'
value) to parameter of type '__attribute__((__vector_size__(1 * sizeof(long))))
long' (vector of 1 'long' value) [-Werror,-Wvector-conversion]

For an example, you can use:

  #include <arm_neon.h>

  poly64_t foo (poly64x1_t v);

  poly64_t
  foo (poly64x1_t v) {
    return vget_lane_p64(v, 0);
  }

Or, on Compiler Explorer: <a href="https://godbolt.org/z/GWf6fq">https://godbolt.org/z/GWf6fq</a>

It looks like this is a problem on all the vget*_lane_p64 functions.</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>