TCGArg dest, TCGArg arg1, TCGArg arg2,
int const_arg2, bool neg)
{
+ int cmp_rexw = rexw;
bool inv = false;
bool cleared;
int jcc;
}
break;
+ case TCG_COND_TSTNE:
+ inv = true;
+ /* fall through */
+ case TCG_COND_TSTEQ:
+ /* If arg2 is -1, convert to LTU/GEU vs 1. */
+ if (const_arg2 && arg2 == 0xffffffffu) {
+ arg2 = 1;
+ cmp_rexw = 0;
+ goto do_ltu;
+ }
+ break;
+
case TCG_COND_LEU:
inv = true;
/* fall through */
* We can then use NEG or INC to produce the desired result.
* This is always smaller than the SETCC expansion.
*/
- tcg_out_cmp(s, TCG_COND_LTU, arg1, arg2, const_arg2, rexw);
+ tcg_out_cmp(s, TCG_COND_LTU, arg1, arg2, const_arg2, cmp_rexw);
/* X - X - C = -C = (C ? -1 : 0) */
tgen_arithr(s, ARITH_SBB + (neg ? rexw : 0), dest, dest);
cleared = true;
}
- jcc = tcg_out_cmp(s, cond, arg1, arg2, const_arg2, rexw);
+ jcc = tcg_out_cmp(s, cond, arg1, arg2, const_arg2, cmp_rexw);
tcg_out_modrm(s, OPC_SETCC | jcc, 0, dest);
if (!cleared) {