diff options
author | Daniel Black <daniel@linux.ibm.com> | 2018-11-22 14:51:31 +1100 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2019-05-27 16:47:51 +0300 |
commit | 35522455e0c0d680a68609b2bb82e4321afce32f (patch) | |
tree | 02d31c1194df00b03080abf17d53f3fedffd1fb1 /storage | |
parent | bff9b8026bd69f44d62d0eb33364d4a1ca1788f4 (diff) | |
download | mariadb-git-35522455e0c0d680a68609b2bb82e4321afce32f.tar.gz |
RocksDB: use crc32c optimised version for POWER
Diffstat (limited to 'storage')
-rw-r--r-- | storage/rocksdb/build_rocksdb.cmake | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake index 93f5fa2d1f3..eb7a7fed6c1 100644 --- a/storage/rocksdb/build_rocksdb.cmake +++ b/storage/rocksdb/build_rocksdb.cmake @@ -112,6 +112,24 @@ if(NOT WIN32) add_definitions(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX) endif() +include(CheckCCompilerFlag) +# ppc64 or ppc64le +if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") + CHECK_C_COMPILER_FLAG("-maltivec" HAS_ALTIVEC) + if(HAS_ALTIVEC) + message(STATUS " HAS_ALTIVEC yes") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maltivec") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec") + endif(HAS_ALTIVEC) + if(NOT CMAKE_C_FLAGS MATCHES "m(cpu|tune)") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mcpu=power8") + endif() + if(NOT CMAKE_CXX_FLAGS MATCHES "m(cpu|tune)") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=power8") + endif() + ADD_DEFINITIONS(-DHAVE_POWER8 -DHAS_ALTIVEC) +endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") + option(WITH_FALLOCATE "build with fallocate" ON) if(WITH_FALLOCATE AND UNIX) @@ -377,6 +395,13 @@ else() port/port_posix.cc env/env_posix.cc env/io_posix.cc) + # ppc64 or ppc64le + if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") + enable_language(ASM) + list(APPEND ROCKSDB_SOURCES + util/crc32c_ppc.c + util/crc32c_ppc_asm.S) + endif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") endif() SET(SOURCES) FOREACH(s ${ROCKSDB_SOURCES}) |