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

Unified Diff: src/opts/SkNx_sse.h

Issue 1707673002: fast sk4f <-> sk4i SSE methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ffff 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
« no previous file with comments | « no previous file | tests/SkNxTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkNx_sse.h
diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h
index 7d00ddf9ba4722ef7ff1306e266f40099824cb18..be521a1a311e666f9b67a01ca80038ec3f75c487 100644
--- a/src/opts/SkNx_sse.h
+++ b/src/opts/SkNx_sse.h
@@ -294,6 +294,13 @@ public:
__m128i fVec;
};
+template<> /*static*/ inline Sk4f SkNx_cast<float, int>(const Sk4i& src) {
+ return _mm_cvtepi32_ps(src.fVec);
+}
+
+template <> /*static*/ inline Sk4i SkNx_cast<int, float>(const Sk4f& src) {
+ return _mm_cvttps_epi32(src.fVec);
+}
template<> /*static*/ inline Sk4h SkNx_cast<uint16_t, float>(const Sk4f& src) {
auto _32 = _mm_cvttps_epi32(src.fVec);
« no previous file with comments | « no previous file | tests/SkNxTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698