RFR: 8282221: x86 intrinsics for divideUnsigned and remainderUnsigned methods in java.lang.Integer and java.lang.Long [v12]

Vladimir Kozlov kvn at openjdk.java.net
Fri Apr 8 16:36:47 UTC 2022


On Fri, 8 Apr 2022 01:59:10 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:

> Personally, I think the optimisation for `div < 0` should be handled by the mid-end optimiser, which will not only give us the advantages of dead code elimination, but also global code motion. I would suggest the backend only doing `xorl rdx, rdx; divl $div$$Register` and the optimisation for `div < 0` will be implemented as a part of JDK-8282365. What do you think?

 I agree that we can do more optimizations with constants as JDK-8282365 suggested.

But I think we should proceed with current changes as they are after fixing remaining issues.
I assume that you are talking about case when `divisor` is constant (or both). Because if it is not, IR optimization will not help - we don't profile arithmetic values so we can't generate uncommon trap path without some profiling information.

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

PR: https://git.openjdk.java.net/jdk/pull/7572


More information about the core-libs-dev mailing list