glibc/sysdeps/i386
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
..
fpu Add fesetexcept. 2016-08-16 16:16:10 +00:00
i586 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
i686 Regenerate i686 libm-test-ulps with GCC 6.1 at -O3 [BZ #20347] 2016-07-13 08:02:10 -07:00
i786
nptl elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
sys Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Implies
Makefile i386: Compile rtld-*.os with -mno-sse -mno-mmx -mfpmath=387 2016-07-18 15:16:24 -07:00
Versions
____longjmp_chk.S
__longjmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
abort-instr.h
add_n.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
addmul_1.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
asm-syntax.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
atomic-machine.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
backtrace.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
bcopy.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
bzero.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
cacheinfo.c Move sysdeps/x86_64/cacheinfo.c to sysdeps/x86 2016-05-08 08:49:18 -07:00
configure configure: fix `test ==` usage 2016-04-09 20:05:13 -04:00
configure.ac configure: fix `test ==` usage 2016-04-09 20:05:13 -04:00
crti.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
crtn.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-machine.h Call init_cpu_features only if SHARED is defined 2016-05-13 08:29:33 -07:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-tls.h elf: Consolidate machine-agnostic DTV definitions in <dl-dtv.h> 2016-06-20 14:31:40 +02:00
dl-tlsdesc.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-tlsdesc.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
dl-trampoline.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ffs.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
gmp-mparam.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
htonl.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
htons.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
i386-mcount.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
init-arch.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
jmpbuf-offsets.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
link-defines.sym Preserve bound registers for pointer pass/return 2015-07-09 06:50:12 -07:00
lshift.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memcmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memcopy.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memcpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memcpy_chk.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memmove.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
memmove_chk.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mempcpy.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
mempcpy_chk.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memset.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memset_chk.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
mp_clz_tab.c
mul_1.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
preconfigure Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments. 2014-06-25 17:52:56 +00:00
pthread_spin_trylock.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rawmemchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
rshift.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
setfpucw.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
setjmp.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stackguard-macros.h BZ #15754: CVE-2013-4788 2013-09-23 00:52:09 -04:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
start.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stpcpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
stpncpy.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strcat.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strchrnul.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strcspn.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
string-inlines.c Improve generic strcspn performance 2016-04-01 10:44:40 -03:00
strlen.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strlen.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strpbrk.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strrchr.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strspn.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtok.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
strtok_r.S
sub_n.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tls-macros.h i386: Fix build by GCC 5.0 2014-12-30 11:37:41 -08:00
tlsdesc.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tlsdesc.sym
tst-audit.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-audit3.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-audit3.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-auditmod3a.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-auditmod3b.c Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
tst-ld-sse-use.sh Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00