hotspot: problem with bitwise rotation on PowerLE

Jan S Rellermeyer rellermeyer at us.ibm.com
Fri May 8 20:01:41 UTC 2015



I am helping people in IBM who have encountered a hotspot bug that surfaces
when using bitwise rotations (such as through Integer.rotateRight). I have
attached a small test program that illustrates the problem. When running
this on Power LE (I don't think that anybody tried on BE, though) the
results of the hash function are incorrect.

The bug goes away when disabling inlining. After digging through the
generated code I found out that it contained some suspicious fnmadd
instructions where you would rather expect some kind of left rotate. I
could track down that the bug was caused by the immediate value for the
right shift constant of what should be a rlwinm node to be negative and
thereby bleeding into the opcode (which unfortunately still created a valid
Power instruction, namely the fnmadd). Running with a fastdebug build
causes an assertion to fail.

The attached patch does fix the problem and so does an alternative patch
that replaces the URshift with a UShift but I am not entirely sure if this
really fixes the root cause or rather just prevents the rotlI instruction
from being matched by the ReduceInst.

--Jan.


Dr. Jan S. Rellermeyer
IBM Research
RSM - Austin Research Lab
rellermeyer_at_us.ibm.com
The University of Texas at Austin
Adjunct Assistant Professor
jrellerm_at_cs.utexas.edu

(See attached file: hash.java)(See attached file: rotl.patch)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20150508/3811e86d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hash.java
Type: application/octet-stream
Size: 4739 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20150508/3811e86d/hash-0001.java>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotl.patch
Type: application/octet-stream
Size: 890 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/ppc-aix-port-dev/attachments/20150508/3811e86d/rotl-0001.patch>


More information about the ppc-aix-port-dev mailing list