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

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

Issue 1286093004: Refactor to put SkXfermode_opts inside SK_OPTS_NS. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months 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') | src/opts/SkOpts_neon.cpp » ('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_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 namespace { // See SkNx.h
14
15
16 template <> 13 template <>
17 class SkNf<2, float> { 14 class SkNf<2, float> {
18 public: 15 public:
19 SkNf(const __m128& vec) : fVec(vec) {} 16 SkNf(const __m128& vec) : fVec(vec) {}
20 17
21 SkNf() {} 18 SkNf() {}
22 explicit SkNf(float val) : fVec(_mm_set1_ps(val)) {} 19 explicit SkNf(float val) : fVec(_mm_set1_ps(val)) {}
23 static SkNf Load(const float vals[2]) { 20 static SkNf Load(const float vals[2]) {
24 return _mm_castsi128_ps(_mm_loadl_epi64((const __m128i*)vals)); 21 return _mm_castsi128_ps(_mm_loadl_epi64((const __m128i*)vals));
25 } 22 }
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 303 }
307 304
308 SkNi thenElse(const SkNi& t, const SkNi& e) const { 305 SkNi thenElse(const SkNi& t, const SkNi& e) const {
309 return _mm_or_si128(_mm_and_si128 (fVec, t.fVec), 306 return _mm_or_si128(_mm_and_si128 (fVec, t.fVec),
310 _mm_andnot_si128(fVec, e.fVec)); 307 _mm_andnot_si128(fVec, e.fVec));
311 } 308 }
312 309
313 __m128i fVec; 310 __m128i fVec;
314 }; 311 };
315 312
316 } // namespace
317
318 #endif//SkNx_sse_DEFINED 313 #endif//SkNx_sse_DEFINED
OLDNEW
« no previous file with comments | « src/opts/SkNx_neon.h ('k') | src/opts/SkOpts_neon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698