]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/ppc: Fix rlwinm on ppc64
authorVitaly Chikunov <vt@altlinux.org>
Mon, 9 Mar 2020 20:45:57 +0000 (23:45 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 4 Jun 2020 00:57:29 +0000 (19:57 -0500)
commit4a9486a02d17e81a54bc4b631fec7112a1850a9d
tree2ed4979b77728bf7755001ae22079bd904d659ec
parentc44c4f7229a4c5d2d10efaede2570537cb1e3285
target/ppc: Fix rlwinm on ppc64

rlwinm cannot just AND with Mask if shift value is zero on ppc64 when
Mask Begin is greater than Mask End and high bits are set to 1.

Note that PowerISA 3.0B says that for `rlwinm' ROTL32 is used, and
ROTL32 is defined (in 3.3.14) so that rotated value should have two
copies of lower word of the source value.

This seems to be another incarnation of the fix from 820724d170
("target-ppc: Fix rlwimi, rlwinm, rlwnm again"), except I leave
optimization when Mask value is less than 32 bits.

Fixes: 7b4d326f47 ("target-ppc: Use the new deposit and extract ops")
Cc: qemu-stable@nongnu.org
Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
Message-Id: <20200309204557.14836-1-vt@altlinux.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 94f040aaecf4e41cc68991b80204b1b6886bbdd0)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target/ppc/translate.c