]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add some specialisation rules which are ultimately helpful in reduce
authorJulian Seward <jseward@acm.org>
Wed, 20 Jul 2005 00:30:37 +0000 (00:30 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 20 Jul 2005 00:30:37 +0000 (00:30 +0000)
memcheck's false-error rate on inlined strlen and related nasties.

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

VEX/priv/guest-amd64/ghelpers.c

index d9226d004d6b80be274f0da6fd46da20d4a95d44..77022f0ded5facb66fbb6f44a7b46194e1691002 100644 (file)
@@ -913,8 +913,8 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
       }
 
       if (isU64(cc_op, AMD64G_CC_OP_SUBL) && isU64(cond, AMD64CondLE)) {
-         /* long sub/cmp, then L (signed less than or equal) 
-            --> test dst <s src */
+         /* long sub/cmp, then LE (signed less than or equal) 
+            --> test dst <=s src */
          return unop(Iop_1Uto64,
                      binop(Iop_CmpLE64S, 
                            binop(Iop_Shl64,cc_dep1,mkU8(32)),
@@ -947,6 +947,16 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
                            unop(Iop_64to16,cc_dep2)));
       }
 
+      if (isU64(cc_op, AMD64G_CC_OP_SUBW) && isU64(cond, AMD64CondLE)) {
+         /* 16-bit sub/cmp, then LE (signed less than or equal) 
+            --> test dst <=s src */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpLE64S, 
+                           binop(Iop_Shl64,cc_dep1,mkU8(48)),
+                           binop(Iop_Shl64,cc_dep2,mkU8(48))));
+
+      }
+
       /*---------------- SUBB ----------------*/
 
       if (isU64(cc_op, AMD64G_CC_OP_SUBB) && isU64(cond, AMD64CondZ)) {
@@ -1031,6 +1041,17 @@ IRExpr* guest_amd64_spechelper ( HChar* function_name,
 //..                                         mkU32(0)));
 //..       }
 //.. 
+
+      /*---------------- INCB ----------------*/
+
+      if (isU64(cc_op, AMD64G_CC_OP_INCB) && isU64(cond, AMD64CondLE)) {
+         /* 8-bit inc, then LE --> test result <=s 0 */
+         return unop(Iop_1Uto64,
+                     binop(Iop_CmpLE64S, 
+                           binop(Iop_Shl64,cc_dep1,mkU8(56)),
+                           mkU64(0)));
+      }
+
 //..       /*---------------- DECL ----------------*/
 //.. 
 //..       if (isU32(cc_op, AMD64G_CC_OP_DECL) && isU32(cond, X86CondZ)) {