]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Use Z_FORCEINLINE for all adler32 or crc32 implementation functions
authorNathan Moinvaziri <nathan@nathanm.com>
Thu, 1 Jan 2026 03:50:10 +0000 (19:50 -0800)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 7 Jan 2026 06:46:23 +0000 (07:46 +0100)
arch/arm/adler32_neon.c
arch/loongarch/adler32_lasx.c
arch/loongarch/adler32_lsx.c
arch/power/adler32_power8.c
arch/power/adler32_vmx.c
arch/riscv/adler32_rvv.c
arch/riscv/crc32_zbc.c
arch/x86/adler32_avx2.c
arch/x86/adler32_avx512.c
arch/x86/adler32_ssse3.c
arch/x86/chorba_sse41.c

index 74054c0c3982dfe8d321689bea774612bf466649..4943bb9ffb51cbd03b5fa1ae975390f71a70d65a 100644 (file)
@@ -20,7 +20,7 @@ static const uint16_t ALIGNED_(64) taps[64] = {
     16, 15, 14, 13, 12, 11, 10, 9,
     8, 7, 6, 5, 4, 3, 2, 1 };
 
-static Z_FORCEINLINE void NEON_accum32_copy(uint32_t *s, uint8_t *dst, const uint8_t *buf, size_t len) {
+Z_FORCEINLINE static void NEON_accum32_copy(uint32_t *s, uint8_t *dst, const uint8_t *buf, size_t len) {
     uint32x4_t adacc = vdupq_n_u32(0);
     uint32x4_t s2acc = vdupq_n_u32(0);
     uint32x4_t s2acc_0 = vdupq_n_u32(0);
@@ -144,7 +144,7 @@ static Z_FORCEINLINE void NEON_accum32_copy(uint32_t *s, uint8_t *dst, const uin
     s[1] = vget_lane_u32(as, 1);
 }
 
-static Z_FORCEINLINE void NEON_accum32(uint32_t *s, const uint8_t *buf, size_t len) {
+Z_FORCEINLINE static void NEON_accum32(uint32_t *s, const uint8_t *buf, size_t len) {
     uint32x4_t adacc = vdupq_n_u32(0);
     uint32x4_t s2acc = vdupq_n_u32(0);
     uint32x4_t s2acc_0 = vdupq_n_u32(0);
@@ -265,7 +265,7 @@ static void NEON_handle_tail(uint32_t *pair, const uint8_t *buf, size_t len) {
     }
 }
 
-static Z_FORCEINLINE uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
+Z_FORCEINLINE static uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
     /* split Adler-32 into component sums */
     uint32_t sum2 = (adler >> 16) & 0xffff;
     adler &= 0xffff;
index cf6d33f40ffbd9a7bc90112602316168efe59e0c..c63930551cda246555eba33eb7abfd4e01115115 100644 (file)
@@ -34,7 +34,7 @@ static inline uint32_t partial_hsum256(__m256i x) {
 extern uint32_t adler32_copy_lsx(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len);
 extern uint32_t adler32_lsx(uint32_t adler, const uint8_t *src, size_t len);
 
-static inline uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
+Z_FORCEINLINE static uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
     if (UNLIKELY(src == NULL)) return 1L;
     if (UNLIKELY(len == 0)) return adler;
 
index 5978523fb3974433af610f20eb4a24890c3a33fc..75b3b4550e9a0aeb695039fdaab7e449cdc4c7ae 100644 (file)
@@ -29,7 +29,7 @@ static inline uint32_t hsum(__m128i x) {
     return __lsx_vpickve2gr_w(sum4, 0);
 }
 
-static inline uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
+Z_FORCEINLINE static uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
     if (UNLIKELY(src == NULL)) return 1L;
     if (UNLIKELY(len == 0)) return adler;
 
index bb6013318a0150fc5c42e7a1e68eab78ead9ffee..10338fcc8a680f1ffe07f8568ad1bcf5a8415639 100644 (file)
@@ -52,7 +52,7 @@ static inline vector unsigned int vec_sumsu(vector unsigned int __a, vector unsi
     return __a;
 }
 
-static inline uint32_t adler32_impl(uint32_t adler, const uint8_t *buf, size_t len) {
+Z_FORCEINLINE static uint32_t adler32_impl(uint32_t adler, const uint8_t *buf, size_t len) {
     uint32_t s1 = adler & 0xffff;
     uint32_t s2 = (adler >> 16) & 0xffff;
 
index 0478d052d79bbdee05ab87b75d005406bc6fae2b..03a847430ad98f40267c4199da6d6d925d3507b4 100644 (file)
@@ -118,7 +118,7 @@ static void vmx_accum32(uint32_t *s, const uint8_t *buf, size_t len) {
     vec_ste(s2acc, 0, s+1);
 }
 
-static inline uint32_t adler32_impl(uint32_t adler, const uint8_t *buf, size_t len) {
+Z_FORCEINLINE static uint32_t adler32_impl(uint32_t adler, const uint8_t *buf, size_t len) {
     uint32_t sum2;
     uint32_t pair[16] ALIGNED_(16);
     memset(&pair[2], 0, 14);
index 41a754ce673fd0d02b4e86c41f1ec0a235e717a8..b9360ed72b6deb4dcb1838f21ad0b7f6a949b2a8 100644 (file)
@@ -12,7 +12,7 @@
 #include "zbuild.h"
 #include "adler32_p.h"
 
-static inline uint32_t adler32_copy_impl(uint32_t adler, uint8_t* restrict dst, const uint8_t *src, size_t len, int COPY) {
+Z_FORCEINLINE static uint32_t adler32_copy_impl(uint32_t adler, uint8_t* restrict dst, const uint8_t *src, size_t len, int COPY) {
     /* split Adler-32 into component sums */
     uint32_t sum2 = (adler >> 16) & 0xffff;
     adler &= 0xffff;
index 71bd70a4e1c86b3d89d650951798531f4052177a..570c0a66438254b0ddcffbb6d92877b3cf9951bf 100644 (file)
@@ -31,8 +31,7 @@ static inline uint64_t clmulh(uint64_t a, uint64_t b) {
   return res;
 }
 
-static inline uint32_t crc32_clmul_impl(uint64_t crc, const unsigned char *buf,
-                                        uint64_t len) {
+Z_FORCEINLINE static uint32_t crc32_clmul_impl(uint64_t crc, const unsigned char *buf, uint64_t len) {
   const uint64_t *buf64 = (const uint64_t *)buf;
   uint64_t low = buf64[0] ^ crc;
   uint64_t high = buf64[1];
index c714bbd49cf103920325c371945539ffcbd07d5d..464e83df05bc0b30003bbbce13e90384e5b5aa61 100644 (file)
@@ -18,7 +18,7 @@
 extern uint32_t adler32_copy_sse42(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len);
 extern uint32_t adler32_ssse3(uint32_t adler, const uint8_t *src, size_t len);
 
-static inline uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
+Z_FORCEINLINE static uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
     if (UNLIKELY(src == NULL)) return 1L;
     if (UNLIKELY(len == 0)) return adler;
 
index 5254f2dba62ee84c51fe2d4d572f9230f2e4b62a..8ebaf50b2c7d44c94315da86c61e96643315ee82 100644 (file)
@@ -15,7 +15,7 @@
 #include "x86_intrins.h"
 #include "adler32_avx512_p.h"
 
-static inline uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
+Z_FORCEINLINE static uint32_t adler32_copy_impl(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len, const int COPY) {
     if (UNLIKELY(src == NULL)) return 1L;
     if (UNLIKELY(len == 0)) return adler;
 
index 7c1dc84c9be08812aa2154625873a65840b7920f..5c5a6c5f3cb9956380ec493ee762562cd3179871 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <immintrin.h>
 
-static inline uint32_t adler32_impl(uint32_t adler, const uint8_t *buf, size_t len) {
+Z_FORCEINLINE static uint32_t adler32_impl(uint32_t adler, const uint8_t *buf, size_t len) {
     uint32_t sum2;
 
      /* split Adler-32 into component sums */
index 65243bff3b6581d5bd3e7a0acaffdcb047947b82..aa1c7a27755523b1f9a445142c04855c2606d457 100644 (file)
@@ -52,7 +52,7 @@
     out3 = _mm_xor_si128(in[4], xor3); \
     } while (0)
 
-static Z_FORCEINLINE uint32_t crc32_chorba_32768_nondestructive_sse41(uint32_t crc, const uint64_t* buf, size_t len) {
+Z_FORCEINLINE static uint32_t crc32_chorba_32768_nondestructive_sse41(uint32_t crc, const uint64_t* buf, size_t len) {
     const uint64_t* input = buf;
     ALIGNED_(16) uint64_t bitbuffer[32768 / sizeof(uint64_t)];
     __m128i *bitbuffer_v = (__m128i*)bitbuffer;