Add x86 feature avx512 support for memcmpSmall. Co-authored-by: @vesslanjin jun.i.jin@intel.com

This commit is contained in:
hanqf-git 2022-01-17 16:13:49 +08:00
parent d2bc77ac47
commit 71ce4b46d8
2 changed files with 5 additions and 19 deletions

View File

@ -134,7 +134,7 @@ else ()
set (COMPILER_FLAGS "${COMPILER_FLAGS} ${TEST_FLAG}")
endif ()
set (TEST_FLAG "-mavx512f -mavx512bw")
set (TEST_FLAG "-mavx512f -mavx512bw -mavx512vl")
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG} -O0")
check_cxx_source_compiles("
#include <immintrin.h>
@ -143,6 +143,8 @@ else ()
(void)a;
auto b = _mm512_add_epi16(__m512i(), __m512i());
(void)b;
auto c = _mm_cmp_epi8_mask(__m128i(), __m128i(), 0);
(void)c;
return 0;
}
" HAVE_AVX512)
@ -150,20 +152,6 @@ else ()
set (COMPILER_FLAGS "${COMPILER_FLAGS} ${TEST_FLAG}")
endif ()
set (TEST_FLAG "-mavx512bw -mavx512vl")
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG} -O0")
check_cxx_source_compiles("
#include <immintrin.h>
int main() {
auto mask = _mm_cmp_epi8_mask(__m128i(), __m128i(), 0);
(void)mask;
return 0;
}
" HAVE_AVX512_BW_VL)
if (HAVE_AVX512_BW_VL AND ENABLE_AVX512)
set (COMPILER_FLAGS "${COMPILER_FLAGS} ${TEST_FLAG}")
endif ()
set (TEST_FLAG "-mbmi")
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG} -O0")
check_cxx_source_compiles("
@ -195,10 +183,7 @@ else ()
set (X86_INTRINSICS_FLAGS "${X86_INTRINSICS_FLAGS} -mbmi")
endif ()
if (HAVE_AVX512)
set (X86_INTRINSICS_FLAGS "${X86_INTRINSICS_FLAGS} -mavx512f -mavx512bw -mprefer-vector-width=256")
endif ()
if (HAVE_AVX512_BW_VL)
set (X86_INTRINSICS_FLAGS "${X86_INTRINSICS_FLAGS} -mavx512bw -mavx512vl")
set (X86_INTRINSICS_FLAGS "${X86_INTRINSICS_FLAGS} -mavx512f -mavx512bw -mavx512vl -mprefer-vector-width=256")
endif ()
endif ()
endif ()

View File

@ -304,6 +304,7 @@ set_source_files_properties(
Columns/ColumnsCommon.cpp
Columns/ColumnVector.cpp
Columns/ColumnDecimal.cpp
Columns/ColumnString.cpp
PROPERTIES COMPILE_FLAGS "${X86_INTRINSICS_FLAGS}")
if(RE2_LIBRARY)