]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
dis_VMASKMOV: create per-lane transfer/no-transfer guard expressions
authorJulian Seward <jseward@acm.org>
Tue, 3 Feb 2015 18:01:41 +0000 (18:01 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 3 Feb 2015 18:01:41 +0000 (18:01 +0000)
that are more Memcheck-friendly.  No functional change.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3081

VEX/priv/guest_amd64_toIR.c

index d6d3a17ae5f82602124eda7c7ff42cd68c56f494..5e9d0bd647b5e8e503eab5841432e4b75771c670 100644 (file)
@@ -27272,11 +27272,15 @@ static ULong dis_VMASKMOV ( Bool *uses_vvvv, const VexAbiInfo* vbi,
    Int nLanes = (isYMM ? 2 : 1) * (laneIs32 ? 4 : 2);
 
    for (i = 0; i < nLanes; i++) {
-      IRTemp cond = newTemp(Ity_I1);
-      assign( cond,
-              binop(laneIs32 ? Iop_CmpLT32S : Iop_CmpLT64S,
-                    (laneIs32 ? getYMMRegLane32 : getYMMRegLane64)( rV, i ),
-                    mkU(ty, 0) ));
+      IRExpr* shAmt = laneIs32 ? mkU8(31)    : mkU8(63);
+      IRExpr* one   = laneIs32 ? mkU32(1)    : mkU64(1);
+      IROp    opSHR = laneIs32 ? Iop_Shr32   : Iop_Shr64;
+      IROp    opEQ  = laneIs32 ? Iop_CmpEQ32 : Iop_CmpEQ64;
+      IRExpr* lane  = (laneIs32 ? getYMMRegLane32 : getYMMRegLane64)( rV, i );
+
+      IRTemp  cond = newTemp(Ity_I1);
+      assign(cond, binop(opEQ, binop(opSHR, lane, shAmt), one));
+
       IRTemp  data = newTemp(ty);
       IRExpr* ea   = binop(Iop_Add64, mkexpr(addr),
                                       mkU64(i * (laneIs32 ? 4 : 8)));