From patchwork Tue Mar 16 20:04:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 47984 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 524B5B7D0B for ; Thu, 18 Mar 2010 12:08:59 +1100 (EST) Received: from localhost ([127.0.0.1]:56343 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ns47a-00069j-3A for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2010 21:01:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ns3t0-000063-ML for qemu-devel@nongnu.org; Wed, 17 Mar 2010 20:46:54 -0400 Received: from [199.232.76.173] (port=52451 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ns3sx-0008VW-RR for qemu-devel@nongnu.org; Wed, 17 Mar 2010 20:46:51 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Ns3sw-0000HQ-3q for qemu-devel@nongnu.org; Wed, 17 Mar 2010 20:46:51 -0400 Received: from are.twiddle.net ([75.149.56.221]:38372) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ns3st-0000HB-OZ for qemu-devel@nongnu.org; Wed, 17 Mar 2010 20:46:47 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id 549EAB0B; Wed, 17 Mar 2010 17:46:45 -0700 (PDT) Message-Id: <6c7d8fcd9a1bbf08415d4f8c7f5b33fb9c22b750.1268868813.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Tue, 16 Mar 2010 13:04:34 -0700 To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 6/8] target-alpha: Use setcond for int comparisons. 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 Signed-off-by: Richard Henderson --- target-alpha/translate.c | 43 ++++++++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 21 deletions(-) diff --git a/target-alpha/translate.c b/target-alpha/translate.c index c52cac3..3fa32b3 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -1288,33 +1288,34 @@ MVIOP2(pkwb) MVIOP2(unpkbl) MVIOP2(unpkbw) -static inline void gen_cmp(TCGCond cond, int ra, int rb, int rc, int islit, - uint8_t lit) +static void gen_cmp(TCGCond cond, int ra, int rb, int rc, + int islit, uint8_t lit) { - int l1, l2; - TCGv tmp; + TCGv va, vb; - if (unlikely(rc == 31)) + if (unlikely(rc == 31)) { return; + } - l1 = gen_new_label(); - l2 = gen_new_label(); + if (ra == 31) { + va = tcg_const_i64(0); + } else { + va = cpu_ir[ra]; + } + if (islit) { + vb = tcg_const_i64(lit); + } else { + vb = cpu_ir[rb]; + } - if (ra != 31) { - tmp = tcg_temp_new(); - tcg_gen_mov_i64(tmp, cpu_ir[ra]); - } else - tmp = tcg_const_i64(0); - if (islit) - tcg_gen_brcondi_i64(cond, tmp, lit, l1); - else - tcg_gen_brcond_i64(cond, tmp, cpu_ir[rb], l1); + tcg_gen_setcond_i64(cond, cpu_ir[rc], va, vb); - tcg_gen_movi_i64(cpu_ir[rc], 0); - tcg_gen_br(l2); - gen_set_label(l1); - tcg_gen_movi_i64(cpu_ir[rc], 1); - gen_set_label(l2); + if (ra == 31) { + tcg_temp_free(va); + } + if (islit) { + tcg_temp_free(vb); + } } static void gen_rx(int ra, int set)