File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,14 @@ bool X86TargetInfo::initFeatureMap(
157157 if (getTriple ().getArch () == llvm::Triple::x86_64)
158158 setFeatureEnabled (Features, " sse2" , true );
159159
160+ // Enable SSE4.1 for Windows MSVC targets to support SIMD intrinsics like
161+ // _mm_mullo_epi32 without requiring explicit /arch: flags.
162+ if ((getTriple ().getArch () == llvm::Triple::x86_64 ||
163+ getTriple ().getArch () == llvm::Triple::x86) &&
164+ getTriple ().isWindowsMSVCEnvironment ()) {
165+ setFeatureEnabled (Features, " sse4.1" , true );
166+ }
167+
160168 using namespace llvm ::X86;
161169
162170 SmallVector<StringRef, 16 > CPUFeatures;
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -x c -triple i386-pc-windows-msvc -fsyntax-only %s
2+ // RUN: %clang_cc1 -x c -triple x86_64-pc-windows-msvc -fsyntax-only %s
3+ // RUN: %clang_cc1 -x c -triple i386-unknown-linux-gnu -fsyntax-only %s
4+ // RUN: %clang_cc1 -x c -triple x86_64-unknown-linux-gnu -fsyntax-only %s
5+
6+ // This test verifies that SSE4.1 intrinsics are available by default
7+ // without requiring explicit /arch: or -msse4.1 flags.
8+
9+ #include <immintrin.h>
10+
11+ void test_sse41_intrinsics (void ) {
12+ __m128i a = _mm_set1_epi32 (1 );
13+ __m128i b = _mm_set1_epi32 (2 );
14+ __m128i result = _mm_mullo_epi32 (a , b );
15+ (void )result ;
16+ }
You can’t perform that action at this time.
0 commit comments