delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/02/16:46:06

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199905022045.PAA27648@modi.xraylith.wisc.edu>
X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol
To: cygwin AT sourceware DOT cygnus DOT com
Subject: (patch) newlib rint fix
Date: Sun, 02 May 1999 15:45:29 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

We had discussed the problem with rint in the past, and I had suggested
a solution in that thread. Since it's still not fixed in the latest 
snapshots, here's a patch. This fixes the bug reported to the list by 
Jeff Deifik <jdeifik AT weasel DOT com>.

   Subject: beta 20.1 and 19 and 18 'rint' function with gcc is broken
   URL: http://www.cygnus.com/ml/gnu-win32/1998-Dec/0381.html

Sun May  2 14:33:57 1999  Mumit Khan  <khan AT xraylith DOT wisc DOT edu>
	
	* libm/common/s_rint.c (rint): Make w volatile to tell the 
	optimizer not to optimize it away.
	* libm/common/sf_rint.c (rintf): Likewise.

--- libm/common/s_rint.c.~1	Sun May  2 14:26:58 1999
+++ libm/common/s_rint.c	Sun May  2 14:27:10 1999
@@ -44,7 +44,8 @@ TWO52[2]={
 {
 	__int32_t i0,j0,sx;
 	__uint32_t i,i1;
-	double w,t;
+	volatile double w;
+	double t;
 	EXTRACT_WORDS(i0,i1,x);
 	sx = (i0>>31)&1;
 	j0 = ((i0>>20)&0x7ff)-0x3ff;
--- libm/common/sf_rint.c.~1	Sun May  2 14:27:15 1999
+++ libm/common/sf_rint.c	Sun May  2 14:27:28 1999
@@ -34,7 +34,8 @@ TWO23[2]={
 {
 	__int32_t i0,j0,sx;
 	__uint32_t i,i1;
-	float w,t;
+	volatile float w;
+	float t;
 	GET_FLOAT_WORD(i0,x);
 	sx = (i0>>31)&1;
 	j0 = ((i0>>23)&0xff)-0x7f;

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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