private static void EmitMoviMvni(ILEmitterCtx context, bool not) { OpCodeSimdImm64 op = (OpCodeSimdImm64)context.CurrOp; Type[] typesSav = new Type[] { UIntTypesPerSizeLog2[op.Size] }; long imm = op.Imm; if (not) { imm = ~imm; } if (op.Size < 3) { context.EmitLdc_I4((int)imm); } else { context.EmitLdc_I8(imm); } context.EmitCall(typeof(Sse2).GetMethod(nameof(Sse2.SetAllVector128), typesSav)); context.EmitStvec(op.Rd); if (op.RegisterSize == RegisterSize.Simd64) { EmitVectorZeroUpper(context, op.Rd); } }
public static void EmitVectorImmOp(ILEmitterCtx context, Action emit, bool binary) { OpCodeSimdImm64 op = (OpCodeSimdImm64)context.CurrOp; int bytes = op.GetBitsCount() >> 3; int elems = bytes >> op.Size; for (int index = 0; index < elems; index++) { if (binary) { EmitVectorExtractZx(context, op.Rd, index, op.Size); } context.EmitLdc_I8(op.Imm); emit(); EmitVectorInsert(context, op.Rd, index, op.Size); } if (op.RegisterSize == RegisterSize.Simd64) { EmitVectorZeroUpper(context, op.Rd); } }
public static void Fmov_V(ILEmitterCtx context) { OpCodeSimdImm64 op = (OpCodeSimdImm64)context.CurrOp; int elems = op.RegisterSize == RegisterSize.Simd128 ? 4 : 2; for (int index = 0; index < (elems >> op.Size); index++) { context.EmitLdc_I8(op.Imm); EmitVectorInsert(context, op.Rd, index, op.Size + 2); } if (op.RegisterSize == RegisterSize.Simd64) { EmitVectorZeroUpper(context, op.Rd); } }