本文整理汇总了C#中Reko.UnitTests.Mocks.ProcedureBuilder.Dpb方法的典型用法代码示例。如果您正苦于以下问题:C# ProcedureBuilder.Dpb方法的具体用法?C# ProcedureBuilder.Dpb怎么用?C# ProcedureBuilder.Dpb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reko.UnitTests.Mocks.ProcedureBuilder
的用法示例。
在下文中一共展示了ProcedureBuilder.Dpb方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VpLoadDpbSmallerCast
public void VpLoadDpbSmallerCast()
{
var m = new ProcedureBuilder();
var a2 = m.Reg32("a2", 10);
var d3 = m.Reg32("d3", 3);
var tmp = m.Temp(PrimitiveType.Word16, "tmp");
m.Assign(tmp, m.LoadW(a2));
m.Assign(d3, m.Dpb(d3, tmp, 0));
m.Store(m.IAdd(a2, 4), m.Cast(PrimitiveType.Byte, d3));
SsaState ssa = RunTest(m);
var sExp =
#region Expected
@"a2:a2
def: def a2
uses: tmp_2 = Mem0[a2:word16]
Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
Mem0:Global memory
def: def Mem0
uses: tmp_2 = Mem0[a2:word16]
tmp_2: orig: tmp
def: tmp_2 = Mem0[a2:word16]
uses: d3_4 = DPB(d3, tmp_2, 0)
Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
d3:d3
def: def d3
uses: d3_4 = DPB(d3, tmp_2, 0)
d3_4: orig: d3
def: d3_4 = DPB(d3, tmp_2, 0)
Mem5: orig: Mem0
def: Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
// ProcedureBuilder
// Return size: 0
void ProcedureBuilder()
ProcedureBuilder_entry:
def a2
def Mem0
def d3
// succ: l1
l1:
tmp_2 = Mem0[a2:word16]
d3_4 = DPB(d3, tmp_2, 0)
Mem5[a2 + 0x00000004:byte] = (byte) tmp_2
ProcedureBuilder_exit:
";
#endregion
AssertStringsEqual(sExp, ssa);
}
示例2: TrcoDbp
public void TrcoDbp()
{
ProcedureBuilder m = new ProcedureBuilder();
Identifier a = m.Local32("a");
Identifier b = m.LocalByte("b");
var s = m.Assign(a, m.Dpb(a, b, 0));
coll = CreateCollector();
s.Accept(eqb);
s.Accept(coll);
StringWriter sb = new StringWriter();
handler.Traits.Write(sb);
Console.WriteLine(sb);
string exp =
"T_1 (in a : word32)" + nl +
"\ttrait_primitive(word32)" + nl +
"\ttrait_primitive(word32)" + nl +
"\ttrait_primitive(word32)" + nl +
"\ttrait_equal(T_3)" + nl +
"T_2 (in b : byte)" + nl +
"\ttrait_primitive(byte)" + nl +
"T_3 (in DPB(a, b, 0) : word32)" + nl +
"\ttrait_primitive(word32)" + nl;
Assert.AreEqual(exp, sb.ToString());
}
示例3: VpDbpDbp
public void VpDbpDbp()
{
var m = new ProcedureBuilder();
var d1 = m.Reg32("d32",0);
var a1 = m.Reg32("a32",1);
m.Assign(d1, m.Dpb(d1, m.LoadW(a1), 0));
m.Assign(d1, m.Dpb(d1, m.LoadW(m.IAdd(a1, 4)), 0));
Procedure proc = m.Procedure;
var gr = proc.CreateBlockDominatorGraph();
var importResolver = MockRepository.GenerateStub<IImportResolver>();
importResolver.Replay();
var sst = new SsaTransform(new ProgramDataFlow(), proc, importResolver, gr, new HashSet<RegisterStorage>());
var ssa = sst.SsaState;
var vp = new ValuePropagator(arch, ssa);
vp.Transform();
using (FileUnitTester fut = new FileUnitTester("Analysis/VpDpbDpb.txt"))
{
proc.Write(false, fut.TextWriter);
fut.TextWriter.WriteLine();
fut.AssertFilesEqual();
}
}
示例4: VpDbpDbp
public void VpDbpDbp()
{
var m = new ProcedureBuilder();
var d1 = m.Reg32("d32");
var a1 = m.Reg32("a32");
var tmp = m.Frame.CreateTemporary(PrimitiveType.Word16);
m.Assign(d1, m.Dpb(d1, m.LoadW(a1), 0, 16));
m.Assign(d1, m.Dpb(d1, m.LoadW(m.IAdd(a1, 4)), 0, 16));
Procedure proc = m.Procedure;
var gr = proc.CreateBlockDominatorGraph();
SsaTransform sst = new SsaTransform(new ProgramDataFlow(), proc, gr);
SsaState ssa = sst.SsaState;
ssa.DebugDump(true);
var vp = new ValuePropagator(arch, ssa.Identifiers, proc);
vp.Transform();
using (FileUnitTester fut = new FileUnitTester("Analysis/VpDpbDpb.txt"))
{
proc.Write(false, fut.TextWriter);
fut.TextWriter.WriteLine();
fut.AssertFilesEqual();
}
}