Skip to contentSkip to conversation

ARM floating point improvements and EABIhf support

PATCH Superseded Thomas Petazzoni 2 participants 14 messages Jul 6, 2013 – Jul 8, 2013 Arm/versatile express platform

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover ARM floating point improvements and EABIhf support

Hello,

Here is a patch series that improves the support for the various floating point possibilities on ARM, and adds support for the new EABIhf ARM ABI. Until now, we only had a global BR2_SOFT_FLOAT option to enable/disable soft-float support, and on ARM a BR2_VFP_FLOAT option to enable -mfpu=vfp. This clearly isn't sufficient to take into the various possibilities offered by the Cortex-A ARM cores.

In summary:

* PATCH 1 introduces the BR2_GCC_TARGET_FLOAT and BR2_GCC_TARGET_FPU hidden options, that will be used by the Config.in.<arch> files to define which -mfloat-abi= and -mfpu= values they want.

* PATCH 2 moves BR2_SOFT_FLOAT as global hidden option, and adds per-architecture visible options. This will allow each architecture to do its own business in terms of floating point strategy selection, while still providing a global BR2_SOFT_FLOAT for Buildroot code that needs to know whether floating point is emulated in software or not.

* PATCH 3 is the core of the patch set, adding many new options to select various VFP versions for various ARM cores, and adding support for the EABIhf ARM ABI. A special attention has been made on the Config.in help texts, to help the user making the right choice in terms of VFP selection.

* PATCH 4 and 5 adjust gcc and binutils version availabilities according to the selected ABI or VFP version.

* PATCH 6 removes the BR2_VFP_FLOAT option that no longer makes any sense.

* PATCH 7 updates some defconfig that were using BR2_VFP_FLOAT.

* PATCH 8 updates the external toolchain Config.in options after the introduction of the VFP selection and EABIhf ABI.

I have tested the following combinations:
* ARM926 soft-float EABI internal toolchain
* Cortex-A8 softfp EABI internal toolchain, using VFPv3-D16
* Cortex-A8 EABIhf toolchain, using VFPv3-D16
* Cortex-A8 soft-float with the Arago toolchain (the libc/libm itself uses VFP instructions, but programs are properly built soft-float)
* Cortex-A8 softfp with the Arago toolchain, using VFPv3-D16
* Cortex-A8 EABIhf with the Linaro toolchain, using VFPv3-D16

For each case, it was run time tested on a Cortex-A8 real platform (not Qemu), using a small demo program that makes a few floating point computations, and the assembly code was checked to verify that we're correctly in the soft-float, softfp or hard cases.

Thanks,

Thomas

Thomas Petazzoni (8):
arch: introduce BR2_GCC_TARGET_{FPU,FLOAT}
arch: Refactor BR2_SOFT_FLOAT into per-architecture options
arch: improve ARM floating point support and add support for EABIhf
binutils: exclude binutils versions that don't support EABIhf
gcc: take into account ARM floating point capabilities
toolchain: remove the old BR2_VFP_FLOAT option
configs: update defconfigs after VFP option changes
toolchain-external: update config options after EABIhf introduction

 Config.in.legacy                                   |   9 +
 arch/Config.in                                     |   9 +
 arch/Config.in.arm                                 | 221 ++++++++++++++++++++-
 arch/Config.in.avr32                               |  10 +
 arch/Config.in.mips                                |  10 +
 arch/Config.in.powerpc                             |  10 +
 configs/calao_snowball_defconfig                   |   3 +-
 configs/mx53loco_defconfig                         |   3 +-
 configs/qemu_arm_nuri_defconfig                    |   3 +-
 configs/qemu_arm_vexpress_defconfig                |   3 +-
 package/Makefile.in                                |   6 +
 package/binutils/Config.in.host                    |   3 +
 package/gcc/Config.in.host                         |  10 +
 package/gcc/gcc.mk                                 |  10 +
 toolchain/toolchain-buildroot/Config.in.2          |  12 --
 toolchain/toolchain-common.in                      |  21 --
 toolchain/toolchain-external/Config.in             |  24 ++-
 toolchain/toolchain-external/ext-tool.mk           |  15 +-
 .../toolchain-external/ext-toolchain-wrapper.c     |   9 +-
 19 files changed, 330 insertions(+), 61 deletions(-)
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/8 arch: introduce BR2_GCC_TARGET_{FPU, FLOAT}

Buildroot already has the BR2_GCC_TARGET_{TUNE,ARCH,ABI,CPU} hidden kconfig strings that allow per-architecture Config.in files to feed the appropriate values of --with-{tune,arch,abi-cpu} when building gcc, or the appropriate flags for the external toolchain wrapper.

This commit has two additional options: BR2_GCC_TARGET_{FPU,FLOAT}, that allows to define the --with-{fpu,float} gcc configure options for the internal backend, or the -mfpu/-mfloat-abi options for the flags of the external toolchain wrapper.

---
 arch/Config.in                                       |  6 ++++++
 package/gcc/gcc.mk                                   | 10 ++++++++++
 toolchain/toolchain-external/ext-tool.mk             | 10 ++++++++++
 toolchain/toolchain-external/ext-toolchain-wrapper.c |  6 ++++++
 4 files changed, 32 insertions(+)
arch/Config.in +6 -0
index 5ca05cd..d95d4ef 100644
@@ -192,6 +192,12 @@ config BR2_GCC_TARGET_CPU
 config BR2_GCC_TARGET_CPU_REVISION
 	string
 
+config BR2_GCC_TARGET_FPU
+	string
+
+config BR2_GCC_TARGET_FLOAT_ABI
+	string
+
 # Set up target binary format
 choice
 	prompt "Target Binary Format"
package/gcc/gcc.mk +10 -0
index 968354b..c5ca857 100644
@@ -165,6 +165,16 @@ HOST_GCC_COMMON_CONF_OPT += --with-cpu=$(call qstrip,$(BR2_GCC_TARGET_CPU))
 endif
 endif
 
+GCC_TARGET_FPU = $(call qstrip,$(BR2_GCC_TARGET_FPU))
+ifneq ($(GCC_TARGET_FPU),)
+HOST_GCC_COMMON_CONF_OPT += --with-fpu=$(GCC_TARGET_FPU)
+endif
+
+GCC_TARGET_FLOAT_ABI = $(call qstrip,$(BR2_GCC_TARGET_FLOAT_ABI))
+ifneq ($(GCC_TARGET_FLOAT_ABI),)
+HOST_GCC_COMMON_CONF_OPT += --with-float=$(GCC_TARGET_FLOAT_ABI)
+endif
+
 # Branding works on >= 4.3
 ifneq ($(findstring x4.2.,x$(GCC_VERSION)),x4.2.)
 HOST_GCC_COMMON_CONF_OPT += \
