Add RISC-V Zvbc vector CRC32C acceleration#3332
Open
Felix-Gong wants to merge 1 commit into
Open
Conversation
Implement CRC32C using Zvbc vector carry-less multiplication (vclmul/vclmulh RVV intrinsics). Processes 4 lanes of 128-bit folding per iteration (64 bytes), with 4-to-1 lane reduction and Barrett reduction for finalization. - Add rv_crc32c_vclmul() using vclmul/vclmulh intrinsics - Add isZvbc() runtime detection via /proc/cpuinfo - Add WITH_RISCV_ZVBC cmake option - Fix macro guards: support __riscv_zvbc without __riscv_zbc - Zvbc preferred over Zbc in Choose_Extend()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vclmul/vclmulhRVV intrinsics)WITH_RISCV_ZVBCcmake optionChoose_Extend()for higher throughputBackground
This extends the existing Zbc scalar CRC32C optimization (merged in #3312) with vector support. The implementation follows the same 128-bit folding + Barrett reduction approach used in x86 SSE4.2 and ARM PMULL.
Key implementation details
clmul/clmulh(Zbc instructions, available when Zvbc is present)Testing
Verified on QEMU with
-cpu rv64,zvbc=true,v=true,vlen=128:Build