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

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

Issue 1230663005: 3-15% speedup to HardLight / Overlay xfermodes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add a test that widenLo() | widenHi() == widenLoHi() Created 5 years, 5 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/Sk4px_none.h ('k') | src/opts/SkNx_sse.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_neon_DEFINED 8 #ifndef SkNx_neon_DEFINED
9 #define SkNx_neon_DEFINED 9 #define SkNx_neon_DEFINED
10 10
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 SkNi operator << (int bits) const { SHIFT16(vshlq_n_u16, fVec, bits); } 330 SkNi operator << (int bits) const { SHIFT16(vshlq_n_u16, fVec, bits); }
331 SkNi operator >> (int bits) const { SHIFT16(vshrq_n_u16, fVec, bits); } 331 SkNi operator >> (int bits) const { SHIFT16(vshrq_n_u16, fVec, bits); }
332 332
333 static SkNi Min(const SkNi& a, const SkNi& b) { return vminq_u16(a.fVec, b.f Vec); } 333 static SkNi Min(const SkNi& a, const SkNi& b) { return vminq_u16(a.fVec, b.f Vec); }
334 334
335 template <int k> uint16_t kth() const { 335 template <int k> uint16_t kth() const {
336 SkASSERT(0 <= k && k < 8); 336 SkASSERT(0 <= k && k < 8);
337 return vgetq_lane_u16(fVec, k&7); 337 return vgetq_lane_u16(fVec, k&7);
338 } 338 }
339 339
340 SkNi thenElse(const SkNi& t, const SkNi& e) const {
341 return vorrq_u16(vandq_u16(t.fVec, fVec),
342 vbicq_u16(e.fVec, fVec));
343 }
344
340 uint16x8_t fVec; 345 uint16x8_t fVec;
341 }; 346 };
342 347
343 template <> 348 template <>
344 class SkNi<16, uint8_t> { 349 class SkNi<16, uint8_t> {
345 public: 350 public:
346 SkNi(const uint8x16_t& vec) : fVec(vec) {} 351 SkNi(const uint8x16_t& vec) : fVec(vec) {}
347 352
348 SkNi() {} 353 SkNi() {}
349 explicit SkNi(uint8_t val) : fVec(vdupq_n_u8(val)) {} 354 explicit SkNi(uint8_t val) : fVec(vdupq_n_u8(val)) {}
(...skipping 29 matching lines...) Expand all
379 uint8x16_t fVec; 384 uint8x16_t fVec;
380 }; 385 };
381 386
382 #undef SHIFT32 387 #undef SHIFT32
383 #undef SHIFT16 388 #undef SHIFT16
384 #undef SHIFT8 389 #undef SHIFT8
385 390
386 } // namespace 391 } // namespace
387 392
388 #endif//SkNx_neon_DEFINED 393 #endif//SkNx_neon_DEFINED
OLDNEW
« no previous file with comments | « src/opts/Sk4px_none.h ('k') | src/opts/SkNx_sse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698