From patchwork Thu Sep 4 17:20:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 385970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8637A140110 for ; Fri, 5 Sep 2014 03:48:19 +1000 (EST) Received: from localhost ([::1]:53118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPb8r-0002g3-5K for incoming@patchwork.ozlabs.org; Thu, 04 Sep 2014 13:48:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPaiW-0004O5-0y for qemu-devel@nongnu.org; Thu, 04 Sep 2014 13:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPaiF-0005p0-Ns for qemu-devel@nongnu.org; Thu, 04 Sep 2014 13:21:03 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43889 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPaiF-0005gl-1d; Thu, 04 Sep 2014 13:20:47 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3F6CEAD97; Thu, 4 Sep 2014 17:20:46 +0000 (UTC) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Thu, 4 Sep 2014 19:20:33 +0200 Message-Id: <1409851240-48126-46-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1409851240-48126-1-git-send-email-agraf@suse.de> References: <1409851240-48126-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, Tom Musta Subject: [Qemu-devel] [PULL 45/52] target-ppc: Optimize rlwinm MB=0 ME=31 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Tom Musta Optimize the special case of rlwinm where MB=0 and ME=31. This can be implemented as a 32-bit ROTL. Signed-off-by: Tom Musta Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Alexander Graf --- target-ppc/translate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 095b83c..889e37d 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -1691,6 +1691,12 @@ static void gen_rlwinm(DisasContext *ctx) tcg_gen_shri_tl(t0, t0, mb); tcg_gen_ext32u_tl(cpu_gpr[rA(ctx->opcode)], t0); tcg_temp_free(t0); + } else if (likely(mb == 0 && me == 31)) { + TCGv_i32 t0 = tcg_temp_new_i32(); + tcg_gen_trunc_tl_i32(t0, cpu_gpr[rS(ctx->opcode)]); + tcg_gen_rotli_i32(t0, t0, sh); + tcg_gen_extu_i32_tl(cpu_gpr[rA(ctx->opcode)], t0); + tcg_temp_free_i32(t0); } else { TCGv t0 = tcg_temp_new(); #if defined(TARGET_PPC64)