Mark Wielaard 566af6
commit 632cb02573da3ff6237d9aeb9acd55c09c2ad317
Mark Wielaard 566af6
Author: philippe <philippe@8f6e269a-dfd6-0310-a8e1-e2731360e62c>
Mark Wielaard 566af6
Date:   Tue Jul 12 20:49:05 2016 +0000
Mark Wielaard 566af6
Mark Wielaard 566af6
    Fix n-i-bz amd64: memcheck false positive with shr %edx
Mark Wielaard 566af6
    
Mark Wielaard 566af6
    False positive analysis and fix by Julian.
Mark Wielaard 566af6
    
Mark Wielaard 566af6
    Thanks
Mark Wielaard 566af6
    
Mark Wielaard 566af6
    
Mark Wielaard 566af6
    
Mark Wielaard 566af6
    git-svn-id: svn://svn.valgrind.org/vex/trunk@3223 8f6e269a-dfd6-0310-a8e1-e2731360e62c
Mark Wielaard 566af6
Mark Wielaard 566af6
diff --git a/VEX/priv/guest_amd64_helpers.c b/VEX/priv/guest_amd64_helpers.c
Mark Wielaard 566af6
index ab53e15..3a0a4c6 100644
Mark Wielaard 566af6
--- a/VEX/priv/guest_amd64_helpers.c
Mark Wielaard 566af6
+++ b/VEX/priv/guest_amd64_helpers.c
Mark Wielaard 566af6
@@ -1604,6 +1604,15 @@ IRExpr* guest_amd64_spechelper ( const HChar* function_name,
Mark Wielaard 566af6
                            mkU64(0)));
Mark Wielaard 566af6
       }
Mark Wielaard 566af6
 
Mark Wielaard 566af6
+      /*---------------- SHRL ----------------*/
Mark Wielaard 566af6
+
Mark Wielaard 566af6
+      if (isU64(cc_op, AMD64G_CC_OP_SHRL) && isU64(cond, AMD64CondZ)) {
Mark Wielaard 566af6
+         /* SHRL, then Z --> test dep1 == 0 */
Mark Wielaard 566af6
+         return unop(Iop_1Uto64,
Mark Wielaard 566af6
+                     binop(Iop_CmpEQ32, unop(Iop_64to32, cc_dep1),
Mark Wielaard 566af6
+                           mkU32(0)));
Mark Wielaard 566af6
+      }
Mark Wielaard 566af6
+
Mark Wielaard 566af6
       /*---------------- COPY ----------------*/
Mark Wielaard 566af6
       /* This can happen, as a result of amd64 FP compares: "comisd ... ;
Mark Wielaard 566af6
          jbe" for example. */