wandboard / imx6 hard float

Andrew Turner andrew at fubar.geek.nz
Fri Feb 28 19:25:46 UTC 2014


On Thu, 27 Feb 2014 20:23:47 -0700
Ian Lepore <ian at FreeBSD.org> wrote:

> After some testing last week I determined that hard float works on
> imx6, so I enabled it (added option VFP) in the kernel configs.  To
> check whether it's enabled, see if "sysctl hw.floatingpoint" is set
> to 1.
> 
> To actually use the hardware floating point you have to add some
> options to CFLAGS:
> 
>       * For clang CFLAGS="-mfloat-abi=softfp"
>       * For gcc   CFLAGS="-mfloat-abi=softfp -mfpu=vfp"
>       * You can do that on the make command line, in the environment,
> or in /etc/make.conf.
> 
> I think the implication of float-abi=softfp is that floating point
> arguments are passed in integer registers, and we're losing some
> performance with that.  But as I vaguely understand it, we're still
> missing some piece of support code to enable full eabihf.  Maybe
> somebody who knows the status of that can fill in my hand-wavy blanks.

You are correct. There are three values for float-abi:
 * soft - Use the software float library, pass float vales in
   integer registers. This is what we are currently using.
 * softfp - Use the VFP unit where available, also pass float values in
   integer registers
 * hard - Use the VFP unit where available, pass float values in vfp
   registers.

The soft and softfp variants of the ABI are binary compatible. I am
considering changing the default armv6 ABI to softfp as, as far as I
can tell, all SoCs we support have a VFP unit. However it may be better
to move to a hard-float ABI and leave armv6 as it is.

The main thing blocking adding support for armv6hf was clang was
missing the FreeBSD code to handle it, and our version of GCC is too
old to support vfp with ARM EABI hard float. I also have some changes
to the EABI helper functions to add a hard-float version. Most software
compiled for the hardfloat ABI will not need them, however someone may
call one of these functions directly so we should provide them.

Andrew



More information about the freebsd-arm mailing list