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

Side by Side Diff: src/opts/SkNx_avx.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/effects/gradients/SkLinearGradient.cpp ('k') | src/opts/SkNx_neon.h » ('j') | 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_avx_DEFINED 8 #ifndef SkNx_avx_DEFINED
9 #define SkNx_avx_DEFINED 9 #define SkNx_avx_DEFINED
10 10
11 // This file may assume <= AVX, but must check SK_CPU_SSE_LEVEL for anything mor e recent. 11 // This file may assume <= AVX, but must check SK_CPU_SSE_LEVEL for anything mor e recent.
12 12
13 // All the SSE specializations are still good ideas. We'll just add Sk8f. 13 // All the SSE specializations are still good ideas. We'll just add Sk8f.
14 #include "SkNx_sse.h" 14 #include "SkNx_sse.h"
15 15
16 // SkNx_sse.h defines SKNX_IS_FAST.
17
16 namespace { // See SkNx.h 18 namespace { // See SkNx.h
17 19
18 template <> 20 template <>
19 class SkNx<8, float> { 21 class SkNx<8, float> {
20 public: 22 public:
21 SkNx(const __m256& vec) : fVec(vec) {} 23 SkNx(const __m256& vec) : fVec(vec) {}
22 24
23 SkNx() {} 25 SkNx() {}
24 SkNx(float val) : fVec(_mm256_set1_ps(val)) {} 26 SkNx(float val) : fVec(_mm256_set1_ps(val)) {}
25 static SkNx Load(const float vals[8]) { return _mm256_loadu_ps(vals); } 27 static SkNx Load(const float vals[8]) { return _mm256_loadu_ps(vals); }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 SkNx thenElse(const SkNx& t, const SkNx& e) const { 83 SkNx thenElse(const SkNx& t, const SkNx& e) const {
82 return _mm256_blendv_ps(e.fVec, t.fVec, fVec); 84 return _mm256_blendv_ps(e.fVec, t.fVec, fVec);
83 } 85 }
84 86
85 __m256 fVec; 87 __m256 fVec;
86 }; 88 };
87 89
88 } // namespace 90 } // namespace
89 91
90 #endif//SkNx_avx_DEFINED 92 #endif//SkNx_avx_DEFINED
OLDNEW
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/opts/SkNx_neon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698