mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 20:46:48 +02:00
Add an optimized strnlen() implementation for RISC-V. This version includes a generic optimization and a Zbb-powered optimization using the 'orc.b' instruction, derived from the strlen() implementation. Benchmark results (QEMU TCG, rv64): Length | Original (MB/s) | Optimized (MB/s) | Improvement -------|-----------------|------------------|------------ 16 B | 179 | 309 | +72.6% 512 B | 347 | 1562 | +350.1% 4096 B | 356 | 1878 | +427.5% Suggested-by: Qingfang Deng <dqfext@gmail.com> Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn> Link: https://patch.msgid.link/20260130025018.172925-7-jiangfeng@kylinos.cn Signed-off-by: Paul Walmsley <pjw@kernel.org>
22 lines
607 B
Makefile
22 lines
607 B
Makefile
# SPDX-License-Identifier: GPL-2.0-only
|
|
lib-y += delay.o
|
|
lib-y += memcpy.o
|
|
lib-y += memset.o
|
|
lib-y += memmove.o
|
|
ifeq ($(CONFIG_KASAN_GENERIC)$(CONFIG_KASAN_SW_TAGS),)
|
|
lib-y += strcmp.o
|
|
lib-y += strlen.o
|
|
lib-y += strncmp.o
|
|
lib-y += strnlen.o
|
|
endif
|
|
lib-y += csum.o
|
|
ifeq ($(CONFIG_MMU), y)
|
|
lib-$(CONFIG_RISCV_ISA_V) += uaccess_vector.o
|
|
endif
|
|
lib-$(CONFIG_MMU) += uaccess.o
|
|
lib-$(CONFIG_64BIT) += tishift.o
|
|
lib-$(CONFIG_RISCV_ISA_ZICBOZ) += clear_page.o
|
|
obj-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
|
|
lib-$(CONFIG_RISCV_ISA_V) += xor.o
|
|
lib-$(CONFIG_RISCV_ISA_V) += riscv_v_helpers.o
|