Commit bb210e78b35d21f8bfe2addbe64b65f586f5a241

Authored by bellard
1 parent ac56dd48

compare fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3962 c046a42c-6fe2-441c-8c8c-71466251a162
tcg/i386/tcg-target.c
@@ -332,7 +332,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, @@ -332,7 +332,7 @@ static void tcg_out_brcond(TCGContext *s, int cond,
332 /* use test */ 332 /* use test */
333 switch(cond) { 333 switch(cond) {
334 case TCG_COND_EQ: 334 case TCG_COND_EQ:
335 - c = JCC_JNE; 335 + c = JCC_JE;
336 break; 336 break;
337 case TCG_COND_NE: 337 case TCG_COND_NE:
338 c = JCC_JNE; 338 c = JCC_JNE;
@@ -355,7 +355,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, @@ -355,7 +355,7 @@ static void tcg_out_brcond(TCGContext *s, int cond,
355 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); 355 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
356 } 356 }
357 } else { 357 } else {
358 - tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3), arg1, arg2); 358 + tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3), arg2, arg1);
359 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); 359 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
360 } 360 }
361 } 361 }
@@ -374,7 +374,7 @@ static void tcg_out_brcond2(TCGContext *s, @@ -374,7 +374,7 @@ static void tcg_out_brcond2(TCGContext *s,
374 break; 374 break;
375 case TCG_COND_NE: 375 case TCG_COND_NE:
376 tcg_out_brcond(s, TCG_COND_NE, args[0], args[2], const_args[2], args[5]); 376 tcg_out_brcond(s, TCG_COND_NE, args[0], args[2], const_args[2], args[5]);
377 - tcg_out_brcond(s, TCG_COND_EQ, args[1], args[3], const_args[3], label_next); 377 + tcg_out_brcond(s, TCG_COND_NE, args[1], args[3], const_args[3], args[5]);
378 break; 378 break;
379 case TCG_COND_LT: 379 case TCG_COND_LT:
380 tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]); 380 tcg_out_brcond(s, TCG_COND_LT, args[1], args[3], const_args[3], args[5]);
tcg/x86_64/tcg-target.c
@@ -445,7 +445,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, @@ -445,7 +445,7 @@ static void tcg_out_brcond(TCGContext *s, int cond,
445 /* use test */ 445 /* use test */
446 switch(cond) { 446 switch(cond) {
447 case TCG_COND_EQ: 447 case TCG_COND_EQ:
448 - c = JCC_JNE; 448 + c = JCC_JE;
449 break; 449 break;
450 case TCG_COND_NE: 450 case TCG_COND_NE:
451 c = JCC_JNE; 451 c = JCC_JNE;
@@ -471,7 +471,7 @@ static void tcg_out_brcond(TCGContext *s, int cond, @@ -471,7 +471,7 @@ static void tcg_out_brcond(TCGContext *s, int cond,
471 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); 471 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
472 } 472 }
473 } else { 473 } else {
474 - tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3) | rexw, arg1, arg2); 474 + tcg_out_modrm(s, 0x01 | (ARITH_CMP << 3) | rexw, arg2, arg1);
475 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index); 475 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
476 } 476 }
477 } 477 }