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 2010-01-07 10:15:20 -08:00 committed by Aurelien Jarno
parent be210acb41
commit 401d466da9

View File

@ -205,6 +205,11 @@ typedef enum {
TCG_COND_GTU, TCG_COND_GTU,
} TCGCond; } TCGCond;
static inline TCGCond tcg_invert_cond(TCGCond c)
{
return (TCGCond)(c ^ 1);
}
static inline TCGCond tcg_unsigned_cond(TCGCond c) static inline TCGCond tcg_unsigned_cond(TCGCond c)
{ {
return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c); return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c);