[PW_SID:1095468] riscv: lib: add optimized memcmp() and extend KUnit tests#1948
[PW_SID:1095468] riscv: lib: add optimized memcmp() and extend KUnit tests#1948linux-riscv-bot wants to merge 2 commits into
Conversation
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, Aligned): Len | Default | NoZBB | ZBB | %NoZBB | %ZBB ------|---------|--------|--------|--------|------- 1 B | 20.3 | 25.0 | 20.9 | +23.2% | +3.0% 7 B | 88.9 | 107.5 | 155.7 | +20.9% | +75.1% 8 B | 89.6 | 110.9 | 176.2 | +23.8% | +96.7% 16 B | 134.4 | 172.4 | 334.8 | +28.3% | +149.1% 31 B | 163.5 | 220.5 | 606.2 | +34.9% | +270.8% 64 B | 203.8 | 235.9 | 968.6 | +15.8% | +375.3% 127 B | 224.6 | 268.7 | 1362.8 | +19.6% | +506.8% 512 B | 235.7 | 271.1 | 1913.7 | +15.0% | +711.9% 1024 B| 256.8 | 290.6 | 2123.6 | +13.2% | +726.9% 4096 B| 263.8 | 302.9 | 2290.4 | +14.8% | +768.2% Benchmark results (QEMU TCG, rv64, Unaligned - Offset 3): Len | Default | NoZBB | ZBB | %NoZBB | %ZBB ------|---------|--------|--------|--------|------- 1 B | 20.7 | 21.7 | 21.5 | +4.8% | +3.9% 7 B | 96.2 | 99.1 | 96.9 | +3.0% | +0.7% 8 B | 97.5 | 118.5 | 110.5 | +21.5% | +13.3% 16 B | 136.7 | 166.6 | 172.8 | +21.9% | +26.4% 31 B | 167.6 | 206.5 | 211.9 | +23.2% | +26.4% 64 B | 204.4 | 229.9 | 240.3 | +12.5% | +17.6% 127 B | 229.6 | 261.7 | 269.0 | +14.0% | +17.2% 512 B | 245.5 | 260.8 | 269.9 | +6.2% | +9.9% 1024 B| 246.9 | 261.2 | 283.5 | +5.8% | +14.8% 4096 B| 250.7 | 295.8 | 299.7 | +18.0% | +19.5% 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>
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 1: "[v3,1/2] riscv: lib: add memcmp() implementation" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
|
Patch 2: "[v3,2/2] lib/string_kunit: extend benchmarks and unit test to memcmp()" |
PR for series 1095468 applied to workflow__riscv__fixes
Name: riscv: lib: add optimized memcmp() and extend KUnit tests
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1095468
Version: 3