From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33708) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TH3KU-0000zH-4O for qemu-devel@nongnu.org; Wed, 26 Sep 2012 21:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TH3KS-0005hg-Qb for qemu-devel@nongnu.org; Wed, 26 Sep 2012 21:55:54 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33983) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TH3KS-0005h9-KV for qemu-devel@nongnu.org; Wed, 26 Sep 2012 21:55:52 -0400 Received: by padfb10 with SMTP id fb10so913009pad.4 for ; Wed, 26 Sep 2012 18:55:51 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Wed, 26 Sep 2012 18:55:31 -0700 Message-Id: <1348710942-3040-2-git-send-email-rth@twiddle.net> In-Reply-To: <1348710942-3040-1-git-send-email-rth@twiddle.net> References: <1348710942-3040-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 01/12] tcg-sparc: Fix brcond2 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl Much the same problem as recently fixed for hppa. Signed-off-by: Richard Henderson --- 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 bb43e83..726fb9b 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