[Top] [All Lists]

Re: FPU Control Word: Initial Value looks wrong

To: Ralf Baechle <>
Subject: Re: FPU Control Word: Initial Value looks wrong
From: Andreas Jaeger <>
Date: 04 Jul 2000 13:39:04 +0200
In-reply-to: Ralf Baechle's message of "Tue, 4 Jul 2000 00:32:32 +0200"
Mail-copies-to: never
References: <> <>
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Capitol Reef)
>>>>> Ralf Baechle writes:

Ralf> On Mon, Jul 03, 2000 at 07:30:42PM +0200, Andreas Jaeger wrote:
>> Porting glibc to MIPS I noticed that the initial contents of the fpu
>> control word doesn't seem to be right (at least on the machines I've
>> tried - one with a normal MIPS 2.2.13 and one with 2.2.15 and the
>> MIPS/Algorithmics patches (including FPU emulator).

>> The appended small test program should return a 0 (that's the desired
>> value by glibc for full ISO C99 support) - but it seems to be set to
>> 0x600.
>> Could the kernel folks fix this, please?  I grepped through the sources
>> and didn't find a place where the FPU gets initialised.:-(

Ralf> Surprise - the kernel initializes this to zero and the libc should do
Ralf> the same afair.  Did this change?

No, that's correct - but I don't get a zero.

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?

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?

 Andreas Jaeger
  SuSE Labs

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