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 "SkBlitRow_opts_SSE4.h" | 8 #include "SkBlitRow_opts_SSE4.h" |
| 9 |
| 10 // Some compilers can't compile SSSE3 or SSE4 intrinsics. We give them stub met
hods. |
| 11 // The stubs should never be called, so we make them crash just to confirm that. |
| 12 #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SSE41 |
| 13 void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT, const SkPMColor* SK_REST
RICT, int, U8CPU) { |
| 14 sk_throw(); |
| 15 } |
| 16 |
| 17 #else |
| 18 |
| 19 #include <smmintrin.h> // SSE4.1 intrinsics |
9 #include "SkColorPriv.h" | 20 #include "SkColorPriv.h" |
10 #include "SkColor_opts_SSE2.h" | 21 #include "SkColor_opts_SSE2.h" |
11 #include "SkMSAN.h" | 22 #include "SkMSAN.h" |
12 | 23 |
13 void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT dst, | 24 void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT dst, |
14 const SkPMColor* SK_RESTRICT src, | 25 const SkPMColor* SK_RESTRICT src, |
15 int count, | 26 int count, |
16 U8CPU alpha) { | 27 U8CPU alpha) { |
17 sk_msan_assert_initialized(src, src+count); | 28 sk_msan_assert_initialized(src, src+count); |
18 | 29 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 63 } |
53 | 64 |
54 // Wrap up the last <= 15 pixels. | 65 // Wrap up the last <= 15 pixels. |
55 for (int i = count16*16; i < count; i++) { | 66 for (int i = count16*16; i < count; i++) { |
56 // This check is not really necessarily, but it prevents pointless autov
ectorization. | 67 // This check is not really necessarily, but it prevents pointless autov
ectorization. |
57 if (src[i] & 0xFF000000) { | 68 if (src[i] & 0xFF000000) { |
58 dst[i] = SkPMSrcOver(src[i], dst[i]); | 69 dst[i] = SkPMSrcOver(src[i], dst[i]); |
59 } | 70 } |
60 } | 71 } |
61 } | 72 } |
| 73 |
| 74 #endif |
OLD | NEW |