[llvmlinux] ARM -mfpu=-softvfp+vfp

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Feb 20 16:33:11 UTC 2014


On Thu, Feb 20, 2014 at 04:56:18PM +0100, Arnd Bergmann wrote:
> On Wednesday 19 February 2014, Behan Webster wrote:
> > Cc-ing Arnd Bergmann as he is relevant to this discussion.
> > On 02/19/14 03:18, Renato Golin wrote:
> > > Folks,
> > >
> > > Following bug:
> > >
> > > http://llvm.org/bugs/show_bug.cgi?id=18689
> > >
> > > I think the fix for the second problem (softvfp) is *also* to change
> > > the compilation flags.
> > >
> > > The rationale is in Bernie's email:
> > >
> > > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140217/099354.html
> > >
> > > Mainly that "softvfp+vfp" is ambiguous in many different ways and
> > > implementing it would be promoting differences between the compilers,
> > > rather than bringing them back together.
> > >
> > > Also, we need first to ask what do GAS need to know about the PCS? Is
> > > this just something that unknowingly got in for the Android build?
> > > Does that flag really needs to be passed in that way, or can it be
> > > just -Wa,-mfpu=vfp + -mfloat-abi=softfp? That has the same behaviour
> > > on the compiler and is supported by both LLVM and GCC.
> > Arnd Bergman is likely the right person to ask about the flags set in 
> > arch/arm/vp/Makefile
> 
> I don't even know what -mfpu=softvfp+vfp means, and I can't find it
> in the documentation.
> > 
> > KBUILD_AFLAGS   :=$(KBUILD_AFLAGS:-msoft-float=-Wa,-mfpu=softvfp+vfp 
> > -mfloat-abi=soft)
> > 
> > Would there be issues in changing the flags to -Wa,-mfpu=vfp 
> > -mfloat-abi=softfp?
> 
> I added the -mfload-abi=softfp part in the Makefile to work around a
> problem with hardfloat gcc, but the bug you are linking to seems to be
> more concerned about the -mfpu=softvfp+vfp part being hard.
> 
> That was added by Russell in
> http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/commit/?id=1a6be26d5b1a86f66ef60e5b73bae64d50873724
> 
> Maybe he knows what will work for you.
> 
> What we want to achieve is to build the file that uses vfp instructions,
> independent of what CPU we are targetting and whether the compiler
> defaults to soft-float or hard-float ABI.

Well, first thing to realise is that it's not -mfpu=softvfp+vfp at all.
It's -Wa,-mfpu=softvfp+vfp.  So it's a binutils option, not a C compiler
option, so the binutils documentation is relevant:

`-mfpu=FLOATING-POINT-FORMAT'
     This option specifies the floating point format to assemble for.
     The assembler will issue an error message if an attempt is made to
     assemble an instruction which will not execute on the target
     floating point unit.  The following format options are recognized:
     `softfpa', `fpe', `fpe2', `fpe3', `fpa', `fpa10', `fpa11',
     `arm7500fe', `softvfp', `softvfp+vfp', `vfp', `vfp10', `vfp10-r0',
     `vfp9', `vfpxd', `vfpv2', `vfpv3', `vfpv3-fp16', `vfpv3-d16',
     `vfpv3-d16-fp16', `vfpv3xd', `vfpv3xd-d16', `vfpv4', `vfpv4-d16',
     `fpv4-sp-d16', `arm1020t', `arm1020e', `arm1136jf-s', `maverick',
     `neon', and `neon-vfpv4'.

This is done to ensure that the assembler accepts the VFP instructions
it's given, and builds them without warning/error irrespective of the
CPU architecture being built for.

-- 
FTTC broadband for 0.8mile line: 5.8Mbps down 500kbps up.  Estimation
in database were 13.1 to 19Mbit for a good line, about 7.5+ for a bad.
Estimate before purchase was "up to 13.2Mbit".


More information about the LLVMLinux mailing list