toolchain/toolchain-external/ext-tool.mk +10 -0
index b8d77ad..5c51e06 100644
@@ -145,6 +145,8 @@ CC_TARGET_CPU_:=$(call qstrip,$(BR2_GCC_TARGET_CPU)-$(BR2_GCC_TARGET_CPU_REVISIO
 endif
 CC_TARGET_ARCH_:=$(call qstrip,$(BR2_GCC_TARGET_ARCH))
 CC_TARGET_ABI_:=$(call qstrip,$(BR2_GCC_TARGET_ABI))
+CC_TARGET_FLOAT_:=$(call qstrip,$(BR2_GCC_TARGET_FLOAT))
+CC_TARGET_FPU_:=$(call qstrip,$(BR2_GCC_TARGET_FPU))
 
 # march/mtune/floating point mode needs to be passed to the external toolchain
 # to select the right multilib variant
@@ -168,6 +170,14 @@ ifneq ($(CC_TARGET_ABI_),)
 TOOLCHAIN_EXTERNAL_CFLAGS += -mabi=$(CC_TARGET_ABI_)
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_ABI='"$(CC_TARGET_ABI_)"'
 endif
+ifneq ($(CC_TARGET_FLOAT_),)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mfloat-abi=$(CC_TARGET_FLOAT_)
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_FLOAT='"$(CC_TARGET_FLOAT_)"'
+endif
+ifneq ($(CC_TARGET_FPU_),)
+TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=$(CC_TARGET_FPU_)
+TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_FPU='"$(CC_TARGET_FPU_)"'
+endif
 ifeq ($(BR2_BINFMT_FLAT),y)
 TOOLCHAIN_EXTERNAL_CFLAGS += -Wl,-elf2flt
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_BINFMT_FLAT
toolchain/toolchain-external/ext-toolchain-wrapper.c +6 -0
index 9d79d68..e504ff2 100644
@@ -38,6 +38,12 @@ static char *predef_args[] = {
 #ifdef BR_ABI
 	"-mabi=" BR_ABI,
 #endif
+#ifdef BR_FLOAT
+	"-mfloat-abi=" BR_FLOAT,
+#endif
+#ifdef BR2_FPU
+	"-mfpu=" BR_FPU,
+#endif
 #ifdef BR_SOFTFLOAT
 	"-msoft-float",
 #endif /* BR_SOFTFLOAT */
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 2/8 arch: Refactor BR2_SOFT_FLOAT into per-architecture options

In reply to Thomas Petazzoni

As we are going to introduced a more advanced support of floating point options for the ARM architecture, we need to adjust how the soft-float option is handled. We replace the current hidden option BR2_PREFER_SOFT_FLOAT option and the visible BR2_SOFT_FLOAT option by:

* A global hidden BR2_SOFT_FLOAT option, defined in arch/Config.in, that tells whether the architecture-specific code is using software emulated floating point. This hidden option can be used throughout Buildroot to determine whether soft float is used or not.

* Per-architecture visible BR2_<arch>_SOFT_FLOAT options, for the architecture for which it makes sense, which allows users to select soft float emulation when needed.

This change will allow each architecture to have a different way of presenting its floating point capabilities.

---
 arch/Config.in                |  3 +++
 arch/Config.in.arm            | 10 ++++++++++
 arch/Config.in.avr32          | 10 ++++++++++
 arch/Config.in.mips           | 10 ++++++++++
 arch/Config.in.powerpc        | 10 ++++++++++
 toolchain/toolchain-common.in | 21 ---------------------
 6 files changed, 43 insertions(+), 21 deletions(-)
arch/Config.in +3 -0
index d95d4ef..8daeee3 100644
@@ -1,6 +1,9 @@
 config BR2_ARCH_IS_64
        bool
 
+config BR2_SOFT_FLOAT
+	bool
+
 choice
 	prompt "Target Architecture"
 	default BR2_i386
arch/Config.in.arm +10 -0
index 983cac4..a0c7228 100644
@@ -86,6 +86,16 @@ config BR2_ARM_EABI
 	def_bool y
 	depends on !BR2_ARM_OABI
 
+config BR2_ARM_SOFT_FLOAT
+	bool "Use soft-float"
+	default y
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
+
 config BR2_ARM_ENABLE_NEON
 	bool "Enable NEON SIMD extension support"
 	depends on BR2_ARM_CPU_MAYBE_HAS_NEON
arch/Config.in.avr32 +10 -0
index ebf8454..34055d9 100644
@@ -3,3 +3,13 @@ config BR2_ARCH
 
 config BR2_ENDIAN
        default "BIG"
+
+config BR2_AVR32_SOFT_FLOAT
+	bool "Use soft-float"
+	default y
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
arch/Config.in.mips +10 -0
index 1454fb4..6242bcc 100644
@@ -52,6 +52,16 @@ config BR2_MIPS_NABI64
 	depends on BR2_ARCH_IS_64
 endchoice
 
+config BR2_MIPS_SOFT_FLOAT
+	bool "Use soft-float"
+	default y
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
+
 config BR2_ARCH
 	default "mips"		if BR2_mips
 	default "mipsel"	if BR2_mipsel
arch/Config.in.powerpc +10 -0
index 8643efc..721d40a 100644
@@ -88,6 +88,16 @@ config BR2_powerpc_SPE
 	depends on BR2_powerpc_8540 || BR2_powerpc_8548
 endchoice
 
+config BR2_POWERPC_SOFT_FLOAT
+	bool "Use soft-float"
+	default y
+	select BR2_SOFT_FLOAT
+	help
+	  If your target CPU does not have a Floating Point Unit (FPU)
+	  or a kernel FPU emulator, but you still wish to support
+	  floating point functions, then everything will need to be
+	  compiled with soft floating point support (-msoft-float).
+
 config BR2_ARCH
 	default "powerpc"	if BR2_powerpc
 
toolchain/toolchain-common.in +0 -21
index 7c9b842..dc3bd2a 100644
@@ -90,27 +90,6 @@ config BR2_USE_MMU
 	  If your target has a MMU, you should say Y here.  If you
 	  are unsure, just say Y.
 
-config BR2_PREFER_SOFT_FLOAT
-	bool
-	default y if BR2_arm
-	default y if BR2_armeb
-	default y if BR2_avr32
-	default y if BR2_mips
-	default y if BR2_mipsel
-
-config BR2_SOFT_FLOAT
-	bool "Use software floating point by default"
-	depends on BR2_arm || BR2_armeb || BR2_avr32 || BR2_mips || BR2_mipsel || BR2_powerpc
-	# External toolchains will automatically do soft float or hard
-	# float depending on their configuration
-	depends on BR2_TOOLCHAIN_BUILDROOT || BR2_TOOLCHAIN_CTNG
-	default $(BR2_PREFER_SOFT_FLOAT)
-	help
-	  If your target CPU does not have a Floating Point Unit (FPU) or a
-	  kernel FPU emulator, but you still wish to support floating point
-	  functions, then everything will need to be compiled with soft
-	  floating point support (-msoft-float).
-
 config BR2_TARGET_OPTIMIZATION
 	string "Target Optimizations"
 	default "-pipe"
Signature · 1 line
1.8.1.2
#3 lore raw

PATCH 2/8 arch: Refactor BR2_SOFT_FLOAT into per-architecture options

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> As we are going to introduced a more advanced support of floating Thomas> point options for the ARM architecture, we need to adjust how the Thomas> soft-float option is handled. We replace the current hidden option Thomas> BR2_PREFER_SOFT_FLOAT option and the visible BR2_SOFT_FLOAT option by:

Thomas> * A global hidden BR2_SOFT_FLOAT option, defined in arch/Config.in,

 Thomas>    that tells whether the architecture-specific code is using software
 Thomas>    emulated floating point. This hidden option can be used throughout
 Thomas>    Buildroot to determine whether soft float is used or not.

Thomas> * Per-architecture visible BR2_<arch>_SOFT_FLOAT options, for the
Thomas> architecture for which it makes sense, which allows users to select
Thomas> soft float emulation when needed.

Thomas> This change will allow each architecture to have a different way of Thomas> presenting its floating point capabilities.

Thomas> diff --git a/arch/Config.in.avr32 b/arch/Config.in.avr32 Thomas> index ebf8454..34055d9 100644
Thomas> --- a/arch/Config.in.avr32
Thomas> +++ b/arch/Config.in.avr32
Thomas> @@ -3,3 +3,13 @@ config BR2_ARCH

Thomas> config BR2_ENDIAN
Thomas> default "BIG"
Thomas> +
Thomas> +config BR2_AVR32_SOFT_FLOAT
Thomas> + bool "Use soft-float"
Thomas> + default y
Thomas> + select BR2_SOFT_FLOAT
Thomas> + help

 Thomas> +	  If your target CPU does not have a Floating Point Unit (FPU)
 Thomas> +	  or a kernel FPU emulator, but you still wish to support
 Thomas> +	  floating point functions, then everything will need to be
 Thomas> +	  compiled with soft floating point support (-msoft-float).

Does avr32 SoCs with hard float even exist? Does uClibc/kernel/.. support it? If not, we could just make this a hidden option.

Thomas> +config BR2_POWERPC_SOFT_FLOAT
Thomas> + bool "Use soft-float"
Thomas> + default y
Thomas> + select BR2_SOFT_FLOAT
Thomas> + help

 Thomas> +	  If your target CPU does not have a Floating Point Unit (FPU)
 Thomas> +	  or a kernel FPU emulator, but you still wish to support
 Thomas> +	  floating point functions, then everything will need to be
 Thomas> +	  compiled with soft floating point support (-msoft-float).

We didn't use to default to soft float for powerpc, as most cores have a FPU.

Thomas> -config BR2_PREFER_SOFT_FLOAT
Thomas> - bool
Thomas> - default y if BR2_arm
Thomas> - default y if BR2_armeb
Thomas> - default y if BR2_avr32
Thomas> - default y if BR2_mips
Thomas> - default y if BR2_mipsel

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 2/8 arch: Refactor BR2_SOFT_FLOAT into per-architecture options

Dear Peter Korsgaard,

Quoted 3 lines · Peter Korsgaard

Does avr32 SoCs with hard float even exist? Does uClibc/kernel/.. support it? If not, we could just make this a hidden option.

According to http://en.wikipedia.org/wiki/AVR32, the AVR32 AP7 never had a floating point unit, only the UC3, but I believe Linux was only running on AP7 cores, but I'm not sure. Anyway, I'll make AVR32 soft-float only.

Quoted 5 lines

Thomas> +config BR2_POWERPC_SOFT_FLOAT
Thomas> + bool "Use soft-float"
Thomas> + default y
Thomas> + select BR2_SOFT_FLOAT
Thomas> + help

Quoted 7 lines
 Thomas> +	  If your target CPU does not have a Floating Point Unit (FPU)
 Thomas> +	  or a kernel FPU emulator, but you still wish to support
 Thomas> +	  floating point functions, then everything will need to be
 Thomas> +	  compiled with soft floating point support (-msoft-float).

We didn't use to default to soft float for powerpc, as most cores have a FPU.

Correct, will fix. As a followup to this patch set, it'd be nice if someone knowledgeable in PPC stuff did a similar handling of FPU stuff.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#5 lore raw

PATCH 3/8 arch: improve ARM floating point support and add support for EABIhf

In reply to Thomas Petazzoni

This commit introduces the support for the EABIhf ABI, next to the existing support we have for EABI and OABI (even though OABI support is deprecated). EABIhf allows to improve performance of floating point workload by using floating point registers to transfer floating point arguments when calling functions, instead of using integer registers to do, as is done in the 'softfp' floating point model of EABI.

In addition to this, this commit introduces a list of options for the floating point support:
* Software floating point
* VFP
* VFPv3
* VFPv3-D16
* VFPv4
* VFPv4-D16

and it introduces some logic to make sure the options are only visible when it makes sense, depending on the ARM core being selected. This is however made complicated by the fact that certain VFP capabilities are mandatory on some cores, but optional on some other cores. The kconfig logic tries to achieve the following goals:

* Hide options that are definitely not possible.

* Use safe default values (i.e for Cortex-A5 and A7, the presence of the VFPv4 unit is optional, so we default on software floating point on these cores)..

* Show the available possibilities, even if some of them are not necessarily working on a particular core (again, for the Cortex-A5 and A7 cores, there is no way of knowing whether the particular variant used by the user has VFPv4 or not, so we select software floating point by default, but still show VFP/VFPv3/VFPv4 options).

It is worth noting that this commit doesn't add support for all possible -mfpu= values on ARM. We haven't added support for fpa, fpe2, fpe3, maverick (those four are only used on very old ARM cores), for vfpv3-fp16, vfpv3-d16-fp16, vfpv3xd, vfpv3xd-fp16, neon-fp16, vfpv4-sp-d16. They can be added quite easily if needed thanks to the new organization of the Config.in options.

---
 arch/Config.in.arm  | 231 ++++++++++++++++++++++++++++++++++++++++++++++++----
 package/Makefile.in |   6 ++
 2 files changed, 219 insertions(+), 18 deletions(-)
arch/Config.in.arm +213 -18
index a0c7228..785462b 100644
@@ -6,6 +6,31 @@ config BR2_ARM_CPU_HAS_NEON
 config BR2_ARM_CPU_MAYBE_HAS_NEON
 	bool
 
+# for some cores, VFPv2 is optional
+config BR2_ARM_CPU_MAYBE_HAS_VFPV2
+	bool
+
+config BR2_ARM_CPU_HAS_VFPV2
+	bool
+
+# for some cores, VFPv3 is optional
+config BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	bool
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV2
+
+config BR2_ARM_CPU_HAS_VFPV3
+	bool
+	select BR2_ARM_CPU_HAS_VFPV2
+
+# for some cores, VFPv4 is optional
+config BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	bool
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV3
+
+config BR2_ARM_CPU_HAS_VFPV4
+	bool
+	select BR2_ARM_CPU_HAS_VFPV3
+
 choice
 	prompt "Target Architecture Variant"
 	depends on BR2_arm || BR2_armeb
@@ -27,31 +52,40 @@ config BR2_arm10t
 	bool "arm10t"
 config BR2_arm1136jf_s_r0
 	bool "arm1136jf_s rev0"
+	select BR2_ARM_CPU_HAS_VFPV2
 config BR2_arm1136jf_s_r1
 	bool "arm1136jf_s rev1"
+	select BR2_ARM_CPU_HAS_VFPV2
 config BR2_arm1176jz_s
 	bool "arm1176jz-s"
 config BR2_arm1176jzf_s
 	bool "arm1176jzf-s"
+	select BR2_ARM_CPU_HAS_VFPV2
 config BR2_cortex_a5
 	bool "cortex-A5"
 	select BR2_ARM_CPU_MAYBE_HAS_NEON
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV4
 config BR2_cortex_a7
 	bool "cortex-A7"
 	select BR2_ARM_CPU_HAS_NEON
+	select BR2_ARM_CPU_HAS_VFPV4
 config BR2_cortex_a8
 	bool "cortex-A8"
 	select BR2_ARM_CPU_HAS_NEON
+	select BR2_ARM_CPU_HAS_VFPV3
 config BR2_cortex_a9
 	bool "cortex-A9"
 	select BR2_ARM_CPU_MAYBE_HAS_NEON
+	select BR2_ARM_CPU_MAYBE_HAS_VFPV3
 config BR2_cortex_a15
 	bool "cortex-A15"
 	select BR2_ARM_CPU_HAS_NEON
+	select BR2_ARM_CPU_HAS_VFPV4
 config BR2_fa526
 	bool "fa526/626"
 config BR2_pj4
 	bool "pj4"
+	select BR2_ARM_CPU_HAS_VFPV3
 config BR2_strongarm
 	bool "strongarm sa110/sa1100"
 config BR2_xscale
@@ -67,34 +101,67 @@ config BR2_arm1136jf_s
 choice
 	prompt "Target ABI"
 	depends on BR2_arm || BR2_armeb
-	depends on BR2_DEPRECATED
 	default BR2_ARM_EABI
 	help
-	  Application Binary Interface to use
+	  Application Binary Interface to use. The Application Binary
+	  Interface describes the calling conventions (how arguments
+	  are passed to functions, how the return value is passed, how
+	  system calls are made, etc.).
 
 	  Note:
 	    Using OABI is discouraged.
 
-config BR2_ARM_EABI_CHOICE
+config BR2_ARM_EABI
 	bool "EABI"
-config BR2_ARM_OABI
-	bool "OABI"
-	depends on !BR2_GCC_VERSION_4_7_X
-endchoice
+	help
+	  The EABI is currently the standard ARM ABI, which is used in
+	  most projects. It supports both the 'soft' floating point
+	  model (in which floating point instructions are emulated in
+	  software) and the 'softfp' floating point model (in which
+	  floating point instructions are executed using an hardware
+	  floating point unit, but floating point arguments to
+	  functions are passed in integer registers).
 
-config BR2_ARM_EABI
-	def_bool y
-	depends on !BR2_ARM_OABI
+	  The 'softfp' floating point model is link-compatible with
+	  the 'soft' floating point model, i.e you can link a library
+	  built 'soft' with some other code built 'softfp'.
 
-config BR2_ARM_SOFT_FLOAT
-	bool "Use soft-float"
-	default y
-	select BR2_SOFT_FLOAT
+	  However, passing the floating point arguments in integer
+	  registers is a bit inefficient, so if your ARM processor has
+	  a floating point unit, and you don't have pre-compiled
+	  'soft' or 'softfp' code, using the EABIhf ABI will provide
+	  better floating point performances.
+
+	  If your processor does not have a floating point unit, then
+	  you must use this ABI.
+
+config BR2_ARM_EABIHF
+	bool "EABIhf"
+	depends on BR2_ARM_CPU_MAYBE_HAS_VFPV2 || BR2_ARM_CPU_HAS_VFPV2
 	help
-	  If your target CPU does not have a Floating Point Unit (FPU)
-	  or a kernel FPU emulator, but you still wish to support
-	  floating point functions, then everything will need to be
-	  compiled with soft floating point support (-msoft-float).
+	  The EABIhf is an extension of EABI which supports the 'hard'
+	  floating point model. This model uses the floating point
+	  unit to execute floating point instructions, and passes
+	  floating point arguments in floating point registers.
+
+	  It is more efficient than EABI for floating point related
+	  workload. However, it does not allow to link against code
+	  that has been pre-built for the 'soft' or 'softfp' floating
+	  point models.
+
+	  If your processor has a floating point unit, and you don't
+	  depend on existing pre-compiled code, this option is most
+	  likely the best choice.
+
+config BR2_ARM_OABI
+	bool "OABI"
+	depends on BR2_DEPRECATED
+	help
+	  The OABI is a deprecated ABI that Linux was using before ARM
+	  standardized the EABI. It should no longer be used for new
+	  projects.
+
+endchoice
 
 config BR2_ARM_ENABLE_NEON
 	bool "Enable NEON SIMD extension support"
@@ -105,6 +172,120 @@ config BR2_ARM_ENABLE_NEON
 	  Select this option if you are certain your particular
 	  implementation has NEON support and you want to use it.
 
+choice
+	prompt "Floating point strategy"
+	depends on BR2_ARM_EABI || BR2_ARM_EABIHF
+	default BR2_ARM_FPU_VFPV4D16 if BR2_ARM_CPU_HAS_VFPV4
+	default BR2_ARM_FPU_VFPV3D16 if BR2_ARM_CPU_HAS_VFPV3
+	default BR2_ARM_FPU_VFPV2 if BR2_ARM_CPU_HAS_VFPV2
+	default BR2_ARM_SOFT_FLOAT if !BR2_ARM_CPU_HAS_VFPV2
+
+config BR2_ARM_SOFT_FLOAT
+	bool "Soft float"
+	depends on BR2_ARM_EABI
+	select BR2_SOFT_FLOAT
+	help
+	  This option allows to use software emulated floating
+	  point. It should be used for ARM cores that do not include a
+	  Vector Floating Point unit, such as ARMv5 cores (ARM926 for
+	  example) or certain ARMv6 cores.
+
+config BR2_ARM_FPU_VFPV2
+	bool "VFPv2"
+	depends on BR2_ARM_CPU_HAS_VFPV2 || BR2_ARM_CPU_MAYBE_HAS_VFPV2
+	help
+	  This option allows to use the VFPv2 floating point unit, as
+	  available in some ARMv6 processors (ARM1136JF-S,
+	  ARM1176JZF-S and ARM11 MPCore).
+
+	  Note that this option is also safe to use for newer cores
+	  such as Cortex-A, because the VFPv3 and VFPv4 units are
+	  backward compatible with VFPv2.
+
+config BR2_ARM_FPU_VFPV3
+	bool "VFPv3"
+	depends on BR2_ARM_CPU_HAS_VFPV3 || BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	help
+	  This option allows to use the VFPv3 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{8, 9}). This
+	  option requires a VFPv3 unit that has 32 double-precision
+	  registers, which is not necessarily the case in all SOCs
+	  based on Cortex-A{8, 9}. If you're unsure, use VFPv3-D16
+	  instead, which is guaranteed to work on all Cortex-A{8, 9}.
+
+	  Note that this option is also safe to use for newer cores
+	  that have a VFPv4 unit, because VFPv4 is backward compatible
+	  with VFPv3. They must of course also have 32
+	  double-precision registers.
+
+config BR2_ARM_FPU_VFPV3D16
+	bool "VFPv3-D16"
+	depends on BR2_ARM_CPU_HAS_VFPV3 || BR2_ARM_CPU_MAYBE_HAS_VFPV3
+	help
+	  This option allows to use the VFPv3 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{8, 9}). This
+	  option requires a VFPv3 unit that has 16 double-precision
+	  registers, which is generally the case in all SOCs based on
+	  Cortex-A{8, 9}, even though VFPv3 is technically optional on
+	  Cortex-A9. This is the safest option for those cores.
+
+	  Note that this option is also safe to use for newer cores
+	  such that have a VFPv4 unit, because the VFPv4 is backward
+	  compatible with VFPv3.
+
+config BR2_ARM_FPU_VFPV4
+	bool "VFPv4"
+	depends on BR2_ARM_CPU_HAS_VFPV4 || BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	help
+	  This option allows to use the VFPv4 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{5, 7, 12,
+	  15}). This option requires a VFPv4 unit that has 32
+	  double-precision registers, which is not necessarily the
+	  case in all SOCs based on Cortex-A{5, 7, 12, 15}. If you're
+	  unsure, you should probably use VFPv4-D16 instead.
+
+	  Note that if you want binary code that works on all ARMv7
+	  cores, including the earlier Cortex-A{8, 9}, you should
+	  instead select VFPv3.
+
+config BR2_ARM_FPU_VFPV4D16
+	bool "VFPv4-D16"
+	depends on BR2_ARM_CPU_HAS_VFPV4 || BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	help
+	  This option allows to use the VFPv4 floating point unit, as
+	  available in some ARMv7 processors (Cortex-A{5, 7, 12,
+	  15}). This option requires a VFPv4 unit that has 16
+	  double-precision registers, which is always available on
+	  Cortex-A12 and Cortex-A15, but optional on Cortex-A5 and
+	  Cortex-A7.
+
+	  Note that if you want binary code that works on all ARMv7
+	  cores, including the earlier Cortex-A{8, 9}, you should
+	  instead select VFPv3-D16.
+
+config BR2_ARM_FPU_NEON
+	bool "NEON"
+	depends on BR2_ARM_CPU_HAS_NEON
+	help
+	  This option allows to use the NEON SIMD unit, as available
+	  in some ARMv7 processors, as a floating-point unit. It
+	  should however be noted that using NEON for floating point
+	  operations doesn't provide a complete compatibility with the
+	  IEEE 754.
+
+config BR2_ARM_FPU_NEON_VFPV4
+	bool "NEON/VFPv4"
+	depends on BR2_ARM_CPU_HAS_VFPV4 || BR2_ARM_CPU_MAYBE_HAS_VFPV4
+	depends on BR2_ARM_CPU_HAS_NEON
+	help
+	  This option allows to use both the VFPv4 and the NEON SIMD
+	  units for floating point operations. Note that some ARMv7
+	  cores do not necessarily have VFPv4 and/or NEON support, for
+	  example on Cortex-A5 and Cortex-A7, support for VFPv4 and
+	  NEON is optional.
+
+endchoice
+
 config BR2_ARCH
 	default "arm"	if BR2_arm
 	default "armeb"	if BR2_armeb
