From f425cb6f24aba7edf52f8862bbb8a18aeb96099e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Fri, 1 Oct 2021 03:40:29 +0100 Subject: [PATCH] Fix CRC32 using ARM SIMD being reversed when not needed. --- crc32_arm_simd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crc32_arm_simd.c b/crc32_arm_simd.c index 8671281..8ebd1fa 100644 --- a/crc32_arm_simd.c +++ b/crc32_arm_simd.c @@ -11,7 +11,7 @@ TARGET_ARMV8_WITH_CRC uint32_t armv8_crc32_little(uint32_t crc, const unsigned char* buf, uint32_t len) { - uint32_t c = (uint32_t)~crc; + uint32_t c = (uint32_t)crc; #if defined(__aarch64__) || defined(_M_ARM64) while(len && ((uintptr_t)buf & 7)) @@ -68,6 +68,6 @@ TARGET_ARMV8_WITH_CRC uint32_t armv8_crc32_little(uint32_t crc, const unsigned c #endif while(len--) { c = __crc32b(c, *buf++); } - return ~c; + return c; } #endif