[0/2] Add ifunc support and different versions of strlen

Message ID 20230801070902.1385953-1-dengjianbo@loongson.cn
Headers
Series Add ifunc support and different versions of strlen |

Message

dengjianbo Aug. 1, 2023, 7:09 a.m. UTC
  Tested on LoongArch 3A5000 machine: gcc 13.0.1, Linux kernel 6.1.0-rc7+,
binutils 2.40.50, No new FAIL items introduced.

make check:
4646 PASS
  20 UNSUPPORTED
  12 XFAIL 
   6 XPASS

make bench result can be found from:
https://github.com/jiadengx/glibc_test/blob/main/strlen/bench-strlen.out

Comparing with the current generic version, strlen_lasx(256bit SIMD) has
a 20%-600% performance improvement, strlen_lsx(128bit SIMD) has a 20%-
280% performace improvement, strlen_algin has a 5%-60% performance
improvement when length exceeds 32 bytes.

Detailed info can be found from histogram via following link:
https://github.com/jiadengx/glibc_test/tree/main/strlen

dengjianbo (2):
  LoongArch: Redefine macro LEAF/ENTRY.
  Loongarch:  Add ifunc support and add different versions of strlen

 sysdeps/loongarch/lp64/multiarch/Makefile     |   3 +
 .../lp64/multiarch/ifunc-impl-list.c          |  39 +++++++
 .../loongarch/lp64/multiarch/ifunc-strlen.h   |  36 +++++++
 .../loongarch/lp64/multiarch/strlen-aligned.S | 101 ++++++++++++++++++
 .../loongarch/lp64/multiarch/strlen-lasx.S    |  65 +++++++++++
 sysdeps/loongarch/lp64/multiarch/strlen-lsx.S |  73 +++++++++++++
 sysdeps/loongarch/lp64/multiarch/strlen.c     |  37 +++++++
 sysdeps/loongarch/sys/asm.h                   |  36 +++++--
 sysdeps/loongarch/sys/regdef.h                |  57 ++++++++++
 .../unix/sysv/linux/loongarch/cpu-features.h  |   2 +
 10 files changed, 439 insertions(+), 10 deletions(-)
 create mode 100644 sysdeps/loongarch/lp64/multiarch/Makefile
 create mode 100644 sysdeps/loongarch/lp64/multiarch/ifunc-impl-list.c
 create mode 100644 sysdeps/loongarch/lp64/multiarch/ifunc-strlen.h
 create mode 100644 sysdeps/loongarch/lp64/multiarch/strlen-aligned.S
 create mode 100644 sysdeps/loongarch/lp64/multiarch/strlen-lasx.S
 create mode 100644 sysdeps/loongarch/lp64/multiarch/strlen-lsx.S
 create mode 100644 sysdeps/loongarch/lp64/multiarch/strlen.c