aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-09-01Make common fmax implementation generic.Paul E. Murphy11-78/+34
Also update aarch64 to ensure the correct s_fmin.c is included. The include order favors including the generated copy.
2016-09-01Make common nextdown implementation generic.Paul E. Murphy6-68/+23
With the exception of those machines using the ldbl-opt in an Implies file, this is a trivial transformation. nextdownl is not subject to the non-trivial versioning rules of the other generated functions, so to keep things simple, it is handled as a one-off case in ldbl-opt to preserve the existing behavior.
2016-09-01Make common fdim implementation generic.Paul E. Murphy14-101/+63
The only difference is the usage of math_narrow_eval when building s_fdiml.c. This should be harmless for long double, but I did observe some code generation changes on m68k, but lack the resources to test it. Likewise, to more easily support overriding symbol generation, the aliasing macros are always conditionally defined on their absence to reduce boilerplate. I also ran builds for i486, ppc64, sparcv9, aarch64, s390x and observed no changes to s_fdim* objects.
2016-09-01Base <sys/quota.h> on Linux kernel headers [BZ #20525]Florian Weimer5-131/+121
Macros which are also defined in <linux/quota.h> are removed, and <linux/quota.h> is included instead. This commit cleans up the definition of fs_to_dq_blocks and struct dqblock and struct dqinfo, too.
2016-08-31ldbl-128: Cleanup e_gammal_r.c after _Float128 renamePaul E. Murphy2-6/+12
2016-08-31ldbl-128: Rename 'long double' to '_Float128'Paul E. Murphy78-620/+736
Add a layer of macro indirection for long double files which need to be built using another typename. Likewise, add the L(num) macro used in a later patch to override real constants. These macros are only defined through the ldbl-128 math_ldbl.h header, thereby implicitly restricting these macros to machines which back long double with an IEEE binary128 format. Likewise, appropriate changes are made for the few files which indirectly include such ldbl-128 files. These changes produce identical binaries for s390x, aarch64, and ppc64.
2016-08-31S390: Do not set FE_INEXACT with feraiseexcept (FE_OWERFLOW|FE_UNDERFLOW).Stefan Liebler6-6/+113
On s390 feraiseexcept (FE_OVERFLOW|FE_UNDERFLOW) sets FE_INEXACT, too. This patch uses z196 zarch load rounded instruction which can suppress FE_INEXACT exception if gcc has z196 support in used configuration. Otherwise FE_INEXACT flag is set as before. The gcc support is tested in a new configure-check. A comment in fsetexcptflg.c is corrected as new exceptions are not executed with the next floating-point instruction if fpc is set with _FPU_SETCW macro. It seems the comment was copied e.g. from sysdeps/x86_64/fpu/fsetexcptflg.c file. ChangeLog: * config.h.in (HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT): New undefine. * sysdeps/s390/configure.ac: Add test for z196 zarch support. * sysdeps/s390/configure: Regenerated. * sysdeps/s390/fpu/fraiseexcpt.c (__feraiseexcept): Use ledbra instruction for raising over-/underflow if z196 zarch is supported by default. * sysdeps/s390/fpu/fsetexcptflg.c (fesetexceptflag): Correct comment.
2016-08-30hurd: Fix adjtime call with OLDDELTA == NULLSvante Signell2-0/+9
* sysdeps/mach/hurd/adjtime.c (__adjtime): When OLDDELTA is NULL, make it point to a dumb buffer for RPC to fill it.
2016-08-30Use fabs(x) instead of branching on signedness of input to sin and cosSiddhesh Poyarekar2-148/+100
The sin and cos code is inconsistent about its use of fabs to get the absolute value of X where in some places it conditionalizes the code while in others it uses fabs. fabs seems to be a better candidate in most cases because it avoids a branch. Similarly there is an attempt to make it easier for the compiler to emit conditional assignment instructions (like fcsel on aarch64) where it can, by isolating conditional assignment constructs from the rest of the expression. A further benefit of this change is to identify common constructs across functions and consolidate them in future patches. * sysdeps/ieee754/dbl-64/s_sin.c (do_cos_slow): Use ternary instead of if/else. (do_sin_slow): Likewise. (do_sincos_1): Use fabs instead of if/else. (do_sincos_2): Likewise. (__sin): Likewise. (__cos): Likewise. (slow2): Likewise. (sloww): Likewise. (sloww1): Likewise. Drop argument M. (sloww2): Use fabs instead of if/else. (bsloww): Likewise. (bsloww1): Likewise. (bsloww2): Likewise.
2016-08-30Add fall through commentsSiddhesh Poyarekar2-0/+6
Add fall through comments I had missed writing in previously.
2016-08-30Consolidate reduce_and_compute codeSiddhesh Poyarekar2-17/+19
This patch reshuffles the reduce_and_compute code so that the structure matches other code structures of the same type elsewhere in s_sin.c and s_sincos.c. This is the beginning of an attempt to consolidate and reduce code duplication in functions in s_sin.c to make it easier to read and possibly also easier for the compiler to optimize. * sysdeps/ieee754/dbl-64/s_sin.c (reduce_and_compute): Consolidate switch cases 0 and 2.
2016-08-29Convert remaining complex function to generated filesPaul E. Murphy47-2206/+332
Convert cpow, clog, clog10, cexp, csqrt, and cproj functions into generated templates. Note, ldbl-opt still retains s_clog10l.c as the aliasing rules are non-trivial.
2016-08-29Prepare to convert remaining _Complex functionsPaul E. Murphy7-0/+650
This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
2016-08-29sparcv9: Restore fdiml@GLIBC_2.1Paul E. Murphy2-1/+8
Use s_fdim.c from sysdeps/ieee754/ldbl-opt/ instead of math/ to ensure a compat symbol for fdiml is created.
2016-08-29Add fetestexceptflag.Joseph Myers36-4/+284
TS 18661-1 defines an fetestexceptflag function to test the exception state saved in an fexcept_t object by fegetexceptflag. This patch implements this function for glibc. Almost all architectures save exception state in such a way that it can be directly ANDed with exception flag bits, so rather than having lots of fetestexceptflag implementations that all do the same thing, the math/ implementation is made to use this generic logic (which is also OK in the fallback case where FE_ALL_EXCEPT is zero). The only architecture that seems to need anything different is s390. (fegetexceptflag and fesetexceptflag use abbreviated filenames fgetexcptflg.c and fsetexcptflg.c. Because we are no longer concerned by 14-character filename limits, fetestexceptflag uses the obvious filename fetestexceptflag.c.) The NEWS entry is intended to be expanded along the lines given in <https://sourceware.org/ml/libc-alpha/2016-08/msg00356.html> when fegetmode and fesetmode are added. Tested for x86_64, x86, mips64 and powerpc. * math/fetestexceptflag.c: New file. * sysdeps/s390/fpu/fetestexceptflag.c: Likewise. Comment by Stefan Liebler. * math/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (fetestexceptflag): New function declaration. * manual/arith.texi (fetestexceptflag): Document function. * math/Versions (fetestexceptflag): New libm symbol at version GLIBC_2.25. * math/Makefile (libm-support): Add fetestexceptflag. (tests): Add test-fetestexceptflag. * math/test-fetestexceptflag.c: New file. * 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-26malloc: Simplify static malloc interposition [BZ #20432]Florian Weimer15-160/+706
Existing interposed mallocs do not define the glibc-internal fork callbacks (and they should not), so statically interposed mallocs lead to link failures because the strong reference from fork pulls in glibc's malloc, resulting in multiple definitions of malloc-related symbols.
2016-08-26Fix test-skeleton C99 designed initializationAdhemerval Zanella2-1/+6
ISO C forbids empty initializer braces (6.7.9 initializer-list must contain at least one initializer). However GCC allows it, generating a warning depending of the version. With GCC 4.8 on ARM I noticed tst-initializers1.c fails to build with: In file included from tst-initializers1.c:60:0: ../test-skeleton.c: In function 'delayed_exit_thread': ../test-skeleton.c:687:10: error: missing initializer for field 'tv_sec' of 'struct timespec' [-Werror=missing-field-initializers] struct timespec remaining = {} While with GCC 5.1 the same warning is just spilled with -pedantic. To be safe this patch just zero initialize the struct as expected. Tested on armhf. * test-skeleton.c (delayed_exit_thread): Add initializer on struct timespec C99 designated initialization.
2016-08-26Correct incorrect bug number in changelogFlorian Weimer1-1/+1
2016-08-26nptl: Avoid expected SIGALRM in most tests [BZ #20432]Florian Weimer15-101/+293
Before this change, several tests did not detect early deadlocks because they used SIGALRM as the expected signal, and they ran for the full default TIMEOUT seconds. This commit adds a new delayed_exit function to the test skeleton, along with several error-checking wrappers to pthread functions. Additional error checking is introduced into several tests.
2016-08-26X86-64: Correct CFA in _dl_runtime_resolveH.J. Lu2-0/+8
When stack is re-aligned in _dl_runtime_resolve, there is no need to adjust CFA when allocating register save area on stack. * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve): Don't adjust CFA when allocating register save area on re-aligned stack.
2016-08-26string: More tests for strcmp, strcasecmp, strncmp, strncasecmpFlorian Weimer3-1/+218
2016-08-25Reduce memory size of tsearch red-black tree.Mark Wielaard2-153/+259
A tsearch red-black tree node contains 3 pointers (key, left, right) and 1 bit to hold the red-black flag. When allocating new nodes this 1 bit is expanded to a full word. Causing the overhead per node to be 3 times the key size. We can reduce this overhead to just 2 times the key size. malloc returns naturally aligned memory. All nodes are internally allocated with malloc and the left/right node pointers are used as implementation details. So we can use the low bits of the left/right node pointers to store extra information. Replace all direct accesses of the struct node_t node pointers and red-black value with defines that take care of the red-black flag in the low bit of the (left) node pointer. This reduces the size of the nodes on 32-bit systems from 16 to 12 bytes and on 64-bit systems from 32 to 24 bytes. Also fix a call to CHECK_TREE so the code can be build (and tested) with DEBUGGING defined again. V2 changes: - Add assert after malloc to catch any odd pointers from bad interposed mallocs. - Rename implementation flag to USE_MALLOC_LOW_BIT. ChangeLog: * misc/tsearch.c (struct node_t): Reduce to 3 pointers if USE_MALLOC_LOW_BIT. Define pointer/value accessors. (check_tree_recurse): Use newly defined accessors. (check_tree): Likewise. (maybe_split_for_insert): Likewise. (__tfind): Likewise. (__tdelete): Likewise. (trecurse): Likewise. (tdestroy_recurse): Likewise. (__tsearch): Likewise. And add asserts for malloc alignment. (__twalk): Cast root to node in case CHECK_TREE is defined.
2016-08-24localedata: lt_LT: use hyphens in d_fmt [BZ #20497]Ernestas Kulik2-1/+6
The standard currently in effect (LST ISO 8601:1997) mandates the use of hyphens (as opposed to full stops, currently) in date formats. It also matches current CLDR data (v29), Wikipedia's & Wikia's settings, and Microsoft's Lithuanian Style Guide.
2016-08-21mach: Add more allowed external headersSamuel Thibault2-1/+5
* scripts/check-local-headers.sh (exclude): Add mach_debug/.
2016-08-19Convert _Complex tangent functions to generated codePaul E. Murphy30-1860/+246
This converts s_c{,a}tan{,h}{f,,l} into a single templated file c{,a}tan{,h}_template.c with the exception of alpha.
2016-08-19Prepare to convert _Complex tangent functionsPaul E. Murphy5-0/+545
This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
2016-08-19Convert _Complex sine functions to generated codePaul E. Murphy40-2354/+303
Refactor s_c{,a}sin{,h}{f,,l} into a single templated macro.
2016-08-19Prepare to convert _Complex sine functionsPaul E. Murphy6-0/+694
This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
2016-08-19X86: Change bit_YMM_state to (1 << 2)H.J. Lu2-1/+5
All other state bits, except for bit_YMM_state, are defined as (1 << N). This patch changes bit_YMM_state from (2 << 1) to (1 << 2). * sysdeps/x86/cpu-features.h (bit_YMM_state): Set to (1 << 2).
2016-08-19Merge common usage of mul_split functionPaul E. Murphy14-346/+146
A number of files share identical code for the mul_split function. This moves the duplicated function mul_split into its own header, and refactors the fma usage into a single selection macro. Likewise, mul_split when used by a long double implementation is renamed mul_splitl for clarity.
2016-08-19Convert _Complex cosine functions to generated codePaul E. Murphy33-1162/+174
This is fairly straight fowards. m68k overrides are updated to use the framework, and thus are simplified a bit.
2016-08-19Prepare to convert _Complex cosine functionsPaul E. Murphy5-0/+346
This patch has no function changes, except to ensure the git history correctly tracks the changes to convert the double version of these functions into a templated version.
2016-08-19Add tst-wcstod-roundPaul E. Murphy5-199/+303
This extends tst-strtod-round with a few trivial changes to also test the wide character variants of strto* using similar macros to other shared tests.
2016-08-19Add tests for fortification of bcopy and bzero.Zack Weinberg2-0/+65
* debug/tst-chk1.c: Add tests for fortification of bcopy and bzero.
2016-08-18Fix incorrect double-checked locking related to _res_hconf.initialized.Torvald Riegel6-7/+23
_res_hconf.initialized was not suitable for use in a multi-threaded environment due to the lack of atomics and memory barriers. Use of it was also unnecessary because _res_hconf_init did the right thing by using __libc_once. This patch fixes the glibc-internal uses by just calling _res_hconf_init unconditionally, and switches to a release MO atomic store for _res_hconf.initialized to fix the glibc side of the synchronization problem (which will maintain backward compatibility, but cannot fix the lack of acquire MO on any glibc-external loads). [BZ #20477] * resolv/res_hconf.c (do_init): Use atomic access. * resolv/res_hconf.h: Add comments. * nscd/aicache.c (addhstaiX): Call _res_hconf_init unconditionally. * nss/getXXbyYY_r.c (REENTRANT_NAME): Likewise. * sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
2016-08-18Get rid of array-bounds warning in __kernel_rem_pio2[f] with gcc 6.1 -O3.Stefan Liebler3-0/+27
On s390x I get the following werror when build with gcc 6.1 (or current gcc head) and -O3: ../sysdeps/ieee754/dbl-64/k_rem_pio2.c: In function ‘__kernel_rem_pio2’: ../sysdeps/ieee754/dbl-64/k_rem_pio2.c:254:18: error: array subscript is below array bounds [-Werror=array-bounds] for (k = 1; iq[jk - k] == 0; k++) ~~^~~~~~~~ I get the same error with sysdeps/ieee754/flt-32/k_rem_pio2f.c. This patch adds DIAG_* macros around it. ChangeLog: * sysdeps/ieee754/dbl-64/k_rem_pio2.c (__kernel_rem_pio2): Use DIAG_*_NEEDS_COMMENT macro to get rid of array-bounds warning. * sysdeps/ieee754/flt-32/k_rem_pio2f.c (__kernel_rem_pio2f): Likewise.
2016-08-18argp: Do not override GCC keywords with macros [BZ #16907]Florian Weimer3-55/+14
glibc provides fallback definitions already. It is not necessary to suppress warnings for unknown attributes because GCC does this automatically for system headers. This commit does not sync with gnulib because gnulib has started to use _GL_* macros in the header file, which are arguably in the gnulib implementation space and not suitable for an installed glibc header file.
2016-08-17ldbl-128: Remove unused sqrtl declaration in e_asinl.cPaul E. Murphy2-1/+5
This did not alter compilation for s390x and aarch64 targets.
2016-08-17Support for type-generic libm function implementations libmPaul E. Murphy33-373/+441
This defines a new classes of libm objects. The <func>_template.c file which is used in conjunction with the new makefile hooks to derive variants for each type supported by the target machine. The headers math-type-macros-TYPE.h are used to supply macros to a common implementation of a function in a file named FUNC_template.c and glued togethor via a generated file matching existing naming in the build directory. This has the properties of preserving the existing override mechanism and not requiring any arcane build system twiddling. Likewise, it enables machines to override these files without any additional work. I have verified the built objects for ppc64, x86_64, alpha, arm, and m68k do not change in any meaningful way with these changes using the Fedora cross toolchains. I have verified the x86_64 and ppc64 changes still run.
2016-08-17nptl/tst-once5: Reduce time to expected failureFlorian Weimer2-0/+7
2016-08-17Do not override objects in libc.a in other static libraries [BZ #20452]Florian Weimer14-1/+50
With this change, we no longer add sysdep.o and similar objects which are present in libc.a to other static libraries.
2016-08-16Fix soft-fp extended.h unpacking (GCC bug 77265).Joseph Myers2-0/+10
soft-fp unpacking for x86 "extended" fails to clear the implicit mantissa high bit that is explicit in that format, resulting in problems for operations that expect this bit to be clear in raw unpacked values. Specifically, the code for this format is used only for conversions to and from TFmode (__float128) in libgcc, where this issue results in GCC bug 77265, extension of long double infinity to __float128 wrongly produces a NaN. This patch fixes this by always masking out the implicit bit on unpacking, so that the results of unpacking meet the expectations of the rest of the soft-fp code for a normal IEEE format. Tested for x86_64 in libgcc in conjunction with a GCC testcase for this issue (this code isn't used in glibc, only in libgcc). * soft-fp/extended.h [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_E): Mask implicit bit out of unpacked value. [_FP_W_TYPE_SIZE < 64] (FP_UNPACK_RAW_EP): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_E): Likewise. [_FP_W_TYPE_SIZE >= 64] (FP_UNPACK_RAW_EP): Likewise.
2016-08-16Add fesetexcept: sparc.Joseph Myers2-0/+33
This patch adds a SPARC version of fesetexcept. Untested. * sysdeps/sparc/fpu/fesetexcept.c: New file.
2016-08-16Add fesetexcept: sh.Joseph Myers2-0/+34
This patch adds an SH version of fesetexcept. Untested. * sysdeps/sh/sh4/fpu/fesetexcept.c: New file.
2016-08-16Add fesetexcept: s390.Joseph Myers2-0/+35
This patch adds an S/390 version of fesetexcept. Tested and corrected by Stefan Liebler. * sysdeps/s390/fpu/fesetexcept.c: New file.
2016-08-16Add fesetexcept: powerpc.Joseph Myers4-0/+111
This patch adds PowerPC versions of fesetexcept. * sysdeps/powerpc/fpu/fesetexcept.c: New file. * sysdeps/powerpc/nofpu/fesetexcept.c: Likewise. * sysdeps/powerpc/powerpc32/e500/nofpu/fesetexcept.c: Likewise.
2016-08-16Add fesetexcept: mips.Joseph Myers2-0/+34
This patch adds a MIPS version of fesetexcept. * sysdeps/mips/fpu/fesetexcept.c: New file.
2016-08-16Add fesetexcept: m68k.Joseph Myers2-0/+33
This patch adds an M68K version of fesetexcept. Untested. * sysdeps/m68k/fpu/fesetexcept.c: New file.
2016-08-16Add fesetexcept: ia64.Joseph Myers2-0/+33
This patch adds an IA64 version of fesetexcept. Untested. * sysdeps/ia64/fpu/fesetexcept.c: New file.
2016-08-16Add fesetexcept: hppa.Joseph Myers2-0/+37
This patch adds an HPPA version of fesetexcept. Untested. * sysdeps/hppa/fpu/fesetexcept.c: New file.