RFR: 8319716: RISC-V: Add SHA-2
Fei Yang
fyang at openjdk.org
Thu Nov 9 11:31:02 UTC 2023
On Thu, 9 Nov 2023 11:09:22 GMT, Robbin Ehn <rehn 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.
>
> AFIACT the are pretty much the same, except for constants handling in 256.
> Openssl preloads the constants into V10->V25 for 256.
> I think that is beneficial for multi block, but not for single pass.
>
> Compare these 512 round 2s:
>
> __ vl1re64_v(v15, consts); | @{[vle64_v $V20, ($KT)]}
> __ addi(consts, consts, 32); | addi $KT, $KT, 32
> __ vadd_vv(v14, v15, v12); | @{[vadd_vv $V18, $V20, $V14]}
> __ vsha2cl_vv(v17, v16, v14); | @{[vsha2cl_vv $V24, $V22, $V18]}
> __ vsha2ch_vv(v16, v17, v14); | @{[vsha2ch_vv $V22, $V24, $V18]}
> __ vmerge_vvm(v14, v10, v13); | @{[vmerge_vvm $V18, $V10, $V16, $V0]}
> __ vsha2ms_vv(v12, v14, v11); | @{[vsha2ms_vv $V14, $V18, $V12]}
>
>
> I suggest we create a new enhancement for preload constants in 256 multi-block and ship this.
@robehn : Thanks for checking & comparing those two versions. I think I can take a more closer look tomorrow or maybe next week.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/16562#issuecomment-1803654862
More information about the hotspot-dev
mailing list