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

Hamlin Li mli at openjdk.org
Fri Nov 10 11:34:04 UTC 2023


On Fri, 10 Nov 2023 10:12:26 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> I think the caller does a full mod N reduction of your result in `IntegerPolynomial::final Reduce()`.
>
>> Thanks for the information @theRealAph Seems the finalReduce in java code does not make reduce in intrinsic code here unnecessary, because in the intrinsic code, we only store back 130 bits back to acc_start,
> 
> That is not true. We write 131 bits back:
> 
> 
>     __ ubfx(rscratch1, U_1, 40, 24);   // Top 24 bits of U1
>     __ bfi(rscratch1, U_2, 24, 3);    // Bottom 3 bits of U2
>     __ str(rscratch1, Address(acc_start, 4 * sizeof (jlong)));

Thanks for this information. @theRealAph 

@ArsenyBochkarev `We write 131 bits back`, I think it's safe to align riscv implementation with  aarch64 implementation, currently the code is `andi(t2, U_2, bits2);`, this should be changed to `andi(t2, U_2, 0b111);`? And at same time, we are safe to revert before commit 053b7c0.

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

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


More information about the hotspot-compiler-dev mailing list