diff options
author | mysqlonarm <61234003+mysqlonarm@users.noreply.github.com> | 2020-06-01 14:04:06 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-01 11:34:06 +0300 |
commit | dec3f8ca69e5eb19a4be7a175d3834874c4d880b (patch) | |
tree | 8e95e960ec07e5e1bce55ba421c2b54e234e7812 /cmake/crc32.cmake | |
parent | 6a6aa1c08977ed2ad2bf4a8ef88a44d9dbd69501 (diff) | |
download | mariadb-git-dec3f8ca69e5eb19a4be7a175d3834874c4d880b.tar.gz |
MDEV-22641: Provide SIMD optimized wrapper for zlib crc32() (#1558)
Existing implementation used my_checksum (from mysys)
for calculating table checksum and binlog checksum.
This implementation was optimized for powerpc only and lacked
SIMD implementation for x86 (using clmul) and ARM
(using ACLE) instead used zlib-crc32.
mariabackup had its own copy of the crc32 implementation
using hardware optimized implementation only for x86 and lagged
hardware based implementation for powerpc and ARM.
Patch helps unifies all such calls and help aggregate all of them
using an unified interface my_checksum().
Said unification also enables hardware optimized calls for all
architecture viz. x86, ARM, POWERPC.
Default always fallback to zlib crc32.
Thanks to Daniel Black for reviewing, fixing and testing
PowerPC changes. Thanks to Marko and Daniel for early code feedback.
Diffstat (limited to 'cmake/crc32.cmake')
-rw-r--r-- | cmake/crc32.cmake | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/cmake/crc32.cmake b/cmake/crc32.cmake deleted file mode 100644 index 78d57dec3fb..00000000000 --- a/cmake/crc32.cmake +++ /dev/null @@ -1,36 +0,0 @@ -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|AARCH64") - IF(CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1) - include(CheckCXXSourceCompiles) - - CHECK_CXX_SOURCE_COMPILES(" - #define CRC32CX(crc, value) __asm__(\"crc32cx %w[c], %w[c], %x[v]\":[c]\"+r\"(crc):[v]\"r\"(value)) - asm(\".arch_extension crc\"); - unsigned int foo(unsigned int ret) { - CRC32CX(ret, 0); - return ret; - } - int main() { foo(0); }" HAVE_ARMV8_CRC) - - CHECK_CXX_SOURCE_COMPILES(" - asm(\".arch_extension crypto\"); - unsigned int foo(unsigned int ret) { - __asm__(\"pmull v2.1q, v2.1d, v1.1d\"); - return ret; - } - int main() { foo(0); }" HAVE_ARMV8_CRYPTO) - - CHECK_C_COMPILER_FLAG(-march=armv8-a+crc+crypto HAVE_ARMV8_CRC_CRYPTO_INTRINSICS) - IF(HAVE_ARMV8_CRC_CRYPTO_INTRINSICS) - SET(ARMV8_CRC_COMPILE_FLAGS "${ARMV8_CRC_COMPILE_FLAGS} -march=armv8-a+crc+crypto") - ENDIF() - - SET(CRC32_LIBRARY crc32_armv8_neon) - ADD_SUBDIRECTORY(extra/crc32_armv8_neon) - ENDIF() -ENDIF() - -IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") - SET(HAVE_CRC32_VPMSUM 1) - SET(CRC32_LIBRARY crc32-vpmsum) - ADD_SUBDIRECTORY(extra/crc32-vpmsum) -ENDIF() |