11cb0ef41Sopenharmony_ciFrom c43ba7a55f091c0dcbfd8d89f7a5121269ce1b81 Mon Sep 17 00:00:00 2001
21cb0ef41Sopenharmony_ciFrom: Ho Cheung <uioptt24@gmail.com>
31cb0ef41Sopenharmony_ciDate: Thu, 27 Jul 2023 09:47:52 +0800
41cb0ef41Sopenharmony_ciSubject: [PATCH] [zlib] Perform CPU feature detection for ARM inside adler32()
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ciPerform CPU feature detection for ARM within adler32() to have the same
71cb0ef41Sopenharmony_cibehavior as x86.
81cb0ef41Sopenharmony_ci
91cb0ef41Sopenharmony_ci---
101cb0ef41Sopenharmony_ci third_party/zlib/adler32.c | 4 ++--
111cb0ef41Sopenharmony_ci 1 file changed, 2 insertions(+), 2 deletions(-)
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_cidiff --git a/third_party/zlib/adler32.c b/third_party/zlib/adler32.c
141cb0ef41Sopenharmony_ciindex 81c584f68e233..99a294496f7eb 100644
151cb0ef41Sopenharmony_ci--- a/third_party/zlib/adler32.c
161cb0ef41Sopenharmony_ci+++ b/third_party/zlib/adler32.c
171cb0ef41Sopenharmony_ci@@ -90,9 +90,9 @@ uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
181cb0ef41Sopenharmony_ci         return adler | (sum2 << 16);
191cb0ef41Sopenharmony_ci     }
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci-#if defined(ADLER32_SIMD_SSSE3)
221cb0ef41Sopenharmony_ci+#if defined(ADLER32_SIMD_SSSE3) || defined(ADLER32_SIMD_NEON)
231cb0ef41Sopenharmony_ci     /*
241cb0ef41Sopenharmony_ci-     * Use SSSE3 to compute the adler32. Since this routine can be
251cb0ef41Sopenharmony_ci+     * Use SIMD to compute the adler32. Since this function can be
261cb0ef41Sopenharmony_ci      * freely used, check CPU features here. zlib convention is to
271cb0ef41Sopenharmony_ci      * call adler32(0, NULL, 0), before making calls to adler32().
281cb0ef41Sopenharmony_ci      * So this is a good early (and infrequent) place to cache CPU
291cb0ef41Sopenharmony_ci--
301cb0ef41Sopenharmony_ci2.41.0.windows.3
31