Пример #1
0
        public float8(float3 x012, float3 x345, float2 x67)
        {
            if (Sse2.IsSse2Supported)
            {
                v128 mid = Sse2.bsrli_si128(*(v128 *)&x345, sizeof(float));
                v128 hi  = Sse2.unpacklo_pd(mid, *(v128 *)&x67);

                mid = Sse2.bslli_si128(*(v128 *)&x345, 3 * sizeof(float));
                v128 lo;

                if (Sse4_1.IsSse41Supported)
                {
                    lo = Sse4_1.blend_ps(*(v128 *)&x012, mid, 0b1000);
                }
                else
                {
                    lo = Mask.BlendV(*(v128 *)&x012, mid, new v128(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255), false);
                }


                this = new float8(*(float4 *)&lo, *(float4 *)&hi);
            }
            else
            {
                this = new float8
                {
                    _v4_0 = new float4(x012, x345.x),
                    _v4_4 = new float4(x345.yz, x67)
                };
            }
        }
Пример #2
0
        public float8(float2 x01, float3 x234, float3 x567)
        {
            if (Sse2.IsSse2Supported)
            {
                v128 lo  = Sse2.unpacklo_pd(*(v128 *)&x01, *(v128 *)&x234);
                v128 mid = Sse2.bsrli_si128(*(v128 *)&x234, 2 * sizeof(float));
                v128 hi  = Sse2.bslli_si128(*(v128 *)&x567, sizeof(float));

                if (Sse4_1.IsSse41Supported)
                {
                    hi = Sse4_1.blend_ps(mid, hi, 0b1110);
                }
                else
                {
                    hi = Mask.BlendV(mid, hi, new v128(0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255), false);
                }


                this = new float8(*(float4 *)&lo, *(float4 *)&hi);
            }
            else
            {
                this = new float8
                {
                    _v4_0 = new float4(x01, x234.xy),
                    _v4_4 = new float4(x234.z, x567)
                };
            }
        }
Пример #3
0
        public float8(float3 x012, float2 x34, float3 x567)
        {
            if (Sse4_1.IsSse41Supported)
            {
                v128 mid = Sse2.bslli_si128(*(v128 *)&x34, 3 * sizeof(float));
                v128 lo  = Sse4_1.blend_ps(*(v128 *)&x012, mid, 0b1000);

                mid = Sse2.bsrli_si128(*(v128 *)&x34, sizeof(float));

                v128 hi = Sse2.bslli_si128(*(v128 *)&x567, sizeof(float));
                hi = Sse4_1.blend_ps(mid, hi, 0b1110);


                this = new float8(*(float4 *)&lo, *(float4 *)&hi);
            }
            else if (Sse2.IsSse2Supported)
            {
                v128 mid = Sse2.bslli_si128(*(v128 *)&x34, 3 * sizeof(float));
                v128 lo  = Mask.BlendV(*(v128 *)&x012, mid, new v128(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255), false);

                mid = Sse2.bsrli_si128(*(v128 *)&x34, sizeof(float));

                v128 hi = Sse2.bslli_si128(*(v128 *)&x567, sizeof(float));
                hi = Mask.BlendV(mid, hi, new v128(0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255), false);


                this = new float8(*(float4 *)&lo, *(float4 *)&hi);
            }
            else
            {
                this = new float8
                {
                    _v4_0 = new float4(x012, x34.x),
                    _v4_4 = new float4(x34.y, x567)
                };
            }
        }