From patchwork Fri May 27 03:04:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9137589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A7CE26075A for ; Fri, 27 May 2016 03:10:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB4F25D97 for ; Fri, 27 May 2016 03:10:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9043F281C2; Fri, 27 May 2016 03:10:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 42A8B25D97 for ; Fri, 27 May 2016 03:10:04 +0000 (UTC) Received: from localhost ([::1]:41449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b689z-0002Tp-9L for patchwork-qemu-devel@patchwork.kernel.org; Thu, 26 May 2016 23:10:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b685J-0006vn-1A for qemu-devel@nongnu.org; Thu, 26 May 2016 23:05:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b685C-0003Mp-RN for qemu-devel@nongnu.org; Thu, 26 May 2016 23:05:11 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:58721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b685C-0003Jn-GN; Thu, 26 May 2016 23:05:06 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3rG9qK58Tqz9s8d; Fri, 27 May 2016 13:05:01 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1464318301; bh=yyitk+N9a+44sibxAmB8y5EpK3imcmea+ru1TjR/24U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VkGH0YNPMrXguFeq8kt9L2CVXg6buNflH+v+Wt1sb5R9xoiywiHylIzpE4r7wtGti RK9AK8AnYLOltW77Ddgo/4WxI8PbhoYttbXbYDAmhBbXzB1LzBiarIrD/cOpSDMfQS Ez3Fk6VgdCh19rlPdct8NkknjD553c2WhxSCnO0k= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 27 May 2016 13:04:47 +1000 Message-Id: <1464318298-2456-3-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464318298-2456-1-git-send-email-david@gibson.dropbear.id.au> References: <1464318298-2456-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 02/13] target-ppc: Use movcond in isel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , qemu-ppc@nongnu.org, agraf@suse.de, David Gibson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: David Gibson --- target-ppc/translate.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 745f4de..3ea6625 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -756,27 +756,20 @@ static void gen_cmpli(DisasContext *ctx) /* isel (PowerPC 2.03 specification) */ static void gen_isel(DisasContext *ctx) { - TCGLabel *l1, *l2; uint32_t bi = rC(ctx->opcode); - uint32_t mask; - TCGv_i32 t0; + uint32_t mask = 0x08 >> (bi & 0x03); + TCGv t0 = tcg_temp_new(); + TCGv zr; - l1 = gen_new_label(); - l2 = gen_new_label(); + tcg_gen_extu_i32_tl(t0, cpu_crf[bi >> 2]); + tcg_gen_andi_tl(t0, t0, mask); - mask = 0x08 >> (bi & 0x03); - t0 = tcg_temp_new_i32(); - tcg_gen_andi_i32(t0, cpu_crf[bi >> 2], mask); - tcg_gen_brcondi_i32(TCG_COND_EQ, t0, 0, l1); - if (rA(ctx->opcode) == 0) - tcg_gen_movi_tl(cpu_gpr[rD(ctx->opcode)], 0); - else - tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rA(ctx->opcode)]); - tcg_gen_br(l2); - gen_set_label(l1); - tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_gpr[rB(ctx->opcode)]); - gen_set_label(l2); - tcg_temp_free_i32(t0); + zr = tcg_const_tl(0); + tcg_gen_movcond_tl(TCG_COND_NE, cpu_gpr[rD(ctx->opcode)], t0, zr, + rA(ctx->opcode) ? cpu_gpr[rA(ctx->opcode)] : zr, + cpu_gpr[rB(ctx->opcode)]); + tcg_temp_free(zr); + tcg_temp_free(t0); } /* cmpb: PowerPC 2.05 specification */