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

Hamlin Li mli at openjdk.org
Wed Nov 8 12:36:06 UTC 2023


On Tue, 7 Nov 2023 14:50:34 GMT, ArsenyBochkarev <duke at openjdk.org> wrote:

>> Maybe there is no chance for this to happen, as in the loop there is already one reducing before quit the loop, the `reduce` here is already the final one?
>> I'm not quite sure.
>
> There are two cases here:
> 1. No loop cycles were performed: the maximum value in `U_2` before the `reduce` is `0b11`, so it is cleared by `srli`;
> 2. Some loop cycles were performed: it is possible for `U_2 == 0b11` and `t2 == 1` to happen at the end of loop's last `reduce` block, that's correct. However, at the next reduce outside the loop, `U_2` would have `0b100` value which would be cleared to safe `0b1` by `srli`.

Yes, what I'm discussing is the case 2.
Sorry, I'm still bit concerned.

You said `at the next reduce outside the loop, U_2 would have 0b100 value which would be cleared to safe 0b1 by srli.`, but seems the dest register of srli is tmp1 not U_2, am I right?

If I'm right above, then let's continue the discussion.
Let's say at the entry of LINE 4576 `reduce(U_2, U_1, U_0, t1, t2);` (just out of the loop), U_2 == ob11.
Then in reduce(), U_2 will be 0b11 at the entry of LINE 4478 `__ add(U_2, U_2, tmp2);`, and tmp2 == 1. Is it possible?

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

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


More information about the hotspot-compiler-dev mailing list