RFR: 8257182: JCK test failures in integer / long rotation tests

Christian Hagedorn chagedorn at openjdk.java.net
Thu Dec 3 10:56:00 UTC 2020


On Wed, 2 Dec 2020 15:45:13 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> The `RotateLeftNode::Value()` and `RotateRightNode::Value()` methods use an arithmetic instead of a logical shift due to applying the shift operator `>>` to a signed instead of an unsigned number. When, for example, rotating a negative even integer (least significant bit is 0) to the right, we should always get a positive number (most significant bit becoming 0). However, the arithmetic shift keeps the integer being negative. This lets some JCK rotation tests fail with -Xcomp.
>> 
>> The previously failing JCK tests work again with -Xcomp by applying this fix.
>> 
>> Thanks,
>> Christian
>
> Looks great! Thanks for fixing it and adding a regression test.

@TheRealMDoerr @vnkozlov Thanks for your reviews!

-------------

PR: https://git.openjdk.java.net/jdk/pull/1562


More information about the hotspot-compiler-dev mailing list