From 9bb51177f7f0b0917132fab3a0bea6b2c023e575 Mon Sep 17 00:00:00 2001 From: Tim Haines Date: Thu, 23 Nov 2023 11:01:25 -0600 Subject: [PATCH] Make jnz an alias of jne --- common/h/mnemonics/x86_entryIDs.h | 2 +- common/src/arch-x86.C | 8 ++++---- dataflowAPI/src/convertOpcodes.C | 2 +- instructionAPI/src/Instruction.C | 2 +- instructionAPI/src/InstructionCategories.C | 2 +- instructionAPI/src/Operation.C | 2 +- parseAPI/src/BoundFactCalculator.C | 2 +- parseAPI/src/BoundFactData.C | 4 ++-- parseAPI/src/IdiomModelDesc.C | 6 +++--- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/h/mnemonics/x86_entryIDs.h b/common/h/mnemonics/x86_entryIDs.h index d8f6e7ae24..b04cf2aa7b 100644 --- a/common/h/mnemonics/x86_entryIDs.h +++ b/common/h/mnemonics/x86_entryIDs.h @@ -249,10 +249,10 @@ e_jl, e_jle, e_jmp, e_jne, +e_jnz = e_jne, e_jno, e_jnp, e_jns, -e_jnz, e_jo, e_jp, e_jrcxz, diff --git a/common/src/arch-x86.C b/common/src/arch-x86.C index 7a69184ab2..1bf9a8de1a 100644 --- a/common/src/arch-x86.C +++ b/common/src/arch-x86.C @@ -1092,7 +1092,7 @@ COMMON_EXPORT dyn_hash_map entryNames_IAPI = map_list_of (e_jno, "jno") (e_jnp, "jnp") (e_jns, "jns") - (e_jnz, "jnz") + (e_jne, "jne") (e_jo, "jo") (e_jp, "jp") (e_js, "js") @@ -2120,7 +2120,7 @@ list_of(x86::of)(x86::sf)(x86::zf)(x86::af)(x86::pf)(x86::cf)(x86::tf)(x86::if_) flagTable_[e_jno] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); flagTable_[e_jnp] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); flagTable_[e_jns] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); - flagTable_[e_jnz] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); + flagTable_[e_jne] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); flagTable_[e_jo] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); flagTable_[e_jp] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); flagTable_[e_js] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector()); @@ -2358,7 +2358,7 @@ static ia32_entry oneByteMap[256] = { { e_jb_jnaej_j, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, { e_jnb_jae_j, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, { e_jz, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, - { e_jnz, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, + { e_jne, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, { e_jbe, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, { e_ja, t_done, 0, false, { Jb, Zz, Zz }, (IS_JCC | REL_B), s1R, 0 }, /* 78 */ @@ -2682,7 +2682,7 @@ static ia32_entry twoByteMap[256] = { { e_jb, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, { e_jae, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, { e_jz, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, - { e_jnz, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, + { e_jne, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, { e_jbe, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, { e_ja, t_done, 0, false, { Jz, Zz, Zz }, (IS_JCC | REL_X), s1R | (fCOND << FPOS), 0 }, /* 88 */ diff --git a/dataflowAPI/src/convertOpcodes.C b/dataflowAPI/src/convertOpcodes.C index ea74bb3693..6fe66ad7c1 100644 --- a/dataflowAPI/src/convertOpcodes.C +++ b/dataflowAPI/src/convertOpcodes.C @@ -118,7 +118,7 @@ X86InstructionKind RoseInsnX86Factory::convertKind(entryID opcode, prefixEntryID return x86_jpo; case e_jns: return x86_jns; - case e_jnz: + case e_jne: return x86_jne; case e_jo: return x86_jo; diff --git a/instructionAPI/src/Instruction.C b/instructionAPI/src/Instruction.C index bf747f0749..a9bc725770 100644 --- a/instructionAPI/src/Instruction.C +++ b/instructionAPI/src/Instruction.C @@ -577,7 +577,7 @@ namespace Dyninst case e_jno: case e_jnp: case e_jns: - case e_jnz: + case e_jne: case e_jo: case e_jp: case e_js: diff --git a/instructionAPI/src/InstructionCategories.C b/instructionAPI/src/InstructionCategories.C index 92d7fe4b00..68c3609a78 100644 --- a/instructionAPI/src/InstructionCategories.C +++ b/instructionAPI/src/InstructionCategories.C @@ -66,7 +66,7 @@ namespace Dyninst case e_jno: case e_jnp: case e_jns: - case e_jnz: + case e_jne: case e_jo: case e_jp: case e_js: diff --git a/instructionAPI/src/Operation.C b/instructionAPI/src/Operation.C index d729dcdf02..4999078ef4 100644 --- a/instructionAPI/src/Operation.C +++ b/instructionAPI/src/Operation.C @@ -330,7 +330,7 @@ namespace Dyninst nonOperandRegisterWrites.insert(make_pair(e_jno, thePC)); nonOperandRegisterWrites.insert(make_pair(e_jnp, thePC)); nonOperandRegisterWrites.insert(make_pair(e_jns, thePC)); - nonOperandRegisterWrites.insert(make_pair(e_jnz, thePC)); + nonOperandRegisterWrites.insert(make_pair(e_jne, thePC)); nonOperandRegisterWrites.insert(make_pair(e_jo, thePC)); nonOperandRegisterWrites.insert(make_pair(e_jp, thePC)); nonOperandRegisterWrites.insert(make_pair(e_js, thePC)); diff --git a/parseAPI/src/BoundFactCalculator.C b/parseAPI/src/BoundFactCalculator.C index 4faa478b2b..14e5d28a57 100644 --- a/parseAPI/src/BoundFactCalculator.C +++ b/parseAPI/src/BoundFactCalculator.C @@ -259,7 +259,7 @@ bool BoundFactsCalculator::CalculateBoundedFacts() { static bool IsConditionalJump(Instruction insn) { entryID id = insn.getOperation().getID(); - if (id == e_jz || id == e_jnz || + if (id == e_jz || id == e_jne || id == e_jb || id == e_jae || id == e_jbe || id == e_ja || id == e_jb_jnaej_j || id == e_jnb_jae_j || diff --git a/parseAPI/src/BoundFactData.C b/parseAPI/src/BoundFactData.C index b037d0337a..90f206f601 100644 --- a/parseAPI/src/BoundFactData.C +++ b/parseAPI/src/BoundFactData.C @@ -678,7 +678,7 @@ bool BoundFact::ConditionalJumpBound(Instruction insn, EdgeTypeEnum type) { } break; } - case e_jnz: { + case e_jne: { if (pred.e1->getID() == AST::V_ConstantAST) { if (pred.e2->getID() == AST::V_ConstantAST) { parsing_printf("WARNING: both predicate elements are constants!\n"); @@ -849,7 +849,7 @@ bool BoundFact::ConditionalJumpBound(Instruction insn, EdgeTypeEnum type) { } break; } - case e_jnz: { + case e_jne: { if (pred.e1->getID() == AST::V_ConstantAST) { if (pred.e2->getID() == AST::V_ConstantAST) { parsing_printf("WARNING: both predicate elements are constants!\n"); diff --git a/parseAPI/src/IdiomModelDesc.C b/parseAPI/src/IdiomModelDesc.C index 5bbdbedc55..1648f11f6b 100644 --- a/parseAPI/src/IdiomModelDesc.C +++ b/parseAPI/src/IdiomModelDesc.C @@ -288,7 +288,7 @@ IdiomModel::IdiomModel(string model_spec) { i37.prefix = true; i37.terms.push_back(IdiomTerm(e_jmp, x86::eip, NOARG)); i37.terms.push_back(WILDCARD_TERM); - i37.terms.push_back(IdiomTerm(e_jnz, x86::eip, NOARG)); + i37.terms.push_back(IdiomTerm(e_jne, x86::eip, NOARG)); reverse(i37.terms.begin(), i37.terms.end()); prefix.addIdiom(i37); @@ -856,7 +856,7 @@ IdiomModel::IdiomModel(string model_spec) { i10.w = 11.854041; i10.prefix = false; i10.terms.push_back(IdiomTerm(e_cmp, MEMARG, IMMARG)); - i10.terms.push_back(IdiomTerm(e_jnz, x86_64::rip, NOARG)); + i10.terms.push_back(IdiomTerm(e_jne, x86_64::rip, NOARG)); i10.terms.push_back(IdiomTerm(e_push, x86_64::rbp, x86_64::rsp)); normal.addIdiom(i10); @@ -1193,7 +1193,7 @@ IdiomModel::IdiomModel(string model_spec) { Idiom i51; i51.w = -11.891171; i51.prefix = true; - i51.terms.push_back(IdiomTerm(e_jnz, x86_64::rip, NOARG)); + i51.terms.push_back(IdiomTerm(e_jne, x86_64::rip, NOARG)); reverse(i51.terms.begin(), i51.terms.end()); prefix.addIdiom(i51);