Ejemplo n.º 1
0
        public static int4 nabs(int4 x)
        {
            if (Ssse3.IsSsse3Supported)
            {
                v128 _nabs = Sse2.sub_epi32(default(v128), Ssse3.abs_epi32(*(v128 *)&x));

                return(*(int4 *)&_nabs);
            }
            else if (Sse2.IsSse2Supported)
            {
                v128 _nabs = Mask.BlendV(Sse2.sub_epi32(default(v128), *(v128 *)&x), *(v128 *)&x, Sse2.cmpgt_epi32(default(v128), *(v128 *)&x));

                return(*(int4 *)&_nabs);
            }
            else
            {
                return(new int4(nabs(x.x), nabs(x.y), nabs(x.z), nabs(x.w)));
            }
        }