OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkNx_DEFINED | 8 #ifndef SkNx_DEFINED |
9 #define SkNx_DEFINED | 9 #define SkNx_DEFINED |
10 | 10 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 typedef SkNx<2, float> Sk2f; | 192 typedef SkNx<2, float> Sk2f; |
193 typedef SkNx<4, float> Sk4f; | 193 typedef SkNx<4, float> Sk4f; |
194 typedef SkNx<2, SkScalar> Sk2s; | 194 typedef SkNx<2, SkScalar> Sk2s; |
195 typedef SkNx<4, SkScalar> Sk4s; | 195 typedef SkNx<4, SkScalar> Sk4s; |
196 | 196 |
197 typedef SkNx<4, uint8_t> Sk4b; | 197 typedef SkNx<4, uint8_t> Sk4b; |
198 typedef SkNx<16, uint8_t> Sk16b; | 198 typedef SkNx<16, uint8_t> Sk16b; |
199 typedef SkNx<4, uint16_t> Sk4h; | 199 typedef SkNx<4, uint16_t> Sk4h; |
200 typedef SkNx<16, uint16_t> Sk16h; | 200 typedef SkNx<16, uint16_t> Sk16h; |
201 | 201 |
| 202 typedef SkNx<4, int> Sk4i; |
| 203 |
202 // Include platform specific specializations if available. | 204 // Include platform specific specializations if available. |
203 #if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 | 205 #if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 |
204 #include "../opts/SkNx_sse.h" | 206 #include "../opts/SkNx_sse.h" |
205 #elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON) | 207 #elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON) |
206 #include "../opts/SkNx_neon.h" | 208 #include "../opts/SkNx_neon.h" |
207 #else | 209 #else |
208 static inline | 210 static inline |
209 void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c
, const Sk4f& d) { | 211 void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c
, const Sk4f& d) { |
210 SkNx_cast<uint8_t>(a).store(p+ 0); | 212 SkNx_cast<uint8_t>(a).store(p+ 0); |
211 SkNx_cast<uint8_t>(b).store(p+ 4); | 213 SkNx_cast<uint8_t>(b).store(p+ 4); |
212 SkNx_cast<uint8_t>(c).store(p+ 8); | 214 SkNx_cast<uint8_t>(c).store(p+ 8); |
213 SkNx_cast<uint8_t>(d).store(p+12); | 215 SkNx_cast<uint8_t>(d).store(p+12); |
214 } | 216 } |
215 #endif | 217 #endif |
216 | 218 |
217 #endif//SkNx_DEFINED | 219 #endif//SkNx_DEFINED |
OLD | NEW |