Exemplo n.º 1
0
        private static bool ValidComputer(Intrinsics flags = Intrinsics.None)
        {
            if (!RemoteExecutor.IsSupported)
            {
                return(false);
            }

            if (flags == Intrinsics.None)
            {
                return(true);
            }

            // I realize we could do a bitwise AND operation here, but this isn't really written for performance.
            if (flags.HasFlag(Intrinsics.Sse) && !Sse.IsSupported)
            {
                return(false);
            }

            if (flags.HasFlag(Intrinsics.Sse2) && !Sse2.IsSupported)
            {
                return(false);
            }

            if (flags.HasFlag(Intrinsics.Sse3) && !Sse3.IsSupported)
            {
                return(false);
            }

            if (flags.HasFlag(Intrinsics.Avx) && !Avx.IsSupported)
            {
                return(false);
            }

            if (flags.HasFlag(Intrinsics.Avx2) && !Avx2.IsSupported)
            {
                return(false);
            }

            if (flags.HasFlag(Intrinsics.AdvSimd) && !AdvSimd.IsSupported)
            {
                return(false);
            }

            if (flags.HasFlag(Intrinsics.AdvSimdArm64) && !AdvSimd.IsSupported)
            {
                return(false);
            }

            return(true);
        }