]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fast-case a couple more flag/thunk conditions.
authorJulian Seward <jseward@acm.org>
Tue, 24 Aug 2004 01:16:01 +0000 (01:16 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 24 Aug 2004 01:16:01 +0000 (01:16 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@200

VEX/priv/guest-x86/ghelpers.c

index 3199ff620c2bcc31ff3156d910b332e9dc9ab098..c1a16ac07eb78a06befb2cb4508123b3117cbf93 100644 (file)
@@ -464,7 +464,7 @@ static UInt calculate_eflags_c ( UInt cc_op, UInt cc_src, UInt cc_dst )
    tab[cc_op][cond]++;
    n_calc_cond++;
 
-   if (0 == ((n_calc_all+n_calc_c) & 0xFF)) showCounts();
+   if (0 == ((n_calc_all+n_calc_c) & 0xFFFF)) showCounts();
 #  endif
 
    switch (cond) {
@@ -635,6 +635,11 @@ IRExpr* x86guest_spechelper ( Char* function_name,
          return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dst, mkU32(0)));
       }
 
+      if (isU32(cc_op, CC_OP_LOGICL) && isU32(cond, CondS)) {
+         /* long and/or/xor, then S --> test dst <s 0 */
+         return unop(Iop_1Uto32,binop(Iop_CmpLT32S, cc_dst, mkU32(0)));
+      }
+
       if (isU32(cc_op, CC_OP_LOGICL) && isU32(cond, CondLE)) {
          /* long and/or/xor, then LE
             This is pretty subtle.  LOGIC sets SF and ZF according to the
@@ -676,6 +681,11 @@ IRExpr* x86guest_spechelper ( Char* function_name,
          return unop(Iop_1Uto32,binop(Iop_CmpEQ32, cc_dst, mkU32(0)));
       }
 
+      if (isU32(cc_op, CC_OP_DECL) && isU32(cond, CondS)) {
+         /* dec L, then S --> compare DST <s 0 */
+         return unop(Iop_1Uto32,binop(Iop_CmpLT32S, cc_dst, mkU32(0)));
+      }
+
       return NULL;
    }