Skip to content

Commit 6ec1ca7

Browse files
committed
build: Fix test for SSE4.1 intrinsics
This change uses the `_mm_blend_epi16` SSE4.1 function used in our code and fixes false-positive cases, for example, when CXXFLAGS="-mno-sse4.1" provided.
1 parent 2b260ea commit 6ec1ca7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

configure.ac

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,12 @@ TEMP_CXXFLAGS="$CXXFLAGS"
504504
CXXFLAGS="$SSE41_CXXFLAGS $CXXFLAGS"
505505
AC_MSG_CHECKING([for SSE4.1 intrinsics])
506506
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
507-
#include <stdint.h>
508507
#include <immintrin.h>
509508
]],[[
510-
__m128i l = _mm_set1_epi32(0);
511-
return _mm_extract_epi32(l, 3);
509+
__m128i a = _mm_set1_epi32(0);
510+
__m128i b = _mm_set1_epi32(1);
511+
__m128i r = _mm_blend_epi16(a, b, 0xFF);
512+
return _mm_extract_epi32(r, 3);
512513
]])],
513514
[ AC_MSG_RESULT([yes]); enable_sse41=yes; AC_DEFINE([ENABLE_SSE41], [1], [Define this symbol to build code that uses SSE4.1 intrinsics]) ],
514515
[ AC_MSG_RESULT([no])]

0 commit comments

Comments
 (0)