| 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_neon_DEFINED | 8 #ifndef SkNx_neon_DEFINED |
| 9 #define SkNx_neon_DEFINED | 9 #define SkNx_neon_DEFINED |
| 10 | 10 |
| 11 #define SKNX_IS_FAST |
| 12 |
| 11 namespace { // See SkNx.h | 13 namespace { // See SkNx.h |
| 12 | 14 |
| 13 // Well, this is absurd. The shifts require compile-time constant arguments. | 15 // Well, this is absurd. The shifts require compile-time constant arguments. |
| 14 | 16 |
| 15 #define SHIFT8(op, v, bits) switch(bits) { \ | 17 #define SHIFT8(op, v, bits) switch(bits) { \ |
| 16 case 1: return op(v, 1); case 2: return op(v, 2); case 3: return op(v
, 3); \ | 18 case 1: return op(v, 1); case 2: return op(v, 2); case 3: return op(v
, 3); \ |
| 17 case 4: return op(v, 4); case 5: return op(v, 5); case 6: return op(v
, 6); \ | 19 case 4: return op(v, 4); case 5: return op(v, 5); case 6: return op(v
, 6); \ |
| 18 case 7: return op(v, 7); \ | 20 case 7: return op(v, 7); \ |
| 19 } return fVec | 21 } return fVec |
| 20 | 22 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 #undef SHIFT8 | 322 #undef SHIFT8 |
| 321 | 323 |
| 322 template<> | 324 template<> |
| 323 inline SkNx<4, int> SkNx_cast<int, float, 4>(const SkNx<4, float>& src) { | 325 inline SkNx<4, int> SkNx_cast<int, float, 4>(const SkNx<4, float>& src) { |
| 324 return vcvtq_s32_f32(src.fVec); | 326 return vcvtq_s32_f32(src.fVec); |
| 325 } | 327 } |
| 326 | 328 |
| 327 } // namespace | 329 } // namespace |
| 328 | 330 |
| 329 #endif//SkNx_neon_DEFINED | 331 #endif//SkNx_neon_DEFINED |
| OLD | NEW |