aboutsummaryrefslogtreecommitdiff
path: root/ChocolArm64/Optimizations.cs
blob: 8fa6f4626c070d6a9a5fc623294a08b4e82ec137 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System.Runtime.Intrinsics.X86;

public static class Optimizations
{
    internal static bool FastFP = true;

    private static bool _useAllSseIfAvailable = true;

    private static bool _useSseIfAvailable   = true;
    private static bool _useSse2IfAvailable  = true;
    private static bool _useSse3IfAvailable  = true;
    private static bool _useSsse3IfAvailable = true;
    private static bool _useSse41IfAvailable = true;
    private static bool _useSse42IfAvailable = true;

    internal static bool UseSse   = (_useAllSseIfAvailable && _useSseIfAvailable)   && Sse.IsSupported;
    internal static bool UseSse2  = (_useAllSseIfAvailable && _useSse2IfAvailable)  && Sse2.IsSupported;
    internal static bool UseSse3  = (_useAllSseIfAvailable && _useSse3IfAvailable)  && Sse3.IsSupported;
    internal static bool UseSsse3 = (_useAllSseIfAvailable && _useSsse3IfAvailable) && Ssse3.IsSupported;
    internal static bool UseSse41 = (_useAllSseIfAvailable && _useSse41IfAvailable) && Sse41.IsSupported;
    internal static bool UseSse42 = (_useAllSseIfAvailable && _useSse42IfAvailable) && Sse42.IsSupported;
}