summaryrefslogtreecommitdiff
path: root/include/my_sys.h
diff options
context:
space:
mode:
authormysqlonarm <61234003+mysqlonarm@users.noreply.github.com>2020-06-01 14:04:06 +0530
committerGitHub <noreply@github.com>2020-06-01 11:34:06 +0300
commitdec3f8ca69e5eb19a4be7a175d3834874c4d880b (patch)
tree8e95e960ec07e5e1bce55ba421c2b54e234e7812 /include/my_sys.h
parent6a6aa1c08977ed2ad2bf4a8ef88a44d9dbd69501 (diff)
downloadmariadb-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 'include/my_sys.h')
-rw-r--r--include/my_sys.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 639429e9c26..0807d5b6701 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -921,8 +921,18 @@ extern int my_compress_buffer(uchar *dest, size_t *destLen,
extern int packfrm(const uchar *, size_t, uchar **, size_t *);
extern int unpackfrm(uchar **, size_t *, const uchar *);
-extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem,
- size_t count);
+void my_checksum_init(void);
+#ifdef HAVE_CRC32_VPMSUM
+extern my_checksum(ha_checksum, const void *, size_t);
+#else
+typedef ha_checksum (*my_crc32_t)(ha_checksum, const void *, size_t);
+extern my_crc32_t my_checksum;
+#endif
+
+#if defined(__GNUC__) && defined(HAVE_ARMV8_CRC)
+int crc32_aarch64_available(void);
+#endif
+
#ifdef DBUG_ASSERT_EXISTS
extern void my_debug_put_break_here(void);
#else
@@ -930,7 +940,6 @@ extern void my_debug_put_break_here(void);
#endif
extern void my_sleep(ulong m_seconds);
-extern ulong crc32(ulong crc, const uchar *buf, uint len);
extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void);