LoongArch: Add ifunc support for strcpy, stpcpy{aligned, unaligned, lsx, lasx}
authordengjianbo <dengjianbo@loongson.cn>
Wed, 13 Sep 2023 07:34:59 +0000 (15:34 +0800)
committercaiyinyu <caiyinyu@loongson.cn>
Fri, 15 Sep 2023 01:07:47 +0000 (09:07 +0800)
commit06251002d4a1d92101ae7205be380887a4129471
tree1fe85f72cba92d737ff3593f66a266b843c21ce7
parentc6c73e136a51d2372d108fb411e8418593aa79ca
LoongArch: Add ifunc support for strcpy, stpcpy{aligned, unaligned, lsx, lasx}

According to glibc strcpy and stpcpy microbenchmark test results(changed
to use generic_strcpy and generic_stpcpy instead of strlen + memcpy),
comparing with the generic version, this implementation could reduce the
runtime as following:

Name              Percent of rutime reduced
strcpy-aligned    8%-45%
strcpy-unaligned  8%-48%, comparing with the aligned version, unaligned
                  version takes less instructions to copy the tail of data
  which length is less than 8. it also has better performance
  in case src and dest cannot be both aligned with 8bytes
strcpy-lsx        20%-80%
strcpy-lasx       15%-86%
stpcpy-aligned    6%-43%
stpcpy-unaligned  8%-48%
stpcpy-lsx        10%-80%
stpcpy-lasx       10%-87%
12 files changed:
sysdeps/loongarch/lp64/multiarch/Makefile
sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
sysdeps/loongarch/lp64/multiarch/stpcpy-aligned.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/stpcpy-lasx.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/stpcpy-lsx.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/stpcpy-unaligned.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/stpcpy.c [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/strcpy-aligned.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/strcpy-lasx.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/strcpy-lsx.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/strcpy-unaligned.S [new file with mode: 0644]
sysdeps/loongarch/lp64/multiarch/strcpy.c [new file with mode: 0644]