Commit Graph

12 Commits

Author SHA1 Message Date
Joseph Myers 541f19baf8 Use libm_alias_* in soft-fp.
This patch makes the soft-fp implementations of fma functions use the
libm_alias_* macros.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by the patch.

	* soft-fp/fmadf4.c: Include <libm-alias-double.h>.
	[!__fma] (fma): Define using libm_alias_double.
	* soft-fp/fmasf4.c: Include <libm-alias-float.h>.
	[!__fmaf] (fmaf): Define using libm_alias_float.
	* soft-fp/fmatf4.c: Include <libm-alias-ldouble.h>.
	(fmal): Define using libm_alias_ldouble.
2017-10-11 00:03:46 +00:00
Zack Weinberg 9090848d06 Narrowing the visibility of libc-internal.h even further.
posix/wordexp-test.c used libc-internal.h for PTR_ALIGN_DOWN; similar
to what was done with libc-diag.h, I have split the definitions of
cast_to_integer, ALIGN_UP, ALIGN_DOWN, PTR_ALIGN_UP, and PTR_ALIGN_DOWN
to a new header, libc-pointer-arith.h.

It then occurred to me that the remaining declarations in libc-internal.h
are mostly to do with early initialization, and probably most of the
files including it, even in the core code, don't need it anymore.  Indeed,
only 19 files actually need what remains of libc-internal.h.  23 others
need libc-diag.h instead, and 12 need libc-pointer-arith.h instead.
No file needs more than one of them, and 16 don't need any of them!

So, with this patch, libc-internal.h stops including libc-diag.h as
well as losing the pointer arithmetic macros, and all including files
are adjusted.

        * include/libc-pointer-arith.h: New file.  Define
	cast_to_integer, ALIGN_UP, ALIGN_DOWN, PTR_ALIGN_UP, and
        PTR_ALIGN_DOWN here.
        * include/libc-internal.h: Definitions of above macros
	moved from here.  Don't include libc-diag.h anymore either.
	* posix/wordexp-test.c: Include stdint.h and libc-pointer-arith.h.
        Don't include libc-internal.h.

	* debug/pcprofile.c, elf/dl-tunables.c, elf/soinit.c, io/openat.c
	* io/openat64.c, misc/ptrace.c, nptl/pthread_clock_gettime.c
	* nptl/pthread_clock_settime.c, nptl/pthread_cond_common.c
	* string/strcoll_l.c, sysdeps/nacl/brk.c
	* sysdeps/unix/clock_settime.c
	* sysdeps/unix/sysv/linux/i386/get_clockfreq.c
	* sysdeps/unix/sysv/linux/ia64/get_clockfreq.c
	* sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c
	* sysdeps/unix/sysv/linux/sparc/sparc64/get_clockfreq.c:
	Don't include libc-internal.h.

	* elf/get-dynamic-info.h, iconv/loop.c
	* iconvdata/iso-2022-cn-ext.c, locale/weight.h, locale/weightwc.h
	* misc/reboot.c, nis/nis_table.c, nptl_db/thread_dbP.h
	* nscd/connections.c, resolv/res_send.c, soft-fp/fmadf4.c
	* soft-fp/fmasf4.c, soft-fp/fmatf4.c, stdio-common/vfscanf.c
	* sysdeps/ieee754/dbl-64/e_lgamma_r.c
	* sysdeps/ieee754/dbl-64/k_rem_pio2.c
	* sysdeps/ieee754/flt-32/e_lgammaf_r.c
	* sysdeps/ieee754/flt-32/k_rem_pio2f.c
	* sysdeps/ieee754/ldbl-128/k_tanl.c
	* sysdeps/ieee754/ldbl-128ibm/k_tanl.c
	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c
	* sysdeps/ieee754/ldbl-96/k_tanl.c, sysdeps/nptl/futex-internal.h:
	Include libc-diag.h instead of libc-internal.h.

        * elf/dl-load.c, elf/dl-reloc.c, locale/programs/locarchive.c
        * nptl/nptl-init.c, string/strcspn.c, string/strspn.c
	* malloc/malloc.c, sysdeps/i386/nptl/tls.h
	* sysdeps/nacl/dl-map-segments.h, sysdeps/x86_64/atomic-machine.h
	* sysdeps/unix/sysv/linux/spawni.c
        * sysdeps/x86_64/nptl/tls.h:
        Include libc-pointer-arith.h instead of libc-internal.h.

	* elf/get-dynamic-info.h, sysdeps/nacl/dl-map-segments.h
	* sysdeps/x86_64/atomic-machine.h:
        Add multiple include guard.
2017-03-01 20:33:46 -05:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers f1d237df1e Remove GCC version conditionals on -Wmaybe-uninitialized pragmas.
One common case of __GNUC_PREREQ (4, 7) conditionals is use of
diagnostic control pragmas for -Wmaybe-uninitialized, an option
introduced in GCC 4.7 where older GCC needed -Wuninitialized to be
controlled instead if the warning appeared with older GCC.  This patch
removes such conditionals.

