mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 10:05:29 +00:00
amd64: add a spec rule for SHRL/SARL then CondS. gcc-8 has been seen to generate such things.
This commit is contained in:
parent
40f0364e1e
commit
8a2acb304d
@ -1744,6 +1744,26 @@ IRExpr* guest_amd64_spechelper ( const HChar* function_name,
|
|||||||
mkU32(0)));
|
mkU32(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isU64(cc_op, AMD64G_CC_OP_SHRL) && isU64(cond, AMD64CondS)) {
|
||||||
|
/* SHRL/SARL, then S --> (ULong)result[31] */
|
||||||
|
return binop(Iop_And64,
|
||||||
|
binop(Iop_Shr64, cc_dep1, mkU8(31)),
|
||||||
|
mkU64(1));
|
||||||
|
}
|
||||||
|
// The following looks correct to me, but never seems to happen because
|
||||||
|
// the front end converts jns to js by switching the fallthrough vs
|
||||||
|
// taken addresses. See jcc_01(). But then why do other conditions
|
||||||
|
// considered by this function show up in both variants (xx and Nxx) ?
|
||||||
|
//if (isU64(cc_op, AMD64G_CC_OP_SHRL) && isU64(cond, AMD64CondNS)) {
|
||||||
|
// /* SHRL/SARL, then NS --> (ULong) ~ result[31] */
|
||||||
|
// vassert(0);
|
||||||
|
// return binop(Iop_Xor64,
|
||||||
|
// binop(Iop_And64,
|
||||||
|
// binop(Iop_Shr64, cc_dep1, mkU8(31)),
|
||||||
|
// mkU64(1)),
|
||||||
|
// mkU64(1));
|
||||||
|
//}
|
||||||
|
|
||||||
/*---------------- COPY ----------------*/
|
/*---------------- COPY ----------------*/
|
||||||
/* This can happen, as a result of amd64 FP compares: "comisd ... ;
|
/* This can happen, as a result of amd64 FP compares: "comisd ... ;
|
||||||
jbe" for example. */
|
jbe" for example. */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user