<div dir="ltr"><div><div><div><div><div>Hi Joel,<br><br></div>     I understood what you tried to point out about the surprise from the<br></div>compiler.  The ISR is supposed to be written as short as possible<br></div>to the point that only a few hardware registers are needed to be<br>
programmed. All the non-essential stuff (e.g. a = b; where a, b are<br>struct timespec) can be done via the rtems_event_send(), which is<br>implemented outside the ISR.  Look at the BSP code in GT64260eth_isr() of<br>
network/if_100MHz/GT64260eth.c and i82544EI_isr() of<br>network/if_1GHz/if_wm.c.  Did you see that any surprise could be<br></div></div><div>triggered by the modern compiler ?   If it does, then either the code<br>should be rewritten or there is a bug in the compiler.<br>
</div><div>BTW, which version of gcc compiler do you mean ?<br><br></div><div>Cheers,<br></div><div>Kate Feng<br></div><div><br><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 12, 2013 at 9:35 AM, Joel Sherrill <span dir="ltr"><<a href="mailto:Joel.Sherrill@oarcorp.com" target="_blank">Joel.Sherrill@oarcorp.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><p dir="ltr"><br>
On Dec 12, 2013 6:25 AM, Matt Wette <<a href="mailto:mwette@alumni.caltech.edu" target="_blank">mwette@alumni.caltech.edu</a>> wrote:<br>
><br>
> But if you don't use FP in ISR you still need to compile the ISR with -fsoft-float because the compiler may dirty the FP registers otherwise.<br>
> For example: a = b; where a, b are struct timespec may be implemented in FP registers.</p>
</div><p dir="ltr">Agreed and that is what I was trying to.point out. If FPU usage by the compiler is implicit and surprising, then you have to be cautious in isr and driver code. </p>
<p dir="ltr">The larger issue is that if this setting is in the BSP's .cfg file, it impacts all user, rtems and bsp code. If desirable, it should be added as an extra addition in Makefile.am for the BSP so its impact is limited to the bsp.</p>
<div><div class="h5"><br>
><br>
> On Dec 11, 2013, at 9:44 PM, Kate Feng <<a href="mailto:kate007.feng@gmail.com" target="_blank">kate007.feng@gmail.com</a>> wrote:<br>
><br>
>> Using -msoft-float is slower than using the hardware FPU.<br>
>> The former one will kill real-time performance. -msoft-float is not<br>
>> recommended to be used at the BSP level, unless the board does not<br>
>> support hardware FP registers.  See more below......<br>
>><br>
>> On Tue, Dec 10, 2013 at 12:36 PM, Joel Sherrill <<a href="mailto:Joel.Sherrill@oarcorp.com" target="_blank">Joel.Sherrill@oarcorp.com</a>> wrote:<br>
>>><br>
>>> GCC for the PowerPC will use floating point registers when you don't expect. Because of this all tasks are implicitly float on PPC. But in the bsp, there is concern for accidentally using the FPU in an ISR. This may be the sole reason soft float is used here.<br>

>><br>
>> If the usage of the FPU could not be avoided in an ISR, then one<br>
>> should explicitly save and restore the FP registers in the ISR.<br>
>><br>
>> Cheers,<br>
>> Kate Feng<br>
>>><br>
>>> Would love to hear from Kate or another PowerPC BSP folks.<br>
>>><br>
>>> On Dec 10, 2013 9:05 AM, Chirayu Desai <<a href="mailto:chirayudesai1@gmail.com" target="_blank">chirayudesai1@gmail.com</a>> wrote:<br>
>>> Sorry for not being clear earlier, I want to know whether -msoft-float is required or not.<br>
>>> If someone using the git HEAD (or RTEMS 4.10 or above) can verify that it is working without a problem, that would be great.<br>
>>> -msoft-float was removed in rtems.git commit 7425411ff581a8f5c92a1266085e7eb1f4debd2b,<br>
>>><br>
>>><br>
>>> On 10 December 2013 22:29, Chirayu Desai <<a href="mailto:chirayudesai1@gmail.com" target="_blank">chirayudesai1@gmail.com</a>> wrote:<br>
>>>><br>
>>>> Hi,<br>
>>>><br>
>>>> <a href="https://www.rtems.org/bugzilla/show_bug.cgi?id=1323" target="_blank">https://www.rtems.org/bugzilla/show_bug.cgi?id=1323</a><br>
>>>> There is still an uncertainty regarding that bug, as the hardware does have a FPU, but looks like it was removed for some reason.<br>
>>>><br>
>>>> git says this was introduced by commit ee732739bf9021a7a22de95eca9095c49b1d9169<br>
>>>><br>
>>>><br>
>>>><br>
>>>> commit ee732739bf9021a7a22de95eca9095c49b1d9169<br>
>>>><br>
>>>> Author: Joel Sherrill <joel.sherrill@OARcorp.com><br>
>>>><br>
>>>> Date:   Thu Sep 13 14:26:24 2007 +0000<br>
>>>><br>
>>>><br>
>>>><br>
>>>>     2007-09-07      Kate Feng <<a href="mailto:feng1@bnl.gov" target="_blank">feng1@bnl.gov</a>><br>
>>>><br>
>>>><br>
>>>><br>
>>>>         * ChangeLog, Makefile.am, README, README.booting, README.irq,<br>
>>>><br>
>>>>         <a href="http://preinstall.am" target="_blank">preinstall.am</a>, GT64260/MVME5500I2C.c, include/bsp.h, irq/irq.c,<br>
>>>><br>
>>>>         irq/irq.h, irq/irq_init.c, pci/detect_host_bridge.c, pci/pci.c,<br>
>>>><br>
>>>>         pci/pci_interface.c, pci/pcifinddevice.c, start/preload.S,<br>
>>>><br>
>>>>         startup/bspclean.c, startup/bspstart.c, startup/pgtbl_activate.c,<br>
>>>><br>
>>>>         startup/reboot.c, vectors/bspException.h, vectors/exceptionhandler.c:<br>
>>>><br>
>>>>         Merge my improvements in this BSP including a new network<br>
>>>><br>
>>>>         driver for the 1GHz NIC.<br>
>>>><br>
>>>>         * network/if_100MHz/GT64260eth.c, network/if_100MHz/GT64260eth.h,<br>
>>>><br>
>>>>         network/if_100MHz/GT64260ethreg.h, network/if_100MHz/Makefile.am,<br>
>>>><br>
>>>>         network/if_1GHz/Makefile.am, network/if_1GHz/POSSIBLEBUG,<br>
>>>><br>
>>>>         network/if_1GHz/if_wm.c, network/if_1GHz/if_wmreg.h,<br>
>>>><br>
>>>>         network/if_1GHz/pci_map.c, network/if_1GHz/pcireg.h: New files.<br>
>>>><br>
>>>><br>
>>>> Anybody here who can test this on actual hardware and verify what is wrong with this?<br>
>>>><br>
>>>><br>
>>>> Thanks.<br>
>>>><br>
>>>> Chirayu Desai<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> rtems-users mailing list<br>
>>> <a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a><br>
>>> <a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
>>><br>
>><br>
>> _______________________________________________<br>
>> rtems-users mailing list<br>
>> <a href="mailto:rtems-users@rtems.org" target="_blank">rtems-users@rtems.org</a><br>
>> <a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
><br>
><br>
</div></div><p></p>
<br>_______________________________________________<br>
rtems-users mailing list<br>
<a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
<a href="http://www.rtems.org/mailman/listinfo/rtems-users" target="_blank">http://www.rtems.org/mailman/listinfo/rtems-users</a><br>
<br></blockquote></div><br></div>