示例#1
0
        public static unsafe Vector8us ShuffleHigh(Vector8us va, ShuffleSel sel)
        {
            ushort *ptr = ((ushort *)&va) + 4;
            int     idx = (int)sel;

            return(new Vector8us(va.v0, va.v1, va.v2, va.v3, *(ptr + ((idx >> 0) & 0x3)), *(ptr + ((idx >> 2) & 0x3)), *(ptr + ((idx >> 4) & 0x3)), *(ptr + ((idx >> 6) & 0x3))));
        }
示例#2
0
        public static unsafe Vector8us ShuffleLow(Vector8us va, ShuffleSel sel)
        {
            ushort *ptr = ((ushort *)&va);
            int     idx = (int)sel;

            return(new Vector8us(*(ptr + ((idx >> 0) & 0x3)), *(ptr + ((idx >> 2) & 0x3)), *(ptr + ((idx >> 4) & 0x3)), *(ptr + ((idx >> 6) & 0x3)), va.v4, va.v5, va.v6, va.v7));
        }
示例#3
0
        public static unsafe Vector4ui Shuffle(Vector4ui v1, ShuffleSel sel)
        {
            uint *ptr = (uint *)&v1;
            int   idx = (int)sel;

            return(new Vector4ui(*(ptr + ((idx >> 0) & 0x3)), *(ptr + ((idx >> 2) & 0x3)), *(ptr + ((idx >> 4) & 0x3)), *(ptr + ((idx >> 6) & 0x3))));
        }
示例#4
0
        public static unsafe Vector4f Shuffle(Vector4f v1, ShuffleSel sel)
        {
            float *ptr = (float *)&v1;
            int    idx = (int)sel;

            return(new Vector4f(*(ptr + ((idx >> 0) & 0x3)), *(ptr + ((idx >> 2) & 0x3)), *(ptr + ((idx >> 4) & 0x3)), *(ptr + ((idx >> 6) & 0x3))));
        }
示例#5
0
        public static unsafe Vector4ui Shuffle(this Vector4ui v1, Vector4ui v2, ShuffleSel sel)
        {
            uint *p1  = (uint *)&v1;
            uint *p2  = (uint *)&v2;
            int   idx = (int)sel;

            return(new Vector4ui(*(p1 + ((idx >> 0) & 0x3)), *(p1 + ((idx >> 2) & 0x3)), *(p2 + ((idx >> 4) & 0x3)), *(p2 + ((idx >> 6) & 0x3))));
        }
示例#6
0
        public static unsafe Vector4f Shuffle(this Vector4f v1, Vector4f v2, ShuffleSel sel)
        {
            float *p1  = (float *)&v1;
            float *p2  = (float *)&v2;
            int    idx = (int)sel;

            return(new Vector4f(*(p1 + ((idx >> 0) & 0x3)), *(p1 + ((idx >> 2) & 0x3)), *(p2 + ((idx >> 4) & 0x3)), *(p2 + ((idx >> 6) & 0x3))));
        }
示例#7
0
		public static unsafe Vector8us ShuffleLow (Vector8us va, ShuffleSel sel)
		{
			ushort *ptr = ((ushort*)&va);
			int idx = (int)sel;
			return new Vector8us (*(ptr + ((idx >> 0) & 0x3)), *(ptr + ((idx >> 2) & 0x3)), *(ptr + ((idx >> 4) & 0x3)), *(ptr + ((idx >> 6) & 0x3)), va.v4, va.v5, va.v6, va.v7);
		}
示例#8
0
		public static unsafe Vector8us ShuffleHigh (Vector8us va, ShuffleSel sel)
		{
			ushort *ptr = ((ushort*)&va) + 4;
			int idx = (int)sel;
			return new Vector8us (va.v0, va.v1, va.v2, va.v3, *(ptr + ((idx >> 0) & 0x3)), *(ptr + ((idx >> 2) & 0x3)), *(ptr + ((idx >> 4) & 0x3)), *(ptr + ((idx >> 6) & 0x3)));
		}
示例#9
0
		public static unsafe Vector4ui Shuffle (this Vector4ui v1, Vector4ui v2, ShuffleSel sel)
		{
			uint *p1 = (uint*)&v1;
			uint *p2 = (uint*)&v2;
			int idx = (int)sel;
			return new Vector4ui (*(p1 + ((idx >> 0) & 0x3)), *(p1 + ((idx >> 2) & 0x3)), *(p2 + ((idx >> 4) & 0x3)), *(p2 + ((idx >> 6) & 0x3))); 
		}
示例#10
0
		public static unsafe Vector4f Shuffle (this Vector4f v1, Vector4f v2, ShuffleSel sel)
		{
			float *p1 = (float*)&v1;
			float *p2 = (float*)&v2;
			int idx = (int)sel;
			return new Vector4f (*(p1 + ((idx >> 0) & 0x3)), *(p1 + ((idx >> 2) & 0x3)), *(p2 + ((idx >> 4) & 0x3)), *(p2 + ((idx >> 6) & 0x3))); 
		}
示例#11
0
		public static unsafe Vector4ui Shuffle (this Vector4ui v1, ShuffleSel sel)
		{
			uint *ptr = (uint*)&v1;
			int idx = (int)sel;
			return new Vector4ui (*(ptr + ((idx >> 0) & 0x3)),*(ptr + ((idx >> 2) & 0x3)),*(ptr + ((idx >> 4) & 0x3)),*(ptr + ((idx >> 6) & 0x3)));
		}
示例#12
0
		public static unsafe Vector4f Shuffle (this Vector4f v1, ShuffleSel sel)
		{
			float *ptr = (float*)&v1;
			int idx = (int)sel;
			return new Vector4f (*(ptr + ((idx >> 0) & 0x3)),*(ptr + ((idx >> 2) & 0x3)),*(ptr + ((idx >> 4) & 0x3)),*(ptr + ((idx >> 6) & 0x3)));
		}
示例#13
0
 void EmitShuffle(ShuffleSel shuffle)
 {
     ilgen.Emit (OpCodes.Ldc_I4, (int)shuffle);
     ilgen.Emit (OpCodes.Call, typeof (VectorOperations).GetMethod ("Shuffle", new Type[] { typeof (Vector4f), typeof (ShuffleSel)}));
 }