private void LoadLocals(AILEmitter Context, long Inputs, ARegisterType BaseType) { for (int Bit = 0; Bit < 64; Bit++) { long Mask = 1L << Bit; if ((Inputs & Mask) != 0) { ARegister Reg = AILEmitter.GetRegFromBit(Bit, BaseType); Context.Generator.EmitLdarg(ATranslatedSub.StateArgIdx); Context.Generator.Emit(OpCodes.Ldfld, Reg.GetField()); Context.Generator.EmitStloc(Context.GetLocalIndex(Reg)); } } }
private void StoreLocals(AILEmitter Context, long Outputs, ARegisterType BaseType) { for (int Bit = 0; Bit < 64; Bit++) { long Mask = 1L << Bit; if ((Outputs & Mask) != 0) { ARegister Reg = AILEmitter.GetRegFromBit(Bit, BaseType); Context.Generator.EmitLdarg(ATranslatedSub.RegistersArgIdx); Context.Generator.EmitLdloc(Context.GetLocalIndex(Reg)); AILConv.EmitConv( Context, Context.GetLocalType(Reg), Context.GetFieldType(Reg.Type)); Context.Generator.Emit(OpCodes.Stfld, Reg.GetField()); } } }