Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nk1GG-0003kQ-Hc for qemu-devel@nongnu.org; Tue, 23 Feb 2010 15:21:40 -0500 Received: from [199.232.76.173] (port=58303 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nk1GC-0003jm-JW for qemu-devel@nongnu.org; Tue, 23 Feb 2010 15:21:36 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nk1GB-0004DF-Sd for qemu-devel@nongnu.org; Tue, 23 Feb 2010 15:21:36 -0500 Received: from mx20.gnu.org ([199.232.41.8]:52827) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Nk1G9-0004Cd-VE for qemu-devel@nongnu.org; Tue, 23 Feb 2010 15:21:34 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nk1G8-0000Gu-PT for qemu-devel@nongnu.org; Tue, 23 Feb 2010 15:21:33 -0500 From: Nathan Froyd Date: Tue, 23 Feb 2010 12:21:31 -0800 Message-Id: <1266956491-30704-1-git-send-email-froydnj@codesourcery.com> Subject: [Qemu-devel] [PATCH] target-ppc: fix SPE evsplat* instructions List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net The shifts in the gen_evsplat* functions were expecting rA to be masked, not extracted, and so used the wrong shift amounts to sign-extend or pad with zeroes. Signed-off-by: Nathan Froyd --- target-ppc/translate.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index d4e81ce..0b11fda 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -7001,7 +7001,7 @@ static inline void gen_evmergelohi(DisasContext *ctx) } static inline void gen_evsplati(DisasContext *ctx) { - uint64_t imm = ((int32_t)(rA(ctx->opcode) << 11)) >> 27; + uint64_t imm = ((int32_t)(rA(ctx->opcode) << 27)) >> 27; #if defined(TARGET_PPC64) tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], (imm << 32) | imm); @@ -7012,7 +7012,7 @@ static inline void gen_evsplati(DisasContext *ctx) } static inline void gen_evsplatfi(DisasContext *ctx) { - uint64_t imm = rA(ctx->opcode) << 11; + uint64_t imm = rA(ctx->opcode) << 27; #if defined(TARGET_PPC64) tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], (imm << 32) | imm); -- 1.6.3.2