RFR: 8340732: RISC-V: Refactor crc32 scalar version

Hamlin Li mli at openjdk.org
Wed Sep 25 07:36:38 UTC 2024


On Tue, 24 Sep 2024 13:58:57 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hi,
>> Can you help to review this patch?
>> As discussed in https://github.com/openjdk/jdk/pull/20910#discussion_r1755150447, it's helpful to refactor the existing scalar version of crc32 intrinsic.
>> Several refactoring are done in this pr,
>> 1. Simplify the `len` usage, now it only decreases (i.e. change in one direction)
>> 2. Simplify the code paths
>> 3. Remove one instruction in `L_by4_loop`
>> 4. Remove unnecessary code
>> 5. Other misc
>> 
>> Thanks!
>
> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 6097:
> 
>> 6095:     __ kernel_crc32(crc, buf, len,
>> 6096:                     c_rarg3, c_rarg4, c_rarg5, c_rarg6, // tmp's for tables
>> 6097:                     c_rarg7, t2, x28, x29, x30, x31);   // misc tmps
> 
> Nit: Can we use alias t3-t6 for x28-x31 instead? The purpose is to be consistent with `t2` in naming.

How do you think we add t3-t6 alias into assemler_riscv.hpp?
I saw several times people had the similar question, and in the code there are several places like this `Register size      = x29;   // t4`, i.e. try to use t3-t6, but needs to add a comment for that.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21150#discussion_r1774694494


More information about the hotspot-dev mailing list