From patchwork Sat Dec 21 16:59:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 304427 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 39D2E2C009C for ; Sun, 22 Dec 2013 04:02:57 +1100 (EST) Received: from localhost ([::1]:54840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuPx0-0002E4-BS for incoming@patchwork.ozlabs.org; Sat, 21 Dec 2013 12:02:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuPtg-0006Na-BD for qemu-devel@nongnu.org; Sat, 21 Dec 2013 11:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VuPtY-0002Qs-IT for qemu-devel@nongnu.org; Sat, 21 Dec 2013 11:59:28 -0500 Received: from hall.aurel32.net ([2001:bc8:30d7:101::1]:46549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VuPtY-0002QQ-Bm for qemu-devel@nongnu.org; Sat, 21 Dec 2013 11:59:20 -0500 Received: from pc-97-206-86-200.cm.vtr.net ([200.86.206.97] helo=ohm.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1VuPtW-0005I0-FV; Sat, 21 Dec 2013 17:59:18 +0100 Received: from aurel32 by ohm.rr44.fr with local (Exim 4.80) (envelope-from ) id 1VuPtM-0003Tv-NP; Sat, 21 Dec 2013 17:59:08 +0100 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Sat, 21 Dec 2013 17:59:00 +0100 Message-Id: <1387645145-13069-4-git-send-email-aurelien@aurel32.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387645145-13069-1-git-send-email-aurelien@aurel32.net> References: <1387645145-13069-1-git-send-email-aurelien@aurel32.net> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:bc8:30d7:101::1 Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 3/8] target-sh4: optimize addc using add2 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 Signed-off-by: Aurelien Jarno --- target-sh4/translate.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/target-sh4/translate.c b/target-sh4/translate.c index d816936..17b4abe 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -639,17 +639,15 @@ static void _decode_opc(DisasContext * ctx) return; case 0x300e: /* addc Rm,Rn */ { - TCGv t0, t1; - t0 = tcg_temp_new(); + TCGv t0, t1, t2; + t0 = tcg_const_tl(0); t1 = tcg_temp_new(); - tcg_gen_add_i32(t0, REG(B7_4), REG(B11_8)); - tcg_gen_add_i32(t1, cpu_sr_t, t0); - tcg_gen_setcond_i32(TCG_COND_GTU, cpu_sr_t, REG(B11_8), t0); - tcg_gen_setcond_i32(TCG_COND_GTU, t0, t0, t1); - tcg_gen_or_i32(cpu_sr_t, cpu_sr_t, t0); + t2 = tcg_temp_new(); + tcg_gen_add2_i32(t1, t2, REG(B11_8), t0, REG(B7_4), t0); + tcg_gen_add2_i32(REG(B11_8), cpu_sr_t, t1, t2, cpu_sr_t, t0); tcg_temp_free(t0); - tcg_gen_mov_i32(REG(B11_8), t1); tcg_temp_free(t1); + tcg_temp_free(t2); } return; case 0x300f: /* addv Rm,Rn */