Message ID | 3c054d6ab4be20981dc0087da4f580035b08ae4c.1261260692.git.rth@twiddle.net |
---|---|
State | New |
Headers | show |
diff --git a/tcg/tcg.h b/tcg/tcg.h index 376d6af..ac38390 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -205,11 +205,19 @@ typedef enum { TCG_COND_GTU, } TCGCond; +/* Invert the sense of the comparison. */ static inline TCGCond tcg_invert_cond(TCGCond c) { return (TCGCond)(c ^ 1); } +/* Swap the operands in a comparison. */ +static inline TCGCond tcg_swap_cond(TCGCond c) +{ + int mask = (c < TCG_COND_LT ? 0 : c < TCG_COND_LTU ? 7 : 15); + return (TCGCond)(c ^ mask); +} + #define TEMP_VAL_DEAD 0 #define TEMP_VAL_REG 1 #define TEMP_VAL_MEM 2