private static void Blx(ILEmitterCtx context, bool x) { IOpCode32BImm op = (IOpCode32BImm)context.CurrOp; uint pc = op.GetPc(); bool isThumb = IsThumb(context.CurrOp); if (!isThumb) { context.EmitLdc_I(op.GetPc() - 4); } else { context.EmitLdc_I(op.GetPc() | 1); } context.EmitStint(GetBankedRegisterAlias(context.Mode, RegisterAlias.Aarch32Lr)); //If x is true, then this is a branch with link and exchange. //In this case we need to swap the mode between Arm <-> Thumb. if (x) { context.EmitLdc_I4(isThumb ? 0 : 1); context.EmitStflg((int)PState.TBit); } InstEmitFlowHelper.EmitCall(context, op.Imm); }
public static void Bl(ILEmitterCtx context) { OpCodeBImmAl64 op = (OpCodeBImmAl64)context.CurrOp; context.EmitLdc_I(op.Position + 4); context.EmitStint(RegisterAlias.Lr); context.EmitStoreState(); InstEmitFlowHelper.EmitCall(context, op.Imm); }