From 0c0a4850e5d5f0497cd8e2d86f2749e7d6681b81 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 13 Oct 2021 21:06:53 +0100 Subject: [PATCH] Ensure MingW32 arm compilations have the inlines for crc32 operations. --- crc32_arm_simd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crc32_arm_simd.c b/crc32_arm_simd.c index 9a710f4..39f9240 100644 --- a/crc32_arm_simd.c +++ b/crc32_arm_simd.c @@ -32,6 +32,10 @@ #if(defined(__aarch64__) || defined(_M_ARM64) || defined(__arm__) || defined(_M_ARM)) && __ARM_ARCH >= 8 +#if defined(__MINGW32__) && !defined(__ARM_FEATURE_CRC32) +#define __ARM_FEATURE_CRC32 1 +#endif + #include #include "library.h" @@ -68,12 +72,12 @@ TARGET_ARMV8_WITH_CRC uint32_t armv8_crc32_little(uint32_t previous_crc, const u data = (const uint8_t*)buf8; #else // AARCH64 - while(len && ((uintptr_t)buf & 3)) + while(len && ((uintptr_t)data & 3)) { - c = __crc32b(c, *buf++); + c = __crc32b(c, *data++); --len; } - const uint32_t* buf4 = (const uint32_t*)buf; + const uint32_t* buf4 = (const uint32_t*)data; while(len >= 32) { c = __crc32w(c, *buf4++); @@ -92,7 +96,7 @@ TARGET_ARMV8_WITH_CRC uint32_t armv8_crc32_little(uint32_t previous_crc, const u len -= 4; } - buf = (const uint8_t*)buf4; + data = (const uint8_t*)buf4; #endif while(len--) { c = __crc32b(c, *data++); }