Add NEON support to the NDK build system + docs
You can now define LOCAL_ARM_NEON to 'true' in your Android.mk to indicate that a whole module must be compiled with NEON support. Alternatively, use the .neon suffix when listing source files in LOCAL_SRC_FILES to indicate that they should be built with NEON support. E.g.: LOCAL_SRC_FILES := foo.c.neon bar.c zoo.c.arm.neon Note that .arm.neon is supported, but .neon.arm is NOT. Also added documentation in docs/CPU-ARM-NEON.TXT Another patch will provide one or more sample applications to demonstrate all of this.
This commit is contained in:
@@ -60,6 +60,34 @@ TARGET_thumb_debug_CFLAGS := $(TARGET_thumb_release_CFLAGS) \
|
||||
-marm \
|
||||
-fno-omit-frame-pointer
|
||||
|
||||
# This function will be called to determine the target CFLAGS used to build
|
||||
# a C or Assembler source file, based on its tags.
|
||||
#
|
||||
# NOTE: ARM Advanced SIMD (a.k.a. NEON) is not supported with this toolchain.
|
||||
#
|
||||
TARGET-process-src-files-tags = \
|
||||
$(eval __arm_sources := $(call get-src-files-with-tag,arm)) \
|
||||
$(eval __thumb_sources := $(call get-src-files-without-tag,arm)) \
|
||||
$(eval __debug_sources := $(call get-src-files-with-tag,debug)) \
|
||||
$(eval __release_sources := $(call get-src-files-without-tag,debug)) \
|
||||
$(call set-src-files-target-cflags, \
|
||||
$(call set_intersection,$(__arm_sources),$(__debug_sources)), \
|
||||
$(TARGET_arm_debug_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__arm_sources),$(__release_sources)),\
|
||||
$(TARGET_arm_release_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__arm_sources),$(__debug_sources)),\
|
||||
$(TARGET_arm_debug_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__thumb_sources),$(__release_sources)),\
|
||||
$(TARGET_thumb_release_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__thumb_sources),$(__debug_sources)),\
|
||||
$(TARGET_thumb_debug_CFLAGS)) \
|
||||
$(call set-src-files-text,$(__arm_sources),arm$(space)$(space)) \
|
||||
$(call set-src-files-text,$(__thumb_sources),thumb)
|
||||
|
||||
TARGET_CC := $(TOOLCHAIN_PREFIX)gcc
|
||||
TARGET_CFLAGS := $(TARGET_CFLAGS.common)
|
||||
|
||||
|
||||
@@ -49,6 +49,9 @@ else
|
||||
TARGET_ARCH_LDFLAGS :=
|
||||
endif
|
||||
|
||||
TARGET_CFLAGS.neon := \
|
||||
-mfpu=neon
|
||||
|
||||
TARGET_arm_release_CFLAGS := -O2 \
|
||||
-fomit-frame-pointer \
|
||||
-fstrict-aliasing \
|
||||
@@ -70,6 +73,35 @@ TARGET_thumb_debug_CFLAGS := $(TARGET_thumb_release_CFLAGS) \
|
||||
-marm \
|
||||
-fno-omit-frame-pointer
|
||||
|
||||
# This function will be called to determine the target CFLAGS used to build
|
||||
# a C or Assembler source file, based on its tags.
|
||||
#
|
||||
TARGET-process-src-files-tags = \
|
||||
$(eval __arm_sources := $(call get-src-files-with-tag,arm)) \
|
||||
$(eval __thumb_sources := $(call get-src-files-without-tag,arm)) \
|
||||
$(eval __debug_sources := $(call get-src-files-with-tag,debug)) \
|
||||
$(eval __release_sources := $(call get-src-files-without-tag,debug)) \
|
||||
$(call set-src-files-target-cflags, \
|
||||
$(call set_intersection,$(__arm_sources),$(__debug_sources)), \
|
||||
$(TARGET_arm_debug_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__arm_sources),$(__release_sources)),\
|
||||
$(TARGET_arm_release_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__arm_sources),$(__debug_sources)),\
|
||||
$(TARGET_arm_debug_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__thumb_sources),$(__release_sources)),\
|
||||
$(TARGET_thumb_release_CFLAGS)) \
|
||||
$(call set-src-files-target-cflags,\
|
||||
$(call set_intersection,$(__thumb_sources),$(__debug_sources)),\
|
||||
$(TARGET_thumb_debug_CFLAGS)) \
|
||||
$(call add-src-files-target-cflags,\
|
||||
$(call get-src-files-with-tag,neon),\
|
||||
$(TARGET_CFLAGS.neon)) \
|
||||
$(call set-src-files-text,$(__arm_sources),arm$(space)$(space)) \
|
||||
$(call set-src-files-text,$(__thumb_sources),thumb)
|
||||
|
||||
TARGET_CC := $(TOOLCHAIN_PREFIX)gcc
|
||||
TARGET_CFLAGS := $(TARGET_CFLAGS.common) $(TARGET_ARCH_CFLAGS)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user