Friday, 11 September 2015

Re: [gccsdk] How to get hardware vfp with GCC?

On 11/09/15 14:32, Gavin Wraith wrote:
> Thanks very much for all the useful advice. How do I get GCC
> to produce VFP in hardware, for a Raspberry Pi 2?
> It looks as if ARMv6 has been set as a default - OK for
> Raspberry Pi 1 but not 2. Not quite sure that I understand
> what FPA means here:

FPA means Floating Point Accelerator, or in our case the Floating
Point Emulator module. This is what the SharedCLibrary uses.
By default GCC replaces actual FP instructions with function
calls to a C library (libgcc).

> error: sys.o uses FPA instructions, whereas so.riscos does not
> error: sys.o uses hardware FP, whereas so.riscos uses software FP
>
> My CFLAGS for GCC contain "-mfpu=vfp". What more is needed to ensure
> hardware FP?

The use of hardware and software here is somewhat confusing and
does give the impression that it's referring to hardware instructions
or software functions.

In fact this is a reference to the calling convention of functions, ie,
how FP values are passed and returned to and from functions.

Hardware means that values are passed via FP hardware registers such as
f0 on the old FPA, or s0 on VFP.
Software means that values are bit converted to an integer
representation and passed via integer registers (r0-r3).

Obviously, it's important that the caller and callee agree on the
convention which is why the linker is complaining.

So -mfpu-vfp will give you VFP hardware instructions, but the calling
convention is software. AFAIK, we don't have a VFP+Hard combination.

Does specifying -fpu=SoftVFP to asasm when building sys.o not fix
the problem?

Lee.


_______________________________________________
GCCSDK mailing list gcc@gccsdk.riscos.info
Bugzilla: http://www.riscos.info/bugzilla/index.cgi
List Info: http://www.riscos.info/mailman/listinfo/gcc
Main Page: http://www.riscos.info/index.php/GCCSDK

No comments:

Post a Comment