]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fast-case some more stuff.
authorJulian Seward <jseward@acm.org>
Sat, 23 Oct 2004 01:13:57 +0000 (01:13 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 23 Oct 2004 01:13:57 +0000 (01:13 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@402

VEX/priv/guest-x86/ghelpers.c

index 122c8ccd291089e3cb0eef35d861e8eb0aa643da..1717a7dc553c6b75bf7728211d61d91e18efaadb 100644 (file)
@@ -494,12 +494,23 @@ UInt calculate_eflags_all ( UInt cc_op, UInt cc_src_formal, UInt cc_dst_formal )
 static UInt calculate_eflags_c ( UInt cc_op, UInt cc_src, UInt cc_dst )
 {
    /* Fast-case some common ones. */
-   if (cc_op == CC_OP_LOGICL)
-      return 0;
-   if (cc_op == CC_OP_DECL)
-      return cc_src;
-   if (cc_op == CC_OP_SUBL)
-      return ( ((UInt)cc_src) > ((UInt)cc_dst) ) ? CC_MASK_C : 0;
+   switch (cc_op) {
+      case CC_OP_LOGICL: case CC_OP_LOGICW: case CC_OP_LOGICB:
+         return 0;
+      case CC_OP_DECL:
+         return cc_src;
+      case CC_OP_SUBL:
+         return ( ((UInt)cc_src) > ((UInt)cc_dst) ) 
+                   ? CC_MASK_C : 0;
+      case CC_OP_ADDL:
+         return ( ((UInt)cc_src + (UInt)cc_dst) < ((UInt)cc_src) ) 
+                   ? CC_MASK_C : 0;
+      case CC_OP_SUBB:
+         return ( ((UInt)(cc_src & 0xFF)) > ((UInt)(cc_dst & 0xFF)) ) 
+                   ? CC_MASK_C : 0;
+      default: 
+         break;
+   }
 
 #  if PROFILE_EFLAGS
    if (!initted)