Skip to content

[PW_SID:1093584] [1/2] riscv: lib: add memcmp() implementation#1917

Closed
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1093584
Closed

[PW_SID:1093584] [1/2] riscv: lib: add memcmp() implementation#1917
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1093584

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1093584 applied to workflow__riscv__fixes

Name: [1/2] riscv: lib: add memcmp() implementation
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1093584
Version: 1

Linux RISC-V bot and others added 3 commits May 10, 2026 02:08
Add an assembly implementation of memcmp() for RISC-V. The implementation
uses the ZBB extension for word-at-a-time comparison and an assembly
fallback for non-ZBB systems.

Benchmark results (QEMU TCG, rv64):

  Len  | Def   | NoZBB | ZBB   | %NoZBB | %ZBB
  -----|-------|-------|-------|--------|-------
  1 B  | 22.4  | 24.6  | 23.2  | +9.8%  | +3.5%
  7 B  | 96.9  | 108.5 | 107.3 | +12.0% | +10.7%
  8 B  | 107.0 | 116.3 | 176.7 | +8.7%  | +65.1%
  16 B | 148.4 | 172.8 | 315.6 | +16.4% | +112.6%
  31 B | 182.2 | 217.1 | 377.6 | +19.2% | +107.2%
  64 B | 220.6 | 239.4 | 874.2 | +8.5%  | +296.2%
  127 B| 213.7 | 254.8 | 1042.9| +19.2% | +388.0%
  512 B| 255.1 | 269.0 | 1778.6| +5.4%  | +597.2%
  1024B| 252.3 | 280.9 | 1887.7| +11.3% | +648.1%
  3173B| 241.3 | 288.7 | 2063.2| +19.6% | +755.0%
  4096B| 240.9 | 280.5 | 2064.5| +16.4% | +756.9%

Signed-off-by: Milan Tripkovic <Milan.Tripkovic@rt-rk.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Extend the string benchmarking suite to include memcmp().
Extend the string unit test to include memcmp().

Signed-off-by: Milan Tripkovic <Milan.Tripkovic@rt-rk.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 113.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 2210.11 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2993.75 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.31 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 20.66 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.26 seconds
Result: WARNING
Output:

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#62: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 134 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit eae5ffb6688a ("riscv: lib: add memcmp() implementation") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 0 checks, 134 lines checked
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 77.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
kdoc
Desc: Detects for kdoc errors
Duration: 0.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[1/2] riscv: lib: add memcmp() implementation"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 113.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1035.67 seconds
Result: ERROR
Output:

Redirect to /build/tmp.ZfMNKvwZSo and /build/tmp.0NzQC0XwLk
Tree base:
eae5ffb6688ae ("riscv: lib: add memcmp() implementation")
Building the whole tree with the patch
Building the tree before the patch
Building the tree with the patch
New errors added:
--- /build/tmp.DRdW38XZ5f	2026-05-12 17:43:38.017296754 +0000
+++ /build/tmp.x0WUGy5SoM	2026-05-12 17:43:38.019296728 +0000
@@ -117,0 +118 @@
+      1 /build/tmp77rjt1lw/lib/tests/string_kunit.c:929:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
Per-file breakdown
error/warning file pre:
error/warning file post:
pre: 118 post: 119



real	15m36.506s
user	584m0.234s
sys	121m14.375s

real	0m44.976s
user	1m47.016s
sys	1m34.983s

real	0m44.691s
user	1m45.654s
sys	1m34.655s

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1392.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 19.12 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 20.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.90 seconds
Result: WARNING
Output:

CHECK: Please use a blank line after function/struct/union/enum declarations
#23: FILE: lib/tests/string_kunit.c:883:
 }
+static void string_test_memcmp(struct kunit *test)

CHECK: Alignment should match open parenthesis
#42: FILE: lib/tests/string_kunit.c:902:
+				KUNIT_EXPECT_EQ_MSG(test, memcmp(buf1 + i, buf2 + j, len), 0,
+					"Should be equal: i:%d j:%d len:%d", i, j, len);

CHECK: Alignment should match open parenthesis
#50: FILE: lib/tests/string_kunit.c:910:
+					KUNIT_EXPECT_NE_MSG(test, res, 0,
+						"Should detect difference at k:%d (i:%d j:%d len:%d)",

CHECK: Please use a blank line after function/struct/union/enum declarations
#62: FILE: lib/tests/string_kunit.c:922:
+}
+#if IS_ENABLED(CONFIG_STRING_KUNIT_BENCH)

total: 0 errors, 0 warnings, 4 checks, 114 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit b99c85ca241f ("lib/string_kunit: extend benchmarks and unit test to memcmp()") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 4 checks, 114 lines checked
CHECK: Alignment should match open parenthesis
CHECK: Please use a blank line after function/struct/union/enum declarations


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 76.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
kdoc
Desc: Detects for kdoc errors
Duration: 0.73 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot force-pushed the workflow__riscv__fixes branch from 2d4fcdd to cd9d421 Compare May 14, 2026 08:49
@linux-riscv-bot linux-riscv-bot deleted the pw1093584 branch May 20, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants