Skip to content

Zbb string optimizations

Heiko Stuebner linux-riscv 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v5 Latest2 patches 7 repliesApplied 2/2

Changes in v5 from the cover letter

- split out the now shared alternatives j-address-fixup
- split out the somewhat unrelated isn-func move patch
- follow Andrew's great suggestions on making the assembly nicer
- put the Zbb extension into the correct place after Conor's reordering

Patches in v5 All 2 applied

#Subject and filesSizeRepliesApplied
1/2RISC-V: add infrastructure to allow different str* implementationsarch/riscv/include/asm/string.h arch/riscv/kernel/riscv_ksyms.c arch/riscv/lib/Makefile +4 more+134 -01 replyApplied
2/2RISC-V: add zbb support to string functionsarch/riscv/Kconfig arch/riscv/include/asm/errata_list.h arch/riscv/include/asm/hwcap.h +5 more+334 -14 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndrew JonesConor Dooley
1/2R-b R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/2] Zbb string optimizations

From: Heiko Stuebner <[email protected]>

This series still tries to allow optimized string functions for specific extensions. The last approach of using an inline base function to hold the alternative calls did cause some issues in a number of places

So instead of that we're now just using an alternative j at the beginning of the generic function to jump to a separate place inside the function itself.

This of course needs a fixup for "j" instructions in alternative blocks, so that is provided here as well.

Technically patch4 got a review from Andrew, but that was still with the inline approach, so I didn't bring it over to v4.

Dependencies:
- 6.2-rc1
- the series adding the call address fixes to alternatives (in Palmer's next)
https://lore.kernel.org/r/[email protected]
- the patch adding the j address fix to alternatives
https://lore.kernel.org/r/[email protected]
- Conor's isa extension reordering series
https://lore.kernel.org/r/[email protected]

changes since v4:
- split out the now shared alternatives j-address-fixup
- split out the somewhat unrelated isn-func move patch
- follow Andrew's great suggestions on making the assembly nicer
- put the Zbb extension into the correct place after Conor's reordering

changes since v3:
- rebase on top of 6.2-rc1 + the applied alternative-call series
- add alternative fixup for jal instructions
- drop the inline functions and instead just jump

changes since v2:
- add patch fixing the c.jalr funct4 value
- reword some commit messages
- fix position of auipc addition patch (earlier)
- fix compile errors from patch-reordering gone wrong (worked at the end of v2, but compiling individual patches caused issues) - patches are now tested individually
- limit Zbb variants for GNU as for now
(LLVM support for .option arch is still under review)
- prevent str-functions from getting optimized to builtin-variants

changes since v1:
- a number of generalizations/cleanups for instruction parsing
- use accessor function to access instructions (Emil)
- actually patch the correct location when having more than one instruction in an alternative block
- string function cleanups (comments etc) (Conor)
- move zbb extension above s* extensions in cpu.c lists

changes since rfc:
- make Zbb code actually work
- drop some unneeded patches
- a lot of cleanups

Heiko Stuebner (2):
RISC-V: add infrastructure to allow different str* implementations
RISC-V: add zbb support to string functions

 arch/riscv/Kconfig                   |  24 +++++
 arch/riscv/include/asm/errata_list.h |   3 +-
 arch/riscv/include/asm/hwcap.h       |   1 +
 arch/riscv/include/asm/string.h      |  10 ++
 arch/riscv/kernel/cpu.c              |   1 +
 arch/riscv/kernel/cpufeature.c       |  18 ++++
 arch/riscv/kernel/riscv_ksyms.c      |   3 +
 arch/riscv/lib/Makefile              |   3 +
 arch/riscv/lib/strcmp.S              | 121 +++++++++++++++++++++++
 arch/riscv/lib/strlen.S              | 133 +++++++++++++++++++++++++
 arch/riscv/lib/strncmp.S             | 139 +++++++++++++++++++++++++++
 arch/riscv/purgatory/Makefile        |  13 +++
 12 files changed, 468 insertions(+), 1 deletion(-)
 create mode 100644 arch/riscv/lib/strcmp.S
 create mode 100644 arch/riscv/lib/strlen.S
 create mode 100644 arch/riscv/lib/strncmp.S
Signature · 7 lines
2.35.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv