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