@@ -161,3 +342,17 @@ config BR2_GCC_TARGET_ARCH
 config BR2_GCC_TARGET_ABI
 	default "apcs-gnu"	if BR2_ARM_OABI
 	default "aapcs-linux"	if BR2_ARM_EABI
+
+config BR2_GCC_TARGET_FPU
+	default "vfp"		if BR2_ARM_FPU_VFPV2
+	default "vfpv3"		if BR2_ARM_FPU_VFPV3
+	default "vfpv3-d16" 	if BR2_ARM_FPU_VFPV3D16
+	default "vfpv4" 	if BR2_ARM_FPU_VFPV4
+	default "vfpv4-d16" 	if BR2_ARM_FPU_VFPV4D16
+	default "neon" 		if BR2_ARM_FPU_NEON
+	default "neon-vfpv4" 	if BR2_ARM_FPU_NEON_VFPV4
+
+config BR2_GCC_TARGET_FLOAT_ABI
+	default "soft"		if BR2_ARM_SOFT_FLOAT
+	default "softfp"	if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABI
+	default "hard"		if !BR2_ARM_SOFT_FLOAT && BR2_ARM_EABIHF
package/Makefile.in +6 -0
index 405b3e4..f570d67 100644
@@ -40,6 +40,12 @@ ABI=gnueabi
 else
 ABI=eabi
 endif
