From: Richard Henderson Date: Thu, 7 Jan 2010 18:15:20 +0000 (-0800) Subject: tcg: add tcg_invert_cond X-Git-Tag: v0.13.0-rc0~1493 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=401d466da9dccf9bc6653ca30efdbd451c8d9190;p=thirdparty%2Fqemu.git 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 Signed-off-by: Aurelien Jarno --- diff --git a/tcg/tcg.h b/tcg/tcg.h index 121b17c2b90..b218abeaf28 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);