mkU64(0)));
}
+ if (isU64(cc_op, AMD64G_CC_OP_LOGICB) && isU64(cond, AMD64CondS)) {
+ /* this is an idiom gcc sometimes uses to find out if the top
+ bit of a byte register is set: eg testb %al,%al; js ..
+ Since it just depends on the top bit of the byte, extract
+ that bit and explicitly get rid of all the rest. This
+ helps memcheck avoid false positives in the case where any
+ of the other bits in the byte are undefined. */
+ /* byte and/or/xor, then S --> (UInt)result[7] */
+ return binop(Iop_And64,
+ binop(Iop_Shr64,cc_dep1,mkU8(7)),
+ mkU64(1));
+ }
+
/*---------------- INCB ----------------*/
if (isU64(cc_op, AMD64G_CC_OP_INCB) && isU64(cond, AMD64CondLE)) {
IRExpr_Const(IRConst_U8(1)));
} else
+ /* Add64(t,t) ==> t << 1; rationale as for Add32(t,t) above. */
+ if (e->Iex.Binop.op == Iop_Add64
+ && e->Iex.Binop.arg1->tag == Iex_Tmp
+ && e->Iex.Binop.arg2->tag == Iex_Tmp
+ && e->Iex.Binop.arg1->Iex.Tmp.tmp
+ == e->Iex.Binop.arg2->Iex.Tmp.tmp) {
+ e2 = IRExpr_Binop(Iop_Shl64,
+ e->Iex.Binop.arg1,
+ IRExpr_Const(IRConst_U8(1)));
+ } else
+
/* Or64/Add64(x,0) ==> x */
if ((e->Iex.Binop.op == Iop_Add64 || e->Iex.Binop.op == Iop_Or64)
&& e->Iex.Binop.arg2->tag == Iex_Const