glibc/manual
Joseph Myers 29cb929332 Add iscanonical.
TS 18661-1 adds an iscanonical classification macro to <math.h>.

The motivation for this is decimal floating-point, where some values
have both canonical and noncanonical encodings.  For IEEE binary
interchange formats, all encodings are canonical.  For x86/m68k
ldbl-96, and for ldbl-128ibm, there are encodings that do not
represent any valid value of the type; although formally iscanonical
does not need to handle trap representations (and so could just always
return 1), it seems useful, and in line with the description in the TS
of "representations that are extraneous to the floating-point model"
as being non-canonical (as well as "redundant representations of some
or all of its values"), for it to detect those representations and
return 0 for them.

This patch adds iscanonical to glibc.  It goes in a header
<bits/iscanonical.h>, included under appropriate conditions in
<math.h>.  The default header version just evaluates the argument
(converted to its semantic type, though current GCC will probably
discard that conversion and any exceptions resulting from it) and
returns 1.  ldbl-96 and ldbl-128ibm then have versions of the header
that call a function __iscanonicall for long double (the sizeof-based
tests will of course need updating for float128 support, like other
such type-generic macro implementations).  The ldbl-96 version of
__iscanonicall has appropriate conditionals to reflect the differences
in the m68k version of that format (where the high mantissa bit may be
either 0 or 1 when the exponent is 0 or 0x7fff).  Corresponding tests
for those formats are added as well.  Other architectures do not have
any new functions added because just returning 1 is correct for all
their floating-point formats.

Tested for x86_64, x86, mips64 (to test the default macro version) and
powerpc.

	* math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Include
	<bits/iscanonical.h>.
	* bits/iscanonical.h: New file.
	* math/s_iscanonicall.c: Likewise.
	* math/Versions (__iscanonicall): New libm symbol at version
	GLIBC_2.25.
	* math/libm-test.inc (iscanonical_test_data): New array.
	(iscanonical_test): New function.
	(main): Call iscanonical_test.
	* math/Makefile (headers): Add bits/iscanonical.h.
	(type-ldouble-routines): Add s_iscanonicall.
	* manual/arith.texi (Floating Point Classes): Document
	iscanonical.
	* manual/libm-err-tab.pl: Update comment on interfaces without
	ulps tabulated.
	* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h: New file.
	* sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c: Likewise.
	* sysdeps/ieee754/ldbl-128ibm/test-iscanonical-ldbl-128ibm.c:
	Likewise.
	* sysdeps/ieee754/ldbl-128ibm/Makefile (tests): Add
	test-iscanonical-ldbl-128ibm.
	* sysdeps/ieee754/ldbl-96/bits/iscanonical.h: New file.
	* sysdeps/ieee754/ldbl-96/s_iscanonicall.c: Likewise.
	* sysdeps/ieee754/ldbl-96/test-iscanonical-ldbl-96.c: Likewise.
	* sysdeps/ieee754/ldbl-96/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
	* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/m68k/m680x0/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/x86_64/64/libm.abilist: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-09-30 00:27:50 +00:00
..
examples glob: Simplify the interface for the GLOB_ALTDIRFUNC callback gl_readdir 2016-04-29 09:35:30 +02:00
Makefile Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
argp.texi manual/argp.texi (Specifying Argp Parsers): Fix typo. 2015-10-14 11:49:58 -04:00
arith.texi Add iscanonical. 2016-09-30 00:27:50 +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 * manual/conf.texi: Document MTASC-safety properties. 2014-01-29 05:26:47 -02:00
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 * manual/debug.texi: Document MTASC-safety properties. 2014-01-30 18:50:57 -02:00
dir .. 2005-11-21 15:45:19 +00:00
errno.texi manual: fix typos in error reporting 2016-05-19 23:25:06 -04:00
fdl-1.3.texi BZ#13738: Switch manual to FDL 1.3. 2012-02-24 12:58:10 -08:00
filesys.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
freemanuals.texi Update to canonical freemanuals.texi file. 2013-09-24 14:06:56 -07:00
getopt.texi * manual/getopt.texi: Document MTASC-safety properties. 2014-01-31 23:16:56 -02:00
header.texi Use Texinfo macros to refer to the GNU C Library within the manual. 2012-02-28 14:44:20 +00:00
install-plain.texi BZ #15941: Fix INSTALL file regeneration failure with makeinfo 5.x 2013-12-05 09:58:20 +05:30
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 Clean up glibc manual references to "GNU system" (bug 6911). 2012-03-08 01:27:38 +00:00
ipc.texi manual/ipc.texi: Fix AC-safety notes. 2014-04-08 17:12:15 -04:00
job.texi ctermid: return string literal, document MT-Safety pitfall 2014-11-21 02:16:02 -02:00
lang.texi Add <stdint.h> integer width macros. 2016-09-21 17:06:36 +00:00
lgpl-2.1.texi Use canonical FSF .texi files for LGPL and FDL texts. 2011-06-06 16:16:55 -07:00
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 * manual/libdl.texi: New. 2014-01-31 23:23:59 -02:00
libm-err-tab.pl Add iscanonical. 2016-09-30 00:27:50 +00:00
llio.texi Fix exponents in manual. 2015-08-20 09:43:50 +02:00
locale.texi manual: fix spelling typos 2016-06-16 00:59:57 -04:00
macros.texi Fix exponents in manual. 2015-08-20 09:43:50 +02:00
maint.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01: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: Clarify NSS error reporting 2016-09-23 14:18:09 +02:00
nsswitch.texi
pattern.texi manual: fix typos in the pattern chapter 2016-06-16 01:34:38 -04:00
pipe.texi * manual/pipe.texi: Document MTASC-safety properties. 2014-01-31 23:37:28 -02:00
platform.texi PowerPC: Extend Program Priority Register support 2015-08-19 17:43:26 -03:00
probes.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
process.texi Remove union wait [BZ #19613] 2016-04-14 08:54:57 +02:00
resource.texi Fix typo in manual. 2014-06-05 01:13:04 +02:00
search.texi manual: fix typos in the search chapter 2016-06-16 01:24:16 -04:00
setjmp.texi manual/setjmp.texi: Clarify setcontext and signal handlers text 2014-04-17 11:40:36 +01:00
signal.texi Fix crossreference to nonexistent node BSD Handler 2014-11-18 11:19:20 +01:00
socket.texi Fix two spaces after sentence. 2014-02-26 23:27:38 +01:00
startup.texi Remove _BSD_SOURCE and _SVID_SOURCE. 2014-02-11 23:40:07 +00:00
stdio-fp.c
stdio.texi Split large string section; add truncation advice 2015-12-10 08:29:30 -08:00
string.texi manual: Clarify the documentation of strverscmp [BZ #20524] 2016-09-21 15:41:17 +02: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 * manual/syslog.texi: Document MTASC-safety properties. 2014-02-01 01:22:09 -02:00
terminal.texi * manual/terminal.texi: Document MTASC-safety properties. 2014-02-01 03:53:15 -02:00
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 * manual/time.texi (TZ Variable): glibc no longer comes with tzdata. 2015-02-16 15:32:34 -08:00
tsort.awk Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00
users.texi manual: cuserid is mtasurace if not passed a string 2014-11-21 02:15:09 -02:00
xtract-typefun.awk Make shebang interpreter directives consistent 2016-01-07 04:03:21 -05:00