glibc/manual
Joseph Myers 5146356f5a Add fesetexcept.
TS 18661-1 defines an fesetexcept function for setting floating-point
exception flags without the side-effect of causing enabled traps to be
taken.

This patch series implements this function for glibc.  The present
patch adds the fallback stub implementation, x86 and x86_64
implementations, documentation, tests and ABI baseline updates.  The
remaining patches, some of them untested, add implementations for
other architectures.  The implementations generally follow those of
the fesetexceptflag function.

As for fesetexceptflag, the approach taken for architectures where
setting flags causes enabled traps to be taken is to set the flags
(and potentially cause traps) rather than refusing to set the flags
and returning an error.  Since ISO C and TS 18661 provide no way to
enable traps, this is formally in accordance with the standards.

The NEWS entry should be considered a placeholder, since this patch
series is intended to be followed by further such series adding other
TS 18661-1 features, so that the NEWS entry would end up looking more
like

* 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.

with hopefully more such entries for other features, rather than
having an entry for a single function in the end.

I believe we have consensus for adding TS 18661-1 interfaces as per
<https://sourceware.org/ml/libc-alpha/2016-06/msg00421.html>.

Tested for x86_64, x86, mips64 (hard float, and soft float to test the
fallback version), arm (hard float) and powerpc (hard float, soft
float and e500).

	* math/fesetexcept.c: New file.
	* sysdeps/i386/fpu/fesetexcept.c: Likewise.
	* sysdeps/x86_64/fpu/fesetexcept.c: Likewise.
	* math/fenv.h: Define
	__GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
	<bits/libc-header-start.h> instead of including <features.h>.
	[__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetexcept): New function
	declaration.
	* manual/arith.texi (fesetexcept): Document function.
	* math/Versions (fesetexcept): New libm symbol at version
	GLIBC_2.25.
	* math/Makefile (libm-support): Add fesetexcept.
	(tests): Add test-fesetexcept and test-fesetexcept-traps.
	* math/test-fesetexcept.c: New file.
	* math/test-fesetexcept-traps.c: Likewise.
	* sysdeps/nacl/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
	Likewise.
	* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-08-16 16:16:10 +00:00
..
examples glob: Simplify the interface for the GLOB_ALTDIRFUNC callback gl_readdir 2016-04-29 09:35:30 +02:00
argp.texi
arith.texi Add fesetexcept. 2016-08-16 16:16:10 +00:00
charset.texi manual: fix typos in character set handling 2016-06-16 00:45:37 -04:00
check-safety.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
conf.texi
contrib.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
creature.texi Support __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro. 2016-08-03 22:21:37 +00:00
crypt.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
ctype.texi manual: fix typos in the character handling chapter 2016-06-16 00:37:44 -04:00
debug.texi
dir
errno.texi manual: fix typos in error reporting 2016-05-19 23:25:06 -04:00
fdl-1.3.texi
filesys.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
freemanuals.texi
getopt.texi
header.texi
install-plain.texi
install.texi 2016-06-05 Paul Pluzhnikov <ppluzhnikov@google.com> 2016-06-05 08:41:13 -07:00
intro.texi manual: fix typo in the introduction 2016-05-19 23:22:59 -04:00
io.texi
ipc.texi
job.texi
lang.texi Split large string section; add truncation advice 2015-12-10 08:29:30 -08:00
lgpl-2.1.texi
libc-texinfo.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
libc.texinfo Fix doc quoting problems with Texinfo 5 2016-01-10 00:20:51 -08:00
libcbook.texi
libdl.texi
libm-err-tab.pl Add nextup and nextdown math functions 2016-06-16 21:37:45 +05:30
llio.texi
locale.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
macros.texi
maint.texi
Makefile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
math.texi Support __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro. 2016-08-03 22:21:37 +00:00
memory.texi manual: fix typos in the memory chapter 2016-06-16 00:33:53 -04:00
message.texi manual: fix typos in the message chapter 2016-06-16 01:14:32 -04:00
nss.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
nsswitch.texi
pattern.texi manual: fix typos in the pattern chapter 2016-06-16 01:34:38 -04:00
pipe.texi
platform.texi
probes.texi
process.texi Remove union wait [BZ #19613] 2016-04-14 08:54:57 +02:00
resource.texi
search.texi manual: fix typos in the search chapter 2016-06-16 01:24:16 -04:00
setjmp.texi
signal.texi
socket.texi
startup.texi
stdio-fp.c
stdio.texi Split large string section; add truncation advice 2015-12-10 08:29:30 -08:00
string.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
summary.awk Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sysinfo.texi Make obsolete syscall wrappers into compat symbols (bug 18472). 2015-12-14 22:52:15 +00:00
syslog.texi
terminal.texi
texinfo.tex Update miscellaneous files from upstream sources. 2016-01-05 18:04:06 +00:00
texis.awk
threads.texi Remove CPU set size checking from affinity functions [BZ #19143] 2015-11-24 17:21:01 +01:00
time.texi
tsort.awk Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
users.texi
xtract-typefun.awk Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00