diff --git a/libc/arch-arm64/dynamic_function_dispatch.cpp b/libc/arch-arm64/dynamic_function_dispatch.cpp index 0edc7f702..cd5531163 100644 --- a/libc/arch-arm64/dynamic_function_dispatch.cpp +++ b/libc/arch-arm64/dynamic_function_dispatch.cpp @@ -41,6 +41,12 @@ DEFINE_IFUNC_FOR(memchr) { } } +typedef void* memcmp_func(void*, const void*, size_t); +DEFINE_IFUNC_FOR(memcmp) { + // TODO: enable the SVE version. + RETURN_FUNC(memcmp_func, __memcmp_aarch64); +} + typedef void* memcpy_func(void*, const void*, size_t); DEFINE_IFUNC_FOR(memcpy) { if (arg->_hwcap & HWCAP_ASIMD) { @@ -110,6 +116,12 @@ DEFINE_IFUNC_FOR(strncmp) { RETURN_FUNC(strncmp_func, __strncmp_aarch64); } +typedef size_t strnlen_func(const char*); +DEFINE_IFUNC_FOR(strnlen) { + // TODO: enable the SVE version. + RETURN_FUNC(strnlen_func, __strnlen_aarch64); +} + typedef char* strrchr_func(const char*, int); DEFINE_IFUNC_FOR(strrchr) { if (arg->_hwcap2 & HWCAP2_MTE) { diff --git a/libc/arch-arm64/static_function_dispatch.S b/libc/arch-arm64/static_function_dispatch.S index 5c36de694..c7557f851 100644 --- a/libc/arch-arm64/static_function_dispatch.S +++ b/libc/arch-arm64/static_function_dispatch.S @@ -34,6 +34,7 @@ ENTRY(name); \ END(name) FUNCTION_DELEGATE(memchr, __memchr_aarch64_mte) +FUNCTION_DELEGATE(memcmp, __memcmp_aarch64) FUNCTION_DELEGATE(memcpy, __memcpy_aarch64) FUNCTION_DELEGATE(memmove, __memmove_aarch64) FUNCTION_DELEGATE(stpcpy, __stpcpy_aarch64) @@ -44,5 +45,6 @@ FUNCTION_DELEGATE(strcpy, __strcpy_aarch64) FUNCTION_DELEGATE(strlen, __strlen_aarch64_mte) FUNCTION_DELEGATE(strrchr, __strrchr_aarch64_mte) FUNCTION_DELEGATE(strncmp, __strncmp_aarch64) +FUNCTION_DELEGATE(strnlen, __strnlen_aarch64) NOTE_GNU_PROPERTY()