Exemplo n.º 1
0
        public static void EmitBxWritePc(ArmEmitterContext context, Operand pc, int sourceRegister = 0)
        {
            bool    isReturn = sourceRegister == RegisterAlias.Aarch32Lr || IsA32Return(context);
            Operand mode     = context.BitwiseAnd(pc, Const(1));

            SetFlag(context, PState.TFlag, mode);

            Operand addr = context.ConditionalSelect(mode, context.BitwiseAnd(pc, Const(~1)), context.BitwiseAnd(pc, Const(~3)));

            InstEmitFlowHelper.EmitVirtualJump(context, addr, isReturn);
        }
Exemplo n.º 2
0
        private static void EmitAluWritePc(ArmEmitterContext context, Operand value)
        {
            Debug.Assert(value.Type == OperandType.I32);

            if (IsThumb(context.CurrOp))
            {
                context.StoreToContext();
                bool isReturn = IsA32Return(context);

                Operand addr = context.BitwiseOr(value, Const(1));

                InstEmitFlowHelper.EmitVirtualJump(context, addr, isReturn);
            }
            else
            {
                EmitBxWritePc(context, value);
            }
        }
Exemplo n.º 3
0
        private static void EmitAluWritePc(ArmEmitterContext context, Operand value)
        {
            Debug.Assert(value.Type == OperandType.I32);

            if (((OpCode32)context.CurrOp).IsThumb())
            {
                bool isReturn = IsA32Return(context);
                if (!isReturn)
                {
                    context.StoreToContext();
                }

                InstEmitFlowHelper.EmitVirtualJump(context, value, isReturn);
            }
            else
            {
                EmitBxWritePc(context, value);
            }
        }