opnsense-src/lib/libc/amd64/string
Robert Clausecker 3a19fcb9fd lib/libc/amd64/string: add strncmp scalar, baseline implementation
The scalar implementation is fairly straightforward and merely unrolled
four times.  The baseline implementation closely follows D41971 with
appropriate extensions and extra code paths to pay attention to string
length.

Performance is quite good.  We beat both glibc (except for very long
strings, but they likely use AVX which we don't) and Bionic (except for
medium-sized aligned strings, where we are still in the same ballpark).

Sponsored by:	The FreeBSD Foundation
Tested by:	developers@, exp-run
Approved by:	mjg
MFC after:	1 month
MFC to:		stable/14
PR:		275785
Differential Revision: https://reviews.freebsd.org/D42122

(cherry picked from commit 14289e973f5c941e4502cc2b11265e4b3072839a)
2024-01-24 20:39:25 +01:00
..
amd64_archlevel.c lib/libc/amd64: add archlevel-based simd dispatch framework 2023-08-04 01:53:43 +03:00
bcmp.S amd64: bring back asm bcmp, shared with memcmp 2022-03-26 09:10:03 +00:00
bcopy.c libc: Purge unneeded cdefs.h 2023-11-26 21:20:09 -07:00
bzero.c libc: Purge unneeded cdefs.h 2023-11-26 21:20:09 -07:00
Makefile.inc lib/libc/amd64/string: add strncmp scalar, baseline implementation 2024-01-24 20:39:25 +01:00
memchr.S lib/libc/amd64/string: add memchr(3) scalar, baseline implementation 2023-09-23 14:20:28 -04:00
memcmp.S lib/libc/amd64/string/memcmp.S: harden against phony buffer lengths 2023-09-23 14:21:42 -04:00
memcpy.S Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
memmove.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
memset.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
stpcpy.S lib/libc/amd64/string/stpcpy.S: add baseline implementation 2023-08-21 20:59:38 +02:00
strcat.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
strchrnul.S lib/libc/amd64/string/strchrnul.S: fix edge case in scalar code 2023-08-28 19:45:51 +02:00
strcmp.S lib/libc/amd64/string/strcmp.S: add baseline implementation 2024-01-24 20:39:24 +01:00
strcpy.c libc: Purge unneeded cdefs.h 2023-11-26 21:20:09 -07:00
strcspn.S lib/libc/amd64/string: implement strpbrk() through strcspn() 2024-01-24 20:39:24 +01:00
strlen.S Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
strncmp.S lib/libc/amd64/string: add strncmp scalar, baseline implementation 2024-01-24 20:39:25 +01:00
strnlen.c libc: Purge unneeded cdefs.h 2023-11-26 21:20:09 -07:00
strpbrk.c lib/libc/amd64/string: implement strpbrk() through strcspn() 2024-01-24 20:39:24 +01:00
strspn.S lib/libc/amd64/string: add strspn(3) scalar, x86-64-v2 implementation 2023-09-23 14:20:28 -04:00
timingsafe_bcmp.S lib/libc/amd64/string: add timingsafe_bcmp(3) scalar, baseline implementations 2023-12-28 18:02:41 +01:00
timingsafe_memcmp.S lib/libc/amd64/string: add timingsafe_memcmp() assembly implementation 2023-12-28 18:02:41 +01:00