summaryrefslogtreecommitdiff
path: root/mysys/crc32
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-27 09:34:53 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-27 09:34:53 +0300
commitb47d61d04fe59368a4d2c2de1bd04d9a8b5a20e5 (patch)
tree829506a641a2ba9e584d3675c83a3acf47f92f76 /mysys/crc32
parentbb284e3fdbfb6fc20f703762a5437c57c5c9d597 (diff)
downloadmariadb-git-b47d61d04fe59368a4d2c2de1bd04d9a8b5a20e5.tar.gz
MDEV-23585: Fix HAVE_CLMUL_INSTRUCTION
MDEV-22641 in commit dec3f8ca69e5eb19a4be7a175d3834874c4d880b refactored a SIMD implementation of CRC-32 for the ISO 3309 polynomial that uses the IA-32/AMD64 carry-less multiplication (pclmul) instructions. The code was previously only available in Mariabackup; it was changed to be a general replacement of the zlib crc32(). There exist AMD64 systems where CMAKE_SYSTEM_PROCESSOR matches the pattern i[36]86 but not x86_64 or amd64. This would cause a link failure, because mysys/checksum.c would basically assume that the compiler support for instruction is always available on GCC-compatible compilers on AMD64. Furthermore, we were unnecessarily disabling the SIMD acceleration for 32-bit executables. Note: Until MDEV-22749 has been implemented, the PCLMUL instruction will not be used on Microsoft Windows. Closes: #1660
Diffstat (limited to 'mysys/crc32')
-rw-r--r--mysys/crc32/crc32_x86.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mysys/crc32/crc32_x86.c b/mysys/crc32/crc32_x86.c
index 3f176a6c145..608ba3927c7 100644
--- a/mysys/crc32/crc32_x86.c
+++ b/mysys/crc32/crc32_x86.c
@@ -57,8 +57,6 @@ typedef uint8_t byte;
# define _gcry_bswap32 __builtin_bswap32
-#if __GNUC__ >= 4 && defined(__x86_64__)
-
#if defined(_GCRY_GCC_VERSION) && _GCRY_GCC_VERSION >= 40400 /* 4.4 */
/* Prevent compiler from issuing SSE instructions between asm blocks. */
# pragma GCC target("no-sse")
@@ -542,4 +540,3 @@ unsigned int crc32_pclmul(unsigned int crc32, const void *buf, size_t len)
crc32_intel_pclmul(&crc32, buf, len);
return ~crc32;
}
-#endif