about summary refs log tree commit diff
path: root/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
diff options
context:
space:
mode:
authordengjianbo <dengjianbo@loongson.cn>2023-08-24 16:50:17 +0800
committercaiyinyu <caiyinyu@loongson.cn>2023-08-24 17:19:47 +0800
commite74d959862db0e97a1a186ffe606e8fb6c93c309 (patch)
tree92d9260c7cb646991d251da854d05aed562f69fd /sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
parent1dc0bc8f07483e3faef245c343b773137c8d2c4f (diff)
downloadglibc-e74d959862db0e97a1a186ffe606e8fb6c93c309.tar.gz
glibc-e74d959862db0e97a1a186ffe606e8fb6c93c309.tar.xz
glibc-e74d959862db0e97a1a186ffe606e8fb6c93c309.zip
LoongArch: Add ifunc support for strnlen{aligned, lsx, lasx}
Based on the glibc microbenchmark, strnlen-aligned implementation could
reduce the runtime more than 10%, strnlen-lsx implementation could reduce
the runtime about 50%-78%, strnlen-lasx implementation could reduce the
runtime about 50%-88%.
Diffstat (limited to 'sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c')
-rw-r--r--sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c b/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
index 25eb96b061..7cec0b7724 100644
--- a/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
@@ -38,6 +38,14 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_aligned)
 	      )
 
+  IFUNC_IMPL (i, name, strnlen,
+#if !defined __loongarch_soft_float
+	      IFUNC_IMPL_ADD (array, i, strnlen, SUPPORT_LASX, __strnlen_lasx)
+	      IFUNC_IMPL_ADD (array, i, strnlen, SUPPORT_LSX, __strnlen_lsx)
+#endif
+	      IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_aligned)
+	      )
+
   IFUNC_IMPL (i, name, strchr,
 #if !defined __loongarch_soft_float
 	      IFUNC_IMPL_ADD (array, i, strchr, SUPPORT_LASX, __strchr_lasx)