lib/libc/aarch64/string: strcat enable use of SIMD

Call into SIMD strlen and stpcpy for an optimized strcat. Port of
D42600 for amd64.

Tested by:	fuz (exprun)
Reviewed by:	fuz, emaste
Sponsored by:	Google LLC (GSoC 2024)
PR:		281175
Differential Revision: https://reviews.freebsd.org/D46417
This commit is contained in:
Getz Mikalsen 2024-08-26 20:14:15 +02:00 committed by Robert Clausecker
parent 89b3872376
commit 79287d783c
2 changed files with 22 additions and 1 deletions

View file

@ -25,7 +25,8 @@ MDSRCS+= \
strspn.S \
strcspn.S \
strpbrk.c \
strsep.c
strsep.c \
strcat.c
#
# Add the above functions. Generate an asm file that includes the needed

View file

@ -0,0 +1,20 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2024 Getz Mikalsen <getz@FreeBSD.org>
*/
#include <string.h>
#undef strcat /* _FORTIFY_SOURCE */
char *
strcat(char * __restrict s, const char * __restrict append)
{
char *save = s;
/* call into SIMD optimized functions */
stpcpy(s + strlen(s), append);
return(save);
}