blob: b9b67704d4ce24fe40d384886b8f66a2ed070017 [file] [log] [blame]
mtklein3e490b72015-03-20 06:33:02 -07001/*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkNx_DEFINED
9#define SkNx_DEFINED
10
mtkleinc9adb052015-03-30 10:50:27 -070011
12#define SKNX_NO_SIMDx // Remove the x to disable SIMD for all SkNx types.
13
14
15#include "SkScalar.h"
16#include "SkTypes.h"
17#include <math.h>
18#define REQUIRE(x) static_assert(x, #x)
19
mtklein082e3292015-08-12 11:56:43 -070020// This file may be included multiple times by .cpp files with different flags, leading
21// to different definitions. Usually that doesn't matter because it's all inlined, but
22// in Debug modes the compilers may not inline everything. So wrap everything in an
23// anonymous namespace to give each includer their own silo of this code (or the linker
24// will probably pick one randomly for us, which is rarely correct).
25namespace {
26
mtklein8fe8fff2015-04-14 11:49:14 -070027// The default implementations just fall back on a pair of size N/2.
28
mtkleinc9adb052015-03-30 10:50:27 -070029template <int N, typename T>
mtklein6c221b42015-11-20 13:53:19 -080030class SkNx {
mtklein115acee2015-04-14 14:02:52 -070031public:
mtklein6c221b42015-11-20 13:53:19 -080032 SkNx() {}
33 SkNx(const SkNx<N/2, T>& lo, const SkNx<N/2, T>& hi) : fLo(lo), fHi(hi) {}
34 SkNx(T val) : fLo(val), fHi(val) {}
35 static SkNx Load(const T vals[N]) {
36 return SkNx(SkNx<N/2,T>::Load(vals), SkNx<N/2,T>::Load(vals+N/2));
mtklein115acee2015-04-14 14:02:52 -070037 }
38
mtklein6c221b42015-11-20 13:53:19 -080039 SkNx(T a, T b) : fLo(a), fHi(b) { REQUIRE(N==2); }
40 SkNx(T a, T b, T c, T d) : fLo(a,b), fHi(c,d) { REQUIRE(N==4); }
41 SkNx(T a, T b, T c, T d, T e, T f, T g, T h) : fLo(a,b,c,d), fHi(e,f,g,h) { REQUIRE(N==8); }
42 SkNx(T a, T b, T c, T d, T e, T f, T g, T h,
mtkleind2ffd362015-05-12 06:11:21 -070043 T i, T j, T k, T l, T m, T n, T o, T p)
44 : fLo(a,b,c,d, e,f,g,h), fHi(i,j,k,l, m,n,o,p) { REQUIRE(N==16); }
mtklein115acee2015-04-14 14:02:52 -070045
46 void store(T vals[N]) const {
47 fLo.store(vals);
48 fHi.store(vals+N/2);
49 }
50
mtklein6c221b42015-11-20 13:53:19 -080051 SkNx saturatedAdd(const SkNx& o) const {
52 return SkNx(fLo.saturatedAdd(o.fLo), fHi.saturatedAdd(o.fHi));
mtklein6cbf18c2015-05-12 15:48:09 -070053 }
54
mtklein6c221b42015-11-20 13:53:19 -080055 SkNx operator + (const SkNx& o) const { return SkNx(fLo + o.fLo, fHi + o.fHi); }
56 SkNx operator - (const SkNx& o) const { return SkNx(fLo - o.fLo, fHi - o.fHi); }
57 SkNx operator * (const SkNx& o) const { return SkNx(fLo * o.fLo, fHi * o.fHi); }
mtklein115acee2015-04-14 14:02:52 -070058
mtklein6c221b42015-11-20 13:53:19 -080059 SkNx operator << (int bits) const { return SkNx(fLo << bits, fHi << bits); }
60 SkNx operator >> (int bits) const { return SkNx(fLo >> bits, fHi >> bits); }
mtklein115acee2015-04-14 14:02:52 -070061
mtklein6c221b42015-11-20 13:53:19 -080062 static SkNx Min(const SkNx& a, const SkNx& b) {
63 return SkNx(SkNx<N/2, T>::Min(a.fLo, b.fLo), SkNx<N/2, T>::Min(a.fHi, b.fHi));
mtklein27e517a2015-05-14 17:53:04 -070064 }
mtklein6c221b42015-11-20 13:53:19 -080065 SkNx operator < (const SkNx& o) const { return SkNx(fLo < o.fLo, fHi < o.fHi); }
mtklein115acee2015-04-14 14:02:52 -070066
67 template <int k> T kth() const {
68 SkASSERT(0 <= k && k < N);
69 return k < N/2 ? fLo.template kth<k>() : fHi.template kth<k-N/2>();
70 }
71
mtkleinb5e86112015-06-24 15:18:39 -070072 bool allTrue() const { return fLo.allTrue() && fHi.allTrue(); }
73 bool anyTrue() const { return fLo.anyTrue() || fHi.anyTrue(); }
mtklein6c221b42015-11-20 13:53:19 -080074 SkNx thenElse(const SkNx& t, const SkNx& e) const {
75 return SkNx(fLo.thenElse(t.fLo, e.fLo), fHi.thenElse(t.fHi, e.fHi));
mtkleinb5e86112015-06-24 15:18:39 -070076 }
77
mtkleind2ffd362015-05-12 06:11:21 -070078protected:
mtklein115acee2015-04-14 14:02:52 -070079 REQUIRE(0 == (N & (N-1)));
mtklein115acee2015-04-14 14:02:52 -070080
mtklein6c221b42015-11-20 13:53:19 -080081 SkNx<N/2, T> fLo, fHi;
mtklein115acee2015-04-14 14:02:52 -070082};
83
mtklein6f797092015-11-09 08:33:53 -080084template <int N>
mtklein6c221b42015-11-20 13:53:19 -080085class SkNx<N,float> {
mtkleinc9adb052015-03-30 10:50:27 -070086public:
mtklein6c221b42015-11-20 13:53:19 -080087 SkNx() {}
88 SkNx(float val) : fLo(val), fHi(val) {}
89 static SkNx Load(const float vals[N]) {
90 return SkNx(SkNx<N/2, float>::Load(vals), SkNx<N/2, float>::Load(vals+N/2));
mtkleinc9adb052015-03-30 10:50:27 -070091 }
mtkleinaba1dc82015-08-31 14:39:59 -070092 // FromBytes() and toBytes() specializations may assume their argument is N-byte aligned.
93 // E.g. Sk4f::FromBytes() may assume it's reading from a 4-byte-aligned pointer.
94 // Converts [0,255] bytes to [0.0, 255.0] floats.
mtklein6c221b42015-11-20 13:53:19 -080095 static SkNx FromBytes(const uint8_t bytes[N]) {
96 return SkNx(SkNx<N/2, float>::FromBytes(bytes), SkNx<N/2, float>::FromBytes(bytes+N/2));
mtkleinaba1dc82015-08-31 14:39:59 -070097 }
mtkleinc9adb052015-03-30 10:50:27 -070098
mtklein6c221b42015-11-20 13:53:19 -080099 SkNx(float a, float b) : fLo(a), fHi(b) { REQUIRE(N==2); }
100 SkNx(float a, float b, float c, float d) : fLo(a,b), fHi(c,d) { REQUIRE(N==4); }
101 SkNx(float a, float b, float c, float d, float e, float f, float g, float h)
mtklein6f797092015-11-09 08:33:53 -0800102 : fLo(a,b,c,d)
103 , fHi(e,f,g,h) { REQUIRE(N==8); }
mtkleinc9adb052015-03-30 10:50:27 -0700104
mtklein6f797092015-11-09 08:33:53 -0800105 void store(float vals[N]) const {
mtkleinc9adb052015-03-30 10:50:27 -0700106 fLo.store(vals);
107 fHi.store(vals+N/2);
108 }
mtkleinaba1dc82015-08-31 14:39:59 -0700109 // Please see note on FromBytes().
mtkleina508f3c2015-09-01 06:29:45 -0700110 // Clamps to [0.0,255.0] floats and truncates to [0,255] bytes.
mtkleinaba1dc82015-08-31 14:39:59 -0700111 void toBytes(uint8_t bytes[N]) const {
112 fLo.toBytes(bytes);
113 fHi.toBytes(bytes+N/2);
114 }
mtkleinc9adb052015-03-30 10:50:27 -0700115
mtklein6c221b42015-11-20 13:53:19 -0800116 SkNx operator + (const SkNx& o) const { return SkNx(fLo + o.fLo, fHi + o.fHi); }
117 SkNx operator - (const SkNx& o) const { return SkNx(fLo - o.fLo, fHi - o.fHi); }
118 SkNx operator * (const SkNx& o) const { return SkNx(fLo * o.fLo, fHi * o.fHi); }
119 SkNx operator / (const SkNx& o) const { return SkNx(fLo / o.fLo, fHi / o.fHi); }
mtkleinc9adb052015-03-30 10:50:27 -0700120
mtklein6c221b42015-11-20 13:53:19 -0800121 SkNx operator == (const SkNx& o) const { return SkNx(fLo == o.fLo, fHi == o.fHi); }
122 SkNx operator != (const SkNx& o) const { return SkNx(fLo != o.fLo, fHi != o.fHi); }
123 SkNx operator < (const SkNx& o) const { return SkNx(fLo < o.fLo, fHi < o.fHi); }
124 SkNx operator > (const SkNx& o) const { return SkNx(fLo > o.fLo, fHi > o.fHi); }
125 SkNx operator <= (const SkNx& o) const { return SkNx(fLo <= o.fLo, fHi <= o.fHi); }
126 SkNx operator >= (const SkNx& o) const { return SkNx(fLo >= o.fLo, fHi >= o.fHi); }
mtkleinc9adb052015-03-30 10:50:27 -0700127
mtklein6c221b42015-11-20 13:53:19 -0800128 static SkNx Min(const SkNx& l, const SkNx& r) {
129 return SkNx(SkNx<N/2, float>::Min(l.fLo, r.fLo), SkNx<N/2, float>::Min(l.fHi, r.fHi));
mtkleinc9adb052015-03-30 10:50:27 -0700130 }
mtklein6c221b42015-11-20 13:53:19 -0800131 static SkNx Max(const SkNx& l, const SkNx& r) {
132 return SkNx(SkNx<N/2, float>::Max(l.fLo, r.fLo), SkNx<N/2, float>::Max(l.fHi, r.fHi));
mtkleinc9adb052015-03-30 10:50:27 -0700133 }
134
mtklein6c221b42015-11-20 13:53:19 -0800135 SkNx sqrt() const { return SkNx(fLo. sqrt(), fHi. sqrt()); }
mtkleind7c014f2015-04-27 14:22:32 -0700136
137 // Generally, increasing precision, increasing cost.
mtklein6c221b42015-11-20 13:53:19 -0800138 SkNx rsqrt0() const { return SkNx(fLo.rsqrt0(), fHi.rsqrt0()); }
139 SkNx rsqrt1() const { return SkNx(fLo.rsqrt1(), fHi.rsqrt1()); }
140 SkNx rsqrt2() const { return SkNx(fLo.rsqrt2(), fHi.rsqrt2()); }
mtkleinc9adb052015-03-30 10:50:27 -0700141
mtklein6c221b42015-11-20 13:53:19 -0800142 SkNx invert() const { return SkNx(fLo. invert(), fHi. invert()); }
143 SkNx approxInvert() const { return SkNx(fLo.approxInvert(), fHi.approxInvert()); }
mtkleinc9adb052015-03-30 10:50:27 -0700144
mtklein6f797092015-11-09 08:33:53 -0800145 template <int k> float kth() const {
mtkleinc9adb052015-03-30 10:50:27 -0700146 SkASSERT(0 <= k && k < N);
mtkleina156a8f2015-04-03 06:16:13 -0700147 return k < N/2 ? fLo.template kth<k>() : fHi.template kth<k-N/2>();
mtkleinc9adb052015-03-30 10:50:27 -0700148 }
149
mtkleinb5e86112015-06-24 15:18:39 -0700150 bool allTrue() const { return fLo.allTrue() && fHi.allTrue(); }
151 bool anyTrue() const { return fLo.anyTrue() || fHi.anyTrue(); }
mtklein6c221b42015-11-20 13:53:19 -0800152 SkNx thenElse(const SkNx& t, const SkNx& e) const {
153 return SkNx(fLo.thenElse(t.fLo, e.fLo), fHi.thenElse(t.fHi, e.fHi));
mtkleinb5e86112015-06-24 15:18:39 -0700154 }
155
mtkleind2ffd362015-05-12 06:11:21 -0700156protected:
mtkleinc9adb052015-03-30 10:50:27 -0700157 REQUIRE(0 == (N & (N-1)));
mtklein6c221b42015-11-20 13:53:19 -0800158 SkNx(const SkNx<N/2, float>& lo, const SkNx<N/2, float>& hi) : fLo(lo), fHi(hi) {}
mtkleinc9adb052015-03-30 10:50:27 -0700159
mtklein6c221b42015-11-20 13:53:19 -0800160 SkNx<N/2, float> fLo, fHi;
mtkleinc9adb052015-03-30 10:50:27 -0700161};
162
163
mtklein8fe8fff2015-04-14 11:49:14 -0700164// Bottom out the default implementations with scalars when nothing's been specialized.
mtkleinc9adb052015-03-30 10:50:27 -0700165
mtkleinc9adb052015-03-30 10:50:27 -0700166template <typename T>
mtklein6c221b42015-11-20 13:53:19 -0800167class SkNx<1,T> {
mtklein115acee2015-04-14 14:02:52 -0700168public:
mtklein6c221b42015-11-20 13:53:19 -0800169 SkNx() {}
170 SkNx(T val) : fVal(val) {}
171 static SkNx Load(const T vals[1]) { return SkNx(vals[0]); }
mtklein115acee2015-04-14 14:02:52 -0700172
173 void store(T vals[1]) const { vals[0] = fVal; }
174
mtklein6c221b42015-11-20 13:53:19 -0800175 SkNx saturatedAdd(const SkNx& o) const {
mtklein6cbf18c2015-05-12 15:48:09 -0700176 SkASSERT((T)(~0) > 0); // TODO: support signed T
177 T sum = fVal + o.fVal;
mtklein6c221b42015-11-20 13:53:19 -0800178 return SkNx(sum < fVal ? (T)(~0) : sum);
mtklein6cbf18c2015-05-12 15:48:09 -0700179 }
180
mtklein6c221b42015-11-20 13:53:19 -0800181 SkNx operator + (const SkNx& o) const { return SkNx(fVal + o.fVal); }
182 SkNx operator - (const SkNx& o) const { return SkNx(fVal - o.fVal); }
183 SkNx operator * (const SkNx& o) const { return SkNx(fVal * o.fVal); }
mtklein115acee2015-04-14 14:02:52 -0700184
mtklein6c221b42015-11-20 13:53:19 -0800185 SkNx operator << (int bits) const { return SkNx(fVal << bits); }
186 SkNx operator >> (int bits) const { return SkNx(fVal >> bits); }
mtklein115acee2015-04-14 14:02:52 -0700187
mtklein6c221b42015-11-20 13:53:19 -0800188 static SkNx Min(const SkNx& a, const SkNx& b) { return SkNx(SkTMin(a.fVal, b.fVal)); }
189 SkNx operator <(const SkNx& o) const { return SkNx(fVal < o.fVal); }
mtklein27e517a2015-05-14 17:53:04 -0700190
mtklein115acee2015-04-14 14:02:52 -0700191 template <int k> T kth() const {
192 SkASSERT(0 == k);
193 return fVal;
194 }
195
mtkleinb5e86112015-06-24 15:18:39 -0700196 bool allTrue() const { return fVal; }
197 bool anyTrue() const { return fVal; }
mtklein6c221b42015-11-20 13:53:19 -0800198 SkNx thenElse(const SkNx& t, const SkNx& e) const { return fVal ? t : e; }
mtkleinb5e86112015-06-24 15:18:39 -0700199
mtkleind2ffd362015-05-12 06:11:21 -0700200protected:
mtklein115acee2015-04-14 14:02:52 -0700201 T fVal;
202};
203
mtklein6f797092015-11-09 08:33:53 -0800204template <>
mtklein6c221b42015-11-20 13:53:19 -0800205class SkNx<1,float> {
mtkleinc9adb052015-03-30 10:50:27 -0700206public:
mtklein6c221b42015-11-20 13:53:19 -0800207 SkNx() {}
208 SkNx(float val) : fVal(val) {}
209 static SkNx Load(const float vals[1]) { return SkNx(vals[0]); }
210 static SkNx FromBytes(const uint8_t bytes[1]) { return SkNx((float)bytes[0]); }
mtkleinc9adb052015-03-30 10:50:27 -0700211
mtklein6f797092015-11-09 08:33:53 -0800212 void store(float vals[1]) const { vals[0] = fVal; }
213 void toBytes(uint8_t bytes[1]) const { bytes[0] = (uint8_t)(SkTMin(fVal, 255.0f)); }
mtklein1113da72015-04-27 12:08:01 -0700214
mtklein6c221b42015-11-20 13:53:19 -0800215 SkNx operator + (const SkNx& o) const { return SkNx(fVal + o.fVal); }
216 SkNx operator - (const SkNx& o) const { return SkNx(fVal - o.fVal); }
217 SkNx operator * (const SkNx& o) const { return SkNx(fVal * o.fVal); }
218 SkNx operator / (const SkNx& o) const { return SkNx(fVal / o.fVal); }
mtkleinc9adb052015-03-30 10:50:27 -0700219
mtklein6c221b42015-11-20 13:53:19 -0800220 SkNx operator == (const SkNx& o) const { return SkNx(fVal == o.fVal); }
221 SkNx operator != (const SkNx& o) const { return SkNx(fVal != o.fVal); }
222 SkNx operator < (const SkNx& o) const { return SkNx(fVal < o.fVal); }
223 SkNx operator > (const SkNx& o) const { return SkNx(fVal > o.fVal); }
224 SkNx operator <= (const SkNx& o) const { return SkNx(fVal <= o.fVal); }
225 SkNx operator >= (const SkNx& o) const { return SkNx(fVal >= o.fVal); }
mtkleinc9adb052015-03-30 10:50:27 -0700226
mtklein6c221b42015-11-20 13:53:19 -0800227 static SkNx Min(const SkNx& l, const SkNx& r) { return SkNx(SkTMin(l.fVal, r.fVal)); }
228 static SkNx Max(const SkNx& l, const SkNx& r) { return SkNx(SkTMax(l.fVal, r.fVal)); }
mtkleinc9adb052015-03-30 10:50:27 -0700229
mtklein6c221b42015-11-20 13:53:19 -0800230 SkNx sqrt() const { return SkNx(sqrtf(fVal)); }
231 SkNx rsqrt0() const { return SkNx(1.0f / sqrtf(fVal)); }
232 SkNx rsqrt1() const { return this->rsqrt0(); }
233 SkNx rsqrt2() const { return this->rsqrt1(); }
mtkleinc9adb052015-03-30 10:50:27 -0700234
mtklein6c221b42015-11-20 13:53:19 -0800235 SkNx invert() const { return SkNx(1.0f / fVal); }
236 SkNx approxInvert() const { return this->invert(); }
mtkleinc9adb052015-03-30 10:50:27 -0700237
mtklein6f797092015-11-09 08:33:53 -0800238 template <int k> float kth() const {
mtkleinc9adb052015-03-30 10:50:27 -0700239 SkASSERT(k == 0);
240 return fVal;
241 }
242
mtklein6f797092015-11-09 08:33:53 -0800243 bool allTrue() const { return this->pun() != 0; }
244 bool anyTrue() const { return this->pun() != 0; }
mtklein6c221b42015-11-20 13:53:19 -0800245 SkNx thenElse(const SkNx& t, const SkNx& e) const { return this->pun() ? t : e; }
mtkleinb5e86112015-06-24 15:18:39 -0700246
mtkleind2ffd362015-05-12 06:11:21 -0700247protected:
mtklein6f797092015-11-09 08:33:53 -0800248 uint32_t pun() const {
249 union { float f; uint32_t i; } pun = { fVal };
mtkleinb5e86112015-06-24 15:18:39 -0700250 return pun.i;
251 }
252
mtklein6f797092015-11-09 08:33:53 -0800253 float fVal;
mtkleinc9adb052015-03-30 10:50:27 -0700254};
255
mtkleina1c0ee42015-09-10 14:16:07 -0700256// This default implementation can be specialized by ../opts/SkNx_foo.h
257// if there's a better platform-specific shuffle strategy.
mtklein6c221b42015-11-20 13:53:19 -0800258template <typename Nx, int... Ix>
259inline Nx SkNx_shuffle_impl(const Nx& src) { return Nx( src.template kth<Ix>()... ); }
mtkleina1c0ee42015-09-10 14:16:07 -0700260
mtklein6c221b42015-11-20 13:53:19 -0800261// This generic shuffle can be called with 1 or N indices:
mtkleina1c0ee42015-09-10 14:16:07 -0700262// Sk4f f(a,b,c,d);
263// SkNx_shuffle<3>(f); // ~~~> Sk4f(d,d,d,d)
264// SkNx_shuffle<2,1,0,3>(f); // ~~~> Sk4f(c,b,a,d)
mtklein6c221b42015-11-20 13:53:19 -0800265template <int... Ix, typename Nx>
266inline Nx SkNx_shuffle(const Nx& src) { return SkNx_shuffle_impl<Nx, Ix...>(src); }
mtkleina1c0ee42015-09-10 14:16:07 -0700267
268// A reminder alias that shuffles can be used to duplicate a single index across a vector.
mtklein6c221b42015-11-20 13:53:19 -0800269template <int Ix, typename Nx>
270inline Nx SkNx_dup(const Nx& src) { return SkNx_shuffle<Ix>(src); }
271
272// This is a poor-man's std::make_index_sequence from C++14.
273// I'd implement it fully, but it hurts my head.
274template <int...> struct SkIntSequence {};
275template <int N> struct MakeSkIntSequence;
276template <> struct MakeSkIntSequence< 1> : SkIntSequence<0 >{};
277template <> struct MakeSkIntSequence< 2> : SkIntSequence<0,1 >{};
278template <> struct MakeSkIntSequence< 4> : SkIntSequence<0,1,2,3 >{};
279template <> struct MakeSkIntSequence< 8> : SkIntSequence<0,1,2,3,4,5,6,7 >{};
280template <> struct MakeSkIntSequence<16> : SkIntSequence<0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15>{};
281
282// This is the default/fallback implementation for SkNx_cast. Best to specialize SkNx_cast!
283template <typename D, typename S, int N, int... Ix>
284SkNx<N,D> SkNx_cast_fallback(const SkNx<N,S>& src, SkIntSequence<Ix...>) {
285 return SkNx<N,D>( (D)src.template kth<Ix>()... );
286}
287
288// This is a generic cast between two SkNx with the same number of elements N. E.g.
289// Sk4b bs = ...; // Load 4 bytes.
290// Sk4f fs = SkNx_cast<float>(bs); // (This will replace SkNf::FromBytes() one day.)
291// Sk4i is = SkNx_cast<int>(fs); // Cast each float to int.
292// This can be specialized in ../opts/SkNx_foo.h if there's a better platform-specific cast.
293template <typename D, typename S, int N>
294SkNx<N,D> SkNx_cast(const SkNx<N,S>& src) {
295 return SkNx_cast_fallback<D,S,N>(src, MakeSkIntSequence<N>());
296}
mtkleina1c0ee42015-09-10 14:16:07 -0700297
mtklein082e3292015-08-12 11:56:43 -0700298} // namespace
299
mtkleina1c0ee42015-09-10 14:16:07 -0700300
mtkleinc9adb052015-03-30 10:50:27 -0700301// Include platform specific specializations if available.
302#ifndef SKNX_NO_SIMD
mtklein084db252015-11-11 11:39:09 -0800303 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_AVX
304 #include "../opts/SkNx_avx.h"
305 #elif SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
mtkleinc9adb052015-03-30 10:50:27 -0700306 #include "../opts/SkNx_sse.h"
307 #elif defined(SK_ARM_HAS_NEON)
308 #include "../opts/SkNx_neon.h"
309 #endif
310#endif
311
312#undef REQUIRE
313
mtklein6c221b42015-11-20 13:53:19 -0800314typedef SkNx<2, float> Sk2f;
315typedef SkNx<2, float> Sk2s;
316typedef SkNx<4, float> Sk4f;
317typedef SkNx<4, float> Sk4s;
318typedef SkNx<8, float> Sk8f;
319typedef SkNx<8, float> Sk8s;
mtkleinc9adb052015-03-30 10:50:27 -0700320
mtklein6c221b42015-11-20 13:53:19 -0800321typedef SkNx<8, uint16_t> Sk8h;
322typedef SkNx<16, uint16_t> Sk16h;
323typedef SkNx<16, uint8_t> Sk16b;
324
325typedef SkNx<4, int> Sk4i;
mtklein1113da72015-04-27 12:08:01 -0700326
mtklein3e490b72015-03-20 06:33:02 -0700327#endif//SkNx_DEFINED