]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Factor out repeated code for LOOP{E,NE}
authorNicholas Nethercote <n.nethercote@gmail.com>
Fri, 28 Nov 2003 09:44:21 +0000 (09:44 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Fri, 28 Nov 2003 09:44:21 +0000 (09:44 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2072

coregrind/vg_to_ucode.c

index d7b619b31dee97d1541b4c3c592ef50bc8617495..21cb778cccfa8220796400291893dc632a50e8a9 100644 (file)
@@ -4860,21 +4860,15 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
       uInstr2(cb, PUT,  4, TempReg, t1,    ArchReg, R_ECX);
       uInstr2(cb, JIFZ, 4, TempReg, t1,    Literal, 0);
       uLiteral(cb, eip);
-
-      if (opc == 0xE2) {   /* LOOP */
-         uInstr1(cb, JMP,  0, Literal, 0);
-         uLiteral(cb, d32);
-         uCond(cb, CondAlways);
-      } else {             /* LOOPE/LOOPNE */
+      if (opc == 0xE0 || opc == 0xE1) {   /* LOOPE/LOOPNE */
          uInstr1(cb, JMP,  0, Literal, 0);
          uLiteral(cb, eip);
          uCond(cb, (opc == 0xE1 ? CondNZ : CondZ));
          uFlagsRWU(cb, FlagsOSZACP, FlagsEmpty, FlagsEmpty);
-
-         uInstr1(cb, JMP,  0, Literal, 0);
-         uLiteral(cb, d32);
-         uCond(cb, CondAlways);
       }
+      uInstr1(cb, JMP,  0, Literal, 0);
+      uLiteral(cb, d32);
+      uCond(cb, CondAlways);
       *isEnd = True;
       if (dis)
          VG_(printf)("loop 0x%x\n", d32);