Lines Matching refs:AI

20 #define AI SK_ALWAYS_INLINE  macro
31 AI SkNx() = default;
32 AI SkNx(const Half& lo, const Half& hi) : fLo(lo), fHi(hi) {} in SkNx()
34 AI SkNx(T v) : fLo(v), fHi(v) {} in SkNx()
36 AI SkNx(T a, T b) : fLo(a) , fHi(b) { static_assert(N==2, ""); } in SkNx()
37 AI SkNx(T a, T b, T c, T d) : fLo(a,b), fHi(c,d) { static_assert(N==4, ""); } in SkNx()
38 AI 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) { in SkNx()
41 AI SkNx(T a, T b, T c, T d, T e, T f, T g, T h, in SkNx()
47 AI T operator[](int k) const {
52 AI static SkNx Load(const void* vptr) { in Load()
56 AI void store(void* vptr) const { in store()
62 AI static void Load4(const void* vptr, SkNx* a, SkNx* b, SkNx* c, SkNx* d) { in Load4()
73 AI static void Load3(const void* vptr, SkNx* a, SkNx* b, SkNx* c) { in Load3()
83 AI static void Load2(const void* vptr, SkNx* a, SkNx* b) { in Load2()
92 AI static void Store4(void* vptr, const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) { in Store4()
97 AI static void Store3(void* vptr, const SkNx& a, const SkNx& b, const SkNx& c) { in Store3()
102 AI static void Store2(void* vptr, const SkNx& a, const SkNx& b) { in Store2()
108 AI T min() const { return SkTMin(fLo.min(), fHi.min()); } in min()
109 AI T max() const { return SkTMax(fLo.max(), fHi.max()); } in max()
110 AI bool anyTrue() const { return fLo.anyTrue() || fHi.anyTrue(); } in anyTrue()
111 AI bool allTrue() const { return fLo.allTrue() && fHi.allTrue(); } in allTrue()
113 AI SkNx abs() const { return { fLo. abs(), fHi. abs() }; } in abs()
114 AI SkNx sqrt() const { return { fLo. sqrt(), fHi. sqrt() }; } in sqrt()
115 AI SkNx rsqrt() const { return { fLo. rsqrt(), fHi. rsqrt() }; } in rsqrt()
116 AI SkNx floor() const { return { fLo. floor(), fHi. floor() }; } in floor()
117 AI SkNx invert() const { return { fLo.invert(), fHi.invert() }; } in invert()
119 AI SkNx operator!() const { return { !fLo, !fHi }; }
120 AI SkNx operator-() const { return { -fLo, -fHi }; }
121 AI SkNx operator~() const { return { ~fLo, ~fHi }; }
123 AI SkNx operator<<(int bits) const { return { fLo << bits, fHi << bits }; }
124 AI SkNx operator>>(int bits) const { return { fLo >> bits, fHi >> bits }; }
126 AI SkNx operator+(const SkNx& y) const { return { fLo + y.fLo, fHi + y.fHi }; }
127 AI SkNx operator-(const SkNx& y) const { return { fLo - y.fLo, fHi - y.fHi }; }
128 AI SkNx operator*(const SkNx& y) const { return { fLo * y.fLo, fHi * y.fHi }; }
129 AI SkNx operator/(const SkNx& y) const { return { fLo / y.fLo, fHi / y.fHi }; }
131 AI SkNx operator&(const SkNx& y) const { return { fLo & y.fLo, fHi & y.fHi }; }
132 AI SkNx operator|(const SkNx& y) const { return { fLo | y.fLo, fHi | y.fHi }; }
133 AI SkNx operator^(const SkNx& y) const { return { fLo ^ y.fLo, fHi ^ y.fHi }; }
135 AI SkNx operator==(const SkNx& y) const { return { fLo == y.fLo, fHi == y.fHi }; }
136 AI SkNx operator!=(const SkNx& y) const { return { fLo != y.fLo, fHi != y.fHi }; }
137 AI SkNx operator<=(const SkNx& y) const { return { fLo <= y.fLo, fHi <= y.fHi }; }
138 AI SkNx operator>=(const SkNx& y) const { return { fLo >= y.fLo, fHi >= y.fHi }; }
139 AI SkNx operator< (const SkNx& y) const { return { fLo < y.fLo, fHi < y.fHi }; }
140 AI SkNx operator> (const SkNx& y) const { return { fLo > y.fLo, fHi > y.fHi }; }
142 AI SkNx saturatedAdd(const SkNx& y) const { in saturatedAdd()
146 AI SkNx mulHi(const SkNx& m) const { in mulHi()
149 AI SkNx thenElse(const SkNx& t, const SkNx& e) const { in thenElse()
152 AI static SkNx Min(const SkNx& x, const SkNx& y) { in Min()
155 AI static SkNx Max(const SkNx& x, const SkNx& y) { in Max()
165 AI SkNx() = default;
166 AI SkNx(T v) : fVal(v) {}
169 AI T operator[](int SkDEBUGCODE(k)) const {
174 AI static SkNx Load(const void* ptr) {
179 AI void store(void* ptr) const { memcpy(ptr, &fVal, sizeof(T)); }
181 AI static void Load4(const void* vptr, SkNx* a, SkNx* b, SkNx* c, SkNx* d) {
188 AI static void Load3(const void* vptr, SkNx* a, SkNx* b, SkNx* c) {
194 AI static void Load2(const void* vptr, SkNx* a, SkNx* b) {
199 AI static void Store4(void* vptr, const SkNx& a, const SkNx& b, const SkNx& c, const SkNx& d) {
206 AI static void Store3(void* vptr, const SkNx& a, const SkNx& b, const SkNx& c) {
212 AI static void Store2(void* vptr, const SkNx& a, const SkNx& b) {
218 AI T min() const { return fVal; }
219 AI T max() const { return fVal; }
220 AI bool anyTrue() const { return fVal != 0; }
221 AI bool allTrue() const { return fVal != 0; }
223 AI SkNx abs() const { return Abs(fVal); }
224 AI SkNx sqrt() const { return Sqrt(fVal); }
225 AI SkNx rsqrt() const { return T(1) / this->sqrt(); }
226 AI SkNx floor() const { return Floor(fVal); }
227 AI SkNx invert() const { return T(1) / *this; }
229 AI SkNx operator!() const { return !fVal; }
230 AI SkNx operator-() const { return -fVal; }
231 AI SkNx operator~() const { return FromBits(~ToBits(fVal)); }
233 AI SkNx operator<<(int bits) const { return fVal << bits; }
234 AI SkNx operator>>(int bits) const { return fVal >> bits; }
236 AI SkNx operator+(const SkNx& y) const { return fVal + y.fVal; }
237 AI SkNx operator-(const SkNx& y) const { return fVal - y.fVal; }
238 AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
239 AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
241 AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
242 AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
243 AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
245 AI SkNx operator==(const SkNx& y) const { return FromBits(fVal == y.fVal ? ~0 : 0); }
246 AI SkNx operator!=(const SkNx& y) const { return FromBits(fVal != y.fVal ? ~0 : 0); }
247 AI SkNx operator<=(const SkNx& y) const { return FromBits(fVal <= y.fVal ? ~0 : 0); }
248 AI SkNx operator>=(const SkNx& y) const { return FromBits(fVal >= y.fVal ? ~0 : 0); }
249 AI SkNx operator< (const SkNx& y) const { return FromBits(fVal < y.fVal ? ~0 : 0); }
250 AI SkNx operator> (const SkNx& y) const { return FromBits(fVal > y.fVal ? ~0 : 0); }
252 AI static SkNx Min(const SkNx& x, const SkNx& y) { return x.fVal < y.fVal ? x : y; }
253 AI static SkNx Max(const SkNx& x, const SkNx& y) { return x.fVal > y.fVal ? x : y; }
255 AI SkNx saturatedAdd(const SkNx& y) const {
261 AI SkNx mulHi(const SkNx& m) const {
267 AI SkNx thenElse(const SkNx& t, const SkNx& e) const { return fVal != 0 ? t : e; }
271 AI static int Abs(int val) { return val < 0 ? -val : val; }
273 AI static float Abs(float val) { return ::fabsf(val); }
274 AI static float Sqrt(float val) { return ::sqrtf(val); }
275 AI static float Floor(float val) { return ::floorf(val); }
277 AI static double Abs(double val) { return ::fabs(val); }
278 AI static double Sqrt(double val) { return ::sqrt(val); }
279 AI static double Floor(double val) { return ::floor(val); }
283 AI static U ToBits(U v) { return v; }
284 AI static int32_t ToBits(float v) { int32_t bits; memcpy(&bits, &v, sizeof(v)); return bits; }
285 AI static int64_t ToBits(double v) { int64_t bits; memcpy(&bits, &v, sizeof(v)); return bits; }
288 AI static T FromBits(Bits bits) {
299 #define V template <int N, typename T> AI static SkNx<N,T>
350 AI static void SkNx_split(const SkNx<N,T>& v, SkNx<N/2,T>* lo, SkNx<N/2,T>* hi) {
357 AI static SkNx<N*2,T> SkNx_join(const SkNx<N,T>& lo, const SkNx<N,T>& hi) {
368 AI static SkNx<sizeof...(Ix),T> SkNx_shuffle(const SkNx<N,T>& v) {
374 AI static SkNx<N,Dst> SkNx_cast(const SkNx<N,Src>& v) {
378 AI static SkNx<1,Dst> SkNx_cast(const SkNx<1,Src>& v) {
383 AI static SkNx<N,T> SkNx_fma(const SkNx<N,T>& f, const SkNx<N,T>& m, const SkNx<N,T>& a) {
418 AI static Sk4i Sk4f_round(const Sk4f& x) {
427 AI static void Sk4f_ToBytes(uint8_t p[16],
432 #undef AI