Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: src/opts/SkNx_sse.h

Issue 1489233005: Don't use the Sk4f gradient impl without SIMD (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: SKNX_IS_FAST Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/opts/SkNx_neon.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/opts/SkNx_neon.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698