aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2010-01-07 10:15:20 -0800
committerAurelien Jarno <aurelien@aurel32.net>2010-02-06 17:14:24 +0100
commit401d466da9dccf9bc6653ca30efdbd451c8d9190 (patch)
tree4e67ccbb1317f90094031a97e1b47dc83016dc16 /tcg/tcg.h
parentbe210acb412c30f4264509810fed4de664d35e7d (diff)
downloadqemu-401d466da9dccf9bc6653ca30efdbd451c8d9190.zip
qemu-401d466da9dccf9bc6653ca30efdbd451c8d9190.tar.gz
qemu-401d466da9dccf9bc6653ca30efdbd451c8d9190.tar.bz2
tcg: add tcg_invert_cond
It is very handy to have a reliable mapping of a condition to its inverse. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'tcg/tcg.h')
-rw-r--r--tcg/tcg.h5
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);