Merge pull request #4621 from alexanderkyte/strdup_env
[mono.git] / mcs / class / Mono.Simd / Mono.Simd / Vector8s.cs
index 0d48cf0a770d87cd8f97135cdba64d25733958dc..1008c20920b7b478d1f316f0dc69ea86923c1a98 100644 (file)
@@ -29,6 +29,7 @@ using System.Runtime.InteropServices;
 
 namespace Mono.Simd
 {
+       [Obsolete ("Use the types in the System.Numerics.Vectors namespace")]
        [StructLayout(LayoutKind.Explicit, Pack = 0, Size = 16)]
        public struct Vector8s
        {
@@ -60,6 +61,18 @@ namespace Mono.Simd
                        this.v6 = v6;
                        this.v7 = v7;
                }
+               
+               public Vector8s (short s)
+               {
+                       this.v0 = s;
+                       this.v1 = s;
+                       this.v2 = s;
+                       this.v3 = s;
+                       this.v4 = s;
+                       this.v5 = s;
+                       this.v6 = s;
+                       this.v7 = s;
+               }
 
                public short V0 { get { return v0; } set { v0 = value; } }
                public short V1 { get { return v1; } set { v1 = value; } }
@@ -70,6 +83,21 @@ namespace Mono.Simd
                public short V6 { get { return v6; } set { v6 = value; } }
                public short V7 { get { return v7; } set { v7 = value; } }
 
+               public static Vector8s Identity
+               {
+                       get { return  new Vector8s (1); }
+               }
+
+               public static Vector8s Zero
+               {
+                       get { return  new Vector8s (0); }
+               }
+
+               public static Vector8s MinusOne
+               {
+                       get { return new Vector8s (-1); }
+               }
+
                [System.Runtime.CompilerServices.IndexerName ("Component")]
                public unsafe short this [int index]
                {
@@ -352,5 +380,11 @@ namespace Mono.Simd
                public static unsafe void PrefetchNonTemporal (Vector8s *res)
                {
                }
+               
+               public override string ToString()
+               {
+                       return "<" + v0 + ", " + v1 + ", " + v2 + ", " + v3 + ", " +
+                                       v4 + ", " + v5 + ", " + v6 + ", " + v7 + ">"; 
+               }
        }
 }