RFR: 8216392: Enable cmovP_mem and cmovP_memU instructions

Roman Kennke rkennke at redhat.com
Wed Jan 9 12:13:22 UTC 2019

While poking around x86_64.ad's cmovP instructions (because I needed it
for an experiment in Shenandoah), I noticed that 2 of them are
disabled/commented-out:  cmovP_mem and  cmovP_memU. This means that a
cmovp with a 2nd argument that is a LoadP will generate two instructions:

mov %r1, $mem
cmov %r2, %1

instead of just one:

cmov %r2, $mem

The comment there says that adlc doesn't compute the bottom-type
correctly, and that implicit null-checking is broken, but I couldn't
confirm either of those. I checked hg annotate, but the commented-out
block stems from revision #1 and cannot be traced to a bug or so.

I did notice a bug though: the two instructions would encode to cmov to
32bit register instead to 64bit register. I added the missing
REX_reg_reg_wide(dst, src) and now everything seems to work fine and
generated code looks better.

I cannot say if if this has performance implication. I suspect not. If
it has, it's probably miniscule improvement. I can't see how it could be
worse though.


Testing: tier1 (hotspot/jdk/langtools) passes on linux-x86



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20190109/a0f0ebac/signature.asc>

More information about the hotspot-compiler-dev mailing list