diff options
author | Yuqi Gu <yuqi.gu@arm.com> | 2020-08-13 06:41:21 +0000 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-08-21 20:41:35 +0300 |
commit | 151fc0ed887db7e51ab90a2bf822f7cc3a725f62 (patch) | |
tree | ed2499269f52db981514da97bb5f1aa1717ad8fc /storage/innobase/ut | |
parent | 0b4ed0b7fbc8d61441718e05d95897c1bae430c4 (diff) | |
download | mariadb-git-151fc0ed887db7e51ab90a2bf822f7cc3a725f62.tar.gz |
MDEV-23495: Refine Arm64 PMULL runtime check in MariaDB
Raspberry Pi 4 supports crc32 but doesn't support pmull (MDEV-23030).
The PR #1645 offers a solution to fix this issue. But it does not consider
the condition that the target platform does support crc32 but not support PMULL.
In this condition, it should leverage the Arm64 crc32 instruction (__crc32c) and
just only skip parallel computation (pmull/vmull) rather than skip all hardware
crc32 instruction of computation.
The PR also removes unnecessary CRC32_ZERO branch in 'crc32c_aarch64' for MariaDB,
formats the indent and coding style.
Change-Id: I76371a6bd767b4985600e8cca10983d71b7e9459
Signed-off-by: Yuqi Gu <yuqi.gu@arm.com>
Diffstat (limited to 'storage/innobase/ut')
-rw-r--r-- | storage/innobase/ut/ut0crc32.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/innobase/ut/ut0crc32.cc b/storage/innobase/ut/ut0crc32.cc index 9de0ca81fe3..1ddac168d95 100644 --- a/storage/innobase/ut/ut0crc32.cc +++ b/storage/innobase/ut/ut0crc32.cc @@ -342,11 +342,11 @@ allocations, would not hurt if called twice, but would be pointless. */ void ut_crc32_init() { #ifndef HAVE_CRC32_VPMSUM -# if defined(__GNUC__) && defined(HAVE_ARMV8_CRC) && defined(HAVE_ARMV8_CRYPTO) - if (crc32c_aarch64_available()) +# if defined(__GNUC__) && defined(HAVE_ARMV8_CRC) + if (const char *crc32c_implementation= crc32c_aarch64_available()) { ut_crc32_low= crc32c_aarch64; - ut_crc32_implementation= "Using ARMv8 crc32 + pmull instructions"; + ut_crc32_implementation= crc32c_implementation; return; } # elif defined(TRY_SSE4_2) |