RFR: 8318723: RISC-V: C2 UDivL
Andrew Haley
aph at openjdk.org
Wed Oct 25 17:55:36 UTC 2023
On Wed, 25 Oct 2023 14:48:15 GMT, Ludovic Henry <luhenry at openjdk.org> wrote:
>> 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. )
>
> Ok, so let's keep the version with branch. You should add a comment at https://github.com/openjdk/jdk/pull/16346/files#diff-7a5c3ed05b6f3f06ed1c59f5fc2a14ec566a6a5bd1d09606115767daa99115bdR2435 explaining just that.
But you're putting a conditional branch in the way of the common cases, and you're greatly increasing icache pressure, for the sake of a rare case. How does that make any sense?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16346#discussion_r1372124307
More information about the hotspot-dev
mailing list