This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 00/20] RFC: Add the CPU run-time library for C


The current glibc has memory and string functions highly optimized for
the current processors on the market.  But it takes years for released
glibc to be installed on end-users machines.  In 2018, many machines
with the latest Intel processors are still running glibc 2.17, which
was released in February, 2013.

This patch set introduces the CPU run-time library for C, libcpu-rt-c.
libcpu-rt-c contains a subset of the C library with the optimized
functions.  The resulting libcpu-rt-c.so is binary compatible with
older versions of libc.so so that libcpu-rt-c.so can be used with
LD_PRELOAD or linked directly with applications.  For some workloads,
LD_PRELOAD=libcpu-rt-c.so has shown to improve performance by as much
as 20% on Skylake machine.

H.J. Lu (20):
  Initial empty CPU run-time library for C: libcpu-rt-c
  libcpu-rt-c/x86: Add cacheinfo
  libcpu-rt-c/x86: Add cpu-rt-tunables.c
  libcpu-rt-c/x86-64: Add memchr
  libcpu-rt-c/x86-64: Add memcmp
  libcpu-rt-c/x86-64: Add memcpy, memmove and mempcpy
  libcpu-rt-c/x86-64: Add memrchr
  libcpu-rt-c/x86-64: Add memset and wmemset
  libcpu-rt-c/i386: Add memcmp
  libcpu-rt-c: Don't use IFUNC memcmp in init_cpu_features
  libcpu-rt-c/x86-64: Add strchr
  libcpu-rt-c/x86-64: Add strcmp
  libcpu-rt-c/x86-64: Add strcpy
  libcpu-rt-c/x86-64: Add strlen
  libcpu-rt-c/x86-64: Add strcat
  libcpu-rt-c/x86-64: Add strnlen
  libcpu-rt-c/x86-64: Add strncat
  libcpu-rt-c/x86-64: Add strncmp
  libcpu-rt-c/x86-64: Add strncpy
  libcpu-rt-c/x86-64: Add strrchr

 Makeconfig                                    |  4 +-
 configure                                     | 17 +++++
 configure.ac                                  | 11 ++++
 cpu-rt-c/Makefile                             | 42 ++++++++++++
 cpu-rt-c/cpu-rt-misc.c                        | 22 +++++++
 cpu-rt-c/cpu-rt-support.h                     | 38 +++++++++++
 cpu-rt-c/cpu-rt-tunables.c                    | 28 ++++++++
 cpu-rt-c/dl-tunables.h                        | 57 ++++++++++++++++
 elf/dl-misc.c                                 |  2 +
 elf/dl-tunables.c                             |  2 +-
 shlib-versions                                |  3 +
 sysdeps/i386/Makefile                         |  7 ++
 sysdeps/i386/dl-procinfo.c                    | 16 +++--
 sysdeps/i386/i686/multiarch/Makefile          |  4 ++
 sysdeps/i386/i686/multiarch/memcmp-ia32.S     |  8 ++-
 sysdeps/i386/i686/multiarch/memcmp-sse4.S     |  2 +-
 sysdeps/i386/i686/multiarch/memcmp-ssse3.S    |  2 +-
 sysdeps/i386/i686/multiarch/memcmp.c          |  2 +-
 sysdeps/unix/sysv/linux/i386/dl-procinfo.h    |  4 +-
 sysdeps/x86/Makefile                          | 13 ++++
 sysdeps/x86/cacheinfo.c                       | 19 +++++-
 sysdeps/x86/cpu-features.c                    | 46 ++++++++-----
 sysdeps/x86/cpu-features.h                    | 12 +++-
 sysdeps/x86/cpu-rt-misc.c                     | 65 +++++++++++++++++++
 sysdeps/x86/cpu-rt-support.h                  | 21 ++++++
 sysdeps/x86/cpu-tunables.c                    | 14 +++-
 sysdeps/x86/dl-procinfo.c                     | 41 +++++++-----
 sysdeps/x86/dl-procinfo.h                     | 15 +++--
 sysdeps/x86/ldsodefs.h                        | 17 ++++-
 sysdeps/x86_64/Makefile                       | 10 +++
 sysdeps/x86_64/memchr.S                       |  2 +-
 sysdeps/x86_64/memmove.S                      | 12 +++-
 sysdeps/x86_64/memrchr.S                      |  6 ++
 sysdeps/x86_64/memset.S                       |  6 +-
 sysdeps/x86_64/multiarch/Makefile             | 30 +++++++++
 sysdeps/x86_64/multiarch/memchr-avx2.S        |  2 +-
 sysdeps/x86_64/multiarch/memchr-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/memchr.c             |  6 +-
 sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S  |  2 +-
 sysdeps/x86_64/multiarch/memcmp-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/memcmp-sse4.S        |  2 +-
 sysdeps/x86_64/multiarch/memcmp-ssse3.S       |  2 +-
 sysdeps/x86_64/multiarch/memcmp.c             |  4 +-
 sysdeps/x86_64/multiarch/memcpy-ssse3-back.S  |  6 +-
 sysdeps/x86_64/multiarch/memcpy-ssse3.S       |  6 +-
 sysdeps/x86_64/multiarch/memcpy.c             | 14 ++--
 .../multiarch/memmove-avx-unaligned-erms.S    |  2 +-
 .../multiarch/memmove-avx512-no-vzeroupper.S  |  8 ++-
 .../multiarch/memmove-avx512-unaligned-erms.S |  2 +-
 .../multiarch/memmove-sse2-unaligned-erms.S   |  2 +-
 .../multiarch/memmove-vec-unaligned-erms.S    | 33 ++++++----
 sysdeps/x86_64/multiarch/memmove.c            | 10 ++-
 sysdeps/x86_64/multiarch/mempcpy.c            | 10 ++-
 sysdeps/x86_64/multiarch/memrchr-avx2.S       |  2 +-
 sysdeps/x86_64/multiarch/memrchr-sse2.S       |  2 +-
 sysdeps/x86_64/multiarch/memrchr.c            |  8 ++-
 .../multiarch/memset-avx2-unaligned-erms.S    |  2 +-
 .../multiarch/memset-avx512-no-vzeroupper.S   |  4 +-
 .../multiarch/memset-avx512-unaligned-erms.S  |  2 +-
 .../multiarch/memset-sse2-unaligned-erms.S    |  8 ++-
 .../multiarch/memset-vec-unaligned-erms.S     | 17 +++--
 sysdeps/x86_64/multiarch/memset.c             |  4 +-
 .../x86_64/multiarch/strcat-sse2-unaligned.S  |  2 +-
 sysdeps/x86_64/multiarch/strcat-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/strcat-ssse3.S       |  2 +-
 sysdeps/x86_64/multiarch/strcat.c             |  4 +-
 sysdeps/x86_64/multiarch/strchr-avx2.S        |  2 +-
 sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S |  2 +-
 sysdeps/x86_64/multiarch/strchr-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/strchr.c             |  4 +-
 sysdeps/x86_64/multiarch/strcmp-avx2.S        |  2 +-
 .../x86_64/multiarch/strcmp-sse2-unaligned.S  |  2 +-
 sysdeps/x86_64/multiarch/strcmp-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/strcmp-ssse3.S       |  2 +-
 sysdeps/x86_64/multiarch/strcmp.c             |  4 +-
 .../x86_64/multiarch/strcpy-sse2-unaligned.S  |  2 +-
 sysdeps/x86_64/multiarch/strcpy-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/strcpy-ssse3.S       |  2 +-
 sysdeps/x86_64/multiarch/strcpy.c             |  4 +-
 sysdeps/x86_64/multiarch/strlen-avx2.S        |  2 +-
 sysdeps/x86_64/multiarch/strlen-sse2.S        |  2 +-
 sysdeps/x86_64/multiarch/strlen.c             |  4 +-
 sysdeps/x86_64/multiarch/strncat-c.c          |  2 +-
 sysdeps/x86_64/multiarch/strncat.c            |  6 +-
 sysdeps/x86_64/multiarch/strncmp-sse2.S       |  2 +-
 sysdeps/x86_64/multiarch/strncmp.c            |  4 +-
 sysdeps/x86_64/multiarch/strncpy.c            |  4 +-
 sysdeps/x86_64/multiarch/strnlen-sse2.S       |  2 +-
 sysdeps/x86_64/multiarch/strnlen.c            | 20 +++++-
 sysdeps/x86_64/multiarch/strrchr-avx2.S       |  2 +-
 sysdeps/x86_64/multiarch/strrchr-sse2.S       |  2 +-
 sysdeps/x86_64/multiarch/strrchr.c            |  4 +-
 sysdeps/x86_64/multiarch/wmemset.c            | 10 ++-
 sysdeps/x86_64/strcat.S                       |  2 +
 sysdeps/x86_64/strncat.c                      |  9 +++
 95 files changed, 717 insertions(+), 166 deletions(-)
 create mode 100644 cpu-rt-c/Makefile
 create mode 100644 cpu-rt-c/cpu-rt-misc.c
 create mode 100644 cpu-rt-c/cpu-rt-support.h
 create mode 100644 cpu-rt-c/cpu-rt-tunables.c
 create mode 100644 cpu-rt-c/dl-tunables.h
 create mode 100644 sysdeps/x86/cpu-rt-misc.c
 create mode 100644 sysdeps/x86/cpu-rt-support.h
 create mode 100644 sysdeps/x86_64/strncat.c

-- 
2.17.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]