HardwareCapabilities.cs 950 B

1234567891011121314151617181920212223
  1. using System.Runtime.Intrinsics.X86;
  2. namespace ARMeilleure.CodeGen.X86
  3. {
  4. static class HardwareCapabilities
  5. {
  6. public static bool SupportsSse => Sse.IsSupported;
  7. public static bool SupportsSse2 => Sse2.IsSupported;
  8. public static bool SupportsSse3 => Sse3.IsSupported;
  9. public static bool SupportsSsse3 => Ssse3.IsSupported;
  10. public static bool SupportsSse41 => Sse41.IsSupported;
  11. public static bool SupportsSse42 => Sse42.IsSupported;
  12. public static bool SupportsPclmulqdq => Pclmulqdq.IsSupported;
  13. public static bool SupportsFma => Fma.IsSupported;
  14. public static bool SupportsPopcnt => Popcnt.IsSupported;
  15. public static bool SupportsAesni => Aes.IsSupported;
  16. public static bool SupportsAvx => Avx.IsSupported;
  17. public static bool ForceLegacySse { get; set; }
  18. public static bool SupportsVexEncoding => SupportsAvx && !ForceLegacySse;
  19. }
  20. }