internal static v128 ShortToLong(short2 x) { if (Sse4_1.IsSse41Supported) { return(Sse4_1.cvtepi16_epi64(x)); } else if (Sse2.IsSse2Supported) { v128 sign = Sse2.cmpgt_epi16(default(v128), x); v128 shorts = Sse2.unpacklo_epi16(x, sign); sign = Sse2.unpacklo_epi16(sign, sign); return(Sse2.unpacklo_epi32(shorts, sign)); } else { throw new CPUFeatureCheckException(); } }