From patchwork Mon Sep 24 21:21:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186567 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 EFEDD2C0085 for ; Tue, 25 Sep 2012 07:22:09 +1000 (EST) Received: from localhost ([::1]:48036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGG6S-0007JM-2O for incoming@patchwork.ozlabs.org; Mon, 24 Sep 2012 17:22:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGG6D-00079b-5D for qemu-devel@nongnu.org; Mon, 24 Sep 2012 17:21:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGG6C-0000fq-7V for qemu-devel@nongnu.org; Mon, 24 Sep 2012 17:21:53 -0400 Received: from mail-qc0-f173.google.com ([209.85.216.173]:63774) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGG6C-0000fZ-3V for qemu-devel@nongnu.org; Mon, 24 Sep 2012 17:21:52 -0400 Received: by mail-qc0-f173.google.com with SMTP id b12so1466263qca.4 for ; Mon, 24 Sep 2012 14:21:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=N0uVBS/SAAtbaJTj5n9jQyD6ORDbewxr+4DGnMW38Os=; b=z96taLDDaRa0op++dF418G6R7Ahwv5d3W09FaeZdVq2vCyX5hvz3s9LbFhMmDS8LjQ Nv55Cvlh6gb251Y4lKT22rfjJ7B+Ts2zjm+bvaJkhUnBxCNq2K5NPrsHuL4gcvUtGvp6 bhDDcGY/XmSLfS2cUEuoL40FFN/AFWTw9002aG2O7fz4kZg/1tnnYFG6QSLvWVc+Xjig ZPhEK7fv5l1RhJ2CAuXynZI4+bA8ZOaUYRhEotMmE1yR+S1elkyi2KJ87DRI+iM6GPlA Xn9gG9XB5rgVL4028ACp1mAYene0xaYa6xUH8wYZmcUtaw6sTNWg0qgLHIu9t/+xD51h mqFw== Received: by 10.229.136.201 with SMTP id s9mr9902526qct.61.1348521711362; Mon, 24 Sep 2012 14:21:51 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id fl3sm26994652qab.3.2012.09.24.14.21.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 14:21:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 24 Sep 2012 14:21:39 -0700 Message-Id: <1348521701-18238-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348521701-18238-1-git-send-email-rth@twiddle.net> References: <1348521701-18238-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.216.173 Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 1/3] tcg: Add is_unsigned_cond 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 Before we rearrange the TCG_COND enumeration, add a predicate for the (single) use of comparisons vs TCGCond. Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.c | 2 +- tcg/tcg.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c index 3b90605..6e95eba 100644 --- a/tcg/s390/tcg-target.c +++ b/tcg/s390/tcg-target.c @@ -1113,7 +1113,7 @@ static void tgen64_xori(TCGContext *s, TCGReg dest, tcg_target_ulong val) static int tgen_cmp(TCGContext *s, TCGType type, TCGCond c, TCGReg r1, TCGArg c2, int c2const) { - bool is_unsigned = (c > TCG_COND_GT); + bool is_unsigned = is_unsigned_cond(c); if (c2const) { if (c2 == 0) { if (type == TCG_TYPE_I32) { diff --git a/tcg/tcg.h b/tcg/tcg.h index 48a56f0..120daab 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -298,6 +298,11 @@ static inline TCGCond tcg_unsigned_cond(TCGCond c) return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c); } +static inline bool is_unsigned_cond(TCGCond c) +{ + return c >= TCG_COND_LTU; +} + #define TEMP_VAL_DEAD 0 #define TEMP_VAL_REG 1 #define TEMP_VAL_MEM 2