private Type GetVecType(AOpCode OpCode, AIoType IoType) { if (!(OpCode is IAOpCodeSimd Op)) { return(typeof(AVec)); } int Size = Op.Size; if (Op.Emitter == AInstEmit.Fmov_Ftoi || Op.Emitter == AInstEmit.Fmov_Itof) { Size |= 2; } if ((Op is AOpCodeMem || Op is IAOpCodeLit) && !(Op is AOpCodeSimdMemMs || Op is AOpCodeSimdMemSs)) { return(Size < 4 ? typeof(ulong) : typeof(AVec)); } else if (IoType == AIoType.VectorI) { return(GetIntType(Size)); } else if (IoType == AIoType.VectorF) { return(GetFloatType(Size)); } return(typeof(AVec)); }
private Type GetOutOperType(AIoType IoType) { //This instruction is used to convert between floating point //types, so the input and output types are different. if (CurrOp.Emitter == AInstEmit.Fcvt_S) { return(GetFloatType(((AOpCodeSimd)CurrOp).Opc)); } else { return(GetOperType(IoType)); } }
private Type GetOperType(AIoType IoType) { switch (IoType & AIoType.Mask) { case AIoType.Flag: return(typeof(bool)); case AIoType.Int: return(GetIntType(CurrOp)); case AIoType.Vector: return(GetVecType(CurrOp, IoType)); } throw new ArgumentException(nameof(IoType)); }
private void Stloc(int Index, AIoType IoType) { ILBlock.Add(new AILOpCodeStore(Index, IoType, CurrOp.RegisterSize)); }
private void Ldloc(int Index, AIoType IoType, ARegisterSize RegisterSize) { ILBlock.Add(new AILOpCodeLoad(Index, IoType, RegisterSize)); }
public AILOpCodeLoad(int Index, AIoType IoType, ARegisterSize RegisterSize) { this.IoType = IoType; this.Index = Index; this.RegisterSize = RegisterSize; }
public AILOpCodeLoad(int Index, AIoType IoType) : this(Index, IoType, ARegisterSize.Int64) { }
public AILOpCodeStore(int Index, AIoType IoType, ARegisterSize RegisterSize = ARegisterSize.Int64) { this.IoType = IoType; this.Index = Index; this.RegisterSize = RegisterSize; }
private void Stloc(int Index, AIoType IoType) { ILBlock.Add(new AILOpCodeStore(Index, IoType, GetOutOperType(IoType))); }
private void Ldloc(int Index, AIoType IoType, Type Type) { ILBlock.Add(new AILOpCodeLoad(Index, IoType, Type)); }
public AILOpCodeLoad(int Index, AIoType IoType, Type OperType) { this.IoType = IoType; this.Index = Index; this.OperType = OperType; }
public AILOpCodeLoad(int Index, AIoType IoType) : this(Index, IoType, null) { }
public AILOpCodeStore(int Index, AIoType IoType) : this(Index, IoType, null) { }