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

Hamlin Li mli at openjdk.org
Mon Dec 2 12:05:39 UTC 2024


On Mon, 2 Dec 2024 11:02:09 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Hi,
>> Can you review this patch to implement CRC32 with `vclmul` (Zvbc)?
>> Thanks!
>> 
>> 
>> ## Test
>> test/hotspot/jtreg/compiler/intrinsics/zip/TestCRC32.java, 
>> test/jdk/java/util/zip/TestCRC32.java
>
> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1761:
> 
>> 1759:   bind(L_16_bytes_loop);
>> 1760:   {
>> 1761:     #define CRC32_VCLMUL_FOLD_16_BYTES(vx, vt, vtmp1, vtmp2, vtmp3, vtmp4) \
> 
> It makes no sense for this to be a macro, because it's called infrequently. Making it a function would save space.

Thanks for the suggestion, will fix it.

> src/hotspot/cpu/riscv/macroAssembler_riscv.cpp line 1833:
> 
>> 1831:     vslideup_vi(vy, vtmp1, 1); \
>> 1832:     vmv_x_s(tmp2, vtmp3); \
>> 1833:     vmv_s_x(vy, tmp2);
> 
> Again, not a macro.

Thanks for the suggestion, will fix it.

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

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


More information about the hotspot-dev mailing list