This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

soft-fp: make extensions quiet signaling NaNs (bug 16041)


This patch fixes bug 16041, soft-fp extensions of signaling NaNs to a
wider floating-point type producing another signaling NaN when they
should produce a quiet NaN.

Tested for powerpc-nofpu.  David, this should fix the problem you
reported for SPARC (the relevant test in math/basic-test.c is disabled
for powerpc because of issues with conversions to/from long double).

2013-10-16  Joseph Myers  <joseph@codesourcery.com>

	[BZ #16041]
	* soft-fp/op-common.h (FP_EXTEND): When input is a signaling NaN,
	make result into a quiet NaN.

diff --git a/soft-fp/op-common.h b/soft-fp/op-common.h
index 9a9a8f5..67cdc33 100644
--- a/soft-fp/op-common.h
+++ b/soft-fp/op-common.h
@@ -1505,6 +1505,7 @@
 		    FP_SET_EXCEPTION (FP_EX_INVALID);			\
 		  _FP_FRAC_SLL_##dwc (D, (_FP_FRACBITS_##dfs		\
 					  - _FP_FRACBITS_##sfs));	\
+		  _FP_SETQNAN (dfs, dwc, D);				\
 		}							\
 	    }								\
 	}								\

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]