[zlib] Add deflate fill_window_sse feature guard
Add DEFLATE_FILL_WINDOW_SSE2 define for the fill_window_sse feature and
use it to guard the feature code (not ADLER32_SIMD_SSSE3).
The fill_window_sse feature only requires SSE2: use x86_cpu_enable_sse2
for the run-time check.
No-presubmit: true
Bug: 1072308
Change-Id: I770fffa619c998dae1c1f8da1cac8b973e43a509
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2156330
Commit-Queue: Noel Gordon <noel@chromium.org>
Auto-Submit: Noel Gordon <noel@chromium.org>
Reviewed-by: Adenilson Cavalcanti <cavalcantii@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#761279}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cd8dcf969915890e5b0d6aa5f9c35ec9a0363290
diff --git a/BUILD.gn b/BUILD.gn
index c5be73d..903ef30 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -201,7 +201,10 @@
config("zlib_x86_simd_config") {
if (use_x86_x64_optimizations) {
- defines = [ "CRC32_SIMD_SSE42_PCLMUL" ]
+ defines = [
+ "CRC32_SIMD_SSE42_PCLMUL",
+ "DEFLATE_FILL_WINDOW_SSE2",
+ ]
}
}
diff --git a/deflate.c b/deflate.c
index 744d855..cec0294 100644
--- a/deflate.c
+++ b/deflate.c
@@ -1521,8 +1521,8 @@
local void fill_window(deflate_state *s)
{
-#ifdef ADLER32_SIMD_SSSE3
- if (x86_cpu_enable_simd) {
+#ifdef DEFLATE_FILL_WINDOW_SSE2
+ if (x86_cpu_enable_sse2) {
fill_window_sse(s);
return;
}