diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-04-08 23:58:43 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-09 11:43:04 +0000 |
commit | 42f02aa4e344572ef280571594208ad61cea4567 (patch) | |
tree | 242bd4c66829ad6daf416b426dbceed9a41487fb /src/opts | |
parent | e697500577c53f5d5856211a3b0f7031f1c387d1 (diff) |
Implement Sk2f::Store2
Bug: skia:
Change-Id: Ifea5957458e5547ee428809d9599286e70f3f8f9
Reviewed-on: https://skia-review.googlesource.com/119860
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/opts')
-rw-r--r-- | src/opts/SkNx_neon.h | 8 | ||||
-rw-r--r-- | src/opts/SkNx_sse.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/opts/SkNx_neon.h b/src/opts/SkNx_neon.h index 52247c8f66..232903ab67 100644 --- a/src/opts/SkNx_neon.h +++ b/src/opts/SkNx_neon.h @@ -34,6 +34,14 @@ 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 Store2(void* dst, const SkNx& a, const SkNx& b) { + float32x2x2_t ab = {{ + a.fVec, + b.fVec, + }}; + vst2_f32((float*) dst, ab); + } + AI static void Store3(void* dst, const SkNx& a, const SkNx& b, const SkNx& c) { float32x2x3_t abc = {{ a.fVec, diff --git a/src/opts/SkNx_sse.h b/src/opts/SkNx_sse.h index b4ae0cbe2b..bd5c58e261 100644 --- a/src/opts/SkNx_sse.h +++ b/src/opts/SkNx_sse.h @@ -29,6 +29,11 @@ public: AI void store(void* ptr) const { _mm_storel_pi((__m64*)ptr, fVec); } + AI static void Store2(void* dst, const SkNx& a, const SkNx& b) { + auto vals = _mm_unpacklo_ps(a.fVec, b.fVec); + _mm_storeu_ps((float*)dst, vals); + } + 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); |