Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 2
0
 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));
     }
 }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
 private void Stloc(int Index, AIoType IoType)
 {
     ILBlock.Add(new AILOpCodeStore(Index, IoType, CurrOp.RegisterSize));
 }
Ejemplo n.º 5
0
 private void Ldloc(int Index, AIoType IoType, ARegisterSize RegisterSize)
 {
     ILBlock.Add(new AILOpCodeLoad(Index, IoType, RegisterSize));
 }
Ejemplo n.º 6
0
 public AILOpCodeLoad(int Index, AIoType IoType, ARegisterSize RegisterSize)
 {
     this.IoType       = IoType;
     this.Index        = Index;
     this.RegisterSize = RegisterSize;
 }
Ejemplo n.º 7
0
 public AILOpCodeLoad(int Index, AIoType IoType) : this(Index, IoType, ARegisterSize.Int64)
 {
 }
Ejemplo n.º 8
0
 public AILOpCodeStore(int Index, AIoType IoType, ARegisterSize RegisterSize = ARegisterSize.Int64)
 {
     this.IoType       = IoType;
     this.Index        = Index;
     this.RegisterSize = RegisterSize;
 }
Ejemplo n.º 9
0
 private void Stloc(int Index, AIoType IoType)
 {
     ILBlock.Add(new AILOpCodeStore(Index, IoType, GetOutOperType(IoType)));
 }
Ejemplo n.º 10
0
 private void Ldloc(int Index, AIoType IoType, Type Type)
 {
     ILBlock.Add(new AILOpCodeLoad(Index, IoType, Type));
 }
Ejemplo n.º 11
0
 public AILOpCodeLoad(int Index, AIoType IoType, Type OperType)
 {
     this.IoType   = IoType;
     this.Index    = Index;
     this.OperType = OperType;
 }
Ejemplo n.º 12
0
 public AILOpCodeLoad(int Index, AIoType IoType) : this(Index, IoType, null)
 {
 }
Ejemplo n.º 13
0
 public AILOpCodeStore(int Index, AIoType IoType) : this(Index, IoType, null)
 {
 }