+2009-01-19 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * Vector*.cs: Add ToString, single element constructors
+ and some helper constants.
+
2009-01-07 Rodrigo Kumpera <rkumpera@novell.com>
* Vector*.cs: Use explicit layout to avoid the runtime
this.v12 = v12;
this.v13 = v13;
this.v14 = v14;
- this.v15 = v15; }
+ this.v15 = v15;
+ }
+
+ public Vector16b (byte b)
+ {
+ this.v0 = b;
+ this.v1 = b;
+ this.v2 = b;
+ this.v3 = b;
+ this.v4 = b;
+ this.v5 = b;
+ this.v6 = b;
+ this.v7 = b;
+ this.v8 = b;
+ this.v9 = b;
+ this.v10 = b;
+ this.v11 = b;
+ this.v12 = b;
+ this.v13 = b;
+ this.v14 = b;
+ this.v15 = b;
+ }
public byte V0 { get { return v0; } set { v0 = value; } }
public byte V1 { get { return v1; } set { v1 = value; } }
public byte V14 { get { return v14; } set { v14 = value; } }
public byte V15 { get { return v15; } set { v15 = value; } }
+ public static Vector16b One
+ {
+ get {return new Vector16b (1); }
+ }
+
+ public static Vector16b Zero
+ {
+ get {return new Vector16b (0); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe byte this [int index]
{
public static unsafe void PrefetchNonTemporal (Vector16b *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + v0 + ", " + v1 + ", " + v2 + ", " + v3 + ", " +
+ v4 + ", " + v5 + ", " + v6 + ", " + v7 + ", " +
+ + v8 + ", " + v9 + ", " + v10 + ", " + v11 + ", " +
+ v12 + ", " + v13 + ", " + v14 + ", " + v15 + ">";
+ }
}
}
this.v12 = v12;
this.v13 = v13;
this.v14 = v14;
- this.v15 = v15; }
+ this.v15 = v15;
+ }
+
+ public Vector16sb (sbyte sb)
+ {
+ this.v0 = sb;
+ this.v1 = sb;
+ this.v2 = sb;
+ this.v3 = sb;
+ this.v4 = sb;
+ this.v5 = sb;
+ this.v6 = sb;
+ this.v7 = sb;
+ this.v8 = sb;
+ this.v9 = sb;
+ this.v10 = sb;
+ this.v11 = sb;
+ this.v12 = sb;
+ this.v13 = sb;
+ this.v14 = sb;
+ this.v15 = sb;
+ }
public sbyte V0 { get { return v0; } set { v0 = value; } }
public sbyte V1 { get { return v1; } set { v1 = value; } }
public sbyte V14 { get { return v14; } set { v14 = value; } }
public sbyte V15 { get { return v15; } set { v15 = value; } }
+ public static Vector16sb One
+ {
+ get { return new Vector16sb (1); }
+ }
+
+ public static Vector16sb Zero
+ {
+ get { return new Vector16sb (0); }
+ }
+
+ public static Vector16sb MinusOne
+ {
+ get { return new Vector16sb (-1); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe sbyte this [int index]
{
public static unsafe void PrefetchNonTemporal (Vector16sb *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + v0 + ", " + v1 + ", " + v2 + ", " + v3 + ", " +
+ v4 + ", " + v5 + ", " + v6 + ", " + v7 + ", " +
+ + v8 + ", " + v9 + ", " + v10 + ", " + v11 + ", " +
+ v12 + ", " + v13 + ", " + v14 + ", " + v15 + ">";
+ }
}
}
public double X { get { return x; } set { x = value; } }
public double Y { get { return y; } set { y = value; } }
+ public static Vector2d Pi
+ {
+ get { return new Vector2d (System.Math.PI); }
+ }
+
+ public static Vector2d E
+ {
+ get { return new Vector2d (System.Math.E); }
+ }
+
+ public static Vector2d One
+ {
+ get { return new Vector2d (1); }
+ }
+
+ public static Vector2d Zero
+ {
+ get { return new Vector2d (0); }
+ }
+
+ public static Vector2d MinusOne
+ {
+ get { return new Vector2d (-1); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe double this [int index]
{
this.y = y;
}
+ public Vector2d (double d)
+ {
+ this.x = d;
+ this.y = d;
+ }
+
[Acceleration (AccelMode.SSE2)]
public static unsafe Vector2d operator & (Vector2d v1, Vector2d v2)
{
public static unsafe void PrefetchNonTemporal (Vector2d *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + x + ", " + y + ">";
+ }
}
}
public long X { get { return x; } set { x = value; } }
public long Y { get { return y; } set { y = value; } }
+ public static Vector2l One
+ {
+ get { return new Vector2l (1); }
+ }
+
+ public static Vector2l Zero
+ {
+ get { return new Vector2l (0); }
+ }
+
+ public static Vector2l MinusOne
+ {
+ get { return new Vector2l (-1); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe long this [int index]
{
this.y = y;
}
+ public Vector2l (long l)
+ {
+ this.x = l;
+ this.y = l;
+ }
+
[Acceleration (AccelMode.SSE2)]
public static Vector2l operator + (Vector2l v1, Vector2l v2)
{
public static unsafe void PrefetchNonTemporal (Vector2l *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + x + ", " + y + ">";
+ }
}
}
public ulong X { get { return x; } set { x = value; } }
public ulong Y { get { return y; } set { y = value; } }
+ public static Vector2ul One
+ {
+ get { return new Vector2ul (1); }
+ }
+
+ public static Vector2ul Zero
+ {
+ get { return new Vector2ul (0); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe ulong this [int index]
{
this.x = x;
this.y = y;
}
+
+ public Vector2ul (ulong ul)
+ {
+ this.x = ul;
+ this.y = ul;
+ }
[Acceleration (AccelMode.SSE2)]
public static Vector2ul operator + (Vector2ul v1, Vector2ul v2)
public static unsafe void PrefetchNonTemporal (Vector2ul *res)
{
}
+ public override string ToString()
+ {
+ return "<" + x + ", " + y + ">";
+ }
+
}
}
public float Z { get { return z; } set { z = value; } }
public float W { get { return w; } set { w = value; } }
+ public static Vector4f Pi
+ {
+ get { return new Vector4f ((float)System.Math.PI); }
+ }
+
+ public static Vector4f E
+ {
+ get { return new Vector4f ((float)System.Math.E); }
+ }
+
+ public static Vector4f One
+ {
+ get { return new Vector4f (1); }
+ }
+
+ public static Vector4f Zero
+ {
+ get { return new Vector4f (0); }
+ }
+
+ public static Vector4f MinusOne
+ {
+ get { return new Vector4f (-1); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe float this [int index]
{
this.z = z;
this.w = w;
}
+
+ public Vector4f (float f)
+ {
+ this.x = f;
+ this.y = f;
+ this.z = f;
+ this.w = f;
+ }
[Acceleration (AccelMode.SSE1)]
public static unsafe Vector4f operator & (Vector4f v1, Vector4f v2)
public static unsafe void PrefetchNonTemporal (Vector4f *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + x + ", " + y + ", " + z + ", " + w + ">";
+ }
}
}
public int Z { get { return z; } set { z = value; } }
public int W { get { return w; } set { w = value; } }
+ public static Vector4i Identity
+ {
+ get { return new Vector4i (1); }
+ }
+
+ public static Vector4i Zero
+ {
+ get { return new Vector4i (0); }
+ }
+
+ public static Vector4i MinusOne
+ {
+ get { return new Vector4i (-1); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe int this [int index]
{
this.z = z;
this.w = w;
}
+
+ public Vector4i (int i)
+ {
+ this.x = i;
+ this.y = i;
+ this.z = i;
+ this.w = i;
+ }
[Acceleration (AccelMode.SSE2)]
public static Vector4i operator + (Vector4i v1, Vector4i v2)
public static unsafe void PrefetchNonTemporal (Vector4i *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + x + ", " + y + ", " + z + ", " + w + ">";
+ }
}
}
public uint Z { get { return z; } set { z = value; } }
public uint W { get { return w; } set { w = value; } }
+ public static Vector4ui Identity
+ {
+ get { return new Vector4ui (1); }
+ }
+
+ public static Vector4ui Zero
+ {
+ get { return new Vector4ui (0); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe uint this [int index]
{
this.z = z;
this.w = w;
}
+
+ public Vector4ui (uint ui)
+ {
+ this.x = ui;
+ this.y = ui;
+ this.z = ui;
+ this.w = ui;
+ }
[Acceleration (AccelMode.SSE2)]
public static Vector4ui operator + (Vector4ui v1, Vector4ui v2)
public static unsafe void PrefetchNonTemporal (Vector4ui *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + x + ", " + y + ", " + z + ", " + w + ">";
+ }
}
}
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; } }
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]
{
public static unsafe void PrefetchNonTemporal (Vector8s *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + v0 + ", " + v1 + ", " + v2 + ", " + v3 + ", " +
+ v4 + ", " + v5 + ", " + v6 + ", " + v7 + ">";
+ }
}
}
this.v6 = v6;
this.v7 = v7;
}
+
+ public Vector8us (ushort us)
+ {
+ this.v0 = us;
+ this.v1 = us;
+ this.v2 = us;
+ this.v3 = us;
+ this.v4 = us;
+ this.v5 = us;
+ this.v6 = us;
+ this.v7 = us;
+ }
public ushort V0 { get { return v0; } set { v0 = value; } }
public ushort V1 { get { return v1; } set { v1 = value; } }
public ushort V6 { get { return v6; } set { v6 = value; } }
public ushort V7 { get { return v7; } set { v7 = value; } }
+ public static Vector8us Identity
+ {
+ get { return new Vector8us (1); }
+ }
+
+ public static Vector8us Zero
+ {
+ get { return new Vector8us (0); }
+ }
+
[System.Runtime.CompilerServices.IndexerName ("Component")]
public unsafe ushort this [int index]
{
public static unsafe void PrefetchNonTemporal (Vector8us *res)
{
}
+
+ public override string ToString()
+ {
+ return "<" + v0 + ", " + v1 + ", " + v2 + ", " + v3 + ", " +
+ v4 + ", " + v5 + ", " + v6 + ", " + v7 + ">";
+ }
}
}