Пример #1
0
        public static void Ldp(AILEmitterCtx Context)
        {
            AOpCodeMemPair Op = (AOpCodeMemPair)Context.CurrOp;

            void EmitReadAndStore(int Rt)
            {
                if (Op.Extend64)
                {
                    EmitReadSx64Call(Context, Op.Size);
                }
                else
                {
                    EmitReadZxCall(Context, Op.Size);
                }

                if (Op is IAOpCodeSimd)
                {
                    Context.EmitStvec(Rt);
                }
                else
                {
                    Context.EmitStintzr(Rt);
                }
            }

            Context.EmitLdarg(ATranslatedSub.MemoryArgIdx);

            EmitLoadAddress(Context);

            EmitReadAndStore(Op.Rt);

            Context.EmitLdarg(ATranslatedSub.MemoryArgIdx);
            Context.EmitLdtmp();
            Context.EmitLdc_I8(1 << Op.Size);

            Context.Emit(OpCodes.Add);

            EmitReadAndStore(Op.Rt2);

            EmitWBackIfNeeded(Context);
        }
Пример #2
0
        public static void Stp(AILEmitterCtx Context)
        {
            AOpCodeMemPair Op = (AOpCodeMemPair)Context.CurrOp;

            Context.EmitLdarg(ATranslatedSub.MemoryArgIdx);

            EmitLoadAddress(Context);

            if (Op is IAOpCodeSimd)
            {
                Context.EmitLdvec(Op.Rt);
            }
            else
            {
                Context.EmitLdintzr(Op.Rt);
            }

            EmitWriteCall(Context, Op.Size);

            Context.EmitLdarg(ATranslatedSub.MemoryArgIdx);
            Context.EmitLdtmp();
            Context.EmitLdc_I8(1 << Op.Size);

            Context.Emit(OpCodes.Add);

            if (Op is IAOpCodeSimd)
            {
                Context.EmitLdvec(Op.Rt2);
            }
            else
            {
                Context.EmitLdintzr(Op.Rt2);
            }

            EmitWriteCall(Context, Op.Size);

            EmitWBackIfNeeded(Context);
        }