[ECOS] Floating Point Register saves

Bob Koninckx bob.koninckx@o-3s.com
Tue Sep 28 22:20:00 GMT 2004

On Tue, 2004-09-28 at 11:20, Nick Garnett wrote
> In theory using the FPU in ISRs and DSRs is allowed, there is code to
> save and restore the FPU state in both lazy and non-lazy
> configurations. Of course this has not been exercised very much and
> may contain bugs. You may have to some debugging.
> However, I would also question the need to do FP operations in ISRs
> and DSRs. These routines are meant to be fast and small. It is often
> better to offload any complex computations to a thread. Note that even
> if the DSR only does a small amount of FP computation, the cost of
> saving and restoring the FP state to let it do so is very high. 

Hmmm... true and not true. On some platforms, (e.g powerpc), you have no
guarantee that the the compiler will not use floating point registers
for non-floating point operations when it gets short of non floating
point registers. (don't ask me where I read this)

This means that you _must_ (at least on PowerPC) save floating point
regs in every ISR, regardless of the fact that you do any FP arithmetic
in the ISR or not.


> -- 
> Nick Garnett                    eCos Kernel Architect
> http://www.ecoscentric.com/     The eCos and RedBoot experts

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list