+else ifeq ($(BR2_ARM_EABIHF),y)
+ifeq ($(LIBC),uclibc)
+ABI=gnueabihf
+else
+ABI=eabihf
+endif
 endif
 
 # For FSL PowerPC there's SPE
Signature · 1 line
1.8.1.2
#6 lore raw

PATCH 3/8 arch: improve ARM floating point support and add support for EABIhf

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> This commit introduces the support for the EABIhf ABI, next to the Thomas> existing support we have for EABI and OABI (even though OABI support Thomas> is deprecated). EABIhf allows to improve performance of floating point Thomas> workload by using floating point registers to transfer floating point Thomas> arguments when calling functions, instead of using integer registers Thomas> to do, as is done in the 'softfp' floating point model of EABI.

Thomas> In addition to this, this commit introduces a list of options for the Thomas> floating point support:

 Thomas>  * Software floating point
 Thomas>  * VFP
 Thomas>  * VFPv3
 Thomas>  * VFPv3-D16
 Thomas>  * VFPv4
 Thomas>  * VFPv4-D16

Thomas> and it introduces some logic to make sure the options are only visible Thomas> when it makes sense, depending on the ARM core being selected. This is Thomas> however made complicated by the fact that certain VFP capabilities are Thomas> mandatory on some cores, but optional on some other cores. The kconfig Thomas> logic tries to achieve the following goals:

