delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/12/15/23:06:45

From: khan AT xraylith DOT wisc DOT edu (Mumit Khan)
Subject: Re: beta 20.1 and 19 and 18 'rint' function with gcc is broken
15 Dec 1998 23:06:45 -0800 :
Message-ID: <199812152235.QAA13939.cygnus.gnu-win32@modi.xraylith.wisc.edu>
References: <4 DOT 1 DOT 19981214084527 DOT 035e9470 AT pop DOT ni DOT net>
To: Jeff Deifik <jdeifik AT weasel DOT com>
Cc: gnu-win32 AT cygnus DOT com

Jeff Deifik <jdeifik AT weasel DOT com> writes:
> I have reported a bug with the math function rint.
> It is still not fixed with the latest beta-20.1

Hi Jeff,

I did take a look when you posted the test case the first time around, 
and I apologize for forgetting all about it.

The problem is the way rint is written in newlib -- it's using the old 
Sun code that I'm not too fond of. In fact, most of newlib's math functions
are not up to par if you're going to develop numerical code on ix86.

The simple fix, albeit awkward, is to declare the variable "w" volatile in
newlib/libm/math/s_rint.c and then the compiler wouldn't optimize away the
critical section at the end. Another quick fix is to use a an assembly
version of rint (see glibc2 sources) and use that for cygwin.

The real fix is to dump the math library and use one of the better tested
ones. Even glibc2 does quite a bit better than newlib as long as you steer
clear of some of the buggy inlined routines.

The *real* fix IMO is to dump newlib, but that's a whole different topic.

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019