<font size=2 face="sans-serif">I added a section to the FPU page (</font><a href=https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support><font size=2 color=blue face="sans-serif">https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</font></a><font size=2 face="sans-serif">)
- hope it helps the next person dealing with this.</font>
<br><font size=2 face="sans-serif">I hope Daniel Hellström  replies
with the code that used to trigger the compiler bug - we will then be able
to make sure the bug is gone now, and finally put this to rest.</font>
<br>
<br><font size=2 face="sans-serif"><b>HE Space for ESA - European Space
Agency</b></font>
<br><font size=2 color=#000080 face="sans-serif">Thanassis Tsiodras</font>
<br><font size=2 face="sans-serif">Real-time Embedded Software Engineer
</font>
<br><font size=2 face="sans-serif">System, Software and Technology Department</font>
<br>
<br><font size=2 face="sans-serif"><b>ESTEC</b></font>
<br><font size=2 face="sans-serif">Keplerlaan 1, PO Box 299</font>
<br><font size=2 face="sans-serif">NL-2200 AG Noordwijk, The Netherlands</font>
<br><font size=2 face="sans-serif">Athanasios.Tsiodras@esa.int | </font><a href=www.esa.int><font size=2 color=blue face="sans-serif">www.esa.int</font></a>
<br><font size=2 face="sans-serif">T +31 71 565 5332</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From:      
 </font><font size=1 face="sans-serif">"Gedare Bloom"
<gedare@rtems.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:      
 </font><font size=1 face="sans-serif">"Hugues Jérôme"
<hugues.jerome@gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc:      
 </font><font size=1 face="sans-serif">Athanasios.Tsiodras@esa.int,
"RTEMS List" <users@rtems.org></font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:      
 </font><font size=1 face="sans-serif">08/02/2016 17:41</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:    
   </font><font size=1 face="sans-serif">Re: Crash under
sparc/rtems-4.11 when compiling with FPU</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by:    
   </font><font size=1 face="sans-serif">gedare@gwmail.gwu.edu</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Please disregard the TBR notice, and feel free to
