tab[cc_op][cond]++;
n_calc_cond++;
- if (0 == ((n_calc_all+n_calc_c) & 0x0FFF)) showCounts();
+ if (0 == ((n_calc_all+n_calc_c) & 0x3FFF)) showCounts();
# endif
switch (cond) {
cc_src = args[2];
cc_dst = args[3];
- if (isU32(cc_op, CC_OP_LOGICB) && isU32(cond, CondZ)) {
- /* byte and/or/xor, then Z --> test dst==0 */
+ /*---------------- SUBL ----------------*/
+
+ if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondZ)) {
+ /* long sub/cmp, then Z --> test dst==src */
return unop(Iop_1Uto32,
- binop(Iop_CmpEQ32, binop(Iop_And32,cc_dst,mkU32(255)),
- mkU32(0)));
+ binop(Iop_CmpEQ32, cc_dst, cc_src));
+ }
+
+ if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondL)) {
+ /* long sub/cmp, then L (signed less than)
+ --> test dst <s src */
+ return unop(Iop_1Uto32,
+ binop(Iop_CmpLT32S, cc_dst, cc_src));
+ }
+
+ if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondLE)) {
+ /* long sub/cmp, then LE (signed less than or equal)
+ --> test dst <=s src */
+ return unop(Iop_1Uto32,
+ binop(Iop_CmpLE32S, cc_dst, cc_src));
+ }
+
+ if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondBE)) {
+ /* long sub/cmp, then BE (unsigned less than or equal)
+ --> test dst <=u src */
+ return unop(Iop_1Uto32,
+ binop(Iop_CmpLE32U, cc_dst, cc_src));
+ }
+
+ if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondB)) {
+ /* long sub/cmp, then B (unsigned less than)
+ --> test dst <u src */
+ return unop(Iop_1Uto32,
+ binop(Iop_CmpLT32U, cc_dst, cc_src));
}
+ /*---------------- SUBW ----------------*/
+
if (isU32(cc_op, CC_OP_SUBW) && isU32(cond, CondZ)) {
/* byte sub/cmp, then Z --> test dst==src */
return unop(Iop_1Uto32,
unop(Iop_32to16,cc_src)));
}
+ /*---------------- SUBB ----------------*/
+
if (isU32(cc_op, CC_OP_SUBB) && isU32(cond, CondZ)) {
/* byte sub/cmp, then Z --> test dst==src */
return unop(Iop_1Uto32,
binop(Iop_And32,cc_dst,mkU32(0xFFFF))));
}
+ /*---------------- LOGICL ----------------*/
+
if (isU32(cc_op, CC_OP_LOGICL) && isU32(cond, CondZ)) {
/* long and/or/xor, then Z --> test dst==0 */
return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dst, mkU32(0)));
return unop(Iop_1Uto32,binop(Iop_CmpLE32S, cc_dst, mkU32(0)));
}
- if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondZ)) {
- /* long sub/cmp, then Z --> test dst==src */
- return unop(Iop_1Uto32,
- binop(Iop_CmpEQ32, cc_dst, cc_src));
- }
-
- if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondL)) {
- /* long sub/cmp, then L (signed less than)
- --> test dst <s src */
- return unop(Iop_1Uto32,
- binop(Iop_CmpLT32S, cc_dst, cc_src));
- }
-
- if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondLE)) {
- /* long sub/cmp, then LE (signed less than or equal)
- --> test dst <=s src */
- return unop(Iop_1Uto32,
- binop(Iop_CmpLE32S, cc_dst, cc_src));
- }
+ /*---------------- LOGICB ----------------*/
- if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondBE)) {
- /* long sub/cmp, then BE (unsigned less than or equal)
- --> test dst <=u src */
+ if (isU32(cc_op, CC_OP_LOGICB) && isU32(cond, CondZ)) {
+ /* byte and/or/xor, then Z --> test dst==0 */
return unop(Iop_1Uto32,
- binop(Iop_CmpLE32U, cc_dst, cc_src));
+ binop(Iop_CmpEQ32, binop(Iop_And32,cc_dst,mkU32(255)),
+ mkU32(0)));
}
- if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondB)) {
- /* long sub/cmp, then B (unsigned less than)
- --> test dst <u src */
- return unop(Iop_1Uto32,
- binop(Iop_CmpLT32U, cc_dst, cc_src));
- }
+ /*---------------- DECL ----------------*/
if (isU32(cc_op, CC_OP_DECL) && isU32(cond, CondZ)) {
/* dec L, then Z --> test dst == 0 */