RFR(S): 8080190: PPC64: Fix wrong rotate instructions in the .ad file

Volker Simonis volker.simonis at gmail.com
Wed May 13 16:29:27 UTC 2015


Hi,

could you please review the following, ppc64-only fix which solves a
problem with the integer-rotate instructions in C2:

https://bugs.openjdk.java.net/browse/JDK-8080190
http://cr.openjdk.java.net/~simonis/webrevs/2015/8080190.v2/

The problem was that we initially took the "rotate left/right by 8-bit
immediate" instructions from x86_64. But on x86_64 the rotate
instructions for 32-bit integers do in fact really take 8-bit
immediates (seems like the Intel guys had to many spare bits when they
designed their instruction set :) On the other hand, the rotate
instructions on Power only use 5 bit to encode the rotation distance.

We do check for this limit, but only in the debug build so you'll see
an assertion there, but in the product build we will silently emit a
wrong instruction which can lead to anything starting from a crash up
to an incorrect computation.

I think the simplest solution for this problem is to mask the
rotation distance with 0x1f  (which is equivalent to taking the
distance modulo 32) in the corresponding instructions.

This change should also be backported to 8 as fast as possible. Notice
that this a day-zero bug in our ppc64 port because in our internal SAP
JVM we already mask the shift amounts in the ideal graph but for some
unknown reasons these shared changes haven’t been contributed along
with our port.

Thank you and best regards,
Volker


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