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 #ifndef SkNx_sse_DEFINED | 8 #ifndef SkNx_sse_DEFINED |
9 #define SkNx_sse_DEFINED | 9 #define SkNx_sse_DEFINED |
10 | 10 |
11 // This file may assume <= SSE2, but must check SK_CPU_SSE_LEVEL for anything mo
re recent. | 11 // This file may assume <= SSE2, but must check SK_CPU_SSE_LEVEL for anything mo
re recent. |
12 | 12 |
| 13 #define SKNX_IS_FAST |
| 14 |
13 namespace { // See SkNx.h | 15 namespace { // See SkNx.h |
14 | 16 |
15 | 17 |
16 template <> | 18 template <> |
17 class SkNx<2, float> { | 19 class SkNx<2, float> { |
18 public: | 20 public: |
19 SkNx(const __m128& vec) : fVec(vec) {} | 21 SkNx(const __m128& vec) : fVec(vec) {} |
20 | 22 |
21 SkNx() {} | 23 SkNx() {} |
22 SkNx(float val) : fVec(_mm_set1_ps(val)) {} | 24 SkNx(float val) : fVec(_mm_set1_ps(val)) {} |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 288 |
287 | 289 |
288 template<> | 290 template<> |
289 inline SkNx<4, int> SkNx_cast<int, float, 4>(const SkNx<4, float>& src) { | 291 inline SkNx<4, int> SkNx_cast<int, float, 4>(const SkNx<4, float>& src) { |
290 return _mm_cvttps_epi32(src.fVec); | 292 return _mm_cvttps_epi32(src.fVec); |
291 } | 293 } |
292 | 294 |
293 } // namespace | 295 } // namespace |
294 | 296 |
295 #endif//SkNx_sse_DEFINED | 297 #endif//SkNx_sse_DEFINED |
OLD | NEW |