Optimizations.cs 1.1 KB

12345678910111213141516171819202122
  1. using System.Runtime.Intrinsics.X86;
  2. public static class Optimizations
  3. {
  4. internal static bool FastFP = true;
  5. private static bool _useAllSseIfAvailable = true;
  6. private static bool _useSseIfAvailable = true;
  7. private static bool _useSse2IfAvailable = true;
  8. private static bool _useSse3IfAvailable = true;
  9. private static bool _useSsse3IfAvailable = true;
  10. private static bool _useSse41IfAvailable = true;
  11. private static bool _useSse42IfAvailable = true;
  12. internal static bool UseSse = (_useAllSseIfAvailable && _useSseIfAvailable) && Sse.IsSupported;
  13. internal static bool UseSse2 = (_useAllSseIfAvailable && _useSse2IfAvailable) && Sse2.IsSupported;
  14. internal static bool UseSse3 = (_useAllSseIfAvailable && _useSse3IfAvailable) && Sse3.IsSupported;
  15. internal static bool UseSsse3 = (_useAllSseIfAvailable && _useSsse3IfAvailable) && Ssse3.IsSupported;
  16. internal static bool UseSse41 = (_useAllSseIfAvailable && _useSse41IfAvailable) && Sse41.IsSupported;
  17. internal static bool UseSse42 = (_useAllSseIfAvailable && _useSse42IfAvailable) && Sse42.IsSupported;
  18. }