about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* S390: Optimize utf8-utf16 module.Stefan Liebler2016-05-252-106/+446
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reworks the s390 specific module to convert between utf8 and utf16. Now ifunc is used to choose either the c or etf3eh (with convert utf instruction) variants at runtime. Furthermore a new vector variant for z13 is introduced which will be build and chosen if vector support is available at build / runtime. In case of converting utf 8 to utf16, the vector variant optimizes input of 1byte utf8 characters. The convert utf instruction is used if a multibyte utf8 character is found. For the other direction utf16 to utf8, the cu21 instruction can't be re-enabled, because it does not report an error, if the input-stream consists of a single low surrogate utf16 char (e.g. 0xdc00). This applies to the newest z13, too. Thus there is only the c or the new vector variant, which can handle 1..4 byte utf8 characters. The c variant from utf16 to utf8 has beed fixed. If a high surrogate was at the end of the input-buffer, then errno was set to EINVAL and the input-pointer pointed just after the high surrogate. Now it points to the beginning of the high surrogate. This patch also fixes some whitespace errors. The c variant from utf8 to utf16 is now checking that tail-bytes starts with 0b10... and the value is not in range of an utf16 surrogate. Furthermore, the etf3eh variants are handling the "UTF-xx//IGNORE" case now. Before they ignored the ignore-case and always stopped at an error. ChangeLog: * sysdeps/s390/s390-64/utf8-utf16-z9.c: Use ifunc to select c, etf3eh or new vector loop-variant.
* S390: Optimize utf8-utf32 module.Stefan Liebler2016-05-252-184/+485
| | | | | | | | | | | | | | | | | | | | This patch reworks the s390 specific module to convert between utf8 and utf32. Now ifunc is used to choose either the c or etf3eh (with convert utf instruction) variants at runtime. Furthermore a new vector variant for z13 is introduced which will be build and chosen if vector support is available at build / runtime. The vector variants optimize input of 1byte utf8 characters. The convert utf instruction is used if a multibyte utf8 character is found. This patch also fixes some whitespace errors. The c variants are rejecting UTF-16 surrogates and values above 0x10ffff now. Furthermore, the etf3eh variants are handling the "UTF-xx//IGNORE" case now. Before they ignored the ignore-case and always stopped at an error. ChangeLog: * sysdeps/s390/s390-64/utf8-utf32-z9.c: Use ifunc to select c, etf3eh or new vector loop-variant.
* S390: Optimize iso-8859-1 to ibm037 iconv-module.Stefan Liebler2016-05-252-37/+61
| | | | | | | | | | | This patch reworks the s390 specific module which used the z900 translate one to one instruction. Now the g5 translate instruction is used, because it outperforms the troo instruction. ChangeLog: * sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c (TROO_LOOP): Rename to TR_LOOP and usage of tr instead of troo instruction.
* S390: Optimize builtin iconv-modules.Stefan Liebler2016-05-253-0/+1275
| | | | | | | | | | | | | | | | | This patch introduces a s390 specific gconv_simple.c file which provides optimized versions for z13 with vector instructions, which will be chosen at runtime via ifunc. The optimized conversions can convert between internal and ascii, ucs4, ucs4le, ucs2, ucs2le. If the build-environment lacks vector support, then iconv/gconv_simple.c is used wihtout any change. Otherwise iconvdata/gconv_simple.c is used to create conversion loop routines without vector instructions as fallback, if vector instructions aren't available at runtime. ChangeLog: * sysdeps/s390/multiarch/gconv_simple.c: New File. * sysdeps/s390/multiarch/Makefile (sysdep_routines): Add gconv_simple.
* S390: Optimize 8bit-generic iconv modules.Stefan Liebler2016-05-255-0/+460
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a s390 specific 8bit-generic.c file which provides an optimized version for z13 with translate-/vector-instructions, which will be chosen at runtime via ifunc. If the build-environment lacks vector support, then iconvdata/8bit-generic.c is used wihtout any change. Otherwise iconvdata/8bit-generic.c is used to create conversion loop routines without vector instructions as fallback, if vector instructions aren't available at runtime. The vector routines can only be used with charsets where the maximum UCS4 value fits in 1 byte size. Then the hardware translate-instruction is used to translate between up to 256 generic characters and "1 byte UCS4" characters at once. The vector instructions are used to convert between the "1 byte UCS4" and UCS4. The gen-8bit.sh script in sysdeps/s390/multiarch generates the conversion table to_ucs1. Therefore in sysdeps/s390/multiarch/Makefile is added an override define generate-8bit-table, which is originally defined in iconvdata/Makefile. This version calls the gen-8bit.sh in iconvdata folder and the s390 one. ChangeLog: * sysdeps/s390/multiarch/8bit-generic.c: New File. * sysdeps/s390/multiarch/gen-8bit.sh: New File. * sysdeps/s390/multiarch/Makefile (generate-8bit-table): New override define. * sysdeps/s390/multiarch/iconv/skeleton.c: Likewise.
* S390: Configure check for vector support in gcc.Stefan Liebler2016-05-254-0/+64
| | | | | | | | | | | | | | | The S390 specific test checks if the gcc has support for vector registers by compiling an inline assembly which clobbers vector registers. On success the macro HAVE_S390_VX_GCC_SUPPORT is defined. This macro can be used to determine if e.g. clobbering vector registers is allowed or not. ChangeLog: * config.h.in (HAVE_S390_VX_GCC_SUPPORT): New macro undefine. * sysdeps/s390/configure.ac: Add test for S390 vector register support in gcc. * sysdeps/s390/configure: Regenerated.
* S390: Get rid of make warning: overriding recipe for target gconv-modules.Stefan Liebler2016-05-254-54/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a way to provide an architecture dependent gconv-modules file. Before this patch, the gconv-modules file was normally installed from src-dir/iconvdata/gconv-modules. The S390 Makefile had overridden the installation recipe (with a make warning) in order to install the gconv-module-s390 file from build-dir. The iconvdata/Makefile provides another recipe, which copies the gconv-modules file from src to build dir, which are used by the testcases. Thus the testcases does not use the currently build s390-modules. This patch uses build-dir/iconvdata/gconv-modules for installation, which is generated by concatenating src-dir/iconvdata/gconv-modules and the architecture specific one. The latter one can be specified by setting the variable sysdeps-gconv-modules in sysdeps/.../Makefile. The architecture specific gconv-modules file is emitted before the common one because these modules aren't used in all possible conversions. E.g. the converting from INTERNAL to UTF-16 used the common UTF-16.so module instead of UTF16_UTF32_Z9.so. This way, the s390-Makefile does not need to override the recipe for gconv-modules and no warning is emitted anymore. Since we no longer support empty objpfx the conditional test in iconvdata/Makefile is removed. ChangeLog: * iconvdata/Makefile ($(inst_gconvdir)/gconv-modules): Install file from $(objpfx)gconv-modules. ($(objpfx)gconv-modules): Concatenate architecture specific file in variable sysdeps-gconv-modules and gconv-modules in src dir. * sysdeps/s390/gconv-modules: New file. * sysdeps/s390/s390-64/Makefile: ($(inst_gconvdir)/gconv-modules): Deleted. ($(objpfx)gconv-modules-s390): Deleted. (sysdeps-gconv-modules): New variable.
* Do not raise "inexact" from x86_64 SSE4.1 ceil, floor (bug 15479).Joseph Myers2016-05-245-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Continuing fixes for ceil and floor functions not to raise the "inexact" exception, this patch fixes the x86_64 SSE4.1 versions. The roundss / roundsd instructions take an immediate operand that determines the rounding mode and whether to raise "inexact"; this just needs bit 3 set to disable "inexact", which this patch does. Remark: we don't have an SSE4.1 version of trunc / truncf (using this instruction with operand 11); I'd expect one to make sense, but of course it should be benchmarked against the existing C code. I'll file a bug in Bugzilla for the lack of such a version. Tested for x86_64. [BZ #15479] * sysdeps/x86_64/fpu/multiarch/s_ceil.S (__ceil_sse41): Set bit 3 of immediate operand to rounding instruction. * sysdeps/x86_64/fpu/multiarch/s_ceilf.S (__ceilf_sse41): Likewise. * sysdeps/x86_64/fpu/multiarch/s_floor.S (__floor_sse41): Likewise. * sysdeps/x86_64/fpu/multiarch/s_floorf.S (__floorf_sse41): Likewise.
* Fixup usage of MIN_EXP in libm-test.incPaul E. Murphy2016-05-242-11/+16
| | | | | Make MANT_DIG shadow the types *_MIN_EXP macro. Replace calls sites with (MIN_EXP - 1), and simplify.
* Fixup usage of MANT_DIG in libm-test.incPaul E. Murphy2016-05-242-46/+51
| | | | | Make MANT_DIG shadow the types *_MANT_DIG macro. Replace calls sites with (MANT_DIG - 1), and simplify.
* Refactor tst-strtod-round.cPaul E. Murphy2016-05-244-12357/+12416
| | | | | | | | | | This file is partially generated. To make updates a little simpler, I have moved the generated code into a partially contained header to simplify regeneration. gen-tst-strtod-round.c now takes two, mandatory arguments. These arguments specify the input test data and the output destination, respectively.
* Do not raise "inexact" from generic round (bug 15479).Joseph Myers2016-05-247-141/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C99 and C11 allow but do not require ceil, floor, round and trunc to raise the "inexact" exception for noninteger arguments. TS 18661-1 requires that this exception not be raised by these functions. This aligns them with general IEEE semantics, where "inexact" is only raised if the final step of rounding the infinite-precision result to the result type is inexact; for these functions, the infinite-precision integer result is always representable in the result type, so "inexact" should never be raised. The generic implementations of ceil, floor and round functions contain code to force "inexact" to be raised. This patch removes it for round functions to align them with TS 18661-1 in this regard. The tests *are* updated by this patch; there are fewer architecture-specific versions than for ceil and floor, and I fixed the powerpc ones some time ago. If any others still have the issue, as shown by tests for round failing with spurious exceptions, they can be fixed separately by architecture maintainers or others. Tested for x86_64, x86 and mips64. [BZ #15479] * sysdeps/ieee754/dbl-64/s_round.c (huge): Remove variable. (__round): Do not force "inexact" exception. * sysdeps/ieee754/dbl-64/wordsize-64/s_round.c (huge): Remove variable. (__round): Do not force "inexact" exception. * sysdeps/ieee754/flt-32/s_roundf.c (huge): Remove variable. (__roundf): Do not force "inexact" exception. * sysdeps/ieee754/ldbl-128/s_roundl.c (huge): Remove variable. (__roundl): Do not force "inexact" exception. * sysdeps/ieee754/ldbl-96/s_roundl.c (huge): Remove variable. (__roundl): Do not force "inexact" exception. * math/libm-test.inc (round_test_data): Do not allow spurious "inexact" exceptions.
* Do not raise "inexact" from generic floor (bug 15479).Joseph Myers2016-05-245-45/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C99 and C11 allow but do not require ceil, floor, round and trunc to raise the "inexact" exception for noninteger arguments. TS 18661-1 requires that this exception not be raised by these functions. This aligns them with general IEEE semantics, where "inexact" is only raised if the final step of rounding the infinite-precision result to the result type is inexact; for these functions, the infinite-precision integer result is always representable in the result type, so "inexact" should never be raised. The generic implementations of ceil, floor and round functions contain code to force "inexact" to be raised. This patch removes it for floor functions to align them with TS 18661-1 in this regard. Note that some architecture-specific versions may still raise "inexact", so the tests are not updated and the bug is not yet fixed. Tested for x86_64, x86 and mips64. [BZ #15479] * sysdeps/ieee754/dbl-64/s_floor.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__floor): Do not force "inexact" exception. * sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__floor): Do not force "inexact" exception. * sysdeps/ieee754/flt-32/s_floorf.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__floorf): Do not force "inexact" exception. * sysdeps/ieee754/ldbl-128/s_floorl.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__floorl): Do not force "inexact" exception.
* Do not raise "inexact" from generic ceil (bug 15479).Joseph Myers2016-05-245-42/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C99 and C11 allow but do not require ceil, floor, round and trunc to raise the "inexact" exception for noninteger arguments. TS 18661-1 requires that this exception not be raised by these functions. This aligns them with general IEEE semantics, where "inexact" is only raised if the final step of rounding the infinite-precision result to the result type is inexact; for these functions, the infinite-precision integer result is always representable in the result type, so "inexact" should never be raised. The generic implementations of ceil, floor and round functions contain code to force "inexact" to be raised. This patch removes it for ceil functions to align them with TS 18661-1 in this regard. Note that some architecture-specific versions may still raise "inexact", so the tests are not updated and the bug is not yet fixed. Tested for x86_64, x86 and mips64. [BZ #15479] * sysdeps/ieee754/dbl-64/s_ceil.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__ceil): Do not force "inexact" exception. * sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__ceil): Do not force "inexact" exception. * sysdeps/ieee754/flt-32/s_ceilf.c (huge): Remove variable. (__ceilf): Do not force "inexact" exception. * sysdeps/ieee754/ldbl-128/s_ceill.c: Do not mention "inexact" exception in comment. (huge): Remove variable. (__ceill): Do not force "inexact" exception.
* Avoid an extra branch to PLT for -z nowH.J. Lu2016-05-245-2/+24
| | | | | | | | | | | | | | | | | | | When --enable-bind-now is used to configure glibc build, we can avoid an extra branch to the PLT entry by using indirect branch via the GOT slot instead, which is similar to the first instructuon in the PLT entry. Changes in the shared library sizes in text sections: Shared library Before (bytes) After (bytes) libm.so 1060813 1060797 libmvec.so 160881 160805 libpthread.so 94992 94984 librt.so 25064 25048 * config.h.in (BIND_NOW): New. * configure.ac (BIND_NOW): New. Defined for --enable-bind-now. * configure: Regenerated. * sysdeps/x86_64/sysdep.h (JUMPTARGET)[BIND_NOW]: Defined to indirect branch via the GOT slot.
* S390: Implement mempcpy with help of memcpy. [BZ #19765]Stefan Liebler2016-05-249-45/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There exist optimized memcpy functions on s390, but no optimized mempcpy. This patch adds mempcpy entry points in memcpy.S files, which use the memcpy implementation. Now mempcpy itself is also an IFUNC function as memcpy is and the variants are listed in ifunc-impl-list.c. The s390 string.h does not define _HAVE_STRING_ARCH_mempcpy. Instead mempcpy string/string.h inlines memcpy() + n. If n is constant and small enough, GCC emits instructions like mvi or mvc and avoids the function call to memcpy. If n is not constant, then memcpy is called and n is added afterwards. If _HAVE_STRING_ARCH_mempcpy would be defined, mempcpy would be called in every case. According to PR70140 "Inefficient expansion of __builtin_mempcpy" (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70140) GCC should handle a call to mempcpy in the same way as memcpy. Then either the mempcpy macro in string/string.h has to be removed or _HAVE_STRING_ARCH_mempcpy has to be defined for S390. ChangeLog: [BZ #19765] * sysdeps/s390/mempcpy.S: New File. * sysdeps/s390/multiarch/mempcpy.c: Likewise. * sysdeps/s390/multiarch/Makefile (sysdep_routines): Add mempcpy. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add mempcpy variants. * sysdeps/s390/s390-32/memcpy.S: Add mempcpy entry point. (memcpy): Adjust to be usable from mempcpy entry point. (__memcpy_mvcle): Likewise. * sysdeps/s390/s390-64/memcpy.S: Likewise. * sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Add entry points ____mempcpy_z196, ____mempcpy_z10 and add __GI_ symbols for mempcpy. (__memcpy_z196): Adjust to be usable from mempcpy entry point. (__memcpy_z10): Likewise. * sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Likewise.
* S390: Do not call memcpy, memcmp, memset within libc.so via ifunc-plt.Stefan Liebler2016-05-248-5/+32
| | | | | | | | | | | | | | | | | | | | | | | | On s390, the memcpy, memcmp, memset functions are IFUNC symbols, which are created with s390_libc_ifunc-macro. This macro creates a __GI_ symbol which is set to the ifunced symbol. Thus calls within libc.so to e.g. memcpy result in a call to *ABS*+0x954c0@plt stub and afterwards to the resolved memcpy-ifunc-variant. This patch sets the __GI_ symbol to the default-ifunc-variant to avoid the plt call. The __GI_ symbols are now created at the default variant of ifunced function. ChangeLog: * sysdeps/s390/multiarch/ifunc-resolve.h (s390_libc_ifunc): Remove __GI_ symbol. * sysdeps/s390/s390-32/multiarch/memcmp-s390.S: Add __GI_memcmp symbol. * sysdeps/s390/s390-64/multiarch/memcmp-s390x.S: Likewise. * sysdeps/s390/s390-32/multiarch/memcpy-s390.S: Add __GI_memcpy symbol. * sysdeps/s390/s390-64/multiarch/memcpy-s390x.S: Likewise. * sysdeps/s390/s390-32/multiarch/memset-s390.S: Add __GI_memset symbol. * sysdeps/s390/s390-64/multiarch/memset-s390x.S: Likewise.
* S390: Use 64bit instruction to check for copies of > 1MB with mvcle.Stefan Liebler2016-05-242-1/+6
| | | | | | | | | | | | | The __memcpy_default variant on s390 64bit calculates the number of 256byte blocks in a 64bit register and checks, if they exceed 1MB to jump to mvcle. Otherwise a mvc-loop is used. The compare-instruction only checks a 32bit value. This patch uses a 64bit compare. ChangeLog: * sysdeps/s390/s390-64/memcpy.S (memcpy): Use cghi instead of chi to compare 64bit value.
* S390: Use mvcle for copies > 1MB on 32bit with default memcpy variant.Stefan Liebler2016-05-242-1/+6
| | | | | | | | | | | | If more than 255 bytes should be copied, the algorithm jumps away. Before this patch, it jumps to the mvc-loop (.L_G5_12). Now it jumps first to the "> 1MB" check, which jumps away to __memcpy_mvcle. Otherwise, the mvc-loop (.L_G5_12) copies the bytes. ChangeLog: * sysdeps/s390/s390-32/memcpy.S (memcpy): Jump to 1MB check before executing mvc-loop.
* malloc: Correct malloc alignment on 32-bit architectures [BZ #6527]Florian Weimer2016-05-243-15/+10
| | | | | | | | | | | | | | | | After the heap rewriting added in commit 4cf6c72fd2a482e7499c29162349810029632c3f (malloc: Rewrite dumped heap for compatibility in __malloc_set_state), we can change malloc alignment for new allocations because the alignment of old allocations no longer matters. We need to increase the malloc state version number, so that binaries containing dumped heaps of the new layout will not try to run on previous versions of glibc, resulting in obscure crashes. This commit addresses a failure of tst-malloc-thread-fail on the affected architectures (32-bit ppc and mips) because the test checks pointer alignment.
* Refactor tst-strtod6.cPaul E. Murphy2016-05-232-65/+41
| | | | | | Use the type-generic macros in tst-strtod.h to simplify this test case and enable extension to future variants of this functions.
* Refactor bug-strtod2.c to be type genericPaul E. Murphy2016-05-232-18/+35
| | | | | This only tested for strtod. This expands the testing to all variants of strto*.
* Refactor bug-strtod.c to better test new types.Paul E. Murphy2016-05-233-65/+96
| | | | | | This introduces tst-strtod.h to contain some macros to assist with updating strto{f,d,ld} test code to support additional variants of this function.
* CVE-2016-4429: sunrpc: Do not use alloca in clntudp_call [BZ #20112]Florian Weimer2016-05-233-1/+20
| | | | | | | | | | The call is technically in a loop, and under certain circumstances (which are quite difficult to reproduce in a test case), alloca can be invoked repeatedly during a single call to clntudp_call. As a result, the available stack space can be exhausted (even though individual alloca sizes are bounded implicitly by what can fit into a UDP packet, as a side effect of the earlier successful send operation).
* Make padding in struct sockaddr_storage explicit [BZ #20111]Florian Weimer2016-05-239-15/+213
| | | | | | | | | | This avoids aliasing issues with GCC 6 in -fno-strict-aliasing mode. (With implicit padding, not all data is copied.) This change makes it explicit that struct sockaddr_storage is only 126 bytes large on m68k (unlike elsewhere, where we end up with the requested 128 bytes). The new test case makes sure that this does not happen on other architectures.
* conformtest: Correct some limits.h expectations for XPG3, XPG4.Joseph Myers2016-05-233-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | The conform/ test of limits.h namespace for XPG3 was failing because of NL_* and NZERO defines. Those symbols are EX-shaded, not UX-shaded, so it's correct for them to be defined for XPG3; this patch corrects the expectations accordingly. (Actually it looks like they should not be listed as optional for these standards, but that's another matter.) Tested for x86_64 and x86. * conform/data/limits.h-data (CHARCLASS_NAME_MAX): Also expect for [XPG3 || XPG4]. (NL_ARGMAX): Also expect for [XPG3]. (NL_LANGMAX): Likewise. (NL_MSGMAX): Likewise. (NL_NMAX): Likewise. (NL_SETMAX): Likewise. (NL_TEXTMAX): Likewise. (NZERO): Likewise. (TMP_MAX): Likewise. * conform/Makefile (test-xfail-XPG3/limits.h/conform): Remove variable.
* Update sysdeps/unix/sysv/linux/bits/socket.h for Linux 4.6.Joseph Myers2016-05-232-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch updates sysdeps/unix/sysv/linux/bits/socket.h for new constants added in Linux 4.6. AF_KCM / PF_KCM are added. SOL_KCM is new, and I added a lot of SOL_* values postdating the last one present in the header, since I saw no apparent reason for the set in glibc to stop at SOL_IRDA. MSG_BATCH is added; Linux also has MSG_SENDPAGE_NOTLAST which is not in glibc, but given the comment starts "sendpage() internal" I presume it's correct for it not to be in glibc. (Note that this is a case where the Linux kernel header with userspace relevant values is *not* a uapi header but include/linux/socket.h - I don't know why, but at least this header, as well as uapi headers, needs reviewing for glibc-relevant changes each release.) Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * sysdeps/unix/sysv/linux/bits/socket.h (PF_KCM): New macro. (PF_MAX): Update value. (AF_KCM): New macro. (SOL_NETBEUI): Likewise. (SOL_LLC): Likewise. (SOL_DCCP): Likewise. (SOL_NETLINK): Likewise. (SOL_TIPC): Likewise. (SOL_RXRPC): Likewise. (SOL_PPPOL2TP): Likewise. (SOL_BLUETOOTH): Likewise. (SOL_PNPIPE): Likewise. (SOL_RDS): Likewise. (SOL_IUCV): Likewise. (SOL_CAIF): Likewise. (SOL_ALG): Likewise. (SOL_NFC): Likewise. (SOL_KCM): Likewise. (MSG_BATCH): New enum value and macro.
* Remove special L2 cache case for Knights LandingH.J. Lu2016-05-202-2/+6
| | | | | | | | | | | | | | L2 cache is shared by 2 cores on Knights Landing, which has 4 threads per core: https://en.wikipedia.org/wiki/Xeon_Phi#Knights_Landing So L2 cache is shared by 8 threads on Knights Landing as reported by CPUID. We should remove special L2 cache case for Knights Landing. [BZ #18185] * sysdeps/x86/cacheinfo.c (init_cacheinfo): Don't limit threads sharing L2 cache to 2 for Knights Landing.
* conformtest: Correct ftw.h expectations for XPG3, XPG4.Joseph Myers2016-05-203-1/+23
| | | | | | | | | | | | | | | | | | | This patch corrects various conformtest expectations in ftw.h for XPG3 and XPG4. Tested for x86_64 and x86. * conform/data/ftw.h-data (struct FTW): Do not expect for [XPG3]. (FTW_DP): Do not expect for [XPG3 || XPG4]. (FTW_SL): Do not expect for [XPG3]. (FTW_SLN): Likewise. (FTW_PHYS): Likewise. (FTW_MOUNT): Likewise. (FTW_DEPTH): Likewise. (FTW_CHDIR): Likewise. (nftw): Likewise. * conform/Makefile (test-xfail-XPG3/ftw.h/conform): Remove variable.
* manual: fix typos in error reportingricaljasan@pacific.net2016-05-192-11/+15
|
* manual: fix typo in the introductionricaljasan@pacific.net2016-05-192-1/+5
|
* Implement proper fmal for ldbl-128ibm (bug 13304).Joseph Myers2016-05-194-6148/+6404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ldbl-128ibm had an implementation of fmal that just did (x * y) + z in most cases, with no attempt at actually being a fused operation. This patch replaces it with a genuine fused operation. It is not necessarily correctly rounding, but should produce a result at least as accurate as the long double arithmetic operations in libgcc, which I think is all that can reasonably be expected for such a non-IEEE format where arithmetic is approximate rather than rounded according to any particular rule for determining the exact result. Like the libgcc arithmetic, it may produce spurious overflow and underflow results, and it falls back to the libgcc multiplication in the case of (finite, finite, zero). This concludes the fixes for bug 13304; any subsequently found fma issues should go in separate Bugzilla bugs. Various other pieces of bug 13304 were fixed in past releases over the past several years. Tested for powerpc. [BZ #13304] * sysdeps/ieee754/ldbl-128ibm/s_fmal.c: Include <fenv.h>, <float.h>, <math_private.h> and <stdlib.h>. (add_split): New function. (mul_split): Likewise. (ext_val): New typedef. (store_ext_val): New function. (mul_ext_val): New function. (compare): New function. (add_split_ext): New function. (__fmal): After checking for Inf, NaN and zero, compute result as an exact sum of scaled double values in round-to-nearest before adding those up and adjusting for other rounding modes. * math/auto-libm-test-in: Remove xfail-rounding:ldbl-128ibm from tests of fma. * math/auto-libm-test-out: Regenerated.
* Correct Intel processor level type mask from CPUIDH.J. Lu2016-05-192-1/+7
| | | | | | | | | | | | | | | Intel CPUID with EAX == 11 returns: ECX Bits 07 - 00: Level number. Same value in ECX input. Bits 15 - 08: Level type. ^^^^^^^^^^^^^^^^^^^^^^^^ This is level type. Bits 31 - 16: Reserved. Intel processor level type mask should be 0xff00, not 0xff0. [BZ #20119] * sysdeps/x86/cacheinfo.c (init_cacheinfo): Correct Intel processor level type mask for CPUID with EAX == 11.
* Check the HTT bit before counting logical threadsH.J. Lu2016-05-193-76/+93
| | | | | | | | | | | Skip counting logical threads for Intel processors if the HTT bit is 0 which indicates there is only a single logical processor. * sysdeps/x86/cacheinfo.c (init_cacheinfo): Skip counting logical threads if the HTT bit is 0. * sysdeps/x86/cpu-features.h (bit_cpu_HTT): New. (index_cpu_HTT): Likewise. (reg_HTT): Likewise.
* Remove alignments on jump targets in memsetH.J. Lu2016-05-192-32/+11
| | | | | | | | | | | | | | | X86-64 memset-vec-unaligned-erms.S aligns many jump targets, which increases code sizes, but not necessarily improve performance. As memset benchtest data of align vs no align on various Intel and AMD processors https://sourceware.org/bugzilla/attachment.cgi?id=9277 shows that aligning jump targets isn't necessary. [BZ #20115] * sysdeps/x86_64/multiarch/memset-vec-unaligned-erms.S (__memset): Remove alignments on jump targets.
* conformtest: Correct pwd.h expectations for XPG3.Joseph Myers2016-05-193-2/+7
| | | | | | | | | | | | This patch corrects some conformtest expectations for pwd.h for XPG4. Tested for x86_64 and x86. * conform/data/pwd.h-data (endpwent): Do not expect for [XPG3]. (getpwent): Likewise. (setpwent): Likewise. * conform/Makefile (test-xfail-XPG3/pwd.h/conform): Remove variable.
* conformtest: Correct search.h expectations for XPG3.Joseph Myers2016-05-193-1/+11
| | | | | | | | | | | | This patch corrects some conformtest expectations for search.h for XPG3. Tested for x86_64 and x86. * conform/data/search.h-data (insque): Do not expect for [XPG3]. (remque): Likewise. * conform/Makefile (test-xfail-XPG3/search.h/conform): Remove variable.
* Update libm-test.inc comment about NaN signs.Joseph Myers2016-05-182-2/+6
| | | | | | | | | | | | | | | | libm-test.inc has a comment about signs of NaNs not being tested. This is out of date since: commit ce66581742e7ae1d6ce59e5d2d4859b2ae41218c Author: Joseph Myers <joseph@codesourcery.com> Date: Sat Nov 16 12:48:35 2013 +0000 Test signs of NaNs in libm-test.inc where appropriate. This patch removes the inaccurate statement. * math/libm-test.inc: Update comment not to refer to signs of NaNs not being tested.
* Don't call internal _Unwind_Resume via PLTH.J. Lu2016-05-183-2/+10
| | | | | | | | | | | There is no need to call the internal funtion, _Unwind_Resume, which is defined in unwind-forcedunwind.c, via PLT. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S (__condvar_cleanup2): Remove JUMPTARGET from _Unwind_Resume call. * sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S (__condvar_cleanup1): Likewise.
* Don't call internal __pthread_unwind via PLTH.J. Lu2016-05-182-2/+13
| | | | | | | | | | | | Add PTHREAD_UNWIND to replace JUMPTARGET(__pthread_unwind) and define it to __GI___pthread_unwind within libpthread. * sysdeps/unix/sysv/linux/x86_64/cancellation.S (PTHREAD_UNWIND): New (__pthread_unwind): Renamed to ... (PTHREAD_UNWIND): This. (__pthread_enable_asynccancel): Replace JUMPTARGET(__pthread_unwind) with PTHREAD_UNWIND.
* Add CLONE_NEWCGROUP from Linux 4.6 to bits/sched.h.Joseph Myers2016-05-182-0/+4
| | | | | | | | | | | This patch adds CLONE_NEWCGROUP, new in Linux 4.6, to sysdeps/unix/sysv/linux/bits/sched.h. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). * sysdeps/unix/sysv/linux/bits/sched.h [__USE_GNU] (CLONE_NEWCGROUP): New macro.
* Add Q_GETNEXTQUOTA from Linux 4.6 to sys/quota.h.Joseph Myers2016-05-182-0/+6
| | | | | | | | | | | This patch adds Q_GETNEXTQUOTA, new in Linux 4.6, to sysdeps/unix/sysv/linux/sys/quota.h. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). * sysdeps/unix/sysv/linux/sys/quota.h [_LINUX_QUOTA_VERSION >= 2] (Q_GETNEXTQUOTA): New macro.
* Clear destination buffer updated by the previous runH.J. Lu2016-05-185-0/+21
| | | | | | | | | | | | | Clear the destination buffer updated by the previous run in bench-memcpy.c and test-memcpy.c to catch the error when the following implementations do not copy anything. [BZ #19907] * benchtests/bench-memcpy.c (do_one_test): Clear the destination buffer updated by the previous run. * string/test-memcpy.c (do_one_test): Likewise. * benchtests/bench-memmove.c (do_one_test): Add a comment. * string/test-memmove.c (do_one_test): Likewise.
* Do not declare grantpt, ptsname, unlockpt in stdlib.h for XPG3 (bug 20094).Joseph Myers2016-05-173-2/+9
| | | | | | | | | | | | | | | | | stdlib.h declares grantpt, ptsname, unlockpt for __USE_XOPEN. This patch corrects the condition to __USE_XOPEN_EXTENDED (these functions are new in XPG4). Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). [BZ #20094] * stdlib/stdlib.h (grantpt): Declare if [__USE_XOPEN_EXTENDED], not [__USE_XOPEN]. (unlockpt): Likewise. (ptsname): Likewise. * conform/Makefile (test-xfail-XPG3/stdlib.h/conform): Remove variable.
* Make sys/stat.h define S_IFSOCK, S_ISSOCK for XPG4 (bug 20076).Joseph Myers2016-05-173-3/+9
| | | | | | | | | | | | | | | sys/stat.h should define S_IFSOCK and S_ISSOCK for XPG4 (XNS), but does not. This patch corrects the relevant header conditionals. Tested for x86_64 and x86 (testsuite, and that installed shared libraries are unchanged by the patch). [BZ #20076] * io/sys/stat.h (S_IFSOCK): Define for [__USE_XOPEN_EXTENDED] instead of [__USE_UNIX98]. (S_ISSOCK): Likewise. * conform/Makefile (test-xfail-XPG4/sys/stat.h/conform): Remove variable.
* Fix stdlib.h rand_r namespace (bug 20074).Joseph Myers2016-05-173-2/+7
| | | | | | | | | | | | | | | stdlib.h declares rand_r if __USE_POSIX; i.e., POSIX.1:1990. But rand_r was added along with threads, so the condition should be __USE_POSIX199506. This patch corrects the condition. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #20074] * stdlib/stdlib.h (rand_r): Declare if [__USE_POSIX199506], not if [__USE_POSIX]. * conform/Makefile (test-xfail-XPG4/stdlib.h/conform): Remove variable.
* Correct ttyslot header declaration conditions (bug 20051).Joseph Myers2016-05-174-4/+18
| | | | | | | | | | | | | | | | | | | | | | | UNIX98 and XPG4 have ttyslot in <stdlib.h>. glibc, however, has it in <unistd.h>, for __USE_MISC || (__USE_XOPEN_EXTENDED && !__USE_UNIX98), but no supported standard has it in <unistd.h>. This patch adds a properly conditioned declaration to <stdlib.h> (only enabled for the relevant standards, not for __USE_MISC or __USE_GNU). The <unistd.h> declaration is restricted to __USE_MISC. Some relevant XFAILs are removed. Tested for x86_64 and x86 (testsuite, and that installed stripped shared libraries are unchanged by the patch). [BZ #20051] * posix/unistd.h [__USE_XOPEN_EXTENDED && !__USE_UNIX98] (ttyslot): Do not declare. * stdlib/stdlib.h [__USE_XOPEN_EXTENDED && !__USE_XOPEN2K] (ttyslot): New prototype. * conform/Makefile (test-xfail-XPG4/unistd.h/conform): Remove variable. (test-xfail-UNIX98/stdlib.h/conform): Likewise.
* Fix tst-cancel17/tst-cancelx17, which sometimes segfaults while exiting.Stefan Liebler2016-05-172-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The testcase tst-cancel[x]17 ends sometimes with a segmentation fault. This happens in one of 10000 cases. Then the real testcase has already exited with success and returned from do_test(). The segmentation fault occurs after returning from main in _dl_fini(). In those cases, the aio_read(&a) was not canceled because the read request was already in progress. In the meanwhile aio_write(ap) wrote something to the pipe and the read request is able to read the requested byte. The read request hasn't finished before returning from do_test(). After it finishes, it writes the return value and error code from the read syscall to the struct aiocb a, which lies on the stack of do_test. The stack of the subsequent function call of _dl_fini or _dl_sort_fini, which is inlined in _dl_fini is corrupted. In case of S390, it reads a zero and decrements it by 1: unsigned int k = nmaps - 1; struct link_map **runp = maps[k]->l_initfini; The load from unmapped memory leads to the segmentation fault. The stack corruption also happens on other architectures. I saw them e.g. on x86 and ppc, too. This patch adds an aio_suspend call to ensure, that the read request is finished before returning from do_test(). ChangeLog: * nptl/tst-cancel17.c (do_test): Wait for finishing aio_read(&a).
* tst-mallocfork2: Fix race condition, use fewer resourcesFlorian Weimer2016-05-132-1/+14
| | | | | | | | | | | | | | | | The first SIGUSR1 signal could arrive when sigusr1_sender_pid was still 0. As a result, kill would send SIGSTOP to the entire process group. This would cause the test to hang before printing any output. This commit also adds a sched_yield to the signal source, so that it does not flood the parent process with signals it has never a chance to handle. Even with these changes, tst-mallocfork2 still fails reliably after the fix in commit commit 56290d6e762c1194547e73ff0b948cd79d3a1e03 (Increase fork signal safety for single-threaded processes) is backed out.
* conformtest: Correct some stdlib.h expectations for XPG3.Joseph Myers2016-05-132-14/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch corrects some spurious conformtest stdlib.h expectations for XPG3 (not based on a full review of the expectations for that standard, so other issues may remain). Tested for x86_64 and x86. * conform/data/stdlib.h-data (a64l): Do not expect for [XPG3]. (ecvt): Likewise. (fcvt): Likewise. (gcvt): Likewise. (getsubopt): Likewise. (grantpt): Likewise. (initstate): Likewise. (l64a): Likewise. (mktemp): Likewise. (mkstemp): Likewise. (ptsname): Likewise. (random): Likewise. (realpath): Likewise. (setstate): Likewise. (srandom): Likewise. (ttyslot): Likewise. (unlockpt): Likewise. (valloc): Likewise.