Skip to content

Commit

Permalink
Fix: git dirty state.
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Sep 27, 2024
1 parent 4a9f942 commit 3ebf45e
Show file tree
Hide file tree
Showing 43 changed files with 230,710 additions and 232,365 deletions.
2 changes: 2 additions & 0 deletions src/Decompiler/Analysis/LongAddRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ public void ReplaceLongOperations(Block block)
CreateLongUnaryInstruction(loInstr, hiInstr);
Changed = true;
}
if (block.Address.Offset == 0x8CB2)
_ = this; //$DEBUG;
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/UnitTests/Arch/MicroBlaze/MicroBlazeRewriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ public void MicroBlazeRw_sra()
Given_HexString("92640001"); // sra\tr19,r4
AssertCode(
"0|L--|00100000(4): 2 instructions",
"1|L--|r19 = r4 >> 1<i32>",
"2|L--|C = cond(r19)");
"1|L--|C = (r4 & 1<32>) != 0<32> ? 1<32> : 0<32>",
"2|L--|r19 = r4 >> 1<i32>");
}

[Test]
Expand All @@ -487,8 +487,8 @@ public void MicroBlazeRw_src()
Given_HexString("90F90021"); // src r7,r25
AssertCode(
"0|L--|00100000(4): 2 instructions",
"1|L--|r7 = __rcr<word32,int32>(r25, 1<i32>, C)",
"2|L--|C = cond(r7)");
"1|L--|C = (r25 & 1<32>) != 0<32> ? 1<32> : 0<32>",
"2|L--|r7 = __rcr<word32,int32>(r25, 1<i32>, C)");
}

[Test]
Expand All @@ -497,8 +497,8 @@ public void MicroBlazeRw_srl()
Given_HexString("92A40041"); // srl\tr21,r4
AssertCode(
"0|L--|00100000(4): 2 instructions",
"1|L--|r21 = r4 >>u 1<i32>",
"2|L--|C = cond(r21)");
"1|L--|C = (r4 & 1<32>) != 0<32> ? 1<32> : 0<32>",
"2|L--|r21 = r4 >>u 1<i32>");
}

[Test]
Expand Down
42 changes: 27 additions & 15 deletions src/UnitTests/Decompiler/Analysis/ConditionCodeEliminatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,24 +410,36 @@ public void CceEqId()
Assert.AreEqual("branch r == 0<32> foo", stmBr.Instruction.ToString());
}

[Test]
[Test]
[Category(Categories.UnitTests)]
public void CceSetnz()
{
Identifier r = Reg32("r");
Identifier Z = FlagGroup("Z");
Identifier f = Reg32("f");
public void CceSetnz()
{
var sExp =
#region Expected
@"// ProcedureBuilder
// Return size: 0
define ProcedureBuilder
ProcedureBuilder_entry:
def r
// succ: l1
l1:
Mem4[0x123400<32>:word32] = r != 0<32>
ProcedureBuilder_exit:
Statement stmZ = new Statement(Address.Ptr32(0), m.Assign(Z, m.Cond(m.ISub(r, 0))), null);
ssaIds[Z].DefStatement = stmZ;
Statement stmF = new Statement(Address.Ptr32(0), m.Assign(f, m.Test(ConditionCode.NE, Z)), null);
ssaIds[f].DefStatement = stmF;
ssaIds[Z].Uses.Add(stmF);
";
#endregion

Given_ConditionCodeEliminator();
cce.Transform(ssaState);
Assert.AreEqual("f = r != 0<32>", stmF.Instruction.ToString());
}
RunStringTest(sExp, m =>
{
Identifier r = Reg32("r");
Identifier Z = FlagGroup("Z");
Identifier f = Reg32("f");

m.Assign(Z, m.Cond(m.ISub(r, 0)));
m.Assign(f, m.Test(ConditionCode.NE, Z));
m.MStore(m.Word32(0x123400), f);
});
}

[Test]
[Category(Categories.UnitTests)]
Expand Down
4 changes: 2 additions & 2 deletions src/tests/Analysis/DfaReg00005.exp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ bool fn0C00_000C(byte al, selector ds)
fn0C00_000C_entry:
// succ: l0C00_000C
l0C00_000C:
C_6 = cond(al - 0x20<8>) & 2<32> (alias)
SCZO_5 = cond(al - 0x20<8>)
branch al <u 0x20<8> l0C00_0014
// succ: l0C00_0010 l0C00_0014
l0C00_0010:
Mem10[ds:0x201<16>:word16] = Mem0[ds:0x201<16>:word16] + 1<16>
// succ: l0C00_0014
l0C00_0014:
return C_6 != 0<32>
return (SCZO_5 & 2<32>) != 0<32>
// succ: fn0C00_000C_exit
fn0C00_000C_exit:

Loading

0 comments on commit 3ebf45e

Please sign in to comment.