diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-02-06 17:55:30 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-07 05:06:15 +0000 |
commit | 6f8fa4e6ca8b21577ae7bdf6874647d1f6b65785 (patch) | |
tree | 3dbd6fd438d800b1a035e38e6aee96a8bb53d361 /src | |
parent | 9ff8c8c073ba553dc8b22bb9aacc23949292f72f (diff) |
Implement Sk2f::Store4
Bug: skia:
Change-Id: I2adb983d68625d327e7c00e53b6ae4703b46252f
Reviewed-on: https://skia-review.googlesource.com/104761
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/opts/SkNx_neon.h | 10 | ||||
-rw-r--r-- | src/opts/SkNx_sse.h | 7 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h index 8d1a249530..f8170ef962 100644 --- a/src/opts/SkNx_neon.h +++ b/src/opts/SkNx_neon.h @@ -43,6 +43,16 @@ public: vst3_f32((float*) dst, abc); } + AI static void Store4(void* dst, const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) { + float32x2x4_t abcd = {{ + a.fVec, + b.fVec, + c.fVec, + d.fVec, + }}; + vst4_f32((float*) dst, abcd); + } + 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 dc9a5944da..3b530f0e78 100644 --- a/src/opts/SkNx_sse.h +++ b/src/opts/SkNx_sse.h @@ -36,6 +36,13 @@ public: _mm_storel_pi(((__m64*)dst) + 2, hi); } + AI static void Store4(void* dst, const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) { + auto lo = _mm_setr_ps(a[0], b[0], c[0], d[0]), + hi = _mm_setr_ps(a[1], b[1], c[1], d[1]); + _mm_storeu_ps((float*)dst, lo); + _mm_storeu_ps(((float*)dst) + 4, 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); } |