OSDN Git Service

tcg: Add tcg_unsigned_cond.
authorRichard Henderson <rth@twiddle.net>
Sun, 27 Dec 2009 09:09:41 +0000 (09:09 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 27 Dec 2009 09:09:41 +0000 (09:09 +0000)
Returns an unsigned version of a signed condition;
returns the original condition otherwise.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tcg/tcg.h

index 9824493..121b17c 100644 (file)
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -205,6 +205,11 @@ typedef enum {
     TCG_COND_GTU,
 } TCGCond;
 
+static inline TCGCond tcg_unsigned_cond(TCGCond c)
+{
+    return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c);
+}
+
 #define TEMP_VAL_DEAD  0
 #define TEMP_VAL_REG   1
 #define TEMP_VAL_MEM   2