RFR: 8318723: RISC-V: C2 UDivL

Hamlin Li mli at openjdk.org
Wed Oct 25 13:42:37 UTC 2023


On Wed, 25 Oct 2023 13:14:19 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:

>> I don't know why the previous jmh data has no `error` part, maybe because it's too low to show.
>
> IIUC, with the branch, the results are `6376.674 ±  16.869  ns/op`, and without the branch, they are `29518.033 ± 49.056`, correct? If so, the branch makes more sense, at least of the board you've tested.

Yes, for negtive divisor, unsigned div can go through a quick path which is must faster than built-in instructions.
And this is demonstrated in the div cost in riscv.ad, and also verified by benchmark tests run on the board.

( I'm not sure if in the future built-in div will be faster, if it turns out in the future, we should also need to redefine the div cost in riscv.ad, and re-visit this intrinsic. )

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16346#discussion_r1371781221


More information about the hotspot-dev mailing list