Beispiel #1
0
        public static bool match(this eArgumentsMask argMask, eRegSize regSize)
        {
            eArgumentsMask thisMask = eArgumentsMask.None;

            if (0 != (regSize & eRegSize.scalarMask))
            {
                if (0 != (argMask & eArgumentsMask.memory))
                {
                    return(false);
                }
                argMask &= ArgTypes.scalarBits;
                switch (regSize)
                {
                case eRegSize.scalar8:
                    thisMask = eArgumentsMask.reg8;
                    break;

                case eRegSize.scalar16:
                    thisMask = eArgumentsMask.reg16 | eArgumentsMask.reg16_32 | eArgumentsMask.reg16_32_64;
                    break;

                case eRegSize.scalar32:
                    thisMask = eArgumentsMask.reg32 | eArgumentsMask.reg16_32 | eArgumentsMask.reg16_32_64;
                    break;

                case eRegSize.scalar64:
                    thisMask = eArgumentsMask.reg64 | eArgumentsMask.reg16_32_64;
                    break;
                }
                return(0 != (argMask & thisMask));
            }

            switch (regSize)
            {
            default:
                return(eArgumentsMask.None == (argMask & eArgumentsMask.memory));

            case eRegSize.mmx:
                thisMask = ArgTypes.mmxBits;
                break;

            case eRegSize.xmm:
                thisMask = ArgTypes.sseBits;
                break;

            case eRegSize.ymm:
                thisMask = ArgTypes.avxBits;
                break;

            case eRegSize.zmm:
                thisMask = ArgTypes.avx512Bits;
                break;
            }
            return(eArgumentsMask.None == (argMask & (ArgTypes.vectorBits ^ thisMask)));
        }
Beispiel #2
0
 static IEnumerable <eArgumentsMask> parseImpl(string raw)
 {
     foreach (string s in raw.Split(s_slash, StringSplitOptions.RemoveEmptyEntries))
     {
         eArgumentsMask res    = eArgumentsMask.None;
         string[]       fields = s.Split(s_comma, StringSplitOptions.RemoveEmptyEntries);
         foreach (string opt in fields)
         {
             eArgumentsMask m;
             if (s_dict.TryGetValue(opt, out m))
             {
                 res |= m;
             }
         }
         yield return(res);
     }
 }
Beispiel #3
0
 public static bool regsOnly(this eArgumentsMask argMask)
 {
     return(0 == (argMask & eArgumentsMask.memory));
 }