diff options
author | 2017-07-14 10:17:04 -0400 | |
---|---|---|
committer | 2017-07-14 18:14:04 +0000 | |
commit | e94865e9347f50cbd6b8dd1b9ca165b42cdcdf02 (patch) | |
tree | 0761f4fa4735c229c8ba06ba89f4620e4c1c3546 | |
parent | 8abb9f45379823f417371d3e99f42629fbccd579 (diff) |
Simplify Sk4i's Min/Max
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD
Bug: skia:
Change-Id: Id82a58f2f4d947894bb710cb3190c873b20b98eb
Reviewed-on: https://skia-review.googlesource.com/23404
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
-rw-r--r-- | src/opts/SkNx_sse.h | 10 |
1 files changed, 2 insertions, 8 deletions
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 } |