8389223: RISC-V: Implement CRC32C intrinsic using Zbc extension - #32061
8389223: RISC-V: Implement CRC32C intrinsic using Zbc extension#32061cczdsq wants to merge 1 commit into
Conversation
|
Hi @cczdsq, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user cczdsq" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
|
❗ This change is not yet ready to be integrated. |
|
The total number of required reviews for this PR has been set to 2 based on the presence of this label: |
ca092dd to
c26b517
Compare
|
@cczdsq Please do not rebase or force-push to an active PR as it invalidates existing review comments. Note for future reference, the bots always squash all changes into a single commit automatically as part of the integration. See OpenJDK Developers’ Guide for more information. |
Hi all,
Please review this PR that implements the
_updateBytesCRC32Cintrinsicfor RISC-V using the Zbc extension.
JBS: https://bugs.openjdk.org/browse/JDK-8389223
Summary
Currently, CRC32C on RISC-V falls back to the generic table-based
implementation. This intrinsic accelerates
java.util.zip.CRC32Cfor cores with Zbc support via carry-less multiply folding.
The implementation uses a folding-based algorithm:
clmul/clmulhwith precomputed fold constants (k1 = x^128 mod P, k2 = x^192 mod P)
The intrinsic is gated by
UseZbcandUseCRC32CIntrinsics, and isautomatically enabled when the Zbc extension is detected via
riscv_hwprobe.Testing
Correctness verified with:
test/jdk/java/util/zip/TestCRC32C.javatest/hotspot/jtreg/compiler/intrinsics/zip/TestCRC32C.java(
-mmode: 1050 cases × 20000 iterations)Performance
JMH benchmark (
org.openjdk.bench.java.util.TestCRC32C) on a RISC-Vboard with Zbc support:
JMH parameters:
-f 2 -wi 5 -i 5 -w 1s -r 1s, measurement error < 1%.Progress
Error
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/32061/head:pull/32061$ git checkout pull/32061Update a local copy of the PR:
$ git checkout pull/32061$ git pull https://git.openjdk.org/jdk.git pull/32061/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 32061View PR using the GUI difftool:
$ git pr show -t 32061Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/32061.diff