From patchwork Sat Dec 19 18:44:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [4/5] tcg: Add tcg_invert_cond. Date: Sat, 19 Dec 2009 08:44:52 -0000 From: Richard Henderson X-Patchwork-Id: 41469 Message-Id: To: qemu-devel@nongnu.org Cc: aurelien@aurel32.net 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