当前位置: 首页>>代码示例>>C#>>正文


C# ProcedureBuilder.Dpb方法代码示例

本文整理汇总了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);
        }
开发者ID:uxmal,项目名称:reko,代码行数:51,代码来源:ValuePropagationTests.cs

示例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());
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:24,代码来源:TraitCollectorTests.cs

示例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();
			}
		}
开发者ID:uxmal,项目名称:reko,代码行数:26,代码来源:ValuePropagationTests.cs

示例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();
            }
        }
开发者ID:nemerle,项目名称:reko,代码行数:27,代码来源:ValuePropagationTests.cs


注:本文中的Reko.UnitTests.Mocks.ProcedureBuilder.Dpb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。