More efficient absolute value on SSE2

This commit is contained in:
Matt Sarett 2016-06-20 08:59:25 -04:00
parent 4a8105e925
commit 36762ac4b4

View File

@ -208,7 +208,7 @@ static __m128i abs_i16(__m128i x) {
x = _mm_xor_si128(x, is_negative);
/* +1 to negative lanes, else +0. */
x = _mm_add_epi16(x, _mm_srli_epi16(is_negative, 15));
x = _mm_sub_epi16(x, is_negative);
return x;
#endif
}