From patchwork Tue Feb 23 20:21:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 46097 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D6EF8B7CE6 for ; Wed, 24 Feb 2010 07:23:01 +1100 (EST) Received: from localhost ([127.0.0.1]:59752 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nk1HU-000415-NH for incoming@patchwork.ozlabs.org; Tue, 23 Feb 2010 15:22:56 -0500 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 Received: (qmail 22138 invoked from network); 23 Feb 2010 20:21:31 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Feb 2010 20:21:31 -0000 From: Nathan Froyd To: qemu-devel@nongnu.org Date: Tue, 23 Feb 2010 12:21:31 -0800 Message-Id: <1266956491-30704-1-git-send-email-froydnj@codesourcery.com> X-Mailer: git-send-email 1.6.3.2 X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH] target-ppc: fix SPE evsplat* instructions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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);