Thomas> * Hide options that are definitely not possible.

Thomas> * Use safe default values (i.e for Cortex-A5 and A7, the presence of
Thomas> the VFPv4 unit is optional, so we default on software floating
Thomas> point on these cores)..

Thomas> * Show the available possibilities, even if some of them are not

 Thomas>    necessarily working on a particular core (again, for the Cortex-A5
 Thomas>    and A7 cores, there is no way of knowing whether the particular
 Thomas>    variant used by the user has VFPv4 or not, so we select software
 Thomas>    floating point by default, but still show VFP/VFPv3/VFPv4 options).

Thomas> It is worth noting that this commit doesn't add support for all Thomas> possible -mfpu= values on ARM. We haven't added support for fpa, fpe2, Thomas> fpe3, maverick (those four are only used on very old ARM cores), for Thomas> vfpv3-fp16, vfpv3-d16-fp16, vfpv3xd, vfpv3xd-fp16, neon-fp16, Thomas> vfpv4-sp-d16. They can be added quite easily if needed thanks to the Thomas> new organization of the Config.in options.

Thomas> Signed-off-by: Thomas Petazzoni <[email protected]>

 Thomas>  config BR2_cortex_a15
 Thomas>  	bool "cortex-A15"
 Thomas>  	select BR2_ARM_CPU_HAS_NEON
 Thomas> +	select BR2_ARM_CPU_HAS_VFPV4
 Thomas>  config BR2_fa526
 Thomas>  	bool "fa526/626"
 Thomas>  config BR2_pj4
 Thomas>  	bool "pj4"
 Thomas> +	select BR2_ARM_CPU_HAS_VFPV3
 Thomas>  config BR2_strongarm
 Thomas>  	bool "strongarm sa110/sa1100"
 Thomas>  config BR2_xscale
 Thomas> @@ -67,34 +101,67 @@ config BR2_arm1136jf_s
 Thomas>  choice
 Thomas>  	prompt "Target ABI"
 Thomas>  	depends on BR2_arm || BR2_armeb

