Add RISC-V hardware acceleration for Abseil CRC32C #639
+283
−0
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.
Description
This PR adds support for RISC-V hardware acceleration to the Abseil CRC32C implementation bundled in abseil. Currently, MySQL on RISC-V just falls back to the software implementation.
Implementation Details
SupportsRiscvCrc32()in cpu_detect.cc using theriscv_hwprobesyscall (Linux) to detectZbcorZbkcextensions at runtime.-march=rv64gc_zbcor-march=rv64gc_zbkc.clmul,clmulh).Performance Results
Benchmarks were run on a RISC-V server (SG2044).
Environment:
Comparison
BM_Calculate/500000BM_Extend/500000BM_Memcpy/500000Throughput for
BM_Memcpy(500KB) improved from 60.7 MiB/s to 171.7 MiB/s.Testing
crc32c_test, and passed all 11 built-in unit tests from theCRC32Ctest suite.Impact
This change improves the performance of MySQL on RISC-V platforms, specifically for operations involving CRC32C calculations.
Raw Data
Baseline Benchmark Data
Accelerated Benchmark Data
Test Output