From patchwork Sat Dec 19 18:44:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 41469 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 26D0BB6F19 for ; Sun, 20 Dec 2009 06:01:50 +1100 (EST) Received: from localhost ([127.0.0.1]:36239 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NM4Ym-0003CH-7A for incoming@patchwork.ozlabs.org; Sat, 19 Dec 2009 14:01:48 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NM4SS-00012K-Vi for qemu-devel@nongnu.org; Sat, 19 Dec 2009 13:55:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NM4SP-0000zx-7G for qemu-devel@nongnu.org; Sat, 19 Dec 2009 13:55:14 -0500 Received: from [199.232.76.173] (port=56813 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NM4SO-0000zg-T8 for qemu-devel@nongnu.org; Sat, 19 Dec 2009 13:55:12 -0500 Received: from are.twiddle.net ([75.149.56.221]:32983) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NM4SN-0005Fz-Oz for qemu-devel@nongnu.org; Sat, 19 Dec 2009 13:55:12 -0500 Received: by are.twiddle.net (Postfix, from userid 5000) id E9BBBA32; Sat, 19 Dec 2009 10:55:09 -0800 (PST) Message-Id: In-Reply-To: References: From: Richard Henderson Date: Sat, 19 Dec 2009 10:44:52 -0800 To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: aurelien@aurel32.net Subject: [Qemu-devel] [PATCH 4/5] tcg: Add tcg_invert_cond. 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 It is very handy to have a reliable mapping of a condition to its inverse. Signed-off-by: Richard Henderson Acked-by: Aurelien Jarno --- tcg/tcg.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index 9824493..376d6af 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -205,6 +205,11 @@ typedef enum { TCG_COND_GTU, } TCGCond; +static inline TCGCond tcg_invert_cond(TCGCond c) +{ + return (TCGCond)(c ^ 1); +} + #define TEMP_VAL_DEAD 0 #define TEMP_VAL_REG 1 #define TEMP_VAL_MEM 2