]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Un-break eflag helper specialiser.
authorJulian Seward <jseward@acm.org>
Mon, 8 Nov 2004 18:20:23 +0000 (18:20 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 8 Nov 2004 18:20:23 +0000 (18:20 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@527

VEX/priv/guest-x86/ghelpers.c

index 533b649b85550b68371500ca446d652f4253ecd3..47bc77594566a9f20bbc84ce386edd5aedea0af2 100644 (file)
@@ -739,7 +739,7 @@ IRExpr* x86guest_spechelper ( Char* function_name,
       }
 
       if (isU32(cc_op, CC_OP_SUBB) && isU32(cond, CondNZ)) {
-         /* byte sub/cmp, then Z --> test dst!=src */
+         /* byte sub/cmp, then NZ --> test dst!=src */
          return unop(Iop_1Uto32,
                      binop(Iop_CmpNE8, 
                            unop(Iop_32to8,cc_dep1), 
@@ -748,10 +748,11 @@ IRExpr* x86guest_spechelper ( Char* function_name,
       if (isU32(cc_op, CC_OP_SUBB) && isU32(cond, CondNBE)) {
          /* long sub/cmp, then NBE (unsigned greater than)
             --> test src <=u dst */
+         /* Note, args are opposite way round from the usual */
          return unop(Iop_1Uto32,
                      binop(Iop_CmpLT32U, 
-                           binop(Iop_And32,cc_dep1,mkU32(0xFF)),
-                          binop(Iop_And32,cc_dep2,mkU32(0xFF))));
+                           binop(Iop_And32,cc_dep2,mkU32(0xFF)),
+                          binop(Iop_And32,cc_dep1,mkU32(0xFF))));
       }
 
       /*---------------- LOGICL ----------------*/