Thomas> - depends on BR2_DEPRECATED
Thomas> default BR2_ARM_EABI

Looks good. You could argue that we should do:

default BR2_ARM_EABIHF

instead (E.G. default to eabihf if available, otherwise fall back to eabi), but with all the optional vfp units it's perhaps better to play it safe..

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 3/8 arch: improve ARM floating point support and add support for EABIhf

Dear Peter Korsgaard,

Quoted 7 lines · Peter Korsgaard

Looks good. You could argue that we should do:

default BR2_ARM_EABIHF

instead (E.G. default to eabihf if available, otherwise fall back to eabi), but with all the optional vfp units it's perhaps better to play it safe..

Yeah, I thought that defaulting on eabihf today (for ARMv7) was a bit too much. I played conservative, and remained on eabi by default.

Best regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#8 lore raw

PATCH 4/8 binutils: exclude binutils versions that don't support EABIhf

In reply to Thomas Petazzoni

The ARM EABIhf support was introduced in Binutils 2.22, so earlier versions should not be selected when EABIhf is used.

---
 package/binutils/Config.in.host | 3 +++
 1 file changed, 3 insertions(+)
package/binutils/Config.in.host +3 -0
index 3d687fe..9ddaed7 100644
@@ -14,14 +14,17 @@ choice
 
 	config BR2_BINUTILS_VERSION_2_20_1
 		depends on !BR2_avr32
+		depends on !BR2_ARM_EABIHF
 		bool "binutils 2.20.1"
 
 	config BR2_BINUTILS_VERSION_2_21
 		depends on !BR2_avr32
+		depends on !BR2_ARM_EABIHF
 		bool "binutils 2.21"
 
 	config BR2_BINUTILS_VERSION_2_21_1
 		depends on !BR2_avr32
+		depends on !BR2_ARM_EABIHF
 		bool "binutils 2.21.1"
 
 	config BR2_BINUTILS_VERSION_2_22
Signature · 1 line
1.8.1.2
#9 lore raw

PATCH 5/8 gcc: take into account ARM floating point capabilities

In reply to Thomas Petazzoni

The ARM EABIhf support was introduced in gcc 4.6.x, so versions earlier than this one should not be used when EABIhf is selected.

