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

Fei Yang fyang at openjdk.org
Wed Nov 1 07:58:01 UTC 2023


On Wed, 1 Nov 2023 07:44:46 GMT, Vladimir Kempik <vkempik at openjdk.org> wrote:

>> 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.

Well, I think the code comment on the right hand side explains. But I am OK either way.
Note that a similar case is at line L4609.

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

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


More information about the hotspot-compiler-dev mailing list