summaryrefslogtreecommitdiff
path: root/storage/innobase/ut
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-08-28 14:44:36 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-08-28 14:44:36 +0300
commit9ef36faa614528b66e0a6ba58a4c40b246658b83 (patch)
tree5054626ad161f207322c580486eb2ee36ff61d64 /storage/innobase/ut
parentc14ecc750037f666ad1d39927ac0eb1ab4543506 (diff)
downloadmariadb-git-9ef36faa614528b66e0a6ba58a4c40b246658b83.tar.gz
MDEV-23618 InnoDB lacks IA-32 CRC-32C acceleration on GCC 4
When MDEV-22669 introduced CRC-32C acceleration to IA-32, it worked around a compiler bug by disabling the acceleration on GCC 4 for IA-32 altogether, even though the compiler bug only affects -fPIC builds that are targeting IA-32. Let us extend the solution fe5dbfe723427a3606c41409626dc853f997e679 and define HAVE_CPUID_INSTRUCTION that allows us to implement a necessary and sufficient work-around of the compiler bug.
Diffstat (limited to 'storage/innobase/ut')
-rw-r--r--storage/innobase/ut/ut0crc32.cc14
1 files changed, 2 insertions, 12 deletions
diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc
index 1ddac168d95..80a0d165069 100644
--- a/storage/innobase/ut/ut0crc32.cc
+++ b/storage/innobase/ut/ut0crc32.cc
@@ -102,17 +102,7 @@ const char* ut_crc32_implementation = "Using POWER8 crc32 instructions";
extern "C" {
uint32_t crc32c_aarch64(uint32_t crc, const unsigned char *buffer, uint64_t len);
};
-# elif defined(_MSC_VER)
-# define TRY_SSE4_2
-# elif defined (__GNUC__)
-# ifdef __x86_64__
-# define TRY_SSE4_2
-# elif defined(__i386__) && (__GNUC__ > 4 || defined __clang__)
-# define TRY_SSE4_2
-# endif
-# endif
-
-# ifdef TRY_SSE4_2
+# elif defined HAVE_CPUID_INSTRUCTION
/** return whether SSE4.2 instructions are available */
static inline bool has_sse4_2()
{
@@ -349,7 +339,7 @@ void ut_crc32_init()
ut_crc32_implementation= crc32c_implementation;
return;
}
-# elif defined(TRY_SSE4_2)
+# elif defined HAVE_CPUID_INSTRUCTION
if (has_sse4_2())
{
ut_crc32_low= ut_crc32_hw;