Skip to content

RISC-V: Optimize crc32c with Zbc extension#14536

Open
fengpengboa wants to merge 1 commit intofacebook:mainfrom
fengpengboa:crc32c_zbc
Open

RISC-V: Optimize crc32c with Zbc extension#14536
fengpengboa wants to merge 1 commit intofacebook:mainfrom
fengpengboa:crc32c_zbc

Conversation

@fengpengboa
Copy link
Copy Markdown

This PR introduces optimized CRC32C hardware acceleration for RISC-V platforms that support the Zbc (Carry-less Multiplication) extension. The implementation leverages the clmul instruction to compute CRC32C more efficiently, providing significant performance improvements over the existing software-based fallback.

1.crc32c test
[==========] Running 8 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 8 tests from CRC
[ RUN ] CRC.StandardResults
[ OK ] CRC.StandardResults (2 ms)
[ RUN ] CRC.Values
[ OK ] CRC.Values (0 ms)
[ RUN ] CRC.Extend
[ OK ] CRC.Extend (0 ms)
[ RUN ] CRC.Mask
[ OK ] CRC.Mask (0 ms)
[ RUN ] CRC.Crc32cCombineBasicTest
[ OK ] CRC.Crc32cCombineBasicTest (0 ms)
[ RUN ] CRC.Crc32cCombineOrderMattersTest
[ OK ] CRC.Crc32cCombineOrderMattersTest (0 ms)
[ RUN ] CRC.Crc32cCombineFullCoverTest
[ OK ] CRC.Crc32cCombineFullCoverTest (70 ms)
[ RUN ] CRC.Crc32cCombineBigSizeTest
[ OK ] CRC.Crc32cCombineBigSizeTest (151 ms)
[----------] 8 tests from CRC (225 ms total)

[----------] Global test environment tear-down
[==========] 8 tests from 1 test case ran. (225 ms total)
[ PASSED ] 8 tests.

2.Performance Results
Performance was measured using the crc32c_bench microbenchmark on a SG2044.
./db_bench --benchmarks="crc32c"

Software fallback : 10.396 micros/op 96189 ops/sec 13.307 seconds 1280000 operations; 375.7 MB/s (4096 per op)
zbc optimized : 0.617 micros/op 1621320 ops/sec 0.789 seconds 1280000 operations; 6333.3 MB/s (4096 per op)

…d CRC32C hardware acceleration for RISC-V platforms that support the Zbc (Carry-less Multiplication) extension. The implementation leverages the clmul instruction to compute CRC32C more efficiently, providing significant performance improvements over the existing software-based fallback.
@meta-cla
Copy link
Copy Markdown

meta-cla bot commented Mar 31, 2026

Hi @fengpengboa!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla meta-cla bot added the CLA Signed label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant