aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/opts
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-12-01 13:23:05 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-01 21:12:49 +0000
commit0cb75879a5923ead28083face7618f44c6c8cbfb (patch)
tree9affddb5a210b1b9b696210f3a0b542cee250998 /src/opts
parent51b20f266fbfa9d074bca9ce949d35f10340a9b4 (diff)
Add Store3 to Sk2f
Bug: skia: Change-Id: I0377e6a1dd8259e944f7902a5c68af524fa588c7 Reviewed-on: https://skia-review.googlesource.com/79382 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/opts')
-rw-r--r--src/opts/SkNx_neon.h9
-rw-r--r--src/opts/SkNx_sse.h7
2 files changed, 16 insertions, 0 deletions
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h
index b114f8f28a..8d1a249530 100644
--- a/src/opts/SkNx_neon.h
+++ b/src/opts/SkNx_neon.h
@@ -34,6 +34,15 @@ public:
AI static SkNx Load(const void* ptr) { return vld1_f32((const float*)ptr); }
AI void store(void* ptr) const { vst1_f32((float*)ptr, fVec); }
+ AI static void Store3(void* dst, const SkNx& a, const SkNx& b, const SkNx& c) {
+ float32x2x3_t abc = {{
+ a.fVec,
+ b.fVec,
+ c.fVec,
+ }};
+ vst3_f32((float*) dst, abc);
+ }
+
AI SkNx invert() const {
float32x2_t est0 = vrecpe_f32(fVec),
est1 = vmul_f32(vrecps_f32(est0, fVec), est0);
diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h
index a5432495eb..dc9a5944da 100644
--- a/src/opts/SkNx_sse.h
+++ b/src/opts/SkNx_sse.h
@@ -29,6 +29,13 @@ public:
AI void store(void* ptr) const { _mm_storel_pi((__m64*)ptr, fVec); }
+ AI static void Store3(void* dst, const SkNx& a, const SkNx& b, const SkNx& c) {
+ auto lo = _mm_setr_ps(a[0], b[0], c[0], a[1]),
+ hi = _mm_setr_ps(b[1], c[1], 0, 0);
+ _mm_storeu_ps((float*)dst, lo);
+ _mm_storel_pi(((__m64*)dst) + 2, hi);
+ }
+
AI SkNx operator - () const { return _mm_xor_ps(_mm_set1_ps(-0.0f), fVec); }
AI SkNx operator + (const SkNx& o) const { return _mm_add_ps(fVec, o.fVec); }