Modify Android mem* routines with CodeAurora versions.
Update the memcpy, memmove, and memset routines to use the
versions from CodeAurora when specified in the bionic/Android.mk
file (actually activated in the BoardConfig.mk file under
device/<vendor>/<board>). With this change, the mem* routines are
only used for the msm8660, while other platforms will use the
current Android mem* routines.
Future platforms can modify the makefile to use the CodeAurora-based
mem* routines as desired. This has the benefit of making the CodeAurora-
based routines opt-in instead of opt-out.
Also, PLDSIZE and PLDOFFS can be specified in the BoardConfig.mk as well,
so other platforms with different PLD tunings can use the same code
without modifying the source file itself.
Tests with FileCycler-0.3 showed a slight 1.1% improvement with these
files on an 8660v2, based on the average of three FileCycler runs with
and without the patch. Since the min/max values did not overlap, and
the average score showed an improvement, we can consider upstreaming these
modifications.
Change-Id: I6946076bc6a88a2a2c8667b09494e1eb31e01ee0
Conflicts:
libc/Android.mk
Signed-off-by: Andrew Sutherland <dr3wsuth3rland@gmail.com>
diff --git a/libc/Android.mk b/libc/Android.mk
index 59d0065..3832e24 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -362,8 +362,6 @@
arch-arm/bionic/strcpy.S \
arch-arm/bionic/strcmp.S \
arch-arm/bionic/syscall.S \
- string/memmove.c.arm \
- string/bcopy.c \
string/strncmp.c \
unistd/socketcalls.c
ifeq ($(ARCH_ARM_HAVE_ARMV7A),true)
@@ -372,6 +370,17 @@
libc_common_src_files += arch-arm/bionic/strlen.c.arm
endif
+# Check if we want a neonized version of memmove instead of the
+# current ARM version
+ifeq ($(TARGET_USE_SCORPION_BIONIC_OPTIMIZATION),true)
+libc_common_src_files += \
+ arch-arm/bionic/memmove.S
+else # Non-Scorpion-based ARM
+libc_common_src_files += \
+ string/bcopy.c \
+ string/memmove.c.arm
+endif # !TARGET_USE_SCORPION_BIONIC_OPTIMIZATION
+
# These files need to be arm so that gdbserver
# can set breakpoints in them without messing
# up any thumb code.
@@ -516,9 +525,20 @@
ifeq ($(ARCH_ARM_HAVE_TLS_REGISTER),true)
libc_common_cflags += -DHAVE_ARM_TLS_REGISTER
endif
+
ifeq ($(TARGET_HAVE_TEGRA_ERRATA_657451),true)
libc_common_cflags += -DHAVE_TEGRA_ERRATA_657451
endif
+
+ # Add in defines to activate SCORPION_NEON_OPTIMIZATION
+ ifeq ($(TARGET_USE_SCORPION_BIONIC_OPTIMIZATION),true)
+ libc_common_cflags += -DSCORPION_NEON_OPTIMIZATION
+ ifeq ($(TARGET_USE_SCORPION_PLD_SET),true)
+ libc_common_cflags += -DPLDOFFS=$(TARGET_SCORPION_BIONIC_PLDOFFS)
+ libc_common_cflags += -DPLDSIZE=$(TARGET_SCORPION_BIONIC_PLDSIZE)
+ endif
+ endif
+
else # !arm
ifeq ($(TARGET_ARCH),x86)
libc_crt_target_cflags := -m32