On Thu, Jul 27, 2023 at 8:44 AM Uwe Schindler <u...@thetaphi.de> wrote:
> Hi Mike, > > actually Hotspot is using CMOV. Some nodes after bytecode analysis are > converted to CMoveNode and it has implementations to generate machine code > (as far as i see) for x86, s390 and arm. > > The generic code is here: > https://github.com/openjdk/jdk/blob/486c7844f902728ce580c3994f58e3e497834952/src/hotspot/share/opto/movenode.cpp > Thanks Uwe, this is wild. I read the comment at the top of that source file and couldn't understand it! And it made it sound like there was no solution (all five bullets have problems). > Actually it is used in some cases, but I did not find out when it uses it > to generate instructions from bytecode. It also has some code to optimize > the cmov away if the result is known before (or not, e.g. for floats it > does not do this). > > I think best would be to ask on the hotspot compiler list on suggestions > how to write Java code to trigger the JVM to insert the CMOV. > Thanks. I wonder if there is any practical performance impact of targeting CMOV from javaland... Mike McCandless http://blog.mikemccandless.com