FLOATING POINT with rtems

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Dec 3 10:52:21 UTC 2013


On 2013-12-03 10:10, Jiri Gaisler wrote:
>
>
> On 12/03/2013 09:02 AM, Sebastian Huber wrote:
>
>> Recent GCCs will use (at least on PowerPC and ARM) floating point registers for integer operations if the register pressure is high for example.  So this separate integer/floating point context is an anachronism on these targets. Due to this the VFP/Neon on ARM and the
>> SPE/Altivec for PowerPC context is part of the normal thread context since also interrupt handlers may use the floating point unit (GCC may use for example the multi-byte vector copy operations).
>>
>> Are the soft-float and hard-float ABIs compatible on SPARC?
>
> Yes, floats/doubles are always passed in integer registers.

Ok, this is good.

The only drawback I see at the moment is that, in case we don't use the FPU, 
then we still reserve space for the FPU contexts in the workspace and carry 
some dead code around.

The current situation is confusing for users.  So we should either add a FPU 
BSP variant or use the proposal from Jiri.

>
>> What happens if we call a hard-float Newlib function with floating-point arguments inside a soft-float RTEMS library?
>
>
> Newlib (and libgcc) are compiled with multi-lib, so if -msoft-float is given
> during linking then soft-float routines will be pulled in. Without -msoft-float,
> hard-floats will be pulled in (default). There is pathological case where a
> task without the floating-point attribute can cause an FPU disabled trap because
> gcc used %fp registers for integers. This can happen on hard-float targets
> where not all tasks are supposed to use the FPU. To avoid this, all
> task would need to have the floating-point attribute set (on hard-float targets).
>
> Ideally, there should be an option in gcc to avoid storing floats in
> integer registers (other than -msoft-float) ...

My impression is that such an option won't be accepted by mainline GCC.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
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