RFR: 8319716: RISC-V: Add SHA-2

Hamlin Li mli at openjdk.org
Thu Nov 9 17:43:05 UTC 2023


On Thu, 9 Nov 2023 17:33:14 GMT, Hamlin Li <mli at openjdk.org> wrote:

>> Hi, please consider.
>> 
>> Main author is @luhenry, I only fixed some minor things and tested it.
>> 
>> Such as:
>> test/hotspot/jtreg/compiler/intrinsics/sha/
>> test/jdk/java/security/MessageDigest/
>> test/jdk/jdk/security/
>> tier1
>> 
>> And still running some test.
>
> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 3917:
> 
>> 3915:     //--------------------------------------------------------------------------------
>> 3916:     // Quad-round 0 (+0, v10->v11->v12->v13)
>> 3917:     __ vl1re32_v(v15, consts);
> 
> Seems the round 0-11 are quite similar with each other, although with some difference in some src registers, but with similar patterns.
> Would it be possible and better to group them in a loop to simplify the code? or construct some functions.

Seems also that generate_sha256_implCompress and generate_sha512_implCompress can share some code, looks like they are quite similar at a brief look.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16562#discussion_r1388356849


More information about the hotspot-dev mailing list