Skip to content

Commit

Permalink
Apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuda-Chen committed Jan 30, 2024
1 parent 5f63b4b commit 04e96f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sse2neon.h
Original file line number Diff line number Diff line change
Expand Up @@ -8500,7 +8500,8 @@ FORCE_INLINE uint32_t _mm_crc32_u8(uint32_t crc, uint8_t v)
crc = __crc32cb(crc, v);
#else
crc ^= v;
#if defined(__ARM_FEATURE_CRYPTO)
#if (defined(__ARM_FEATURE_CRYPTO) || \
(defined(__aarch64__) || __has_builtin(__builtin_arm_crypto_vmullp64)))
// Adapted from: https://mary.rs/lab/crc32/
// Barrent reduction
uint64x2_t orig =
Expand All @@ -8509,8 +8510,7 @@ FORCE_INLINE uint32_t _mm_crc32_u8(uint32_t crc, uint8_t v)

// Polynomial P(x) of CRC32C
uint64_t p = 0x105EC76F1;
// Barrett Reduction constant mu_{64} = \lfloor 2^{64} / P(x) \rfloor =
// 0x11f91caf6 in bit-reflected form
// Barrett Reduction (in bit-reflected form) constant mu_{64} = \lfloor 2^{64} / P(x) \rfloor = 0x11f91caf6
uint64_t mu = 0x1dea713f1;

// Multiply by mu_{64}
Expand All @@ -8525,7 +8525,7 @@ FORCE_INLINE uint32_t _mm_crc32_u8(uint32_t crc, uint8_t v)

// Extract the 'lower' (in bit-reflected sense) 32 bits
crc = vgetq_lane_u32(vreinterpretq_u32_u64(tmp), 1);
#else
#else // Fall back to the generic table lookup approach
// Adapted from: https://create.stephan-brumme.com/crc32/
// Apply half-byte comparision algorithm for the best ratio between
// performance and lookup table.
Expand Down

0 comments on commit 04e96f7

Please sign in to comment.