RFR: 8315716: RISC-V: implement ChaCha20 intrinsic [v3]

Fei Yang fyang at openjdk.org
Wed Oct 11 02:52:01 UTC 2023


On Mon, 9 Oct 2023 14:55:42 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Only vector version is included in this patch.
>> 
>> ### Test
>> The patch passed the jdk tests found via `find test/jdk/ -iname *ChaCha*`
>
> Hamlin Li has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Ajust code according round 3 reviewing

Thanks for the update. Two more nits remain, otherwise LGTM.

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 4345:

> 4343:     };
> 4344:     const VectorRegister tmp_vr = v16;
> 4345:     const VectorRegister counter = v17;

Maybe rename this as `counter_vr`?

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 4378:

> 4376:       chacha20_quarter_round(work_vrs[1], work_vrs[6], work_vrs[11], work_vrs[12], tmp_vr);
> 4377:       chacha20_quarter_round(work_vrs[2], work_vrs[7], work_vrs[8], work_vrs[13], tmp_vr);
> 4378:       chacha20_quarter_round(work_vrs[3], work_vrs[4], work_vrs[9], work_vrs[14], tmp_vr);

I personally prefer to add one extra space to keep the fourth parameter aligned for those calls to `chacha20_quarter_round`.

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

Marked as reviewed by fyang (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15899#pullrequestreview-1665737295
PR Review Comment: https://git.openjdk.org/jdk/pull/15899#discussion_r1351129196
PR Review Comment: https://git.openjdk.org/jdk/pull/15899#discussion_r1351723257


More information about the hotspot-dev mailing list