Exemplo n.º 1
0
        public static Vector4Int64 Subtract(Vector4Int64Param1_3 vector, long scalar)
        {
            if (Avx2.IsSupported)
            {
                Vector4Int64 expand = Vector256.Create(scalar);
                return(Avx2.Add(vector, expand));
            }

            return(Subtract_Software(vector, scalar));
        }
Exemplo n.º 2
0
        public static Vector4Int64 Clamp(Vector4Int64Param1_3 vector, Vector4Int64Param1_3 low, Vector4Int64Param1_3 high)
        {
            if (Avx2.IsSupported)
            {
                Vector4Int64 temp = Avx2.Min(vector, high);
                return(Avx2.Max(temp, low));
            }

            return(Clamp_Software(vector, low, high));
        }
Exemplo n.º 3
0
        public static Vector4Int64 Abs(Vector4Int64Param1_3 vector)
        {
            if (Avx2.IsSupported)
            {
                Vector4Int64 zero = Vector4Int64.Zero;
                zero = Avx2.Subtract(zero, vector); // This gets the inverted results of all elements
                return(Avx2.Max(zero, vector));     // This selects the positive values of the 2 vectors
            }

            return(Abs_Software(vector));
        }