Commit dfd0c672 authored by Xiang Li's avatar Xiang Li

Add sse42 folder for _mm_crc32_u16 and remove duplicated files in folder avx2 and avx

parent b5069b9e
......@@ -27,6 +27,9 @@ file( GLOB AVX2_SRC_FILES "../CommonLib/x86/avx2/*.cpp" )
# get sse4.1 source files
file( GLOB SSE41_SRC_FILES "../CommonLib/x86/sse41/*.cpp" )
# get sse4.2 source files
file( GLOB SSE42_SRC_FILES "../CommonLib/x86/sse42/*.cpp" )
# get libmd5 source files
file( GLOB MD5_SRC_FILES "../libmd5/*.cpp" )
......@@ -35,7 +38,7 @@ file( GLOB MD5_INC_FILES "../libmd5/*.h" )
# get all source files
set( SRC_FILES ${BASE_SRC_FILES} ${X86_SRC_FILES} ${SSE41_SRC_FILES} ${AVX_SRC_FILES} ${AVX2_SRC_FILES} ${MD5_SRC_FILES} )
set( SRC_FILES ${BASE_SRC_FILES} ${X86_SRC_FILES} ${SSE41_SRC_FILES} ${SSE42_SRC_FILES} ${AVX_SRC_FILES} ${AVX2_SRC_FILES} ${MD5_SRC_FILES} )
# get all include files
set( INC_FILES ${BASE_INC_FILES} ${X86_INC_FILES} ${MD5_INC_FILES} )
......@@ -86,6 +89,7 @@ target_link_libraries( ${LIB_NAME} Threads::Threads )
# set needed compile definitions
set_property( SOURCE ${SSE41_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_SSE41 )
set_property( SOURCE ${SSE42_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_SSE42 )
set_property( SOURCE ${AVX_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_AVX )
set_property( SOURCE ${AVX2_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_AVX2 )
# set needed compile flags
......@@ -94,6 +98,7 @@ if( MSVC )
set_property( SOURCE ${AVX2_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" )
elseif( UNIX )
set_property( SOURCE ${SSE41_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" )
set_property( SOURCE ${SSE42_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-msse4.2" )
set_property( SOURCE ${AVX_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-mavx" )
set_property( SOURCE ${AVX2_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-mavx2" )
endif()
......
......@@ -24,6 +24,9 @@ file( GLOB AVX_SRC_FILES "x86/avx/*.cpp" )
# get avx2 source files
file( GLOB AVX2_SRC_FILES "x86/avx2/*.cpp" )
# get sse4.2 source files
file( GLOB SSE42_SRC_FILES "x86/sse42/*.cpp" )
# get sse4.1 source files
file( GLOB SSE41_SRC_FILES "x86/sse41/*.cpp" )
......@@ -35,7 +38,7 @@ file( GLOB MD5_INC_FILES "../libmd5/*.h" )
# get all source files
set( SRC_FILES ${BASE_SRC_FILES} ${X86_SRC_FILES} ${SSE41_SRC_FILES} ${AVX_SRC_FILES} ${AVX2_SRC_FILES} ${MD5_SRC_FILES} )
set( SRC_FILES ${BASE_SRC_FILES} ${X86_SRC_FILES} ${SSE41_SRC_FILES} ${SSE42_SRC_FILES} ${AVX_SRC_FILES} ${AVX2_SRC_FILES} ${MD5_SRC_FILES} )
# get all include files
set( INC_FILES ${BASE_INC_FILES} ${X86_INC_FILES} ${MD5_INC_FILES} )
......@@ -85,6 +88,7 @@ target_link_libraries( ${LIB_NAME} Threads::Threads )
# set needed compile definitions
set_property( SOURCE ${SSE41_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_SSE41 )
set_property( SOURCE ${SSE42_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_SSE42 )
set_property( SOURCE ${AVX_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_AVX )
set_property( SOURCE ${AVX2_SRC_FILES} APPEND PROPERTY COMPILE_DEFINITIONS USE_AVX2 )
# set needed compile flags
......@@ -93,6 +97,7 @@ if( MSVC )
set_property( SOURCE ${AVX2_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "/arch:AVX2" )
elseif( UNIX )
set_property( SOURCE ${SSE41_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-msse4.1" )
set_property( SOURCE ${SSE42_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-msse4.2" )
set_property( SOURCE ${AVX_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-mavx" )
set_property( SOURCE ${AVX2_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-mavx2" )
endif()
......
......@@ -176,13 +176,14 @@ void AdaptiveLoopFilter::initAdaptiveLoopFilterX86()
void IbcHashMap::initIbcHashMapX86()
{
auto vext = read_x86_extension_flags();
switch (vext) {
switch (vext)
{
case AVX512:
case AVX2:
_initIbcHashMapX86<AVX2>();
case AVX:
_initIbcHashMapX86<AVX>();
case SSE42:
_initIbcHashMapX86<SSE42>();
break;
case SSE41:
default:
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment