target/s390x: Fix shifting 32-bit values for more than 31 bits
commit6da170beda33f3e7f1d9242814acd9f428f0f0fb
authorIlya Leoshkevich <iii@linux.ibm.com>
Wed, 12 Jan 2022 16:50:15 +0000 (12 17:50 +0100)
committerThomas Huth <thuth@redhat.com>
Mon, 17 Jan 2022 07:36:33 +0000 (17 08:36 +0100)
tree2c7f85c0db55a58be39a94a9ecd9467d7bf79ea8
parentdf103c09bc2f549d36ba6313a69c18fc003ef1ee
target/s390x: Fix shifting 32-bit values for more than 31 bits

According to PoP, both 32- and 64-bit shifts use lowest 6 address
bits. The current code special-cases 32-bit shifts to use only 5 bits,
which is not correct. For example, shifting by 32 bits currently
preserves the initial value, however, it's supposed zero it out
instead.

Fix by merging sh32 and sh64 and adapting CC calculation to shift
values greater than 31.

Fixes: cbe24bfa91d2 ("target-s390: Convert SHIFT, ROTATE SINGLE")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20220112165016.226996-5-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
target/s390x/cpu-dump.c
target/s390x/s390x-internal.h
target/s390x/tcg/cc_helper.c
target/s390x/tcg/insn-data.def
target/s390x/tcg/translate.c