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: 49666 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 5FBA0B7C67 for ; Thu, 8 Apr 2010 09:11:31 +1000 (EST) Received: from localhost ([127.0.0.1]:50490 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NzeAe-0007PN-Iw for incoming@patchwork.ozlabs.org; Wed, 07 Apr 2010 18:56:28 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nze3X-0005Jr-Pz for qemu-devel@nongnu.org; Wed, 07 Apr 2010 18:49:07 -0400 Received: from [140.186.70.92] (port=37902 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nze3T-0005Ip-BG for qemu-devel@nongnu.org; Wed, 07 Apr 2010 18:49:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nze3Q-0003hY-5o for qemu-devel@nongnu.org; Wed, 07 Apr 2010 18:49:03 -0400 Received: from are.twiddle.net ([75.149.56.221]:44522) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nze3Q-0003h8-0U for qemu-devel@nongnu.org; Wed, 07 Apr 2010 18:49:00 -0400 Received: by are.twiddle.net (Postfix, from userid 5000) id 3AF70DD3; Wed, 7 Apr 2010 15:48:56 -0700 (PDT) Message-Id: <0f0bca19e91dc77b9114042e12626b3bd087dc0b.1270680209.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 eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 06/13] 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 dff03ef..adeff0a 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -1290,33 +1290,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)