summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-04 01:15:28 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-04 01:15:28 +0000
commitc9f4586f4e347951221dda7c1d44c80575eeeb92 (patch)
treeb444dcf73293702eea223fc2cad4fa46ca976a8d
parentf4c952acfeb41b8c9aaadd2a10ddd35c10c2dc88 (diff)
parentd9645b462b3242da80355218699cb9d2577314cb (diff)
downloadzlib-c9f4586f4e347951221dda7c1d44c80575eeeb92.tar.gz
Snap for 11669053 from d9645b462b3242da80355218699cb9d2577314cb to sdk-release
Change-Id: Iec49741164b75121c0d7600ae0f4cc4976a37bcc
-rw-r--r--Android.bp38
1 files changed, 24 insertions, 14 deletions
diff --git a/Android.bp b/Android.bp
index a8ff866..944aa62 100644
--- a/Android.bp
+++ b/Android.bp
@@ -35,20 +35,25 @@ cflags_shared = [
cflags_arm = [
// Even the NDK dropped non-neon support in r24.
"-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.
+ // HWCAP_CRC32 is checked at runtime, so it's okay to enable crc32
+ // acceleration for both 64-bit and 32-bit (which may be armv7, at
+ // least for NDK users).
"-DCRC32_ARMV8_CRC32",
+ // TODO: DINFLATE_CHUNK_SIMD_NEON causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures.
+ // "-DINFLATE_CHUNK_SIMD_NEON",
+]
+cflags_arm64 = cflags_arm + ["-DINFLATE_CHUNK_READ_64LE"]
+
+cflags_riscv64 = [
+ // TODO: test and enable these.
+ // "-DRISCV_RVV",
+ // "-DADLER32_SIMD_RVV",
]
-cflags_arm64 = cflags_arm
// The *host* x86 configuration (with *lower* CPU feature requirements).
cflags_x86 = [
// See ARMV8_OS_LINUX above.
"-DX86_NOT_WINDOWS",
- // TODO: see arm above.
- // "-DINFLATE_CHUNK_SIMD_SSE2",
// Android's host CPU feature requirements are *lower* than the
// corresponding device CPU feature requirements, so it's easier to just
// say "no SIMD for you" rather than specificially disable SSSE3.
@@ -57,16 +62,18 @@ cflags_x86 = [
// https://issuetracker.google.com/171235570
"-DCPU_NO_SIMD",
]
-// The *device* x86 configuration (with *higher* CPU feature requirements).
+cflags_x86_64 = cflags_x86 + ["-DINFLATE_CHUNK_READ_64LE"]
+
+// The additional *device* x86/x86_64 configuration. Devices have *higher* CPU
+// feature requirements than the host.
cflags_android_x86 = [
- // Android's x86/x86-64 ABI includes SSE2 and SSSE3.
+ // Android's x86 and x86-64 ABIs both include SSE2 and SSSE3.
"-UCPU_NO_SIMD",
"-DADLER32_SIMD_SSSE3",
+ // TODO: DINFLATE_CHUNK_SIMD_SSE2 causes `atest org.apache.harmony.tests.java.util.zip.DeflaterTest` failures.
+ // "-DINFLATE_CHUNK_SIMD_SSE2",
]
-// This optimization is applicable to arm64 and x86-64.
-cflags_64 = ["-DINFLATE_CHUNK_READ_64LE"]
-
libz_srcs = [
"adler32.c",
"adler32_simd.c",
@@ -121,13 +128,16 @@ cc_defaults {
cflags: cflags_arm,
},
arm64: {
- cflags: cflags_arm64 + cflags_64,
+ cflags: cflags_arm64,
+ },
+ riscv64: {
+ cflags: cflags_riscv64,
},
x86: {
cflags: cflags_x86,
},
x86_64: {
- cflags: cflags_x86 + cflags_64,
+ cflags: cflags_x86_64,
},
},
target: {