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

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

Issue 2184753002: Add Sk4h_load4 for loading F16. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typo Created 4 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
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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 476 }
477 477
478 template<> inline Sk4h SkNx_cast<uint16_t, int>(const Sk4i& src) { 478 template<> inline Sk4h SkNx_cast<uint16_t, int>(const Sk4i& src) {
479 return vmovn_u32(vreinterpretq_u32_s32(src.fVec)); 479 return vmovn_u32(vreinterpretq_u32_s32(src.fVec));
480 } 480 }
481 481
482 static inline Sk4i Sk4f_round(const Sk4f& x) { 482 static inline Sk4i Sk4f_round(const Sk4f& x) {
483 return vcvtq_s32_f32((x + 0.5f).fVec); 483 return vcvtq_s32_f32((x + 0.5f).fVec);
484 } 484 }
485 485
486 static inline void Sk4h_load4(const void* ptr, Sk4h* r, Sk4h* g, Sk4h* b, Sk4h* a) {
487 uint16x4x4_t rgba = vld4_u16((const uint16_t*)ptr);
488 *r = rgba.val[0];
489 *g = rgba.val[1];
490 *b = rgba.val[2];
491 *a = rgba.val[3];
492 }
493
486 static inline void Sk4h_store4(void* dst, const Sk4h& r, const Sk4h& g, const Sk 4h& b, 494 static inline void Sk4h_store4(void* dst, const Sk4h& r, const Sk4h& g, const Sk 4h& b,
487 const Sk4h& a) { 495 const Sk4h& a) {
488 uint16x4x4_t rgba = {{ 496 uint16x4x4_t rgba = {{
489 r.fVec, 497 r.fVec,
490 g.fVec, 498 g.fVec,
491 b.fVec, 499 b.fVec,
492 a.fVec, 500 a.fVec,
493 }}; 501 }};
494 vst4_u16((uint16_t*) dst, rgba); 502 vst4_u16((uint16_t*) dst, rgba);
495 } 503 }
496 504
497 #endif//SkNx_neon_DEFINED 505 #endif//SkNx_neon_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkRasterPipelineBlitter.cpp ('k') | src/opts/SkNx_sse.h » ('j') | src/opts/SkNx_sse.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698