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>
This commit is contained in:
Richard Henderson authored and Aurelien Jarno committed 2010-02-06 17:14:24 +01:00
1 parent be210acb41
commit 401d466da9
1 file changed
+5
+5
View File
@@ -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);