The ARM VFPv4 support was introduced in gcc 4.5.x, so versions earlier than this one should not be used when VFPv4 is used.

---
 package/gcc/Config.in.host | 10 ++++++++++
 1 file changed, 10 insertions(+)
package/gcc/Config.in.host +10 -0
index 1b19128..0a893b2 100644
@@ -22,15 +22,22 @@ choice
 
 	config BR2_GCC_VERSION_4_3_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a8 && !BR2_cortex_a9 && !BR2_cortex_a15 && !BR2_x86_atom && !BR2_powerpc_e300c2 && !BR2_powerpc_e300c3 && !BR2_powerpc_e500mc && !BR2_powerpc_464 && !BR2_powerpc_464fp && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4
+		depends on !BR2_ARM_EABIHF
 		bool "gcc 4.3.x"
 
 	config BR2_GCC_VERSION_4_4_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a5 && !BR2_cortex_a7 && !BR2_cortex_a15 && !BR2_x86_atom && !BR2_powerpc_476 && !BR2_powerpc_476fp && !BR2_fa526 && !BR2_pj4
 		bool "gcc 4.4.x"
+		# ARM EABIhf support appeared in gcc 4.6
+		depends on !BR2_ARM_EABIHF
+		# VFPv4 support appeared in gcc 4.5
+		depends on !BR2_ARM_FPU_VFPV4 && !BR2_ARM_FPU_VFPV4D16
 
 	config BR2_GCC_VERSION_4_5_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_cortex_a7 && !BR2_cortex_a15 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_fa526 && !BR2_pj4
 		select BR2_GCC_NEEDS_MPC
+		# ARM EABIhf support appeared in gcc 4.6
+		depends on !BR2_ARM_EABIHF
 		bool "gcc 4.5.x"
 
 	config BR2_GCC_VERSION_4_6_X
@@ -40,17 +47,20 @@ choice
 
 	config BR2_GCC_VERSION_4_7_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8 && !BR2_pj4
+		depends on !BR2_ARM_OABI
 		select BR2_GCC_NEEDS_MPC
 		bool "gcc 4.7.x"
 
 	config BR2_GCC_VERSION_4_8_X
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8
 		select BR2_GCC_NEEDS_MPC
+		depends on !BR2_ARM_OABI
 		bool "gcc 4.8.x"
 
 	config BR2_GCC_VERSION_SNAP
 		depends on !BR2_arc && !BR2_avr32 && !BR2_sparc_sparchfleon && !BR2_sparc_sparchfleonv8 && !BR2_sparc_sparcsfleon && !BR2_sparc_sparcsfleonv8
 		select BR2_GCC_NEEDS_MPC
+		depends on !BR2_ARM_OABI
 		bool "gcc snapshot"
 endchoice
 
Signature · 1 line
1.8.1.2
#10 lore raw

PATCH 6/8 toolchain: remove the old BR2_VFP_FLOAT option

In reply to Thomas Petazzoni

Now that we have a much better way of selecting between the various VFP versions and capabilities, the BR2_VFP_FLOAT version no longer makes sense. This commit gets rid of it, and adds the appropriate Config.in.legacy code.

---
 Config.in.legacy                                     |  9 +++++++++
 toolchain/toolchain-buildroot/Config.in.2            | 12 ------------
 toolchain/toolchain-external/ext-tool.mk             |  5 -----
 toolchain/toolchain-external/ext-toolchain-wrapper.c |  3 ---
 4 files changed, 9 insertions(+), 20 deletions(-)
Config.in.legacy +9 -0
index 01bf900..b92b656 100644
@@ -76,6 +76,15 @@ config BR2_ELF2FLT
 	  BR2_PACKAGE_HOST_ELF2FLT due to the conversion of elf2flt to
 	  the package infrastructure.
 
+config BR2_VFP_FLOAT
+	bool "the ARM VFP floating point option has been renamed"
+	select BR2_LEGACY
+	help
+	  Due to a major refactoring of the floating-point handling of
+	  the ARM architecture support, the BR2_VFP_FLOAT option has
+	  been replaced with a choice of options that allows to select
+	  between various VFP versions/capabilities.
+
 ###############################################################################
 comment "Legacy options removed in 2013.05"
 
toolchain/toolchain-buildroot/Config.in.2 +0 -12
index 9bbf016..5a191f3 100644
@@ -23,16 +23,4 @@ config BR2_TOOLCHAIN_BUILDROOT_USE_SSP
 
 source "package/elf2flt/Config.in.host"
 
-config BR2_VFP_FLOAT
-	bool "Use ARM Vector Floating Point unit"
-	depends on !BR2_SOFT_FLOAT
-	depends on BR2_arm || BR2_armeb
-	help
-	  Setting this option will enable the "-mfpu=vfp" option.
-	  If your ARM CPU has a Vector Floating Point Unit (VFP)
-	  and the toolchain supports the option, then the
-	  code can be optimized.
-
-	  Most people will answer N.
-
 endif
toolchain/toolchain-external/ext-tool.mk +0 -5
index 5c51e06..98a4c59 100644
@@ -196,11 +196,6 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
 TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
 endif
 
-ifeq ($(BR2_VFP_FLOAT),y)
-TOOLCHAIN_EXTERNAL_CFLAGS += -mfpu=vfp
-TOOLCHAIN_EXTERNAL_WRAPPER_ARGS += -DBR_VFPFLOAT=1
-endif
-
 ifeq ($(BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD),y)
 TOOLCHAIN_EXTERNAL_DEPENDENCIES = $(TOOLCHAIN_EXTERNAL_DIR)/.extracted
 endif