(There remain several older uses of -Wno-uninitialized in makefiles
that still need to be converted to diagnostic control pragmas if the
issue is still present with current sources and supported GCC
versions, and it's likely that in most cases those pragmas also will
end up controlling -Wmaybe-uninitialized.)

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch, except for libresolv
since res_send.c contains assertions whose line numbers are changed by
the patch).

	* resolv/res_send.c (send_vc) [__GNUC_PREREQ (4, 7)]: Make code
	unconditional.
	* soft-fp/fmadf4.c [__GNUC_PREREQ (4, 7)]: Likewise.
	[!__GNUC_PREREQ (4, 7)]: Remove conditional code.
	* soft-fp/fmasf4.c [__GNUC_PREREQ (4, 7)]: Make code
	unconditional.
	[!__GNUC_PREREQ (4, 7)]: Remove conditional code.
	* soft-fp/fmatf4.c [__GNUC_PREREQ (4, 7)]: Make code
	unconditional.
	[!__GNUC_PREREQ (4, 7)]: Remove conditional code.
	* stdlib/setenv.c
	[((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7)]: Make
	code unconditional.
	[!(((__GNUC__ << 16) + __GNUC_MINOR__) >= ((4 << 16) + 7))]:
	Remove conditional code.
	* sysdeps/ieee754/dbl-64/e_lgamma_r.c
	(__ieee754_lgamma_r) [__GNUC_PREREQ (4, 7)]: Make code
	unconditional.
	(__ieee754_lgamma_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
	code.
	* sysdeps/ieee754/flt-32/e_lgammaf_r.c
	(__ieee754_lgammaf_r) [__GNUC_PREREQ (4, 7)]: Make code
	unconditional.
	(__ieee754_lgammaf_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
	code.
	* sysdeps/ieee754/ldbl-128/k_tanl.c
	(__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
	(__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
	* sysdeps/ieee754/ldbl-128ibm/k_tanl.c
	(__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
	(__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
	* sysdeps/ieee754/ldbl-96/e_lgammal_r.c
	(__ieee754_lgammal_r) [__GNUC_PREREQ (4, 7)]: Make code
	unconditional.
	(__ieee754_lgammal_r) [!__GNUC_PREREQ (4, 7)]: Remove conditional
	code.
	* sysdeps/ieee754/ldbl-96/k_tanl.c
	(__kernel_tanl) [__GNUC_PREREQ (4, 7)]: Make code unconditional.
	(__kernel_tanl) [!__GNUC_PREREQ (4, 7)]: Remove conditional code.
2015-10-27 23:42:20 +00:00
Steve Ellcey 37430363b8 Fix undefined warning messages in GCC 6.
GCC 6 puts out warnings in a different location then GCC 5.  Move the
    DIAG macros so that the warnings are supressed for both compilers.

    ChangeLog:

	* soft-fp/fmasf4.c: Add include of sys/cdefs.h.
	Move DIAG_PUSH_NEEDS_COMMENT, DIAG_IGNORE_NEEDS_COMMENT to front of
	file, move DIAG_POP_NEEDS_COMMENT to end of file.
	* soft-fp/fmadf4.c: Ditto.
	* soft-fp/fmatf4.c: Ditto.
2015-08-27 08:09:49 -07:00
Joseph Myers dc6b5aed1b Fix soft-fp fma for -Wuninitialized.
The soft-fp implementations of fma produce -Wuninitialized warnings
because, in the cases where the result is not a nonzero finite value,
the soft-fp does not set the exponent of the result since the (cooked)
packing will do so, but the compiler does not then see that the
exponent is always set in packing before it's used if it wasn't set
earlier.  This patch uses DIAG_* macros to suppress those warnings.

Tested for mips64.  (In fact this allows the mips64 build to complete
with the -Wno-uninitialized removed from math/Makefile, but more
cleanups are still needed in the ldbl-128ibm code for uninitialized
warnings there.)

	* soft-fp/fmadf4.c: Include <libc-internal.h>.
	(__fma): Ignore uninitialized warnings around packing.
	* soft-fp/fmasf4.c: Include <libc-internal.h>.
	(__fmaf): Ignore uninitialized warnings around packing.
	* soft-fp/fmatf4.c: Include <libc-internal.h>.
	(__fmal): Ignore uninitialized warnings around packing.
2015-05-22 20:28:50 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers 51ca9e29af soft-fp: fix horizontal whitespace. 2013-10-16 01:22:21 +00:00
Joseph Myers 1e14558915 soft-fp: fix vertical whitespace and indentation. 2013-10-15 00:17:35 +00:00
Joseph Myers 77f01ab5d1 Implement fma in soft-fp. 2013-07-02 14:55:32 +00:00