Repository navigation
add RVV optimization for ZSTD_row_getMatchMask - #4481
Conversation
Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
|
Hi @camel-cdr @Cyan4973 , |
|
Look, I'm not going to help you finetune your prompts until the llm generates a good implementation. I've already toled you how to implement it earlier and probably wasted more time on this now then it would've taken me to write the implementation my self. |
| int i; | ||
| assert(nbChunks == 1 || nbChunks == 2 || nbChunks == 4); | ||
|
|
||
| size_t vl = __riscv_vsetvl_e8m1(16); |
There was a problem hiding this comment.
minor:
this is not C90 compliant.
The size_t vl declaration should come before the assert() expression.
|
Is this new code path tested in CI ? |
Performance (vs. SWAR) - 16-byte data: 5.87x speedup - 32-byte data: 9.63x speedup - 64-byte data: 17.98x speedup Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
|
yes, this looks proper now 👍 |
I've confirmed that the new RVV code path is covered |
This pull request introduces a RISC-V Vector (RVV) specific optimization for the
ZSTD_row_getMatchMaskfunction, replacing the generic SWAR implementation on RV64 platforms with V-extension support. The goal is to leverage RVV's parallel computation capabilities to improve performance on the RISC-V architecture.Performance
Microbenchmark Results
A microbenchmark isolating the
ZSTD_row_getMatchMaskfunction shows a significant speedup compared to the SWAR fallback.rowEntriesFullbench
The overall impact on the
fullbenchis modest. However, the new implementation shows a consistent small improvement and, most importantly, no performance regression.Validation
make check).make test).make staticAnalyze).