[llvm-bugs] [Bug 44589] New: _mm_extract_pi16 and _mm_insert_pi16 warn with -Wvector-conversion

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 19 08:49:54 PST 2020


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

            Bug ID: 44589
           Summary: _mm_extract_pi16 and _mm_insert_pi16 warn with
                    -Wvector-conversion
           Product: clang
           Version: 9.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: clang at evan.coeusgroup.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 23032
  --> https://bugs.llvm.org/attachment.cgi?id=23032&action=edit
Patch to cast the vectors to __v4hi

When using either _mm_extract_pi16 or _mm_insert_pi16 with the
-Wvector-conversion warning enabled, clang will emit a diagnostic since the
builtins used by both functions expect a vector of 4 shorts, but __m64 is a
vector of 1 long long.

Here is a trivial test case:

  #include <xmmintrin.h>

  int16_t extract(__m64 a) {
    return _mm_extract_pi16(a, 0);
  }

  __m64 insert(__m64 a, int d) {
    return _mm_insert_pi16(a, d, 0);
  }

A patch to simply cast the vectors to __v4hi instead of __m64 (which works for
me) is attached.

-- 
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/20200119/bfea0f67/attachment.html>


More information about the llvm-bugs mailing list