示例#1
0
        internal static v128 SByteToInt(v128 x)
        {
            if (Sse4_1.IsSse41Supported)
            {
                return(Sse4_1.cvtepi8_epi32(x));
            }
            else if (Sse2.IsSse2Supported)
            {
                v128 sign   = Sse2.cmpgt_epi8(default(v128), x);
                v128 shorts = Sse2.unpacklo_epi8(x, sign);

                sign = Sse2.unpacklo_epi8(sign, sign);
                return(Sse2.unpacklo_epi16(shorts, sign));
            }
            else
            {
                throw new CPUFeatureCheckException();
            }
        }