Crash under sparc/rtems-4.11 when compiling with FPU

Athanasios.Tsiodras at esa.int Athanasios.Tsiodras at esa.int
Mon Feb 8 09:06:49 UTC 2016


Hi, Jiri.

You are right that this is the default (see quick test output below). If I 
understood him corectly, though, I think that Sebastian is saying that the 
default settings of the Leon3 BSP compilation ("-msoft-float " - see 
"c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg") do not allow me to 
use "-mhard-float" in my application code. The documentation seems to 
contradict him, stating that I should be able to, and that "deferred 
floating point context switch" is a feature, not a bug). I will try his 
suggestion anyway - I patched the .cfg and am currentlly building the BSP 
with -mhard-float - will report back whether this solves the issue or not.

$ cat foo.c
void foo()
{
        float a=1;
        float b;
        b= a*a;
}

$ sparc-rtems4.11-gcc -c foo.c

$ sparc-rtems4.11-objdump -S foo.o

Disassembly of section .text:
00000000 <foo>:
  ...
  1c:   91 a2 49 28     fmuls  %f9, %f8, %f8
  ...


European Space Agency (via HE Space)
Thanassis Tsiodras
Real-time Embedded Software Engineer 
System, Software and Technology Department

ESTEC
Keplerlaan 1, PO Box 299
NL-2200 AG Noordwijk, The Netherlands
Athanasios.Tsiodras at esa.int | www.esa.int
T +31 71 565 5332



From:   "Jiri Gaisler" <jiri at gaisler.se>
To:     "Sebastian Huber" <sebastian.huber at embedded-brains.de>, "RTEMS 
List" <users at rtems.org>
Cc:     software at gaisler.com
Date:   07/02/2016 10:59
Subject:        Re: Crash under sparc/rtems-4.11 when compiling with FPU
Sent by:        "users" <users-bounces at rtems.org>



On 07/02/16 07:41, Sebastian Huber wrote:
> Hello Athanasios,
>
> it was always a miracle to me how you are supposed to use the 
leon2/leon3 BSPs with a FPU. If you want to use the FPU, then the BSP must 
be built with the -mhard-float option, otherwise the FPU support is not 
enabled in the operating system support. In addition the application 
configuration must be compiled with exactly the same compiler flags as the 
BSP, otherwise it will generate a corrupt configuration.
>
> I think we need leon2fp and leon3fp BSPs, which use -mhard-float.
>

Isn't -mhard-float the default setting in gcc? -msoft-float is used to
force software emulation of the FPU, otherwise FPU instructions are
issued by default.

Jiri.
_______________________________________________
users mailing list
users at rtems.org
http://lists.rtems.org/mailman/listinfo/users


This message and any attachments are intended for the use of the addressee or addressees only.
The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its
content is not permitted.
If you received this message in error, please notify the sender and delete it from your system.
Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160208/78e178fc/attachment-0002.html>


More information about the users mailing list