summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-02-13 16:31:48 +0000
committerElliott Hughes <enh@google.com>2020-02-13 16:31:48 +0000
commit18e812de40e875a64b8268f5ff3d813a094acf39 (patch)
treed424eedeabc2db004eb4aa9c5916e15f0fa9f717
parent5ad12200f7f3fe49155385d787d67317799a90cf (diff)
downloadzlib-18e812de40e875a64b8268f5ff3d813a094acf39.tar.gz
Revert "Reland "Enable the various chrome zlib optimizations.""
This reverts commit 5ad12200f7f3fe49155385d787d67317799a90cf. This broke recovery_unit_test.ApplyPatchModesTest. See http://b/149443852. --- Original commit message: Reland "Enable the various chrome zlib optimizations." This reverts commit fed86a74dc785d93da99a3820eaaeed5b946ca4f, but with the optimized inflation disabled because it breaks `atest CtsLibcoreTestCases:org.apache.harmony.tests.java.util.zip.DeflaterTest`. This version also distinguishes neon/non-neon builds because the NDK builds a single libz. I don't trust -mfpu=neon not to cause all kinds of neon dependencies; I don't think that our HWCAP tests would be sufficient. This is for arm/arm64 only, because there are test failures for x86/x86-64 that we haven't understood yet. Bug: https://issuetracker.google.com/115695768 Bug: https://issuetracker.google.com/135889247 Change-Id: If52601ad86efadcec149d5c90580f084c2e881f1 Test: boots Test: zlib_bench scores 2x or more faster on arm/arm64 Test: atest CtsLibcoreTestCases:org.apache.harmony.tests.java.util.zip.DeflaterTest
-rw-r--r--Android.bp97
1 files changed, 8 insertions, 89 deletions
diff --git a/Android.bp b/Android.bp
index 849384b..c665c49 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,70 +1,9 @@
-srcs_opt = [
- "adler32_simd.c",
- // See https://chromium-review.googlesource.com/749732.
-// TODO: causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures.
-// "contrib/optimizations/inffast_chunk.c",
-// "contrib/optimizations/inflate.c",
- // This file doesn't build for non-neon, so it can't be in the main srcs.
- "cpu_features.c",
- "crc32_simd.c",
-]
-
-cflags_arm = [
- // Since we're building for the platform, we claim to be Linux rather than
- // Android so we use getauxval() directly instead of the NDK
- // android_getCpuFeatures which isn't available to us anyway.
- "-DARMV8_OS_LINUX",
- // Testing with zlib_bench shows -O3 is a win for ARM but a bit of a wash
- // for x86, so match the BUILD file in only enabling this for ARM.
- "-O3",
-]
-cflags_arm_neon = [
- // We no longer support non-Neon platform builds, but the NDK just has one libz.
- "-DADLER32_SIMD_NEON",
-// TODO: causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures.
-// "-DINFLATE_CHUNK_SIMD_NEON",
- // HWCAP_CRC32 is checked at runtime, so it's okay to turn crc32
- // acceleration on for both 32- and 64-bit.
- "-DCRC32_ARMV8_CRC32",
-]
-cflags_arm64 = cflags_arm + cflags_arm_neon
-
-cflags_x86 = []
-srcs_x86 = [
- "cpu_features.c",
-]
-
-/* TODO: this should work, but fails some tests on cuttlefish.
-cflags_x86 = [
- // See ARMV8_OS_LINUX above.
- "-DX86_NOT_WINDOWS",
- // Android's x86/x86-64 ABI includes SSE2 and SSSE3.
- "-DADLER32_SIMD_SSSE3",
- "-DINFLATE_CHUNK_SIMD_SSE2",
- // TODO: ...but the host build system defaults don't match our official ABI.
- "-mssse3",
- // PCLMUL isn't in the ABI, but it won't actually be used unless CPUID
- // reports that the processor really does have the instruction.
- "-mpclmul",
- "-DCRC32_SIMD_SSE42_PCLMUL",
-]
-srcs_x86 = [
- "crc_folding.c",
- "fill_window_sse.c",
- "x86.c",
-] + srcs_opt
-*/
-
-// This optimization is applicable to arm64 and x86-64.
-cflags_64 = ["-DINFLATE_CHUNK_READ_64LE"]
-
cc_defaults {
name: "libz_defaults",
cflags: [
- // We do support hidden visibility, so turn that on.
+ "-O3",
"-DHAVE_HIDDEN",
- // We do support const, so turn that on.
"-DZLIB_CONST",
"-Wall",
"-Werror",
@@ -76,6 +15,7 @@ cc_defaults {
srcs: [
"adler32.c",
"compress.c",
+ "cpu_features.c",
"crc32.c",
"deflate.c",
"gzclose.c",
@@ -83,9 +23,9 @@ cc_defaults {
"gzread.c",
"gzwrite.c",
"infback.c",
- "inffast.c",
"inflate.c",
"inftrees.c",
+ "inffast.c",
"trees.c",
"uncompr.c",
"zutil.c",
@@ -93,28 +33,15 @@ cc_defaults {
arch: {
arm: {
+ // measurements show that the ARM version of ZLib is about x1.17 faster
+ // than the thumb one...
+ // TODO: re-test with zlib_bench after SIMD is enabled.
+ instruction_set: "arm",
+
// TODO: This is to work around b/24465209. Remove after root cause
// is fixed.
pack_relocations: false,
ldflags: ["-Wl,--hash-style=both"],
-
- cflags: cflags_arm,
- neon: {
- cflags: cflags_arm_neon,
- srcs: srcs_opt,
- }
- },
- arm64: {
- cflags: cflags_arm64 + cflags_64,
- srcs: srcs_opt,
- },
- x86: {
- cflags: cflags_x86,
- srcs: srcs_x86,
- },
- x86_64: {
- cflags: cflags_x86 + cflags_64,
- srcs: srcs_x86,
},
},
}
@@ -146,8 +73,6 @@ cc_library {
},
}
-// libz_current allows modules building against the NDK to have access to zlib
-// API that's not available from the NDK libz.
cc_library_static {
name: "libz_current",
defaults: ["libz_defaults"],
@@ -168,12 +93,6 @@ cc_binary {
cflags: ["-Wall", "-Werror"],
host_supported: true,
shared_libs: ["libz"],
- // We build zlib_bench32 and zlib_bench64 so it's easy to test LP32.
- compile_multilib: "both",
- multilib: {
- lib32: { suffix: "32", },
- lib64: { suffix: "64", },
- },
}
// This module is defined in development/ndk/Android.bp. Updating these headers