Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: third_party/zlib/BUILD.gn

Issue 677713002: Reland "Integrate SIMD optimisations for zlib" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add MSan suppression, prevent crc_fold_copy reading outside allocated memory, inline insert_string_… Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/zlib/BUILD.gn
diff --git a/third_party/zlib/BUILD.gn b/third_party/zlib/BUILD.gn
index 0f21450e38bc65c62cbe1fccf0d5e884206370b3..18cf816397c05839f3f2d76f981fa95e0ee42a36 100644
--- a/third_party/zlib/BUILD.gn
+++ b/third_party/zlib/BUILD.gn
@@ -6,6 +6,15 @@ config("zlib_config") {
include_dirs = [ "." ]
}
+static_library("zlib_x86_simd") {
+ if (cpu_arch == "x86" || cpu_arch == "x64") {
+ sources = [ "crc_folding.c", "fill_window_sse.c" ]
+ cflags = [ "-msse2", "-msse4.2", "-mpclmul" ]
+ } else {
+ sources = [ "simd_stub.c"]
+ }
+}
+
static_library("zlib") {
if (!is_win) {
# Don't stomp on "libzlib" on other platforms.
@@ -36,16 +45,22 @@ static_library("zlib") {
"trees.c",
"trees.h",
"uncompr.c",
+ "x86.h",
"zconf.h",
"zlib.h",
"zutil.c",
"zutil.h",
]
+ if (cpu_arch == "x86" || cpu_arch == "x64") {
+ sources += [ "x86.c" ]
+ }
+
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":zlib_config" ]
+ deps = [ ":zlib_x86_simd" ]
}
static_library("minizip") {

Powered by Google App Engine
This is Rietveld 408576698