]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Don't compile in Chorba for vpclmulqdq because it is never used
authorNathan Moinvaziri <nathan@nathanm.com>
Sat, 3 Jan 2026 02:14:24 +0000 (18:14 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 17 Jan 2026 19:37:25 +0000 (20:37 +0100)
By the time Chorba if statement is hit, len is already reduced to < 256.

arch/x86/crc32_pclmulqdq_tpl.h

index 6feb40ed7d517d4b79876d91ba523992bcf902fb..96aedf2df6bb9c61f6783330a3cf263785d7129c 100644 (file)
@@ -310,8 +310,7 @@ Z_FORCEINLINE static uint32_t crc32_copy_impl(uint32_t crc, uint8_t *dst, const
         xmm_crc2 = _mm512_extracti32x4_epi32(zmm_crc0, 2);
         xmm_crc3 = _mm512_extracti32x4_epi32(zmm_crc0, 3);
     }
-#endif
-
+#else
     /* Implement Chorba algorithm from https://arxiv.org/abs/2412.16398
      * We interleave the PCLMUL-base folds with 8x scaled generator
      * polynomial copies; we read 8x QWORDS and then XOR them into
@@ -506,6 +505,8 @@ Z_FORCEINLINE static uint32_t crc32_copy_impl(uint32_t crc, uint8_t *dst, const
     }
 #endif
 
+#endif  /* X86_VPCLMULQDQ */
+
     while (len >= 64) {
         len -= 64;
         xmm_t0 = _mm_load_si128((__m128i *)src);