Comments about JDK-8213473: Replace testB_mem_imm matcher with testUB_mem_imm
bsrbnd at gmail.com
Fri Nov 16 14:23:25 UTC 2018
The current fix  for JDK-8213473  replaces 'testB_mem_imm' with
'testUB_mem_imm' in 'x86_64.ad' which is fine for unsigned bytes, for
if ((flags & 0x80) != 0) ...
But per JLS §5.6.2 & §5.1.2, if we have something like :
if ((flags & (byte)0x80) != 0) ...
the mask is 32-bit sign-extended and 'LoadB' isn't converted to
'LoadUB' in 'AndINode::Ideal'  which is fine.
Unfortunately 'testUB_mem_imm' won't be matched in this case, so I
guess we'd need both 'testB_mem_imm' & 'testUB_mem_imm' patterns.
If we all agree, I can create a JBS issue and send out a RFR for this?
More information about the hotspot-dev