qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/6] tcg: Add tcg_invert_cond.


From: Richard Henderson
Subject: [Qemu-devel] [PATCH 3/6] tcg: Add tcg_invert_cond.
Date: Thu, 7 Jan 2010 10:46:58 -0800

It is very handy to have a reliable mapping of a condition to its inverse.

Signed-off-by: Richard Henderson <address@hidden>
---
 tcg/tcg.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 121b17c..b218abe 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);
+}
+
 static inline TCGCond tcg_unsigned_cond(TCGCond c)
 {
     return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c);
-- 
1.6.5.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]