PowerPC FP handling weakness.

Sergei Organov osv at javad.ru
Fri Sep 29 16:04:11 UTC 2000


Joel Sherrill <joel.sherrill at OARcorp.com> writes:

> Eric Valette wrote:
> > 
> > Sergei Organov wrote:
> > >
> > > Eric Valette <valette at crf.canon.fr> writes:
> > >
> > > [...]
> > > > Why don't you send a patch that does deffered FPU registers saving... In
> > > > that case enabling FP by default is a non problem since if a task does
> > > > not use the FPU registers they will not be saved on context switch just
> > > > when a flotating point execption processing occurs because FPU usage has
> > > > been disabled...
> > >
> > > I believe that there is no need for such a patch because RTEMS supports
> > > deferred FPU registers saving for a long time. The problem is that current
> > > 'printf' implementation does use FP, and it will cause problems when you call
> > > 'printf' from non-FP task. Enabling FP bit in MSR for non-FP task just hides
> > > the problem and doesn't solve it. Or maybe I don't understand what you are
> > > saying?
> > 
> > I'm affraid deffered FPU context switching has never been tested on
> > 60x/7xx. Maybe I can be wrong...
> 
> I think that in a system where all tasks are FP deferred switching is
> equivalent to on every switch.  Think about it.  All deferred switching
> says is that we won't save the context until another FP task is switched
> in.  This is every time.  Not as clear as it should be but technically
> OK.

True, but in this case the problem with 'printf' just can't show itself. 

I myself tested deferred switch on MPC505 (RTEMS3.6.0), and it worked
just fine for me. I did disable FP for non-FP tasks though. Moreover, deferred 
context switch doesn't actually depend much on BSP, so chances are good that
if it works for one target, it will work for another one as well. I'm almost
(99.99% to be exact :-)) sure that deferred context switch works fine on PPC
until rules aren't violated (calling non-patched 'printf' from non-FP task is
violation of rules).

BTW, I just checked last snapshot from 'newlib' anon-cvs, and it doesn't
contain patch for 'printf' to don't use FP. Joel, are there any chances the
patch will be incorporated into 'newlib'?

BR,
Sergei.




More information about the users mailing list