OSDN Git Service

tcg: Add tcg_signed_cond
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 20 Nov 2017 13:47:02 +0000 (14:47 +0100)
committerRichard Henderson <richard.henderson@linaro.org>
Fri, 29 Dec 2017 20:43:40 +0000 (12:43 -0800)
Complimenting the existing tcg_unsigned_cond.

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

index f25efa9..8c45f7e 100644 (file)
--- 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)
 {