diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h index 7542e3b4d7..54c95970aa 100644 --- a/src/opts/SkNx_sse.h +++ b/src/opts/SkNx_sse.h @@ -211,10 +211,7 @@ public: #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 return _mm_min_epi32(x.fVec, y.fVec); #else - __m128i less_than = _mm_cmplt_epi32(x.fVec, y.fVec); - __m128i choose_x = _mm_and_si128(less_than, x.fVec); - __m128i choose_y = _mm_andnot_si128(less_than, y.fVec); - return _mm_or_si128(choose_x, choose_y); + return (x < y).thenElse(x, y); #endif } @@ -222,10 +219,7 @@ public: #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE41 return _mm_max_epi32(x.fVec, y.fVec); #else - __m128i greater_than = _mm_cmpgt_epi32(x.fVec, y.fVec); - __m128i choose_x = _mm_and_si128(greater_than, x.fVec); - __m128i choose_y = _mm_andnot_si128(greater_than, y.fVec); - return _mm_or_si128(choose_x, choose_y); + return (x > y).thenElse(x, y); #endif }