opnsense-src/lib/libc/string
Robert Clausecker ee8b0c436d lib/libc/string: replace ffs/fls implementations with clang builtins
Most architectures we support (except for riscv64) have instructions
to compute these functions very quickly.  Replace old code with the
ffs and clz builtin functions, allowing clang to generate good code
for all architectures.

As a consequence, toss out arm and i386 ffs() implementations.

Sponsored by:	FreeBSD Foundation
Approved by:	mhorne
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D40730
2023-07-03 22:18:27 +02:00
..
bcmp.3 Add timingsafe_bcmp and timingsafe_memcmp. 2016-08-14 23:38:50 +00:00
bcmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
bcopy.3 Fix spelling. 2015-08-24 01:53:18 +00:00
bcopy.c libc/string/bcopy.c: Use intptr_t as the copy type 2021-04-20 01:46:42 +01:00
bstring.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
bzero.3 Update bzero(3) manpage to following the Posix Standard. 2015-08-24 01:51:10 +00:00
bzero.c
ffs.3 Document bitset(9) 2015-10-17 19:55:58 +00:00
ffs.c lib/libc/string: replace ffs/fls implementations with clang builtins 2023-07-03 22:18:27 +02:00
ffsl.c lib/libc/string: replace ffs/fls implementations with clang builtins 2023-07-03 22:18:27 +02:00
ffsll.c lib/libc/string: replace ffs/fls implementations with clang builtins 2023-07-03 22:18:27 +02:00
fls.c lib/libc/string: replace ffs/fls implementations with clang builtins 2023-07-03 22:18:27 +02:00
flsl.c lib/libc/string: replace ffs/fls implementations with clang builtins 2023-07-03 22:18:27 +02:00
flsll.c lib/libc/string: replace ffs/fls implementations with clang builtins 2023-07-03 22:18:27 +02:00
index.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
Makefile.inc libc: Fix build with WITHOUT_MACHDEP_OPTIMIZATIONS=YES set. 2023-01-10 17:00:41 +03:00
memccpy.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
memccpy.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
memchr.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
memchr.c clang-format libc string functions imported from musl 2020-11-18 22:01:34 +00:00
memcmp.3 Add timingsafe_bcmp and timingsafe_memcmp. 2016-08-14 23:38:50 +00:00
memcmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
memcpy.3 memcpy.3: remove BUGS section allowing overlapping strings 2021-08-24 09:58:10 -04:00
memcpy.c
memmem.3 Correctly spell illumos (all lowercase) in man pages 2023-06-29 13:14:45 +02:00
memmem.c libc: fix undefined behavior from signed overflow in strstr and memmem 2020-11-19 00:03:15 +00:00
memmove.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
memmove.c
mempcpy.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
memrchr.c Add memrchr(3). 2008-04-10 00:12:44 +00:00
memset.3 memset.3: better fix previous typo 2020-02-08 21:17:48 +00:00
memset.c libc/string/memset.c: Use unsigned long for stores 2021-04-20 01:46:43 +01:00
memset_s.c Improve standard compliance for memset_s() and abort_handler_s(). 2017-08-12 15:18:17 +00:00
stpcpy.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
stpncpy.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
strcasecmp.3 Fix strcasecmp_l() and strncasecmp_l() POSIX 2008 compliance. 2014-05-30 01:09:07 +00:00
strcasecmp.c libc: drop "All rights reserved" from Foundation copyrights 2022-08-04 16:57:50 -04:00
strcasestr.c libc: drop "All rights reserved" from Foundation copyrights 2022-08-04 16:57:50 -04:00
strcat.3 libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
strcat.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strchr.3 strchr(3): Mdoc fixes. 2015-06-04 21:54:46 +00:00
strchr.c libc: Use musl's optimized strchr and strchrnul 2021-03-01 21:09:59 -05:00
strchrnul.c libc: Use musl's optimized strchr and strchrnul 2021-03-01 21:09:59 -05:00
strcmp.3 libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
strcmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strcoll.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
strcoll.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
strcpy.3 strcpy.3: Improve legibility and clarity 2018-06-06 20:09:21 +00:00
strcpy.c [PPC64] strcpy optimization 2020-01-15 19:46:01 +00:00
strcspn.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
strdup.3 strdup.3: Function appeared in 4.3BSD-Reno, not 4.4BSD 2020-12-14 00:50:45 +00:00
strdup.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strerror.3 strerror.3: Fix whitespace issue introduced in r368714 2020-12-18 22:10:17 +00:00
strerror.c Remove __NO_TLS. 2021-02-23 20:08:10 +02:00
string.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
strlcat.c Make strlcpy/strlcat slightly easier to read. 2015-04-06 03:21:22 +00:00
strlcpy.3 Correct man page URI formatting. 2023-06-09 20:49:51 -07:00
strlcpy.c Make strlcpy/strlcat slightly easier to read. 2015-04-06 03:21:22 +00:00
strlen.3 libc: Add HISTORY sections to the manual pages 2022-05-05 18:46:32 +02:00
strlen.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
strmode.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
strmode.c Change strmode argument type to mode_t 2021-06-29 17:38:45 -06:00
strncat.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strncmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strncpy.c [PPC64] strncpy optimization 2020-01-15 19:53:03 +00:00
strndup.c Replace strndup with OpenBSD's implementation. 2015-08-26 23:28:10 +00:00
strnlen.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
strnstr.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strpbrk.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
strpbrk.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strrchr.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strsep.3 strsep.3: don't silently ignore errors 2018-05-28 18:29:15 +00:00
strsep.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strsignal.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strspn.3 Various mdoc fixes and a few EOL whitespace removals. 2014-12-21 12:36:36 +00:00
strspn.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
strstr.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
strstr.c libc: correct SPDX tag on strstr.c 2022-01-16 11:56:28 -05:00
strtok.3 strtok(3): make it easier to find the RETURN VALUES section 2020-06-22 11:03:36 +00:00
strtok.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
strverscmp.3 libc: Add strverscmp(3) and versionsort(3) 2022-08-25 03:29:03 +03:00
strverscmp.c libc: Add strverscmp(3) and versionsort(3) 2022-08-25 03:29:03 +03:00
strxfrm.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
strxfrm.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
swab.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
swab.c Fix truncation when ssize_t is larger than MAX_INT 2023-02-04 21:14:14 -07:00
Symbol.map libc: Add strverscmp(3) and versionsort(3) 2022-08-25 03:29:03 +03:00
timingsafe_bcmp.3 Add timingsafe_bcmp and timingsafe_memcmp. 2016-08-14 23:38:50 +00:00
timingsafe_bcmp.c Add timingsafe_bcmp and timingsafe_memcmp. 2016-08-14 23:38:50 +00:00
timingsafe_memcmp.c Add timingsafe_bcmp and timingsafe_memcmp. 2016-08-14 23:38:50 +00:00
wcpcpy.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
wcpncpy.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcscasecmp.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcscat.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcschr.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcscmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
wcscoll.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
wcscoll.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcscpy.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcscspn.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcsdup.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcslcat.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcslcpy.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcslen.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcsncasecmp.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcsncat.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcsncmp.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
wcsncpy.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
wcsnlen.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcspbrk.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcsrchr.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wcsspn.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wcsstr.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
wcstok.3 Remove stray comma at the end of the See Also list. 2002-10-15 09:49:54 +00:00
wcstok.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
wcswidth.3 mdoc(7) police: tiny nits. 2002-12-09 14:04:05 +00:00
wcswidth.c libc: drop "All rights reserved" from Foundation copyrights 2022-08-04 16:57:50 -04:00
wcsxfrm.3 Renumber clauses to reduce diffs to other versions 2013-05-28 20:57:40 +00:00
wcsxfrm.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wmemchr.3 libc: add mempcpy(3) and wmempcpy(3) 2021-07-15 19:40:28 +03:00
wmemchr.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wmemcmp.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wmemcpy.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wmemmove.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
wmempcpy.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
wmemset.c libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00