qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>
Subject: [Qemu-devel] [PATCH 02/13] tcg-sparc: Fix brcond2
Date: Wed, 10 Oct 2012 09:02:36 -0700	[thread overview]
Message-ID: <1349884967-4608-3-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1349884967-4608-1-git-send-email-rth@twiddle.net>

Much the same problem as recently fixed for hppa.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 tcg/sparc/tcg-target.c | 23 +++++++----------------
 1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c
index 0c32baa..2475808 100644
--- a/tcg/sparc/tcg-target.c
+++ b/tcg/sparc/tcg-target.c
@@ -561,33 +561,24 @@ static void tcg_out_brcond2_i32(TCGContext *s, TCGCond cond,
     /* Note that we fill one of the delay slots with the second compare.  */
     switch (cond) {
     case TCG_COND_EQ:
-        cc = INSN_COND(tcg_cond_to_bcond[TCG_COND_NE], 0);
-        tcg_out_branch_i32(s, cc, label_next);
+        tcg_out_branch_i32(s, COND_NE, label_next);
         tcg_out_cmp(s, al, bl, blconst);
-        cc = INSN_COND(tcg_cond_to_bcond[TCG_COND_EQ], 0);
-        tcg_out_branch_i32(s, cc, label_dest);
+        tcg_out_branch_i32(s, COND_E, label_dest);
         break;
 
     case TCG_COND_NE:
-        cc = INSN_COND(tcg_cond_to_bcond[TCG_COND_NE], 0);
-        tcg_out_branch_i32(s, cc, label_dest);
+        tcg_out_branch_i32(s, COND_NE, label_dest);
         tcg_out_cmp(s, al, bl, blconst);
-        tcg_out_branch_i32(s, cc, label_dest);
+        tcg_out_branch_i32(s, COND_NE, label_dest);
         break;
 
     default:
-        /* ??? One could fairly easily special-case 64-bit unsigned
-           compares against 32-bit zero-extended constants.  For instance,
-           we know that (unsigned)AH < 0 is false and need not emit it.
-           Similarly, (unsigned)AH > 0 being true implies AH != 0, so the
-           second branch will never be taken.  */
-        cc = INSN_COND(tcg_cond_to_bcond[cond], 0);
+        cc = tcg_cond_to_bcond[tcg_high_cond(cond)];
         tcg_out_branch_i32(s, cc, label_dest);
         tcg_out_nop(s);
-        cc = INSN_COND(tcg_cond_to_bcond[TCG_COND_NE], 0);
-        tcg_out_branch_i32(s, cc, label_next);
+        tcg_out_branch_i32(s, COND_NE, label_next);
         tcg_out_cmp(s, al, bl, blconst);
-        cc = INSN_COND(tcg_cond_to_bcond[tcg_unsigned_cond(cond)], 0);
+        cc = tcg_cond_to_bcond[tcg_unsigned_cond(cond)];
         tcg_out_branch_i32(s, cc, label_dest);
         break;
     }
-- 
1.7.11.4

  parent reply	other threads:[~2012-10-10 16:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10 16:02 [Qemu-devel] [PATCH v2 00/13] tcg-sparc fixes and improvements Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 01/13] target-sparc: Fix optimized %icc comparisons Richard Henderson
2012-10-10 16:02 ` Richard Henderson [this message]
2012-10-10 16:02 ` [Qemu-devel] [PATCH 03/13] tcg-sparc: Implement movcond Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 04/13] tcg-sparc: Fix setcond2 Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 05/13] tcg-sparc: Fix qemu_st for 32-bit Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 06/13] tcg-sparc: Fix setcond Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 07/13] tcg-sparc: Fix add2/sub2 Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 08/13] tcg-sparc: Use Z constraint for %g0 Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 09/13] tcg-sparc: Optimize setcond2 equality compare with 0 Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 10/13] tcg-sparc: Drop use of Bicc in favor of BPcc Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 11/13] tcg-sparc: Dump illegal opode contents Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 12/13] tcg-sparc: Emit BPr insns for brcond_i64 Richard Henderson
2012-10-10 16:02 ` [Qemu-devel] [PATCH 13/13] tcg-sparc: Emit MOVR insns for setcond_i64 and movcond_64 Richard Henderson
2012-10-13 14:21 ` [Qemu-devel] [PATCH v2 00/13] tcg-sparc fixes and improvements Blue Swirl

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=1349884967-4608-3-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --cc=blauwirbel@gmail.com \
    --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).