From patchwork Fri Jan 7 22:43:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 77925 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 11623B70DF for ; Sat, 8 Jan 2011 09:47:49 +1100 (EST) Received: from localhost ([127.0.0.1]:56130 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbL62-0003Nd-8A for incoming@patchwork.ozlabs.org; Fri, 07 Jan 2011 17:47:46 -0500 Received: from [140.186.70.92] (port=48784 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PbL36-0001he-L4 for qemu-devel@nongnu.org; Fri, 07 Jan 2011 17:44:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PbL1p-0003Mc-BA for qemu-devel@nongnu.org; Fri, 07 Jan 2011 17:43:27 -0500 Received: from a.mail.sonic.net ([64.142.16.245]:46711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PbL1o-0003MR-Tv for qemu-devel@nongnu.org; Fri, 07 Jan 2011 17:43:25 -0500 Received: from are.twiddle.net (are.twiddle.net [75.101.38.216]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id p07Mh8wk001801 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Jan 2011 14:43:08 -0800 Received: from are.twiddle.net (localhost [127.0.0.1]) by are.twiddle.net (8.14.4/8.14.4) with ESMTP id p07Mh7XG000963; Fri, 7 Jan 2011 14:43:07 -0800 Received: (from rth@localhost) by are.twiddle.net (8.14.4/8.14.4/Submit) id p07Mh7iu000962; Fri, 7 Jan 2011 14:43:07 -0800 From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 7 Jan 2011 14:43:03 -0800 Message-Id: <1294440183-885-8-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1294440183-885-1-git-send-email-rth@twiddle.net> References: <1294440183-885-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: Alexander Graf , Aurelien Jarno Subject: [Qemu-devel] [PATCH 7/7] target-ppc: Use deposit operation. 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 Use this in implementing rl[wd]imi, at least for the cases that don't require true rotation. Signed-off-by: Richard Henderson --- target-ppc/translate.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 74e06d7..f45c0ec 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -1516,6 +1516,11 @@ static void gen_rlwimi(DisasContext *ctx) sh = SH(ctx->opcode); if (likely(sh == 0 && mb == 0 && me == 31)) { tcg_gen_ext32u_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]); + } else if ((31 - me) == sh && mb <= me) { + /* This is a well-behaved bitfield deposit. */ + tcg_gen_deposit_tl (cpu_gpr[rA(ctx->opcode)], + cpu_gpr[rA(ctx->opcode)], + cpu_gpr[rS(ctx->opcode)], sh, me - mb + 1); } else { target_ulong mask; TCGv t1; @@ -1761,6 +1766,11 @@ static inline void gen_rldimi(DisasContext *ctx, int mbn, int shn) me = 63 - sh; if (unlikely(sh == 0 && mb == 0)) { tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_gpr[rS(ctx->opcode)]); + } else if (mb <= me) { + /* This is a well-behaved bitfield deposit. */ + tcg_gen_deposit_tl (cpu_gpr[rA(ctx->opcode)], + cpu_gpr[rA(ctx->opcode)], + cpu_gpr[rS(ctx->opcode)], sh, me - mb + 1); } else { TCGv t0, t1; target_ulong mask;