Problems with floating-point support on ARM

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Sep 10 11:29:35 UTC 2009


Ralf Corsepius wrote:
> On 09/10/2009 11:06 AM, Sebastian Huber wrote:
>> Hi,
>>
>> RTEMS currently supports only soft-float ARM
> What makes you say so?

cat cpukit/score/cpu/arm/rtems/score/arm.h

> 
>> The
>> default floating-point model for GCC on ARM is FPA.
> AFAICT, correct.
> 
>> That means (excerpt from the corresponding ARM document):
>>
>> Little-endian double-precision values are neither pure little-endian
>> nor pure
>> big-endian.
>>
>> This differs from that more recent VFP (Vectored Floatin-Point
>> architecture).
>>
>> In IEEE 754 we have the following double format:
>>
>> least significant word (lsw): fraction [31:0]
>> moast significant word (msw): sign | exponent | fraction [51:32]
>>
>> This will be stored in different ways:
>>
>>                   VFP LE    VFP BE    FPA
>> lower address       lsw       msw    msw
>> higher address      msw       lsw    lsw
>>
>> The important thing here is that on little-endian the msw and lsw are
>> switched.
>> Newlib does not support the FPA floating-point model on little-endian.
> What is missing according to your view?

It would require to much work to support FPA on little-endian in newlib.

> 
>> In this
>> case it produces wrong results and writes to arbitrary memory locations.
>>
>> A possible fix is to add the following options to the GCC
>> configuration command
>> line:
>>
>>      --with-float=soft
>>      --with-fpu=vfp
>>
>> The VFP floating-point hardware model is not implemented in GCC,
> What makes you say so?
> 
> What I see inside of the GCC source code speaks, doesn't match with your
> claim.

arm-rtems4.10-gcc -mfpu=vfp -mfloat-abi=hard test.c
test.c:1: sorry, unimplemented: -mfloat-abi=hard and VFP

> 
>> thus the
>> hard-float multilibs have to be disabled in gcc/config/arm/t-rtems.
> 
> Let me bring this hardly readable verbosity to the point: What do you
> want us to do?
> 
> Do you want us to change the default fpu to vfp instead of fpa?

Yes.

> 
> Comments from other arm users? Will vfp work for your boards?
> 
> Ralf
> 


-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list