From 610cec574403ad4c7c6ed09a331957782a97eb3a Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 11 Apr 2023 02:20:35 +0000 Subject: [zlib][fuzzer] Use relative path for dependency header Small cleanup, should allow to build inflate_with_header_fuzzer outside of a Chromium checkout. AOSP request. Bug: 1431454 Change-Id: If7156e9b04df010bf99771d26a183fb00c612572 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4409440 Reviewed-by: Chris Blume Commit-Queue: Adenilson Cavalcanti Cr-Commit-Position: refs/heads/main@{#1128454} NOKEYCHECK=True GitOrigin-RevId: b2a3373fc39a211ecabdd12dce73bc6d78b78173 --- contrib/tests/fuzzers/inflate_with_header_fuzzer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc b/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc index f99220a..dfb5b39 100644 --- a/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc +++ b/contrib/tests/fuzzers/inflate_with_header_fuzzer.cc @@ -12,7 +12,7 @@ #include -#include "third_party/zlib/zlib.h" +#include "zlib.h" // Fuzzer builds often have NDEBUG set, so roll our own assert macro. #define ASSERT(cond) \ -- cgit v1.2.3 From 14dd4c4455602c9b71a1a89b5cafd1f4030d2e3f Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 11 Apr 2023 17:40:40 +0000 Subject: [zlib] Only create needed vectors for crc_fold_512 The original x86 specific folding CRC code contributed back in 2015 used a macro pair (CRC_LOAD/CRC_SAVE) to load and store data vectors that is reused along the code. Modern compilers (e.g. VS2022) will complain about unused code past the return in crc_fold_512to32 which only needs the first 4 sets of vectors (xmm_crc0 .. xmm_crc3) and this patch fixes the issue. For reference, see warning C4702: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4702?view=msvc-170 Bug: 1426252 Change-Id: I9636a7705f7f7c869b5bcfc4f7d35795614c7d23 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4409500 Reviewed-by: Hans Wennborg Commit-Queue: Adenilson Cavalcanti Reviewed-by: Chris Blume Cr-Commit-Position: refs/heads/main@{#1128743} NOKEYCHECK=True GitOrigin-RevId: 955a57f0b03d7a2b6266d535f9e6ba03ba26a340 --- crc_folding.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crc_folding.c b/crc_folding.c index ee31d49..1b4f4e1 100644 --- a/crc_folding.c +++ b/crc_folding.c @@ -435,7 +435,10 @@ unsigned ZLIB_INTERNAL crc_fold_512to32(deflate_state *const s) unsigned crc; __m128i x_tmp0, x_tmp1, x_tmp2, crc_fold; - CRC_LOAD(s) + __m128i xmm_crc0 = _mm_loadu_si128((__m128i *)s->crc0 + 0); + __m128i xmm_crc1 = _mm_loadu_si128((__m128i *)s->crc0 + 1); + __m128i xmm_crc2 = _mm_loadu_si128((__m128i *)s->crc0 + 2); + __m128i xmm_crc3 = _mm_loadu_si128((__m128i *)s->crc0 + 3); /* * k1 @@ -491,7 +494,6 @@ unsigned ZLIB_INTERNAL crc_fold_512to32(deflate_state *const s) crc = _mm_extract_epi32(xmm_crc3, 2); return ~crc; - CRC_SAVE(s) } #endif /* CRC32_SIMD_SSE42_PCLMUL */ -- cgit v1.2.3