From patchwork Wed Feb 20 07:52:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 221983 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 13EB92C007E for ; Wed, 20 Feb 2013 19:08:54 +1100 (EST) Received: from localhost ([::1]:53697 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U84jU-0005W3-0y for incoming@patchwork.ozlabs.org; Wed, 20 Feb 2013 03:08:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U84Ul-0001nN-RN for qemu-devel@nongnu.org; Wed, 20 Feb 2013 02:53:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U84Ue-0002Lo-8u for qemu-devel@nongnu.org; Wed, 20 Feb 2013 02:53:39 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:56521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U84Ue-0002Lj-2i for qemu-devel@nongnu.org; Wed, 20 Feb 2013 02:53:32 -0500 Received: by mail-pa0-f54.google.com with SMTP id fa10so3843881pad.13 for ; Tue, 19 Feb 2013 23:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=2Vmf3/Er6UiJDE6Eijqop15vm+tTBq8oatsgK0z7EYs=; b=yoXPEUOtRrmrFW/TVzOglpieelWTTfnWRkqLS+xZJ/eZLjGyiOv6JqruowSI2NpWeJ DFD5+MzwYQBGw3wx2PupryMXuJmn78zFlKJ8h2yMbuKR+eKHa6Mo9lVETeSCf3DKWUBm L23q2Ciw++Br5/PySm5zuaHop+YCU1J4XAHlspFK6OyHgoY91tpQgw0/eVhw2JG3bz0l IQ/gv0euEw+aAG7zTx27RxDMrIp9nLw1GpYQLGoxQleiljZN4xppU298vYqP2UyIbWJh YU9fnPLGF/f5FCCt3NExlDFIHjtYURfy9Byet0oUOuMqdZ/Cf1q6Rk+TB0TCWJPl9HpU y0CQ== X-Received: by 10.68.136.42 with SMTP id px10mr27683261pbb.32.1361346811333; Tue, 19 Feb 2013 23:53:31 -0800 (PST) Received: from anchor.twiddle.net (50-194-63-110-static.hfc.comcastbusiness.net. [50.194.63.110]) by mx.google.com with ESMTPS id c8sm20826347pbq.10.2013.02.19.23.53.29 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 19 Feb 2013 23:53:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 19 Feb 2013 23:52:20 -0800 Message-Id: <1361346746-8511-33-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1361346746-8511-1-git-send-email-rth@twiddle.net> References: <1361346746-8511-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.220.54 Cc: blauwirbel@gmail.com, Alexander Graf , aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 32/38] target-ppc: Compute mullwo without branches 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 Cc: Alexander Graf Signed-off-by: Richard Henderson --- target-ppc/translate.c | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 4311119..f886441 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -1036,35 +1036,21 @@ static void gen_mullw(DisasContext *ctx) /* mullwo mullwo. */ static void gen_mullwo(DisasContext *ctx) { - int l1; - TCGv_i64 t0, t1; + TCGv_i32 t0 = tcg_temp_new_i32(); + TCGv_i32 t1 = tcg_temp_new_i32(); - t0 = tcg_temp_new_i64(); - t1 = tcg_temp_new_i64(); - l1 = gen_new_label(); - /* Start with XER OV disabled, the most likely case */ - tcg_gen_movi_tl(cpu_ov, 0); -#if defined(TARGET_PPC64) - tcg_gen_ext32s_i64(t0, cpu_gpr[rA(ctx->opcode)]); - tcg_gen_ext32s_i64(t1, cpu_gpr[rB(ctx->opcode)]); -#else - tcg_gen_ext_tl_i64(t0, cpu_gpr[rA(ctx->opcode)]); - tcg_gen_ext_tl_i64(t1, cpu_gpr[rB(ctx->opcode)]); -#endif - tcg_gen_mul_i64(t0, t0, t1); -#if defined(TARGET_PPC64) - tcg_gen_ext32s_i64(cpu_gpr[rD(ctx->opcode)], t0); - tcg_gen_brcond_i64(TCG_COND_EQ, t0, cpu_gpr[rD(ctx->opcode)], l1); -#else - tcg_gen_trunc_i64_tl(cpu_gpr[rD(ctx->opcode)], t0); - tcg_gen_ext32s_i64(t1, t0); - tcg_gen_brcond_i64(TCG_COND_EQ, t0, t1, l1); -#endif - tcg_gen_movi_tl(cpu_ov, 1); - tcg_gen_movi_tl(cpu_so, 1); - gen_set_label(l1); - tcg_temp_free_i64(t0); - tcg_temp_free_i64(t1); + tcg_gen_trunc_tl_i32(t0, cpu_gpr[rA(ctx->opcode)]); + tcg_gen_trunc_tl_i32(t1, cpu_gpr[rB(ctx->opcode)]); + tcg_gen_muls2_i32(t0, t1, t0, t1); + tcg_gen_ext_i32_tl(cpu_gpr[rD(ctx->opcode)], t0); + + tcg_gen_sari_i32(t0, t0, 31); + tcg_gen_setcond_i32(TCG_COND_NE, t0, t0, t1); + tcg_gen_extu_i32_tl(cpu_ov, t0); + tcg_gen_or_tl(cpu_so, cpu_so, cpu_ov); + + tcg_temp_free_i32(t0); + tcg_temp_free_i32(t1); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx, cpu_gpr[rD(ctx->opcode)]); }