Patchwork [5/6] tcg: Add tcg_unsigned_cond.

login
register
mail settings
Submitter Richard Henderson
Date Dec. 19, 2009, 8:24 p.m.
Message ID <640a13a7bc3a377ada192374fcb2de2d3a80d383.1261256927.git.rth@twiddle.net>
Download mbox | patch
Permalink /patch/41472/
State New
Headers show

Comments

Richard Henderson - Dec. 19, 2009, 8:24 p.m.
Returns an unsigned version of a signed condition;
returns the original condition otherwise.
---
 tcg/tcg.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index 376d6af..b218abe 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -210,6 +210,11 @@  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);
+}
+
 #define TEMP_VAL_DEAD  0
 #define TEMP_VAL_REG   1
 #define TEMP_VAL_MEM   2