nuttx/libs/libc/string
Xiang Xiao d1dc791d11 libs/libc/string: Add 4-byte alignment middle path for BSD functions.
libc_data_t is 8 bytes wide, so a buffer which is 4-byte but not
8-byte aligned falls back to the byte at a time loop.  Add a 32-bit
middle path so such buffers still handle four bytes per iteration.

* Add DETECTNULL32/DETECTCHAR32, UNALIGNED4/UNALIGNED4_X,
  LITTLEBLOCKSIZE4/BIGBLOCKSIZE4 and TOO_SMALL4 to libs/libc/libc.h.
* Take the new path in memccpy, memcmp, memcpy, memset, stpcpy,
  stpncpy, strcmp, strcpy, strncmp and strncpy when both pointers are
  4-byte aligned but the 8-byte path can't be used.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-08-17 10:47:33 +02:00
..
CMakeLists.txt libc/string: Add BSD-optimized memset implementation. 2026-02-04 03:02:04 +08:00
Kconfig libc: Rename LIBC_STRING_OPTIMIZE to LIBC_NEWLIB_OPTSPEED 2025-01-20 22:27:19 +08:00
lib_bsdmemccpy.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdmemchr.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdmemcmp.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdmemcpy.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdmemrchr.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdmemset.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstpcpy.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstpncpy.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrcat.c libs/libc/string: Use long long to speed up the BSD string functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrchr.c libs/libc/string: Use long long to speed up the BSD string functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrchrnul.c libc_bsd:add missing SPDX-License 2026-02-04 03:02:04 +08:00
lib_bsdstrcmp.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrcpy.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrlen.c libs/libc/string: Use long long to speed up the BSD string functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrncmp.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrncpy.c libs/libc/string: Add 4-byte alignment middle path for BSD functions. 2026-08-17 10:47:33 +02:00
lib_bsdstrrchr.c libc_bsd:add missing SPDX-License 2026-02-04 03:02:04 +08:00
lib_explicit_bzero.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_ffs.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_ffsl.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_ffsll.c !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
lib_fls.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_flsl.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_flsll.c !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
lib_index.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_isbasedigit.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_memccpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_memchr.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_memcmp.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_memcpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_memmem.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_memmove.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_mempcpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_memrchr.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_memset.c libs/libc/string: Fix sign extension in memset word fill pattern. 2026-08-17 10:47:33 +02:00
lib_popcount.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_popcountl.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_popcountll.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_rawmemchr.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_rindex.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_skipspace.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_stpcpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_stpncpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strcasecmp.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strcasestr.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strcat.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strchr.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strchrnul.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strcmp.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strcoll.c Merge the newlibc string into NuttX. 2024-10-17 22:52:42 +08:00
lib_strcpy.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strcspn.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strdup.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strerror.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_strerrorr.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_strlcat.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strlcpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strlen.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strncasecmp.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strncat.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strncmp.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strncpy.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strndup.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strnlen.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strpbrk.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strrchr.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strsep.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strsignal.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_strspn.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strstr.c string:use builtin function to optimize libc function 2025-12-20 10:38:53 +08:00
lib_strtok.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strtokr.c libc: remove reference to non-existent readme 2025-10-11 17:07:51 -04:00
lib_strverscmp.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_strxfrm.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_timingsafe_bcmp.c libs/libc: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00
lib_vikmemcpy.c !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
Make.defs libc/string: Add BSD-optimized memset implementation. 2026-02-04 03:02:04 +08:00