Optimizations.cs 1.3 KB

123456789101112131415161718192021222324252627
  1. using System.Runtime.Intrinsics.X86;
  2. namespace ChocolArm64
  3. {
  4. public static class Optimizations
  5. {
  6. public static bool AssumeStrictAbiCompliance { get; set; } = true;
  7. public static bool FastFP { get; set; } = true;
  8. private const bool UseAllSseIfAvailable = true;
  9. public static bool UseSseIfAvailable { get; set; } = UseAllSseIfAvailable;
  10. public static bool UseSse2IfAvailable { get; set; } = UseAllSseIfAvailable;
  11. public static bool UseSse3IfAvailable { get; set; } = UseAllSseIfAvailable;
  12. public static bool UseSsse3IfAvailable { get; set; } = UseAllSseIfAvailable;
  13. public static bool UseSse41IfAvailable { get; set; } = UseAllSseIfAvailable;
  14. public static bool UseSse42IfAvailable { get; set; } = UseAllSseIfAvailable;
  15. internal static bool UseSse => UseSseIfAvailable && Sse.IsSupported;
  16. internal static bool UseSse2 => UseSse2IfAvailable && Sse2.IsSupported;
  17. internal static bool UseSse3 => UseSse3IfAvailable && Sse3.IsSupported;
  18. internal static bool UseSsse3 => UseSsse3IfAvailable && Ssse3.IsSupported;
  19. internal static bool UseSse41 => UseSse41IfAvailable && Sse41.IsSupported;
  20. internal static bool UseSse42 => UseSse42IfAvailable && Sse42.IsSupported;
  21. }
  22. }