Intrinsics for Math.min and max

Martin Grajcar maaartinus at gmail.com
Tue Apr 1 06:02:47 UTC 2014


I wonder if these intrinsics still make sense when the compiler can
generate movcc itself. According to this SO question
http://stackoverflow.com/questions/22752198/java-math-min-max-performance
it can lead to a factor two slowdown (I guess a JMH benchmark would confirm
this).

For computations like min/max of an array, branches are fairly predictable
after a few steps and avoiding movcc is a good idea.

Regards,
Martin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20140401/0bbee1bc/attachment-0001.html>


More information about the hotspot-compiler-dev mailing list