OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkOpts.h" | 8 #include "SkOpts.h" |
9 | 9 |
10 #define SK_OPTS_NS sk_sse41 | 10 #define SK_OPTS_NS sk_sse41 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 return r; | 43 return r; |
44 } | 44 } |
45 static m64i next1(const uint32_t*& ptr) { | 45 static m64i next1(const uint32_t*& ptr) { |
46 auto r = _mm_cvtsi32_si128(*ptr); | 46 auto r = _mm_cvtsi32_si128(*ptr); |
47 ptr += 1; | 47 ptr += 1; |
48 return r; | 48 return r; |
49 } | 49 } |
50 | 50 |
51 // xyzw -> xxxx yyyy zzzz wwww | 51 // xyzw -> xxxx yyyy zzzz wwww |
52 static __m128i replicate_coverage(__m128i xyzw) { | 52 static __m128i replicate_coverage(__m128i xyzw) { |
53 const uint8_t mask[] = { 0,0,0,0, 1,1,1,1, 2,2,2,2, 3,3,3,3 }; | 53 return _mm_shuffle_epi8(xyzw, _mm_setr_epi8(0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2,
2, 3, 3, 3, 3)); |
54 return _mm_shuffle_epi8(xyzw, _mm_load_si128((const __m128i*)mask)); | |
55 } | 54 } |
56 | 55 |
57 static __m128i next4(const uint8_t*& ptr) { | 56 static __m128i next4(const uint8_t*& ptr) { |
58 auto r = replicate_coverage(_mm_cvtsi32_si128(*(const uint32_t*)ptr)); | 57 auto r = replicate_coverage(_mm_cvtsi32_si128(*(const uint32_t*)ptr)); |
59 ptr += 4; | 58 ptr += 4; |
60 return r; | 59 return r; |
61 } | 60 } |
62 static m64i next2(const uint8_t*& ptr) { | 61 static m64i next2(const uint8_t*& ptr) { |
63 auto r = replicate_coverage(_mm_cvtsi32_si128(*(const uint16_t*)ptr)); | 62 auto r = replicate_coverage(_mm_cvtsi32_si128(*(const uint16_t*)ptr)); |
64 ptr += 2; | 63 ptr += 2; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 box_blur_xx = sk_sse41::box_blur_xx; | 220 box_blur_xx = sk_sse41::box_blur_xx; |
222 box_blur_xy = sk_sse41::box_blur_xy; | 221 box_blur_xy = sk_sse41::box_blur_xy; |
223 box_blur_yx = sk_sse41::box_blur_yx; | 222 box_blur_yx = sk_sse41::box_blur_yx; |
224 | 223 |
225 #ifndef SK_SUPPORT_LEGACY_X86_BLITS | 224 #ifndef SK_SUPPORT_LEGACY_X86_BLITS |
226 blit_row_color32 = sk_sse41::blit_row_color32; | 225 blit_row_color32 = sk_sse41::blit_row_color32; |
227 blit_mask_d32_a8 = sk_sse41::blit_mask_d32_a8; | 226 blit_mask_d32_a8 = sk_sse41::blit_mask_d32_a8; |
228 #endif | 227 #endif |
229 } | 228 } |
230 } | 229 } |
OLD | NEW |