From patchwork Sat Dec 19 20:24:20 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 41472 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 C166EB6F18 for ; Sun, 20 Dec 2009 08:20:24 +1100 (EST) Received: from localhost ([127.0.0.1]:36515 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NM6iq-0006fh-FG for incoming@patchwork.ozlabs.org; Sat, 19 Dec 2009 16:20:20 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NM6iL-0006eh-FU for qemu-devel@nongnu.org; Sat, 19 Dec 2009 16:19:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NM6iJ-0006dR-RU for qemu-devel@nongnu.org; Sat, 19 Dec 2009 16:19:48 -0500 Received: from [199.232.76.173] (port=49347 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NM6iJ-0006dE-Kw for qemu-devel@nongnu.org; Sat, 19 Dec 2009 16:19:47 -0500 Received: from are.twiddle.net ([75.149.56.221]:45155) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NM6iI-0000g6-MD for qemu-devel@nongnu.org; Sat, 19 Dec 2009 16:19:46 -0500 Received: by are.twiddle.net (Postfix, from userid 5000) id 24EA8A46; Sat, 19 Dec 2009 13:19:45 -0800 (PST) Message-Id: <640a13a7bc3a377ada192374fcb2de2d3a80d383.1261256927.git.rth@twiddle.net> In-Reply-To: References: From: Richard Henderson Date: Sat, 19 Dec 2009 12:24:20 -0800 To: qemu-devel@nongnu.org X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH 5/6] tcg: Add tcg_unsigned_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 Returns an unsigned version of a signed condition; returns the original condition otherwise. --- tcg/tcg.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tcg/tcg.h b/tcg/tcg.h index 376d6af..b218abe 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -210,6 +210,11 @@ static inline TCGCond tcg_invert_cond(TCGCond c) return (TCGCond)(c ^ 1); } +static inline TCGCond tcg_unsigned_cond(TCGCond c) +{ + return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c); +} + #define TEMP_VAL_DEAD 0 #define TEMP_VAL_REG 1 #define TEMP_VAL_MEM 2