From 515ba5478b6f6ae082c2f3fc9ae99f78403eeb50 Mon Sep 17 00:00:00 2001 From: Cuda-Chen Date: Wed, 17 Jan 2024 22:58:23 +0800 Subject: [PATCH] Apply suggestions --- sse2neon.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sse2neon.h b/sse2neon.h index 8371a05f..d04c83d4 100644 --- a/sse2neon.h +++ b/sse2neon.h @@ -8486,7 +8486,7 @@ FORCE_INLINE uint64_t _mm_crc32_u64(uint64_t crc, uint64_t v) return crc; } -const uint32_t crc32_tbl[] = { +static const uint32_t _sse2neon_crc32_tbl[] = { 0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, 0xc79a971f, 0x35f1141c, 0x26a1e7e8, 0xd4ca64eb, 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b, 0x4d43cfd0, 0xbf284cd3, 0xac78bf27, 0x5e133c24, 0x105ec76f, 0xe235446c, @@ -8546,13 +8546,7 @@ FORCE_INLINE uint32_t _mm_crc32_u8(uint32_t crc, uint8_t v) crc = __crc32cb(crc, v); #else crc ^= v; - crc = (crc >> 8) ^ crc32_tbl[crc & 0xFF]; - /*for (int bit = 0; bit < 8; bit++) { - if (crc & 1) - crc = (crc >> 1) ^ UINT32_C(0x82f63b78); - else - crc = (crc >> 1); - }*/ + crc = (crc >> 8) ^ _sse2neon_crc32_tbl[crc & 0xFF]; #endif return crc; }