aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-08manual: fix texinfo typoPaul Eggert
* manual/creature.texi (Feature Test Macros): Fix “creature.texi:309: warning: `.' or `,' must follow @xref, not f”.
2023-04-06<stdio.h>: Make fopencookie, vasprintf, asprintf available by defaultFlorian Weimer
FreeBSD makes these functions available by default, so we should not treat them as GNU-specific and restrict them to _GNU_SOURCE. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-04-06<string.h>: Make strchrnul, strcasestr, memmem available by defaultFlorian Weimer
FreeBSD makes them available by default, too, so there does not seem to be a reason to restrict these functions to _GNU_SOURCE. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-04-05<sys/platform/x86.h>: Add PREFETCHI supportH.J. Lu
Add PREFETCHI support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add AMX-COMPLEX supportH.J. Lu
Add AMX-COMPLEX support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add AVX-NE-CONVERT supportH.J. Lu
Add AVX-NE-CONVERT support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add AVX-VNNI-INT8 supportH.J. Lu
Add AVX-VNNI-INT8 support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add MSRLIST supportH.J. Lu
Add MSRLIST support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add AVX-IFMA supportH.J. Lu
Add AVX-IFMA support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add AMX-FP16 supportH.J. Lu
Add AMX-FP16 support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add WRMSRNS supportH.J. Lu
Add WRMSRNS support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add ArchPerfmonExt supportH.J. Lu
Add Architectural Performance Monitoring Extended Leaf (EAX = 23H) support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add CMPCCXADD supportH.J. Lu
Add CMPCCXADD support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add LASS supportH.J. Lu
Add Linear Address Space Separation (LASS) support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add RAO-INT supportH.J. Lu
Add RAO-INT support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add LBR supportH.J. Lu
Add architectural LBR support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add RTM_FORCE_ABORT supportH.J. Lu
Add RTM_FORCE_ABORT support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add SGX-KEYS supportH.J. Lu
Add SGX-KEYS support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add BUS_LOCK_DETECT supportH.J. Lu
Add Bus lock debug exceptions (BUS_LOCK_DETECT) support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<sys/platform/x86.h>: Add LA57 supportH.J. Lu
Add 57-bit linear addresses and five-level paging (LA57) support to <sys/platform/x86.h>. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05platform.texi: Move LAM after LAHF64_SAHF64H.J. Lu
Move LAM after LAHF64_SAHF64 to sort x86 features. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05<bits/platform/x86.h>: Rename to x86_cpu_INDEX_7_ECX_15H.J. Lu
Rename x86_cpu_INDEX_7_ECX_1 to x86_cpu_INDEX_7_ECX_15 for the unused bit 15 in ECX from CPUID with EAX == 0x7 and ECX == 0. Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-05hppa: Update struct __pthread_rwlock_arch_t comment.John David Anglin
Signed-off-by: John David Anglin <dave.anglin@bell.net>
2023-04-05hppa: Revise __TIMESIZE define to use __WORDSIZEJohn David Anglin
Handle both 32 and 64-bit ABIs. Signed-off-by: John David Anglin <dave.anglin@bell.net>
2023-04-05libio: Remove unused pragma weak on vtableAdhemerval Zanella
Both _IO_file_jumps_alias and _IO_wfile_jumps_alias are defined as alias.
2023-04-05malloc: Only set pragma weak for rpc freemem if requiredAdhemerval Zanella
Both __rpc_freemem and __rpc_thread_destroy are only used if the the compat symbols are required.
2023-04-05htl: move pthread_self info libc.Guy-Fleury Iteriteka
Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230318095826.1125734-4-gfleury@disroot.org>
2023-04-05htl: move ___pthread_self into libc.Guy-Fleury Iteriteka
sysdeps/mach/hurd/htl/pt-pthread_self.c: New file. htl/Makefile: .. Add it to libc routine. sysdeps/mach/hurd/htl/pt-sysdep.c(__pthread_self): Remove it. sysdeps/mach/hurd/htl/pt-sysdep.h(__pthread_self): Add hidden propertie. htl/Versions(__pthread_self) Version it as private symbol. Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230318095826.1125734-3-gfleury@disroot.org>
2023-04-05htl: move __pthtread_total into libcGuy-Fleury Iteriteka
htl/pt-nthreads.c: new file. htl/Makefile: Add it to routine. htl/Versions: version it as private libc symbol. htl/pt-create.c: remove his definition here. htl/pt-internal.h: add propertie to it declaration. Signed-off-by: Guy-Fleury Iteriteka <gfleury@disroot.org> Message-Id: <20230318095826.1125734-2-gfleury@disroot.org>
2023-04-04compare_strings.py : Add --gmean flagNisha Menon
To calculate geometric mean for string benchmark results. Signed-off-by: Nisha Poyarekar <nisha.s.menon@gmail.com>
2023-04-04x86/dl-cacheinfo: remove unsused parameter from handle_amdAndreas Schwab
Also replace an unreachable assert with __builtin_unreachable.
2023-04-03powerpc: Disable stack protector in early static initializationAdhemerval Zanella
Similar to fb95c316382679c0826cc8399760977cd95f15c9, also disable for string-ppc64.c (pulled on rltd as the default string implementation). Checked on powerpc64-linux-gnu.
2023-04-03nptl: Fix tst-cancel30 on sparc64Adhemerval Zanella
As indicated by sparc kernel-features.h, even though sparc64 defines __NR_pause, it is not supported (ENOSYS). Always use ppoll or the 64 bit time_t variant instead.
2023-04-03math: Remove the error handling wrapper from fmod and fmodfAdhemerval Zanella Netto
The error handling is moved to sysdeps/ieee754 version with no SVID support. The compatibility symbol versions still use the wrapper with SVID error handling around the new code. There is no new symbol version nor compatibility code on !LIBM_SVID_COMPAT targets (e.g. riscv). The ia64 is unchanged, since it still uses the arch specific __libm_error_region on its implementation. For both i686 and m68k, which provive arch specific implementation, wrappers are added so no new symbol are added (which would require to change the implementations). It shows an small improvement, the results for fmod: Architecture | Input | master | patch -----------------|-----------------|----------|-------- x86_64 (Ryzen 9) | subnormals | 12.5049 | 9.40992 x86_64 (Ryzen 9) | normal | 296.939 | 296.738 x86_64 (Ryzen 9) | close-exponents | 16.0244 | 13.119 aarch64 (N1) | subnormal | 6.81778 | 4.33313 aarch64 (N1) | normal | 155.620 | 152.915 aarch64 (N1) | close-exponents | 8.21306 | 5.76138 armhf (N1) | subnormal | 15.1083 | 14.5746 armhf (N1) | normal | 244.833 | 241.738 armhf (N1) | close-exponents | 21.8182 | 22.457 Checked on x86_64-linux-gnu, i686-linux-gnu, and aarch64-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-04-03math: Improve fmodfAdhemerval Zanella Netto
This uses a new algorithm similar to already proposed earlier [1]. With x = mx * 2^ex and y = my * 2^ey (mx, my, ex, ey being integers), the simplest implementation is: mx * 2^ex == 2 * mx * 2^(ex - 1) while (ex > ey) { mx *= 2; --ex; mx %= my; } With mx/my being mantissa of double floating pointer, on each step the argument reduction can be improved 8 (which is sizeof of uint32_t minus MANTISSA_WIDTH plus the signal bit): while (ex > ey) { mx << 8; ex -= 8; mx %= my; } */ The implementation uses builtin clz and ctz, along with shifts to convert hx/hy back to doubles. Different than the original patch, this path assume modulo/divide operation is slow, so use multiplication with invert values. I see the following performance improvements using fmod benchtests (result only show the 'mean' result): Architecture | Input | master | patch -----------------|-----------------|----------|-------- x86_64 (Ryzen 9) | subnormals | 17.2549 | 12.0318 x86_64 (Ryzen 9) | normal | 85.4096 | 49.9641 x86_64 (Ryzen 9) | close-exponents | 19.1072 | 15.8224 aarch64 (N1) | subnormal | 10.2182 | 6.81778 aarch64 (N1) | normal | 60.0616 | 20.3667 aarch64 (N1) | close-exponents | 11.5256 | 8.39685 I also see similar improvements on arm-linux-gnueabihf when running on the N1 aarch64 chips, where it a lot of soft-fp implementation (for modulo, and multiplication): Architecture | Input | master | patch -----------------|-----------------|----------|-------- armhf (N1) | subnormal | 11.6662 | 10.8955 armhf (N1) | normal | 69.2759 | 34.1524 armhf (N1) | close-exponents | 13.6472 | 18.2131 Instead of using the math_private.h definitions, I used the math_config.h instead which is used on newer math implementations. Co-authored-by: kirill <kirill.okhotnikov@gmail.com> [1] https://sourceware.org/pipermail/libc-alpha/2020-November/119794.html Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-04-03math: Improve fmodAdhemerval Zanella Netto
This uses a new algorithm similar to already proposed earlier [1]. With x = mx * 2^ex and y = my * 2^ey (mx, my, ex, ey being integers), the simplest implementation is: mx * 2^ex == 2 * mx * 2^(ex - 1) while (ex > ey) { mx *= 2; --ex; mx %= my; } With mx/my being mantissa of double floating pointer, on each step the argument reduction can be improved 11 (which is sizeo of uint64_t minus MANTISSA_WIDTH plus the signal bit): while (ex > ey) { mx << 11; ex -= 11; mx %= my; } */ The implementation uses builtin clz and ctz, along with shifts to convert hx/hy back to doubles. Different than the original patch, this path assume modulo/divide operation is slow, so use multiplication with invert values. I see the following performance improvements using fmod benchtests (result only show the 'mean' result): Architecture | Input | master | patch -----------------|-----------------|----------|-------- x86_64 (Ryzen 9) | subnormals | 19.1584 | 12.5049 x86_64 (Ryzen 9) | normal | 1016.51 | 296.939 x86_64 (Ryzen 9) | close-exponents | 18.4428 | 16.0244 aarch64 (N1) | subnormal | 11.153 | 6.81778 aarch64 (N1) | normal | 528.649 | 155.62 aarch64 (N1) | close-exponents | 11.4517 | 8.21306 I also see similar improvements on arm-linux-gnueabihf when running on the N1 aarch64 chips, where it a lot of soft-fp implementation (for modulo, clz, ctz, and multiplication): Architecture | Input | master | patch -----------------|-----------------|----------|-------- armhf (N1) | subnormal | 15.908 | 15.1083 armhf (N1) | normal | 837.525 | 244.833 armhf (N1) | close-exponents | 16.2111 | 21.8182 Instead of using the math_private.h definitions, I used the math_config.h instead which is used on newer math implementations. Co-authored-by: kirill <kirill.okhotnikov@gmail.com> [1] https://sourceware.org/pipermail/libc-alpha/2020-November/119794.html Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-04-03benchtests: Add fmodf benchmarkAdhemerval Zanella Netto
1. Subnormals: 128 inputs. 2. Normal numbers with large exponent difference (|x/y| > 2^8): 1024 inputs between FLT_MIN and FLT_MAX; 3. Close exponents (ey >= -103 and |x/y| < 2^8): 1024 inputs with exponents between -10 and 10. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-04-03benchtests: Add fmod benchmarkAdhemerval Zanella Netto
Add three different dataset, from random floating point numbers: 1. Subnormals: 128 inputs. 2. Normal numbers with large exponent difference (|x/y| > 2^52): 1024 inputs between DBL_MIN and DBL_MAX; 3. Close exponents (ey >= -907 and |x/y| < 2^52): 1024 inputs with exponents between -10 and 10. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2023-04-03x86: Set FSGSBASE to active if enabled by kernelH.J. Lu
Linux kernel uses AT_HWCAP2 to indicate if FSGSBASE instructions are enabled. If the HWCAP2_FSGSBASE bit in AT_HWCAP2 is set, FSGSBASE instructions can be used in user space. Define dl_check_hwcap2 to set the FSGSBASE feature to active on Linux when the HWCAP2_FSGSBASE bit is set. Add a test to verify that FSGSBASE is active on current kernels. NB: This test will fail if the kernel doesn't set the HWCAP2_FSGSBASE bit in AT_HWCAP2 while fsgsbase shows up in /proc/cpuinfo. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2023-04-03x86_64: Fix asm constraints in feraiseexcept (bug 30305)Florian Weimer
The divss instruction clobbers its first argument, and the constraints need to reflect that. Fortunately, with GCC 12, generated code does not actually change, so there is no externally visible bug. Suggested-by: Jakub Jelinek <jakub@redhat.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2023-04-03manual: Document __wur usage under _FORTIFY_SOURCESiddhesh Poyarekar
The __warn_unused_result__ attribute is only enabled when fortification is enabled. Mention that in the document. The rationale for this is essentially to mitigate against CWE-252: [1] https://cwe.mitre.org/data/definitions/252.html Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2023-04-03hurd: Microoptimize _hurd_self_sigstate ()Sergey Bugaev
When THREAD_GETMEM is defined with inline assembly, the compiler may not optimize away the two reads of _hurd_sigstate. Help it out a little bit by only reading it once. This also makes for a slightly cleaner code. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-32-bugaevc@gmail.com>
2023-04-03hurd: Add vm_param.h for x86_64Sergey Bugaev
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-30-bugaevc@gmail.com>
2023-04-03hurd: Implement _hurd_longjmp_thread_state for x86_64Sergey Bugaev
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-29-bugaevc@gmail.com>
2023-04-03htl: Implement thread_set_pcsptp for x86_64Sergey Bugaev
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-23-bugaevc@gmail.com>
2023-04-03x86_64: Add rtld-stpncpy & rtld-strncpySergey Bugaev
Just like the other existing rtld-str* files, this provides rtld with usable versions of stpncpy and strncpy. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-22-bugaevc@gmail.com>
2023-04-03htl: Add tcb-offsets.sym for x86_64Sergey Bugaev
The source code is the same as sysdeps/i386/htl/tcb-offsets.sym, but of course the produced tcb-offsets.h will be different. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-21-bugaevc@gmail.com>
2023-04-03hurd: Move a couple of signal-related files to x86Sergey Bugaev
These do not need any changes to be used on x86_64. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-20-bugaevc@gmail.com>
2023-04-03hurd: Use uintptr_t for register values in trampoline.cSergey Bugaev
This is more correct, if only because these fields are defined as having the type unsigned int in the Mach headers, so casting them to a signed int and then back is suboptimal. Also, remove an extra reassignment of uesp -- this is another remnant of the ecx kludge. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-16-bugaevc@gmail.com>
2023-04-03hurd: Move rtld-strncpy-c.c out of mach/hurd/Sergey Bugaev
There's nothing Mach- or Hurd-specific about it; any port that ends up with rtld pulling in strncpy will need this. Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230319151017.531737-15-bugaevc@gmail.com>