RFR: 8316592: RISC-V: implement poly1305 intrinsic [v3]

Vladimir Kempik vkempik at openjdk.org
Wed Nov 1 07:47:02 UTC 2023


On Wed, 1 Nov 2023 06:01:33 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> null has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Replace slli/add sequence with shadd instruction
>
> src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 4564:
> 
>> 4562:       __ srli(tmp1, U_2, 2);
>> 4563:       const int64_t bits2 = right_n_bits(2);
>> 4564:       __ andi(U_2, U_2, bits2); // Clear U_2 except for the first two bits
> 
> A more simpler `__ andi(U_2, U_2, 3)` will do.

3 is kind of magic number in your case. right_n_bits(2) looks better.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16417#discussion_r1378483764


More information about the hotspot-compiler-dev mailing list