diff options
author | dormando <dormando@rydia.net> | 2021-06-08 12:58:44 -0700 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2021-06-08 12:58:44 -0700 |
commit | 4481e4c831dc79058f9ce83046e1d6c53f14b912 (patch) | |
tree | c72d09757f94472a643823f94b860cab93061c64 /crc32c.c | |
parent | 0f1763499e015fe5f6c1bd33430359d8bc4708c3 (diff) | |
download | memcached-4481e4c831dc79058f9ce83046e1d6c53f14b912.tar.gz |
fix arm64 crc32 on old glibc/gcc.
patch by @sergey-dryabzhinsky on github, but he deleted the repo so I
rewrote the commit.
Diffstat (limited to 'crc32c.c')
-rw-r--r-- | crc32c.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -276,6 +276,7 @@ void crc32c_init(void) { #elif defined(__aarch64__) && defined(__linux__) #include <sys/auxv.h> +#if defined(HWCAP_CRC32) static inline uint32_t crc32cx(uint32_t crc, const uint64_t data) { asm(".arch_extension crc\n" @@ -336,6 +337,11 @@ void crc32c_init(void) { if (auxv & HWCAP_CRC32) crc32c = crc32c_hw; } +#else /* no hw crc32 on arm64 system supported? old compiler/libc/kernel? */ +void crc32c_init(void) { + crc32c = crc32c_sw; +} +#endif #else /* !__x86_64__i && !__aarch64__ */ void crc32c_init(void) { crc32c = crc32c_sw; |