<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
We have discussed this a number of times. The reason we used
-msoft-float to compile the kernel was to avoid spurious FPU
instructions emitted by the compiler even if float/double is not
used in the C code. If this happens in a task which has not enabled
FPU operations (default), a crash will occur (FPU disabled
exception). If the current compiler version has stopped issuing
spurious FPU instructions, then the -msoft-float option can be
removed, but adding -mhard-float is not needed as this is the
default.<br>
<br>
Note also that it is probably impossible to mix non-FPU and FPU
tasks in the same kernel, at least when libm is used. Non-FPU tasks
would need to be linked against the soft-float version of libm,
while FPU tasks would need the hard-float version.<br>
<br>
Just my two cents ...<br>
<br>
Jiri.<br>
<br>
<div class="moz-cite-prefix">On 08/02/16 10:57,
<a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a> wrote:<br>
</div>
<blockquote
cite="mid:8005_1454925428_56B86674_8005_135_1_OFD3E51853.B2ABACB4-ONC1257F53.00365268-C1257F53.0036AA7C@esa.int"
type="cite"><font face="sans-serif" size="2">(slight correction -
I pasted the wrong
output, the binary works fine :-)</font>
<br>
<br>
<font face="sans-serif" size="2">*** BEGIN OF TEST HELLO WORLD ***</font>
<br>
<font face="sans-serif" size="2">Hello World, 93647.304688</font>
<br>
<font face="sans-serif" size="2">*** END OF TEST HELLO WORLD ***</font>
<br>
<br>
<font face="sans-serif" size="2">I am unaware of the proper
etiquette
for this, so I better check - am I allowed to edit the wiki page
at </font><a moz-do-not-send="true"
href="https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support"><font
color="blue" face="sans-serif" size="2">https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</font></a><font
face="sans-serif" size="2">
to add a section about Leon3 native FPU usage and the need for
the patch
I did in leon3.cfg?</font>
<br>
<br>
<font face="sans-serif" size="2">Apologies if I am overstepping -
I just
don't want others to go through the same efforts that I did.</font>
<br>
<br>
<font face="sans-serif" size="2">Kind regards,</font>
<br>
<font face="sans-serif" size="2">Thanassis.</font>
<br>
<br>
<font face="sans-serif" size="2"><b>European Space Agency (via HE
Space)</b></font>
<br>
<font color="#000080" face="sans-serif" size="2">Thanassis
Tsiodras</font>
<br>
<font face="sans-serif" size="2">Real-time Embedded Software
Engineer
</font>
<br>
<font face="sans-serif" size="2">System, Software and Technology
Department</font>
<br>
<br>
<font face="sans-serif" size="2"><b>ESTEC</b></font>
<br>
<font face="sans-serif" size="2">Keplerlaan 1, PO Box 299</font>
<br>
<font face="sans-serif" size="2">NL-2200 AG Noordwijk, The
Netherlands</font>
<br>
<font face="sans-serif" size="2"><a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a> | </font><a
moz-do-not-send="true" href="www.esa.int"><font color="blue"
face="sans-serif" size="2"><a class="moz-txt-link-abbreviated" href="http://www.esa.int">www.esa.int</a></font></a>
<br>
<font face="sans-serif" size="2">T +31 71 565 5332</font>
<br>
<br>
<br>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">From:
</font><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">To:
</font><font face="sans-serif" size="1">"RTEMS List"
<a class="moz-txt-link-rfc2396E" href="mailto:users@rtems.org"><users@rtems.org></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Date:
</font><font face="sans-serif" size="1">08/02/2016 10:50</font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Subject:
</font><font face="sans-serif" size="1">Re: Crash under
sparc/rtems-4.11 when compiling with FPU</font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Sent by:
</font><font face="sans-serif" size="1">"users"
<a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@rtems.org"><users-bounces@rtems.org></a></font>
<br>
<hr noshade="noshade">
<br>
<br>
<br>
<font face="sans-serif" size="2">I verified Sebastian's suggestion
-
by modifying the leon3.cfg file...</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
diff --git
a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg
b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
index 58f2f07..30fc3a4 100644</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
--- a/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
+++ b/c/src/lib/libbsp/sparc/leon3/make/custom/leon3.cfg</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
@@ -9,7 +9,8 @@ RTEMS_CPU_MODEL=leon3</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
# This contains the compiler options necessary to
select the CPU model</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
# and (hopefully) optimize for it.</font><font size="3">
</font><font face="sans-serif" size="2"><br>
-CPU_CFLAGS = -mcpu=cypress -msoft-float</font><font size="3">
</font><font face="sans-serif" size="2"><br>
+CPU_CFLAGS = -mcpu=cypress -mhard-float</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
...the generated binary of hello.exe works fine - I went a step
further
and did a test calculation, too:</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
diff --git a/testsuites/samples/hello/init.c
b/testsuites/samples/hello/init.c</font><font size="3">
</font><font face="sans-serif" size="2"><br>
index d8fe450..6ee33f6 100644</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
--- a/testsuites/samples/hello/init.c</font><font size="3">
</font><font face="sans-serif" size="2"><br>
+++ b/testsuites/samples/hello/init.c</font><font size="3">
</font><font face="sans-serif" size="2"><br>
@@ -27,8 +27,13 @@ rtems_task Init(</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
rtems_task_argument ignored</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
)</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
{</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
+ int i = 0;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+ float a=3.14159f, b=1.0f;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
rtems_test_begin();</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
- printf( "Hello World\n" );</font><font size="3">
</font><font face="sans-serif" size="2"><br>
+ for (i=0; i<10; i++)</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+ b*=a;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
+ printf( "Hello World, %f\n", b );</font><font size="3">
</font><font face="sans-serif" size="2"><br>
rtems_test_end();</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
exit( 0 );</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
}</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
...which worked fine:</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
(gdb) tar extended-remote ... ( to grmon)</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
(gdb) c</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
Continuing.</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
*** BEGIN OF TEST HELLO WORLD ***</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Hello World, 1.000000</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
*** END OF TEST HELLO WORLD ***</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
...and I made sure that FPU instructions are inside:</font><font
size="3">
<br>
</font><font face="sans-serif" size="2"><br>
for (i=0; i<10; i++)</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
28: 82 80 7f ff addcc %g1,
-1, %g1</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
2c: 12 bf ff ff bne 28
<Init+0x28></font><font size="3"> </font><font
face="sans-serif" size="2"><br>
30: 91 a2 09 29 fmuls %f8,
%f9, %f8</font><font size="3"> </font><font face="sans-serif"
size="2"><br>
b*=a;</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
printf( "Hello World, %f\n", b );</font><font size="3">
</font><font face="sans-serif" size="2"><br>
34: 91 a0 19 28 fstod %f8,
%f8</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
So, executive summary.... It seems that the default compilation
settings
of the Leon3 BSP forbid "real FPU" work. <br>
If one needs to work in native (non-emulated) FPU mode, then the
leon3.cfg
must be patched as I showed above. </font><font size="3"><br>
</font><font face="sans-serif" size="2"><br>
In the long run, as Sebastian indicated, a leon3fp (and a
corresponding
leon2fp, I imagine) <br>
should ideally be added as new BSP targets - and the FPU page</font><font
size="3">
</font><font face="sans-serif" size="2"><br>
(</font><a moz-do-not-send="true"
href="https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support"><font
color="blue" face="sans-serif" size="2"><u>https://devel.rtems.org/wiki/TBR/UserManual/Floating_Point_Support</u></font></a><font
face="sans-serif" size="2">)
should probably <br>
be updated to indicate this.</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
Thanks to everyone for their help,</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Thanassis.</font><font size="3"> <br>
<br>
</font><font face="sans-serif" size="2"><b><br>
European Space Agency (via HE Space)</b></font><font size="3">
</font><font color="#000080" face="sans-serif" size="2"><br>
Thanassis Tsiodras</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Real-time Embedded Software Engineer <br>
System, Software and Technology Department</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><b><br>
ESTEC</b></font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Keplerlaan 1, PO Box 299</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
NL-2200 AG Noordwijk, The Netherlands</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
<a class="moz-txt-link-abbreviated" href="mailto:Athanasios.Tsiodras@esa.int">Athanasios.Tsiodras@esa.int</a> | </font><a moz-do-not-send="true"
href="www.esa.int"><font color="blue" face="sans-serif" size="2"><u>www.esa.int</u></font></a><font
size="3">
</font><font face="sans-serif" size="2"><br>
T +31 71 565 5332</font><font size="3"> <br>
<br>
<br>
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
From: </font><font face="sans-serif" size="1">"Sebastian
Huber" <a class="moz-txt-link-rfc2396E" href="mailto:sebastian.huber@embedded-brains.de"><sebastian.huber@embedded-brains.de></a></font><font
size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
To: </font><font face="sans-serif" size="1">"RTEMS
List" <a class="moz-txt-link-rfc2396E" href="mailto:users@rtems.org"><users@rtems.org></a></font><font size="3"> </font><font
color="#5f5f5f" face="sans-serif" size="1"><br>
Cc: </font><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:software@gaisler.com">software@gaisler.com</a></font><font
size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Date: </font><font face="sans-serif" size="1">07/02/2016
07:40</font><font size="3"> </font><font color="#5f5f5f"
face="sans-serif" size="1"><br>
Subject: </font><font face="sans-serif" size="1">Re:
Crash under sparc/rtems-4.11 when compiling with FPU</font><font
size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Sent by: </font><font face="sans-serif" size="1">"users"
<a class="moz-txt-link-rfc2396E" href="mailto:users-bounces@rtems.org"><users-bounces@rtems.org></a></font><font size="3"> <br>
</font>
<hr noshade="noshade"><font size="3"><br>
<br>
</font><tt><font size="2"><br>
Hello Athanasios,<br>
<br>
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.<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>
<a class="moz-txt-link-abbreviated" href="mailto:users@rtems.org">users@rtems.org</a></font></tt><font color="blue" size="3"><u><br>
</u></font><a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/users"><tt><font
color="blue" size="2"><u>http://lists.rtems.org/mailman/listinfo/users</u></font></tt></a><font
size="3">
</font>
<br>
<tt><font size="3">This message and any attachments are intended
for
the use of the addressee or addressees only.<br>
The unauthorised disclosure, use, dissemination or copying
(either in whole
or in part) of its<br>
content is not permitted.<br>
If you received this message in error, please notify the
sender and delete
it from your system.<br>
Emails can be altered and their integrity cannot be guaranteed
by the sender.<br>
<br>
Please consider the environment before printing this email.<br>
</font></tt><tt><font size="2">_______________________________________________<br>
users mailing list<br>
<a class="moz-txt-link-abbreviated" href="mailto:users@rtems.org">users@rtems.org</a><br>
</font></tt><a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/users"><tt><font
size="2">http://lists.rtems.org/mailman/listinfo/users</font></tt></a>
<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>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@rtems.org">users@rtems.org</a>
<a class="moz-txt-link-freetext" href="http://lists.rtems.org/mailman/listinfo/users">http://lists.rtems.org/mailman/listinfo/users</a></pre>
</blockquote>
<br>
</body>
</html>