From bb210e78b35d21f8bfe2addbe64b65f586f5a241 Mon Sep 17 00:00:00 2001 From: bellard Date: Sun, 3 Feb 2008 21:06:23 +0000 Subject: [PATCH] compare fix git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3962 c046a42c-6fe2-441c-8c8c-71466251a162 --- tcg/i386/tcg-target.c | 6 +++--- tcg/x86_64/tcg-target.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 20822a4..dd8b5f6 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -332,7 +332,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, /* use test */ switch(cond) { case TCG_COND_EQ: - c = JCC_JNE; + c = JCC_JE; break; case TCG_COND_NE: c = JCC_JNE; @@ -355,7 +355,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); } } else { - tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3), arg1, arg2); + tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3), arg2, arg1); tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); } } @@ -374,7 +374,7 @@ static void tcg_out_brcond2(TCGContext *s, break; case TCG_COND_NE: tcg_out_brcond(s, TCG_COND_NE, args[0], args[2], const_args[2], args[5]); - tcg_out_brcond(s, TCG_COND_EQ, args[1], args[3], const_args[3], label_next); + tcg_out_brcond(s, TCG_COND_NE, args[1], args[3], const_args[3], args[5]); break; case TCG_COND_LT: tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]); diff --git a/tcg/x86_64/tcg-target.c b/tcg/x86_64/tcg-target.c index a2f0e4c..b4b3e7d 100644 --- a/tcg/x86_64/tcg-target.c +++ b/tcg/x86_64/tcg-target.c @@ -445,7 +445,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, /* use test */ switch(cond) { case TCG_COND_EQ: - c = JCC_JNE; + c = JCC_JE; break; case TCG_COND_NE: c = JCC_JNE; @@ -471,7 +471,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); } } else { - tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3) | rexw, arg1, arg2); + tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3) | rexw, arg2, arg1); tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); } } -- 1.7.9.5