about summary refs log tree commit diff
path: root/manual/math.texi
Commit message (Collapse)AuthorAgeFilesLines
* Implement C23 log2p1Joseph Myers2024-05-201-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | C23 adds various <math.h> function families originally defined in TS 18661-4. Add the log2p1 functions (log2(1+x): like log1p, but for base-2 logarithms). This illustrates the intended structure of implementations of all these function families: define them initially with a type-generic template implementation. If someone wishes to add type-specific implementations, it is likely such implementations can be both faster and more accurate than the type-generic one and can then override it for types for which they are implemented (adding benchmarks would be desirable in such cases to demonstrate that a new implementation is indeed faster). The test inputs are copied from those for log1p. Note that these changes make gen-auto-libm-tests depend on MPFR 4.2 (or later). The bulk of the changes are fairly generic for any such new function. (sysdeps/powerpc/nofpu/Makefile only needs changing for those type-generic templates that use fabs.) Tested for x86_64 and x86, and with build-many-glibcs.py.
* manual: Clarify return value of cbrt(3)Alejandro Colomar2024-04-031-2/+6
| | | | | | | | | | | | | Link: <https://lore.kernel.org/linux-man/ZeYKUOKYS7G90SaV@debian/T/#mff0ab388000c6afdb5e5162804d4a0073de481de> Reported-by: Morten Welinder <mwelinder@gmail.com> Cowritten-by: Morten Welinder <mwelinder@gmail.com> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Vincent Lefevre <vincent@vinc17.net> Cc: DJ Delorie <dj@redhat.com> Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr> Cc: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Alejandro Colomar <alx@kernel.org> Reviewed-by: DJ Delorie <dj@redhat.com>
* manual: floor(log2(fabs(x))) has rounding errorsAlejandro Colomar2024-04-031-2/+5
| | | | | | | | | | | | Link: <https://inbox.sourceware.org/libc-alpha/20240305150131.GD3653@qaa.vinc17.org/T/#m3ceecda630012995339bcc5448fee451cf277a8b> Reported-by: Vincent Lefevre <vincent@vinc17.net> Suggested-by: Vincent Lefevre <vincent@vinc17.net> Reviewed-by: DJ Delorie <dj@redhat.com> Cc: Morten Welinder <mwelinder@gmail.com> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr> Cc: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* manual: logb(x) is floor(log2(fabs(x)))Alejandro Colomar2024-04-031-1/+1
| | | | | | | | | | | | | | log2(3) doesn't accept negative input, but it seems logb(3) does accept it. Link: <https://lore.kernel.org/linux-man/ZeYKUOKYS7G90SaV@debian/T/#u> Reported-by: Morten Welinder <mwelinder@gmail.com> Reviewed-by: DJ Delorie <dj@redhat.com> Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Vincent Lefevre <vincent@vinc17.net> Cc: Paul Zimmermann <Paul.Zimmermann@inria.fr> Cc: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Alejandro Colomar <alx@kernel.org>
* Remove ia64-linux-gnuAdhemerval Zanella2024-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Linux 6.7 removed ia64 from the official tree [1], following the general principle that a glibc port needs upstream support for the architecture in all the components it depends on (binutils, GCC, and the Linux kernel). Apart from the removal of sysdeps/ia64 and sysdeps/unix/sysv/linux/ia64, there are updates to various comments referencing ia64 for which removal of those references seemed appropriate. The configuration is removed from README and build-many-glibcs.py. The CONTRIBUTED-BY, elf/elf.h, manual/contrib.texi (the porting mention), *.po files, config.guess, and longlong.h are not changed. For Linux it allows cleanup some clone2 support on multiple files. The following bug can be closed as WONTFIX: BZ 22634 [2], BZ 14250 [3], BZ 21634 [4], BZ 10163 [5], BZ 16401 [6], and BZ 11585 [7]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43ff221426d33db909f7159fdf620c3b052e2d1c [2] https://sourceware.org/bugzilla/show_bug.cgi?id=22634 [3] https://sourceware.org/bugzilla/show_bug.cgi?id=14250 [4] https://sourceware.org/bugzilla/show_bug.cgi?id=21634 [5] https://sourceware.org/bugzilla/show_bug.cgi?id=10163 [6] https://sourceware.org/bugzilla/show_bug.cgi?id=16401 [7] https://sourceware.org/bugzilla/show_bug.cgi?id=11585 Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* arc4random: simplify design for better safetyJason A. Donenfeld2022-07-271-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than buffering 16 MiB of entropy in userspace (by way of chacha20), simply call getrandom() every time. This approach is doubtlessly slower, for now, but trying to prematurely optimize arc4random appears to be leading toward all sorts of nasty properties and gotchas. Instead, this patch takes a much more conservative approach. The interface is added as a basic loop wrapper around getrandom(), and then later, the kernel and libc together can work together on optimizing that. This prevents numerous issues in which userspace is unaware of when it really must throw away its buffer, since we avoid buffering all together. Future improvements may include userspace learning more from the kernel about when to do that, which might make these sorts of chacha20-based optimizations more possible. The current heuristic of 16 MiB is meaningless garbage that doesn't correspond to anything the kernel might know about. So for now, let's just do something conservative that we know is correct and won't lead to cryptographic issues for users of this function. This patch might be considered along the lines of, "optimization is the root of all evil," in that the much more complex implementation it replaces moves too fast without considering security implications, whereas the incremental approach done here is a much safer way of going about things. Once this lands, we can take our time in optimizing this properly using new interplay between the kernel and userspace. getrandom(0) is used, since that's the one that ensures the bytes returned are cryptographically secure. But on systems without it, we fallback to using /dev/urandom. This is unfortunate because it means opening a file descriptor, but there's not much of a choice. Secondly, as part of the fallback, in order to get more or less the same properties of getrandom(0), we poll on /dev/random, and if the poll succeeds at least once, then we assume the RNG is initialized. This is a rough approximation, as the ancient "non-blocking pool" initialized after the "blocking pool", not before, and it may not port back to all ancient kernels, though it does to all kernels supported by glibc (≥3.2), so generally it's the best approximation we can do. The motivation for including arc4random, in the first place, is to have source-level compatibility with existing code. That means this patch doesn't attempt to litigate the interface itself. It does, however, choose a conservative approach for implementing it. Cc: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org> Cc: Florian Weimer <fweimer@redhat.com> Cc: Cristian Rodríguez <crrodriguez@opensuse.org> Cc: Paul Eggert <eggert@cs.ucla.edu> Cc: Mark Harris <mark.hsj@gmail.com> Cc: Eric Biggers <ebiggers@kernel.org> Cc: linux-crypto@vger.kernel.org Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* LoongArch: Update NEWS and README for the LoongArch port.caiyinyu2022-07-261-1/+1
|
* manual: Add documentation for arc4random functionsAdhemerval Zanella Netto2022-07-221-0/+46
|
* x86_64: Document libmvec vector functions accuracy [BZ #28766]Sunil K Pandey2022-01-191-2/+3
| | | | | | | Document maximum 4 ulps accuracy for x86_64 libmvec functions. This fixes BZ #28766. Reviewed-By: Paul Zimmermann <Paul.Zimmermann@inria.fr>
* math: Fix float conversion regressions with gcc-12 [BZ #28713]Szabolcs Nagy2022-01-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converting double precision constants to float is now affected by the runtime dynamic rounding mode instead of being evaluated at compile time with default rounding mode (except static object initializers). This can change the computed result and cause performance regression. The known correctness issues (increased ulp errors) are already fixed, this patch fixes remaining cases of unnecessary runtime conversions. Add float M_* macros to math.h as new GNU extension API. To avoid conversions the new M_* macros are used and instead of casting double literals to float, use float literals (only required if the conversion is inexact). The patch was tested on aarch64 where the following symbols had new spurious conversion instructions that got fixed: __clog10f __gammaf_r_finite@GLIBC_2.17 __j0f_finite@GLIBC_2.17 __j1f_finite@GLIBC_2.17 __jnf_finite@GLIBC_2.17 __kernel_casinhf __lgamma_negf __log1pf __y0f_finite@GLIBC_2.17 __y1f_finite@GLIBC_2.17 cacosf cacoshf casinhf catanf catanhf clogf gammaf_positive Fixes bug 28713. Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
* manual: Use Unicode instead HTML entities for characters (bug 19737)Florian Weimer2020-07-161-3/+3
| | | | | | | | | | Texinfo no longer treats arguments to @set in @ifhtml blocks as literal HTML, so the & in the entity references was encoded as @amp; in HTML. Using the equivalent Unicode characters avoids this issue. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
* Remove __NO_MATH_INLINESAdhemerval Zanella2020-04-171-6/+0
| | | | | | With fenvinline.h removal the flag is not used anymore. Checked on x86_64-linux-gnu.
* manual: Use @code{errno} instead of @var{errno} [BZ #24063]Florian Weimer2019-01-071-1/+1
| | | | | | @var is intended for placeholders (such as function parameters). Actual variables need to use @code because @var causes upper-case output, resulting in a different C identifier.
* Skeleton documentation for the RISC-V portPalmer Dabbelt2018-01-291-1/+1
| | | | | | | | | | During the upstreaming process it was suggested that I add a handful of small documentation entries about the RISC-V port, which I've collected here. 2018-01-29 Palmer Dabbelt <palmer@sifive.com> * manual/math.texi: RISC-V supports _Float128 and _Float64x.
* Add _Float32 function aliases.Joseph Myers2017-12-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch concludes filling out TS 18661-3 support for different types by adding *f32 function aliases of float functions to support _Float32. As with _Float64 and _Float32x, this is supported for all glibc configurations. As with the previous such patches there are some x86 ulps updates because of inline functions present for float but not for _Float32. The patch also has the usual bits/floatn-common.h update, symbol versions, ABI baselines updates, test enablement and documentation. Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * bits/floatn-common.h (__HAVE_FLOAT32): Define to 1. * manual/math.texi (Mathematics): Document support for _Float32. * math/Makefile (test-types): Add float32. * math/Versions (GLIBC_2.27): Add _Float32 functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.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/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* Add _Float64, _Float32x function aliases.Joseph Myers2017-12-061-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch continues filling out TS 18661-3 support by adding *f64 and *f32x function aliases, supporting _Float64 and _Float32x, as aliases for double functions. These types are supported for all glibc configurations. The API corresponds exactly to that for _Float128 and _Float64x. _Float32 aliases to float functions remain to be added in subsequent patches to complete this process (then there are a few miscellaneous functions in TS 18661-3 to implement that aren't simply versions of existing functions for new types). The patch enables the feature in bits/floatn-common.h, adds symbol versions and documentation with updates to ABI baselines, and arranges for the libm functions for the new types to be tested. As with the _Float64x changes there are some x86 ulps updates because of header inlines not used for the new types (and one other change to the non-multiarch libm-test-ulps, which I suppose comes from using a different compiler version / configuration from when it was last regenerated). Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * bits/floatn-common.h (__HAVE_FLOAT64): Define to 1. (__HAVE_FLOAT32X): Likewise. * manual/math.texi (Mathematics): Document support for _Float64 and _Float32x. * math/Makefile (test-types): Add float64 and float32x. * math/Versions (GLIBC_2.27): Add _Float64 and _Float32x functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.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/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* Add _Float64x function aliases.Joseph Myers2017-11-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch continues filling out TS 18661-3 support by adding *f64x function aliases on platforms with _Float64x support. (It so happens the set of such platforms is exactly the same as the set of platforms with _Float128 support, although on x86_64, x86 and ia32 the _Float64x format is Intel extended rather than binary128.) The API provided corresponds exactly to that provided for _Float128, mostly coming from TS 18661-3. As these functions always alias those for another type (long double, _Float128 or both), __* function names are not provided, as in other cases of alias types. Given the preparation done in previous patches, this one just enables the feature via Makeconfig and bits/floatn.h, adds symbol versions, and updates documentation and ABI baselines. The symbol versions are present unconditionally as GLIBC_2.27 in the relevant Versions files, as it's OK for those to specify versions for functions that may not be present in some configurations; no additional complexity is needed unless in future some configuration gains support for this type that didn't have such support in 2.27. The Makeconfig additions for ia64 and x86 aren't strictly needed, as those configurations also get float64x-alias-fcts definitions from sysdeps/ieee754/float128/Makeconfig, but still seem appropriate given that _Float64x is not _Float128 for those configurations. A libm-test-ulps update for x86 is included. This is because bits/mathinline.h does not have _Float64x support added and for two functions the use of out-of-line functions results in increased ulps (ifloat64x shares ulps with ildouble / ifloat128 as appropriate). Given that we'd like generally to eliminate bits/mathinline.h optimizations, preferring to have such optimizations in GCC instead, it seems reasonable not to add such support there for new types. GCC support for _FloatN / _FloatNx built-in functions is limited, but has been improved in GCC 8, and at some point I hope the full set of libm built-in functions in GCC, and other optimizations with per-floating-type aspects, will be enabled for all _FloatN / _FloatNx types. Tested for x86_64 and x86, and with build-many-glibcs.py, with both GCC 6 and GCC 7. * sysdeps/ia64/Makeconfig (float64x-alias-fcts): New variable. * sysdeps/ieee754/float128/Makeconfig (float64x-alias-fcts): Likewise. * sysdeps/ieee754/ldbl-128/Makeconfig (float64x-alias-fcts): Likewise. * sysdeps/x86/Makeconfig: New file. * bits/floatn-common.h (__HAVE_FLOAT64X): Remove macro. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * bits/floatn.h (__HAVE_FLOAT64X): New macro. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/ia64/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/ieee754/ldbl-128/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/mips/ieee754/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/powerpc/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * sysdeps/x86/bits/floatn.h (__HAVE_FLOAT64X): Likewise. (__HAVE_FLOAT64X_LONG_DOUBLE): Likewise. * manual/math.texi (Mathematics): Document support for _Float64x. * math/Versions (GLIBC_2.27): Add _Float64x functions. * stdlib/Versions (GLIBC_2.27): Likewise. * wcsmbs/Versions (GLIBC_2.27): Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* Add _Float128 function aliases.Joseph Myers2017-10-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for *f128 function aliases on platforms where long double has the binary128 format (and thus GCC 7 provides the _Float128 type with the same ABI as long double but as a distinct type in terms of C type compatibility). This is the same API as provided in glibc 2.26 for powerpc64le / x86_64 / x86 / ia64 where _Float128 has a different format from long double, with the bulk of the API coming from TS 18661-3. All the functions alias the corresponding long double functions, and __* function names are not provided since those are only needed once for each floating-point format, not more than once for different types with the same format (so for example, -ffinite-math-only maps foof128 to __fool_finite, while type-generic macros end up calling e.g. __issignalingl for _Float128 arguments on such platforms). The preparation for this feature was done in previous patches, so this one just needs to add the relevant makefile and header definitions, and update macro definitions of libm_alias_ldouble_other_r, to turn on the feature, and update documentation and ABI baselines. Tested (a) for x86_64, (b) for aarch64, (c) with build-many-glibcs.py with both GCC 6 and GCC 7. * sysdeps/ieee754/ldbl-128/Makeconfig: New file. * sysdeps/ieee754/ldbl-128/bits/floatn.h: Likewise. * sysdeps/ieee754/ldbl-128/float128-abi.h: Likewise. * sysdeps/generic/libm-alias-ldouble.h: Include <bits/floatn.h>. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (libm_alias_ldouble_other_r): Also create _Float128 alias. * sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h: Include <bits/floatn.h>. [__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (libm_alias_ldouble_other_r): Also create _Float128 alias. * manual/math.texi (Mathematics): Document additional architecture support for _Float128. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* Obsolete pow10 functions.Joseph Myers2017-09-011-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch obsoletes the pow10, pow10f and pow10l functions (makes them into compat symbols, not available for new ports or static linking). The exp10 names for these functions are standardized (in TS 18661-4) and were added in the same glibc version (2.1) as pow10 so source code can change to use them without any loss of portability. Since pow10 is deliberately not provided for _Float128, only exp10, this slightly simplifies moving to the new wrapper templates in the !LIBM_SVID_COMPAT case, by avoiding needing to arrange for pow10, pow10f and pow10l to be defined by those templates. Tested for x86_64, and with build-many-glibcs.py. * manual/math.texi (pow10): Do not document. (pow10f): Likewise. (pow10l): Likewise. * math/bits/mathcalls.h [__USE_GNU] (pow10): Do not declare. * math/bits/math-finite.h [__USE_GNU] (pow10): Likewise. * math/libm-test-exp10.inc (pow10_test): Remove. (do_test): Do not call pow10. * math/w_exp10_compat.c (pow10): Make into compat symbol. [NO_LONG_DOUBLE] (pow10l): Likewise. * math/w_exp10f_compat.c (pow10f): Likewise. * math/w_exp10l_compat.c (pow10l): Likewise. * sysdeps/ia64/fpu/e_exp10.S: Include <shlib-compat.h>. (pow10): Make into compat symbol. * sysdeps/ia64/fpu/e_exp10f.S: Include <shlib-compat.h>. (pow10f): Make into compat symbol. * sysdeps/ia64/fpu/e_exp10l.S: Include <shlib-compat.h>. (pow10l): Make into compat symbol. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Remove pow10. (CFLAGS-nldbl-pow10.c): Remove variable.. * sysdeps/ieee754/ldbl-opt/nldbl-pow10.c: Remove file. * sysdeps/ieee754/ldbl-opt/w_exp10_compat.c (pow10l): Condition on [SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_27)]. * sysdeps/ieee754/ldbl-opt/w_exp10l_compat.c (compat_symbol): Undefine and redefine. (pow10l): Make into compat symbol. * sysdeps/aarch64/libm-test-ulps: Remove pow10 ulps. * sysdeps/alpha/fpu/libm-test-ulps: Likewise. * sysdeps/arm/libm-test-ulps: Likewise. * sysdeps/hppa/fpu/libm-test-ulps: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/microblaze/libm-test-ulps: Likewise. * sysdeps/mips/mips32/libm-test-ulps: Likewise. * sysdeps/mips/mips64/libm-test-ulps: Likewise. * sysdeps/nios2/libm-test-ulps: Likewise. * sysdeps/powerpc/fpu/libm-test-ulps: Likewise. * sysdeps/powerpc/nofpu/libm-test-ulps: Likewise. * sysdeps/s390/fpu/libm-test-ulps: Likewise. * sysdeps/sh/libm-test-ulps: Likewise. * sysdeps/sparc/fpu/libm-test-ulps: Likewise. * sysdeps/tile/libm-test-ulps: Likewise. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* Add float128 support for ia64.Joseph Myers2017-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables float128 support for ia64, so that all the configurations where GCC supports _Float128 / __float128 as an ABI-distinct type now have glibc support as well. bits/floatn.h declares the support to be available for GCC 4.4 and later, which is when the libgcc support was added. The removal of sysdeps/ia64/fpu/k_rem_pio2.c is because the generic k_rem_pio2.c defines a function required by the float128 code. Tested (compilation only) with build-many-glibcs.py for ia64 (GCC 6 and GCC 7). Given how long it is since libm-test-ulps has been updated for ia64, I think truncating the file and regenerating it from scratch would be a good idea when doing a regeneration to add float128 ulps. I expect various ia64 libm issues (at least some already filed in Bugzilla) to result in test failures even after ulps regeneration, but hopefully the float128 code will pass tests as it's the same as used on other architectures. * sysdeps/ia64/Implies: Add ieee754/float128. * sysdeps/ia64/bits/floatn.h: New file. * sysdeps/ia64/float128-abi.h: Likewise. * manual/math.texi (Mathematics): Document support for _Float128 on ia64. * sysdeps/ia64/Makefile [$(subdir) = math] (CPPFLAGS): Append to Makefile variable. * sysdeps/ia64/fpu/e_sqrtf128.c: New file. * sysdeps/ia64/fpu/k_rem_pio2.c: Remove file. * sysdeps/ia64/fpu/sfp-machine.h: New file. Based on libgcc. * sysdeps/ia64/math-tests.h: New file. * math/libm-test-support.h (XFAIL_FLOAT128_PAYLOAD): Also define based on TEST_COND_binary128 for [__ia64__]. * sysdeps/unix/sysv/linux/ia64/libc.abilist: Update. * sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise,
* Add float128 support for x86_64, x86.Joseph Myers2017-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables float128 support for x86_64 and x86. All GCC versions that can build glibc provide the required support, but since GCC 6 and before don't provide __builtin_nanq / __builtin_nansq, sNaN tests and some tests of NaN payloads need to be disabled with such compilers (this does not affect the generated glibc binaries at all, just the tests). bits/floatn.h declares float128 support to be available for GCC versions that provide the required libgcc support (4.3 for x86_64, 4.4 for i386 GNU/Linux, 4.5 for i386 GNU/Hurd); compilation-only support was present some time before then, but not really useful without the libgcc functions. fenv_private.h needed updating to avoid trying to put _Float128 values in registers. I make no assertion of optimality of the math_opt_barrier / math_force_eval definitions for this case; they are simply intended to be sufficient to work correctly. Tested for x86_64 and x86, with GCC 7 and GCC 6. (Testing for x32 was compilation tests only with build-many-glibcs.py to verify the ABI baseline updates. I have not done any testing for Hurd, although the float128 support is enabled there as for GNU/Linux.) * sysdeps/i386/Implies: Add ieee754/float128. * sysdeps/x86_64/Implies: Likewise. * sysdeps/x86/bits/floatn.h: New file. * sysdeps/x86/float128-abi.h: Likewise. * manual/math.texi (Mathematics): Document support for _Float128 on x86_64 and x86. * sysdeps/i386/fpu/fenv_private.h: Include <bits/floatn.h>. (math_opt_barrier): Do not put _Float128 values in floating-point registers. (math_force_eval): Likewise. [__x86_64__] (SET_RESTORE_ROUNDF128): New macro. * sysdeps/x86/fpu/Makefile [$(subdir) = math] (CPPFLAGS): Append to Makefile variable. * sysdeps/x86/fpu/e_sqrtf128.c: New file. * sysdeps/x86/fpu/sfp-machine.h: Likewise. Based on libgcc. * sysdeps/x86/math-tests.h: New file. * math/libm-test-support.h (XFAIL_FLOAT128_PAYLOAD): New macro. * math/libm-test-getpayload.inc (getpayload_test_data): Use XFAIL_FLOAT128_PAYLOAD. * math/libm-test-setpayload.inc (setpayload_test_data): Likewise. * math/libm-test-totalorder.inc (totalorder_test_data): Likewise. * math/libm-test-totalordermag.inc (totalordermag_test_data): Likewise. * sysdeps/unix/sysv/linux/i386/libc.abilist: Update. * sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise. * sysdeps/i386/fpu/libm-test-ulps: Likewise. * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise. * sysdeps/x86_64/fpu/libm-test-ulps: Likewise.
* powerpc64le: Enable float128Paul E. Murphy2017-06-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds ULPs for the float128 type, updates the abilist for libc and libm, and adds the files bits/floatn.h and float128-abi.h, in order to enable the new type for powerpc64le. This patch also adds the implementation of sqrtf128 for powerpc64le, since it is not implemented in libgcc. The sfp-machine.h header is taken from libgcc. Tested for powerpc64le (GCC 6.2 and GCC 7.1), powerpc64 and s390x. * manual/math.texi (Mathematics): Mention the enabling of float128 for powerpc64le. * sysdeps/powerpc/bits/floatn.h: New file. * sysdeps/powerpc/fpu/libm-test-ulps: Regenerated. * sysdeps/powerpc/fpu/math_private.h: (__ieee754_sqrtf128): New inline override. * sysdeps/powerpc/powerpc64le/Implies-before: New file. * sysdeps/powerpc/powerpc64le/Makefile: New file. * sysdeps/powerpc/powerpc64le/fpu/e_sqrtf128.c: New file. * sysdeps/powerpc/powerpc64le/fpu/sfp-machine.h: New file. * sysdeps/powerpc/powerpc64le/power9/fpu/e_sqrtf128.c: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist: Updated. * sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64le/float128-abi.h: New file.
* manual: Fix a minor grammatical error.Rical Jasan2017-06-251-1/+1
| | | | * manual/math.texi: Fix a grammatical error.
* Document _FloatN and _FloatNx versions of math functionsGabriel F. T. Gomes2017-06-231-7/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functions defined in ISO/IEC TS 18661-3 take floating-point arguments and return floating-point numbers of _FloatN and _FloatNx types. Apart from the type, these functions behave the same as their float, double, and long double counterparts. This patch adds the newer functions to the manual. * manual/arith.texi (Infinity and NaN): Document SNANFN and SNANFNx. (Error Reporting by Mathematical Functions): Document HUGE_VAL_FN and HUGE_VAL_FNx. (Absolute Value): Document fabsfN, fabsfNx, cabsfN, cabsfNx. Rephrase the paragraph that mentions that fabs, fabsf, and fabsl are in math.h, to avoid having to list the _FloatN and _FloatNx variants as well. Likewise for the cabs functions. (Normalization Functions): Document frexpfN, frexpfNx, ldexpfN, ldexpfNx, scalbnfN, scalbnfNx, scalblnfN, scalblnfNx. Mention that _FloatN and _FloatNx variants of scalbn and scalbln come from TS 18661-3, since this section explicitly states that these functions come from BSD. (Rounding Functions): Document ceilfN, ceilfNx, floorfN, floorfNx, truncfN, truncfNx, rintfN, rintfNx, nearbyintfN, nearbyintfNx, roundfN, roundfNx, roundevenfN, roundevenfNx, lrintfN, lrintfNx, llrintfN, llrintfNx, lroundfN, lroundfNx, llroundfN, llroundfNx, fromfpfN, fromfpfNx, ufromfpfN, ufromfpfNx, fromfpxfN, fromfpxfNx, ufromfpxfN, ufromfpxfNx, modffN, modffNx. (Remainder Functions): Document fmodfN, fmodfNx, remainderfN, remainderfNx. (Setting and modifying single bits of FP values): Document copysignfN, copysignfNx, nextafterfN, nextafterfNx, nextupfN, nextupfNx, nextdownfN, nextdownfNx, nanfN, nanfNx, canonicalizefN, canonicalizefNx, getpayloadfN, getpayloadfNx, setpayloadfN, setpayloadfNx, setpayloadsigfN, setpayloadsigfNx. (Floating-Point Comparison Functions): Document totalorderfN, totalorderfNx, totalordermagfN, totalordermagfNx. (Miscellaneous FP arithmetic functions): Document fminfN, fminfNx, fmaxfN, fmaxfNx, fminmagfN, fminmagfNx, fmaxmagfN, fmaxmagfNx, fdimfN, fdimfNx, fmafN, fmafNx. (Complex Numbers): Document the complex types: _FloatN complex and _FloatNx complex. (rojections, Conjugates, and Decomposing of Complex Numbers): Document crealfN, crealfNx, cimagfN, cimagfNx, conjfN, conjfNx, cargfN, cargfNx, cprojfN, cprojfNx. * manual/math.texi (Mathematics): Mention that the _FloatN and _FloatNx variants of the math functions come from TS 18661-3, unless otherwise stated. (Predefined Mathematical Constants): Document the _FloatN and _FloatNx variants of the macros prefixed with M_. (Trigonometric Functions): Document sinfN, sinfNx, cosfN, cosfNx, tanfN, tanfNx, sincosfN, sincosfNx, csinfN, csinfNx, ccosfN, ccosfNx, ctanfN, ctanfNx. (Inverse Trigonometric Functions): Document asinfN, asinfNx, acosfN, acosfNx, atanfN, atanfNx, atan2fN, atan2fNx. (Exponentiation and Logarithms): Document expfN, expfNx, exp2fN, exp2fNx, exp10fN, exp10fNx, logfN, logfNx, log10fN, log10fNx, log2fN, log2fNx, logbfN, logbfNx, ilogbfN, ilogbfNx, llogbfN, llogbfNx, powfN, powfNx, sqrtfN, sqrtfNx, cbrtfN, cbrtfNx, hypotfN, hypotfNx, expm1fN, expm1fNx, log1pfN, log1pfNx, cexpfN, cexpfNx, clogfN, clogfNx, clog10fN, clog10fNx, csqrtfN, csqrtfNx, cpowfN, cpowfNx. (Hyperbolic Functions): sinhfN, sinhfNx, coshfN, coshfNx, tanhfN, tanhfNx, csinhfN, csinhfNx, ccoshfN, ccoshfNx, ctanhfN, ctanhfNx, asinhfN, asinhfNx, acoshfN, acoshfNx, atanhfN, atanhfNx, casinhfN, casinhfNx, cacoshfN, cacoshfNx, catanhfN, catanhfNx. (Special Functions): Document erffN, erffNx, erfcfN, erfcfNx, lgammafN, lgammafNx, lgammarfN_r, lgammafNx_r, tgammafN, tgammafNx, j0fN, j0fNx, j1fN, j1fNx, jnfN, jnfNx, y0fN, y0fNx, y1fN, y1fNx, ynfN, ynfNx.
* manual: Replace summary.awk with summary.pl.Rical Jasan2017-06-151-424/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Summary is now generated from @standards, and syntax-checking is performed. If invalid @standards syntax is detected, summary.pl will fail, reporting all errors. Failure and error reporting is disabled for now, however, since much of the manual is still incomplete wrt. header and standards annotations. Note that the sorting order of the Summary has changed; summary.pl respects the locale, like summary.awk did, but the use of LC_ALL=C is introduced in the Makefile. Other notable deviations are improved detection of the annotated elements' names, which are used for sorting, and improved detection of the @node used to reference into the manual. The most noticeable difference in the rendered Summary is that entries may now contain multiple lines, one for each header and standard combination. summary.pl accepts a `--help' option, which details the expected syntax of @standards. If errors are reported, the user is directed to this feature for further information. * manual/Makefile: Generate summary.texi with summary.pl. Force use of the C locale. Update Perl dependency comment. * manual/header.texi: Update reference to summary.awk. * manual/macros.texi: Refer authors to `summary.pl --help'. * manual/summary.awk: Remove file. * manual/summary.pl: New file. Generate summary.texi, and check for @standards-related syntax errors. * manual/argp.texi: Convert header and standards @comments to @standards. * manual/arith.texi: Likewise. * manual/charset.texi: Likewise. * manual/conf.texi: Likewise. * manual/creature.texi: Likewise. * manual/crypt.texi: Likewise. * manual/ctype.texi: Likewise. * manual/debug.texi: Likewise. * manual/errno.texi: Likewise. * manual/filesys.texi: Likewise. * manual/getopt.texi: Likewise. * manual/job.texi: Likewise. * manual/lang.texi: Likewise. * manual/llio.texi: Likewise. * manual/locale.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/message.texi: Likewise. * manual/pattern.texi: Likewise. * manual/pipe.texi: Likewise. * manual/process.texi: Likewise. * manual/resource.texi: Likewise. * manual/search.texi: Likewise. * manual/setjmp.texi: Likewise. * manual/signal.texi: Likewise. * manual/socket.texi: Likewise. * manual/startup.texi: Likewise. * manual/stdio.texi: Likewise. * manual/string.texi: Likewise. * manual/sysinfo.texi: Likewise. * manual/syslog.texi: Likewise. * manual/terminal.texi: Likewise. * manual/threads.texi: Likewise. * manual/time.texi: Likewise. * manual/users.texi: Likewise.
* float128: Add strfromf128, strtof128, and wcstof128 to the manualGabriel F. T. Gomes2017-06-121-0/+11
| | | | | | | | | | * manual/math.texi (Mathematics): Add description for _FloatN and _FloatNx types and mentions that they are not support in glibc for any architecture, so far. * manual/arith.texi (wcstof, wcstold): Replace the mention to stdlib.h with wchar.h. (Parsing of Floats): Add descriptions for strtofN and wcstofN. (Printing of Floats): Add description for strfromfN.
* Do not hardcode list of libm functions in libm-err-tab.pl.Joseph Myers2017-02-061-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | manual/libm-err-tab.pl contains a hardcoded list of libm functions for which ulps are listed in the manual, and another hardcoded list in a comment of functions deliberately excluded because of an expected lack of ulps (and the two together are not in fact an exhaustive list of libm functions tested through the libm-test machinery). This patch removes these hardcoded lists, so eliminating this from the places needing updating when a new libm function is added. Instead, ulps are tabulated for functions for which they are seen in libm-test-ulps files, in alphabetical order. The pseudo-function names such as *_downward and *_vlen* are excluded since they are excluded from the existing lists, and the description in the manual is updated to explain how those entries are excluded and if a function is not listed at all it does not have known errors. Tested for x86_64. * manual/libm-err-tab.pl (@all_functions): Change to %all_functions. Initialize as empty. (parse_ulps): Add to %all_functions based on functions found in ulps files. Ignore results for non-default rounding modes and vector functions. (print_platforms): Use %all_platforms. * manual/math.texi (Errors in Math Functions): Document omissions from the table.
* Add getentropy, getrandom, <sys/random.h> [BZ #17252]Florian Weimer2016-12-121-1/+2
|
* Add llogb, llogbf, llogbl.Joseph Myers2016-12-021-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TS 18661-1 defines llogb functions that are like ilogb except that they return long int instead of int. Corresponding FP_LLOGB* macros are defined, whose values are required to have the obvious correspondence to those of the FP_ILOGB* macros. This patch implements these functions and macros for glibc. llogb uses the type-generic infrastructure, with an implementation similar to the wrapper for ilogb but with additional conversion from FP_ILOGB* to FP_LLOGB*; this approach avoids needing to modify or duplicate any of the architecture-specific ilogb implementations. Tests are also based on those for ilogb. Ideally the llogb functions would alias the ilogb ones when long is 32-bit, but such aliasing requires the associated header declarations of the different-type alias to be hidden, typically by defining macros before including the header (see e.g. how sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c defines lround to __hidden_lround before including <math.h>). The infrastructure for type-generic function implementations does not support defining such macros at present (since C code can't define a macro whose name is determined by other macros). So this patch leaves them as separate functions (similar to e.g. scalbln and scalbn being separate in such a case as well), but with the remapping of FP_ILOGB* to FP_LLOGB* conditioned out in the case where it would be the identity map. Tested for x86_64, x86, mips64 and powerpc. * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (llogb): New declaration. * math/tgmath.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (llogb): New macro. * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (__FP_LONG_MAX): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT)] (FP_LLOGB0): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT)] (FP_LLOGBNAN): Likewise. * math/Versions (llogb): New libm symbol at version GLIBC_2.25. (llogbf): Likewise. (llogbl): Likewise. * math/Makefile (gen-libm-calls): Add w_llogbF. (tests): Add test-fp-llogb-constants. * math/w_llogb_template.c: New file. Based on math/w_ilogb_template.c. * math/libm-test.inc (llogb_test_data): New array. (llogb_test): New function. (main): Call llogb_test. * math/test-fp-llogb-constants.c: New file. Based on math/test-fp-ilogb-constants.c. * math/test-tgmath-ret.c (llogb): New CHECK_RET_CONST call. (do_test): Call check_return_llogb. * math/test-tgmath.c (NCALLS): Increase to 126. (F(compile_test)): Call llogb. (F(llogb)): New function. * manual/math.texi (Exponents and Logarithms): Document llogb, llogbf, llogbl, FP_LLOGB0 and FP_LLOGBNAN. * manual/libm-err-tab.pl (@all_functions): Add llogb. * sysdeps/ieee754/ldbl-opt/nldbl-llogb.c: New file. * sysdeps/ieee754/ldbl-opt/w_llogbl.c: Likewise. * sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add llogb. (CFLAGS-nldbl-llogb.c): New variable. * 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.
* Correct clog10 documentation (bug 19673).Joseph Myers2016-11-011-2/+2
| | | | | | | | | | | | | | | | | | Bug 19673 reports that the documentation of clog10 is incorrect, both failing to include the division by log (10) in the imaginary part and, in the non-TeX version of the equation only, describing the LHS as log rather than log10. This patch fixes both issues. Note: I think it's appropriate that the LHS says log10 not clog10, and that the cexp and clog descriptions referred to in a comment in that bug report similarly say exp and log; this is a mathematical description not a literal C one. Tested for x86_64. [BZ #19673] * manual/math.texi (Exponents and Logarithms): Correct description of clog10.
* Manual typos: MathematicsRical Jasan2016-10-061-18/+18
| | | | | | 2016-05-06 Rical Jasan <ricaljasan@pacific.net> * manual/math.texi: Fix typos in the manual.
* Support __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro.Joseph Myers2016-08-031-4/+5
| | | | | | | | | | | | | | | | | | | | | | | This patch implements support for the __STDC_WANT_IEC_60559_FUNCS_EXT__ feature test macro, following the __GLIBC_USE approach used for other ISO C feature test macros. Currently this only affects the exp10 functions (which glibc has had for a long time). Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): New macro. * include/features.h (__STDC_WANT_IEC_60559_FUNCS_EXT__): Document. * manual/creature.texi (__STDC_WANT_IEC_60559_FUNCS_EXT__): Document macro. * manual/math.texi (exp10): Document as ISO from TS 18661-4:2015. (exp10f): Likewise. (exp10l): Likewise. * math/bits/mathcalls.h (exp10): Declare if [__GLIBC_USE (IEC_60559_FUNCS_EXT)], not [__USE_GNU].
* Allow spurious underflow / inexact for ldbl-128ibm.Joseph Myers2016-03-101-0/+10
| | | | | | | | | | | | | | | | | | | | | | A large number of the test-ldouble failures seen for ldbl-128ibm are spurious "underflow" and "inexact" exceptions. These arise from such exceptions in the underlying arithmetic; unlike other spurious exceptions from that arithmetic, they do not in general relate to cases where the returned result is also substantially inaccurate, are not so readily avoidable by appropriately conditional libgcc patches, and are widespread enough to be hard to handle through individual XFAILing of the affected tests. Thus, this patch documents relaxed accuracy goals for libm functions for IBM long double and makes libm-test.inc reflect these spurious exceptions in ldbl-128ibm arithmetic and always allow them in ldbl-128ibm testing (while still not allowing these exceptions to be missing where required to be present). Tested for powerpc. * manual/math.texi (Errors in Math Functions): Document relaxed accuracy goals for IBM long double. * math/libm-test.inc (test_exceptions): Always allow spurious "underflow" and "inexact" exceptions for IBM long double.
* Refine documentation of libm exceptions goals.Joseph Myers2015-02-171-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refines the math.texi documentation of the goals for when libm function raise the inexact and underflow exceptions. The previous text was problematic in some cases around the underflow threshold. * Strictly, it would have meant that if the mathematical result of pow was very slightly below DBL_MIN, for example, it was required to raise the underflow exception; although normally a few ulps error would be OK, if that error meant the computed value was slightly above DBL_MIN it would fail the previously described underflow exception goal. * Similarly, strict IEEE semantics would imply that sin (DBL_MIN), in round-to-nearest mode, underflows on before-rounding but not after-rounding architectures, while returning DBL_MIN; the previous wording would have required an underflow exception, so preventing checks for a result with absolute value below DBL_MIN from being sufficient checks to determine whether the exception is required. (Under the previous wording, checks for a result with absolute value <= DBL_MIN wouldn't have been sufficient either, because in FE_TOWARDZERO mode a result of DBL_MIN definitely does not result from an underflowing infinite-precision result.) * The previous wording about rounding infinite-precision values could be taken to mean all exceptions including "inexact" must be consistent with some such value. That would mean that a result of DBL_MIN in FE_UPWARD mode with "inexact" raised must also have "underflow" raised on before-rounding architectures. Again, that would cause problems for computing a result (possibly with spurious "inexact" exceptions) and then using a rounding-mode-independent test for results with absolute value below DBL_MIN to determine whether an underflow exception must be forced in case the underflows from intermediate computations happened to be exact. By refining the documentation, this patch avoids stating goals for accuracy close to the underflow threshold that were stricter than applied anywhere else, and allows the implementation strategy of: compute a result within a few ulps, taking care to avoid underflows in intermediate computations, then force an underflow exception if that result was subnormal. Only fully-defined functions such as fma need to take greater care about the exact underflow threshold (including its dependence on whether the architecture is before-rounding or after-rounding, and on the rounding mode on after-rounding architectures). (If the rounding mode is changed as part of the computation, it's still necessary to ensure that not just intermediate computations, but the final computation of the result to be returned, do not raise underflow if that result is the least normal value and underflow would be inconsistent with the original rounding mode. Since such code can readily discard exceptions as part of saving and restoring the rounding mode - SET_RESTORE_ROUND_NOEX etc. - I don't think that should be a problem in practice.) * manual/math.texi (Errors in Math Functions): Clarify goals regarding inexact and underflow exceptions.
* Fix two spaces after sentence.Ondřej Bílka2014-02-261-1/+1
| | | | | Minor formatting fix that was carried by issuing sed -e"s/\. \([A-Z]\)/. \1/" followed by editing result.
* Remove _BSD_SOURCE and _SVID_SOURCE.Joseph Myers2014-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a minimal patch to remove _BSD_SOURCE and _SVID_SOURCE from the documented user API, making them into aliases for _DEFAULT_SOURCE with a #warning given, but keeping most of the features.h logic using those macros and all the exising __USE_* conditionals, on the basis that all the consequent cleanups will go in followup patches. Tested x86_64. * include/features.h: Update comment documenting feature test macros. [_BSD_SOURCE || _SVID_SOURCE]: Give #warning. Define _DEFAULT_SOURCE. * manual/creature.texi (_BSD_SOURCE): Remove documentation. (_SVID_SOURCE): Likewise. (_DEFAULT_SOURCE): Update description of default features. (Feature Test Macros): Don't mention _SVID_SOURCE in conjunction with _GNU_SOURCE. * manual/filesys.texi (__ftw_func_t): Do not refer to _BSD_SOURCE. (S_ISVTX): Likewise. * manual/math.texi (Mathematical Constants): Likewise. * manual/signal.texi (Interrupted Primitives): Likewise. * manual/startup.texi (putenv): Do not refer to _SVID_SOURCE. * math/test-matherr.c (_SVID_SOURCE): Do not define. * sysvipc/sys/ipc.h [__USE_SVID && !__USE_XOPEN && __GNUC__ >= 2]: Don't refer to _SVID_SOURCE in warning text.
* * manual/math.texi: Document MTASC-safety properties.Alexandre Oliva2014-01-311-0/+103
|
* Document libm accuracy goals.Joseph Myers2013-11-281-4/+74
|
* Fix description of random according to POSIX. Fixes bug 7003Bruno Haible2013-11-011-1/+1
|
* Fix some errors in declarations in the manual.Roland McGrath2013-02-111-4/+4
|
* Use Texinfo macros to refer to the GNU C Library within the manual.Joseph Myers2012-02-281-9/+9
|
* Fix various problems with @deftypefun lines.Nicolas Boulenguez2012-02-171-6/+6
|
* manual: fix typo: s/are/is/Jim Meyering2010-02-221-1/+1
| | | | * manual/math.texi (BSD Random): Fix a typo: s/are/is/
* * manual/arith.texi: Avoid @strong{Note:}.Ulrich Drepper2008-08-021-1/+1
| | | | | | | | | | * manual/creature.texi: Likewise. * manual/filesys.texi: Likewise. * manual/math.texi: Likewise. * manual/memory.texi: Likewise. * manual/resource.texi: Likewise. * manual/syslog.texi: Likewise. * manual/time.texi: Likewise.
* * manual/libc-texinfo.sh: Add entry about free manuals.Andreas Jaeger2001-08-281-3/+5
| | | | | | | | | | | | | | | | | | * manual/contrib.texi (Contributors): Fix cross reference. * manual/libc.texinfo (Copying): Include freemanuals. * manual/Makefile (appendices): Add freemanuals. * manual/freemanuals.texi: New file. Patch by Brian Youmans <3diff@gnu.org>. * manual/libm-err-tab.pl: Pretty print more platforms, print a smaller table. * manual/math.texi (Errors in Math Functions): Fix grammar, start table on separate page. Patch by Brian Youmans <3diff@gnu.org>.
* Update.Ulrich Drepper2001-04-091-12/+70
| | | | | | | 2001-04-09 Ulrich Drepper <drepper@redhat.com> * Makefile (distribute): Add scripts/documented.sh. * scripts/documented.sh: New file.
* Update.Ulrich Drepper2001-03-191-0/+3
| | | | | | | | | | | | | | | * sysdeps/unix/i386/i686/tempname.c: New file. * sysdeps/posix/tempname.c (__gen_tempname): If RANDOM_BITS is defined use this macro to get some bits of randomness instead of the usual gettimeofday or time calls. 2001-03-16 Paul Eggert <eggert@twinsun.com> * sysdeps/posix/tempname.c (uint64_t): Define to uintmax_t if not defined, and if UINT64_MAX is not defined. 2001-03-19 Ulrich Drepper <drepper@redhat.com>
* (Environment Access): Adjust comment about setenv() being BSD-only.Ulrich Drepper2001-01-271-5/+6
|
* Update.Ulrich Drepper2000-08-201-0/+2
| | | | | | | | | | | 2000-08-20 Ulrich Drepper <drepper@redhat.com> * time/tst-getdate.c (main): Make error messages more human readable. * sysdeps/powerpc/fpu_control.h (_FPU_GETCW): Allow gcc to generic postinc/postdec instruction. (_FPU_SETCW): Likewise. Patch by Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.
* Update.Ulrich Drepper2000-05-251-3/+5
| | | | | | | | | | | | | 2000-05-22 Andreas Jaeger <aj@suse.de> * math/Makefile: Add -D__FAST_MATH__ to CFLAGS-test-ifloat.c, CFLAGS-test-idouble.c, CFLAGS-test-ildoubl.c. * manual/math.texi (FP Function Optimizations): Document gcc -ffast-math behaviour with mathinlines. * sysdeps/i386/fpu/bits/mathinline.h: Only use save inline functions unless -ffast-math is given to gcc.