target-ppc: Bug Fix: rlwnm
commit1c0a150f4bb60ce9af7b4b10f0deabdea1b22f93
authorTom Musta <tommusta@gmail.com>
Tue, 12 Aug 2014 13:45:04 +0000 (12 08:45 -0500)
committerAlexander Graf <agraf@suse.de>
Mon, 8 Sep 2014 10:50:50 +0000 (8 12:50 +0200)
tree6f12b6b20b0a84d788726b4c18676f9926c2e56d
parenta7f23d0f8bfbe76864a6427c0e21fe794ab9b7ef
target-ppc: Bug Fix: rlwnm

The rlwnm specification includes the ROTL32 operation, which is defined
to be a left rotation of two copies of the least significant 32 bits of
the source GPR.

The current implementation is incorrect on 64-bit implementations in that
it rotates a single copy of the least significant 32 bits, padding with
zeroes in the most significant bits.

Fix the code to properly implement this ROTL32 operation.

Example:

R3 = 0000000000000002
R4 = 7FFFFFFFFFFFFFFF
rlwnm 3,3,4,31,16
R3 expected : 0000000100000001
R3 actual   : 0000000000000001 (without this patch)

Signed-off-by: Tom Musta <tommusta@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-ppc/translate.c