mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-10 03:47:44 -03:00
Rebase and add Rabin–Karp algorithm
This commit is contained in:
parent
620374a0a2
commit
3cef06b380
1 changed files with 17 additions and 22 deletions
39
third_party/zlib/BUILD.gn
vendored
39
third_party/zlib/BUILD.gn
vendored
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
||||
# Copyright (c) 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
|
@ -21,7 +21,7 @@ config("zlib_internal_config") {
|
|||
|
||||
if (!is_debug) {
|
||||
# Build code using -O3, see: crbug.com/1084371.
|
||||
# configs = [ "//build/config/compiler:optimize_speed" ]
|
||||
configs = [ "//build/config/compiler:optimize_speed" ]
|
||||
}
|
||||
if (is_debug || use_libfuzzer) {
|
||||
# Enable zlib's asserts in debug and fuzzer builds.
|
||||
|
@ -216,6 +216,7 @@ source_set("zlib_crc32_simd") {
|
|||
sources = [
|
||||
"crc32_simd.c",
|
||||
"crc32_simd.h",
|
||||
"crc_folding.c",
|
||||
]
|
||||
|
||||
if (!is_win || is_clang) {
|
||||
|
@ -229,38 +230,34 @@ source_set("zlib_crc32_simd") {
|
|||
configs += [ ":zlib_internal_config" ]
|
||||
|
||||
public_configs = [ ":zlib_crc32_simd_config" ]
|
||||
|
||||
public_deps = [ ":zlib_common_headers" ]
|
||||
}
|
||||
|
||||
config("zlib_x86_simd_config") {
|
||||
config("zlib_slide_hash_simd_config") {
|
||||
if (use_x86_x64_optimizations) {
|
||||
defines = [
|
||||
"CRC32_SIMD_SSE42_PCLMUL",
|
||||
"DEFLATE_FILL_WINDOW_SSE2",
|
||||
]
|
||||
defines = [ "DEFLATE_SLIDE_HASH_SSE2" ]
|
||||
}
|
||||
|
||||
if (use_arm_neon_optimizations) {
|
||||
defines = [ "DEFLATE_SLIDE_HASH_NEON" ]
|
||||
}
|
||||
}
|
||||
|
||||
source_set("zlib_x86_simd") {
|
||||
source_set("zlib_slide_hash_simd") {
|
||||
visibility = [ ":*" ]
|
||||
|
||||
if (use_x86_x64_optimizations) {
|
||||
sources = [
|
||||
"crc_folding.c",
|
||||
"fill_window_sse.c",
|
||||
]
|
||||
sources = [ "slide_hash_simd.h" ]
|
||||
}
|
||||
|
||||
if (!is_win || is_clang) {
|
||||
cflags = [
|
||||
"-msse4.2",
|
||||
"-mpclmul",
|
||||
]
|
||||
}
|
||||
if (use_arm_neon_optimizations) {
|
||||
sources = [ "slide_hash_simd.h" ]
|
||||
}
|
||||
|
||||
configs += [ ":zlib_internal_config" ]
|
||||
|
||||
public_configs = [ ":zlib_x86_simd_config" ]
|
||||
public_configs = [ ":zlib_slide_hash_simd_config" ]
|
||||
|
||||
public_deps = [ ":zlib_common_headers" ]
|
||||
}
|
||||
|
@ -330,20 +327,18 @@ component("zlib") {
|
|||
deps += [
|
||||
":zlib_adler32_simd",
|
||||
":zlib_inflate_chunk_simd",
|
||||
":zlib_slide_hash_simd",
|
||||
]
|
||||
|
||||
if (use_x86_x64_optimizations) {
|
||||
deps += [ ":zlib_crc32_simd" ]
|
||||
} else if (use_arm_neon_optimizations) {
|
||||
sources += [ "contrib/optimizations/slide_hash_neon.h" ]
|
||||
deps += [ ":zlib_arm_crc32" ]
|
||||
}
|
||||
} else {
|
||||
sources += [ "inflate.c" ]
|
||||
}
|
||||
|
||||
deps += [ ":zlib_x86_simd" ]
|
||||
|
||||
if (is_android) {
|
||||
import("//build/config/android/config.gni")
|
||||
if (defined(android_ndk_root) && android_ndk_root != "") {
|
||||
|
|
Loading…
Reference in a new issue