[llvm-bugs] [Bug 38923] New: _mm_insert_epi16 passes int to signature taking short
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Sep 13 02:01:25 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38923
Bug ID: 38923
Summary: _mm_insert_epi16 passes int to signature taking short
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: steveire at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Given
$ type ..\simplemain.cpp
#include <intrin.h>
int main(int argc, char**)
{
__m128i mask = _mm_insert_epi16(__m128i{}, 0x8000, 0x1);
return 0;
}
I get:
$ "C:\\dev\\src\\llvm\\build\\releaseprefix\\bin\\clang.exe" -cc1 -I
"C:\\dev\\src\\llvm\\build\\releaseprefix\\lib\\clang\\8.0.0\\include"
-internal-isystem "C:\\Program Files (x86)\\Microsoft Visual
Studio\\Preview\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\include"
-internal-isystem "C:\\Program Files (x86)\\Windows
Kits\\10\\Include\\10.0.17134.0\\ucrt" -fms-compatibility
-fms-compatibility-version=19.15 -x c++ "..\\simplemain.cpp"
..\\simplemain.cpp:5:20: warning: implicit conversion from 'int' to 'short'
changes value from 32768 to -32768
__m128i mask = _mm_insert_epi16(__m128i{}, 0x8000, 0x1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\\dev\\src\\llvm\\build\\releaseprefix\\lib\\clang\\8.0.0\\include\emmintrin.h:4297:62:
note: expanded from macro '_mm_insert_epi16'
(__m128i)__builtin_ia32_vec_set_v8hi((__v8hi)(__m128i)(a), (int)(b), \
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~
1 warning generated.
This warning gets emitted a lot when using clang-tidy, which invokes the
compiler directly. I can silence it by using `-isystem`, but the warning seems
to be legitimate. `_mm_insert_epi16` accepts an integer and casts it to `int`
in the call to `__builtin_ia32_vec_set_v8hi`, but `__builtin_ia32_vec_set_v8hi`
takes a short at that position.
--
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/20180913/c6202398/attachment.html>
More information about the llvm-bugs
mailing list