Index: src/opts/SkNx_sse.h |
diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h |
index f0ccd3f7b59128e9e5b7d23468e529ee3e687a68..a4f8656536c4bf3facdb7c5df769d81770f3800c 100644 |
--- a/src/opts/SkNx_sse.h |
+++ b/src/opts/SkNx_sse.h |
@@ -132,6 +132,15 @@ public: |
*(int*)bytes = _mm_cvtsi128_si32(fix8); |
} |
+ static void ToBytes(uint8_t bytes[16], |
+ const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) { |
+ _mm_storeu_si128((__m128i*)bytes, |
+ _mm_packus_epi16(_mm_packus_epi16(_mm_cvttps_epi32(a.fVec), |
+ _mm_cvttps_epi32(b.fVec)), |
+ _mm_packus_epi16(_mm_cvttps_epi32(c.fVec), |
+ _mm_cvttps_epi32(d.fVec)))); |
+ } |
+ |
SkNx operator + (const SkNx& o) const { return _mm_add_ps(fVec, o.fVec); } |
SkNx operator - (const SkNx& o) const { return _mm_sub_ps(fVec, o.fVec); } |
SkNx operator * (const SkNx& o) const { return _mm_mul_ps(fVec, o.fVec); } |