From: Nicholas Nethercote Date: Fri, 28 Nov 2003 09:44:21 +0000 (+0000) Subject: Factor out repeated code for LOOP{E,NE} X-Git-Tag: svn/VALGRIND_2_1_0~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b71b93e45b04b74ea9fb40690c7262f174c6d70;p=thirdparty%2Fvalgrind.git Factor out repeated code for LOOP{E,NE} git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2072 --- diff --git a/coregrind/vg_to_ucode.c b/coregrind/vg_to_ucode.c index d7b619b31d..21cb778ccc 100644 --- a/coregrind/vg_to_ucode.c +++ b/coregrind/vg_to_ucode.c @@ -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);