linux-mips-fnet
[Top] [All Lists]

FPU Control Word: Initial Value looks wrong

To: linux-mips@fnet.fr
Subject: FPU Control Word: Initial Value looks wrong
From: Andreas Jaeger <aj@suse.de>
Date: 03 Jul 2000 19:30:42 +0200
Cc: linux-mips@oss.sgi.com
Mail-copies-to: never
Sender: aj@suse.de
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Capitol Reef)
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.:-(

Thanks,
Andreas

P.S. Here's the test program:
#include <stdlib.h>

#define _FPU_GETCW(cw) __asm__ ("cfc1 %0,$31" : "=r" (cw) : )
#define _FPU_SETCW(cw) __asm__ ("ctc1 %0,$31" : : "r" (cw))

int
main (void)
{
  int fpucw;

  _FPU_GETCW (fpucw);

  printf ("%x %d\n", fpucw, fpucw);

  return 0;
}


-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

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