Linux s390 Architecture development
 help / color / mirror / Atom feed
* [PATCH 0/8] s390/string: Convert various functions to C
@ 2026-06-07 16:29 Heiko Carstens
  2026-06-07 16:29 ` [PATCH 1/8] s390/purgatory: Enforce z10 minimum architecture level Heiko Carstens
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Heiko Carstens @ 2026-06-07 16:29 UTC (permalink / raw)
  To: Alexander Gordeev, Sven Schnelle, Vasily Gorbik,
	Christian Borntraeger, Juergen Christ
  Cc: linux-s390

While working on something else I stumbled again across the various mem*()
helper functions, which were implemented in assembler to avoid recursive
calls [1], when using the compiler's builtin functions.

Convert the functions back to C using inline assemblies, which makes them
hopefully a bit more readable and maintainable. Also improve the memmove()
implementation by using the mvcrl instruction for the backward copy case.

Thanks,
Heiko

[1] commit 535c611ddd3e ("s390/string: provide asm lib functions for memcpy and memcmp")

Heiko Carstens (8):
  s390/purgatory: Enforce z10 minimum architecture level
  s390: Add .noinstr.text to boot and purgatory linker scripts
  s390/string: Convert memmove() to C
  s390/string: Convert memset() to C
  s390/string: Convert memset() to C
  s390/string: Convert memset(16|32|64)() to C
  s390/memmove: Optimize backward copy case
  s390/tishift: Convert __ashlti3(), __ashrti3(), __lshrti3() to C

 arch/s390/boot/Makefile                |   2 +-
 arch/s390/boot/mem.S                   |   2 -
 arch/s390/boot/string.c                |   6 +-
 arch/s390/boot/vmlinux.lds.S           |   1 +
 arch/s390/include/asm/asm-prototypes.h |   4 -
 arch/s390/lib/Makefile                 |   1 -
 arch/s390/lib/mem.S                    | 192 ----------------------
 arch/s390/lib/string.c                 | 210 +++++++++++++++++++++++++
 arch/s390/lib/tishift.S                |  63 --------
 arch/s390/lib/tishift.c                |  64 ++++++++
 arch/s390/lib/tishift.h                |   8 +
 arch/s390/purgatory/Makefile           |   9 +-
 arch/s390/purgatory/purgatory.lds.S    |   1 +
 13 files changed, 290 insertions(+), 273 deletions(-)
 delete mode 100644 arch/s390/boot/mem.S
 delete mode 100644 arch/s390/lib/mem.S
 delete mode 100644 arch/s390/lib/tishift.S
 create mode 100644 arch/s390/lib/tishift.c
 create mode 100644 arch/s390/lib/tishift.h

-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-06-07 16:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-07 16:29 [PATCH 0/8] s390/string: Convert various functions to C Heiko Carstens
2026-06-07 16:29 ` [PATCH 1/8] s390/purgatory: Enforce z10 minimum architecture level Heiko Carstens
2026-06-07 16:29 ` [PATCH 2/8] s390: Add .noinstr.text to boot and purgatory linker scripts Heiko Carstens
2026-06-07 16:29 ` [PATCH 3/8] s390/string: Convert memmove() to C Heiko Carstens
2026-06-07 16:29 ` [PATCH 4/8] s390/string: Convert memset() " Heiko Carstens
2026-06-07 16:29 ` [PATCH 5/8] " Heiko Carstens
2026-06-07 16:29 ` [PATCH 6/8] s390/string: Convert memset(16|32|64)() " Heiko Carstens
2026-06-07 16:29 ` [PATCH 7/8] s390/memmove: Optimize backward copy case Heiko Carstens
2026-06-07 16:29 ` [PATCH 8/8] s390/tishift: Convert __ashlti3(), __ashrti3(), __lshrti3() to C Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox