コード例 #1
0
            public zSeriesInstruction MakeInstruction()
            {
                var instr = new zSeriesInstruction
                {
                    Opcode = this.opcode,
                    Ops    = this.ops.ToArray(),
                };

                return(instr);
            }
コード例 #2
0
            public zSeriesInstruction MakeInstruction()
            {
                var instr = new zSeriesInstruction
                {
                    Mnemonic = this.opcode,
                    Operands = this.ops.ToArray(),
                };

                return(instr);
            }
コード例 #3
0
 public zSeriesRewriter(zSeriesArchitecture arch, EndianImageReader rdr, ProcessorState state, IStorageBinder binder, IRewriterHost host)
 {
     this.arch   = arch;
     this.rdr    = rdr;
     this.state  = state;
     this.binder = binder;
     this.host   = host;
     this.dasm   = new zSeriesDisassembler(arch, rdr).GetEnumerator();
     this.cmp    = new ExpressionValueComparer();
     this.instr  = null !;
     this.m      = null !;
 }
コード例 #4
0
        public IEnumerator <RtlInstructionCluster> GetEnumerator()
        {
            while (dasm.MoveNext())
            {
                this.instr  = dasm.Current;
                this.iclass = instr.InstructionClass;
                var instrs = new List <RtlInstruction>();
                this.m = new RtlEmitter(instrs);
                switch (instr.Mnemonic)
                {
                default:
                    host.Warn(instr.Address, "zSeries instruction {0} not implemented yet.", instr);
                    EmitUnitTest();
                    goto case Mnemonic.invalid;

                case Mnemonic.invalid:
                    iclass = InstrClass.Invalid;
                    m.Invalid();
                    break;

                case Mnemonic.a: RewriteA(PrimitiveType.Int32); break;

                case Mnemonic.ad: RewriteFAdd(LongHexFloat); break;

                case Mnemonic.adr: RewriteFAddReg(PrimitiveType.Real64); break;

                case Mnemonic.ae: RewriteFAdd(ShortHexFloat); break;

                case Mnemonic.aeb: RewriteFAdd(PrimitiveType.Real32); break;

                case Mnemonic.aer: RewriteFAddReg(ShortHexFloat); break;

                case Mnemonic.aghi: RewriteAhi2(PrimitiveType.Word64); break;

                case Mnemonic.aghik: RewriteAhi3(PrimitiveType.Word64); break;

                case Mnemonic.ahi: RewriteAhi2(PrimitiveType.Word32); break;

                case Mnemonic.ahik: RewriteAhi3(PrimitiveType.Word32); break;

                case Mnemonic.agr: RewriteAr(PrimitiveType.Int64); break;

                case Mnemonic.agsi: RewriteAsi(PrimitiveType.Int64); break;

                case Mnemonic.al: RewriteA(PrimitiveType.Word32); break;

                case Mnemonic.alcr: RewriteAdcSbcReg(m.IAdd, PrimitiveType.Word32); break;

                case Mnemonic.alcgr: RewriteAdcSbcReg(m.IAdd, PrimitiveType.Word64); break;

                case Mnemonic.algfr: RewriteAlugfr(m.IAdd, PrimitiveType.Word32, PrimitiveType.Word64); break;

                case Mnemonic.algr: RewriteAr(PrimitiveType.Word64); break;

                case Mnemonic.alr: RewriteAr(PrimitiveType.Word32); break;

                case Mnemonic.ar: RewriteAr(PrimitiveType.Int32); break;

                case Mnemonic.asi: RewriteAsi(PrimitiveType.Int32); break;

                case Mnemonic.aur: RewriteFAddReg(ShortHexFloat); break;

                case Mnemonic.awr: RewriteFAddReg(LongHexFloat); break;

                case Mnemonic.axr: RewriteFpuRegPair(m.FAdd, ExtendedHexFloat); break;

                case Mnemonic.b:   RewriteUnconditionalBranch(); break;

                case Mnemonic.bal: RewriteBranchAndLink(); break;

                case Mnemonic.balr: RewriteBranchAndLinkReg(); break;

                case Mnemonic.bas: RewriteBranchAndLink(); break;

                case Mnemonic.bct: RewriteBranchOnCount(PrimitiveType.Word32); break;

                case Mnemonic.bctr: RewriteBranchOnCount(PrimitiveType.Word32); break;

                case Mnemonic.bctgr: RewriteBranchOnCount(PrimitiveType.Word64); break;

                case Mnemonic.bh: RewriteBranchEa(ConditionCode.UGT); break;

                case Mnemonic.bnl: RewriteBranchEa(ConditionCode.GE); break;

                case Mnemonic.bl:  RewriteBranchEa(ConditionCode.LT); break;

                case Mnemonic.blh: RewriteBranchEa(ConditionCode.NE); break;    //$REVIEW where are these mnemonics defined?

                case Mnemonic.bne: RewriteBranchEa(ConditionCode.NE); break;

                case Mnemonic.bnh: RewriteBranchEa(ConditionCode.ULE); break;

                case Mnemonic.be:  RewriteBranchEa(ConditionCode.EQ); break;

                case Mnemonic.bnle: RewriteBranchEa(ConditionCode.GT); break;

                case Mnemonic.bhe: RewriteBranchEa(ConditionCode.UGE); break;

                case Mnemonic.bnlh: RewriteBranchEa(ConditionCode.NE); break;

                case Mnemonic.ble: RewriteBranchEa(ConditionCode.LE); break;

                case Mnemonic.bnhe: RewriteBranchEa(ConditionCode.ULT); break;

                case Mnemonic.bno: RewriteBranchEa(ConditionCode.NO); break;

                case Mnemonic.bo: RewriteBranchEa(ConditionCode.OV); break;

                case Mnemonic.basr: RewriteBasr(); break;

                case Mnemonic.bassm: RewriteBassm(); break;

                case Mnemonic.ber: RewriteBranch(ConditionCode.EQ); break;

                case Mnemonic.bler: RewriteBranch(ConditionCode.LE); break;

                case Mnemonic.bner: RewriteBranch(ConditionCode.NE); break;

                case Mnemonic.bprp: RewriteBprp(); break;

                case Mnemonic.br: RewriteBr(); break;

                case Mnemonic.brasl: RewriteBrasl(); break;

                case Mnemonic.brctg: RewriteBrctg(); break;

                case Mnemonic.brxh: RewriteBranchOnIndex(m.Gt); break;

                case Mnemonic.brxle: RewriteBranchOnIndex(m.Le); break;

                case Mnemonic.bsm: RewriteBsm(); break;

                case Mnemonic.bxh: RewriteBranchOnIndex(m.Gt); break;

                case Mnemonic.bxle: RewriteBranchOnIndex(m.Le); break;

                case Mnemonic.c: RewriteC(PrimitiveType.Int32); break;

                case Mnemonic.cd: RewriteCmpFloatMem(PrimitiveType.Real64); break;

                case Mnemonic.cdb: RewriteCmpFloatMem(PrimitiveType.Real64); break;

                case Mnemonic.cdr: RewriteCmpFloat(PrimitiveType.Real64); break;

                case Mnemonic.ceb: RewriteCmpFloatMem(PrimitiveType.Real32); break;

                case Mnemonic.cer: RewriteCmpFloat(PrimitiveType.Real32); break;

                case Mnemonic.cghi: RewriteCghi(); break;

                case Mnemonic.cgij: RewriteCij(PrimitiveType.Int64); break;

                case Mnemonic.cgr: RewriteCr(m.ISub, PrimitiveType.Int64); break;

                case Mnemonic.cgrj: RewriteCrj(PrimitiveType.Int64); break;

                case Mnemonic.ch: RewriteCmpH(PrimitiveType.Int32, PrimitiveType.Int16); break;

                case Mnemonic.chi: RewriteChi(); break;

                case Mnemonic.cij: RewriteCij(PrimitiveType.Int32); break;

                case Mnemonic.cl: RewriteCl(PrimitiveType.Word32); break;

                case Mnemonic.clc: RewriteClc(); break;

                case Mnemonic.clcl: RewriteClcl(PrimitiveType.Word128); break;

                case Mnemonic.clcle: RewriteClcl(PrimitiveType.Word128); break;

                case Mnemonic.clg: RewriteCl(PrimitiveType.Word64); break;

                case Mnemonic.clgij: RewriteClij(PrimitiveType.Word64); break;

                case Mnemonic.clgr: RewriteCr(m.USub, PrimitiveType.Word64); break;

                case Mnemonic.clgrl: RewriteClrl(PrimitiveType.Word64); break;

                case Mnemonic.clgrj: RewriteClrj(PrimitiveType.Word64); break;

                case Mnemonic.clfi: RewriteClfi(PrimitiveType.UInt32); break;

                case Mnemonic.cli: RewriteCli(); break;

                case Mnemonic.clij: RewriteClij(PrimitiveType.Word32); break;

                case Mnemonic.cliy: RewriteCli(); break;

                case Mnemonic.clr: RewriteCr(m.USub, PrimitiveType.Word32); break;

                case Mnemonic.clrj: RewriteClrj(PrimitiveType.Word32); break;

                case Mnemonic.clrl: RewriteClrl(PrimitiveType.Word32); break;

                case Mnemonic.cr: RewriteCr(m.ISub, PrimitiveType.Int32); break;

                case Mnemonic.crj: RewriteCrj(PrimitiveType.Int32); break;

                case Mnemonic.cs: RewriteCs(PrimitiveType.Word32); break;

                case Mnemonic.csg: RewriteCs(PrimitiveType.Word64); break;

                case Mnemonic.cvb: RewriteCvb(PrimitiveType.Int32); break;

                case Mnemonic.cvd: RewriteCvd(PrimitiveType.Int32); break;

                case Mnemonic.d: RewriteD(); break;

                case Mnemonic.ddr: RewriteFDivR(PrimitiveType.Real64); break;

                case Mnemonic.der: RewriteFDivR(PrimitiveType.Real32); break;

                case Mnemonic.dlgr: RewriteDlr(PrimitiveType.UInt64); break;

                case Mnemonic.dlr: RewriteDlr(PrimitiveType.UInt32); break;

                case Mnemonic.dp: RewriteDp(); break;

                case Mnemonic.dr: RewriteDr(); break;

                case Mnemonic.dsgr: RewriteDsgr(PrimitiveType.Int64); break;

                case Mnemonic.ex: RewriteEx(); break;

                case Mnemonic.exrl: RewriteEx(); break;

                case Mnemonic.hdr: RewriteHalveR(PrimitiveType.Real64, Constant.Real64(2)); break;

                case Mnemonic.her: RewriteHalveR(PrimitiveType.Real32, Constant.Real32(2)); break;

                case Mnemonic.ic: RewriteIc(); break;

                case Mnemonic.j: RewriteJ(); break;

                case Mnemonic.je: RewriteJcc(ConditionCode.EQ); break;

                case Mnemonic.jg: RewriteJcc(ConditionCode.GT); break;

                case Mnemonic.jh: RewriteJcc(ConditionCode.UGT); break;

                case Mnemonic.jl: RewriteJcc(ConditionCode.LT); break;

                case Mnemonic.jle: RewriteJcc(ConditionCode.LE); break;

                case Mnemonic.jhe: RewriteJcc(ConditionCode.UGE); break;

                case Mnemonic.jne: RewriteJcc(ConditionCode.NE); break;

                case Mnemonic.jnh: RewriteJcc(ConditionCode.ULE); break;

                case Mnemonic.jnl: RewriteJcc(ConditionCode.GE); break;

                case Mnemonic.jo: RewriteJcc(ConditionCode.OV); break;

                case Mnemonic.la: RewriteLa(); break;

                case Mnemonic.larl: RewriteLarl(); break;

                case Mnemonic.l: RewriteL(PrimitiveType.Word32); break;

                case Mnemonic.laa: RewriteLaa(m.IAdd, PrimitiveType.Int32); break;

                case Mnemonic.lay: RewriteLay(); break;

                case Mnemonic.lbr: RewriteLr(PrimitiveType.SByte, PrimitiveType.Int32); break;

                case Mnemonic.lcdr: RewriteLcr(LongHexFloat, m.FNeg); break;

                case Mnemonic.lcer: RewriteLcr(ShortHexFloat, m.FNeg); break;

                case Mnemonic.lcr: RewriteLcr(PrimitiveType.Int32, m.Neg); break;

                case Mnemonic.lcgr: RewriteLcr(PrimitiveType.Int64, m.Neg); break;

                case Mnemonic.ld: RewriteL(PrimitiveType.Word64); break;

                case Mnemonic.ldeb: RewriteFConvert(PrimitiveType.Real32, PrimitiveType.Real64); break;

                case Mnemonic.ldxr: RewriteLdxr(); break;

                case Mnemonic.ldr: RewriteLreg(PrimitiveType.Word64); break;

                case Mnemonic.le: RewriteL(PrimitiveType.Real32); break;

                case Mnemonic.ler: RewriteLreg(PrimitiveType.Real32); break;

                case Mnemonic.ledr: RewriteFConvertReg(PrimitiveType.Real64, PrimitiveType.Real32); break;

                case Mnemonic.ldgr: RewriteLdgr(); break;

                case Mnemonic.lg: RewriteL(PrimitiveType.Word64); break;

                case Mnemonic.lgfrl: RewriteL(PrimitiveType.Int32, PrimitiveType.Int64); break;

                case Mnemonic.lh: RewriteL(PrimitiveType.Word16); break;

                case Mnemonic.lhrl: RewriteL(PrimitiveType.Int16, PrimitiveType.Int32); break;

                case Mnemonic.lgdr: RewriteLgdr(); break;

                case Mnemonic.lgf: RewriteLgf(); break;

                case Mnemonic.lgfr: RewriteLgfr(); break;

                case Mnemonic.lghi: RewriteLghi(); break;

                case Mnemonic.lgr: RewriteLreg(PrimitiveType.Word64); break;

                case Mnemonic.lgrl: RewriteLgrl(); break;

                case Mnemonic.lhi: RewriteLhi(); break;

                case Mnemonic.llcr: RewriteLr(PrimitiveType.Byte, PrimitiveType.Word32); break;

                case Mnemonic.llgcr: RewriteLr(PrimitiveType.Byte, PrimitiveType.Word64); break;

                case Mnemonic.llgfr: RewriteLr(PrimitiveType.Word32, PrimitiveType.Word64); break;

                case Mnemonic.llgfrl: RewriteLl(PrimitiveType.Word32); break;

                case Mnemonic.llill: RewriteLli(PrimitiveType.Word16, 0); break;

                case Mnemonic.lmg: RewriteLmg(); break;

                case Mnemonic.lndr: RewriteFNegR(LongHexFloat); break;

                case Mnemonic.lner: RewriteFNegR(ShortHexFloat); break;

                case Mnemonic.lngr: RewriteLnr(PrimitiveType.Int64); break;

                case Mnemonic.lnr: RewriteLnr(PrimitiveType.Int32); break;

                case Mnemonic.locg: RewriteLoc(PrimitiveType.Word64, ConditionCode.ALWAYS); break;

                case Mnemonic.locgre: RewriteLoc(PrimitiveType.Word64, ConditionCode.EQ); break;

                case Mnemonic.locgrh: RewriteLoc(PrimitiveType.Word64, ConditionCode.UGT); break;

                case Mnemonic.locgrle: RewriteLoc(PrimitiveType.Word64, ConditionCode.LE); break;

                case Mnemonic.locgrne: RewriteLoc(PrimitiveType.Word64, ConditionCode.NE); break;

                case Mnemonic.locgrnhe: RewriteLoc(PrimitiveType.Word64, ConditionCode.ULE); break;

                case Mnemonic.locgrnl: RewriteLoc(PrimitiveType.Word64, ConditionCode.GE); break;

                case Mnemonic.locgrnle: RewriteLoc(PrimitiveType.Word64, ConditionCode.GT); break;

                case Mnemonic.lpdr: RewriteLpr("fabs", LongHexFloat); break;

                case Mnemonic.lper: RewriteLpr("fabsf", ShortHexFloat); break;

                case Mnemonic.lpgr: RewriteLpr("abs", PrimitiveType.Int64); break;

                case Mnemonic.lpr: RewriteLpr("abs", PrimitiveType.Int32); break;

                case Mnemonic.lr: RewriteLr(PrimitiveType.Word32, PrimitiveType.Word32); break;

                case Mnemonic.lra: RewriteLra(); break;

                case Mnemonic.lrl: RewriteL(PrimitiveType.Word32); break;

                case Mnemonic.lrvgr: RewriteLrv(PrimitiveType.Word64); break;

                case Mnemonic.lrvr: RewriteLrv(PrimitiveType.Word32); break;

                case Mnemonic.lt: RewriteLt(PrimitiveType.Word32); break;

                case Mnemonic.ltdr: RewriteLtdr(PrimitiveType.Real64, Constant.Real64(0.0)); break;

                case Mnemonic.lter: RewriteLtdr(PrimitiveType.Real32, Constant.Real32(0.0F)); break;

                case Mnemonic.ltg: RewriteLt(PrimitiveType.Word64); break;

                case Mnemonic.ltgr: RewriteLtr(PrimitiveType.Word64); break;

                case Mnemonic.ltr: RewriteLtr(PrimitiveType.Word32); break;

                case Mnemonic.m: RewriteM(PrimitiveType.Int32, PrimitiveType.Int64); break;

                case Mnemonic.md: RewriteFMul(LongHexFloat, LongHexFloat); break;

                case Mnemonic.mdb: RewriteFMul(PrimitiveType.Real64, PrimitiveType.Real64); break;

                case Mnemonic.mde: RewriteFMul(ShortHexFloat, LongHexFloat); break;

                case Mnemonic.mdr: RewriteFMulReg(LongHexFloat, LongHexFloat); break;

                case Mnemonic.medr: RewriteFMulReg(ShortHexFloat, LongHexFloat); break;

                case Mnemonic.meeb: RewriteFMul(PrimitiveType.Real32, PrimitiveType.Real32); break;

                case Mnemonic.meer: RewriteFMulReg(ShortHexFloat, ShortHexFloat); break;

                case Mnemonic.mh: RewriteAluH(m.SMul, PrimitiveType.Int32, PrimitiveType.Int16); break;

                case Mnemonic.mlgr: RewriteMr(m.UMul, PrimitiveType.UInt64, PrimitiveType.UInt128); break;

                case Mnemonic.mr: RewriteMr(m.SMul, PrimitiveType.Int32, PrimitiveType.Int64); break;

                case Mnemonic.msgr: RewriteMulR(PrimitiveType.Int64); break;

                case Mnemonic.mvcle: RewriteMvcle(); break;

                case Mnemonic.mvhi: RewriteMvi(PrimitiveType.Word16); break;

                case Mnemonic.mvi: RewriteMvi(PrimitiveType.Byte); break;

                case Mnemonic.mvz: RewriteMvz(); break;

                case Mnemonic.mxd: RewriteFMul(LongHexFloat, ExtendedHexFloat); break;

                case Mnemonic.mxdr: RewriteFMulReg(LongHexFloat, ExtendedHexFloat); break;

                case Mnemonic.mxr: RewriteFpuRegPair(m.FMul, ExtendedHexFloat); break;

                case Mnemonic.nc: RewriteNc(); break;

                case Mnemonic.ngr: RewriteLogicR(PrimitiveType.Word64, m.And); break;

                case Mnemonic.n: RewriteLogic(PrimitiveType.Word32, m.And); break;

                case Mnemonic.ni: RewriteNi(); break;

                case Mnemonic.nop: m.Nop(); break;

                case Mnemonic.nopr: m.Nop(); break;

                case Mnemonic.nr: RewriteLogicR(PrimitiveType.Word32, m.And); break;

                case Mnemonic.o: RewriteLogic(PrimitiveType.Word32, m.Or); break;

                case Mnemonic.ogr: RewriteLogicR(PrimitiveType.Word64, m.Or); break;

                case Mnemonic.oi: RewriteOi(); break;

                case Mnemonic.or: RewriteLogicR(PrimitiveType.Word32, m.Or); break;

                case Mnemonic.risbg: RewriteRisbg("__risbg"); break;

                case Mnemonic.risbgn: RewriteRisbg("__risbgn"); break;

                case Mnemonic.rllg: RewriteShift3(PrimitiveType.Word64, Rol); break;

                case Mnemonic.s: RewriteS(PrimitiveType.Int32); break;

                case Mnemonic.sh: RewriteAluH(m.ISub, PrimitiveType.Int32, PrimitiveType.Int16); break;

                case Mnemonic.sl: RewriteS(PrimitiveType.Word32); break;

                case Mnemonic.sd: RewriteFSub(LongHexFloat); break;

                case Mnemonic.sdb: RewriteFSub(PrimitiveType.Real64); break;

                case Mnemonic.sdr: RewriteFSubReg(LongHexFloat); break;

                case Mnemonic.se: RewriteFSub(ShortHexFloat); break;

                case Mnemonic.seb: RewriteFSub(PrimitiveType.Real32); break;

                case Mnemonic.ser: RewriteFSubReg(ShortHexFloat); break;

                case Mnemonic.sr: RewriteSub2(PrimitiveType.Int32); break;

                case Mnemonic.sgfr: RewriteAlugfr(m.ISub, PrimitiveType.Int32, PrimitiveType.Int64); break;

                case Mnemonic.sgr: RewriteSub2(PrimitiveType.Int64); break;

                case Mnemonic.sla: RewriteShift2(PrimitiveType.Int32, m.Shl); break;

                case Mnemonic.slgfr: RewriteAlugfr(m.USub, PrimitiveType.Word32, PrimitiveType.Word64); break;

                case Mnemonic.slgr: RewriteSub2(PrimitiveType.Word64); break;

                case Mnemonic.slfi: RewriteSub2(PrimitiveType.Word32); break;

                case Mnemonic.sll: RewriteShift2(PrimitiveType.Word32, m.Shl); break;  //$TODO: CC's are handled unsigned.

                case Mnemonic.slr: RewriteSub2(PrimitiveType.Word32); break;

                case Mnemonic.slrk: RewriteAlu3(m.USub, PrimitiveType.Word32); break;

                case Mnemonic.sllg: RewriteShift3(PrimitiveType.Word64, m.Shl); break;

                case Mnemonic.sllk: RewriteShift3(PrimitiveType.Word32, m.Shl); break;

                case Mnemonic.sra: RewriteShift2(PrimitiveType.Int32, m.Sar); break;

                case Mnemonic.srag: RewriteShift3(PrimitiveType.Int64, m.Sar); break;

                case Mnemonic.srak: RewriteShift3(PrimitiveType.Int32, m.Sar); break;

                case Mnemonic.srl: RewriteShift2(PrimitiveType.Word32, m.Shr); break;

                case Mnemonic.srlk: RewriteShift3(PrimitiveType.Word32, m.Shr); break;

                case Mnemonic.srlg: RewriteShift3(PrimitiveType.Word64, m.Shr); break;

                case Mnemonic.srp: RewriteSrp(); break;

                case Mnemonic.st: RewriteSt(PrimitiveType.Word32); break;

                case Mnemonic.stc: RewriteSt(PrimitiveType.Byte); break;

                case Mnemonic.stctl: RewriteStctl(PrimitiveType.Word32); break;

                case Mnemonic.std: RewriteSt(PrimitiveType.Word64); break;

                case Mnemonic.ste: RewriteSt(PrimitiveType.Word32); break;

                case Mnemonic.stg: RewriteSt(PrimitiveType.Word64); break;

                case Mnemonic.sth: RewriteSt(PrimitiveType.Word16); break;

                case Mnemonic.strl: RewriteSt(PrimitiveType.Word32); break;

                case Mnemonic.stgrl: RewriteSt(PrimitiveType.Word64); break;

                case Mnemonic.stmg: RewriteStmg(); break;

                case Mnemonic.su: RewriteFSub(ShortHexFloat); break;

                case Mnemonic.sur: RewriteSur(ShortHexFloat); break;

                case Mnemonic.swr: RewriteSur(LongHexFloat); break;

                case Mnemonic.svc: RewriteSvc(); break;

                case Mnemonic.sxr: RewriteFpuRegPair(m.FSub, ExtendedHexFloat); break;

                case Mnemonic.ts: RewriteTs(); break;

                case Mnemonic.x: RewriteXor2(PrimitiveType.Word32); break;

                case Mnemonic.xgr: RewriteLogicR(PrimitiveType.Word64, m.Xor); break;

                case Mnemonic.xr: RewriteLogicR(PrimitiveType.Word32, m.Xor); break;

                case Mnemonic.xc: RewriteXc(); break;
                }
                yield return(m.MakeCluster(instr.Address, instr.Length, iclass));
            }
        }
