Skip to content

Commit

Permalink
Make jnz an alias of jne
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Nov 28, 2023
1 parent cd8cb85 commit 9bb5117
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion common/h/mnemonics/x86_entryIDs.h
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions common/src/arch-x86.C
Expand Up @@ -1092,7 +1092,7 @@ COMMON_EXPORT dyn_hash_map<entryID, std::string> 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")
Expand Down Expand Up @@ -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<Dyninst::MachRegister>());
flagTable_[e_jnp] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
flagTable_[e_jns] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
flagTable_[e_jnz] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
flagTable_[e_jne] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
flagTable_[e_jo] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
flagTable_[e_jp] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
flagTable_[e_js] = flagInfo(list_of(x86::of)(x86::sf)(x86::zf)(x86::pf)(x86::cf), vector<Dyninst::MachRegister>());
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion dataflowAPI/src/convertOpcodes.C
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion instructionAPI/src/Instruction.C
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion instructionAPI/src/InstructionCategories.C
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion instructionAPI/src/Operation.C
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion parseAPI/src/BoundFactCalculator.C
Expand Up @@ -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 ||
Expand Down
4 changes: 2 additions & 2 deletions parseAPI/src/BoundFactData.C
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
6 changes: 3 additions & 3 deletions parseAPI/src/IdiomModelDesc.C
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 9bb5117

Please sign in to comment.