Revision bb210e78 tcg/i386/tcg-target.c

b/tcg/i386/tcg-target.c
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 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 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]);

Also available in: Unified diff