qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: aurelien@aurel32.net
Subject: [Qemu-devel] [PATCH 1/3] tcg: Add is_unsigned_cond
Date: Mon, 24 Sep 2012 14:21:39 -0700	[thread overview]
Message-ID: <1348521701-18238-2-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1348521701-18238-1-git-send-email-rth@twiddle.net>

Before we rearrange the TCG_COND enumeration, add a predicate for
the (single) use of comparisons vs TCGCond.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/s390/tcg-target.c | 2 +-
 tcg/tcg.h             | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c
index 3b90605..6e95eba 100644
--- a/tcg/s390/tcg-target.c
+++ b/tcg/s390/tcg-target.c
@@ -1113,7 +1113,7 @@ static void tgen64_xori(TCGContext *s, TCGReg dest, tcg_target_ulong val)
 static int tgen_cmp(TCGContext *s, TCGType type, TCGCond c, TCGReg r1,
                     TCGArg c2, int c2const)
 {
-    bool is_unsigned = (c > TCG_COND_GT);
+    bool is_unsigned = is_unsigned_cond(c);
     if (c2const) {
         if (c2 == 0) {
             if (type == TCG_TYPE_I32) {
diff --git a/tcg/tcg.h b/tcg/tcg.h
index 48a56f0..120daab 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -298,6 +298,11 @@ static inline TCGCond tcg_unsigned_cond(TCGCond c)
     return (c >= TCG_COND_LT && c <= TCG_COND_GT ? c + 4 : c);
 }
 
+static inline bool is_unsigned_cond(TCGCond c)
+{
+    return c >= TCG_COND_LTU;
+}
+
 #define TEMP_VAL_DEAD  0
 #define TEMP_VAL_REG   1
 #define TEMP_VAL_MEM   2
-- 
1.7.11.4

  reply	other threads:[~2012-09-24 21:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-24 21:21 [Qemu-devel] [PATCH 0/3] TCGCond improvements Richard Henderson
2012-09-24 21:21 ` Richard Henderson [this message]
2012-09-24 21:21 ` [Qemu-devel] [PATCH 2/3] tcg: Add TCG_COND_NEVER, TCG_COND_ALWAYS Richard Henderson
2012-09-24 21:21 ` [Qemu-devel] [PATCH 3/3] tcg: Add tcg_high_cond Richard Henderson
2012-10-05 17:00 ` [Qemu-devel] [PATCH 0/3] TCGCond improvements Richard Henderson
2012-10-06 18:35 ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1348521701-18238-2-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).