Don't change Add/Xor into Ror for constant 0

The TryReplaceWithRotateRegisterNegPattern method was providing
the wrong optimization for the constant 0. Shifting using a
negative value is odd as it only takes into account the 5 least
significant bits. This means that a shift by -31 is the same as
a shift of 1 (-30 with 2, and so on). Said method was taking
advantage of this to perform an optimization, but it failed to
realize that this doesn't work with 0. In the end, this
optimization was basically an HAdd or a HXor instruction.

As a note, it provided the right result for HOr, just because
the result of the HOr instruction would be a no-op.

Bug: 325899471
Bug: 324445644
Fixes: 325899471
Fixes: 324445644
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Iaf1385beec85d563539b99b28b5debb04c23bff8
2 files changed