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

Unified Diff: src/core/SkNx.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, 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkNx.h
diff --git a/src/core/SkNx.h b/src/core/SkNx.h
index 253fcf22fea111b8eca4f689145121f51040312e..308addd9283c505e8c799852a389be40b783be19 100644
--- a/src/core/SkNx.h
+++ b/src/core/SkNx.h
@@ -309,6 +309,19 @@ SI Sk4i Sk4f_round(const Sk4f& x) {
(int) lrintf (x[3]), };
}
+// Load 4 Sk4h and transpose them (256 bits total).
+SI void Sk4h_load4(const void* vptr, Sk4h* r, Sk4h* g, Sk4h* b, Sk4h* a) {
+ const uint64_t* ptr = (const uint64_t*)vptr;
+ auto p0 = Sk4h::Load(ptr+0),
+ p1 = Sk4h::Load(ptr+1),
+ p2 = Sk4h::Load(ptr+2),
+ p3 = Sk4h::Load(ptr+3);
+ *r = { p0[0], p1[0], p2[0], p3[0] };
+ *g = { p0[1], p1[1], p2[1], p3[1] };
+ *b = { p0[2], p1[2], p2[2], p3[2] };
+ *a = { p0[3], p1[3], p2[3], p3[3] };
+}
+
// Transpose 4 Sk4h and store (256 bits total).
SI void Sk4h_store4(void* dst, const Sk4h& r, const Sk4h& g, const Sk4h& b, const Sk4h& a) {
uint64_t* dst64 = (uint64_t*) dst;
« no previous file with comments | « src/core/SkHalf.h ('k') | src/core/SkRasterPipelineBlitter.cpp » ('j') | src/opts/SkNx_sse.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698