From: sean AT mcneil DOT com (Sean McNeil) Subject: RE: Current news on b17 release 6 Jan 1997 19:54:11 -0800 Sender: daemon AT cygnus DOT com Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <01BBFC03.19813460.cygnus.gnu-win32@mcneil.mcneil.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Original-To: "gnu-win32 AT cygnus DOT com" , "'Geoffrey Noer'" Original-Sender: owner-gnu-win32 AT cygnus DOT com The FPU for the x86 is not getting initialized properly for IEEE floating point use. This causes innaccuracy in some FP code I have been investigating. The following crt0.c provides the necessary work: #ifdef __PPC__ /* For the PowerPC, we want to make this function have its structured exception table exception function point to something we control. */ extern void __cygwin_exception_handler(); extern void mainCRTStartup(void) __attribute__((__exception__(__cygwin_exception_handler))); #endif #ifdef __i386__ #define FPU_RESERVED 0xF0C0 #define FPU_DEFAULT 0x033f /* For debugging on *#!$@ windbg. bp for breakpoint. */ int __cygwin_crt0_bp = 0; #endif void mainCRTStartup () { #ifdef __i386__ if (__cygwin_crt0_bp) asm volatile ("int3"); { volatile unsigned short cw; /* Get Control Word */ __asm__ volatile ("fnstcw %0" : "=m" (cw) : ); /* mask in */ cw &= FPU_RESERVED; cw |= FPU_DEFAULT; /* set cw */ __asm__ volatile ("fldcw %0" :: "m" (cw)); } #endif cygwin_crt0 (); } - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".