-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Open
Labels
clang-cl`clang-cl` driver. Don't use for other compiler parts`clang-cl` driver. Don't use for other compiler partsclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsdiverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue
Description
For example:
#include <immintrin.h>
__m128i f(__m128i a, __m128i b) {
return _mm_mullo_epi32(a, b); // SSE4.1 intrinsic
}
This builds using Microsoft's cl.
However, with clang-cl, we get: error: use of undeclared identifier '_mm_mullo_epi32'; did you mean '_mm_mullo_epi16'?
We can specify /arch:AVX to solve the problem. However, this means that the compiler is then free to use AVX instructions, which is not what we want if we want to only target SSE4.1. MSVC does not appear to have a /arch:SSE4.1 option: https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170.
We can specify /clang:-msse4.1 to solve the problem, but this means that clang-cl is not a clean replacement of cl.
Metadata
Metadata
Assignees
Labels
clang-cl`clang-cl` driver. Don't use for other compiler parts`clang-cl` driver. Don't use for other compiler partsclang:headersHeaders provided by Clang, e.g. for intrinsicsHeaders provided by Clang, e.g. for intrinsicsdiverges-from:msvcDoes the clang frontend diverge from msvc on this issueDoes the clang frontend diverge from msvc on this issue