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 332 /* use test */
333 333 switch(cond) {
334 334 case TCG_COND_EQ:
335   - c = JCC_JNE;
  335 + c = JCC_JE;
336 336 break;
337 337 case TCG_COND_NE:
338 338 c = JCC_JNE;
... ... @@ -355,7 +355,7 @@ static void tcg_out_brcond(TCGContext *s, int cond,
355 355 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
356 356 }
357 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 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 374 break;
375 375 case TCG_COND_NE:
376 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 378 break;
379 379 case TCG_COND_LT:
380 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 445 /* use test */
446 446 switch(cond) {
447 447 case TCG_COND_EQ:
448   - c = JCC_JNE;
  448 + c = JCC_JE;
449 449 break;
450 450 case TCG_COND_NE:
451 451 c = JCC_JNE;
... ... @@ -471,7 +471,7 @@ static void tcg_out_brcond(TCGContext *s, int cond,
471 471 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
472 472 }
473 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 475 tcg_out_jxx(s, tcg_cond_to_jcc[cond], label_index);
476 476 }
477 477 }
... ...