コード例 #5
0
ファイル: zSeriesRewriter.cs プロジェクト: ermshiperete/reko
        public IEnumerator <RtlInstructionCluster> GetEnumerator()
        {
            while (dasm.MoveNext())
            {
                this.instr = dasm.Current;
                this.rtlc  = InstrClass.Linear;
                var instrs = new List <RtlInstruction>();
                this.m = new RtlEmitter(instrs);
                switch (instr.Mnemonic)
                {
                default:
                    EmitUnitTest();
                    goto case Mnemonic.invalid;

                case Mnemonic.invalid:
                    rtlc = InstrClass.Invalid;
                    m.Invalid();
                    break;

                case Mnemonic.aghi: RewriteAhi(PrimitiveType.Word64); break;

                case Mnemonic.ahi: RewriteAhi(PrimitiveType.Word32); break;

                case Mnemonic.agr: RewriteAgr(); break;

                case Mnemonic.ar: RewriteAr(); break;

                case Mnemonic.basr: RewriteBasr(); break;

                case Mnemonic.ber: RewriteBranch(ConditionCode.EQ); break;

                case Mnemonic.bler: RewriteBranch(ConditionCode.LE); break;

                case Mnemonic.br: RewriteBr(); break;

                case Mnemonic.brasl: RewriteBrasl(); break;

                case Mnemonic.brctg: RewriteBrctg(); break;

                case Mnemonic.chi: RewriteChi(); break;

                case Mnemonic.clc: RewriteClc(); break;

                case Mnemonic.clg: RewriteClg(); break;

                case Mnemonic.cli: RewriteCli(); break;

                case Mnemonic.j: RewriteJ(); break;

                case Mnemonic.je: RewriteJcc(ConditionCode.EQ); break;

                case Mnemonic.jg: RewriteJcc(ConditionCode.GT); break;

                case Mnemonic.jh: RewriteJcc(ConditionCode.UGT); break;

                case Mnemonic.jne: RewriteJcc(ConditionCode.NE); break;

                case Mnemonic.la: RewriteLa(); break;

                case Mnemonic.larl: RewriteLarl(); break;

                case Mnemonic.l: RewriteL(PrimitiveType.Word32); break;

                case Mnemonic.lg: RewriteL(PrimitiveType.Word64); break;

                case Mnemonic.lgf: RewriteLgf(); break;

                case Mnemonic.lgfr: RewriteLgfr(); break;

                case Mnemonic.lghi: RewriteLghi(); break;

                case Mnemonic.lgr: RewriteLgr(); break;

                case Mnemonic.lhi: RewriteLhi(); break;

                case Mnemonic.lmg: RewriteLmg(); break;

                case Mnemonic.lr: RewriteLr(); break;

                case Mnemonic.ltgr: RewriteLtgr(); break;

                case Mnemonic.mvi: RewriteMvi(); break;

                case Mnemonic.mvz: RewriteMvz(); break;

                case Mnemonic.nc: RewriteNc(); break;

                case Mnemonic.ngr: RewriteNgr(); break;

                case Mnemonic.nopr: m.Nop(); break;

                case Mnemonic.sgr: RewriteSgr(); break;

                case Mnemonic.srag: RewriteSrag(); break;

                case Mnemonic.srlg: RewriteSrlg(); break;

                case Mnemonic.st: RewriteSt(PrimitiveType.Word32); break;

                case Mnemonic.stg: RewriteSt(PrimitiveType.Word64); break;

                case Mnemonic.stmg: RewriteStmg(); break;

                case Mnemonic.xc: RewriteXc(); break;
                }
                yield return(new RtlInstructionCluster(instr.Address, instr.Length, instrs.ToArray())
                {
                    Class = rtlc
                });
            }
        }