tcg: Add is_unsigned_cond
authorRichard Henderson <rth@twiddle.net>
Mon, 24 Sep 2012 21:21:39 +0000 (14:21 -0700)
committerAurelien Jarno <aurelien@aurel32.net>
Sat, 6 Oct 2012 16:48:39 +0000 (18:48 +0200)
Before we rearrange the TCG_COND enumeration, add a predicate for
the (single) use of comparisons vs TCGCond.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
tcg/s390/tcg-target.c
tcg/tcg.h

index 4b43059..c0ef6ba 100644 (file)
@@ -1113,7 +1113,7 @@ static void tgen64_xori(TCGContext *s, TCGReg dest, tcg_target_ulong val)
 static int tgen_cmp(TCGContext *s, TCGType type, TCGCond c, TCGReg r1,
                     TCGArg c2, int c2const)
 {
-    bool is_unsigned = (c > TCG_COND_GT);
+    bool is_unsigned = is_unsigned_cond(c);
     if (c2const) {
         if (c2 == 0) {
             if (type == TCG_TYPE_I32) {
index af7464a..6ff2ab5 100644 (file)
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -298,6 +298,11 @@ static inline TCGCond tcg_unsigned_cond(TCGCond c)
     return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c);
 }
 
+static inline bool is_unsigned_cond(TCGCond c)
+{
+    return c >= TCG_COND_LTU;
+}
+
 #define TEMP_VAL_DEAD  0
 #define TEMP_VAL_REG   1
 #define TEMP_VAL_MEM   2