Felix-Gong opened a new pull request, #3312: URL: https://github.com/apache/brpc/pull/3312
## Summary - Add hardware-accelerated CRC32C for RISC-V using the Zbc (carry-less multiplication) extension - 128-bit folding with 4-way parallelism and Barrett reduction, following Hadoop PR #8371 - 3-4x speedup over table-based baseline, ~1.1 GB/s throughput on 1MB data ## Key changes - `rv_clmul()` / `rv_clmulh()` inline assembly wrappers for clmul/clmulh instructions - 128-bit fold with 4-way parallel processing (64 bytes/iteration) - Barrett reduction for final 128-bit to 32-bit conversion - Runtime CPU feature detection via `/proc/cpuinfo` - Compile-time guard: `#ifdef __riscv_zbc` - CMake option: `WITH_RISCV_ZBC` (default OFF) ## Test plan - [x] RFC 3720 Section B.4 standard vectors (5 test cases) - [x] CRC Extend composition test - [x] Mask/Unmask operations - [x] Large data correctness: 64B ~ 1MB against bitwise reference (9 test cases) - [x] Performance benchmark: multiple sizes from 64B to 1MB ## Performance | Size | Software (us) | Clmul (us) | Speedup | Clmul MB/s | |------|--------------|------------|---------|------------| | 64B | 0.2 | 0.1 | 2.2x | 610 | | 4KB | 11.3 | 2.9 | 3.9x | 1347 | | 1MB | 2885.1 | 888.6 | 3.2x | 1125 | -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
