两篇关于ARM VFP的邮件
下面是两篇关于ARM VFP的邮件:
===========================================================
第一篇:VFPv3 Compiler Option
===========================================================
Amit Mandil wrote:
> Hi,
>
> I am using GNU ARM Toolchain for GNU/Linux as host and target both.
> I have seen two compiler options available for VFP instructions in its
> source- vfp and vfp3.
>
> I am using -mfpu=vfp3 for vfpv3 instructions. Am I right or it is meant
> for something else? Please reply!!
That should be fine. Note that you'll also need "-mfloat-abi=softfp" to
get the compiler to emit VFP instructions.
Julian
===========================================================
第二篇:
[arm-gnu] Best library for transcendental functions (sin, cos) for ARM with VFP
===========================================================
On Fri, Jun 15, 2007 at 12:24:00PM -0400, Michael Bergandi wrote:
> I am working on an embedded application that makes extensive use of
> floating point and transcendental functions (ie. sin, cos). The
> target is an arm1136jf-s, which has a VFP unit. The application is
> being compiled with your tool chain (arm-2006q3) using:
>
> CFLAGS = -mcpu=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp -static
> -Wall -O3
The use of -mfpu=vfp is only needed for older toolchains. The
(-mfloat-abi=softfp) will enable the use of the VFP.
> The problem is that performing any transcendentals are extremely
> slow. From my research, I know that the transcendentals are being
> trapped and pushed up to the kernel to handle in software. I'm fine
> with that. However, the implementation in software is done using
> Taylor series approximations that contain mostly floating point
> multiplication and can certainly be accelerated in the VFP.
> Unfortunately, it does not seem that this is being done.
Transcendentals are not trapped and pushed up to the kernel, they are
computed in userspace by the glibc libm functions.
CodeSourcery currently provides a software floating point math library
(-mfloat-abi=soft), and this means that the VFP is not used to
accelerate transcendentals.
CodeSourcery does have plans for enabling accelerated math functions.
> My application is running on top of a 2.6.19 kernel that was
> generated using the Freescale Linux Target Image Builder package
> (that also uses your cross-compiler). The kernel was compiled using
> the following flags:
>
> CFLAGS = -march=armv6 -mtune=arm1136j-s -O2 -fsigned-char
> -mabi=aapcs-linux -mfpu=vfp -mfloat-abi=softfp
This means your kernel uses VFP instructions, but not neccessarily
userspace, and not the provided libm.
> Do you have any suggestions as to how I might improve this
> performance problem? -- Is the math library in one library package
> faster than another? -- Can I rebuild the a library with the VFP
> enabling compiler flags? Would that help?
If you need fast transcendental functions I recommend implementing them
yourself or using a 3rd party library and compiling with
(-mfloat-abi=softfp).
Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716
===========================================================

0 Comments:
Post a Comment
<< Home