diff options
author | David 'Digit' Turner <digit@android.com> | 2012-10-18 13:10:51 +0200 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2012-10-18 18:28:01 +0200 |
commit | 0ea76db1ae4cc2335b7cd9554b14aca6437c5e21 (patch) | |
tree | d042499917319d612b8943744a350a1a6f93d6e7 | |
parent | a099fc95d421df84e6e5a9fc029e49ece7efc2e2 (diff) | |
download | ndk-0ea76db1ae4cc2335b7cd9554b14aca6437c5e21.tar.gz |
Change default -mfpu type to 'vfpv3d16' instead of 'vfp'
'vfp' really corresponds to VFPv2, with 'vfpv3-d16' corresponding
to the mandated minimum FPU architecture for ARMv7-A and hence
armeabi-v7a.
Note that 'vfpv3-d16' adds a few instructions on top of 'vfp' which
relate to loading a small set of immediate values directly into
FPU registers (e.g. +1.0, -1.0, etc). Any code that was previously
generated with -mfpu=vfp will still work, and any code that targets
'vfpv3d16' will work on all armeabi-v7a capable devices.
For more information, see the documentation comments in
sources/android/cpu-features.c introduced in this patch:
https://android-review.googlesource.com/#/c/44920/
Change-Id: Ice0067a23c8e5dc7cec13cd07f18183164a67730
-rwxr-xr-x | build/tools/build-host-gcc.sh | 2 | ||||
-rw-r--r-- | docs/STANDALONE-TOOLCHAIN.html | 12 | ||||
-rw-r--r-- | toolchains/arm-linux-androideabi-4.4.3/setup.mk | 2 | ||||
-rw-r--r-- | toolchains/arm-linux-androideabi-4.6/setup.mk | 2 | ||||
-rw-r--r-- | toolchains/arm-linux-androideabi-4.7/setup.mk | 2 | ||||
-rw-r--r-- | toolchains/arm-linux-androideabi-clang3.1/setup.mk | 2 |
6 files changed, 10 insertions, 12 deletions
diff --git a/build/tools/build-host-gcc.sh b/build/tools/build-host-gcc.sh index ea3c73b37..84cb9cc30 100755 --- a/build/tools/build-host-gcc.sh +++ b/build/tools/build-host-gcc.sh @@ -1405,7 +1405,7 @@ build_host_gcc_core () case $TARGET_ARCH in arm) - ARGS=$ARGS" --with-arch=armv5te --with-float=soft --with-fpu=vfp" + ARGS=$ARGS" --with-arch=armv5te --with-float=soft --with-fpu=vfpv3-d16" ;; mips) # Add --disable-fixed-point to disable fixed-point support diff --git a/docs/STANDALONE-TOOLCHAIN.html b/docs/STANDALONE-TOOLCHAIN.html index 51b41025a..59f089da4 100644 --- a/docs/STANDALONE-TOOLCHAIN.html +++ b/docs/STANDALONE-TOOLCHAIN.html @@ -165,19 +165,17 @@ It is recommended to use the -mthumb compiler flag to force the generation of 16-bit Thumb-1 instructions (the default being 32-bit ARM ones). If you want to target the 'armeabi-v7a' ABI, you will need ensure that the -following two flags are being used: +following flags are being used: - CFLAGS='-march=armv7-a -mfloat-abi=softfp' + CFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16' Note: The first flag enables Thumb-2 instructions, and the second one enables H/W FPU instructions while ensuring that floating-point parameters are passed in core registers, which is critical for ABI compatibility. Do *not* use these flags separately! -You may add proper FPU flag, eg. "-mfpu=vfp" (stands for VFPv2, 16 double-precision -registers), if you target for architecture which supports it. - -If you want to use Neon instructions, you will need one more compiler flag: +If you want to use Neon instructions, you will need to change the -mfpu +compiler flag: CFLAGS='-march=armv7-a -mfloat-abi=softfp -mfpu=neon' @@ -188,7 +186,7 @@ Also, make sure the following two flags are provided to linker: LDFLAGS='-march=armv7-a -Wl,--fix-cortex-a8' Note: The first flag instructs linker to pick libgcc.a, libgcov.a and - crt*.o tailored for armv7. The 2nd flag is *required* to routes + crt*.o tailored for armv7-a. The 2nd flag is *required* to route around a CPU bug in some Cortex-A8 implementations: If none of the above makes sense to you, it's probably better not to use diff --git a/toolchains/arm-linux-androideabi-4.4.3/setup.mk b/toolchains/arm-linux-androideabi-4.4.3/setup.mk index bd58c0483..80302e784 100644 --- a/toolchains/arm-linux-androideabi-4.4.3/setup.mk +++ b/toolchains/arm-linux-androideabi-4.4.3/setup.mk @@ -39,7 +39,7 @@ TARGET_C_INCLUDES := \ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) TARGET_CFLAGS += -march=armv7-a \ -mfloat-abi=softfp \ - -mfpu=vfp + -mfpu=vfpv3-d16 TARGET_LDFLAGS += -march=armv7-a \ -Wl,--fix-cortex-a8 diff --git a/toolchains/arm-linux-androideabi-4.6/setup.mk b/toolchains/arm-linux-androideabi-4.6/setup.mk index 1fad30f87..6c9d516c5 100644 --- a/toolchains/arm-linux-androideabi-4.6/setup.mk +++ b/toolchains/arm-linux-androideabi-4.6/setup.mk @@ -39,7 +39,7 @@ TARGET_C_INCLUDES := \ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) TARGET_CFLAGS += -march=armv7-a \ -mfloat-abi=softfp \ - -mfpu=vfp + -mfpu=vfpv3-d16 TARGET_LDFLAGS += -march=armv7-a \ -Wl,--fix-cortex-a8 diff --git a/toolchains/arm-linux-androideabi-4.7/setup.mk b/toolchains/arm-linux-androideabi-4.7/setup.mk index 19cc1459c..bd756afb9 100644 --- a/toolchains/arm-linux-androideabi-4.7/setup.mk +++ b/toolchains/arm-linux-androideabi-4.7/setup.mk @@ -39,7 +39,7 @@ TARGET_C_INCLUDES := \ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) TARGET_CFLAGS += -march=armv7-a \ -mfloat-abi=softfp \ - -mfpu=vfp + -mfpu=vfpv3-d16 TARGET_LDFLAGS += -march=armv7-a \ -Wl,--fix-cortex-a8 diff --git a/toolchains/arm-linux-androideabi-clang3.1/setup.mk b/toolchains/arm-linux-androideabi-clang3.1/setup.mk index dcb9c2c0e..558ffd311 100644 --- a/toolchains/arm-linux-androideabi-clang3.1/setup.mk +++ b/toolchains/arm-linux-androideabi-clang3.1/setup.mk @@ -68,7 +68,7 @@ ifeq ($(TARGET_ARCH_ABI),armeabi-v7a) TARGET_CFLAGS += -target $(LLVM_TRIPLE) \ -march=armv7-a \ -mfloat-abi=softfp \ - -mfpu=vfp + -mfpu=vfpv3-d16 TARGET_LDFLAGS += -target $(LLVM_TRIPLE) \ -Wl,--fix-cortex-a8 |