mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
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:
parent
89b3872376
commit
79287d783c
2 changed files with 22 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
20
lib/libc/aarch64/string/strcat.c
Normal file
20
lib/libc/aarch64/string/strcat.c
Normal 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);
|
||||
}
|
||||
Loading…
Reference in a new issue