summaryrefslogtreecommitdiffstats
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson2017-11-20 14:47:02 +0100
committerRichard Henderson2017-12-29 21:43:40 +0100
commit923ed1750186591b04d7d61399f6d68b4e0608f2 (patch)
tree288fd2a1e422df28cc1fe50c81de6027c2811781 /tcg
parenttcg: Generalize TCGOp parameters (diff)
downloadqemu-923ed1750186591b04d7d61399f6d68b4e0608f2.tar.gz
qemu-923ed1750186591b04d7d61399f6d68b4e0608f2.tar.xz
qemu-923ed1750186591b04d7d61399f6d68b4e0608f2.zip
tcg: Add tcg_signed_cond
Complimenting the existing tcg_unsigned_cond. Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.h6
1 files changed, 6 insertions, 0 deletions
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)
{