xref: /freebsd/contrib/llvm-project/compiler-rt/lib/builtins/aarch64/sme-libc-routines.c (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1 #include <stddef.h>
2 
__arm_sc_memchr(const void * src,int c,size_t n)3 const void *__arm_sc_memchr(const void *src, int c,
4                             size_t n) __arm_streaming_compatible {
5   const unsigned char *srcp = (const unsigned char *)src;
6   unsigned char c8 = (unsigned char)c;
7   for (size_t i = 0; i < n; ++i)
8     if (srcp[i] == c8)
9       return &srcp[i];
10 
11   return NULL;
12 }
13