summary refs log tree commit diff
path: root/NEWS
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2016-12-16 18:03:25 +0000
committerJoseph Myers <joseph@codesourcery.com>2016-12-16 18:03:25 +0000
commitc0b4353654e635e280ec0c1972f251bf696abb36 (patch)
tree0c695b7feecc0397628c89e0f5b02690ef2cc857 /NEWS
parent8b1f57f4f2c9c71c51b31fda1c91ca0e36b1fb18 (diff)
downloadglibc-c0b4353654e635e280ec0c1972f251bf696abb36.tar.gz
glibc-c0b4353654e635e280ec0c1972f251bf696abb36.tar.xz
glibc-c0b4353654e635e280ec0c1972f251bf696abb36.zip
Define FE_SNANS_ALWAYS_SIGNAL.
TS 18661-1 defines a macro FE_SNANS_ALWAYS_SIGNAL in <fenv.h>, to
indicate that the recommended practice regarding sNaNs (that
operations always produce a qNaN output with "invalid" exception, even
in the fmax / fmin / hypot / pow cases where a qNaN input would not
result in qNaN output) is followed.

Now that those functions with C99 special cases for NaNs have been
fixed not to apply those special cases to sNaN, only to qNaN, glibc
follows that recommended practice.  This patch makes it define the
corresponding macro.

Since compiler optimizations may affect whether sNaNs behave as
expected and the macro relates to both language and library features,
it is only defined if __SUPPORT_SNAN__ is defined (which GCC defines
for -fsignaling-nans).  It is also not defined if FE_INVALID is
undefined, since the recommended practice specifically refers to
raising the "invalid" exception, so it seems inappropriate to define
the macro for soft-float cases without support for exceptions.
(Further refinement would be possible in cases where bits/fenv.h is
shared by configurations both with and without exceptions support.)

Tested for x86_64 and x86, and also did compile-only testing for nios2
to cover the no-exceptions case.

	* math/fenv.h
	[__GLIBC_USE (IEC_60559_BFP_EXT) && FE_INVALID && __SUPPORT_SNAN__]
	(FE_SNANS_ALWAYS_SIGNAL): New macro.
	* math/test-fe-snans-always-signal.c: New file.
	* math/Makefile (tests): Add test-fe-snans-always-signal.
	(CFLAGS-test-fe-snans-always-signal.c): New variable.
	* manual/arith.texi (Infinity and NaN): Document
	FE_SNANS_ALWAYS_SIGNAL.
Diffstat (limited to 'NEWS')
-rw-r--r--NEWS4
1 files changed, 2 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 64ed6593cb..baf46bd4ad 100644
--- a/NEWS
+++ b/NEWS
@@ -46,8 +46,8 @@ Version 2.25
   problem.
 
 * New <fenv.h> features from TS 18661-1:2014 are added to libm: the
-  fesetexcept, fetestexceptflag, fegetmode and fesetmode functions,
-  the femode_t type and the FE_DFL_MODE macro.
+  fesetexcept, fetestexceptflag, fegetmode and fesetmode functions, the
+  femode_t type and the FE_DFL_MODE and FE_SNANS_ALWAYS_SIGNAL macros.
 
 * Integer width macros from TS 18661-1:2014 are added to <limits.h>:
   CHAR_WIDTH, SCHAR_WIDTH, UCHAR_WIDTH, SHRT_WIDTH, USHRT_WIDTH, INT_WIDTH,