Exemple #1
0
        /// <summary>Checks if the specified ISA extension is supported by the processor.</summary>
        /// <param name="isaFeature">An object specifying the ISA extension of interest.</param>
        /// <returns>true if processor supports the specified ISA extension and false otherwise.</returns>
        /// <seealso cref="CpuIsaFeature" />
        /// <seealso cref="X86CpuIsaFeature" />
        /// <seealso cref="ArmCpuIsaFeature" />
        /// <seealso cref="MipsCpuIsaFeature" />
        /// <seealso cref="IA64CpuIsaFeature" />
        /// <seealso cref="PowerPCCpuIsaFeature" />
        public static bool IsSupported(CpuIsaFeature isaFeature)
        {
            ulong  isaFeaturesMask = 0;
            Status status          = yepLibrary_GetCpuIsaFeatures(out isaFeaturesMask);

            if (status != Status.Ok)
            {
                throw GetException(status);
            }

            return((unchecked ((long)isaFeaturesMask) & (1L << unchecked ((int)isaFeature.Id))) != 0);
        }
Exemple #2
0
		/// <summary>Checks if the specified ISA extension is supported by the processor.</summary>
		/// <param name="isaFeature">An object specifying the ISA extension of interest.</param>
		/// <returns>true if processor supports the specified ISA extension and false otherwise.</returns>
		/// <seealso cref="CpuIsaFeature" />
		/// <seealso cref="X86CpuIsaFeature" />
		/// <seealso cref="ArmCpuIsaFeature" />
		/// <seealso cref="MipsCpuIsaFeature" />
		/// <seealso cref="IA64CpuIsaFeature" />
		public static bool IsSupported(CpuIsaFeature isaFeature)
		{
			ulong isaFeaturesMask = 0;
			Status status = yepLibrary_GetCpuIsaFeatures(out isaFeaturesMask);
			if (status != Status.Ok)
				throw GetException(status);

			return (unchecked((long)isaFeaturesMask) & (1L << unchecked((int)isaFeature.Id))) != 0;
		}