Exemplo n.º 1
0
        private static void EmitSse42Crc32(ILEmitterCtx context, Type tCrc, Type tData)
        {
            OpCodeAluRs64 op = (OpCodeAluRs64)context.CurrOp;

            context.EmitLdintzr(op.Rn);
            context.EmitLdintzr(op.Rm);

            context.EmitCall(typeof(Sse42).GetMethod(nameof(Sse42.Crc32), new Type[] { tCrc, tData }));

            context.EmitStintzr(op.Rd);
        }
Exemplo n.º 2
0
        public static void Extr(ILEmitterCtx context)
        {
            // TODO: Ensure that the Shift is valid for the Is64Bits.
            OpCodeAluRs64 op = (OpCodeAluRs64)context.CurrOp;

            context.EmitLdintzr(op.Rm);

            if (op.Shift > 0)
            {
                context.EmitLdc_I4(op.Shift);

                context.Emit(OpCodes.Shr_Un);

                context.EmitLdintzr(op.Rn);
                context.EmitLdc_I4(op.GetBitsCount() - op.Shift);

                context.Emit(OpCodes.Shl);
                context.Emit(OpCodes.Or);
            }

            EmitAluStore(context);
        }
Exemplo n.º 3
0
        private static void EmitCrc32(ILEmitterCtx context, string name)
        {
            OpCodeAluRs64 op = (OpCodeAluRs64)context.CurrOp;

            context.EmitLdintzr(op.Rn);

            if (op.RegisterSize != RegisterSize.Int32)
            {
                context.Emit(OpCodes.Conv_U4);
            }

            context.EmitLdintzr(op.Rm);

            SoftFallback.EmitCall(context, name);

            if (op.RegisterSize != RegisterSize.Int32)
            {
                context.Emit(OpCodes.Conv_U8);
            }

            context.EmitStintzr(op.Rd);
        }