]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
A couple more flags-specialisation cases, derived from profiling FP
authorJulian Seward <jseward@acm.org>
Fri, 4 Mar 2005 13:51:28 +0000 (13:51 +0000)
committerJulian Seward <jseward@acm.org>
Fri, 4 Mar 2005 13:51:28 +0000 (13:51 +0000)
code.

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

VEX/priv/guest-x86/ghelpers.c

index c3ba8ea7e2da9d3bbc27fc47eae7976145a4c43b..d4c3d9619264a850755ba2dd30696ada790612b8 100644 (file)
@@ -814,6 +814,14 @@ IRExpr* guest_x86_spechelper ( HChar* function_name,
                      binop(Iop_CmpLT32U, cc_dep1, cc_dep2));
       }
 
+      if (isU32(cc_op, X86G_CC_OP_SUBL) && isU32(cond, X86CondS)) {
+         /* long sub/cmp, then S --> test (dst-src <s 0) */
+         return unop(Iop_1Uto32,
+                     binop(Iop_CmpLT32S, 
+                           binop(Iop_Sub32, cc_dep1, cc_dep2),
+                           mkU32(0)));
+      }
+
       /*---------------- SUBW ----------------*/
 
       if (isU32(cc_op, X86G_CC_OP_SUBW) && isU32(cond, X86CondZ)) {
@@ -950,18 +958,38 @@ IRExpr* guest_x86_spechelper ( HChar* function_name,
             );
       }
       
-      if (isU32(cc_op, X86G_CC_OP_COPY) && isU32(cond, X86CondB)) {
-         /* COPY, then B --> extract C dep1, and test (C == 1). */
+      if (isU32(cc_op, X86G_CC_OP_COPY) && 
+          (isU32(cond, X86CondB) || isU32(cond, X86CondNB))) {
+         /* COPY, then B --> extract C from dep1, and test (C == 1). */
+         /* COPY, then NB --> extract C from dep1, and test (C == 0). */
+         UInt nnn = isU32(cond, X86CondB) ? 1 : 0;
          return
             unop(
                Iop_1Uto32,
                binop(
-                  Iop_CmpNE32,
+                  Iop_CmpEQ32,
                   binop(
                      Iop_And32,
                      binop(Iop_Shr32, cc_dep1, mkU8(X86G_CC_SHIFT_C)),
                      mkU32(1)
                   ),
+                  mkU32(nnn)
+               )
+            );
+      }
+
+      if (isU32(cc_op, X86G_CC_OP_COPY) && isU32(cond, X86CondZ)) {
+         /* COPY, then Z --> extract Z from dep1, and test (Z == 1). */
+         return
+            unop(
+               Iop_1Uto32,
+               binop(
+                  Iop_CmpNE32,
+                  binop(
+                     Iop_And32,
+                     binop(Iop_Shr32, cc_dep1, mkU8(X86G_CC_SHIFT_Z)),
+                     mkU32(1)
+                  ),
                   mkU32(0)
                )
             );