RFR: 8316592: RISC-V: implement poly1305 intrinsic [v9]
Hamlin Li
mli at openjdk.org
Fri Nov 10 15:48:06 UTC 2023
On Fri, 10 Nov 2023 15:39:28 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> ArsenyBochkarev has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - Rename poly1305-specific functions
>> - Add final conditional reduce
>
> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 4474:
>
>> 4472:
>> 4473: __ srli(tmp1, U_2, 2);
>> 4474: __ shadd(tmp1, tmp1, tmp1, tmp2, 2);
>
> I'm afraid there might be an overflow issue here.
> Consider a smplifed case(8 bits per U): U_2==0b11111111, tmp1 will be 0b111111, tmp1*5 will overflow, and there is carry for it.
> If I'm right, then the fix is to use 2 steps rather than one to reduce, please check the aarch64 version for details.
If the above issue is not a false one, and the implemention was tested with existing jdk test suite, then I'm afraid we need to add more test to catch this issue.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16417#discussion_r1389566035
More information about the hotspot-compiler-dev
mailing list