]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
More eflags-specialisation rules.
authorJulian Seward <jseward@acm.org>
Mon, 15 Nov 2004 12:42:26 +0000 (12:42 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 15 Nov 2004 12:42:26 +0000 (12:42 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@551

VEX/priv/guest-x86/ghelpers.c

index e1363b81ce72148e80fdd31e1bce0dfc1d3cbc4a..ebad1108e6b50b1fbc8fa34a4e75e97d8578fbfc 100644 (file)
@@ -709,6 +709,16 @@ IRExpr* x86guest_spechelper ( Char* function_name,
       cc_dep2 = args[3];
       cc_ndep = args[4];
 
+      /*---------------- ADDL ----------------*/
+
+      if (isU32(cc_op, CC_OP_ADDL) && isU32(cond, CondZ)) {
+         /* long add, then Z --> test (dst+src == 0) */
+         return unop(Iop_1Uto32,
+                     binop(Iop_CmpEQ32, 
+                           binop(Iop_Add32, cc_dep1, cc_dep2),
+                           mkU32(0)));
+      }
+
       /*---------------- SUBL ----------------*/
 
       if (isU32(cc_op, CC_OP_SUBL) && isU32(cond, CondZ)) {
@@ -805,6 +815,15 @@ IRExpr* x86guest_spechelper ( Char* function_name,
          return unop(Iop_1Uto32,binop(Iop_CmpLE32S, cc_dep1, mkU32(0)));
       }
 
+      /*---------------- LOGICW ----------------*/
+
+      if (isU32(cc_op, CC_OP_LOGICW) && isU32(cond, CondZ)) {
+         /* byte and/or/xor, then Z --> test dst==0 */
+         return unop(Iop_1Uto32,
+                     binop(Iop_CmpEQ32, binop(Iop_And32,cc_dep1,mkU32(0xFFFF)), 
+                                        mkU32(0)));
+      }
+
       /*---------------- LOGICB ----------------*/
 
       if (isU32(cc_op, CC_OP_LOGICB) && isU32(cond, CondZ)) {
@@ -826,6 +845,13 @@ IRExpr* x86guest_spechelper ( Char* function_name,
          return unop(Iop_1Uto32,binop(Iop_CmpLT32S, cc_dep1, mkU32(0)));
       }
 
+      /*---------------- SHRL ----------------*/
+
+      if (isU32(cc_op, CC_OP_SHRL) && isU32(cond, CondZ)) {
+         /* SHRL, then Z --> test dep1 == 0 */
+         return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dep1, mkU32(0)));
+      }
+
       return NULL;
    }