RFR: 8339910: RISC-V: crc32 intrinsic with carry-less multiplication [v3]

Robbin Ehn rehn at openjdk.org
Thu Dec 5 15:13:40 UTC 2024


On Mon, 2 Dec 2024 13:54:18 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hi,
>> Can you review this patch to implement CRC32 with `vclmul` (Zvbc)?
>> Thanks!
>> 
>> For more details of the algorithm, please check the paper: "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction - Intel", please also refer to the corresponding code in aarch64 or x86 ones.
>> As the riscv carry-less multiplication instructions are a bit different from the other platforms, so the implementation itself is also a bit different from others.
>> 
>> 
>> ## Test
>> test/hotspot/jtreg/compiler/intrinsics/zip/TestCRC32.java, 
>> test/jdk/java/util/zip/TestCRC32.java
>> also run tests found by: `grep -lRi crc32 test/* | grep -v bench`
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   add some background description

src/hotspot/cpu/riscv/vm_version_riscv.cpp line 360:

> 358:   // UseZvbc (depends on RVV).
> 359:   if (UseZvbc && !UseRVV) {
> 360:     FLAG_SET_DEFAULT(UseZvbc, false);

If Zvbc is picked up via hwprobe and user uses:
`java -XX:-UseRVV ...`
wouldn't they get the warning forcing them to add -UseZvbc?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22475#discussion_r1871556621


More information about the hotspot-dev mailing list