|
|
@ -203,16 +203,25 @@ else() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
include(CheckCCompilerFlag) |
|
|
|
include(CheckCCompilerFlag) |
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") |
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") |
|
|
|
|
|
|
|
CHECK_C_COMPILER_FLAG("-mcpu=power9" HAS_POWER9) |
|
|
|
|
|
|
|
if(HAS_POWER9) |
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=power9 -mtune=power9") |
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power9 -mtune=power9") |
|
|
|
|
|
|
|
else() |
|
|
|
|
|
|
|
CHECK_C_COMPILER_FLAG("-mcpu=power8" HAS_POWER8) |
|
|
|
|
|
|
|
if(HAS_POWER8) |
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=power8 -mtune=power8") |
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power8 -mtune=power8") |
|
|
|
|
|
|
|
endif(HAS_POWER8) |
|
|
|
|
|
|
|
endif(HAS_POWER9) |
|
|
|
CHECK_C_COMPILER_FLAG("-maltivec" HAS_ALTIVEC) |
|
|
|
CHECK_C_COMPILER_FLAG("-maltivec" HAS_ALTIVEC) |
|
|
|
if(HAS_ALTIVEC) |
|
|
|
if(HAS_ALTIVEC) |
|
|
|
message(STATUS " HAS_ALTIVEC yes") |
|
|
|
message(STATUS " HAS_ALTIVEC yes") |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maltivec") |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maltivec") |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec") |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec") |
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=power8") |
|
|
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power8") |
|
|
|
|
|
|
|
endif(HAS_ALTIVEC) |
|
|
|
endif(HAS_ALTIVEC) |
|
|
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") |
|
|
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") |
|
|
|
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64") |
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64") |
|
|
|
CHECK_C_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC) |
|
|
|
CHECK_C_COMPILER_FLAG("-march=armv8-a+crc+crypto" HAS_ARMV8_CRC) |
|
|
@ -235,7 +244,7 @@ else() |
|
|
|
if(MSVC) |
|
|
|
if(MSVC) |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:AVX2") |
|
|
|
else() |
|
|
|
else() |
|
|
|
if(NOT HAVE_POWER8 AND NOT HAS_ARMV8_CRC) |
|
|
|
if(NOT CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64" AND NOT HAS_ARMV8_CRC) |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") |
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
@ -741,11 +750,11 @@ if(HAVE_SSE42 AND NOT MSVC) |
|
|
|
PROPERTIES COMPILE_FLAGS "-msse4.2 -mpclmul") |
|
|
|
PROPERTIES COMPILE_FLAGS "-msse4.2 -mpclmul") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
if(HAVE_POWER8) |
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") |
|
|
|
list(APPEND SOURCES |
|
|
|
list(APPEND SOURCES |
|
|
|
util/crc32c_ppc.c |
|
|
|
util/crc32c_ppc.c |
|
|
|
util/crc32c_ppc_asm.S) |
|
|
|
util/crc32c_ppc_asm.S) |
|
|
|
endif(HAVE_POWER8) |
|
|
|
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(powerpc|ppc)64") |
|
|
|
|
|
|
|
|
|
|
|
if(HAS_ARMV8_CRC) |
|
|
|
if(HAS_ARMV8_CRC) |
|
|
|
list(APPEND SOURCES |
|
|
|
list(APPEND SOURCES |
|
|
|