diff mbox series

[PULL,6/8] tcg: Add tcg_signed_cond

Message ID 20171229193113.11753-7-richard.henderson@linaro.org
State Accepted
Commit 923ed1750186591b04d7d61399f6d68b4e0608f2
Headers show
Series tcg queued patches | expand

Commit Message

Richard Henderson Dec. 29, 2017, 7:31 p.m. UTC
Complimenting the existing tcg_unsigned_cond.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 tcg/tcg.h | 6 ++++++
 1 file changed, 6 insertions(+)

-- 
2.14.3
diff mbox series

Patch

diff --git a/tcg/tcg.h b/tcg/tcg.h
index f25efa9795..8c45f7edbc 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -488,6 +488,12 @@  static inline TCGCond tcg_unsigned_cond(TCGCond c)
     return c & 2 ? (TCGCond)(c ^ 6) : c;
 }
 
+/* Create a "signed" version of an "unsigned" comparison.  */
+static inline TCGCond tcg_signed_cond(TCGCond c)
+{
+    return c & 4 ? (TCGCond)(c ^ 6) : c;
+}
+
 /* Must a comparison be considered unsigned?  */
 static inline bool is_unsigned_cond(TCGCond c)
 {