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-28 10:08:39 +0800
committercaiyinyu <caiyinyu@loongson.cn>2023-08-29 10:35:38 +0800
commitea7698a6165582e45d3cf2726d5e3467e0b1abd5 (patch)
treef487bbee72b7591f959ed23b3e4019b14a000e13 /sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
parent1b1e9b7c10f27947a7cddddf95701ec8030167a6 (diff)
downloadglibc-ea7698a6165582e45d3cf2726d5e3467e0b1abd5.tar.gz
glibc-ea7698a6165582e45d3cf2726d5e3467e0b1abd5.tar.xz
glibc-ea7698a6165582e45d3cf2726d5e3467e0b1abd5.zip
LoongArch: Add ifunc support for memcmp{aligned, lsx, lasx}
According to glibc memcmp microbenchmark test results(Add generic
memcmp), this implementation have performance improvement
except the length is less than 3, details as below:

Name             Percent of time reduced
memcmp-lasx      16%-74%
memcmp-lsx       20%-50%
memcmp-aligned   5%-20%
Diffstat (limited to 'sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c')
-rw-r--r--sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c b/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
index 37f60dde91..e397d58c9d 100644
--- a/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
@@ -127,5 +127,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, memset, 1, __memset_aligned)
 	      )
 
+  IFUNC_IMPL (i, name, memcmp,
+#if !defined __loongarch_soft_float
+	      IFUNC_IMPL_ADD (array, i, memcmp, SUPPORT_LASX, __memcmp_lasx)
+	      IFUNC_IMPL_ADD (array, i, memcmp, SUPPORT_LSX, __memcmp_lsx)
+#endif
+	      IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_aligned)
+	      )
   return i;
 }