toolchain/toolchain-external/ext-toolchain-wrapper.c +0 -3
index e504ff2..d3319e9 100644
@@ -47,9 +47,6 @@ static char *predef_args[] = {
 #ifdef BR_SOFTFLOAT
 	"-msoft-float",
 #endif /* BR_SOFTFLOAT */
-#ifdef BR_VFPFLOAT
-	"-mfpu=vfp",
-#endif /* BR_VFPFLOAT */
 #ifdef BR_64
 	"-m64",
 #endif
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH 7/8 configs: update defconfigs after VFP option changes

In reply to Thomas Petazzoni
---
 configs/calao_snowball_defconfig    | 3 +--
 configs/mx53loco_defconfig          | 3 +--
 configs/qemu_arm_nuri_defconfig     | 3 +--
 configs/qemu_arm_vexpress_defconfig | 3 +--
 4 files changed, 4 insertions(+), 8 deletions(-)
configs/calao_snowball_defconfig +1 -2
index 360ed51..fd9e1b6 100644
@@ -1,10 +1,9 @@
 BR2_arm=y
 BR2_cortex_a9=y
 BR2_GCC_VERSION_4_7_X=y
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_FPU_VFPV3D16=y
 BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
 BR2_TOOLCHAIN_BUILDROOT_CXX=y
-BR2_VFP_FLOAT=y
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
 BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA2"
 BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
configs/mx53loco_defconfig +1 -2
index ff3948b..08de3da 100644
@@ -1,8 +1,7 @@
 # Architecture
 BR2_arm=y
 BR2_cortex_a8=y
-# BR2_SOFT_FLOAT is not set
-BR2_VFP_FLOAT=y
+BR2_ARM_FPU_VFPV3D16=y
 
 # System
 BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
configs/qemu_arm_nuri_defconfig +1 -2
index 27dac27..57c0470 100644
@@ -2,8 +2,7 @@
 BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
-BR2_VFP_FLOAT=y
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_FPU_VFPV3D16=y
 
 # System
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
configs/qemu_arm_vexpress_defconfig +1 -2
index 07b629e..4184da4 100644
@@ -2,8 +2,7 @@
 BR2_arm=y
 BR2_cortex_a9=y
 BR2_ARM_ENABLE_NEON=y
-BR2_VFP_FLOAT=y
-# BR2_SOFT_FLOAT is not set
+BR2_ARM_FPU_VFPV3D16=y
 
 # System
 BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV=y
Signature · 1 line
1.8.1.2
#12 lore raw

PATCH 8/8 toolchain-external: update config options after EABIhf introduction

In reply to Thomas Petazzoni

The introduction of the EABIhf ABI requires a few updates to the configuration options for external toolchains, in order to ensure that the user doesn't do any invalid selection. In detail:

* The Linaro ARM toolchains now depend on BR2_ARM_EABIHF, because that's the ABI they use, and it is incompatible with EABI. The comment about the availability of Linaro toolchains is updated to inform users selecting EABI that they should select EABIhf if they want to see Linaro toolchains.

* The Sourcery CodeBench toolchains now depend on BR2_ARM_EABI, because that's the ABI they use. A comment is added to inform users that have selected EABIhf that Sourcery CodeBench are only available when EABI is used.

* The Arago toolchains now depend on BR2_ARM_EABI, because that's the ABI they use. The description of the ARMv7 Arago toolchain is also slightly improved.

---
 toolchain/toolchain-external/Config.in | 24 ++++++++++++++++++++----
 1 file changed, 20 insertions(+), 4 deletions(-)
toolchain/toolchain-external/Config.in +20 -4
index 946063f..6fd8f1f 100644
@@ -8,6 +8,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_06
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABIHF
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -27,6 +28,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_05
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABIHF
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -46,6 +48,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_04
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABIHF
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -60,14 +63,16 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_2013_04
 
 	  To use this toolchain, you must disable soft float usage.
 
-comment "Linaro toolchains available for Cortex-A{5,8,9,15}"
+comment "Linaro toolchains available for Cortex-A{5,7,8,9,15} and the EABIhf ABI"
 	depends on BR2_arm
 	depends on BR2_GCC_TARGET_ARCH != "armv7-a"
+	depends on !BR2_ARM_EABIHF
 
 config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201305
 	bool "Sourcery CodeBench ARM 2013.05"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -92,6 +97,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201203
 	bool "Sourcery CodeBench ARM 2012.03"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -116,6 +122,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109
 	bool "Sourcery CodeBench ARM 2011.09"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -136,11 +143,17 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_ARM201109
 	      Select BR2_SOFT_FLOAT
 	      Set BR2_TARGET_OPTIMIZATION to -mthumb
 
+comment "Sourcery CodeBench toolchains available for the EABI ABI"
+	depends on BR2_arm
+	depends on !BR2_ARM_EABI
+
 config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109
 	bool "Arago ARMv7 2011.09"
 	depends on BR2_arm
 	depends on BR2_HOSTARCH = "x86_64" || BR2_HOSTARCH = "x86"
 	depends on BR2_GCC_TARGET_ARCH = "armv7-a"
+	depends on BR2_ARM_EABI
+	depends on BR2_ARM_CPU_HAS_VFPV3 || BR2_ARM_CPU_MAYBE_HAS_VFPV3
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
@@ -149,9 +162,11 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV7A_201109
 	  Texas Instruments Arago 2011.09 toolchain, with gcc 4.5.3,
 	  binutils 2.20.1, glibc 2.12, gdb 7.2.
 
-	  This toolchain uses -mfloat-abi=softfp (i.e use FPU
-	  instructions, but pass floating point function arguments in
-	  non-floating point registers).
+	  This toolchain uses -mfloat-abi=softfp (i.e can use FPU
+	  instructions, but passes floating point function arguments
+	  in integer registers), and requires a VFPv3 floating point
+	  unit to work properly. This unit is available on most
+	  Cortex-A ARM processors, but not all.
 
 config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109
 	bool "Arago ARMv5 2011.09"
@@ -160,6 +175,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARAGO_ARMV5TE_201109
 	depends on BR2_GCC_TARGET_ARCH != "armv4t" && \
 		BR2_GCC_TARGET_ARCH != "armv4" && \
 		BR2_GCC_TARGET_ARCH != "armv5t"
+	depends on BR2_ARM_EABI
 	select BR2_TOOLCHAIN_EXTERNAL_GLIBC
 	select BR2_TOOLCHAIN_HAS_NATIVE_RPC
 	select BR2_INSTALL_LIBSTDCPP
Signature · 1 line
1.8.1.2
#13 lore raw

cover ARM floating point improvements and EABIhf support

In reply to Thomas Petazzoni
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Hello,
Thomas> Here is a patch series that improves the support for the various Thomas> floating point possibilities on ARM, and adds support for the new Thomas> EABIhf ARM ABI. Until now, we only had a global BR2_SOFT_FLOAT option Thomas> to enable/disable soft-float support, and on ARM a BR2_VFP_FLOAT Thomas> option to enable -mfpu=vfp. This clearly isn't sufficient to take into Thomas> the various possibilities offered by the Cortex-A ARM cores.

Series looks good (+/- the minor issues I mentioned), but I will wait until you send an update with the oabi stuff from Yann integrated.

Signature · 1 line
Bye, Peter Korsgaard