From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFxTz-0007Ec-EW for qemu-devel@nongnu.org; Thu, 23 Jun 2016 01:47:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFxTr-0002b9-1C for qemu-devel@nongnu.org; Thu, 23 Jun 2016 01:47:19 -0400 From: David Gibson Date: Thu, 23 Jun 2016 15:48:33 +1000 Message-Id: <1466660926-1544-5-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1466660926-1544-1-git-send-email-david@gibson.dropbear.id.au> References: <1466660926-1544-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PULL 04/17] target-ppc: Fix rlwimi, rlwinm, rlwnm again List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: agraf@suse.de, qemu-ppc@nongnu.org, pbonzini@redhat.com, qemu-devel@nongnu.org, Richard Henderson , David Gibson From: Richard Henderson In 63ae0915f8ec, I arranged to use a 32-bit rotate, without considering the effect of a mask value that wraps around to the high bits of the word. [dwg: In 2e11b15 this was partially fixed, but an edge case was still incorrect, which this fixes] Signed-off-by: Richard Henderson [dwg: Folded with a revert of 2e11b15, an earlier buggy version of this patch which already went upstream] Tested-by: Anton Blanchard Signed-off-by: David Gibson --- target-ppc/translate.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 72b67e4..395b885 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -1696,9 +1696,7 @@ static void gen_rlwinm(DisasContext *ctx) #endif mask = MASK(mb, me); - if (sh == 0) { - tcg_gen_andi_tl(t_ra, t_rs, mask); - } else if (mask <= 0xffffffffu) { + if (mask <= 0xffffffffu) { TCGv_i32 t0 = tcg_temp_new_i32(); tcg_gen_trunc_tl_i32(t0, t_rs); tcg_gen_rotli_i32(t0, t0, sh); -- 2.5.5