Fwd: Intrinsics for Math.min and max

Martin Grajcar maaartinus at gmail.com
Wed Apr 2 14:12:52 UTC 2014


This should have been reply to all, forwarding.

On Wed, Apr 2, 2014 at 1:45 AM, Vladimir Kozlov
<vladimir.kozlov at oracle.com>wrote:

> I agree that we should take into account a profiling information (if it is
> available) in LibraryCallKit::inline_min_max() as we do in
> PhaseIdealLoop::conditional_move(). At least the code will be consistent
> in both cases.
>
> We still need to define how quantify "highly unpredictable".
>

To define "highly unpredictable" is hard, but we could define "surely
highly predictable" instead: Whenever the probability is outside the 4%-96%
range, cmov is guaranteed to lose, even if there's no pattern at all. This
would be a fairly conservative change, but it'd help for computing the
maximum for arrays longer than let's say 50 elements.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140402/ab59690d/attachment.html>


More information about the hotspot-compiler-dev mailing list