diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-02-12 14:26:00 +0000 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-03-05 11:36:40 +0000 |
commit | 6ec1ca7c85a4009b77e149a798a331592b96ea42 (patch) | |
tree | c86c571afca06bfe63bc30a90d46f0c2ae157310 /configure.ac | |
parent | 2b260eadf7960290328e13dbdb029fd506105ca4 (diff) |
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.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 4f71515873..2c73e0920c 100644 --- a/configure.ac +++ b/configure.ac @@ -504,11 +504,12 @@ TEMP_CXXFLAGS="$CXXFLAGS" CXXFLAGS="$SSE41_CXXFLAGS $CXXFLAGS" AC_MSG_CHECKING([for SSE4.1 intrinsics]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <stdint.h> #include <immintrin.h> ]],[[ - __m128i l = _mm_set1_epi32(0); - return _mm_extract_epi32(l, 3); + __m128i a = _mm_set1_epi32(0); + __m128i b = _mm_set1_epi32(1); + __m128i r = _mm_blend_epi16(a, b, 0xFF); + return _mm_extract_epi32(r, 3); ]])], [ AC_MSG_RESULT([yes]); enable_sse41=yes; AC_DEFINE([ENABLE_SSE41], [1], [Define this symbol to build code that uses SSE4.1 intrinsics]) ], [ AC_MSG_RESULT([no])] |