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

Unified Diff: src/opts/SkNx_neon.h

Issue 1700473003: NEON f32 <-> f16 and f32 <-> u16 (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: armv8 asm Created 4 years, 10 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
« src/core/SkHalf.h ('K') | « src/core/SkHalf.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkNx_neon.h
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h
index 641e9d296b54014e124ab306a24df328bc1544f9..be37baf3cb20c8c0582797c1011b8e4a126f5c2d 100644
--- a/src/opts/SkNx_neon.h
+++ b/src/opts/SkNx_neon.h
@@ -365,6 +365,14 @@ public:
#undef SHIFT16
#undef SHIFT8
+template<> inline Sk4h SkNx_cast<uint16_t, float>(const Sk4f& src) {
+ return vqmovn_u32(vcvtq_u32_f32(src.fVec));
+}
+
+template<> inline Sk4f SkNx_cast<float, uint16_t>(const Sk4h& src) {
+ return vcvtq_f32_u32(vmovl_u16(src.fVec));
+}
+
template<> inline Sk4b SkNx_cast<uint8_t, float>(const Sk4f& src) {
uint32x4_t _32 = vcvtq_u32_f32(src.fVec);
uint16x4_t _16 = vqmovn_u32(_32);
« src/core/SkHalf.h ('K') | « src/core/SkHalf.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698