This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
soft-fp: make extensions quiet signaling NaNs (bug 16041)
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: "David S. Miller" <davem at davemloft dot net>
- Date: Wed, 16 Oct 2013 22:03:37 +0000
- Subject: soft-fp: make extensions quiet signaling NaNs (bug 16041)
- Authentication-results: sourceware.org; auth=none
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