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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to