libc: x86: Use SSE2 or SSSE3 optimized routines when possible.
This patch uses the new hardware feature macros for x86 to define
various compile-time macros used to make the C library use
SSE2 and/or SSSE3 optimized memory functions for target CPUs
that support these features.
Note that previously, we relied on the macros being defined by
build/core/combo/TARGET_linux-x86.mk, but this is no longer the
case.
Change-Id: Ieae5ff5284c0c839bc920953fb6b91d2f2633afc
diff --git a/libc/Android.mk b/libc/Android.mk
index caeab8c..5d851df 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -513,7 +513,12 @@
else # !arm
ifeq ($(TARGET_ARCH),x86)
libc_crt_target_cflags :=
- # TARGET_GLOBAL_CFLAGS from build/core/combo/TARGET_linux-x86.mk sets all required flags.
+ ifeq ($(ARCH_X86_HAVE_SSE2),true)
+ libc_crt_target_cflags += -DUSE_SSE2=1
+ endif
+ ifeq ($(ARCH_X86_HAVE_SSSE3),true)
+ libc_crt_target_cflags += -DUSE_SSSE3=1
+ endif
endif # x86
endif # !arm