mkU64(0)));
}
+ // Verified
+ if (isU64(cc_op, AMD64G_CC_OP_LOGICQ) && isU64(cond, AMD64CondS)) {
+ /* long long and/or/xor, then S --> (ULong)result[63] */
+ return binop(Iop_Shr64, cc_dep1, mkU8(63));
+ }
+ // Verified
+ if (isU64(cc_op, AMD64G_CC_OP_LOGICQ) && isU64(cond, AMD64CondNS)) {
+ /* long long and/or/xor, then S --> (ULong) ~ result[63] */
+ return binop(Iop_Xor64,
+ binop(Iop_Shr64, cc_dep1, mkU8(63)),
+ mkU64(1));
+ }
+
/*---------------- LOGICL ----------------*/
if (isU64(cc_op, AMD64G_CC_OP_LOGICL) && isU64(cond, AMD64CondZ)) {
binop(Iop_CmpNE64, cc_dep1, mkU64(0)));
}
- //if (isU64(cc_op, AMD64G_CC_OP_SHLQ) && isU64(cond, AMD64CondS)) {
- // /* SHLQ, then S --> (ULong)result[63] */
- // vassert(0);
- //}
+ // Verified
+ if (isU64(cc_op, AMD64G_CC_OP_SHLQ) && isU64(cond, AMD64CondS)) {
+ /* SHLQ, then S --> (ULong)result[63] */
+ return binop(Iop_Shr64, cc_dep1, mkU8(63));
+ }
+ // No known test case
//if (isU64(cc_op, AMD64G_CC_OP_SHLQ) && isU64(cond, AMD64CondNS)) {
// /* SHLQ, then NS --> (ULong) ~ result[63] */
// vassert(0);
binop(Iop_CmpEQ32, unop(Iop_64to32, cc_dep1),
mkU32(0)));
}
- //if (isU64(cc_op, AMD64G_CC_OP_SHLL) && isU64(cond, AMD64CondNZ)) {
- // /* SHLL, then NZ --> test dep1 != 0 */
- // vassert(0);
- //}
+ // Verified
+ if (isU64(cc_op, AMD64G_CC_OP_SHLL) && isU64(cond, AMD64CondNZ)) {
+ /* SHLL, then NZ --> test dep1 != 0 */
+ return unop(Iop_1Uto64,
+ binop(Iop_CmpNE32, unop(Iop_64to32, cc_dep1),
+ mkU32(0)));
+ }
if (isU64(cc_op, AMD64G_CC_OP_SHLL) && isU64(cond, AMD64CondS)) {
/* SHLL, then S --> (ULong)result[31] */
binop(Iop_Shr64, cc_dep1, mkU8(31)),
mkU64(1));
}
+ // No known test case
//if (isU64(cc_op, AMD64G_CC_OP_SHLL) && isU64(cond, AMD64CondNS)) {
// /* SHLL, then NS --> (ULong) ~ result[31] */
// vassert(0);
/*---------------- SHRL ----------------*/
if (isU32(cc_op, X86G_CC_OP_SHRL) && isU32(cond, X86CondZ)) {
- /* SHRL, then Z --> test dep1 == 0 */
+ /* SHRL, then Z --> test dep1(result) == 0 */
return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dep1, mkU32(0)));
}
+ if (isU32(cc_op, X86G_CC_OP_SHRL) && isU32(cond, X86CondNZ)) {
+ /* SHRL, then NZ --> test dep1(result) != 0 */
+ return unop(Iop_1Uto32,binop(Iop_CmpNE32, cc_dep1, mkU32(0)));
+ }
+
+ /*---------------- SHLL ----------------*/
+
+ if (isU32(cc_op, X86G_CC_OP_SHLL) && isU32(cond, X86CondZ)) {
+ /* SHLL, then Z --> test dep1(result) == 0 */
+ return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dep1, mkU32(0)));
+ }
+ //if (isU32(cc_op, X86G_CC_OP_SHLL) && isU32(cond, X86CondNZ)) {
+ // /* SHLL, then NZ --> test dep1(result) != 0 */
+ // vassert(0); // No test case yet observed
+ //}
/*---------------- COPY ----------------*/
/* This can happen, as a result of x87 FP compares: "fcom ... ;