modify/update the<br>
page. This "TBR" is a misnomer of sorts. Many of these pages
are<br>
slated to be copied to a website other than the wiki. Or in this case,<br>
into some sort of user manual that is pending. It was a mistake to use<br>
this TBR lingo.<br>
<br>
On Mon, Feb 8, 2016 at 6:14 AM, Hugues Jérôme <hugues.jerome@gmail.com>
wrote:<br>
> Hi,<br>
><br>
> The root of the wiki you point to is:<br>
><br>
> To Be Removed<br>
><br>
> All pages under /TBR/* are slated to be removed.<br>
><br>
><br>
> If memory serves me, these were created when ritems.org has been<br>
> reorganized.<br>
> Note sure it is a good idea to change this<br>
><br>
><br>
><br>
> Le 8 févr. 2016 à 10:57, Athanasios.Tsiodras@esa.int a écrit :<br>
><br>
> (slight correction - I pasted the wrong output, the binary works fine
:-)<br>
><br>
> *** BEGIN OF TEST HELLO WORLD ***<br>
> Hello World, 93647.304688<br>
> *** END OF TEST HELLO WORLD ***<br>
><br>
> I am unaware of the proper etiquette for this, so I better check -
am I<br>
> allowed to edit the wiki page at<br>
> </font></tt><a href=https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support><tt><font size=2>https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</font></tt></a><tt><font size=2>
to add a<br>
> section about Leon3 native FPU usage and the need for the patch I
did in<br>
> leon3.cfg?<br>
><br>
> Apologies if I am overstepping - I just don't want others to go through
the<br>
> same efforts that I did.<br>
><br>
> Kind regards,<br>
> Thanassis.<br>
><br>
> European Space Agency (via HE Space)<br>
> Thanassis Tsiodras<br>
> Real-time Embedded Software Engineer<br>
> System, Software and Technology Department<br>
><br>
> ESTEC<br>
> Keplerlaan 1, PO Box 299<br>
> NL-2200 AG Noordwijk, The Netherlands<br>
> Athanasios.Tsiodras@esa.int | </font></tt><a href=www.esa.int><tt><font size=2>www.esa.int</font></tt></a><tt><font size=2><br>
> T +31 71 565 5332<br>
><br>
><br>
><br>
> From:        Athanasios.Tsiodras@esa.int<br>
> To:        "RTEMS List" <users@rtems.org><br>
> Date:        08/02/2016 10:50<br>
> Subject:        Re: Crash under sparc/rtems-4.11
when compiling with FPU<br>
> Sent by:        "users" <users-bounces@rtems.org><br>
> ________________________________<br>
><br>
><br>
><br>
> I verified Sebastian's suggestion - by modifying the leon3.cfg file...<br>
><br>
>    diff --git a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg<br>
> b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg<br>
>    index 58f2f07..30fc3a4 100644<br>
>    --- a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg<br>
>    +++ b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg<br>
>    @@ -9,7 +9,8 @@ RTEMS_CPU_MODEL=leon3<br>
><br>
>     #  This contains the compiler options necessary
to select the CPU model<br>
>     #  and (hopefully) optimize for it.<br>
>    -CPU_CFLAGS = -mcpu=cypress -msoft-float<br>
>    +CPU_CFLAGS = -mcpu=cypress -mhard-float<br>
><br>
> ...the generated binary of hello.exe works fine - I went a step further
and<br>
> did a test calculation, too:<br>
><br>
>    diff --git a/testsuites/samples/hello/init.c<br>
> b/testsuites/samples/hello/init.c<br>
>    index d8fe450..6ee33f6 100644<br>
>    --- a/testsuites/samples/hello/init.c<br>
>    +++ b/testsuites/samples/hello/init.c<br>
>    @@ -27,8 +27,13 @@ rtems_task Init(<br>
>       rtems_task_argument ignored<br>
>     )<br>
>     {<br>
>    +  int i = 0;<br>
>    +  float a=3.14159f, b=1.0f;<br>
>    +<br>
>       rtems_test_begin();<br>
>    -  printf( "Hello World\n" );<br>
>    +  for (i=0; i<10; i++)<br>
>    +      b*=a;<br>
>    +  printf( "Hello World, %f\n", b );<br>
>       rtems_test_end();<br>
>       exit( 0 );<br>
>     }<br>
><br>
> ...which worked fine:<br>
><br>
>    (gdb) tar extended-remote ... ( to grmon)<br>
>    (gdb) c<br>
>    Continuing.<br>
><br>
>    *** BEGIN OF TEST HELLO WORLD ***<br>
>    Hello World, 1.000000<br>
>    *** END OF TEST HELLO WORLD ***<br>
><br>
> ...and I made sure that FPU instructions are inside:<br>
><br>
>      for (i=0; i<10; i++)<br>
>      28:   82 80 7f ff     addcc  %g1,
-1, %g1<br>
>      2c:   12 bf ff ff     bne  28
<Init+0x28><br>
>      30:   91 a2 09 29     fmuls  %f8,
%f9, %f8<br>
>          b*=a;<br>
>      printf( "Hello World, %f\n", b );<br>
>      34:   91 a0 19 28     fstod  %f8,
%f8<br>
><br>
> So, executive summary....  It seems that the default compilation
settings of<br>
> the Leon3 BSP forbid "real FPU" work.<br>
> If one needs to work in native (non-emulated) FPU mode, then the leon3.cfg<br>
> must be patched as I showed above.<br>
><br>
> In the long run, as Sebastian indicated, a leon3fp (and a corresponding<br>
> leon2fp, I imagine)<br>
> should ideally be added as new BSP targets - and the FPU page<br>
> (</font></tt><a href=https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support><tt><font size=2>https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</font></tt></a><tt><font size=2>)
should<br>
> probably<br>
> be updated to indicate this.<br>
><br>
> Thanks to everyone for their help,<br>
> Thanassis.<br>
><br>
><br>
> European Space Agency (via HE Space)<br>
> Thanassis Tsiodras<br>
> Real-time Embedded Software Engineer<br>
> System, Software and Technology Department<br>
><br>
> ESTEC<br>
> Keplerlaan 1, PO Box 299<br>
> NL-2200 AG Noordwijk, The Netherlands<br>
> Athanasios.Tsiodras@esa.int | </font></tt><a href=www.esa.int><tt><font size=2>www.esa.int</font></tt></a><tt><font size=2><br>
> T +31 71 565 5332<br>
><br>
><br>
><br>
> From:        "Sebastian Huber" <sebastian.huber@embedded-brains.de><br>
> To:        "RTEMS List" <users@rtems.org><br>
> Cc:        software@gaisler.com<br>
> Date:        07/02/2016 07:40<br>
> Subject:        Re: Crash under sparc/rtems-4.11
when compiling with FPU<br>
> Sent by:        "users" <users-bounces@rtems.org><br>
> ________________________________<br>
><br>
><br>
><br>
> Hello Athanasios,<br>
><br>
> it was always a miracle to me how you are supposed to use the leon2/leon3<br>
> BSPs with a FPU. If you want to use the FPU, then the BSP must be
built with<br>
> the -mhard-float option, otherwise the FPU support is not enabled
in the<br>
> operating system support. In addition the application configuration
must be<br>
> compiled with exactly the same compiler flags as the BSP, otherwise
it will<br>
> generate a corrupt configuration.<br>
><br>
> I think we need leon2fp and leon3fp BSPs, which use -mhard-float.<br>
><br>
> --<br>
> Sebastian Huber, embedded brains GmbH<br>
><br>
> Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
> Phone   : +49 89 189 47 41-16<br>
> Fax     : +49 89 189 47 41-09<br>
> E-Mail  : sebastian.huber at embedded-brains.de<br>
> PGP     : Public key available on request.<br>
><br>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br>
> _______________________________________________<br>
> users mailing list<br>
> users@rtems.org<br>
> </font></tt><a href=http://lists.rtems.org/mailman/listinfo/users><tt><font size=2>http://lists.rtems.org/mailman/listinfo/users</font></tt></a><tt><font size=2><br>
> This message and any attachments are intended for the use of the addressee<br>
> or addressees only.<br>
> The unauthorised disclosure, use, dissemination or copying (either
in whole<br>
> or in part) of its<br>
> content is not permitted.<br>
> If you received this message in error, please notify the sender and
delete<br>
> it from your system.<br>
> Emails can be altered and their integrity cannot be guaranteed by
the<br>
> sender.<br>
><br>
> Please consider the environment before printing this email.<br>
> _______________________________________________<br>
> users mailing list<br>
> users@rtems.org<br>
> </font></tt><a href=http://lists.rtems.org/mailman/listinfo/users><tt><font size=2>http://lists.rtems.org/mailman/listinfo/users</font></tt></a><tt><font size=2><br>
><br>
> This message and any attachments are intended for the use of the addressee<br>
> or addressees only.<br>
> The unauthorised disclosure, use, dissemination or copying (either
in whole<br>
> or in part) of its<br>
> content is not permitted.<br>
> If you received this message in error, please notify the sender and
delete<br>
> it from your system.<br>
> Emails can be altered and their integrity cannot be guaranteed by
the<br>
> sender.<br>
><br>
> Please consider the environment before printing this email.<br>
><br>
> _______________________________________________<br>
> users mailing list<br>
> users@rtems.org<br>
> </font></tt><a href=http://lists.rtems.org/mailman/listinfo/users><tt><font size=2>http://lists.rtems.org/mailman/listinfo/users</font></tt></a><tt><font size=2><br>
><br>
><br>
><br>
> _______________________________________________<br>
> users mailing list<br>
> users@rtems.org<br>
> </font></tt><a href=http://lists.rtems.org/mailman/listinfo/users><tt><font size=2>http://lists.rtems.org/mailman/listinfo/users</font></tt></a><tt><font size=2><br>
</font></tt>
<br><PRE>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.
</PRE>