RFR: 8282365: Optimize divideUnsigned and remainderUnsigned for constants [v18]

Quan Anh Mai qamai at openjdk.org
Tue Aug 22 17:29:50 UTC 2023


On Tue, 22 Aug 2023 17:02:28 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> I am working with adding more division tests in the java side as you have suggested, I think checking the result with different value ranges of the dividend is necessary, I am thinking of using `Min` and `Max` nodes for this, but there is currently no intrinsics for `Math::min(long, long)` and `Math::max(long, long)`, do you think I should add those to have easier time working on testing this patch?
>
> @merykitty Why do you need the intrinsic for `Math::min/max(long,long)`? I would just write two methods: one that is compiled (maybe add IR rule that checks that division is present in earlier compile phase, but not present later), and another method that is excluded from compilation. Then you can just generate random inputs to the division and compare outputs.
> 
> But sure, adding the intrinsics for long min/max is on my list, because I want it to vectorize with SuperWord. So go ahead with it in a separate RFE if you want to use it for testing.

@eme64 Because the division is transformed before it even appears on the graph, so the most simple solution to have an arbitrary value range for the dividend is to use a pair of min/max nodes to clamp the input and inform the compiler about the value set of the dividend. Thanks.

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

PR Comment: https://git.openjdk.org/jdk/pull/9947#issuecomment-1688606053


More information about the hotspot-compiler-dev mailing list