Exemple #1
0
        static Constant[] GetConstants()
        {
            var regEnum  = RegisterEnum.Instance;
            var vmmFirst = regEnum[Get_VMM_first()].Value;
            var vmmLast  = regEnum[Get_VMM_last()].Value;

            ConstantUtils.VerifyMask <Register>((1U << IcedConstants.RegisterBits) - 1);
            return(new Constant[] {
                new Constant(ConstantKind.Index, nameof(IcedConstants.MaxOpCount), IcedConstants.MaxOpCount, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, nameof(IcedConstants.MaxInstructionLength), IcedConstants.MaxInstructionLength, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Int32, nameof(IcedConstants.RegisterBits), IcedConstants.RegisterBits, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, IcedConstants.NumberOfCodeValuesName, (uint)CodeEnum.Instance.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "NumberOfRegisters", (uint)regEnum.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "NumberOfMemorySizes", (uint)MemorySizeEnum.Instance.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "NumberOfEncodingKinds", (uint)EncodingKindEnum.Instance.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "NumberOfOpKinds", (uint)OpKindEnum.Instance.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "NumberOfCodeSizes", (uint)CodeSizeEnum.Instance.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "NumberOfRoundingControlValues", (uint)RoundingControlEnum.Instance.Values.Length, ConstantsTypeFlags.None, null),
                // This is the largest vector register. If it's VEX/EVEX, the upper bits are always cleared when writing to any sub reg, eg. YMM0
                new Constant(ConstantKind.Register, "VMM_first", vmmFirst, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Register, "VMM_last", vmmLast, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Int32, "VMM_count", vmmLast - vmmFirst + 1, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Register, "XMM_last", regEnum[Get_VEC_last("XMM")].Value, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Register, "YMM_last", regEnum[Get_VEC_last("YMM")].Value, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Register, "ZMM_last", regEnum[Get_VEC_last("ZMM")].Value, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.Index, "MaxCpuidFeatureInternalValues", (uint)InstrInfoTypes.EnumCpuidFeatureInternal.Values.Length, ConstantsTypeFlags.None, null),
                new Constant(ConstantKind.MemorySize, IcedConstants.FirstBroadcastMemorySizeName, GetFirstBroadcastMemorySize(), ConstantsTypeFlags.None, null),
            });
        }
Exemple #2
0
 static EnumValue[] GetValues()
 {
     ConstantUtils.VerifyMask <Code>((uint)Enum.CodeMask);
     ConstantUtils.VerifyMask <RoundingControl>((uint)Enum.RoundingControlMask);
     ConstantUtils.VerifyMask((uint)Enum.InstrLengthMask, IcedConstants.MaxInstructionLength);
     return(typeof(Enum).GetFields().Where(a => a.IsLiteral).Select(a => new EnumValue((uint)(Enum)a.GetValue(null) !, a.Name, CommentAttribute.GetDocumentation(a))).ToArray());
 }
Exemple #3
0
 InstrOpInfoFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <SizeOverride>((uint)InstrOpInfoFlags.SizeOverrideMask);
     ConstantUtils.VerifyMask <BranchSizeInfo>((uint)InstrOpInfoFlags.BranchSizeInfoMask);
     ConstantUtils.VerifyMask <SignExtendInfo>((uint)InstrOpInfoFlags.SignExtendInfoMask);
     ConstantUtils.VerifyMask <MemorySizeInfo>((uint)InstrOpInfoFlags.MemorySizeInfoMask);
     ConstantUtils.VerifyMask <FarMemorySizeInfo>((uint)InstrOpInfoFlags.FarMemorySizeInfoMask);
     ConstantUtils.VerifyMask <MemorySize>((uint)InstrOpInfoFlags.MemorySizeMask);
 }
 static EnumValue[] GetValues()
 {
     ConstantUtils.VerifyMask <SizeOverride>((uint)Enum.SizeOverrideMask);
     ConstantUtils.VerifyMask <BranchSizeInfo>((uint)Enum.BranchSizeInfoMask);
     ConstantUtils.VerifyMask <SignExtendInfo>((uint)Enum.SignExtendInfoMask);
     ConstantUtils.VerifyMask <MemorySizeInfo>((uint)Enum.MemorySizeInfoMask);
     ConstantUtils.VerifyMask <FarMemorySizeInfo>((uint)Enum.FarMemorySizeInfoMask);
     ConstantUtils.VerifyMask <MemorySize>((uint)Enum.MemorySizeMask);
     return(typeof(Enum).GetFields().Where(a => a.IsLiteral).Select(a => new EnumValue((uint)(Enum)a.GetValue(null) !, a.Name, CommentAttribute.GetDocumentation(a))).ToArray());
 }
Exemple #5
0
 static EnumValue[] GetValues()
 {
     ConstantUtils.VerifyMask <EncodingKind>((uint)Enum.EncodingMask);
     return(typeof(Enum).GetFields().Where(a => a.IsLiteral).Select(a => new EnumValue((uint)(Enum)a.GetValue(null) !, a.Name, CommentAttribute.GetDocumentation(a))).ToArray());
 }
Exemple #6
0
 CodeFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <RoundingControl>((uint)InstrFlags1.RoundingControlMask);
     ConstantUtils.VerifyMask <CodeSize>((uint)InstrFlags1.CodeSizeMask);
 }
Exemple #7
0
 InstrOpInfoFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <SizeOverride>((uint)InstrOpInfoFlags.SizeOverrideMask);
 }
Exemple #8
0
 StateFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <EncodingKind>((uint)StateFlags.EncodingMask);
 }
Exemple #9
0
 MvexInstrFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <MvexRegMemConv>((uint)MvexInstrFlags.MvexRegMemConvMask);
 }
Exemple #10
0
 CodeFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <Code>((uint)CodeFlags.CodeMask);
     ConstantUtils.VerifyMask <RoundingControl>((uint)CodeFlags.RoundingControlMask);
     ConstantUtils.VerifyMask((uint)CodeFlags.InstrLengthMask, IcedConstants.MaxInstructionLength);
 }
Exemple #11
0
 OpKindFlagsEnum(GenTypes genTypes)
 {
     ConstantUtils.VerifyMask <OpKind>((uint)OpKindFlags.OpKindMask);
     ConstantUtils.VerifyMask <CodeSize>((uint)OpKindFlags.CodeSizeMask);
 }