[Top] [All Lists]

Re: FPU Control Word: Initial Value looks wrong

To: Andreas Jaeger <>
Subject: Re: FPU Control Word: Initial Value looks wrong
From: Ralf Baechle <>
Date: Wed, 5 Jul 2000 00:53:25 +0200
In-reply-to: <>; from on Tue, Jul 04, 2000 at 01:39:04PM +0200
References: <> <> <>
On Tue, Jul 04, 2000 at 01:39:04PM +0200, Andreas Jaeger wrote:

> Ralf> I tried your program on a Indy running 2.4.0-test2 + glibc 2.2 and it 
> was
> Ralf> printing ``0 0''.
> Did you try it with a shared program?


> Static programs always initialize the FPU.  Could you run the program on
> other machines also?

Will do.

> Ralf> Could you check the source of your kernel for the value it's writing to
> Ralf> fcr31?  That's the constant FPU_DEFAULT defined in arch/mips/kernel/
> Ralf> r4k_switch.S.  Some quite old kernel were using a different value but I
> Ralf> was actually assuming those versions have already died out.
> The kernels I used have 0 as FPU_DEFAULT - but nevertheless the
> returned value is wrong.  When is FPU_DEFAULT written to the FPU?

We do lazy fp context switching.  So the kernel initializes the FPU for a
process at the moment when it attempts to use it for the first time.  It
does so by enabling the FPU in the status register, clearing all flags in
$fcr31 and setting all fp registers to a SNAN.


<Prev in Thread] Current Thread [Next in Thread>