aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2009-12-27 09:09:41 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-12-27 09:09:41 +0000
commitff44c2f3c80dcdec7fe1ba8853ab9c03e6e37f7e (patch)
treef77a897bc7399b4b1d69ff6d6fd28cd24b770739 /tcg/tcg.h
parentecbe1576b3287e7907b524901063a8117f544e61 (diff)
tcg: Add tcg_unsigned_cond.
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>
Diffstat (limited to 'tcg/tcg.h')
-rw-r--r--tcg/tcg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 9824493184..121b17c2b9 100644
--- 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